~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/gameengine/Converter/KX_ConvertActuators.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 *  \ingroup bgeconv
31
31
 */
32
32
 
33
 
 
34
 
#if defined(WIN32) && !defined(FREE_WINDOWS)
35
 
#pragma warning (disable : 4786) 
36
 
#endif //WIN32
 
33
#ifdef _MSC_VER
 
34
#  pragma warning (disable:4786)
 
35
#endif
37
36
 
38
37
#include <math.h>
39
38
 
82
81
#include "BKE_text.h"
83
82
#include "BLI_blenlib.h"
84
83
#include "BLI_math_base.h"
85
 
 
86
 
#define FILE_MAX 1024 // repeated here to avoid dependency from BKE_utildefines.h
 
84
#include "BLI_path_util.h"
87
85
 
88
86
#include "KX_NetworkMessageActuator.h"
89
87
 
106
104
#include "BL_BlenderDataConversion.h"
107
105
 
108
106
/** 
109
 
 * KX_BLENDERTRUNC needed to round 'almost' zero values to zero, else velocities etc. are incorrectly set
 
107
 * KX_flt_trunc needed to round 'almost' zero values to zero, else velocities etc. are incorrectly set
110
108
 */
111
109
 
112
 
#define KX_BLENDERTRUNC(x)  (( x < 0.0001 && x > -0.0001 )  ? 0.0 : x)
 
110
BLI_INLINE float KX_flt_trunc(const float x)
 
111
{
 
112
        return ( x < 0.0001f && x > -0.0001f ) ? 0.0f : x;
 
113
}
113
114
 
114
115
void BL_ConvertActuators(const char* maggiename,
115
 
                                                 struct Object* blenderobject,
116
 
                                                 KX_GameObject* gameobj,
117
 
                                                 SCA_LogicManager* logicmgr,
118
 
                                                 KX_Scene* scene,
119
 
                                                 KX_KetsjiEngine* ketsjiEngine,
120
 
                                                 int activeLayerBitInfo,
121
 
                                                 bool isInActiveLayer,
122
 
                                                 RAS_IRenderTools* rendertools,
123
 
                                                 KX_BlenderSceneConverter* converter
124
 
                                                 )
 
116
                         struct Object* blenderobject,
 
117
                         KX_GameObject* gameobj,
 
118
                         SCA_LogicManager* logicmgr,
 
119
                         KX_Scene* scene,
 
120
                         KX_KetsjiEngine* ketsjiEngine,
 
121
                         int activeLayerBitInfo,
 
122
                         bool isInActiveLayer,
 
123
                         RAS_IRenderTools* rendertools,
 
124
                         KX_BlenderSceneConverter* converter
 
125
                         )
125
126
{
126
127
        
127
128
        int uniqueint = 0;
135
136
        }
136
137
        gameobj->ReserveActuator(actcount);
137
138
        bact = (bActuator*) blenderobject->actuators.first;
138
 
        while(bact)
 
139
        while (bact)
