diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-21 11:58:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-21 11:58:38 +0400 |
commit | d599b643b7a1882ea79851e334d7ed133f362bb3 (patch) | |
tree | 4e4640c1b2e7cc82d9db81dbd98a39777dcbce7c /source/gameengine/Converter | |
parent | f3ece5a108db0bdbefb4663ef4ebd9a7e039e263 (diff) |
style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
Diffstat (limited to 'source/gameengine/Converter')
8 files changed, 25 insertions, 36 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index fcf09588791..4969eae67f2 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -140,8 +140,7 @@ void BL_ActionActuator::SetLocalTime(float curtime) // Handle wrap around if (m_localtime < min(m_startframe, m_endframe) || m_localtime > max(m_startframe, m_endframe)) { - switch(m_playtype) - { + switch (m_playtype) { case ACT_ACTION_PLAY: // Clamp m_localtime = m_endframe; @@ -196,8 +195,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) return false; // Convert our playtype to one that BL_Action likes - switch(m_playtype) - { + switch (m_playtype) { case ACT_ACTION_LOOP_END: case ACT_ACTION_LOOP_STOP: playtype = BL_Action::ACT_MODE_LOOP; @@ -312,8 +310,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) return false; } - switch(m_playtype) - { + switch (m_playtype) { case ACT_ACTION_LOOP_STOP: obj->StopAction(m_layer); // Stop the action after getting the frame diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 912e2126874..e23fbd57d49 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -433,8 +433,7 @@ static void GetRGB(short type, unsigned int &c3) { unsigned int color = 0xFFFFFFFFL; - switch(type) - { + switch (type) { case 0: // vertex colors { if (mmcol) { @@ -677,7 +676,7 @@ static bool ConvertMaterial( material->mapping[i].projplane[2] = mttmp->projz; /// -------------------------------- - switch( mttmp->blendtype ) { + switch (mttmp->blendtype) { case MTEX_BLEND: material->blend_mode[i] = BLEND_MIX; break; @@ -701,7 +700,7 @@ static bool ConvertMaterial( // above one tex the switches here // are not used - switch(valid_index) { + switch (valid_index) { case 0: material->IdMode = DEFAULT_BLENDER; break; @@ -1595,7 +1594,7 @@ static void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, // get Root Parent of blenderobject struct Object* parent= blenderobject->parent; - while(parent && parent->parent) { + while (parent && parent->parent) { parent= parent->parent; } @@ -1929,8 +1928,7 @@ static KX_GameObject *gameobject_from_blenderobject( KX_GameObject *gameobj = NULL; Scene *blenderscene = kxscene->GetBlenderScene(); - switch(ob->type) - { + switch (ob->type) { case OB_LAMP: { KX_LightObject* gamelight = gamelight_from_blamp(ob, static_cast<Lamp*>(ob->data), ob->lay, kxscene, rendertools, converter); diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 34af4038c4e..c027d8aec94 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -944,7 +944,7 @@ static void load_datablocks(Main *main_newlib, BlendHandle *bpy_openlib, const c int i=0; LinkNode *n= names; - while(n) { + while (n) { BLO_library_append_named_part(main_tmp, &bpy_openlib, (char *)n->link, idcode); n= (LinkNode *)n->next; i++; @@ -1170,7 +1170,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie) else { /* free the mesh, we could be referecing a linked one! */ int mesh_index= gameobj->GetMeshCount(); - while(mesh_index--) { + while (mesh_index--) { mesh= gameobj->GetMesh(mesh_index); if (IS_TAGGED(mesh->GetMesh())) { gameobj->RemoveMeshes(); /* XXX - slack, should only remove meshes that are library items but mostly objects only have 1 mesh */ diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index ea2b85f8c5e..24d321730eb 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -136,7 +136,7 @@ void BL_ConvertActuators(const char* maggiename, } gameobj->ReserveActuator(actcount); bact = (bActuator*) blenderobject->actuators.first; - while(bact) + while (bact) { STR_String uniquename = bact->name; STR_String& objectname = gameobj->GetName(); @@ -358,7 +358,7 @@ void BL_ConvertActuators(const char* maggiename, KX_SoundActuator::KX_SOUNDACT_TYPE soundActuatorType = KX_SoundActuator::KX_SOUNDACT_NODEF; - switch(soundact->type) { + switch (soundact->type) { case ACT_SND_PLAY_STOP_SOUND: soundActuatorType = KX_SoundActuator::KX_SOUNDACT_PLAYSTOP; break; @@ -946,8 +946,7 @@ void BL_ConvertActuators(const char* maggiename, SCA_2DFilterActuator *tmp = NULL; RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode; - switch(_2dfilter->type) - { + switch (_2dfilter->type) { case ACT_2DFILTER_MOTIONBLUR: filtermode = RAS_2DFilterManager::RAS_2DFILTER_MOTIONBLUR; break; @@ -1026,8 +1025,7 @@ void BL_ConvertActuators(const char* maggiename, bool ghost = true; KX_GameObject *tmpgob = NULL; - switch(parAct->type) - { + switch (parAct->type) { case ACT_PARENT_SET: mode = KX_ParentActuator::KX_PARENT_SET; tmpgob = converter->FindGameObject(parAct->ob); @@ -1081,8 +1079,7 @@ void BL_ConvertActuators(const char* maggiename, KX_GameObject *targetob = converter->FindGameObject(stAct->target); int mode = KX_SteeringActuator::KX_STEERING_NODEF; - switch(stAct->type) - { + switch (stAct->type) { case ACT_STEERING_SEEK: mode = KX_SteeringActuator::KX_STEERING_SEEK; break; diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index 3a6aa228957..769abd01ce0 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -110,8 +110,7 @@ void BL_ConvertControllers( while (bcontr) { SCA_IController* gamecontroller = NULL; - switch(bcontr->type) - { + switch (bcontr->type) { case CONT_LOGIC_AND: { gamecontroller = new SCA_ANDController(gameobj); diff --git a/source/gameengine/Converter/KX_ConvertProperties.cpp b/source/gameengine/Converter/KX_ConvertProperties.cpp index a63f4c38fb6..7222c673322 100644 --- a/source/gameengine/Converter/KX_ConvertProperties.cpp +++ b/source/gameengine/Converter/KX_ConvertProperties.cpp @@ -69,13 +69,12 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan bProperty* prop = (bProperty*)object->prop.first; CValue* propval; bool show_debug_info; - while(prop) - { - + + while (prop) { propval = NULL; show_debug_info = bool (prop->flag & PROP_DEBUG); - switch(prop->type) { + switch (prop->type) { case GPROP_BOOL: { propval = new CBoolValue((bool)(prop->data != 0)); @@ -184,7 +183,7 @@ void BL_ConvertTextProperty(Object* object, KX_FontObject* fontobj,SCA_TimeEvent STR_String str = curve->str; CValue* propval = NULL; - switch(prop->type) { + switch (prop->type) { case GPROP_BOOL: { int value = atoi(str); diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 859257e192d..d3d3256312e 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -118,8 +118,8 @@ void BL_ConvertSensors(struct Object* blenderobject, } gameobj->ReserveSensor(count); sens = (bSensor*)blenderobject->sensors.first; - while(sens) - { + + while (sens) { SCA_ISensor* gamesensor=NULL; /* All sensors have a pulse toggle, frequency, and invert field. */ /* These are extracted here, and set when the sensor is added to the */ @@ -398,7 +398,7 @@ void BL_ConvertSensors(struct Object* blenderobject, /* Better do an explicit conversion here! (was implicit */ /* before...) */ - switch(blenderpropsensor->type) { + switch (blenderpropsensor->type) { case SENS_PROP_EQUAL: propchecktype = SCA_PropertySensor::KX_PROPSENSOR_EQUAL; break; @@ -573,8 +573,7 @@ void BL_ConvertSensors(struct Object* blenderobject, int hatf =0; int prec =0; - switch(bjoy->type) - { + switch (bjoy->type) { case SENS_JOY_AXIS: axis = bjoy->axis; axisf = bjoy->axisf; diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp index 4fc0b0ad3ec..a81d52f6698 100644 --- a/source/gameengine/Converter/KX_IpoConvert.cpp +++ b/source/gameengine/Converter/KX_IpoConvert.cpp @@ -96,7 +96,7 @@ SG_Controller *BL_CreateIPO(struct bAction *action, KX_GameObject* gameobj, KX_B const char *rotmode, *drotmode; - switch(blenderobject->rotmode) { + switch (blenderobject->rotmode) { case ROT_MODE_AXISANGLE: rotmode = "rotation_axis_angle"; drotmode = "delta_rotation_axis_angle"; |