style cleanup: bge, switch statements mostly.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 21 Oct 2012 07:58:38 +0000 (07:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 21 Oct 2012 07:58:38 +0000 (07:58 +0000)
also left bmesh decimator on in previous commit.

81 files changed:
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenlib/intern/boxpack2d.c
source/blender/blenloader/intern/versioning_250.c
source/blender/bmesh/operators/bmo_create.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationImporter.cpp
source/blender/collada/EffectExporter.cpp
source/blender/collada/ImageExporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/compositor/intern/COM_NodeOperation.cpp
source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/render/render_update.c
source/blender/editors/render/render_view.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/transform/transform_manipulator.c
source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
source/blender/imbuf/intern/dds/PixelFormat.h
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/rna_cleanup/rna_cleaner.py
source/blender/modifiers/intern/MOD_decimate.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c
source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c
source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c
source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c
source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c
source/blender/nodes/shader/nodes/node_shader_particle_info.c
source/blender/python/intern/bpy_rna.c
source/blender/quicktime/apple/qtkit_import.m
source/blender/render/intern/source/envmap.c
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Converter/KX_ConvertControllers.cpp
source/gameengine/Converter/KX_ConvertProperties.cpp
source/gameengine/Converter/KX_ConvertSensors.cpp
source/gameengine/Converter/KX_IpoConvert.cpp
source/gameengine/Expressions/BoolValue.cpp
source/gameengine/Expressions/FloatValue.cpp
source/gameengine/Expressions/InputParser.cpp
source/gameengine/Expressions/IntValue.cpp
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/StringValue.cpp
source/gameengine/Expressions/VectorValue.cpp
source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp
source/gameengine/Ketsji/BL_Action.cpp
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/BL_Texture.cpp
source/gameengine/Ketsji/KX_Dome.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_ObjectActuator.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_PythonSeq.cpp
source/gameengine/Ketsji/KX_RayCast.cpp
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
source/gameengine/Rasterizer/RAS_BucketManager.cpp
source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
source/gameengine/VideoTexture/VideoFFmpeg.cpp

index 1d23c374852e874d1058c93eb44757ca2bff2afc..4e00e1bce0bd69d927fba13669254c0c0d1702ea 100644 (file)
@@ -1050,29 +1050,25 @@ static void cloth_update_springs( ClothModifierData *clmd )
 
                spring->stiffness = 0.0f;
 
-               if(spring->type == CLOTH_SPRING_TYPE_STRUCTURAL)
-               {
+               if (spring->type == CLOTH_SPRING_TYPE_STRUCTURAL) {
                        spring->stiffness = (cloth->verts[spring->kl].struct_stiff + cloth->verts[spring->ij].struct_stiff) / 2.0f;
                }
-               else if(spring->type == CLOTH_SPRING_TYPE_SHEAR)
-               {
+               else if (spring->type == CLOTH_SPRING_TYPE_SHEAR) {
                        spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0f;
                }
-               else if(spring->type == CLOTH_SPRING_TYPE_BENDING)
-               {
+               else if (spring->type == CLOTH_SPRING_TYPE_BENDING) {
                        spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0f;
                }
-               else if(spring->type == CLOTH_SPRING_TYPE_GOAL)
-               {
+               else if (spring->type == CLOTH_SPRING_TYPE_GOAL) {
                        /* Warning: Appending NEW goal springs does not work because implicit solver would need reset! */
 
                        /* Activate / Deactivate existing springs */
-                       if ((!(cloth->verts[spring->ij].flags & CLOTH_VERT_FLAG_PINNED)) && (cloth->verts[spring->ij].goal > ALMOST_ZERO))
+                       if ((!(cloth->verts[spring->ij].flags & CLOTH_VERT_FLAG_PINNED)) &&
+                           (cloth->verts[spring->ij].goal > ALMOST_ZERO))
                        {
                                spring->flags &= ~CLOTH_SPRING_FLAG_DEACTIVATE;
                        }
-                       else
-                       {
+                       else {
                                spring->flags |= CLOTH_SPRING_FLAG_DEACTIVATE;
                        }
                }
index e09e2eeb4938cc7a19c932f783215454d3e39005..e7e645bd4259cda9ff943e980724aa68d7308244 100644 (file)
@@ -1476,7 +1476,7 @@ void BKE_curve_bevel_make(Scene *scene, Object *ob, ListBase *disp, int forRende
                }
        }
        else if (cu->ext1 == 0.0f && cu->ext2 == 0.0f) {
-               ;
+               /* pass */
        }
        else if (cu->ext2 == 0.0f) {
                dl = MEM_callocN(sizeof(DispList), "makebevelcurve2");
index 787d5c65e9d420e612aa4ccda6e49e96f8acdecb..d1ef5d7376b518b95db44c20748b4349472cff06 100644 (file)
@@ -711,7 +711,7 @@ static void update_matrixS(ClothVertex *verts, int numverts, fmatrix3x3 *S)
        int i = 0;
 
        /* Clear matrix from old vertex constraints */
-       for(i = 0; i < S[0].vcount; i++)
+       for (i = 0; i < S[0].vcount; i++)
                S[i].c = S[i].r = 0;
 
        /* Set new vertex constraints */
@@ -1662,7 +1662,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
        while (search) {
                // only handle active springs
                ClothSpring *spring = search->link;
-               if!(spring->flags & CLOTH_SPRING_FLAG_DEACTIVATE))
+               if (!(spring->flags & CLOTH_SPRING_FLAG_DEACTIVATE))
                        cloth_calc_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX, time);
 
                search = search->next;
index 9951412063d121fbfe7f4b86b39167348848540d..2f04df06d6684056bfc9e613e75a86233cc2cec2 100644 (file)
@@ -982,14 +982,16 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb)
        if (ma->nodetree && ma->use_nodes)
                ntreeShaderGetTexcoMode(ma->nodetree, r_mode, &ma->texco, &ma->mode_l);
 
-    /* local group override */
-    if((ma->shade_flag & MA_GROUP_LOCAL) && ma->id.lib && ma->group && ma->group->id.lib) {
-        Group *group;
-
-        for(group= G.main->group.first; group; group= group->id.next)
-            if(!group->id.lib && strcmp(group->id.name, ma->group->id.name) == 0)
-                ma->group = group;
-    }
+       /* local group override */
+       if ((ma->shade_flag & MA_GROUP_LOCAL) && ma->id.lib && ma->group && ma->group->id.lib) {
+               Group *group;
+
+               for (group = G.main->group.first; group; group = group->id.next) {
+                       if (!group->id.lib && strcmp(group->id.name, ma->group->id.name) == 0) {
+                               ma->group = group;
+                       }
+               }
+       }
 }
 
 static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int r_mode, float *amb)
index 98dce0894a812d670884244c3ac59037a2285289..88f3eb1561072af1f2ab1ce60b691069366866d7 100644 (file)
@@ -691,7 +691,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
                sds->dx = ch_dx;
                VECCOPY(sds->res, ch_res);
                sds->total_cells = ch_res[0]*ch_res[1]*ch_res[2];
-               if(sds->flags & MOD_SMOKE_HIGHRES) {
+               if (sds->flags & MOD_SMOKE_HIGHRES) {
                        smoke_reallocate_highres_fluid(sds, ch_dx, ch_res, 1);
                }
        }
index c8d6ec73d286f565d04979159d0bbc09f3dc7565..4595b4bd78b52c3d1347772fd89ea43ef7f605b4 100644 (file)
@@ -640,7 +640,6 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData
                tsmd->flow->flags = smd->flow->flags;
        }
        else if (tsmd->coll) {
-               ;
                /* leave it as initialized, collision settings is mostly caches */
        }
 }