139
140
        {
140
141
                STR_String uniquename = bact->name;
141
142
                STR_String& objectname = gameobj->GetName();
147
148
                        {
148
149
                                bObjectActuator* obact = (bObjectActuator*) bact->data;
149
150
                                KX_GameObject* obref = NULL;
150
 
                                MT_Vector3 forcevec(KX_BLENDERTRUNC(obact->forceloc[0]),
151
 
                                        KX_BLENDERTRUNC(obact->forceloc[1]),
152
 
                                        KX_BLENDERTRUNC(obact->forceloc[2]));
153
 
                                MT_Vector3 torquevec(obact->forcerot[0],obact->forcerot[1],obact->forcerot[2]);
154
 
                                MT_Vector3 dlocvec ( KX_BLENDERTRUNC(obact->dloc[0]),
155
 
                                        KX_BLENDERTRUNC(obact->dloc[1]),
156
 
                                        KX_BLENDERTRUNC(obact->dloc[2]));
157
 
                                MT_Vector3 drotvec ( KX_BLENDERTRUNC(obact->drot[0]),obact->drot[1],obact->drot[2]);
158
 
                                MT_Vector3 linvelvec ( KX_BLENDERTRUNC(obact->linearvelocity[0]),
159
 
                                        KX_BLENDERTRUNC(obact->linearvelocity[1]),
160
 
                                        KX_BLENDERTRUNC(obact->linearvelocity[2]));
161
 
                                MT_Vector3 angvelvec ( KX_BLENDERTRUNC(obact->angularvelocity[0]),
162
 
                                        KX_BLENDERTRUNC(obact->angularvelocity[1]),
163
 
                                        KX_BLENDERTRUNC(obact->angularvelocity[2]));
 
151
                                MT_Vector3 forcevec(KX_flt_trunc(obact->forceloc[0]),
 
152
                                                    KX_flt_trunc(obact->forceloc[1]),
 
153
                                                    KX_flt_trunc(obact->forceloc[2]));
 
154
                                MT_Vector3 torquevec(obact->forcerot[0],
 
155
                                                     obact->forcerot[1],
 
156
                                                     obact->forcerot[2]);
 
157
                                MT_Vector3 dlocvec(KX_flt_trunc(obact->dloc[0]),
 
158
                                                   KX_flt_trunc(obact->dloc[1]),
 
159
                                                   KX_flt_trunc(obact->dloc[2]));
 
160
                                MT_Vector3 drotvec(KX_flt_trunc(obact->drot[0]),
 
161
                                                   obact->drot[1],obact->drot[2]);
 
162
                                MT_Vector3 linvelvec(KX_flt_trunc(obact->linearvelocity[0]),
 
163
                                                     KX_flt_trunc(obact->linearvelocity[1]),
 
164
                                                     KX_flt_trunc(obact->linearvelocity[2]));
 
165
                                MT_Vector3 angvelvec(KX_flt_trunc(obact->angularvelocity[0]),
 
166
                                                     KX_flt_trunc(obact->angularvelocity[1]),
 
167
                                                     KX_flt_trunc(obact->angularvelocity[2]));
164
168
                                short damping = obact->damping;
165
 
                                
 
169
 
166
170
                                /* Blender uses a bit vector internally for the local-flags. In */
167
171
                                /* KX, we have four bools. The compiler should be smart enough  */
168
172
                                /* to do the right thing. We need to explicitly convert here!   */
176
180
                                bitLocalFlag.LinearVelocity = bool((obact->flag & ACT_LIN_VEL_LOCAL)!=0);
177
181
                                bitLocalFlag.AngularVelocity = bool((obact->flag & ACT_ANG_VEL_LOCAL)!=0);
178
182
                                bitLocalFlag.ServoControl = bool(obact->type == ACT_OBJECT_SERVO);
 
183
                                bitLocalFlag.CharacterMotion = bool(obact->type == ACT_OBJECT_CHARACTER);
 
184
                                bitLocalFlag.CharacterJump = bool((obact->flag & ACT_CHAR_JUMP)!=0);
179
185
                                bitLocalFlag.AddOrSetLinV = bool((obact->flag & ACT_ADD_LIN_VEL)!=0);
 
186
                                bitLocalFlag.AddOrSetCharLoc = bool((obact->flag & ACT_ADD_CHAR_LOC)!=0);
180
187
                                if (obact->reference && bitLocalFlag.ServoControl)
181
188
                                {
182
189
                                        obref = converter->FindGameObject(obact->reference);
183
190
                                }
184
191
                                
185
 
                                KX_ObjectActuator* tmpbaseact = new KX_ObjectActuator(gameobj,
186
 
                                        obref,
187
 
                                        forcevec.getValue(),
188
 
                                        torquevec.getValue(),
189
 
                                        dlocvec.getValue(),
190
 
                                        drotvec.getValue(),
191
 
                                        linvelvec.getValue(),
192
 
                                        angvelvec.getValue(),
193
 
                                        damping,
194
 
                                        bitLocalFlag
195
 
                                        );
 
192
                                KX_ObjectActuator* tmpbaseact = new KX_ObjectActuator(
 
193
                                            gameobj,
 
194
                                            obref,
 
195
                                            forcevec.getValue(),
 
196
                                            torquevec.getValue(),
 
197
                                            dlocvec.getValue(),
 
198
                                            drotvec.getValue(),
 
199
                                            linvelvec.getValue(),
 
200
                                            angvelvec.getValue(),
 
201
                                            damping,
 
202
                                            bitLocalFlag);
196
203
                                baseact = tmpbaseact;
197
204
                                break;
198
205
                        }
211
218
                                if (actact->flag & ACT_IPOCHILD) ipo_flags |= BL_Action::ACT_IPOFLAG_CHILD;
212
219
                                        
213
220
                                BL_ActionActuator* tmpbaseact = new BL_ActionActuator(
214
 
                                        gameobj,
215
 
                                        propname,
216
 
                                        propframe,
217
 
                                        actact->sta,
218
 
                                        actact->end,
219
 
                                        actact->act,
220
 
                                        actact->type, // + 1, because Blender starts to count at zero,
221
 
                                        actact->blendin,
222
 
                                        actact->priority,
223
 
                                        actact->layer,
224
 
                                        actact->layer_weight,
225
 
                                        ipo_flags,
226
 
                                        actact->end_reset,
227
 
                                        actact->stridelength
228
 
                                        // Ketsji at 1, because zero is reserved for "NoDef"
229
 
                                        );
 
221
                                            gameobj,
 
222
                                            propname,
 
223
                                            propframe,
 
224
                                            actact->sta,
 
225
                                            actact->end,
 
226
                                            actact->act,
 
227
                                            actact->type, // + 1, because Blender starts to count at zero,
 
228
                                            actact->blendin,
 
229
                                            actact->priority,
 
230
                                            actact->layer,
 
231
                                            actact->layer_weight,
 
232
                                            ipo_flags,
 
233
                                            actact->end_reset,
 
234
                                            actact->stridelength
 
235
                                            // Ketsji at 1, because zero is reserved for "NoDef"
 
236
                                            );
