~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/gameengine/Ketsji/KX_SceneActuator.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
* Set scene/camera stuff
3
3
*
4
 
* $Id: KX_SceneActuator.cpp,v 1.4 2004/03/22 22:01:53 jesterking Exp $
 
4
* $Id: KX_SceneActuator.cpp,v 1.11 2005/03/09 19:45:59 lukep Exp $
5
5
*
6
6
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
7
7
 *
84
84
 
85
85
 
86
86
 
87
 
bool KX_SceneActuator::Update(double curtime,double deltatime)
 
87
bool KX_SceneActuator::Update()
88
88
{
89
 
        bool result = false;    
 
89
        // bool result = false; /*unused*/
90
90
        bool bNegativeEvent = IsNegativeEvent();
91
91
        RemoveAllEvents();
92
92
 
100
100
                        m_KetsjiEngine->ReplaceScene(m_scene->GetName(),m_scene->GetName());
101
101
                        break;
102
102
                }
 
103
        case KX_SCENE_SET_CAMERA:
 
104
                if (m_camera)
 
105
                {
 
106
                        m_scene->SetActiveCamera(m_camera);
 
107
                }
 
108
                break;
 
109
        default:
 
110
                break;
 
111
        }
 
112
        
 
113
        if (!m_nextSceneName.Length())
 
114
                return false;
 
115
        
 
116
        switch (m_mode)
 
117
        {
103
118
        case KX_SCENE_SET_SCENE:
104
119
                {
105
120
                        m_KetsjiEngine->ReplaceScene(m_scene->GetName(),m_nextSceneName);
132
147
                        m_KetsjiEngine->ResumeScene(m_nextSceneName);
133
148
                        break;
134
149
                }
135
 
        case KX_SCENE_SET_CAMERA:
136
 
                if (m_camera)
137
 
                {
138
 
                        m_scene->SetActiveCamera(m_camera);
139
 
                }
140
 
                break;
141
150
        default:
142
151
                ; /* do nothing? this is an internal error !!! */
143
152
        }
224
233
 
225
234
 
226
235
 
227
 
PyObject* KX_SceneActuator::_getattr(char* attr)
 
236
PyObject* KX_SceneActuator::_getattr(const STR_String& attr)
228
237
{
229
238
        _getattr_up(SCA_IActuator);
230
239
}
247
256
                return NULL;
248
257
        }
249
258
        
250
 
        if (boolArg == KX_TRUE)
251
 
        {
252
 
                m_restart = true;
253
 
        }
254
 
        else if (boolArg == KX_FALSE)
255
 
        {
256
 
                m_restart = false;
257
 
        }
258
 
        else
259
 
        {
260
 
                ; /* internal error */
261
 
        }
 
259
        m_restart = boolArg != 0;
262
260
        
263
261
        Py_Return;
264
262
}
325
323
                                                                                PyObject* args, 
326
324
                                                                                PyObject* kwds)
327
325
{
 
326
        PyObject *cam;
 
327
        if (PyArg_ParseTuple(args, "O!", &KX_Camera::Type, &cam))
 
328
        {
 
329
                m_camera = (KX_Camera*) cam;
 
330
                Py_Return;
 
331
        }
 
332
        PyErr_Clear();
 
333
 
328
334
        /* one argument: a scene, ignore the rest */
329
335
        char *camName;
330
 
        KX_Camera *camOb;
331
 
 
332
336
        if(!PyArg_ParseTuple(args, "s", &camName))
333
337
        {
334
338
                return NULL;
335
339
        }
336
340
 
337
 
        camOb = FindCamera(camName);
 
341
        KX_Camera *camOb = FindCamera(camName);
338
342
        if (camOb) m_camera = camOb;
339
343
 
340
344
        Py_Return;