@@ -699,7 +698,7 @@ static void obstacles_from_derivedmesh(Object *coll_ob, SmokeDomainSettings *sds
                numverts = dm->getNumVerts(dm);
 
                // DG TODO
-               // if(scs->type > SM_COLL_STATIC)
+               // if (scs->type > SM_COLL_STATIC)
                // if line above is used, the code is in trouble if the object moves but is declared as "does not move"
 
                {
index 1c70a612c4fcd8b756d747c6b9d955f0ad79ea65..2e9f5c151c5988a5e2be0a1bc41e1e4b34d661e1 100644 (file)
@@ -73,7 +73,7 @@ typedef struct BoxVert {
                         ((b)->v[BR]->x = (b)->v[TR]->x)
 #define UPDATE_V34Y(b)  ((b)->v[TL]->y = (b)->v[TR]->y); \
                         ((b)->v[BR]->y = (b)->v[BL]->y)
-                                               
+
 /* UNUSED */
 // #define UPDATE_V34(b) UPDATE_V34X(b); UPDATE_V34Y(b)
 
index 6d8991c749bc313816d1524dc77f50b59243f6e8..00c44bdc008117d235a468fe92a3013798db0d7d 100644 (file)
@@ -2062,7 +2062,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
                                {
                                        brush->add_col[0] = 1.00f;
                                        brush->add_col[1] = 0.39f;
-                                       brush->add_col[2] = 0.39f;
+                                       brush->add_col[2] = 0.39f;
                                }
 
                                if (brush->sub_col[0] == 0 &&
index 731170f963c74676780902ceb2a5526b26888152..bd1c0f809bd123076ee2b7abde5ba333df545b7f 100644 (file)
@@ -84,7 +84,7 @@ static int count_edge_faces(BMesh *bm, BMEdge *e);
 BLI_INLINE BMDiskLink *rs_edge_link_get(BMEdge *e, BMVert *v, EdgeData *e_data)
 {
        return v == ((BMEdge *)e)->v1 ? &(((EdgeData *)e_data)->v1_disk_link) :
-                                       &(((EdgeData *)e_data)->v2_disk_link) ;
+                                       &(((EdgeData *)e_data)->v2_disk_link);
 }
 
 static int rotsys_append_edge(BMEdge *e, BMVert *v,
index 9d2d86fd3cfa1bc5f518ddc1a24e5d4d1b002aaf..26b5edf7ea60cedcb32d251a967840c89bffcebb 100644 (file)
@@ -265,7 +265,7 @@ void AnimationExporter::dae_animation(Object *ob, FCurve *fcu, char *transformNa
                MEM_freeN(eul);
                MEM_freeN(eul_axis);
        }
-       else if(!strcmp(transformName, "lens") && (ob->type == OB_CAMERA)) {
+       else if (!strcmp(transformName, "lens") && (ob->type == OB_CAMERA)) {
                output_id = create_lens_source_from_fcurve((Camera *) ob->data, COLLADASW::InputSemantic::OUTPUT, fcu, anim_id);
        }
        else {
index 02d1e1166c92d74391667cfb15ba0bca93574ab5..374f6385ea714c1730872cd64ea8bfc919f08f50 100644 (file)
@@ -854,14 +854,13 @@ static const double get_aspect_ratio(const COLLADAFW::Camera *camera)
 {
        double aspect =  camera->getAspectRatio().getValue();
 
-       if(aspect == 0)
-       {
+       if (aspect == 0) {
                const double yfov   =  camera->getYFov().getValue();
 
-               if(yfov == 0)
-                       aspect=1; // assume yfov and xfov are equal
-               else
-               {
+               if (yfov == 0) {
+                       aspect = 1; // assume yfov and xfov are equal
+               }
+               else {
                        const double xfov   =  camera->getXFov().getValue();
                        if (xfov==0)
                                aspect = 1;
@@ -885,7 +884,7 @@ void AnimationImporter::translate_Animations(COLLADAFW::Node *node,
        COLLADAFW::Node *root = root_map.find(uid) == root_map.end() ? node : root_map[uid];
 
        Object *ob;
-       if(is_joint)
+       if (is_joint)
                ob = armature_importer->get_armature_for_joint(root);
        else
                ob = object_map.find(uid) == object_map.end() ? NULL : object_map.find(uid)->second;
index 03e96bebb61890b497bf3b1d25ee38c1aa066bcf..e4a654dc99aca4dcc1cb689a7ccf77a5d845eb49 100644 (file)
@@ -381,7 +381,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
        }
 
        std::set<Image *>::iterator uv_t_iter;
-       for(uv_t_iter = uv_textures.begin(); uv_t_iter != uv_textures.end(); uv_t_iter++ ) {
+       for (uv_t_iter = uv_textures.begin(); uv_t_iter != uv_textures.end(); uv_t_iter++ ) {
                Image *ima = *uv_t_iter;
                std::string key(id_name(ima));
                key = translate_id(key);
index a15dadda8cf1e372b9ef4920e79080b592ad296b..2e0c0f1ea57051fe1dfc769daea12c889090083a 100644 (file)
@@ -62,7 +62,7 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies)
        if (not_yet_exported) {
 
                ImBuf *imbuf       = BKE_image_get_ibuf(image, NULL);
-               if(!imbuf) {
+               if (!imbuf) {
                        fprintf(stderr, "Collada export: image does not exist:\n%s\n", image->name);
                        return;
                }
index e5493bc237d5bb03cf1123c0b0587fdb818adb55..8337a977b3b9675a115131a0d6c02f3ea3e6e204 100644 (file)
@@ -998,7 +998,7 @@ static bool bc_has_same_material_configuration(Object *ob1, Object *ob2)
        if (ob1->totcol != ob2->totcol) return false; // not same number of materials
        if (ob1->totcol == 0) return false; // no material at all
        
-       for(int index=0; index < ob1->totcol; index++) {
+       for (int index=0; index < ob1->totcol; index++) {
                if (ob1->matbits[index] != ob2->matbits[index]) return false; // shouldn't happen
                if (ob1->matbits[index] == 0) return false; // shouldn't happen
                if (ob1->mat[index] != ob2->mat[index]) return false; // different material assignment
index 4ae114bd0315145c4a443713cddc41ec60331f02..7b52c52154d3ce92f3b548342ca666921a1f92b2 100644 (file)
@@ -126,7 +126,7 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOper
        else {
                rcti tempOutput;
                bool first = true;
-               for (int i = 0 ; i < getNumberOfInputSockets() ; i ++) {
+               for (int i = 0; i < getNumberOfInputSockets(); i ++) {
                        NodeOperation * inputOperation = this->getInputOperation(i);
                        if (inputOperation && inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
                                if (first) {
index 7ab00b202e17dfb8310f93ea7ae0794c8851cca0..02627bae5ed1b3608c2a7acbae19fcd06bda3578 100644 (file)
@@ -95,7 +95,7 @@ void GaussianYBlurOperation::executePixel(float output[4], int x, int y, void *d
 
        int index;
        int step = getStep();
-       const int bufferIndexx = ((minx - bufferstartx) * 4) ;
+       const int bufferIndexx = ((minx - bufferstartx) * 4);
        for (int ny = miny; ny < maxy; ny += step) {
                index = (ny - y) + this->m_rad;
                int bufferindex = bufferIndexx + ((ny - bufferstarty) * 4 * bufferwidth);
index 5d4609fcd7cb1f70628c4a9e2a5255b37aaaddb7..0a244db5df85892d9188596d1275083ef668d67e 100644 (file)
@@ -3301,7 +3301,9 @@ static void hide_unselected_armature_bones(Scene *scene)
        for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
                bArmature *arm = obedit->data;
                if (EBONE_VISIBLE(arm, ebone)) {
-                       if (ebone->flag & (BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL)) ;
+                       if (ebone->flag & (BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL)) {
+                               /* pass */
+                       }
                        else {
                                ebone->flag |= BONE_HIDDEN_A;
                        }
index 82fef00b1e64d567d11715184039c279e0695f20..0f1d48ff8af75c4d56549068e72f918da4b8e516 100644 (file)
@@ -1195,7 +1195,7 @@ static int meshdeform_tri_intersect(const float orig[3], const float end[3], con
 }
 
 static void harmonic_ray_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
- {
+{
        void **data = userdata;
        MeshDeformBind *mdb = data[1];
        MFace *mface = data[0], *mf;
@@ -1210,7 +1210,7 @@ static void harmonic_ray_callback(void *userdata, int index, const BVHTreeRay *r
        if (mf->v4)
                copy_v3_v3(face[3], mdb->cagecos[mf->v4]);
        
-       add_v3_v3v3(end, isec->start, isec->vec);
+       add_v3_v3v3(end, isec->start, isec->vec);
        
        if (!meshdeform_tri_intersect(ray->origin, end, face[0], face[1], face[2], co, uvw)) 
                if (!mf->v4 || !meshdeform_tri_intersect(ray->origin, end, face[0], face[2], face[3], co, uvw))
@@ -1257,7 +1257,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
        if (BLI_bvhtree_ray_cast(mdb->bvhtree, isect_mdef.start, isect_mdef.vec,
                                 0.0, &hit, harmonic_ray_callback, data) != -1)
        {
-               len = isect_mdef.labda;
+               len = isect_mdef.labda;
                isect_mdef.face = mface = mface1 + hit.index;
 
                /* create MDefBoundIsect */
index b9f6f0bc1869942e63fde50d5ce1a227207c7767..90ac3ddc6f7c858e47f5f1c375b4b0fcf96c1901 100644 (file)
@@ -405,27 +405,27 @@ typedef enum WT_Method {
 
 typedef enum WT_ReplaceMode {
        WT_REPLACE_ALL_WEIGHTS = 1,
-       WT_REPLACE_EMPTY_WEIGHTS = 2,
+       WT_REPLACE_EMPTY_WEIGHTS = 2
 } WT_ReplaceMode;
 
 static EnumPropertyItem WT_vertex_group_mode_item[] = {
-    {WT_REPLACE_ACTIVE_VERTEX_GROUP, "WT_REPLACE_ACTIVE_VERTEX_GROUP", 1, "Active", "Transfer active vertex group from selected to active mesh."},
-    {WT_REPLACE_ALL_VERTEX_GROUPS, "WT_REPLACE_ALL_VERTEX_GROUPS", 1, "All", "Transfer all vertex groups from selected to active mesh."},
-    {0, NULL, 0, NULL, NULL}
+       {WT_REPLACE_ACTIVE_VERTEX_GROUP, "WT_REPLACE_ACTIVE_VERTEX_GROUP", 1, "Active", "Transfer active vertex group from selected to active mesh."},
+       {WT_REPLACE_ALL_VERTEX_GROUPS, "WT_REPLACE_ALL_VERTEX_GROUPS", 1, "All", "Transfer all vertex groups from selected to active mesh."},
+       {0, NULL, 0, NULL, NULL}
 };
 
 static EnumPropertyItem WT_method_item[] = {
-    {WT_BY_INDEX, "WT_BY_INDEX", 1, "Vertex index", "Copy for identical meshes."},
-    {WT_BY_NEAREST_VERTEX, "WT_BY_NEAREST_VERTEX", 1, "Nearest vertex", "Copy weight from closest vertex."},
-    {WT_BY_NEAREST_FACE, "WT_BY_NEAREST_FACE", 1, "Nearest face", "Barycentric interpolation from nearest face."},
-    {WT_BY_NEAREST_VERTEX_IN_FACE, "WT_BY_NEAREST_VERTEX_IN_FACE", 1, "Nearest vertex in face", "Copy weight from closest vertex in nearest face."},
-    {0, NULL, 0, NULL, NULL}
+       {WT_BY_INDEX, "WT_BY_INDEX", 1, "Vertex index", "Copy for identical meshes."},
+       {WT_BY_NEAREST_VERTEX, "WT_BY_NEAREST_VERTEX", 1, "Nearest vertex", "Copy weight from closest vertex."},
+       {WT_BY_NEAREST_FACE, "WT_BY_NEAREST_FACE", 1, "Nearest face", "Barycentric interpolation from nearest face."},
+       {WT_BY_NEAREST_VERTEX_IN_FACE, "WT_BY_NEAREST_VERTEX_IN_FACE", 1, "Nearest vertex in face", "Copy weight from closest vertex in nearest face."},
+       {0, NULL, 0, NULL, NULL}
 };
 
 static EnumPropertyItem WT_replace_mode_item[] = {
-    {WT_REPLACE_ALL_WEIGHTS, "WT_REPLACE_ALL_WEIGHTS", 1, "All", "Overwrites all weights."},
-    {WT_REPLACE_EMPTY_WEIGHTS, "WT_REPLACE_EMPTY_WEIGHTS", 1, "Empty", "Adds weights to vertices with no weight."},
-    {0, NULL, 0, NULL, NULL}
+       {WT_REPLACE_ALL_WEIGHTS, "WT_REPLACE_ALL_WEIGHTS", 1, "All", "Overwrites all weights."},
+       {WT_REPLACE_EMPTY_WEIGHTS, "WT_REPLACE_EMPTY_WEIGHTS", 1, "Empty", "Adds weights to vertices with no weight."},
+       {0, NULL, 0, NULL, NULL}
 };
 
 /*copy weight*/
index 5b1c03f65dfac9c15048e3fa7e03536dc555c665..c5320fde0ff4db78e65351136921820a4b12fd38 100644 (file)
@@ -82,7 +82,7 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated)
                return;
 
        /* don't call this recursively for frame updates */
-       if(recursive_check)
+       if (recursive_check)
                return;
        
        recursive_check = TRUE;
index 0d33c44db8f2b01e1222c706a5713b51dd87d7a2..5ec7f4d05b60b71cb3398d869dcda2e211a1c0cc 100644 (file)
@@ -220,7 +220,6 @@ void render_view_open(bContext *C, int mx, int my)
                else {
                        /* Leave it alone so the image editor will just go back from
                         * full screen to the original tiled setup */
-                       ;
                }
        }
 }
index cdf68d97e4da32c4c457337271d0a6f89f2494f6..e56443fa4b51f29e724f797d014e301901f5c50a 100644 (file)
@@ -1855,7 +1855,7 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
                        break;
                        
                case ESCKEY:
-                       ;
+                       break;
        }
        
        return OPERATOR_RUNNING_MODAL;
index e84db87c5eb760be42cc7794e50ae09426ebff32..df8ef6cc7507949fe1690cb44169581bcdfe19a3 100644 (file)
@@ -2429,8 +2429,7 @@ static int image_record_composite_exec(bContext *C, wmOperator *op)
        if (!image_record_composite_init(C, op))
                return OPERATOR_CANCELLED;
        
-       while (image_record_composite_apply(C, op))
-               ;
+       while (image_record_composite_apply(C, op)) {}
        
        image_record_composite_exit(C, op);
        
index 876c2f9985be4be8dd0108749e100d62cd78a475..4131cbfdd0d2c462b660bf18df7a04581f075596 100644 (file)
@@ -550,7 +550,7 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar)
        int width, height, winx, winy;
        
 #if 0
-       if (image_preview_active(curarea, &width, &height)) ;
+       if (image_preview_active(curarea, &width, &height)) {}
        else
 #endif
        ED_space_image_get_size(sima, &width, &height);
index 74a2292d74c814603c02fe9672c0f5f3f5b36811..d21465155e03ad22f42abaae7d35598d4561a701 100644 (file)
@@ -498,7 +498,7 @@ int calc_manipulator_stats(const bContext *C)
                }
        }
        else if (ob && (ob->mode & OB_MODE_ALL_PAINT)) {
-               ;
+               /* pass */
        }
        else if (ob && ob->mode & OB_MODE_PARTICLE_EDIT) {
                PTCacheEdit *edit = PE_get_current(scene, ob);
index d9d0cb86ee0a63f701a49aa4940dd2264a9fa62c..1fd41aa8c2db48de4a68c542e0ba6ede83773d3a 100644 (file)
@@ -737,7 +737,7 @@ void DDSHeader::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask
        {
                // Compute bit count from the masks.
                uint total = rmask | gmask | bmask | amask;
-               while(total != 0) {
+               while (total != 0) {
                        bitcount++;
                        total >>= 1;
                }
index ce36fb00b97f3592b973899e7992e4abd32d1870..2bb1864e49dfedc57ad438e19016bbcef8ffd5a3 100644 (file)
                        }
                }
 
-        inline float quantizeCeil(float f, int inbits, int outbits)
-        {
-            //uint i = f * (float(1 << inbits) - 1);
-            //i = convert(i, inbits, outbits);
-            //float result = float(i) / (float(1 << outbits) - 1);
-            //nvCheck(result >= f);
-            float result;
-            int offset = 0;
-            do {
-                uint i = offset + uint(f * (float(1 << inbits) - 1));
-                i = convert(i, inbits, outbits);
-                result = float(i) / (float(1 << outbits) - 1);
-                offset++;
-            } while (result < f);
-
-            return result;
-        }
-
-        /*
-        inline float quantizeRound(float f, int bits)
-        {
-            float scale = float(1 << bits);
-            return fround(f * scale) / scale;
-        }
-
-        inline float quantizeFloor(float f, int bits)
-        {
-            float scale = float(1 << bits);
-            return floor(f * scale) / scale;
-        }
-        */
+               inline float quantizeCeil(float f, int inbits, int outbits)
+               {
+                       //uint i = f * (float(1 << inbits) - 1);
+                       //i = convert(i, inbits, outbits);
+                       //float result = float(i) / (float(1 << outbits) - 1);
+                       //nvCheck(result >= f);
+                       float result;
+                       int offset = 0;
+                       do {
+                               uint i = offset + uint(f * (float(1 << inbits) - 1));
+                               i = convert(i, inbits, outbits);
+                               result = float(i) / (float(1 << outbits) - 1);
+                               offset++;
+                       } while (result < f);
+
+                       return result;
+               }
+
+#if 0
+               inline float quantizeRound(float f, int bits)
+               {
+                       float scale = float(1 << bits);
+                       return fround(f * scale) / scale;
+               }
+
+               inline float quantizeFloor(float f, int bits)
+               {
+                       float scale = float(1 << bits);
+                       return floor(f * scale) / scale;
+               }
+#endif
 
        } // PixelFormat namespace
 
index 0d7d20d04ae37985a9c0a88314deeeec31514c26..cd0ea107f501b43bdb777d16aa4aac6ab26e80cd 100644 (file)
@@ -71,12 +71,12 @@ EnumPropertyItem node_quality_items[] = {
 };
 
 EnumPropertyItem node_chunksize_items[] = {
-    {NTREE_CHUNCKSIZE_32,   "32",     0,    "32x32",     "Chunksize of 32x32"},
-    {NTREE_CHUNCKSIZE_64,   "64",     0,    "64x64",     "Chunksize of 64x64"},
-    {NTREE_CHUNCKSIZE_128,   "128",     0,    "128x128",     "Chunksize of 128x128"},
-    {NTREE_CHUNCKSIZE_256,   "256",     0,    "256x256",     "Chunksize of 256x256"},
-    {NTREE_CHUNCKSIZE_512,   "512",     0,    "512x512",     "Chunksize of 512x512"},
-    {NTREE_CHUNCKSIZE_1024,   "1024",     0,    "1024x1024",     "Chunksize of 1024x1024"},
+       {NTREE_CHUNCKSIZE_32,   "32",     0,    "32x32",     "Chunksize of 32x32"},
+       {NTREE_CHUNCKSIZE_64,   "64",     0,    "64x64",     "Chunksize of 64x64"},
+       {NTREE_CHUNCKSIZE_128,  "128",    0,    "128x128",   "Chunksize of 128x128"},
+       {NTREE_CHUNCKSIZE_256,  "256",    0,    "256x256",   "Chunksize of 256x256"},
+       {NTREE_CHUNCKSIZE_512,  "512",    0,    "512x512",   "Chunksize of 512x512"},
+       {NTREE_CHUNCKSIZE_1024, "1024",   0,    "1024x1024", "Chunksize of 1024x1024"},
        {0, NULL, 0, NULL, NULL}
 };
 
index e3359fbae59bfcbbacc0ca234afab5bb6568d1a4..0231e57fcfd72b04a52f1ea2545204de4e5f4e06 100755 (executable)
@@ -130,11 +130,11 @@ def get_props_from_txt(input_filename):
             line = line[1:]
 
         # class
-        [bclass, tail] = [x.strip() for x in line.split('.', 1)]
+        bclass, tail = [x.strip() for x in line.split('.', 1)]
 
         # comment
         if '*' in bclass:
-            [comment, bclass] = [x.strip() for x in bclass.split('*', 1)]
+            comment, bclass = [x.strip() for x in bclass.split('*', 1)]
         else:
             comment= ''
 
@@ -144,18 +144,18 @@ def get_props_from_txt(input_filename):
             continue
 
         # from
-        [bfrom, tail] = [x.strip() for x in tail.split('->', 1)]
+        bfrom, tail = [x.strip() for x in tail.split('->', 1)]
 
         # to
-        [bto, tail] = [x.strip() for x in tail.split(':', 1)]
+        bto, tail = [x.strip() for x in tail.split(':', 1)]
 
         # type, description
         try:
-            [btype, description] = tail.split(None, 1)
+            btype, description = tail.split(None, 1)
             # make life easy and strip quotes
             description = description.replace("'", "").replace('"', "").replace("\\", "").strip()
         except ValueError:
-            [btype, description] = [tail,'NO DESCRIPTION']
+            btype, description = [tail,'NO DESCRIPTION']
 
         # keyword-check
         kwcheck = check_prefix(bto, btype)
index e7ece60121ec7fe7821fc1e369b3a6934a296fa0..de7822443f399b08ffd99bdfbe7124b062485f48 100644 (file)
@@ -50,7 +50,7 @@
 #include "BKE_tessmesh.h"
 
 /* testing only! - Campbell */
-#define USE_DECIMATE_BMESH
+// #define USE_DECIMATE_BMESH
 #include "PIL_time.h"
 
 
index b9593353288facf69b11809c5892342c8676c364..254578f73993636547f5d3bc9e05be3d1b6bbe99 100644 (file)
@@ -206,11 +206,11 @@ static MFace *get_dface(DerivedMesh *dm, DerivedMesh *split, int cur, int i, MFa
 }
 
 #define SET_VERTS(a, b, c, d)  {        \
-        v[0] = mf->v##a; uv[0] = a - 1; \
-        v[1] = mf->v##b; uv[1] = b - 1; \
-        v[2] = mf->v##c; uv[2] = c - 1; \
-        v[3] = mf->v##d; uv[3] = d - 1; \
-    } (void)0
+               v[0] = mf->v##a; uv[0] = a - 1; \
+               v[1] = mf->v##b; uv[1] = b - 1; \
+               v[2] = mf->v##c; uv[2] = c - 1; \
+               v[3] = mf->v##d; uv[3] = d - 1; \
+       } (void)0
 
 #define GET_ES(v1, v2) edgecut_get(eh, v1, v2)
 #define INT_UV(uvf, c0, c1) interp_v2_v2v2(uvf, mf->uv[c0], mf->uv[c1], 0.5f)
index 4a7643f577137a9546a8589aad0826a291a7d05e..af4b6e1b8d062dc9aaf22923c1cb71350cb8d43d 100644 (file)
@@ -45,7 +45,7 @@ static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[]= {
 
 static int node_shader_gpu_bsdf_anisotropic(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
 {
-       if(!in[3].link)
+       if (!in[3].link)
                in[3].link = GPU_builtin(GPU_VIEW_NORMAL);
 
        return GPU_stack_link(mat, "node_bsdf_anisotropic", in, out);
index 63ce637fd720a4d9968fdcedb86c7cb6de7f9c42..021373ac40a78bd1584c2459732c8b2d5a7c2635 100644 (file)
@@ -43,7 +43,7 @@ static bNodeSocketTemplate sh_node_bsdf_diffuse_out[]= {
 
 static int node_shader_gpu_bsdf_diffuse(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
 {
-       if(!in[2].link)
+       if (!in[2].link)
                in[2].link = GPU_builtin(GPU_VIEW_NORMAL);
 
        return GPU_stack_link(mat, "node_bsdf_diffuse", in, out);
index 7b8b80ae8e2c57b2a5018685bbd076b6ff1a35b9..827e349aca39c42d552fdb4b41f9b2ad466f0a36 100644 (file)
@@ -44,7 +44,7 @@ static bNodeSocketTemplate sh_node_bsdf_glass_out[]= {
 
 static int node_shader_gpu_bsdf_glass(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
 {
-       if(!in[3].link)
+       if (!in[3].link)
                in[3].link = GPU_builtin(GPU_VIEW_NORMAL);
 
        return GPU_stack_link(mat, "node_bsdf_glass", in, out);
index 9f42e23ebb6efa9eabb1006fc266dd6a7d945e8d..2c1adb4f0a3d4013f32036b1d4538358959bdd43 100644 (file)
@@ -43,7 +43,7 @@ static bNodeSocketTemplate sh_node_bsdf_glossy_out[]= {
 
 static int node_shader_gpu_bsdf_glossy(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
 {
-       if(!in[2].link)
+       if (!in[2].link)
                in[2].link = GPU_builtin(GPU_VIEW_NORMAL);
 
        return GPU_stack_link(mat, "node_bsdf_glossy", in, out);
index b3290411aee445391815017ae4b0c90616571adb..7412ce81dd1c03a223c09bf63734ab9397e53f87 100644 (file)
@@ -42,7 +42,7 @@ static bNodeSocketTemplate sh_node_bsdf_translucent_out[]= {
 
 static int node_shader_gpu_bsdf_translucent(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
 {
-       if(!in[1].link)
+       if (!in[1].link)
                in[1].link = GPU_builtin(GPU_VIEW_NORMAL);
 
        return GPU_stack_link(mat, "node_bsdf_translucent", in, out);
index 97bc37a84c9dc8d278dee4614a13827a539a9168..a32aec54b320895735ef57b5f8f0637a0d830bfb 100644 (file)
@@ -43,7 +43,7 @@ static bNodeSocketTemplate sh_node_bsdf_velvet_out[]= {
 
 static int node_shader_gpu_bsdf_velvet(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
 {
-       if(!in[2].link)
+       if (!in[2].link)
                in[2].link = GPU_builtin(GPU_VIEW_NORMAL);
 
        return GPU_stack_link(mat, "node_bsdf_velvet", in, out);
index ddfcb9476f4dd47d13905b8c90363bbd17db2935..c7e31d117cc67ba0bd38cd7b4f2f3b15e2827ebe 100644 (file)
 #include "../node_shader_util.h"
 
 static bNodeSocketTemplate outputs[] = {
-    { SOCK_FLOAT,  0, "Index" },
-    { SOCK_FLOAT,  0, "Age" },
-    { SOCK_FLOAT,  0, "Lifetime" },
-    { SOCK_VECTOR,  0, "Location" },
-    #if 0      /* quaternion sockets not yet supported */
-    { SOCK_QUATERNION,  0, "Rotation" },
-    #endif
-    { SOCK_FLOAT,  0, "Size" },
-    { SOCK_VECTOR,  0, "Velocity" },
-    { SOCK_VECTOR,  0, "Angular Velocity" },
-    { -1, 0, "" }
-};
+       { SOCK_FLOAT,  0, "Index" },
+       { SOCK_FLOAT,  0, "Age" },
+       { SOCK_FLOAT,  0, "Lifetime" },
+       { SOCK_VECTOR,  0, "Location" },
+#if 0  /* quaternion sockets not yet supported */
+       { SOCK_QUATERNION,  0, "Rotation" },
+#endif
+       { SOCK_FLOAT,  0, "Size" },
+       { SOCK_VECTOR,  0, "Velocity" },
+       { SOCK_VECTOR,  0, "Angular Velocity" },
+       { -1, 0, "" }
+       };
 
 /* node type definition */
 void register_node_type_sh_particle_info(bNodeTreeType *ttype)
index 1833000f69b51d1bc477bded27b5bfcc01ee3a29..122cc76a3f29f0e7e3f231481182b4de19864c7b 100644 (file)
@@ -4617,7 +4617,7 @@ static struct PyMethodDef pyrna_prop_collection_methods[] = {
 static struct PyMethodDef pyrna_prop_collection_idprop_methods[] = {
        {"add", (PyCFunction)pyrna_prop_collection_idprop_add, METH_NOARGS, NULL},
        {"remove", (PyCFunction)pyrna_prop_collection_idprop_remove, METH_O, NULL},
-    {"clear", (PyCFunction)pyrna_prop_collection_idprop_clear, METH_NOARGS, NULL},
+       {"clear", (PyCFunction)pyrna_prop_collection_idprop_clear, METH_NOARGS, NULL},
        {"move", (PyCFunction)pyrna_prop_collection_idprop_move, METH_VARARGS, NULL},
        {NULL, NULL, 0, NULL}
 };
index b568a1255a855fdb855d01fdb83ee54128d39ef9..e420eb1efa792c46232bccbec6016e0f64b9066c 100644 (file)
@@ -102,7 +102,7 @@ int anim_is_quicktime (const char *name)
        pool = [[NSAutoreleasePool alloc] init];
        
        if([QTMovie canInitWithFile:[NSString stringWithCString:name 
-                                                                encoding:[NSString defaultCStringEncoding]]])
+                                    encoding:[NSString defaultCStringEncoding]]])
        {
                [pool drain];
                return true;
@@ -162,11 +162,11 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height)
        /*Get the bitmap of the image*/
        enumerator = [[sourceImage representations] objectEnumerator];
        while ((representation = [enumerator nextObject])) {
-        if ([representation isKindOfClass:[NSBitmapImageRep class]]) {
-            bitmapImage = (NSBitmapImageRep *)representation;
+               if ([representation isKindOfClass:[NSBitmapImageRep class]]) {
+                       bitmapImage = (NSBitmapImageRep *)representation;
                        break;
-        }
-    }
+               }
+       }
        if (bitmapImage == nil) return NULL;
 
        if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0)
@@ -382,7 +382,7 @@ int startquicktime (struct anim *anim)
        anim->curposition = 0;
 
        [pool drain];
-                                                                                                
+
        return 0;
 }
 
index f01f37019a0ebc4cc82723a1abbb1a9671a916fc..558ba8fe062ea1b9e55f443d29a99f39988cf099 100644 (file)
@@ -216,7 +216,7 @@ static void envmap_transmatrix(float mat[][4], int part)
        eul[0] = eul[1] = eul[2] = 0.0;
        
        if (part == 0) {          /* neg z */
-               ;
+               /* pass */
        }
        else if (part == 1) { /* pos z */
                eul[0] = M_PI;
index fcf095887918a46537d9ea6fa81a1c6b0770e0e5..4969eae67f2870e315ccb9917e401dffb7e18d98 100644 (file)
@@ -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
 
index 912e21268743469e4fbaaea64bf60f92139c9014..e23fbd57d4919ad8b63fcf5f69b4062979e44b47 100644 (file)
@@ -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);
index 34af4038c4eb7b06b9918a997663a242a3da948f..c027d8aec9467a0f3aab207f7a0a8d3193c304f3 100644 (file)
@@ -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 */
index ea2b85f8c5edb648db177c5b676170004966a052..24d321730eb4e49c1cb6fbb2e34eb6fb4e618b29 100644 (file)
@@ -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;
index 3a6aa2289577caeafd5d5537fa4b61fd0ac32ad7..769abd01ce059b28a2285b515f30e526b369ab03 100644 (file)
@@ -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);
index a63f4c38fb68df666a6095ac10fa1095cf891590..7222c673322ce2652f5b371c85faa66860f823f5 100644 (file)
@@ -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);
index 859257e192d5e6ba07f2ae1f1f2652ca61171530..d3d3256312e3c088041405e12f6b2f23fd43fdb8 100644 (file)
@@ -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;
index 4fc0b0ad3ec44eb8c200b34e7ea815a9cd4420cd..a81d52f669842b39b887eb19782b0d7a0f07830b 100644 (file)
@@ -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";
index e640923129a3780bccfaabb0d49f7bc2bc124fcc..ee913877c9661133320409cd69a42729353f9d6e 100644 (file)
@@ -104,39 +104,37 @@ this object
 {
        CValue *ret;
        
-       switch(dtype)
-       {
-       case VALUE_EMPTY_TYPE:
-       case VALUE_BOOL_TYPE:
+       switch (dtype) {
+               case VALUE_EMPTY_TYPE:
+               case VALUE_BOOL_TYPE:
                {
-                       switch(op)
-                       {
-                       case VALUE_AND_OPERATOR:
+                       switch (op) {
+                               case VALUE_AND_OPERATOR:
                                {
                                        ret = new CBoolValue (((CBoolValue *) val)->GetBool() && m_bool);
                                        break;
                                }
-                       case VALUE_OR_OPERATOR:
+                               case VALUE_OR_OPERATOR:
                                {
                                        ret = new CBoolValue (((CBoolValue *) val)->GetBool() || m_bool);
                                        break;
                                }
-                       case VALUE_EQL_OPERATOR:
+                               case VALUE_EQL_OPERATOR:
                                {
                                        ret = new CBoolValue (((CBoolValue *) val)->GetBool() == m_bool);
                                        break;
                                }
-                       case VALUE_NEQ_OPERATOR:
+                               case VALUE_NEQ_OPERATOR:
                                {
                                        ret = new CBoolValue (((CBoolValue *) val)->GetBool() != m_bool);
                                        break;
                                }
-                       case VALUE_NOT_OPERATOR:
+                               case VALUE_NOT_OPERATOR:
                                {
                                        return new CBoolValue (!m_bool);
                                        break;
                                }
-                       default:
+                               default:
                                {
                                        ret =  new CErrorValue(val->GetText() + op2str(op) +
                                                               "[operator not allowed on booleans]");
@@ -145,16 +143,15 @@ this object
                        }
                        break;
                }
-       case VALUE_STRING_TYPE:
+               case VALUE_STRING_TYPE:
                {
-                       switch(op)
-                       {
-                       case VALUE_ADD_OPERATOR:
+                       switch (op) {
+                               case VALUE_ADD_OPERATOR:
                                {
                                        ret = new CStringValue(val->GetText() + GetText(),"");
                                        break;
                                }
-                       default:
+                               default:
                                {
                                        ret =  new CErrorValue(val->GetText() + op2str(op) + "[Only + allowed on boolean and string]");
                                        break;
@@ -162,8 +159,8 @@ this object
                        }
                        break;
                }
-       default:
-               ret =  new CErrorValue("[type mismatch]" + op2str(op) + GetText());
+               default:
+                       ret =  new CErrorValue("[type mismatch]" + op2str(op) + GetText());
        }
 
        return ret;
index c9b59e52ee8ffa0a27f966de7dfc88bbc5c78ea4..b7d7f52815516dc9cadc856b19790faa61939734 100644 (file)
@@ -120,138 +120,134 @@ ret: a new object containing the result of applying operator op to val and
 {
        CValue *ret;
        
-       switch(dtype)
-       {
-       case VALUE_INT_TYPE:
+       switch (dtype) {
+               case VALUE_INT_TYPE:
                {
-                       switch (op)
-                       {
-                       case VALUE_MOD_OPERATOR:
-                               ret = new CFloatValue(fmod(((CIntValue *) val)->GetInt(), m_float));
-                               break;
-                       case VALUE_ADD_OPERATOR:
-                               ret = new CFloatValue(((CIntValue *) val)->GetInt() + m_float);
-                               break;
-                       case VALUE_SUB_OPERATOR:
-                               ret = new CFloatValue(((CIntValue *) val)->GetInt() - m_float);
-                               break;
-                       case VALUE_MUL_OPERATOR:
-                               ret = new CFloatValue(((CIntValue *) val)->GetInt() * m_float);
-                               break;
-                       case VALUE_DIV_OPERATOR:
-                               if (m_float == 0)
-                                       ret = new CErrorValue("Division by zero");
-                               else
-                                       ret = new CFloatValue (((CIntValue *) val)->GetInt() / m_float);
-                               break;
-                       case VALUE_EQL_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() == m_float);
-                               break;
-                       case VALUE_NEQ_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() != m_float);
-                               break;
-                       case VALUE_GRE_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() > m_float);
-                               break;
-                       case VALUE_LES_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() < m_float);
-                               break;
-                       case VALUE_GEQ_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() >= m_float);
-                               break;
-                       case VALUE_LEQ_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() <= m_float);
-                               break;
-                       default:
-                               ret = new CErrorValue("illegal operator. please send a bug report.");
-                               break;
+                       switch (op) {
+                               case VALUE_MOD_OPERATOR:
+                                       ret = new CFloatValue(fmod(((CIntValue *) val)->GetInt(), m_float));
+                                       break;
+                               case VALUE_ADD_OPERATOR:
+                                       ret = new CFloatValue(((CIntValue *) val)->GetInt() + m_float);
+                                       break;
+                               case VALUE_SUB_OPERATOR:
+                                       ret = new CFloatValue(((CIntValue *) val)->GetInt() - m_float);
+                                       break;
+                               case VALUE_MUL_OPERATOR:
+                                       ret = new CFloatValue(((CIntValue *) val)->GetInt() * m_float);
+                                       break;
+                               case VALUE_DIV_OPERATOR:
+                                       if (m_float == 0)
+                                               ret = new CErrorValue("Division by zero");
+                                       else
+                                               ret = new CFloatValue (((CIntValue *) val)->GetInt() / m_float);
+                                       break;
+                               case VALUE_EQL_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() == m_float);
+                                       break;
+                               case VALUE_NEQ_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() != m_float);
+                                       break;
+                               case VALUE_GRE_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() > m_float);
+                                       break;
+                               case VALUE_LES_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() < m_float);
+                                       break;
+                               case VALUE_GEQ_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() >= m_float);
+                                       break;
+                               case VALUE_LEQ_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() <= m_float);
+                                       break;
+                               default:
+                                       ret = new CErrorValue("illegal operator. please send a bug report.");
+                                       break;
                        }
                        break;
                }
-       case VALUE_EMPTY_TYPE:
-       case VALUE_FLOAT_TYPE:
+               case VALUE_EMPTY_TYPE:
+               case VALUE_FLOAT_TYPE:
                {
-                       switch (op)
-                       {
-                       case VALUE_MOD_OPERATOR:
-                               ret = new CFloatValue(fmod(((CFloatValue *) val)->GetFloat(), m_float));
-                               break;
-                       case VALUE_ADD_OPERATOR:
-                               ret = new CFloatValue(((CFloatValue *) val)->GetFloat() + m_float);
-                               break;
-                       case VALUE_SUB_OPERATOR:
-                               ret = new CFloatValue(((CFloatValue *) val)->GetFloat() - m_float);
-                               break;
-                       case VALUE_MUL_OPERATOR:
-                               ret = new CFloatValue(((CFloatValue *) val)->GetFloat() * m_float);
-                               break;
-                       case VALUE_DIV_OPERATOR:
-                               if (m_float == 0)
-                                       ret = new CErrorValue("Division by zero");
-                               else
-                                       ret = new CFloatValue (((CFloatValue *) val)->GetFloat() / m_float);
-                               break;
-                       case VALUE_EQL_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() == m_float);
-                               break;
-                       case VALUE_NEQ_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() != m_float);
-                               break;
-                       case VALUE_GRE_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() > m_float);
-                               break;
-                       case VALUE_LES_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() < m_float);
-                               break;
-                       case VALUE_GEQ_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() >= m_float);
-                               break;
-                       case VALUE_LEQ_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() <= m_float);
-                               break;
-                       case VALUE_NEG_OPERATOR:
-                               ret = new CFloatValue (-m_float);
-                               break;
-                       case VALUE_POS_OPERATOR:
-                               ret = new CFloatValue (m_float);
-                               break;
-                               
-                       default:
-                               ret = new CErrorValue("illegal operator. please send a bug report.");
-                               break;
+                       switch (op) {
+                               case VALUE_MOD_OPERATOR:
+                                       ret = new CFloatValue(fmod(((CFloatValue *) val)->GetFloat(), m_float));
+                                       break;
+                               case VALUE_ADD_OPERATOR:
+                                       ret = new CFloatValue(((CFloatValue *) val)->GetFloat() + m_float);
+                                       break;
+                               case VALUE_SUB_OPERATOR:
+                                       ret = new CFloatValue(((CFloatValue *) val)->GetFloat() - m_float);
+                                       break;
+                               case VALUE_MUL_OPERATOR:
+                                       ret = new CFloatValue(((CFloatValue *) val)->GetFloat() * m_float);
+                                       break;
+                               case VALUE_DIV_OPERATOR:
+                                       if (m_float == 0)
+                                               ret = new CErrorValue("Division by zero");
+                                       else
+                                               ret = new CFloatValue (((CFloatValue *) val)->GetFloat() / m_float);
+                                       break;
+                               case VALUE_EQL_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() == m_float);
+                                       break;
+                               case VALUE_NEQ_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() != m_float);
+                                       break;
+                               case VALUE_GRE_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() > m_float);
+                                       break;
+                               case VALUE_LES_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() < m_float);
+                                       break;
+                               case VALUE_GEQ_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() >= m_float);
+                                       break;
+                               case VALUE_LEQ_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() <= m_float);
+                                       break;
+                               case VALUE_NEG_OPERATOR:
+                                       ret = new CFloatValue (-m_float);
+                                       break;
+                               case VALUE_POS_OPERATOR:
+                                       ret = new CFloatValue (m_float);
+                                       break;
+
+                               default:
+                                       ret = new CErrorValue("illegal operator. please send a bug report.");
+                                       break;
                        }
                        break;
                }
-       case VALUE_STRING_TYPE:
+               case VALUE_STRING_TYPE:
                {
-                       switch(op)
-                       {
-                       case VALUE_ADD_OPERATOR:
-                               ret = new CStringValue(val->GetText() + GetText(),"");
-                               break;
-                       case VALUE_EQL_OPERATOR:
-                       case VALUE_NEQ_OPERATOR:
-                       case VALUE_GRE_OPERATOR:
-                       case VALUE_LES_OPERATOR:
-                       case VALUE_GEQ_OPERATOR:
-                       case VALUE_LEQ_OPERATOR:
-                               ret = new CErrorValue("[Cannot compare string with float]" + op2str(op) + GetText());
-                               break;
-                       default:
-                               ret =  new CErrorValue("[operator not allowed on strings]" + op2str(op) + GetText());
-                               break;
+                       switch (op) {
+                               case VALUE_ADD_OPERATOR:
+                                       ret = new CStringValue(val->GetText() + GetText(),"");
+                                       break;
+                               case VALUE_EQL_OPERATOR:
+                               case VALUE_NEQ_OPERATOR:
+                               case VALUE_GRE_OPERATOR:
+                               case VALUE_LES_OPERATOR:
+                               case VALUE_GEQ_OPERATOR:
+                               case VALUE_LEQ_OPERATOR:
+                                       ret = new CErrorValue("[Cannot compare string with float]" + op2str(op) + GetText());
+                                       break;
+                               default:
+                                       ret =  new CErrorValue("[operator not allowed on strings]" + op2str(op) + GetText());
+                                       break;
                        }
                        break;
                }
-       case VALUE_BOOL_TYPE:
-               ret =  new CErrorValue("[operator not valid on boolean and float]" + op2str(op) + GetText());
-               break;
-       case VALUE_ERROR_TYPE:
-               ret = new CErrorValue(val->GetText() + op2str(op) + GetText());
-               break;
-       default:
-               ret = new CErrorValue("illegal type. contact your dealer (if any)");
-               break;
+               case VALUE_BOOL_TYPE:
+                       ret =  new CErrorValue("[operator not valid on boolean and float]" + op2str(op) + GetText());
+                       break;
+               case VALUE_ERROR_TYPE:
+                       ret = new CErrorValue(val->GetText() + op2str(op) + GetText());
+                       break;
+               default:
+                       ret = new CErrorValue("illegal type. contact your dealer (if any)");
+                       break;
        }
        return ret;
 }
index bdf4ee4605b95fcc68827a6e41526318010abd31..0a5af4a18ea01c289662c3229f7366927e4a7169 100644 (file)
@@ -187,11 +187,10 @@ void CParser::NextSym()
        //   sets the global variable cellcoord to the kind of operator
        
        errmsg = NULL;
-       while(ch == ' ' || ch == 0x9)
+       while (ch == ' ' || ch == 0x9)
                NextCh();
 
-       switch(ch)
-       {
+       switch (ch) {
                case '(':
                        sym = lbracksym; NextCh();
                        break;
@@ -359,7 +358,7 @@ STR_String CParser::Symbol2Str(int s)
 {
        // returns a string representation of of symbol s,
        // for use in Term when generating an error
-       switch(s) {
+       switch (s) {
                case errorsym: return "error";
                case lbracksym: return "(";
                case rbracksym: return ")";
@@ -394,7 +393,7 @@ int CParser::Priority(int optorkind)
 {
        // returns the priority of an operator
        // higher number means higher priority
-       switch(optorkind) {
+       switch (optorkind) {
                case OPor: return 1;
                case OPand: return 2;
                case OPgreater:
@@ -426,102 +425,103 @@ CExpression *CParser::Ex(int i)
                        opkind2 = opkind;
                        NextSym();
                        e2 = Ex(i + 1);
-                       switch(opkind2) {
-                       case OPmodulus: e1 = new COperator2Expr(VALUE_MOD_OPERATOR,e1, e2); break;
-                       case OPplus: e1 = new COperator2Expr(VALUE_ADD_OPERATOR,e1, e2); break;
-                       case OPminus: e1 = new COperator2Expr(VALUE_SUB_OPERATOR,e1, e2); break;
-                       case OPtimes:   e1 = new COperator2Expr(VALUE_MUL_OPERATOR,e1, e2); break;
-                       case OPdivide: e1 = new COperator2Expr(VALUE_DIV_OPERATOR,e1, e2); break;
-                       case OPand: e1 = new COperator2Expr(VALUE_AND_OPERATOR,e1, e2); break;
-                       case OPor: e1 = new COperator2Expr(VALUE_OR_OPERATOR,e1, e2); break;
-                       case OPequal: e1 = new COperator2Expr(VALUE_EQL_OPERATOR,e1, e2); break;
-                       case OPunequal: e1 = new COperator2Expr(VALUE_NEQ_OPERATOR,e1, e2); break;
-                       case OPgreater: e1 = new COperator2Expr(VALUE_GRE_OPERATOR,e1, e2); break;
-                       case OPless: e1 = new COperator2Expr(VALUE_LES_OPERATOR,e1, e2); break;
-                       case OPgreaterequal: e1 = new COperator2Expr(VALUE_GEQ_OPERATOR,e1, e2); break;
-                       case OPlessequal: e1 = new COperator2Expr(VALUE_LEQ_OPERATOR,e1, e2); break;
-                       default: MT_assert(false);      break; // should not happen
+                       switch (opkind2) {
+                               case OPmodulus: e1 = new COperator2Expr(VALUE_MOD_OPERATOR,e1, e2); break;
+                               case OPplus: e1 = new COperator2Expr(VALUE_ADD_OPERATOR,e1, e2); break;
+                               case OPminus: e1 = new COperator2Expr(VALUE_SUB_OPERATOR,e1, e2); break;
+                               case OPtimes:   e1 = new COperator2Expr(VALUE_MUL_OPERATOR,e1, e2); break;
+                               case OPdivide: e1 = new COperator2Expr(VALUE_DIV_OPERATOR,e1, e2); break;
+                               case OPand: e1 = new COperator2Expr(VALUE_AND_OPERATOR,e1, e2); break;
+                               case OPor: e1 = new COperator2Expr(VALUE_OR_OPERATOR,e1, e2); break;
+                               case OPequal: e1 = new COperator2Expr(VALUE_EQL_OPERATOR,e1, e2); break;
+                               case OPunequal: e1 = new COperator2Expr(VALUE_NEQ_OPERATOR,e1, e2); break;
+                               case OPgreater: e1 = new COperator2Expr(VALUE_GRE_OPERATOR,e1, e2); break;
+                               case OPless: e1 = new COperator2Expr(VALUE_LES_OPERATOR,e1, e2); break;
+                               case OPgreaterequal: e1 = new COperator2Expr(VALUE_GEQ_OPERATOR,e1, e2); break;
+                               case OPlessequal: e1 = new COperator2Expr(VALUE_LEQ_OPERATOR,e1, e2); break;
+                               default: MT_assert(false);      break; // should not happen
                        }
                }
        } else if (i == NUM_PRIORITY) {
-               if ((sym == opsym) 
-                       && ( (opkind == OPminus) || (opkind == OPnot) || (opkind == OPplus) ) 
-                       )
+               if ((sym == opsym)
+                   && ( (opkind == OPminus) || (opkind == OPnot) || (opkind == OPplus) )
+                   )
                {
                        NextSym();
-                       switch(opkind) {
-                       /* +1 is also a valid number! */
-                       case OPplus: e1 = new COperator1Expr(VALUE_POS_OPERATOR, Ex(NUM_PRIORITY)); break;
-                       case OPminus: e1 = new COperator1Expr(VALUE_NEG_OPERATOR, Ex(NUM_PRIORITY)); break;
-                       case OPnot: e1 = new COperator1Expr(VALUE_NOT_OPERATOR, Ex(NUM_PRIORITY)); break;
-                       default: {
-                                               // should not happen
-                                               e1 = Error("operator +, - or ! expected");
-                                        }
+                       switch (opkind) {
+                               /* +1 is also a valid number! */
+                               case OPplus: e1 = new COperator1Expr(VALUE_POS_OPERATOR, Ex(NUM_PRIORITY)); break;
+                               case OPminus: e1 = new COperator1Expr(VALUE_NEG_OPERATOR, Ex(NUM_PRIORITY)); break;
+                               case OPnot: e1 = new COperator1Expr(VALUE_NOT_OPERATOR, Ex(NUM_PRIORITY)); break;
+                               default:
+                               {
+                                       // should not happen
+                                       e1 = Error("operator +, - or ! expected");
+                               }
                        }
                }
                else {
-                       switch(sym) {
-                       case constsym: {
-                               switch(constkind) {
-                               case booltype:
-                                       e1 = new CConstExpr(new CBoolValue(boolvalue));
-                                       break;
-                               case inttype:
-                                       {
-                                               cInt temp;
-                                               temp = strtoll(const_as_string, NULL, 10); /* atoi is for int only */
-                                               e1 = new CConstExpr(new CIntValue(temp));
-                                               break;
-                                       }
-                               case floattype:
-                                       {
-                                               double temp;
-                                               temp = atof(const_as_string);
-                                               e1 = new CConstExpr(new CFloatValue(temp));
-                                               break;
+                       switch (sym) {
+                               case constsym: {
+                                       switch (constkind) {
+                                               case booltype:
+                                                       e1 = new CConstExpr(new CBoolValue(boolvalue));
+                                                       break;
+                                               case inttype:
+                                               {
+                                                       cInt temp;
+                                                       temp = strtoll(const_as_string, NULL, 10); /* atoi is for int only */
+                                                       e1 = new CConstExpr(new CIntValue(temp));
+                                                       break;
+                                               }
+                                               case floattype:
+                                               {
+                                                       double temp;
+                                                       temp = atof(const_as_string);
+                                                       e1 = new CConstExpr(new CFloatValue(temp));
+                                                       break;
+                                               }
+                                               case stringtype:
+                                                       e1 = new CConstExpr(new CStringValue(const_as_string,""));
+                                                       break;
+                                               default :
+                                                       MT_assert(false);
+                                                       break;
                                        }
-                               case stringtype:
-                                       e1 = new CConstExpr(new CStringValue(const_as_string,""));
-                                       break;
-                               default :
-                                       MT_assert(false);
+                                       NextSym();
                                        break;
                                }
-                               NextSym();
-                               break;
-                                                  }
-                       case lbracksym:
-                               NextSym();
-                               e1 = Ex(1);
-                               Term(rbracksym);
-                               break;
-                       case ifsym:
-                       {
-                               CExpression *e3;
-                               NextSym();
-                               Term(lbracksym);
-                               e1 = Ex(1);
-                               Term(commasym);
-                               e2 = Ex(1);
-                               if (sym == commasym) {
+                               case lbracksym:
                                        NextSym();
-                                       e3 = Ex(1);
-                               } else {
-                                       e3 = new CConstExpr(new CEmptyValue());
+                                       e1 = Ex(1);
+                                       Term(rbracksym);
+                                       break;
+                               case ifsym:
+                               {
+                                       CExpression *e3;
+                                       NextSym();
+                                       Term(lbracksym);
+                                       e1 = Ex(1);
+                                       Term(commasym);
+                                       e2 = Ex(1);
+                                       if (sym == commasym) {
+                                               NextSym();
+                                               e3 = Ex(1);
+                                       } else {
+                                               e3 = new CConstExpr(new CEmptyValue());
+                                       }
+                                       Term(rbracksym);
+                                       e1 = new CIfExpr(e1, e2, e3);
+                                       break;
                                }
-                               Term(rbracksym);
-                               e1 = new CIfExpr(e1, e2, e3);
-                               break;
-                       }
-                       case idsym:
+                               case idsym:
                                {
                                        e1 = new CIdentifierExpr(const_as_string,m_identifierContext);
                                        NextSym();
                                        
                                        break;
                                }
-                       case errorsym:
+                               case errorsym:
                                {
                                        MT_assert(!e1);
                                        STR_String errtext="[no info]";
@@ -530,7 +530,7 @@ CExpression *CParser::Ex(int i)
                                                CValue* errmsgval = errmsg->Calculate();
                                                errtext=errmsgval->GetText();
                                                errmsgval->Release();
-                                       
+
                                                //e1 = Error(errmsg->Calculate()->GetText());//new CConstExpr(errmsg->Calculate());
                                                
                                                if ( !(errmsg->Release()) )
@@ -545,11 +545,11 @@ CExpression *CParser::Ex(int i)
 
                                        break;
                                }
-                       default:
-                               NextSym();
-                               //return Error("Expression expected");
-                               MT_assert(!e1);
-                               e1 = Error("Expression expected");
+                               default:
+                                       NextSym();
+                                       //return Error("Expression expected");
+                                       MT_assert(!e1);
+                                       e1 = Error("Expression expected");
                        }
                }
        }
index 12d6e258ddf708d5367a86f7a4bbe4ecbc9612de..cb6bc556bab5f9ff9e311b13853566accb8daf43 100644 (file)
@@ -108,165 +108,160 @@ object and val
        }
 }
 
-
-
-CValue* CIntValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val)
 /*
-pre: the type of val is dtype
-ret: a new object containing the result of applying operator op to val and
-this object
-*/
+ * pre: the type of val is dtype
+ * ret: a new object containing the result of applying operator op to val and
+ * this object
+ */
+CValue* CIntValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val)
 {
        CValue *ret;
        
-       switch(dtype) {
-       case VALUE_EMPTY_TYPE:
-       case VALUE_INT_TYPE:
+       switch (dtype) {
+               case VALUE_EMPTY_TYPE:
+               case VALUE_INT_TYPE:
                {
                        switch (op) {
-                       case VALUE_MOD_OPERATOR:
-                               ret = new CIntValue (((CIntValue *) val)->GetInt() % m_int);
-                               break;
-                       case VALUE_ADD_OPERATOR:
-                               ret = new CIntValue (((CIntValue *) val)->GetInt() + m_int);
-                               break;
-                       case VALUE_SUB_OPERATOR:
-                               ret = new CIntValue (((CIntValue *) val)->GetInt() - m_int);
-                               break;
-                       case VALUE_MUL_OPERATOR:
-                               ret = new CIntValue (((CIntValue *) val)->GetInt() * m_int);
-                               break;
-                       case VALUE_DIV_OPERATOR:
-                               if (m_int == 0)
-                               {
-                                       if (val->GetNumber() == 0)
-                                       {
-                                               ret = new CErrorValue("Not a Number");
-                                       } else
-                                       {
-                                               ret = new CErrorValue("Division by zero");
+                               case VALUE_MOD_OPERATOR:
+                                       ret = new CIntValue (((CIntValue *) val)->GetInt() % m_int);
+                                       break;
+                               case VALUE_ADD_OPERATOR:
+                                       ret = new CIntValue (((CIntValue *) val)->GetInt() + m_int);
+                                       break;
+                               case VALUE_SUB_OPERATOR:
+                                       ret = new CIntValue (((CIntValue *) val)->GetInt() - m_int);
+                                       break;
+                               case VALUE_MUL_OPERATOR:
+                                       ret = new CIntValue (((CIntValue *) val)->GetInt() * m_int);
+                                       break;
+                               case VALUE_DIV_OPERATOR:
+                                       if (m_int == 0) {
+                                               if (val->GetNumber() == 0) {
+                                                       ret = new CErrorValue("Not a Number");
+                                               }
+                                               else {
+                                                       ret = new CErrorValue("Division by zero");
+                                               }
                                        }
-                               }
-                               else
-                                       ret = new CIntValue (((CIntValue *) val)->GetInt() / m_int);
-                               break;
-                       case VALUE_EQL_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() == m_int);
-                               break;
-                       case VALUE_NEQ_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() != m_int);
-                               break;
-                       case VALUE_GRE_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() > m_int);
-                               break;
-                       case VALUE_LES_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() < m_int);
-                               break;
-                       case VALUE_GEQ_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() >= m_int);
-                               break;
-                       case VALUE_LEQ_OPERATOR:
-                               ret = new CBoolValue(((CIntValue *) val)->GetInt() <= m_int);
-                               break;
-                       case VALUE_NEG_OPERATOR:
-                               ret = new CIntValue (-m_int);
-                               break;
-                       case VALUE_POS_OPERATOR:
-                               ret = new CIntValue (m_int);
-                               break;
-                       default:
-                               ret = new CErrorValue("illegal operator. please send a bug report.");
-                               break;
+                                       else
+                                               ret = new CIntValue (((CIntValue *) val)->GetInt() / m_int);
+                                       break;
+                               case VALUE_EQL_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() == m_int);
+                                       break;
+                               case VALUE_NEQ_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() != m_int);
+                                       break;
+                               case VALUE_GRE_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() > m_int);
+                                       break;
+                               case VALUE_LES_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() < m_int);
+                                       break;
+                               case VALUE_GEQ_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() >= m_int);
+                                       break;
+                               case VALUE_LEQ_OPERATOR:
+                                       ret = new CBoolValue(((CIntValue *) val)->GetInt() <= m_int);
+                                       break;
+                               case VALUE_NEG_OPERATOR:
+                                       ret = new CIntValue (-m_int);
+                                       break;
+                               case VALUE_POS_OPERATOR:
+                                       ret = new CIntValue (m_int);
+                                       break;
+                               default:
+                                       ret = new CErrorValue("illegal operator. please send a bug report.");
+                                       break;
                        }
                        break;
                }
-       case VALUE_FLOAT_TYPE:
+               case VALUE_FLOAT_TYPE:
                {
                        switch (op) {
-                       case VALUE_MOD_OPERATOR:
-                               ret = new CFloatValue(fmod(((CFloatValue *) val)->GetFloat(), m_int));
-                               break;
-                       case VALUE_ADD_OPERATOR:
-                               ret = new CFloatValue (((CFloatValue *) val)->GetFloat() + m_int);
-                               break;
-                       case VALUE_SUB_OPERATOR:
-                               ret = new CFloatValue (((CFloatValue *) val)->GetFloat() - m_int);
-                               break;
-                       case VALUE_MUL_OPERATOR:
-                               ret = new CFloatValue (((CFloatValue *) val)->GetFloat() * m_int);
-                               break;
-                       case VALUE_DIV_OPERATOR:
-                               if (m_int == 0)
-                                       ret = new CErrorValue("Division by zero");
-                               else
-                                       ret = new CFloatValue (((CFloatValue *) val)->GetFloat() / m_int);
-                               break;
-                       case VALUE_EQL_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() == m_int);
-                               break;
-                       case VALUE_NEQ_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() != m_int);
-                               break;
-                       case VALUE_GRE_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() > m_int);
-                               break;
-                       case VALUE_LES_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() < m_int);
-                               break;
-                       case VALUE_GEQ_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() >= m_int);
-                               break;
-                       case VALUE_LEQ_OPERATOR:
-                               ret = new CBoolValue(((CFloatValue *) val)->GetFloat() <= m_int);
-                               break;
-                       default:
-                               ret = new CErrorValue("illegal operator. please send a bug report.");
-                               break;
+                               case VALUE_MOD_OPERATOR:
+                                       ret = new CFloatValue(fmod(((CFloatValue *) val)->GetFloat(), m_int));
+                                       break;
+                               case VALUE_ADD_OPERATOR:
+                                       ret = new CFloatValue (((CFloatValue *) val)->GetFloat() + m_int);
+                                       break;
+                               case VALUE_SUB_OPERATOR:
+                                       ret = new CFloatValue (((CFloatValue *) val)->GetFloat() - m_int);
+                                       break;
+                               case VALUE_MUL_OPERATOR:
+                                       ret = new CFloatValue (((CFloatValue *) val)->GetFloat() * m_int);
+                                       break;
+                               case VALUE_DIV_OPERATOR:
+                                       if (m_int == 0)
+                                               ret = new CErrorValue("Division by zero");
+                                       else
+                                               ret = new CFloatValue (((CFloatValue *) val)->GetFloat() / m_int);
+                                       break;
+                               case VALUE_EQL_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() == m_int);
+                                       break;
+                               case VALUE_NEQ_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() != m_int);
+                                       break;
+                               case VALUE_GRE_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() > m_int);
+                                       break;
+                               case VALUE_LES_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() < m_int);
+                                       break;
+                               case VALUE_GEQ_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() >= m_int);
+                                       break;
+                               case VALUE_LEQ_OPERATOR:
+                                       ret = new CBoolValue(((CFloatValue *) val)->GetFloat() <= m_int);
+                                       break;
+                               default:
+                                       ret = new CErrorValue("illegal operator. please send a bug report.");
+                                       break;
                        }
                        break;
                }
-       case VALUE_STRING_TYPE:
+               case VALUE_STRING_TYPE:
                {
-                       switch(op) {
-                       case VALUE_ADD_OPERATOR:
-                               ret = new CStringValue(val->GetText() + GetText(),"");
-                               break;
-                       case VALUE_EQL_OPERATOR:
-                       case VALUE_NEQ_OPERATOR:
-                       case VALUE_GRE_OPERATOR:
-                       case VALUE_LES_OPERATOR:
-                       case VALUE_GEQ_OPERATOR:
-                       case VALUE_LEQ_OPERATOR:
-                               ret = new CErrorValue("[Cannot compare string with integer]" + op2str(op) + GetText());
-                               break;
-                       default:
-                               ret =  new CErrorValue("[operator not allowed on strings]" + op2str(op) + GetText());
-                               break;
+                       switch (op) {
+                               case VALUE_ADD_OPERATOR:
+                                       ret = new CStringValue(val->GetText() + GetText(),"");
+                                       break;
+                               case VALUE_EQL_OPERATOR:
+                               case VALUE_NEQ_OPERATOR:
+                               case VALUE_GRE_OPERATOR:
+                               case VALUE_LES_OPERATOR:
+                               case VALUE_GEQ_OPERATOR:
+                               case VALUE_LEQ_OPERATOR:
+                                       ret = new CErrorValue("[Cannot compare string with integer]" + op2str(op) + GetText());
+                                       break;
+                               default:
+                                       ret =  new CErrorValue("[operator not allowed on strings]" + op2str(op) + GetText());
+                                       break;
                        }
                        break;
                }
-       case VALUE_BOOL_TYPE:
-               ret =  new CErrorValue("[operator not valid on boolean and integer]" + op2str(op) + GetText());
-               break;
-               /*
+               case VALUE_BOOL_TYPE:
+                       ret =  new CErrorValue("[operator not valid on boolean and integer]" + op2str(op) + GetText());
+                       break;
+#if 0
                case VALUE_EMPTY_TYPE:
                {
-               switch(op) {
-               
-                 case VALUE_ADD_OPERATOR:
-                 ret = new CIntValue (m_int);
-                 break;
-                 case VALUE_SUB_OPERATOR:
-                 ret = new CIntValue (-m_int);
-                 break;
-                 default:
-                 {
-                 ret = new CErrorValue(op2str(op) +    GetText());
-                 }
-                 }
-                 break;
-                 }
-               */
+                       switch (op) {
+                               case VALUE_ADD_OPERATOR:
+                                       ret = new CIntValue (m_int);
+                                       break;
+                               case VALUE_SUB_OPERATOR:
+                                       ret = new CIntValue (-m_int);
+                                       break;
+                               default:
+                               {
+                                       ret = new CErrorValue(op2str(op) +      GetText());
+                               }
+                       }
+                       break;
+               }
+#endif
        case VALUE_ERROR_TYPE:
                ret = new CErrorValue(val->GetText() + op2str(op) +     GetText());
                break;
index 6bb2f039b5c40641237935b57a366653db48aac3..bb1d0a31c1f5a0cffe133b2d04e184d0a54b395e 100644 (file)
@@ -170,7 +170,7 @@ PyObject *PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObject
         *
         * */
        base_type= Py_TYPE(base);
-       while(base_type && !BGE_PROXY_CHECK_TYPE(base_type))
+       while (base_type && !BGE_PROXY_CHECK_TYPE(base_type))
                base_type= base_type->tp_base;
 
        if (base_type==NULL || !BGE_PROXY_CHECK_TYPE(base_type)) {
@@ -1198,8 +1198,7 @@ void PyObjectPlus::ClearDeprecationWarning()
        WarnLink *wlink_next;
        WarnLink *wlink = GetDeprecationWarningLinkFirst();
        
-       while(wlink)
-       {
+       while (wlink) {
                wlink->warn_done= false; /* no need to NULL the link, its cleared before adding to the list next time round */
                wlink_next= reinterpret_cast<WarnLink *>(wlink->link);
                wlink->link= NULL;
index 2e29a39222b6ea8024c289f3407d8dcfa1389421..166125bc906342d0171470408e46ef323f89db59 100644 (file)
@@ -77,33 +77,34 @@ CValue* CStringValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue
                        ret = new CErrorValue(val->GetText() + op2str(op) +     GetText());
                else
                        ret = new CStringValue(val->GetText() + GetText(),"");
-       } else {
-               
+       }
+       else {
                if (dtype == VALUE_STRING_TYPE || dtype == VALUE_EMPTY_TYPE) {
-                       switch(op) {
-                       case VALUE_EQL_OPERATOR:
-                               ret = new CBoolValue(val->GetText() == GetText());
-                               break;
-                       case VALUE_NEQ_OPERATOR:
-                               ret = new CBoolValue(val->GetText() != GetText());
-                               break;
-                       case VALUE_GRE_OPERATOR:
-                               ret = new CBoolValue(val->GetText() > GetText());
-                               break;
-                       case VALUE_LES_OPERATOR:
-                               ret = new CBoolValue(val->GetText() < GetText());
-                               break;
-                       case VALUE_GEQ_OPERATOR:
-                               ret = new CBoolValue(val->GetText() >= GetText());
-                               break;
-                       case VALUE_LEQ_OPERATOR:
-                               ret = new CBoolValue(val->GetText() <= GetText());
-                               break;
-                       default:
-                               ret =  new CErrorValue(val->GetText() + op2str(op) + "[operator not allowed on strings]");
-                               break;
+                       switch (op) {
+                               case VALUE_EQL_OPERATOR:
+                                       ret = new CBoolValue(val->GetText() == GetText());
+                                       break;
+                               case VALUE_NEQ_OPERATOR:
+                                       ret = new CBoolValue(val->GetText() != GetText());
+                                       break;
+                               case VALUE_GRE_OPERATOR:
+                                       ret = new CBoolValue(val->GetText() > GetText());
+                                       break;
+                               case VALUE_LES_OPERATOR:
+                                       ret = new CBoolValue(val->GetText() < GetText());
+                                       break;
+                               case VALUE_GEQ_OPERATOR:
+                                       ret = new CBoolValue(val->GetText() >= GetText());
+                                       break;
+                               case VALUE_LEQ_OPERATOR:
+                                       ret = new CBoolValue(val->GetText() <= GetText());
+                                       break;
+                               default:
+                                       ret =  new CErrorValue(val->GetText() + op2str(op) + "[operator not allowed on strings]");
+                                       break;
                        }
-               } else {
+               }
+               else {
                        ret =  new CErrorValue(val->GetText() + op2str(op) + "[operator not allowed on strings]");
                }
        }
index ed13b0c8639bd5c8e8faf914a9aa6859d685bcdd..612de658ce91a94aaa6d2c4d1256938051105933 100644 (file)
@@ -96,61 +96,60 @@ CValue* CVectorValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue
 {
        CValue *ret = NULL;
        
-       switch(op)
-       { 
-       case VALUE_ADD_OPERATOR: 
+       switch (op) {
+               case VALUE_ADD_OPERATOR:
                {
                        switch (dtype)
                        {
-                       case VALUE_EMPTY_TYPE:
-                       case VALUE_VECTOR_TYPE: 
+                               case VALUE_EMPTY_TYPE:
+                               case VALUE_VECTOR_TYPE:
                                {
                                        ret = new CVectorValue(
-                                               val->GetVector3()[KX_X] + GetVector3()[KX_X],
-                                               val->GetVector3()[KX_Y] + GetVector3()[KX_Y],
-                                               val->GetVector3()[KX_Z] + GetVector3()[KX_Z],
-                                               CValue::HEAPVALUE);
+                                                   val->GetVector3()[KX_X] + GetVector3()[KX_X],
+                                                   val->GetVector3()[KX_Y] + GetVector3()[KX_Y],
+                                                   val->GetVector3()[KX_Z] + GetVector3()[KX_Z],
+                                                   CValue::HEAPVALUE);
                                        ret->SetName(GetName());
                                        break;
                                }
-                       
-                       default: 
-                               ret = new CErrorValue(val->GetText() + op2str(op) +     GetText());
+
+                               default:
+                                       ret = new CErrorValue(val->GetText() + op2str(op) +     GetText());
                        }
                        break;
                }
-       case VALUE_MUL_OPERATOR:
+               case VALUE_MUL_OPERATOR:
                {
                        switch (dtype)
                        {
                                
-                       case VALUE_EMPTY_TYPE:
-                       case VALUE_VECTOR_TYPE: 
+                               case VALUE_EMPTY_TYPE:
+                               case VALUE_VECTOR_TYPE:
                                {
                                        //MT_Vector3 supports 'scaling' by another vector, instead of using general transform, Gino?
                                        //ret = new CVectorValue(val->GetVector3().Scaled(GetVector3()),GetName());
                                        break;
                                }
-                       case VALUE_FLOAT_TYPE: 
+                               case VALUE_FLOAT_TYPE:
                                {
                                        ret = new CVectorValue(
-                                               val->GetVector3()[KX_X] * GetVector3()[KX_X],
-                                               val->GetVector3()[KX_Y] * GetVector3()[KX_Y],
-                                               val->GetVector3()[KX_Z] * GetVector3()[KX_Z],
-                                               CValue::HEAPVALUE);
+                                                   val->GetVector3()[KX_X] * GetVector3()[KX_X],
+                                                   val->GetVector3()[KX_Y] * GetVector3()[KX_Y],
+                                                   val->GetVector3()[KX_Z] * GetVector3()[KX_Z],
+                                                   CValue::HEAPVALUE);
                                        ret->SetName(GetName());
                                        break;
                                }
-                       
-                       default: 
-                               ret = new CErrorValue(val->GetText() + op2str(op) +     GetText());
+
+                               default:
+                                       ret = new CErrorValue(val->GetText() + op2str(op) +     GetText());
                        }
                        break;
 
                }
-       
-       default:
-               ret = new CErrorValue(val->GetText() + op2str(op) +     GetText());
+
+               default:
+                       ret = new CErrorValue(val->GetText() + op2str(op) +     GetText());
        }
 
        
index efe76c3eb46df72713e0d3918fbd44d4e861d6cc..21619d8c63fd18a5c1a581c0afdf3a69318f466f 100644 (file)
@@ -89,8 +89,7 @@ void SCA_Joystick::HandleEvents(void)
                        SCA_Joystick::m_instance[i]->OnNothing(&sdl_event);
        }
        
-       while(SDL_PollEvent(&sdl_event))
-       {
+       while (SDL_PollEvent(&sdl_event)) {
                /* Note! m_instance[sdl_event.jaxis.which]
                 * will segfault if over JOYINDEX_MAX, not too nice but what are the chances? */
                
@@ -100,28 +99,27 @@ void SCA_Joystick::HandleEvents(void)
                /* Note!, if you manage to press and release a button within 1 logic tick
                 * it wont work as it should */
                
-               switch(sdl_event.type)
-               {
-               case SDL_JOYAXISMOTION:
-                       SCA_Joystick::m_instance[sdl_event.jaxis.which]->OnAxisMotion(&sdl_event);
-                       break;
-               case SDL_JOYHATMOTION:
-                       SCA_Joystick::m_instance[sdl_event.jhat.which]->OnHatMotion(&sdl_event);
-                       break;
-               case SDL_JOYBUTTONUP:
-                       SCA_Joystick::m_instance[sdl_event.jbutton.which]->OnButtonUp(&sdl_event);
-                       break;
-               case SDL_JOYBUTTONDOWN:
-                       SCA_Joystick::m_instance[sdl_event.jbutton.which]->OnButtonDown(&sdl_event);
-                       break;
+               switch (sdl_event.type) {
+                       case SDL_JOYAXISMOTION:
+                               SCA_Joystick::m_instance[sdl_event.jaxis.which]->OnAxisMotion(&sdl_event);
+                               break;
+                       case SDL_JOYHATMOTION:
+                               SCA_Joystick::m_instance[sdl_event.jhat.which]->OnHatMotion(&sdl_event);
+                               break;
+                       case SDL_JOYBUTTONUP:
+                               SCA_Joystick::m_instance[sdl_event.jbutton.which]->OnButtonUp(&sdl_event);
+                               break;
+                       case SDL_JOYBUTTONDOWN:
+                               SCA_Joystick::m_instance[sdl_event.jbutton.which]->OnButtonDown(&sdl_event);
+                               break;
 #if 0  /* Not used yet */
-               case SDL_JOYBALLMOTION:
-                       SCA_Joystick::m_instance[sdl_event.jball.which]->OnBallMotion(&sdl_event);
-                       break;
+                       case SDL_JOYBALLMOTION:
+                               SCA_Joystick::m_instance[sdl_event.jball.which]->OnBallMotion(&sdl_event);
+                               break;
 #endif
-               default:
-                       printf("SCA_Joystick::HandleEvents, Unknown SDL event, this should not happen\n");
-                       break;
+                       default:
+                               printf("SCA_Joystick::HandleEvents, Unknown SDL event, this should not happen\n");
+                               break;
                }
        }
 }
index 7e9a4bc903c61f26d4ab3220bfb3739cb2908490..b4e461a9c2be3d0c45f34300c7d5a961ab50a3d8 100644 (file)
@@ -113,21 +113,21 @@ bool SCA_JoystickSensor::Evaluate()
                return false;
        
        m_reset = false;
-       switch(m_joymode)
-       {
-       case KX_JOYSENSORMODE_AXIS:
+
+       switch (m_joymode) {
+               case KX_JOYSENSORMODE_AXIS:
                {
-               /* what is what!
-                       m_axisf == JOYAXIS_RIGHT, JOYAXIS_UP, JOYAXIS_DOWN, JOYAXIS_LEFT
-                       m_axisf == 1 == up
-                       m_axisf == 2 == left
-                       m_axisf == 3 == down
-                       
-                       numberof== m_axis (1-4), range is half of JOYAXIS_MAX since 
-                               it assumes the axis joysticks are axis parirs (0,1), (2,3), etc
-                               also note that this starts at 1 where functions its used
-                               with expect a zero index.
-                       */
+                       /* what is what!
+                        *  m_axisf == JOYAXIS_RIGHT, JOYAXIS_UP, JOYAXIS_DOWN, JOYAXIS_LEFT
+                        *  m_axisf == 1 == up
+                        *  m_axisf == 2 == left
+                        *  m_axisf == 3 == down
+                        *
+                        *  numberof== m_axis (1-4), range is half of JOYAXIS_MAX since
+                        *      it assumes the axis joysticks are axis parirs (0,1), (2,3), etc
+                        *      also note that this starts at 1 where functions its used
+                        *      with expect a zero index.
+                        */
                        
                        if (!js->IsTrigAxis() && !reset) /* No events from SDL? - don't bother */
                                return false;
@@ -159,7 +159,7 @@ bool SCA_JoystickSensor::Evaluate()
                        }
                        break;
                }
-       case KX_JOYSENSORMODE_AXIS_SINGLE:
+               case KX_JOYSENSORMODE_AXIS_SINGLE:
                {
                        /* Like KX_JOYSENSORMODE_AXIS but don't pair up axis */
                        if (!js->IsTrigAxis() && !reset) /* No events from SDL? - don't bother */
@@ -179,12 +179,12 @@ bool SCA_JoystickSensor::Evaluate()
                        }
                        break;
                }
-               
-       case KX_JOYSENSORMODE_BUTTON:
+
+               case KX_JOYSENSORMODE_BUTTON:
                {
-               /* what is what!
-                       m_button = the actual button in question
-                       */
+                       /* what is what!
+                        *  m_button = the actual button in question
+                        */
                        if (!js->IsTrigButton() && !reset) /* No events from SDL? - don't bother */
                                return false;
                        
@@ -200,12 +200,12 @@ bool SCA_JoystickSensor::Evaluate()
                        }
                        break;
                }
-       case KX_JOYSENSORMODE_HAT:
+               case KX_JOYSENSORMODE_HAT:
                {
-               /* what is what!
-                       numberof = m_hat  -- max 4
-                       direction= m_hatf -- max 12
-                       */
+                       /* what is what!
+                        *  numberof = m_hat  -- max 4
+                        *  direction= m_hatf -- max 12
+                        */
                        
                        if (!js->IsTrigHat() && !reset) /* No events from SDL? - don't bother */
                                return false;
@@ -222,18 +222,19 @@ bool SCA_JoystickSensor::Evaluate()
                        }
                        break;
                }
-               /* test for ball anyone ?*/
-       default:
-               printf("Error invalid switch statement\n");
-               break;
+                       /* test for ball anyone ?*/
+               default:
+                       printf("Error invalid switch statement\n");
+                       break;
        }
        
-       /* if not all events are enabled, only send a positive pulse when 
+       /* if not all events are enabled, only send a positive pulse when
         * the button state changes */
        if (!m_bAllEvents) {
                if (m_istrig_prev == m_istrig) {
                        result = false;
-               } else {
+               }
+               else {
                        m_istrig_prev = m_istrig;
                }
        }
@@ -353,7 +354,7 @@ PyObject *SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYAT
        int axis_index= joy->GetNumberOfAxes();
        PyObject *list= PyList_New(axis_index);
        
-       while(axis_index--) {
+       while (axis_index--) {
                PyList_SET_ITEM(list, axis_index, PyLong_FromSsize_t(joy->GetAxisPosition(axis_index)));
        }
        
@@ -381,7 +382,7 @@ PyObject *SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATT
        int hat_index= joy->GetNumberOfHats();
        PyObject *list= PyList_New(hat_index);
        
-       while(hat_index--) {
+       while (hat_index--) {
                PyList_SET_ITEM(list, hat_index, PyLong_FromSsize_t(joy->GetHat(hat_index)));
        }
        
index 9a2dd9bdd5737017a795e56ced08823a929fbff1..64bcae9f6d7d6789fd7a3adee5e76e534570fcd4 100644 (file)
@@ -225,37 +225,37 @@ bool SCA_KeyboardSensor::Evaluate()
                 */
                if (m_qual > 0) {
                        const SCA_InputEvent & qualevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) m_qual);
-                       switch(qualevent.m_status) {
-                       case SCA_InputEvent::KX_NO_INPUTSTATUS:
-                               qual = false;
-                               break;
-                       case SCA_InputEvent::KX_JUSTRELEASED:
-                               qual_change = true;
-                               qual = false;
-                               break;
-                       case SCA_InputEvent::KX_JUSTACTIVATED:
-                               qual_change = true;
-                       case SCA_InputEvent::KX_ACTIVE:
-                               /* do nothing */
-                               break;
+                       switch (qualevent.m_status) {
+                               case SCA_InputEvent::KX_NO_INPUTSTATUS:
+                                       qual = false;
+                                       break;
+                               case SCA_InputEvent::KX_JUSTRELEASED:
+                                       qual_change = true;
+                                       qual = false;
+                                       break;
+                               case SCA_InputEvent::KX_JUSTACTIVATED:
+                                       qual_change = true;
+                               case SCA_InputEvent::KX_ACTIVE:
+                                       /* do nothing */
+                                       break;
                        }
                }
                if (m_qual2 > 0 && qual==true) {
                        const SCA_InputEvent & qualevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) m_qual2);
                        /* copy of above */
-                       switch(qualevent.m_status) {
-                       case SCA_InputEvent::KX_NO_INPUTSTATUS:
-                               qual = false;
-                               break;
-                       case SCA_InputEvent::KX_JUSTRELEASED:
-                               qual_change = true;
-                               qual = false;
-                               break;
-                       case SCA_InputEvent::KX_JUSTACTIVATED:
-                               qual_change = true;
-                       case SCA_InputEvent::KX_ACTIVE:
-                               /* do nothing */
-                               break;
+                       switch (qualevent.m_status) {
+                               case SCA_InputEvent::KX_NO_INPUTSTATUS:
+                                       qual = false;
+                                       break;
+                               case SCA_InputEvent::KX_JUSTRELEASED:
+                                       qual_change = true;
+                                       qual = false;
+                                       break;
+                               case SCA_InputEvent::KX_JUSTACTIVATED:
+                                       qual_change = true;
+                               case SCA_InputEvent::KX_ACTIVE:
+                                       /* do nothing */
+                                       break;
                        }
                }
                /* done reading qualifiers */
index 7dbbbb2a0d9552c551729e18d9625d37d50f6514..f857d59b1215ba78c2e6c8a272f032711bf0d269 100644 (file)
@@ -376,64 +376,63 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
        PyObject *excdict=              NULL;
        PyObject *resultobj=    NULL;
        
-       switch(m_mode) {
-       case SCA_PYEXEC_SCRIPT:
-       {
-               if (m_bModified)
-                       if (Compile()==false) // sets m_bModified to false
+       switch (m_mode) {
+               case SCA_PYEXEC_SCRIPT:
+               {
+                       if (m_bModified)
+                               if (Compile()==false) // sets m_bModified to false
+                                       return;
+                       if (!m_bytecode)
                                return;
-               if (!m_bytecode)
-                       return;
-               
-               /*
-                * This part here with excdict is a temporary patch
-                * to avoid python/gameengine crashes when python
-                * inadvertently holds references to game objects
-                * in global variables.
-                * 
-                * The idea is always make a fresh dictionary, and
-                * destroy it right after it is used to make sure
-                * python won't hold any gameobject references.
-                * 
-                * Note that the PyDict_Clear _is_ necessary before
-                * the Py_DECREF() because it is possible for the
-                * variables inside the dictionary to hold references
-                * to the dictionary (ie. generate a cycle), so we
-                * break it by hand, then DECREF (which in this case
-                * should always ensure excdict is cleared).
-                */
-
-               excdict= PyDict_Copy(m_pythondictionary);
-
-               resultobj = PyEval_EvalCode((PyObject *)m_bytecode, excdict, excdict);
-
-               /* PyRun_SimpleString(m_scriptText.Ptr()); */
-               break;
-       }
-       case SCA_PYEXEC_MODULE:
-       {
-               if (m_bModified || m_debug)
-                       if (Import()==false) // sets m_bModified to false
+
+                       /*
+                        * This part here with excdict is a temporary patch
+                        * to avoid python/gameengine crashes when python
+                        * inadvertently holds references to game objects
+                        * in global variables.
+                        *
+                        * The idea is always make a fresh dictionary, and
+                        * destroy it right after it is used to make sure
+                        * python won't hold any gameobject references.
+                        *
+                        * Note that the PyDict_Clear _is_ necessary before
+                        * the Py_DECREF() because it is possible for the
+                        * variables inside the dictionary to hold references
+                        * to the dictionary (ie. generate a cycle), so we
+                        * break it by hand, then DECREF (which in this case
+                        * should always ensure excdict is cleared).
+                        */
+
+                       excdict= PyDict_Copy(m_pythondictionary);
+
+                       resultobj = PyEval_EvalCode((PyObject *)m_bytecode, excdict, excdict);
+
+                       /* PyRun_SimpleString(m_scriptText.Ptr()); */
+                       break;
+               }
+               case SCA_PYEXEC_MODULE:
+               {
+                       if (m_bModified || m_debug)
+                               if (Import()==false) // sets m_bModified to false
+                                       return;
+                       if (!m_function)
                                return;
-               if (!m_function)
-                       return;
-               
-               PyObject *args= NULL;
-               
-               if (m_function_argc==1) {
-                       args = PyTuple_New(1);
-                       PyTuple_SET_ITEM(args, 0, GetProxy());
+
+                       PyObject *args= NULL;
+
+                       if (m_function_argc==1) {
+                               args = PyTuple_New(1);
+                               PyTuple_SET_ITEM(args, 0, GetProxy());
+                       }
+
+                       resultobj = PyObject_CallObject(m_function, args);
+                       Py_XDECREF(args);
+                       break;
                }
-               
-               resultobj = PyObject_CallObject(m_function, args);
-               Py_XDECREF(args);
-               break;
-       }
-       
+
        } /* end switch */
-       
-       
-       
+
+
        /* Free the return value and print the error */
        if (resultobj)
                Py_DECREF(resultobj);
index b31803b761ea7edb85be9fedb1c4efda51bd2e75..e8d3441e4ced10f0d98719753afebcb5729d7a40 100644 (file)
@@ -72,7 +72,7 @@ GPG_KeyboardDevice::GPG_KeyboardDevice(void)
        m_reverseKeyTranslateTable[GHOST_kKey7                     ] = KX_SEVENKEY                ;
        m_reverseKeyTranslateTable[GHOST_kKey8                     ] = KX_EIGHTKEY                ;
        m_reverseKeyTranslateTable[GHOST_kKey9                     ] = KX_NINEKEY                 ;
-       
+
        // Middle keyboard area keys
        m_reverseKeyTranslateTable[GHOST_kKeyPause                 ] = KX_PAUSEKEY                ;
        m_reverseKeyTranslateTable[GHOST_kKeyInsert                ] = KX_INSERTKEY               ;
@@ -81,7 +81,7 @@ GPG_KeyboardDevice::GPG_KeyboardDevice(void)
        m_reverseKeyTranslateTable[GHOST_kKeyEnd                   ] = KX_ENDKEY                  ;
        m_reverseKeyTranslateTable[GHOST_kKeyUpPage                ] = KX_PAGEUPKEY               ;
        m_reverseKeyTranslateTable[GHOST_kKeyDownPage              ] = KX_PAGEDOWNKEY             ;
-       
+
        // Arrow keys
        m_reverseKeyTranslateTable[GHOST_kKeyUpArrow               ] = KX_UPARROWKEY              ;
        m_reverseKeyTranslateTable[GHOST_kKeyDownArrow             ] = KX_DOWNARROWKEY            ;
@@ -108,19 +108,19 @@ GPG_KeyboardDevice::GPG_KeyboardDevice(void)
        m_reverseKeyTranslateTable[GHOST_kKeyF17                   ] = KX_F17KEY                  ;
        m_reverseKeyTranslateTable[GHOST_kKeyF18                   ] = KX_F18KEY                  ;
        m_reverseKeyTranslateTable[GHOST_kKeyF19                   ] = KX_F19KEY                  ;
-       
+
 
        // Numpad keys
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad0               ] = KX_PAD0                     ;
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad1               ] = KX_PAD1                     ;
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad2               ] = KX_PAD2                     ;
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad3               ] = KX_PAD3                     ;
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad4               ] = KX_PAD4                     ;
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad5               ] = KX_PAD5                     ;
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad6               ] = KX_PAD6                     ;
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad7               ] = KX_PAD7                     ;
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad8               ] = KX_PAD8                     ;
-       m_reverseKeyTranslateTable[GHOST_kKeyNumpad9               ] = KX_PAD9                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad0               ] = KX_PAD0                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad1               ] = KX_PAD1                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad2               ] = KX_PAD2                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad3               ] = KX_PAD3                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad4               ] = KX_PAD4                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad5               ] = KX_PAD5                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad6               ] = KX_PAD6                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad7               ] = KX_PAD7                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad8               ] = KX_PAD8                     ;
+       m_reverseKeyTranslateTable[GHOST_kKeyNumpad9               ] = KX_PAD9                     ;
        m_reverseKeyTranslateTable[GHOST_kKeyNumpadAsterisk        ] = KX_PADASTERKEY              ;
        m_reverseKeyTranslateTable[GHOST_kKeyNumpadPlus            ] = KX_PADPLUSKEY               ;
        m_reverseKeyTranslateTable[GHOST_kKeyNumpadPeriod          ] = KX_PADPERIOD                ;