230
237
                                baseact= tmpbaseact;
231
238
                                break;
232
239
                        }
238
245
                                        STR_String propframe = (actact->frameProp ? actact->frameProp : "");
239
246
                                        
240
247
                                        BL_ShapeActionActuator* tmpbaseact = new BL_ShapeActionActuator(
241
 
                                                gameobj,
242
 
                                                propname,
243
 
                                                propframe,
244
 
                                                actact->sta,
245
 
                                                actact->end,
246
 
                                                actact->act,
247
 
                                                actact->type, // + 1, because Blender starts to count at zero,
248
 
                                                actact->blendin,
249
 
                                                actact->priority,
250
 
                                                actact->stridelength
251
 
                                                // Ketsji at 1, because zero is reserved for "NoDef"
252
 
                                                );
 
248
                                                    gameobj,
 
249
                                                    propname,
 
250
                                                    propframe,
 
251
                                                    actact->sta,
 
252
                                                    actact->end,
 
253
                                                    actact->act,
 
254
                                                    actact->type, // + 1, because Blender starts to count at zero,
 
255
                                                    actact->blendin,
 
256
                                                    actact->priority,
 
257
                                                    actact->stridelength);
 
258
                                        // Ketsji at 1, because zero is reserved for "NoDef"
253
259
                                        baseact= tmpbaseact;
254
260
                                        break;
255
261
                                }
268
274
                                bool ipo_add = (ipoact->flag & ACT_IPOADD);
269
275
                                
