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

« back to all changes in this revision

Viewing changes to source/gameengine/Ketsji/KX_SoundActuator.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
 * KX_SoundActuator.cpp
3
3
 *
4
 
 * $Id: KX_SoundActuator.cpp,v 1.4 2004/03/22 22:01:53 jesterking Exp $
 
4
 * $Id: KX_SoundActuator.cpp,v 1.9 2005/03/25 10:33:37 kester Exp $
5
5
 *
6
6
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
7
7
 *
64
64
        m_startFrame = start;
65
65
        m_endFrame = end;
66
66
        m_pino = false;
 
67
        
 
68
 
67
69
}
68
70
 
69
71
 
94
96
 
95
97
 
96
98
 
97
 
bool KX_SoundActuator::Update(double curtime,double deltatime)
 
99
bool KX_SoundActuator::Update(double curtime, bool frame)
98
100
{
 
101
        if (!frame)
 
102
                return true;
99
103
        bool result = false;
100
104
 
101
105
        // do nothing on negative events, otherwise sounds are played twice!
256
260
        {"getLooping",(PyCFunction) KX_SoundActuator::sPyGetLooping,METH_VARARGS,NULL},
257
261
        {"setPosition",(PyCFunction) KX_SoundActuator::sPySetPosition,METH_VARARGS,NULL},
258
262
        {"setVelocity",(PyCFunction) KX_SoundActuator::sPySetVelocity,METH_VARARGS,NULL},
259
 
        {"setOrientation",(PyCFunction) KX_SoundActuator::sPySetOrientation,METH_VARARGS,NULL}, 
 
263
        {"setOrientation",(PyCFunction) KX_SoundActuator::sPySetOrientation,METH_VARARGS,NULL},
 
264
        {"setType",(PyCFunction) KX_SoundActuator::sPySetType,METH_VARARGS,NULL},
 
265
        {"getType",(PyCFunction) KX_SoundActuator::sPyGetType,METH_VARARGS,NULL},
260
266
        {NULL,NULL,NULL,NULL} //Sentinel
261
267
};
262
268
 
263
269
 
264
270
 
265
 
PyObject* KX_SoundActuator::_getattr(char* attr)
 
271
PyObject* KX_SoundActuator::_getattr(const STR_String& attr)
266
272
{
267
273
        _getattr_up(SCA_IActuator);
268
274
}
272
278
PyObject* KX_SoundActuator::PySetFilename(PyObject* self, PyObject* args, PyObject* kwds)
273
279
{
274
280
        char *soundName = NULL;
275
 
        void *soundPointer = NULL;
 
281
        // void *soundPointer = NULL; /*unused*/
276
282
        
277
283
        if (!PyArg_ParseTuple(args, "s", &soundName))
278
284
                return NULL;
464
470
        m_soundObject->SetOrientation(ori);
465
471
        
466
472
        Py_Return;
467
 
}         
 
473
}
 
474
 
 
475
PyObject* KX_SoundActuator::PySetType(PyObject* self, PyObject* args, PyObject* kwds)
 
476
{
 
477
        int typeArg;
 
478
 
 
479
        if (!PyArg_ParseTuple(args, "i", &typeArg)) {
 
480
                return NULL;
 
481
        }
 
482
 
 
483
        if ( (typeArg > KX_SOUNDACT_NODEF)
 
484
          && (typeArg < KX_SOUNDACT_MAX) ) {
 
485
                m_type = (KX_SOUNDACT_TYPE) typeArg;
 
486
        }
 
487
 
 
488
        Py_Return;
 
489
}
 
490
 
 
491
PyObject* KX_SoundActuator::PyGetType(PyObject* self, PyObject* args, PyObject* kwds)
 
492
{
 
493
        return PyInt_FromLong(m_type);
 
494
}
468
495
 
469
496
 
470
497