@@ -133,7 +133,7 @@ GPG_KeyboardDevice::GPG_KeyboardDevice(void)
        m_reverseKeyTranslateTable[GHOST_kKeyEsc                   ] = KX_ESCKEY                   ;
        m_reverseKeyTranslateTable[GHOST_kKeyTab                   ] = KX_TABKEY                   ;
        m_reverseKeyTranslateTable[GHOST_kKeySpace                 ] = KX_SPACEKEY                 ;
-       m_reverseKeyTranslateTable[GHOST_kKeyEnter                 ] = KX_RETKEY                               ;
+       m_reverseKeyTranslateTable[GHOST_kKeyEnter                 ] = KX_RETKEY                   ;
        m_reverseKeyTranslateTable[GHOST_kKeyBackSpace             ] = KX_BACKSPACEKEY             ;
        m_reverseKeyTranslateTable[GHOST_kKeySemicolon             ] = KX_SEMICOLONKEY             ;
        m_reverseKeyTranslateTable[GHOST_kKeyPeriod                ] = KX_PERIODKEY                ;
@@ -141,19 +141,19 @@ GPG_KeyboardDevice::GPG_KeyboardDevice(void)
        m_reverseKeyTranslateTable[GHOST_kKeyQuote                 ] = KX_QUOTEKEY                 ;
        m_reverseKeyTranslateTable[GHOST_kKeyAccentGrave           ] = KX_ACCENTGRAVEKEY           ;
        m_reverseKeyTranslateTable[GHOST_kKeyMinus                 ] = KX_MINUSKEY                 ;