270
276
                                KX_IpoActuator* tmpbaseact = new KX_IpoActuator(
271
 
                                        gameobj,
272
 
                                        propname ,
273
 
                                        frameProp,
274
 
                                        ipoact->sta,
275
 
                                        ipoact->end,
276
 
                                        ipochild,
277
 
                                        ipoact->type + 1, // + 1, because Blender starts to count at zero,
278
 
                                        // Ketsji at 1, because zero is reserved for "NoDef"
279
 
                                        ipo_as_force,
280
 
                                        ipo_add,
281
 
                                        local);
 
277
                                            gameobj,
 
278
                                            propname ,
 
279
                                            frameProp,
 
280
                                            ipoact->sta,
 
281
                                            ipoact->end,
 
282
                                            ipochild,
 
283
                                            ipoact->type + 1, // + 1, because Blender starts to count at zero,
 
284
                                            // Ketsji at 1, because zero is reserved for "NoDef"
 
285
                                            ipo_as_force,
 
286
                                            ipo_add,
 
287
                                            local);
282
288
                                baseact = tmpbaseact;
283
289
                                break;
284
290
                        }
294
300
                                        
295
301
                                        /* visifac, fac and axis are not copied from the struct...   */ 
296
302
                                        /* that's some internal state...                             */
297
 
                                        KX_CameraActuator *tmpcamact
298
 
                                                = new KX_CameraActuator(gameobj,
299
 
                                                tmpgob,
300
 
                                                camact->height,
301
 
                                                camact->min,
302
 
                                                camact->max,
303
 
                                                camact->axis,
304
 
                                                camact->damping);
 
303
                                        KX_CameraActuator *tmpcamact = new KX_CameraActuator(
 
304
                                                    gameobj,
 
305
                                                    tmpgob,
 
306
                                                    camact->height,
 
307
                                                    camact->min,
 
308
                                                    camact->max,
 
309
                                                    camact->axis,
 
310
                                                    camact->damping);
305
311
                                        baseact = tmpcamact;
306
312
                                }
307
313
                                break;
334
340
                                        ? (char*) msgAct->body
335
341
                                        : "");
336
342
                                
337
 
                                KX_NetworkMessageActuator *tmpmsgact = 
338
 
                                        new KX_NetworkMessageActuator(
339
 
                                        gameobj,                                        // actuator controlling object
340
 
                                        scene->GetNetworkScene(),       // needed for replication
341
 
                                        toPropName,
342
 
                                        subject,
343
 
                                        bodyType,
344
 
                                        body);
 
343
                                KX_NetworkMessageActuator *tmpmsgact = new KX_NetworkMessageActuator(
 
344
                                            gameobj,                                    // actuator controlling object
 
345
                                            scene->GetNetworkScene(),   // needed for replication
 
346
                                            toPropName,
 
347
                                            subject,
 
348
                                            bodyType,
 
349
                                            body);
345
350
                                baseact = tmpmsgact;
346
351
                                break;
347
352
                        }
356
361
                                KX_SoundActuator::KX_SOUNDACT_TYPE
357
362
                                        soundActuatorType = KX_SoundActuator::KX_SOUNDACT_NODEF;
358
363
                                
