diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-01 06:12:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-01 06:12:53 +0400 |
commit | 2365c64014b3e067bb212b2061f1d14c1f944090 (patch) | |
tree | ccf060ca327a060e524ec92bba3622d9a1139a64 /source/gameengine/GameLogic | |
parent | 00143a3d557d87dda2bb7074dfe2b1a3acf5f28f (diff) |
whitespace bge edits
Diffstat (limited to 'source/gameengine/GameLogic')
-rw-r--r-- | source/gameengine/GameLogic/SCA_2DFilterActuator.cpp | 32 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_ISensor.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_MouseSensor.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp | 78 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_RandomSensor.cpp | 30 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_XORController.cpp | 8 |
7 files changed, 84 insertions, 84 deletions
diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index c270d9a312b..7c1824cd4eb 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -40,20 +40,20 @@ SCA_2DFilterActuator::~SCA_2DFilterActuator() } SCA_2DFilterActuator::SCA_2DFilterActuator( - SCA_IObject *gameobj, + SCA_IObject *gameobj, RAS_2DFilterManager::RAS_2DFILTER_MODE type, - short flag, - float float_arg, - int int_arg, - RAS_IRasterizer* rasterizer, - SCA_IScene* scene) + short flag, + float float_arg, + int int_arg, + RAS_IRasterizer* rasterizer, + SCA_IScene* scene) : SCA_IActuator(gameobj, KX_ACT_2DFILTER), - m_type(type), - m_disableMotionBlur(flag), - m_float_arg(float_arg), - m_int_arg(int_arg), - m_rasterizer(rasterizer), - m_scene(scene) + m_type(type), + m_disableMotionBlur(flag), + m_float_arg(float_arg), + m_int_arg(int_arg), + m_rasterizer(rasterizer), + m_scene(scene) { m_gameobj = NULL; if(gameobj){ @@ -65,9 +65,9 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( CValue* SCA_2DFilterActuator::GetReplica() { - SCA_2DFilterActuator* replica = new SCA_2DFilterActuator(*this); - replica->ProcessReplica(); - return replica; + SCA_2DFilterActuator* replica = new SCA_2DFilterActuator(*this); + replica->ProcessReplica(); + return replica; } @@ -94,7 +94,7 @@ bool SCA_2DFilterActuator::Update() m_scene->Update2DFilter(m_propNames, m_gameobj, m_type, m_int_arg, m_shaderText); } // once the filter is in place, no need to update it again => disable the actuator - return false; + return false; } diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 0d09e33a81b..85982bd3c0f 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -216,8 +216,8 @@ void SCA_ISensor::UnregisterToManager() void SCA_ISensor::ActivateControllers(class SCA_LogicManager* logicmgr) { - for(vector<SCA_IController*>::const_iterator c= m_linkedcontrollers.begin(); - c!=m_linkedcontrollers.end();++c) + for(vector<SCA_IController*>::const_iterator c= m_linkedcontrollers.begin(); + c!=m_linkedcontrollers.end();++c) { SCA_IController* contr = *c; if (contr->IsActive()) diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 513be43ec28..a2374ccb9da 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -132,7 +132,7 @@ bool SCA_KeyboardSensor::Evaluate() // cerr << "SCA_KeyboardSensor::Eval event, sensing for "<< m_hotkey << " at device " << inputdev << "\n"; /* See if we need to do logging: togPropState exists and is - * different from 0 */ + * different from 0 */ CValue* myparent = GetParent(); CValue* togPropState = myparent->GetProperty(m_toggleprop); if (togPropState && @@ -400,7 +400,7 @@ void SCA_KeyboardSensor::LogKeystrokes(void) int index = 0; /* Check on all keys whether they were pushed. This does not - * untangle the ordering, so don't type too fast :) */ + * untangle the ordering, so don't type too fast :) */ for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++) { const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i); diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index a1836163e9c..93d2ae2c1c5 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -50,12 +50,12 @@ /* ------------------------------------------------------------------------- */ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr, - int startx,int starty, - short int mousemode, - SCA_IObject* gameobj) + int startx,int starty, + short int mousemode, + SCA_IObject* gameobj) : SCA_ISensor(gameobj,eventmgr), - m_x(startx), - m_y(starty) + m_x(startx), + m_y(starty) { m_mousemode = mousemode; m_triggermode = true; @@ -72,7 +72,7 @@ void SCA_MouseSensor::Init() SCA_MouseSensor::~SCA_MouseSensor() { - /* Nothing to be done here. */ + /* Nothing to be done here. */ } void SCA_MouseSensor::UpdateHotkey(void *self) diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp index 06c24c8211b..67af6237a8d 100644 --- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp @@ -68,12 +68,12 @@ SCA_RandomNumberGenerator::~SCA_RandomNumberGenerator() { void SCA_RandomNumberGenerator::SetStartVector(void) { /* setting initial seeds to mt[N] using */ - /* the generator Line 25 of Table 1 in */ - /* [KNUTH 1981, The Art of Computer Programming */ - /* Vol. 2 (2nd Ed.), pp102] */ - mt[0] = m_seed & 0xffffffff; - for (mti = 1; mti < N; mti++) - mt[mti] = (69069 * mt[mti-1]) & 0xffffffff; + /* the generator Line 25 of Table 1 in */ + /* [KNUTH 1981, The Art of Computer Programming */ + /* Vol. 2 (2nd Ed.), pp102] */ + mt[0] = m_seed & 0xffffffff; + for (mti = 1; mti < N; mti++) + mt[mti] = (69069 * mt[mti-1]) & 0xffffffff; } long SCA_RandomNumberGenerator::GetSeed() { return m_seed; } @@ -87,39 +87,39 @@ void SCA_RandomNumberGenerator::SetSeed(long newseed) * This is the important part: copied verbatim :) */ unsigned long SCA_RandomNumberGenerator::Draw() { - static unsigned long mag01[2] = { 0x0, MATRIX_A }; - /* mag01[x] = x * MATRIX_A for x=0,1 */ - - unsigned long y; - - if (mti >= N) { /* generate N words at one time */ - int kk; - - /* I set this in the constructor, so it is always satisfied ! */ -// if (mti == N+1) /* if sgenrand() has not been called, */ -// GEN_srand(4357); /* a default initial seed is used */ - - for (kk = 0; kk < N - M; kk++) { - y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK); - mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1]; - } - for (; kk < N-1; kk++) { - y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK); - mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1]; - } - y = (mt[N-1] & UPPER_MASK) | (mt[0] & LOWER_MASK); - mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1]; - - mti = 0; - } - - y = mt[mti++]; - y ^= TEMPERING_SHIFT_U(y); - y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B; - y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C; - y ^= TEMPERING_SHIFT_L(y); - - return y; + static unsigned long mag01[2] = { 0x0, MATRIX_A }; + /* mag01[x] = x * MATRIX_A for x=0,1 */ + + unsigned long y; + + if (mti >= N) { /* generate N words at one time */ + int kk; + + /* I set this in the constructor, so it is always satisfied ! */ + // if (mti == N+1) /* if sgenrand() has not been called, */ + // GEN_srand(4357); /* a default initial seed is used */ + + for (kk = 0; kk < N - M; kk++) { + y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK); + mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1]; + } + for (; kk < N-1; kk++) { + y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK); + mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1]; + } + y = (mt[N-1] & UPPER_MASK) | (mt[0] & LOWER_MASK); + mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1]; + + mti = 0; + } + + y = mt[mti++]; + y ^= TEMPERING_SHIFT_U(y); + y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B; + y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C; + y ^= TEMPERING_SHIFT_L(y); + + return y; } float SCA_RandomNumberGenerator::DrawFloat() { diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 99e25042582..c23722d2d3c 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -48,8 +48,8 @@ /* ------------------------------------------------------------------------- */ SCA_RandomSensor::SCA_RandomSensor(SCA_EventManager* eventmgr, - SCA_IObject* gameobj, - int startseed) + SCA_IObject* gameobj, + int startseed) : SCA_ISensor(gameobj,eventmgr) { m_basegenerator = new SCA_RandomNumberGenerator(startseed); @@ -65,10 +65,10 @@ SCA_RandomSensor::~SCA_RandomSensor() void SCA_RandomSensor::Init() { - m_iteration = 0; + m_iteration = 0; m_interval = 0; m_lastdraw = false; - m_currentDraw = m_basegenerator->Draw(); + m_currentDraw = m_basegenerator->Draw(); } @@ -97,19 +97,19 @@ bool SCA_RandomSensor::IsPositiveTrigger() bool SCA_RandomSensor::Evaluate() { - /* Random generator is the generator from Line 25 of Table 1 in */ - /* [KNUTH 1981, The Art of Computer Programming Vol. 2 */ - /* (2nd Ed.), pp102] */ - /* It's a very simple max. length sequence generator. We can */ - /* draw 32 bool values before having to generate the next */ - /* sequence value. There are some theorems that will tell you */ - /* this is a reasonable way of generating bools. Check Knuth. */ - /* Furthermore, we only draw each <delay>-eth frame. */ + /* Random generator is the generator from Line 25 of Table 1 in */ + /* [KNUTH 1981, The Art of Computer Programming Vol. 2 */ + /* (2nd Ed.), pp102] */ + /* It's a very simple max. length sequence generator. We can */ + /* draw 32 bool values before having to generate the next */ + /* sequence value. There are some theorems that will tell you */ + /* this is a reasonable way of generating bools. Check Knuth. */ + /* Furthermore, we only draw each <delay>-eth frame. */ bool evaluateResult = false; if (++m_interval > m_pulse_frequency) { - bool drawResult = false; + bool drawResult = false; m_interval = 0; if (m_iteration > 31) { m_currentDraw = m_basegenerator->Draw(); @@ -122,8 +122,8 @@ bool SCA_RandomSensor::Evaluate() evaluateResult = drawResult != m_lastdraw; m_lastdraw = drawResult; } - - /* now pass this result to some controller */ + + /* now pass this result to some controller */ return evaluateResult; } diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index f5eefd5cc08..4a03062b6ad 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -63,22 +63,22 @@ void SCA_XORController::Trigger(SCA_LogicManager* logicmgr) bool sensorresult = false; for (vector<SCA_ISensor*>::const_iterator is=m_linkedsensors.begin(); - !(is==m_linkedsensors.end());is++) + !(is==m_linkedsensors.end());is++) { SCA_ISensor* sensor = *is; if (sensor->GetState()) { if (sensorresult == true) { - sensorresult = false; + sensorresult = false; break; } - sensorresult = true; + sensorresult = true; } } for (vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin(); - !(i==m_linkedactuators.end());i++) + !(i==m_linkedactuators.end());i++) { SCA_IActuator* actua = *i; logicmgr->AddActiveActuator(actua,sensorresult); |