-       m_reverseKeyTranslateTable[GHOST_kKeySlash                     ] = KX_SLASHKEY                 ;
+       m_reverseKeyTranslateTable[GHOST_kKeySlash                 ] = KX_SLASHKEY                 ;
        m_reverseKeyTranslateTable[GHOST_kKeyBackslash             ] = KX_BACKSLASHKEY             ;
        m_reverseKeyTranslateTable[GHOST_kKeyEqual                 ] = KX_EQUALKEY                 ;
-       m_reverseKeyTranslateTable[GHOST_kKeyLeftBracket               ] = KX_LEFTBRACKETKEY           ;
-       m_reverseKeyTranslateTable[GHOST_kKeyRightBracket              ] = KX_RIGHTBRACKETKEY          ;
+       m_reverseKeyTranslateTable[GHOST_kKeyLeftBracket           ] = KX_LEFTBRACKETKEY           ;
+       m_reverseKeyTranslateTable[GHOST_kKeyRightBracket          ] = KX_RIGHTBRACKETKEY          ;
 
        // Modifier keys.
-       m_reverseKeyTranslateTable[GHOST_kKeyLeftControl               ] = KX_LEFTCTRLKEY                  ;
-       m_reverseKeyTranslateTable[GHOST_kKeyRightControl              ] = KX_RIGHTCTRLKEY                 ;
+       m_reverseKeyTranslateTable[GHOST_kKeyLeftControl           ] = KX_LEFTCTRLKEY              ;
+       m_reverseKeyTranslateTable[GHOST_kKeyRightControl          ] = KX_RIGHTCTRLKEY             ;
        m_reverseKeyTranslateTable[GHOST_kKeyLeftAlt               ] = KX_LEFTALTKEY               ;
        m_reverseKeyTranslateTable[GHOST_kKeyRightAlt              ] = KX_RIGHTALTKEY              ;
        m_reverseKeyTranslateTable[GHOST_kKeyLeftShift             ] = KX_LEFTSHIFTKEY             ;