359
 
                                switch(soundact->type) {
 
364
                                switch (soundact->type) {
360
365
                                case ACT_SND_PLAY_STOP_SOUND:
361
366
                                        soundActuatorType = KX_SoundActuator::KX_SOUNDACT_PLAYSTOP;
362
367
                                        break;
385
390
                                {
386
391
                                        bSound* sound = soundact->sound;
387
392
                                        bool is3d = soundact->flag & ACT_SND_3D_SOUND ? true : false;
388
 
                                        AUD_Reference<AUD_IFactory> snd_sound;
 
393
                                        boost::shared_ptr<AUD_IFactory> snd_sound;
389
394
                                        KX_3DSoundSettings settings;
390
395
                                        settings.cone_inner_angle = soundact->sound3D.cone_inner_angle;
391
396
                                        settings.cone_outer_angle = soundact->sound3D.cone_outer_angle;
404
409
                                        }
405
410
                                        else
406
411
                                        {
407
 
                                                snd_sound = *reinterpret_cast<AUD_Reference<AUD_IFactory>*>(sound->playback_handle);
 
412
                                                snd_sound = *reinterpret_cast<boost::shared_ptr<AUD_IFactory>*>(sound->playback_handle);
408
413
 
409
414
                                                // if sound shall be 3D but isn't mono, we have to make it mono!
410
415
                                                if (is3d)
411
416
                                                {
412
417
                                                        try
413
418
                                                        {
414
 
                                                                AUD_Reference<AUD_IReader> reader = snd_sound->createReader();
 
419
                                                                boost::shared_ptr<AUD_IReader> reader = snd_sound->createReader();
415
420
                                                                if (reader->getSpecs().channels != AUD_CHANNELS_MONO)
416
421
                                                                {
417
422
                                                                        AUD_DeviceSpecs specs;
418
423
                                                                        specs.channels = AUD_CHANNELS_MONO;
419
424
                                                                        specs.rate = AUD_RATE_INVALID;
420
425
                                                                        specs.format = AUD_FORMAT_INVALID;
421
 
                                                                        snd_sound = new AUD_ChannelMapperFactory(snd_sound, specs);
 
426
                                                                        snd_sound = boost::shared_ptr<AUD_IFactory>(new AUD_ChannelMapperFactory(snd_sound, specs));
422
427
                                                                }
423
428
                                                        }
424
429
                                                        catch(AUD_Exception&)
431
436
                                                new KX_SoundActuator(gameobj,
432
437
                                                snd_sound,
433
438
                                                soundact->volume,
434
 
                                                (float)(exp((soundact->pitch / 12.0) * M_LN2)),
 
439
                                                (float)(expf((soundact->pitch / 12.0f) * (float)M_LN2)),
435
440
                                                is3d,
436
441
                                                settings,
437
442
                                                soundActuatorType);
458
463
                                        destinationObj = converter->FindGameObject(propact->ob);
459
464
                                
460
465
                                SCA_PropertyActuator* tmppropact = new SCA_PropertyActuator(
461
 
                                        gameobj,
462
 
                                        destinationObj,
463
 
                                        propact->name,
464
 
                                        propact->value,
465
 
                                        propact->type+1); // + 1 because Ketsji Logic starts
 
466
                                            gameobj,
 
467
                                            destinationObj,
 
468
                                            propact->name,
 
469
                                            propact->value,
 
470
                                            propact->type + 1); // + 1 because Ketsji Logic starts
466
471
                                // with 0 for KX_ACT_PROP_NODEF
467
472
                                baseact = tmppropact;
468
473
                                break;
492
497
                                                        }
493
498
                                                }
494
499
                                                
495
 
                                                KX_SCA_AddObjectActuator* tmpaddact = 
496
 
                                                        new KX_SCA_AddObjectActuator(
497
 
                                                                gameobj, 
498
 
                                                                originalval,
499
 
                                                                editobact->time,
500
 
                                                                scene,
501
 
                                                                editobact->linVelocity,
502
 
                                                                (editobact->localflag & ACT_EDOB_LOCAL_LINV)!=0,
503
 
                                                                editobact->angVelocity,
504
 
                                                                (editobact->localflag & ACT_EDOB_LOCAL_ANGV)!=0
505
 
                                                                );
506
 
                                                                
 
500
                                                KX_SCA_AddObjectActuator* tmpaddact = new KX_SCA_AddObjectActuator(
 
501
                                                            gameobj,
 
502
                                                            originalval,
 
503
                                                            editobact->time,
 
504
                                                            scene,
 
505
                                                            editobact->linVelocity,
 
506
                                                            (editobact->localflag & ACT_EDOB_LOCAL_LINV) != 0,
 
507
                                                            editobact->angVelocity,
 
508
                                                            (editobact->localflag & ACT_EDOB_LOCAL_ANGV) != 0);
 
509
 
507
510
                                                                //editobact->ob to gameobj
508
511
                                                                baseact = tmpaddact;
509
512
                                        }
520
523
                                                RAS_MeshObject *tmpmesh = NULL;
521
524
                                                if (editobact->me)
522
525
                                                        tmpmesh = BL_ConvertMesh(
523
 
                                                                editobact->me,
524
 
                                                                blenderobject,
525
 
                                                                scene,
526
 
                                                                converter
527
 
                                                                );
528
 
 
529
 
                                                KX_SCA_ReplaceMeshActuator* tmpreplaceact
530
 
                                                        = new KX_SCA_ReplaceMeshActuator(
531
 
                                                                gameobj,
532
 
                                                                tmpmesh,
533
 
                                                                scene,
534
 
                                                                (editobact->flag & ACT_EDOB_REPLACE_MESH_NOGFX)==0,
535
 
                                                                (editobact->flag & ACT_EDOB_REPLACE_MESH_PHYS)!=0
536
 
                                                                
537
 
                                                                );
538
 
                                                        
539
 
                                                        baseact = tmpreplaceact;
 
526
                                                                    editobact->me,
 
527
                                                                    blenderobject,
 
528
                                                                    scene,
 
529
                                                                    converter,
 
530
                                                                    false
 
531
                                                                    );
 
532
 
 
533
                                                KX_SCA_ReplaceMeshActuator* tmpreplaceact = new KX_SCA_ReplaceMeshActuator(
 
534
                                                            gameobj,
 
535
                                                            tmpmesh,
 
536
                                                            scene,
 
537
                                                            (editobact->flag & ACT_EDOB_REPLACE_MESH_NOGFX) == 0,
 
538
                                                            (editobact->flag & ACT_EDOB_REPLACE_MESH_PHYS) != 0);
 
539
 
 
540
                                                baseact = tmpreplaceact;
540
541
                                        }
541
542
                                        break;
542
543
                                case ACT_EDOB_TRACK_TO:
545
546
                                                if (editobact->ob)
546
547
                                                        originalval = converter->FindGameObject(editobact->ob);
547
548
                                                        
548
 
                                                KX_TrackToActuator* tmptrackact 
549
 
                                                        = new KX_TrackToActuator(gameobj, 
550
 
                                                                originalval,
551
 
                                                                editobact->time,
552
 
                                                                editobact->flag,
553
 
                                                                blenderobject->trackflag,
554
 
                                                                blenderobject->upflag
555
 
                                                                );
556
 
                                                        baseact = tmptrackact;
 
549
                                                KX_TrackToActuator* tmptrackact = new KX_TrackToActuator(
 
550
                                                            gameobj,
 
551
                                                            originalval,
 
552
                                                            editobact->time,
 
553
                                                            editobact->flag,
 
554
                                                            blenderobject->trackflag,
 
555
                                                            blenderobject->upflag);
 
556
                                                baseact = tmptrackact;
557
557
                                                break;
558
558
                                        }
559
559
                                case ACT_EDOB_DYNAMICS:
560
560
                                        {
561
 
                                                KX_SCA_DynamicActuator* tmpdynact 
562
 
                                                        = new KX_SCA_DynamicActuator(gameobj, 
563
 
                                                                editobact->dyn_operation,
564
 
                                                                editobact->mass
565
 
                                                                );
566
 
                                                        baseact = tmpdynact;
 
561
                                                KX_SCA_DynamicActuator* tmpdynact = new KX_SCA_DynamicActuator(
 
562
                                                            gameobj,
 
563
                                                            editobact->dyn_operation,
 
564
                                                            editobact->mass);
 
565
                                                baseact = tmpdynact;
567
566
                                        }
568
567
                                }