-       m_reverseKeyTranslateTable[GHOST_kKeyRightShift            ] = KX_RIGHTSHIFTKEY            ;
+       m_reverseKeyTranslateTable[GHOST_kKeyRightShift            ] = KX_RIGHTSHIFTKEY            ;
 }
 
 
index a21c3965be938ec4e58a9f8d0c7c70edffa3329f..5b7a2313f43561156bf76737724f6a5f59bc5f05 100644 (file)
@@ -352,29 +352,27 @@ void BL_Action::Update(float curtime)
        }
 
        // Handle wrap around
-       if (m_localtime < min(m_startframe, m_endframe) || m_localtime > max(m_startframe, m_endframe))
-       {
-               switch(m_playmode)
-               {
-               case ACT_MODE_PLAY:
-                       // Clamp
-                       m_localtime = m_endframe;
-                       m_done = true;
-                       break;
-               case ACT_MODE_LOOP:
-                       // Put the time back to the beginning
-                       m_localtime = m_startframe;
-                       m_starttime = curtime;
-                       break;
-               case ACT_MODE_PING_PONG:
-                       // Swap the start and end frames
-                       float temp = m_startframe;
-                       m_startframe = m_endframe;
-                       m_endframe = temp;
-
-                       m_starttime = curtime;
-
-                       break;
+       if (m_localtime < min(m_startframe, m_endframe) || m_localtime > max(m_startframe, m_endframe)) {
+               switch (m_playmode) {
+                       case ACT_MODE_PLAY:
+                               // Clamp
+                               m_localtime = m_endframe;
+                               m_done = true;
+                               break;
+                       case ACT_MODE_LOOP:
+                               // Put the time back to the beginning
+                               m_localtime = m_startframe;
+                               m_starttime = curtime;
+                               break;
+                       case ACT_MODE_PING_PONG:
+                               // Swap the start and end frames
+                               float temp = m_startframe;
+                               m_startframe = m_endframe;
+                               m_endframe = temp;
+
+                               m_starttime = curtime;
+
+                               break;
                }
        }
 
index e0ad1539b4ae5885a4a4b0b34e99c8e84f5ac9e0..144ad61212d233dcfbe0f859acb4e409f3894972 100644 (file)
@@ -52,51 +52,70 @@ void BL_Uniform::Apply(class BL_Shader *shader)
 #ifdef SORT_UNIFORMS
        MT_assert(mType > UNI_NONE && mType < UNI_MAX && mData);
 
-       if (!mDirty) 
+       if (!mDirty)
                return;
 
-       switch(mType)
-       {
-       case UNI_FLOAT: {
+       switch (mType) {
+               case UNI_FLOAT:
+               {
                        float *f = (float*)mData;
                        glUniform1fARB(mLoc,(GLfloat)*f);
-               }break;
-       case UNI_INT: {
+                       break;
+               }
+               case UNI_INT:
+               {
                        int *f = (int*)mData;
                        glUniform1iARB(mLoc, (GLint)*f);
-               }break;
-       case UNI_FLOAT2: {
+                       break;
+               }
+               case UNI_FLOAT2:
+               {
                        float *f = (float*)mData;
                        glUniform2fvARB(mLoc,1, (GLfloat*)f);
-               }break;
-       case UNI_FLOAT3: {
+                       break;
+               }
+               case UNI_FLOAT3:
+               {
                        float *f = (float*)mData;
                        glUniform3fvARB(mLoc,1,(GLfloat*)f);
-               }break;
-       case UNI_FLOAT4: {
+                       break;
+               }
+               case UNI_FLOAT4:
+               {
                        float *f = (float*)mData;
                        glUniform4fvARB(mLoc,1,(GLfloat*)f);
-               }break;
-       case UNI_INT2: {
+                       break;
+               }
+               case UNI_INT2:
+               {
                        int *f = (int*)mData;
                        glUniform2ivARB(mLoc,1,(GLint*)f);
-               }break; 
-       case UNI_INT3: {
+                       break;
+               }
+               case UNI_INT3:
+               {
                        int *f = (int*)mData;
                        glUniform3ivARB(mLoc,1,(GLint*)f);
-               }break; 
-       case UNI_INT4: {
+                       break;
+               }
+               case UNI_INT4:
+               {
                        int *f = (int*)mData;
                        glUniform4ivARB(mLoc,1,(GLint*)f);
-               }break;
-       case UNI_MAT4: {
+                       break;
+               }
+               case UNI_MAT4:
+               {
                        float *f = (float*)mData;
                        glUniformMatrix4fvARB(mLoc, 1, mTranspose?GL_TRUE:GL_FALSE,(GLfloat*)f);
-               }break;
-       case UNI_MAT3: {
+                       break;
+               }
+               case UNI_MAT3:
+               {
                        float *f = (float*)mData;
                        glUniformMatrix3fvARB(mLoc, 1, mTranspose?GL_TRUE:GL_FALSE,(GLfloat*)f);
-               }break;
+                       break;
+               }
        }
        mDirty = false;
 #endif
@@ -157,7 +176,7 @@ BL_Shader::~BL_Shader()
 void BL_Shader::ClearUniforms()
 {
        BL_UniformVec::iterator it = mUniforms.begin();
-       while(it != mUniforms.end()) {
+       while (it != mUniforms.end()) {
                delete (*it);
                it++;
        }
@@ -165,7 +184,7 @@ void BL_Shader::ClearUniforms()
 
        
        BL_UniformVecDef::iterator itp = mPreDef.begin();
-       while(itp != mPreDef.end()) {
+       while (itp != mPreDef.end()) {
                delete (*itp);
                itp++;
        }
@@ -178,7 +197,7 @@ BL_Uniform  *BL_Shader::FindUniform(const int location)
 {
 #ifdef SORT_UNIFORMS
        BL_UniformVec::iterator it = mUniforms.begin();
-       while(it != mUniforms.end()) {
+       while (it != mUniforms.end()) {
                if ((*it)->GetLocation() == location)
                        return (*it);
                it++;
@@ -1134,7 +1153,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv, "setUniformfv( float (list2 or list
                                        Py_DECREF(item);
                                }
 
-                               switch(list_size)
+                               switch (list_size)
                                {
                                case 2:
                                        {
@@ -1218,7 +1237,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( uniform_name, (list2
        
        /* Sanity checks done! */
        
-       switch(list_size)
+       switch (list_size)
        {
        case 2:
                {
@@ -1394,15 +1413,14 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformDef, "setUniformDef(name, enum)" )
                {
                        bool defined = false;
                        BL_UniformVecDef::iterator it = mPreDef.begin();
-                       while(it != mPreDef.end()) {
+                       while (it != mPreDef.end()) {
                                if ((*it)->mLoc == loc) {
                                        defined = true;
                                        break;
                                }
                                it++;
                        }
-                       if (defined)
-                       {
+                       if (defined) {
                                Py_RETURN_NONE;
                        }
 
index 7196c1ec664d5da455f13b2ba9f1e95ffa353b35..d129fc8871402795d9a9738b379f0469fa11b93f 100644 (file)
@@ -562,7 +562,7 @@ void BL_Texture::setTexEnv(BL_Material *mat, bool modulate)
                using_alpha = true;
        }
 
-       switch( mat->blend_mode[mUnit] ) {
+       switch (mat->blend_mode[mUnit]) {
                case BLEND_MIX:
                        {
                                // ------------------------------
index 87b0cfc1269dd49b08270a6750e6e1c9612bdc6d..fca407f63987817f2d3be1009953c7b49f5966bc 100644 (file)
@@ -94,7 +94,7 @@ KX_Dome::KX_Dome (
 
        SetViewPort(viewport);
 
-       switch(m_mode) {
+       switch (m_mode) {
                case DOME_FISHEYE:
                        if (m_angle <= 180) {
                                cubetop.resize(1);
@@ -1620,7 +1620,7 @@ void KX_Dome::Draw(void)
                glScissor(0,0,warp.imagesize, warp.imagesize);
        }
 
-       switch(m_mode) {
+       switch (m_mode) {
                case DOME_FISHEYE:
                        DrawDomeFisheye();
                        break;
index 6979af10e0afe4093fe7c4c768bd55b096ebf89c..6c581dae21095aa6101777a369e1a9d304904dd2 100644 (file)
@@ -1442,7 +1442,7 @@ static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype)
 
 #define PHYS_ERR(attr) PyErr_SetString(PyExc_AttributeError, "KX_GameObject." attr ", is missing a physics controller")
 
-       switch(subtype) {
+       switch (subtype) {
                case MATHUTILS_VEC_CB_POS_LOCAL:
                        self->NodeGetLocalPosition().getValue(bmo->data);
                        break;
@@ -1492,7 +1492,7 @@ static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype)
        if (self==NULL)
                return -1;
        
-       switch(subtype) {
+       switch (subtype) {
                case MATHUTILS_VEC_CB_POS_LOCAL:
                        self->NodeSetLocalPosition(MT_Point3(bmo->data));
                        self->NodeUpdateGS(0.f);
@@ -1571,7 +1571,7 @@ static int mathutils_kxgameob_matrix_get(BaseMathObject *bmo, int subtype)
        if (self==NULL)
                return -1;
 
-       switch(subtype) {
+       switch (subtype) {
                case MATHUTILS_MAT_CB_ORI_LOCAL:
                        self->NodeGetLocalOrientation().getValue3x3(bmo->data);
                        break;
@@ -1591,7 +1591,7 @@ static int mathutils_kxgameob_matrix_set(BaseMathObject *bmo, int subtype)
                return -1;
        
        MT_Matrix3x3 mat3x3;
-       switch(subtype) {
+       switch (subtype) {
                case MATHUTILS_MAT_CB_ORI_LOCAL:
                        mat3x3.setValue3x3(bmo->data);
                        self->NodeSetLocalOrientation(mat3x3);
index 479e63a1f24774a76166e4ec3cdad4a3b10822f9..a85575d4f5536d707e93965c9658213cb1b6c9cb 100644 (file)
@@ -334,8 +334,7 @@ void KX_KetsjiEngine::RenderDome()
                        
                        // Draw the scene once for each camera with an enabled viewport
                        list<KX_Camera*>::iterator it = cameras->begin();
-                       while(it != cameras->end())
-                       {
+                       while (it != cameras->end()) {
                                if ((*it)->GetViewport())
                                {
                                        if (scene->IsClearingZBuffer())
@@ -889,8 +888,7 @@ void KX_KetsjiEngine::Render()
                
                // Draw the scene once for each camera with an enabled viewport
                list<KX_Camera*>::iterator it = cameras->begin();
-               while(it != cameras->end())
-               {
+               while (it != cameras->end()) {
                        if ((*it)->GetViewport())
                        {
                                if (scene->IsClearingZBuffer())
@@ -939,8 +937,7 @@ void KX_KetsjiEngine::Render()
        
                        // Draw the scene once for each camera with an enabled viewport
                        list<KX_Camera*>::iterator it = cameras->begin();
-                       while(it != cameras->end())
-                       {
+                       while (it != cameras->end()) {
                                if ((*it)->GetViewport())
                                {
                                        if (scene->IsClearingZBuffer())
@@ -1327,8 +1324,7 @@ void KX_KetsjiEngine::RenderFonts(KX_Scene* scene)
        list<class KX_FontObject*>* fonts = scene->GetFonts();
        
        list<KX_FontObject*>::iterator it = fonts->begin();
-       while(it != fonts->end())
-       {
+       while (it != fonts->end()) {
                (*it)->DrawText();
                ++it;
        }
index 0e45684d2d056c41eaa464ccdb67c77fddc5ddcc..13074fca537d691db42009ba8da39b5033a0daf9 100644 (file)
@@ -402,7 +402,7 @@ int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attr
                return PY_SET_ATTR_FAIL;
        }
        
-       switch(val) {
+       switch (val) {
                case 0:
                        self->m_lightobj.m_type = self->m_lightobj.LIGHT_SPOT;
                        break;
index ce63d6e2753b4ddc908d46382b09c62aa8afe51c..0d25cd0ffc1413cc061160e0e5ede946c1e6049c 100644 (file)
@@ -308,8 +308,7 @@ bool KX_MouseFocusSensor::ParentObjectHasFocus()
        list<class KX_Camera*>* cameras = m_kxscene->GetCameras();
        list<KX_Camera*>::iterator it = cameras->begin();
        
-       while(it != cameras->end())
-       {
+       while (it != cameras->end()) {
                if (((*it) != cam) && (*it)->GetViewport())
                        if (ParentObjectHasFocusCamera(*it))
                                return true;
index f35090f9e9bf1ca1c88d66b9ac725dba55d860e0..c57cb7b55b782cb98d3a6c266ba328570b1469a9 100644 (file)
@@ -402,7 +402,7 @@ static int mathutils_obactu_vector_get(BaseMathObject *bmo, int subtype)
        if (self==NULL)
                return -1;
 
-       switch(subtype) {
+       switch (subtype) {
                case MATHUTILS_VEC_CB_LINV:
                        self->m_linear_velocity.getValue(bmo->data);
                        break;
@@ -420,7 +420,7 @@ static int mathutils_obactu_vector_set(BaseMathObject *bmo, int subtype)
        if (self==NULL)
                return -1;
 
-       switch(subtype) {
+       switch (subtype) {
                case MATHUTILS_VEC_CB_LINV:
                        self->m_linear_velocity.setValue(bmo->data);
                        break;
index 7ec84cfa6b7b2ac740011aaf5680248389775dc9..3bb657e2b870adbe896d5ae5a3044e4f3b83f57f 100644 (file)
@@ -1796,7 +1796,7 @@ static void initPySysObjects(Main *maggie)
        
        Library *lib= (Library *)maggie->library.first;
        
-       while(lib) {
+       while (lib) {
                /* lib->name wont work in some cases (on win32),
                 * even when expanding with gp_GamePythonPath, using lib->filename is less trouble */
                initPySysObjects__append(sys_path, lib->filepath);
index 5ab3de15fb39551471d42207d9fa3a08427b1ee8..6b4d88709e83a957588b1c1cb86203ddea90f258 100644 (file)
@@ -72,31 +72,31 @@ static void KX_PythonSeq_dealloc(KX_PythonSeq * self)
 static Py_ssize_t KX_PythonSeq_len( PyObject *self )
 {
        PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base);
-        
+
        if (self_plus==NULL) {
                PyErr_SetString(PyExc_SystemError, "len(seq): "BGE_PROXY_ERROR_MSG);
                return -1;
        }
        
-       switch(((KX_PythonSeq *)self)->type) {
-       case KX_PYGENSEQ_CONT_TYPE_SENSORS:
-               return ((SCA_IController *)self_plus)->GetLinkedSensors().size();
-       case KX_PYGENSEQ_CONT_TYPE_ACTUATORS:
-               return ((SCA_IController *)self_plus)->GetLinkedActuators().size();
-       case KX_PYGENSEQ_OB_TYPE_SENSORS:
-               return ((KX_GameObject *)self_plus)->GetSensors().size();
-       case KX_PYGENSEQ_OB_TYPE_CONTROLLERS:
-               return ((KX_GameObject *)self_plus)->GetControllers().size();
-       case KX_PYGENSEQ_OB_TYPE_ACTUATORS:
-               return ((KX_GameObject *)self_plus)->GetActuators().size();
-       case KX_PYGENSEQ_OB_TYPE_CONSTRAINTS:
-               return ((BL_ArmatureObject *)self_plus)->GetConstraintNumber();
-       case KX_PYGENSEQ_OB_TYPE_CHANNELS:
-               return ((BL_ArmatureObject *)self_plus)->GetChannelNumber();
-       default:
-               /* Should never happen */
-               PyErr_SetString(PyExc_SystemError, "invalid type, internal error");
-               return -1;
+       switch (((KX_PythonSeq *)self)->type) {
+               case KX_PYGENSEQ_CONT_TYPE_SENSORS:
+                       return ((SCA_IController *)self_plus)->GetLinkedSensors().size();
+               case KX_PYGENSEQ_CONT_TYPE_ACTUATORS:
+                       return ((SCA_IController *)self_plus)->GetLinkedActuators().size();
+               case KX_PYGENSEQ_OB_TYPE_SENSORS:
+                       return ((KX_GameObject *)self_plus)->GetSensors().size();
+               case KX_PYGENSEQ_OB_TYPE_CONTROLLERS:
+                       return ((KX_GameObject *)self_plus)->GetControllers().size();
+               case KX_PYGENSEQ_OB_TYPE_ACTUATORS:
+                       return ((KX_GameObject *)self_plus)->GetActuators().size();
+               case KX_PYGENSEQ_OB_TYPE_CONSTRAINTS:
+                       return ((BL_ArmatureObject *)self_plus)->GetConstraintNumber();
+               case KX_PYGENSEQ_OB_TYPE_CHANNELS:
+                       return ((BL_ArmatureObject *)self_plus)->GetChannelNumber();
+               default:
+                       /* Should never happen */
+                       PyErr_SetString(PyExc_SystemError, "invalid type, internal error");
+                       return -1;
        }
 }
 
@@ -109,7 +109,7 @@ static PyObject *KX_PythonSeq_getIndex(PyObject *self, int index)
                return NULL;
        }
        
-       switch(((KX_PythonSeq *)self)->type) {
+       switch (((KX_PythonSeq *)self)->type) {
                case KX_PYGENSEQ_CONT_TYPE_SENSORS:
                {
                        vector<SCA_ISensor*>& linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors();
@@ -193,7 +193,7 @@ static PyObjectPlus * KX_PythonSeq_subscript__internal(PyObject *self, const cha
 {
        PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base);
        
-       switch(((KX_PythonSeq *)self)->type) {
+       switch (((KX_PythonSeq *)self)->type) {
                case KX_PYGENSEQ_CONT_TYPE_SENSORS:
                {
                        vector<SCA_ISensor*>& linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors();
index 459600f2e3487345f636ef641ab71f7d34564a9a..2a6b7d122b5ef00487e0782a94c70bcfb234544e 100644 (file)
@@ -76,9 +76,9 @@ bool KX_RayCast::RayTest(PHY_IPhysicsEnvironment* physics_environment, const MT_
        
        PHY_IPhysicsController* hit_controller;
 
-       while((hit_controller = physics_environment->rayTest(callback,
-                       frompoint.x(),frompoint.y(),frompoint.z(),
-                       topoint.x(),topoint.y(),topoint.z())) != NULL) 
+       while ((hit_controller = physics_environment->rayTest(callback,
+                                                             frompoint.x(),frompoint.y(),frompoint.z(),
+                                                             topoint.x(),topoint.y(),topoint.z())) != NULL)
        {
                KX_ClientObjectInfo* info = static_cast<KX_ClientObjectInfo*>(hit_controller->getNewClientInfo());
                
index c0191db640a300e0bc43b6c13ae6a6d7fa837460..f76f94aa81ded7e60a00e94e6ec56ecfa59548cb 100644 (file)
@@ -325,15 +325,14 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, startSound,
 "startSound()\n"
 "\tStarts the sound.\n")
 {
-       switch(m_handle.isNull() ? AUD_STATUS_INVALID : m_handle->getStatus())
-       {
-       case AUD_STATUS_PLAYING:
-               break;
-       case AUD_STATUS_PAUSED:
-               m_handle->resume();
-               break;
-       default:
-               play();
+       switch (m_handle.isNull() ? AUD_STATUS_INVALID : m_handle->getStatus()) {
+               case AUD_STATUS_PLAYING:
+                       break;
+               case AUD_STATUS_PAUSED:
+                       m_handle->resume();
+                       break;
+               default:
+                       play();
        }
        Py_RETURN_NONE;
 }
index 0ae8908e9464cd1aa06e7a283317a698d6e15670..cf869e7194546a74b4b2de460520f6563a55fdce 100644 (file)
@@ -153,8 +153,7 @@ unsigned int RAS_2DFilterManager::CreateShaderProgram(const char* shadersource)
 
 unsigned int RAS_2DFilterManager::CreateShaderProgram(int filtermode)
 {
-       switch(filtermode)
-       {
+       switch (filtermode) {
                case RAS_2DFILTER_BLUR:
                        return CreateShaderProgram(BlurFragmentShader);
                case RAS_2DFILTER_SHARPEN:
index 3c49d6e5289c05db5fe9293ebe124d0b9c794e36..b251fd6314c0691e1e2095003ca7a60551364a79 100644 (file)
@@ -129,7 +129,7 @@ void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList
                RAS_MaterialBucket* bucket = *bit;
                RAS_MeshSlot* ms;
                // remove the mesh slot form the list, it culls them automatically for next frame
-               while((ms = bucket->GetNextActiveMeshSlot())) {
+               while ((ms = bucket->GetNextActiveMeshSlot())) {
                        slots[i++].set(ms, bucket, pnorm);
                }
        }
@@ -156,7 +156,7 @@ void RAS_BucketManager::RenderAlphaBuckets(
        for (sit=slots.begin(); sit!=slots.end(); ++sit) {
                rendertools->SetClientObject(rasty, sit->m_ms->m_clientObj);
 
-               while(sit->m_bucket->ActivateMaterial(cameratrans, rasty, rendertools))
+               while (sit->m_bucket->ActivateMaterial(cameratrans, rasty, rendertools))
                        sit->m_bucket->RenderMeshSlot(cameratrans, rasty, rendertools, *(sit->m_ms));
 
                // make this mesh slot culled automatically for next frame
@@ -179,8 +179,7 @@ void RAS_BucketManager::RenderSolidBuckets(
                RAS_MaterialBucket* bucket = *bit;
                RAS_MeshSlot* ms;
                // remove the mesh slot form the list, it culls them automatically for next frame
-               while((ms = bucket->GetNextActiveMeshSlot()))
-               {
+               while ((ms = bucket->GetNextActiveMeshSlot())) {
                        rendertools->SetClientObject(rasty, ms->m_clientObj);
                        while (bucket->ActivateMaterial(cameratrans, rasty, rendertools))
                                bucket->RenderMeshSlot(cameratrans, rasty, rendertools, *ms);
@@ -219,7 +218,7 @@ void RAS_BucketManager::RenderSolidBuckets(
        for (sit=slots.begin(); sit!=slots.end(); ++sit) {
                rendertools->SetClientObject(rasty, sit->m_ms->m_clientObj);
 
-               while(sit->m_bucket->ActivateMaterial(cameratrans, rasty, rendertools))
+               while (sit->m_bucket->ActivateMaterial(cameratrans, rasty, rendertools))
                        sit->m_bucket->RenderMeshSlot(cameratrans, rasty, rendertools, *(sit->m_ms));
        }
 #endif
index 0cb6bc7439a6da33df9673c68cc30179d66648a6..480cc742ec8e7f0608842fc4eb2c80fc24e8bf61 100644 (file)
@@ -73,7 +73,7 @@ RAS_MeshSlot::~RAS_MeshSlot()
 #ifdef USE_SPLIT
        Split(true);
 
-       while(m_joinedSlots.size())
+       while (m_joinedSlots.size())
                m_joinedSlots.front()->Split(true);
 #endif
 
index 1f411a095866305804fce4bc0f4280934de1c6d5..d74aa134779b4ebee14faea06c2dc1fcc065c3bb 100644 (file)
@@ -124,7 +124,7 @@ void RAS_ListRasterizer::RemoveListSlot(RAS_ListSlot* list)
 {
        if (list->m_flag & LIST_DERIVEDMESH) {
                RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.begin();
-               while(it != mDerivedMeshLists.end()) {
+               while (it != mDerivedMeshLists.end()) {
                        RAS_ListSlots *slots = it->second;
                        if (slots->size() > list->m_matnr && slots->at(list->m_matnr) == list) {
                                (*slots)[list->m_matnr] = NULL;
@@ -145,7 +145,7 @@ void RAS_ListRasterizer::RemoveListSlot(RAS_ListSlot* list)
                }
        } else {
                RAS_ArrayLists::iterator it = mArrayLists.begin();
-               while(it != mArrayLists.end()) {
+               while (it != mArrayLists.end()) {
                        if (it->second == list) {
                                mArrayLists.erase(it);
                                break;
index a0da1c79baa94d6dd372d82d92476311a6f02035..9d87f0df047aebb06616d002543f5f02a2049290 100644 (file)
@@ -447,8 +447,7 @@ void RAS_OpenGLRasterizer::SetRenderArea()
        switch (m_stereomode)
        {
                case RAS_STEREO_ABOVEBELOW:
-                       switch(m_curreye)
-                       {
+                       switch (m_curreye) {
                                case RAS_STEREO_LEFTEYE:
                                        // upper half of window
                                        area.SetLeft(0);
@@ -716,53 +715,53 @@ void RAS_OpenGLRasterizer::TexCoord(const RAS_TexVert &tv)
                                glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, tv.getUV2());
                                continue;
                        }
-                       switch(m_texco[unit]) {
-                       case RAS_TEXCO_ORCO:
-                       case RAS_TEXCO_GLOB:
-                               glMultiTexCoord3fvARB(GL_TEXTURE0_ARB+unit, tv.getXYZ());
-                               break;
-                       case RAS_TEXCO_UV1:
-                               glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, tv.getUV1());
-                               break;
-                       case RAS_TEXCO_NORM:
-                               glMultiTexCoord3fvARB(GL_TEXTURE0_ARB+unit, tv.getNormal());
-                               break;
-                       case RAS_TEXTANGENT:
-                               glMultiTexCoord4fvARB(GL_TEXTURE0_ARB+unit, tv.getTangent());
-                               break;
-                       case RAS_TEXCO_UV2:
-                               glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, tv.getUV2());
-                               break;
-                       default:
-                               break;
+                       switch (m_texco[unit]) {
+                               case RAS_TEXCO_ORCO:
+                               case RAS_TEXCO_GLOB:
+                                       glMultiTexCoord3fvARB(GL_TEXTURE0_ARB+unit, tv.getXYZ());
+                                       break;
+                               case RAS_TEXCO_UV1:
+                                       glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, tv.getUV1());
+                                       break;
+                               case RAS_TEXCO_NORM:
+                                       glMultiTexCoord3fvARB(GL_TEXTURE0_ARB+unit, tv.getNormal());
+                                       break;
+                               case RAS_TEXTANGENT:
+                                       glMultiTexCoord4fvARB(GL_TEXTURE0_ARB+unit, tv.getTangent());
+                                       break;
+                               case RAS_TEXCO_UV2:
+                                       glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, tv.getUV2());
+                                       break;
+                               default:
+                                       break;
                        }
                }
        }
 
        if (GLEW_ARB_vertex_program) {
                for (unit=0; unit<m_attrib_num; unit++) {
-                       switch(m_attrib[unit]) {
-                       case RAS_TEXCO_ORCO:
-                       case RAS_TEXCO_GLOB:
-                               glVertexAttrib3fvARB(unit, tv.getXYZ());
-                               break;
-                       case RAS_TEXCO_UV1:
-                               glVertexAttrib2fvARB(unit, tv.getUV1());
-                               break;
-                       case RAS_TEXCO_NORM:
-                               glVertexAttrib3fvARB(unit, tv.getNormal());
-                               break;
-                       case RAS_TEXTANGENT:
-                               glVertexAttrib4fvARB(unit, tv.getTangent());
-                               break;
-                       case RAS_TEXCO_UV2:
-                               glVertexAttrib2fvARB(unit, tv.getUV2());
-                               break;
-                       case RAS_TEXCO_VCOL:
-                               glVertexAttrib4ubvARB(unit, tv.getRGBA());
-                               break;
-                       default:
-                               break;
+                       switch (m_attrib[unit]) {
+                               case RAS_TEXCO_ORCO:
+                               case RAS_TEXCO_GLOB:
+                                       glVertexAttrib3fvARB(unit, tv.getXYZ());
+                                       break;
+                               case RAS_TEXCO_UV1:
+                                       glVertexAttrib2fvARB(unit, tv.getUV1());
+                                       break;
+                               case RAS_TEXCO_NORM:
+                                       glVertexAttrib3fvARB(unit, tv.getNormal());
+                                       break;
+                               case RAS_TEXTANGENT:
+                                       glVertexAttrib4fvARB(unit, tv.getTangent());
+                                       break;
+                               case RAS_TEXCO_UV2:
+                                       glVertexAttrib2fvARB(unit, tv.getUV2());
+                                       break;
+                               case RAS_TEXCO_VCOL:
+                                       glVertexAttrib4ubvARB(unit, tv.getRGBA());
+                                       break;
+                               default:
+                                       break;
                        }
                }
        }
@@ -1007,8 +1006,7 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix(
 
                        near_div_focallength = frustnear / m_focallength;
                        offset = 0.5f * m_eyeseparation * near_div_focallength;
-                       switch(m_curreye)
-                       {
+                       switch (m_curreye) {
                                case RAS_STEREO_LEFTEYE:
                                                left += offset;
                                                right += offset;
@@ -1078,8 +1076,7 @@ void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat,
                // vector between eyes
                eyeline = viewDir.cross(viewupVec);
 
-               switch(m_curreye)
-               {
+               switch (m_curreye) {
                        case RAS_STEREO_LEFTEYE:
                                {
                                // translate to left by half the eye distance
index a36229c35d1f4bd2f8044cc5df7c4cd049a2f153..076acb0d15339d1361bb8b3c1ec1e3b447590632 100644 (file)
@@ -246,8 +246,7 @@ void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv)
                                glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert), tv->getUV2());
                                continue;
                        }
-                       switch(m_texco[unit])
-                       {
+                       switch (m_texco[unit]) {
                        case RAS_TEXCO_ORCO:
                        case RAS_TEXCO_GLOB:
                                glTexCoordPointer(3, GL_FLOAT, sizeof(RAS_TexVert),tv->getXYZ());
@@ -274,7 +273,7 @@ void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv)
 
        if (GLEW_ARB_vertex_program) {
                for (unit=0; unit<m_attrib_num; unit++) {
-                       switch(m_attrib[unit]) {
+                       switch (m_attrib[unit]) {
                        case RAS_TEXCO_ORCO:
                        case RAS_TEXCO_GLOB:
                                glVertexAttribPointerARB(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getXYZ());
@@ -330,8 +329,7 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable)
                for (unit=0; unit<texco_num; unit++) {
                        glClientActiveTextureARB(GL_TEXTURE0_ARB+unit);
 
-                       switch(texco[unit])
-                       {
+                       switch (texco[unit]) {
                        case RAS_TEXCO_ORCO:
                        case RAS_TEXCO_GLOB:
                        case RAS_TEXCO_UV1:
@@ -358,7 +356,7 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable)
 
        if (GLEW_ARB_vertex_program) {
                for (unit=0; unit<attrib_num; unit++) {
-                       switch(attrib[unit]) {
+                       switch (attrib[unit]) {
                        case RAS_TEXCO_ORCO:
                        case RAS_TEXCO_GLOB:
                        case RAS_TEXCO_UV1:
index cf65362c31d982bcda72c0b3b58b7a5abd8329b7..3f42d5c4feda9f77df25963a0f416cc5238874d1 100644 (file)
@@ -485,13 +485,13 @@ void VideoFFmpeg::stopCache()
                        av_free(frame->frame);
                        delete frame;
                }
-               while((packet = (CachePacket *)m_packetCacheBase.first) != NULL)
+               while ((packet = (CachePacket *)m_packetCacheBase.first) != NULL)
                {
                        BLI_remlink(&m_packetCacheBase, packet);
                        av_free_packet(&packet->packet);
                        delete packet;
                }
-               while((packet = (CachePacket *)m_packetCacheFree.first) != NULL)
+               while ((packet = (CachePacket *)m_packetCacheFree.first) != NULL)
                {
                        BLI_remlink(&m_packetCacheFree, packet);
                        delete packet;
@@ -921,7 +921,7 @@ AVFrame *VideoFFmpeg::grabFrame(long position)
                        && m_preseek 
                        && position - (m_curPosition + 1) < m_preseek) 
                {
-                       while(av_read_frame(m_formatCtx, &packet)>=0) 
+                       while (av_read_frame(m_formatCtx, &packet)>=0)
                        {
                                if (packet.stream_index == m_videoStream) 
                                {
@@ -996,7 +996,7 @@ AVFrame *VideoFFmpeg::grabFrame(long position)
 
        // find the correct frame, in case of streaming and no cache, it means just
        // return the next frame. This is not quite correct, may need more work
-       while(av_read_frame(m_formatCtx, &packet)>=0) 
+       while (av_read_frame(m_formatCtx, &packet) >= 0)
        {
                if (packet.stream_index == m_videoStream) 
                {