569
568
                                break;
578
577
                                /* convert settings... degrees in the ui become radians  */ 
579
578
                                /* internally                                            */ 
580
579
                                if (conact->type == ACT_CONST_TYPE_ORI) {
581
 
                                        min = (float)((MT_2_PI * conact->minloc[0])/360.0);
582
 
                                        max = (float)((MT_2_PI * conact->maxloc[0])/360.0);
 
580
                                        min = (float)(((float)MT_2_PI * conact->minloc[0]) / 360.0f);
 
581
                                        max = (float)(((float)MT_2_PI * conact->maxloc[0]) / 360.0f);
583
582
                                        switch (conact->mode) {
584
583
                                        case ACT_CONST_DIRPX:
585
584
                                                locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX;
695
694
                                                ; /* error */ 
696
695
                                        }
697
696
                                }
698
 
                                KX_ConstraintActuator *tmpconact 
699
 
                                        = new KX_ConstraintActuator(gameobj,
700
 
                                                conact->damp,
701
 
                                                conact->rotdamp,
702
 
                                                min,
703
 
                                                max,
704
 
                                                conact->maxrot,
705
 
                                                locrot,
706
 
                                                conact->time,
707
 
                                                conact->flag,
708
 
                                                prop);
 
697
                                KX_ConstraintActuator *tmpconact = new KX_ConstraintActuator(
 
698
                                            gameobj,
 
699
                                            conact->damp,
 
700
                                            conact->rotdamp,
 
701
                                            min,
 
702
                                            max,
 
703
                                            conact->maxrot,
 
704
                                            locrot,
 
705
                                            conact->time,
 
706
                                            conact->flag,
 
707
                                            prop);
709
708
                                baseact = tmpconact;
710
709
                                break;
711
710
                        }
778
777
                                default:
779
778
                                        ; /* flag error */
780
779
                                }
781
 
                                tmpsceneact = new KX_SceneActuator(gameobj,
782
 
                                                mode,
783
 
                                                scene,
784
 
                                                ketsjiEngine,
785
 
                                                nextSceneName,
786
 
                                                cam);
787
 
                                        baseact = tmpsceneact;
 
780
                                tmpsceneact = new KX_SceneActuator(
 
781
                                            gameobj,
 
782
                                            mode,
 
783
                                            scene,
 
784
                                            ketsjiEngine,
 
785
                                            nextSceneName,
 
786
                                            cam);
 
787
                                baseact = tmpsceneact;
788
788
                                break;
789
789
                        }
790
790
                case ACT_GAME:
833
833
                                default:
834
834
                                        ; /* flag error */
835
835
                                }
836
 
                                        tmpgameact = new KX_GameActuator(gameobj,
837
 
                                                mode,
838
 
                                                filename,
839
 
                                                loadinganimationname,
840
 
                                                scene,
841
 
                                                ketsjiEngine);
842
 
                                        baseact = tmpgameact;
 
836
                                tmpgameact = new KX_GameActuator(
 
837
                                            gameobj,
 
838
                                            mode,
 
839
                                            filename,
 
840
                                            loadinganimationname,
 
841
                                            scene,
 
842
                                            ketsjiEngine);
 
843
                                baseact = tmpgameact;
843
844
 
844
845
                                break;
845
846
                        }
860
861
                                float paraArg1 = 0.0;
861
862
                                float paraArg2 = 0.0;
862
863
                                
863
 
                                switch  (randAct->distribution) {
 
864
                                switch (randAct->distribution) {
864
865
                                case ACT_RANDOM_BOOL_CONST:
865
866
                                        modeArg = SCA_RandomActuator::KX_RANDOMACT_BOOL_CONST;
866
867
                                        paraArg1 = (float) randAct->int_arg_1;
904
905
                                        modeArg = SCA_RandomActuator::KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL;
905
906
                                        break;
906
907
                                default:
907
 
                                        ; /* error */                           
 
908
                                        ; /* error */
908
909
                                }
909
 
                                tmprandomact = new SCA_RandomActuator(gameobj,
910
 
                                        seedArg,
911
 
                                        modeArg, 
912
 
                                        paraArg1,
913
 
                                        paraArg2,
914
 
                                        randAct->propname);
 
910
                                tmprandomact = new SCA_RandomActuator(
 
911
                                            gameobj,
 
912
                                            seedArg,
 
913
                                            modeArg,
 
914
                                            paraArg1,
 
915
                                            paraArg2,
 
916
                                            randAct->propname);
915
917
                                baseact = tmprandomact;
916
918
                        }
917
919
                        break;
948
950
                        SCA_2DFilterActuator *tmp = NULL;
949
951
 
950
952
                        RAS_2DFilterManager::RAS_2DFILTER_MODE filtermode;
951
 
                        switch(_2dfilter->type)
952
 
                        {
 
953
                        switch (_2dfilter->type) {
953
954
                                case ACT_2DFILTER_MOTIONBLUR:
954
955
                                        filtermode = RAS_2DFilterManager::RAS_2DFILTER_MOTIONBLUR;
955
956
                                        break;
1000
1001
                                        break;
1001
1002
                        }
1002
1003
 
1003
 
                        tmp = new SCA_2DFilterActuator(gameobj, filtermode, _2dfilter->flag,
1004
 
                                _2dfilter->float_arg,_2dfilter->int_arg,ketsjiEngine->GetRasterizer(),scene);
 
1004
                        tmp = new SCA_2DFilterActuator(gameobj, filtermode,  _2dfilter->flag,
 
1005
                                                       _2dfilter->float_arg, _2dfilter->int_arg,
 
1006
                                                       ketsjiEngine->GetRasterizer(), scene);
1005
1007
 
1006
1008
                        if (_2dfilter->text)
1007
1009
                        {
1027
1029
                                bool ghost = true;
1028
1030
                                KX_GameObject *tmpgob = NULL;
1029
1031
 
1030
 
                                switch(parAct->type)
1031
 
                                {
 
1032
                                switch (parAct->type) {
1032
1033
                                        case ACT_PARENT_SET:
1033
1034
                                                mode = KX_ParentActuator::KX_PARENT_SET;
1034
1035
                                                tmpgob = converter->FindGameObject(parAct->ob);
1056
1057
                                bArmatureActuator* armAct = (bArmatureActuator*) bact->data;
1057
1058
                                KX_GameObject *tmpgob = converter->FindGameObject(armAct->target);
1058
1059
                                KX_GameObject *subgob = converter->FindGameObject(armAct->subtarget);
1059
 
                                BL_ArmatureActuator* tmparmact = new BL_ArmatureActuator(gameobj, armAct->type, armAct->posechannel, armAct->constraint, tmpgob, subgob, armAct->weight, armAct->influence);
 
1060
                                BL_ArmatureActuator* tmparmact = new BL_ArmatureActuator(
 
1061
                                            gameobj,
 
1062
                                            armAct->type,
 
1063
                                            armAct->posechannel,
 
1064
                                            armAct->constraint,
 
1065
                                            tmpgob,
 
1066
                                            subgob,
 
1067
                                            armAct->weight,
 
1068
                                            armAct->influence);
1060
1069
                                baseact = tmparmact;
1061
1070
                                break;
1062
1071
                        }
1074
1083
                                KX_GameObject *targetob = converter->FindGameObject(stAct->target);
1075
1084
 
1076
1085
                                int mode = KX_SteeringActuator::KX_STEERING_NODEF;
1077
 
                                switch(stAct->type)
1078
 
                                {
 
1086
                                switch (stAct->type) {
1079
1087
                                case ACT_STEERING_SEEK:
1080
1088
                                        mode = KX_SteeringActuator::KX_STEERING_SEEK;
1081
1089
                                        break;