style cleanup
This commit is contained in:
parent
c2a1dcf621
commit
2fb8292005
|
@ -80,7 +80,7 @@ typedef enum
|
|||
|
||||
// ====================================================================
|
||||
|
||||
static PyObject* AUDError;
|
||||
static PyObject *AUDError;
|
||||
|
||||
static const char* device_not_3d_error = "Device is not a 3D device!";
|
||||
|
||||
|
@ -92,7 +92,7 @@ Factory_dealloc(Factory* self)
|
|||
if(self->factory)
|
||||
delete reinterpret_cast<AUD_Reference<AUD_IFactory>*>(self->factory);
|
||||
Py_XDECREF(self->child_list);
|
||||
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||
Py_TYPE(self)->tp_free((PyObject *)self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
@ -139,7 +139,7 @@ PyDoc_STRVAR(M_aud_Factory_sine_doc,
|
|||
":rtype: :class:`Factory`");
|
||||
|
||||
static PyObject *
|
||||
Factory_sine(PyTypeObject* type, PyObject* args)
|
||||
Factory_sine(PyTypeObject* type, PyObject *args)
|
||||
{
|
||||
float frequency;
|
||||
double rate = 44100;
|
||||
|
@ -179,7 +179,7 @@ PyDoc_STRVAR(M_aud_Factory_file_doc,
|
|||
"playback of that factory.");
|
||||
|
||||
static PyObject *
|
||||
Factory_file(PyTypeObject* type, PyObject* args)
|
||||
Factory_file(PyTypeObject* type, PyObject *args)
|
||||
{
|
||||
const char* filename = NULL;
|
||||
|
||||
|
@ -218,7 +218,7 @@ PyDoc_STRVAR(M_aud_Factory_lowpass_doc,
|
|||
":rtype: :class:`Factory`");
|
||||
|
||||
static PyObject *
|
||||
Factory_lowpass(Factory* self, PyObject* args)
|
||||
Factory_lowpass(Factory* self, PyObject *args)
|
||||
{
|
||||
float frequency;
|
||||
float Q = 0.5;
|
||||
|
@ -232,7 +232,7 @@ Factory_lowpass(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -260,7 +260,7 @@ PyDoc_STRVAR(M_aud_Factory_delay_doc,
|
|||
":rtype: :class:`Factory`");
|
||||
|
||||
static PyObject *
|
||||
Factory_delay(Factory* self, PyObject* args)
|
||||
Factory_delay(Factory* self, PyObject *args)
|
||||
{
|
||||
float delay;
|
||||
|
||||
|
@ -273,7 +273,7 @@ Factory_delay(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -301,7 +301,7 @@ PyDoc_STRVAR(M_aud_Factory_join_doc,
|
|||
"(channels and samplerate).");
|
||||
|
||||
static PyObject *
|
||||
Factory_join(Factory* self, PyObject* object)
|
||||
Factory_join(Factory* self, PyObject *object)
|
||||
{
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
|
||||
|
@ -346,7 +346,7 @@ PyDoc_STRVAR(M_aud_Factory_highpass_doc,
|
|||
":rtype: :class:`Factory`");
|
||||
|
||||
static PyObject *
|
||||
Factory_highpass(Factory* self, PyObject* args)
|
||||
Factory_highpass(Factory* self, PyObject *args)
|
||||
{
|
||||
float frequency;
|
||||
float Q = 0.5;
|
||||
|
@ -360,7 +360,7 @@ Factory_highpass(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -388,7 +388,7 @@ PyDoc_STRVAR(M_aud_Factory_limit_doc,
|
|||
":rtype: :class:`Factory`");
|
||||
|
||||
static PyObject *
|
||||
Factory_limit(Factory* self, PyObject* args)
|
||||
Factory_limit(Factory* self, PyObject *args)
|
||||
{
|
||||
float start, end;
|
||||
|
||||
|
@ -401,7 +401,7 @@ Factory_limit(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -432,7 +432,7 @@ PyDoc_STRVAR(M_aud_Factory_pitch_doc,
|
|||
":attr:`Handle.pitch` instead.");
|
||||
|
||||
static PyObject *
|
||||
Factory_pitch(Factory* self, PyObject* args)
|
||||
Factory_pitch(Factory* self, PyObject *args)
|
||||
{
|
||||
float factor;
|
||||
|
||||
|
@ -445,7 +445,7 @@ Factory_pitch(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -474,7 +474,7 @@ PyDoc_STRVAR(M_aud_Factory_volume_doc,
|
|||
":attr:`Handle.volume` instead.");
|
||||
|
||||
static PyObject *
|
||||
Factory_volume(Factory* self, PyObject* args)
|
||||
Factory_volume(Factory* self, PyObject *args)
|
||||
{
|
||||
float volume;
|
||||
|
||||
|
@ -487,7 +487,7 @@ Factory_volume(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -517,7 +517,7 @@ PyDoc_STRVAR(M_aud_Factory_fadein_doc,
|
|||
".. note:: Before the fade starts it plays silence.");
|
||||
|
||||
static PyObject *
|
||||
Factory_fadein(Factory* self, PyObject* args)
|
||||
Factory_fadein(Factory* self, PyObject *args)
|
||||
{
|
||||
float start, length;
|
||||
|
||||
|
@ -530,7 +530,7 @@ Factory_fadein(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -561,7 +561,7 @@ PyDoc_STRVAR(M_aud_Factory_fadeout_doc,
|
|||
"the length of the factory is not altered.");
|
||||
|
||||
static PyObject *
|
||||
Factory_fadeout(Factory* self, PyObject* args)
|
||||
Factory_fadeout(Factory* self, PyObject *args)
|
||||
{
|
||||
float start, length;
|
||||
|
||||
|
@ -574,7 +574,7 @@ Factory_fadeout(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -603,7 +603,7 @@ PyDoc_STRVAR(M_aud_Factory_loop_doc,
|
|||
":attr:`Handle.loop_count` instead.");
|
||||
|
||||
static PyObject *
|
||||
Factory_loop(Factory* self, PyObject* args)
|
||||
Factory_loop(Factory* self, PyObject *args)
|
||||
{
|
||||
int loop;
|
||||
|
||||
|
@ -616,7 +616,7 @@ Factory_loop(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -644,7 +644,7 @@ PyDoc_STRVAR(M_aud_Factory_mix_doc,
|
|||
"(channels and samplerate).");
|
||||
|
||||
static PyObject *
|
||||
Factory_mix(Factory* self, PyObject* object)
|
||||
Factory_mix(Factory* self, PyObject *object)
|
||||
{
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
|
||||
|
@ -692,7 +692,7 @@ Factory_pingpong(Factory* self)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -731,7 +731,7 @@ Factory_reverse(Factory* self)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -795,7 +795,7 @@ PyDoc_STRVAR(M_aud_Factory_square_doc,
|
|||
":rtype: :class:`Factory`");
|
||||
|
||||
static PyObject *
|
||||
Factory_square(Factory* self, PyObject* args)
|
||||
Factory_square(Factory* self, PyObject *args)
|
||||
{
|
||||
float threshold = 0;
|
||||
|
||||
|
@ -808,7 +808,7 @@ Factory_square(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -842,10 +842,10 @@ PyDoc_STRVAR(M_aud_Factory_filter_doc,
|
|||
":rtype: :class:`Factory`");
|
||||
|
||||
static PyObject *
|
||||
Factory_filter(Factory* self, PyObject* args)
|
||||
Factory_filter(Factory* self, PyObject *args)
|
||||
{
|
||||
PyObject* py_b;
|
||||
PyObject* py_a = NULL;
|
||||
PyObject *py_b;
|
||||
PyObject *py_a = NULL;
|
||||
Py_ssize_t py_a_len;
|
||||
Py_ssize_t py_b_len;
|
||||
|
||||
|
@ -868,7 +868,7 @@ Factory_filter(Factory* self, PyObject* args)
|
|||
}
|
||||
|
||||
std::vector<float> a, b;
|
||||
PyObject* py_value;
|
||||
PyObject *py_value;
|
||||
float value;
|
||||
|
||||
for(Py_ssize_t i = 0; i < py_b_len; i++)
|
||||
|
@ -911,7 +911,7 @@ Factory_filter(Factory* self, PyObject* args)
|
|||
if(parent != NULL)
|
||||
{
|
||||
Py_INCREF(self);
|
||||
parent->child_list = (PyObject*)self;
|
||||
parent->child_list = (PyObject *)self;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -1040,7 +1040,7 @@ Handle_dealloc(Handle* self)
|
|||
{
|
||||
if(self->handle)
|
||||
delete reinterpret_cast<AUD_Reference<AUD_IHandle>*>(self->handle);
|
||||
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||
Py_TYPE(self)->tp_free((PyObject *)self);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(M_aud_Handle_pause_doc,
|
||||
|
@ -1135,7 +1135,7 @@ Handle_get_position(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_position(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_position(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float position;
|
||||
|
||||
|
@ -1180,7 +1180,7 @@ Handle_get_keep(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_keep(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_keep(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
if(!PyBool_Check(args))
|
||||
{
|
||||
|
@ -1239,7 +1239,7 @@ Handle_get_volume(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_volume(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_volume(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float volume;
|
||||
|
||||
|
@ -1278,7 +1278,7 @@ Handle_get_pitch(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_pitch(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_pitch(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float pitch;
|
||||
|
||||
|
@ -1317,7 +1317,7 @@ Handle_get_loop_count(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_loop_count(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_loop_count(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
int loops;
|
||||
|
||||
|
@ -1366,7 +1366,7 @@ Handle_get_location(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_location(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_location(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float x, y, z;
|
||||
|
||||
|
@ -1422,7 +1422,7 @@ Handle_get_velocity(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_velocity(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_velocity(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float x, y, z;
|
||||
|
||||
|
@ -1478,7 +1478,7 @@ Handle_get_orientation(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_orientation(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_orientation(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float w, x, y, z;
|
||||
|
||||
|
@ -1533,7 +1533,7 @@ Handle_get_relative(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_relative(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_relative(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
if(!PyBool_Check(args))
|
||||
{
|
||||
|
@ -1591,7 +1591,7 @@ Handle_get_volume_minimum(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_volume_minimum(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_volume_minimum(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float volume;
|
||||
|
||||
|
@ -1646,7 +1646,7 @@ Handle_get_volume_maximum(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_volume_maximum(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_volume_maximum(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float volume;
|
||||
|
||||
|
@ -1702,7 +1702,7 @@ Handle_get_distance_reference(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_distance_reference(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_distance_reference(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float distance;
|
||||
|
||||
|
@ -1758,7 +1758,7 @@ Handle_get_distance_maximum(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_distance_maximum(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_distance_maximum(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float distance;
|
||||
|
||||
|
@ -1814,7 +1814,7 @@ Handle_get_attenuation(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_attenuation(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_attenuation(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float factor;
|
||||
|
||||
|
@ -1875,7 +1875,7 @@ Handle_get_cone_angle_inner(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_cone_angle_inner(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_cone_angle_inner(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float angle;
|
||||
|
||||
|
@ -1930,7 +1930,7 @@ Handle_get_cone_angle_outer(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_cone_angle_outer(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_cone_angle_outer(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float angle;
|
||||
|
||||
|
@ -1985,7 +1985,7 @@ Handle_get_cone_volume_outer(Handle *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Handle_set_cone_volume_outer(Handle *self, PyObject* args, void* nothing)
|
||||
Handle_set_cone_volume_outer(Handle *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float volume;
|
||||
|
||||
|
@ -2105,7 +2105,7 @@ Device_dealloc(Device* self)
|
|||
{
|
||||
if(self->device)
|
||||
delete reinterpret_cast<AUD_Reference<AUD_IDevice>*>(self->device);
|
||||
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||
Py_TYPE(self)->tp_free((PyObject *)self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
@ -2201,8 +2201,8 @@ PyDoc_STRVAR(M_aud_Device_play_doc,
|
|||
static PyObject *
|
||||
Device_play(Device *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
PyObject* object;
|
||||
PyObject* keepo = NULL;
|
||||
PyObject *object;
|
||||
PyObject *keepo = NULL;
|
||||
|
||||
bool keep = false;
|
||||
|
||||
|
@ -2402,7 +2402,7 @@ Device_get_volume(Device *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Device_set_volume(Device *self, PyObject* args, void* nothing)
|
||||
Device_set_volume(Device *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float volume;
|
||||
|
||||
|
@ -2449,7 +2449,7 @@ Device_get_listener_location(Device *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Device_set_listener_location(Device *self, PyObject* args, void* nothing)
|
||||
Device_set_listener_location(Device *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float x, y, z;
|
||||
|
||||
|
@ -2504,7 +2504,7 @@ Device_get_listener_velocity(Device *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Device_set_listener_velocity(Device *self, PyObject* args, void* nothing)
|
||||
Device_set_listener_velocity(Device *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float x, y, z;
|
||||
|
||||
|
@ -2559,7 +2559,7 @@ Device_get_listener_orientation(Device *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Device_set_listener_orientation(Device *self, PyObject* args, void* nothing)
|
||||
Device_set_listener_orientation(Device *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float w, x, y, z;
|
||||
|
||||
|
@ -2614,7 +2614,7 @@ Device_get_speed_of_sound(Device *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Device_set_speed_of_sound(Device *self, PyObject* args, void* nothing)
|
||||
Device_set_speed_of_sound(Device *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float speed;
|
||||
|
||||
|
@ -2670,7 +2670,7 @@ Device_get_doppler_factor(Device *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Device_set_doppler_factor(Device *self, PyObject* args, void* nothing)
|
||||
Device_set_doppler_factor(Device *self, PyObject *args, void* nothing)
|
||||
{
|
||||
float factor;
|
||||
|
||||
|
@ -2724,7 +2724,7 @@ Device_get_distance_model(Device *self, void* nothing)
|
|||
}
|
||||
|
||||
static int
|
||||
Device_set_distance_model(Device *self, PyObject* args, void* nothing)
|
||||
Device_set_distance_model(Device *self, PyObject *args, void* nothing)
|
||||
{
|
||||
int model;
|
||||
|
||||
|
@ -2833,7 +2833,7 @@ Factory_empty()
|
|||
}
|
||||
|
||||
Factory*
|
||||
checkFactory(PyObject* factory)
|
||||
checkFactory(PyObject *factory)
|
||||
{
|
||||
if(!PyObject_TypeCheck(factory, &FactoryType))
|
||||
{
|
||||
|
@ -2862,7 +2862,7 @@ static struct PyModuleDef audmodule = {
|
|||
PyMODINIT_FUNC
|
||||
PyInit_aud(void)
|
||||
{
|
||||
PyObject* m;
|
||||
PyObject *m;
|
||||
|
||||
if(PyType_Ready(&FactoryType) < 0)
|
||||
return NULL;
|
||||
|
@ -2878,13 +2878,13 @@ PyInit_aud(void)
|
|||
return NULL;
|
||||
|
||||
Py_INCREF(&FactoryType);
|
||||
PyModule_AddObject(m, "Factory", (PyObject*)&FactoryType);
|
||||
PyModule_AddObject(m, "Factory", (PyObject *)&FactoryType);
|
||||
|
||||
Py_INCREF(&DeviceType);
|
||||
PyModule_AddObject(m, "Device", (PyObject*)&DeviceType);
|
||||
PyModule_AddObject(m, "Device", (PyObject *)&DeviceType);
|
||||
|
||||
Py_INCREF(&HandleType);
|
||||
PyModule_AddObject(m, "Handle", (PyObject*)&HandleType);
|
||||
PyModule_AddObject(m, "Handle", (PyObject *)&HandleType);
|
||||
|
||||
AUDError = PyErr_NewException("aud.error", NULL, NULL);
|
||||
Py_INCREF(AUDError);
|
||||
|
|
|
@ -46,7 +46,7 @@ typedef void AUD_Reference_AUD_IHandle;
|
|||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
PyObject* child_list;
|
||||
PyObject *child_list;
|
||||
AUD_Reference_AUD_IFactory* factory;
|
||||
} Factory;
|
||||
|
||||
|
@ -63,9 +63,9 @@ typedef struct {
|
|||
PyMODINIT_FUNC
|
||||
PyInit_aud(void);
|
||||
|
||||
extern PyObject* Device_empty();
|
||||
extern PyObject* Factory_empty();
|
||||
extern Factory* checkFactory(PyObject* factory);
|
||||
extern PyObject *Device_empty();
|
||||
extern PyObject *Factory_empty();
|
||||
extern Factory *checkFactory(PyObject *factory);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ extern "C" {
|
|||
/**
|
||||
* Initalizes the Python module.
|
||||
*/
|
||||
extern PyObject* AUD_initPython(void);
|
||||
extern PyObject *AUD_initPython(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -590,7 +590,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
|
|||
const Py_ssize_t numitems= PyList_GET_SIZE(gameLogic_keys_new);
|
||||
Py_ssize_t listIndex;
|
||||
for (listIndex=0; listIndex < numitems; listIndex++) {
|
||||
PyObject* item = PyList_GET_ITEM(gameLogic_keys_new, listIndex);
|
||||
PyObject *item = PyList_GET_ITEM(gameLogic_keys_new, listIndex);
|
||||
if (!PySequence_Contains(gameLogic_keys, item)) {
|
||||
PyDict_DelItem( PyModule_GetDict(gameLogic), item);
|
||||
}
|
||||
|
|
|
@ -347,7 +347,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
|
|||
/* Python functions */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetChannel(PyObject* value)
|
||||
PyObject *BL_ActionActuator::PyGetChannel(PyObject *value)
|
||||
{
|
||||
PyErr_SetString(PyExc_NotImplementedError, "BL_ActionActuator.getChannel() no longer works, please use BL_ArmatureObject.channels instead");
|
||||
return NULL;
|
||||
|
@ -555,7 +555,7 @@ PyAttributeDef BL_ActionActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* BL_ActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v);
|
||||
return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : "");
|
||||
|
@ -589,7 +589,7 @@ int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF
|
|||
|
||||
}
|
||||
|
||||
PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
PyErr_SetString(PyExc_NotImplementedError, "BL_ActionActuator.channelNames no longer works, please use BL_ArmatureObject.channels instead");
|
||||
return NULL;
|
||||
|
@ -620,7 +620,7 @@ PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA
|
|||
#endif
|
||||
}
|
||||
|
||||
PyObject* BL_ActionActuator::pyattr_get_use_continue(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ActionActuator::pyattr_get_use_continue(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v);
|
||||
return PyBool_FromLong(self->m_flag & ACT_FLAG_CONTINUE);
|
||||
|
@ -638,7 +638,7 @@ int BL_ActionActuator::pyattr_set_use_continue(void *self_v, const KX_PYATTRIBUT
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* BL_ActionActuator::pyattr_get_frame(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ActionActuator::pyattr_get_frame(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v);
|
||||
return PyFloat_FromDouble(((KX_GameObject*)self->m_gameobj)->GetActionFrame(self->m_layer));
|
||||
|
|
|
@ -227,7 +227,7 @@ PyAttributeDef BL_ArmatureActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* BL_ArmatureActuator::pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ArmatureActuator::pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ArmatureActuator* actuator = static_cast<BL_ArmatureActuator*>(self);
|
||||
KX_GameObject *target = (!strcmp(attrdef->m_name, "target")) ? actuator->m_gametarget : actuator->m_gamesubtarget;
|
||||
|
@ -257,7 +257,7 @@ int BL_ArmatureActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBU
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* BL_ArmatureActuator::pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ArmatureActuator::pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ArmatureActuator* actuator = static_cast<BL_ArmatureActuator*>(self);
|
||||
BL_ArmatureConstraint* constraint = actuator->m_constraint;
|
||||
|
|
|
@ -73,8 +73,8 @@ public:
|
|||
#ifdef WITH_PYTHON
|
||||
|
||||
/* These are used to get and set m_target */
|
||||
static PyObject* pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
|
|
@ -62,7 +62,7 @@ PyTypeObject BL_ArmatureChannel::Type = {
|
|||
py_base_new
|
||||
};
|
||||
|
||||
PyObject* BL_ArmatureChannel::py_repr(void)
|
||||
PyObject *BL_ArmatureChannel::py_repr(void)
|
||||
{
|
||||
return PyUnicode_FromString(m_posechannel->name);
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ PyAttributeDef BL_ArmatureChannel::AttributesPtr[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* BL_ArmatureChannel::py_attr_getattr(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ArmatureChannel::py_attr_getattr(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ArmatureChannel* self= static_cast<BL_ArmatureChannel*>(self_v);
|
||||
bPoseChannel* channel = self->m_posechannel;
|
||||
|
@ -200,7 +200,7 @@ int BL_ArmatureChannel::py_attr_setattr(void *self_v, const struct KX_PYATTRIBUT
|
|||
return PY_SET_ATTR_FAIL;
|
||||
}
|
||||
|
||||
PyObject* BL_ArmatureChannel::py_attr_get_joint_rotation(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ArmatureChannel::py_attr_get_joint_rotation(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
bPoseChannel* pchan = static_cast<bPoseChannel*>(self_v);
|
||||
// decompose the pose matrix in euler rotation
|
||||
|
@ -458,7 +458,7 @@ PyObject *BL_ArmatureBone::py_bone_get_children(void *self, const struct KX_PYAT
|
|||
for (child=(Bone*)bone->childbase.first; child; child=(Bone*)child->next)
|
||||
count++;
|
||||
|
||||
PyObject* childrenlist = PyList_New(count);
|
||||
PyObject *childrenlist = PyList_New(count);
|
||||
|
||||
for (count = 0, child=(Bone*)bone->childbase.first; child; child=(Bone*)child->next, ++count)
|
||||
PyList_SET_ITEM(childrenlist,count,NewProxyPlus_Ext(NULL,&Type,child,false));
|
||||
|
|
|
@ -62,11 +62,11 @@ public:
|
|||
|
||||
#ifdef WITH_PYTHON
|
||||
// Python access
|
||||
virtual PyObject* py_repr(void);
|
||||
virtual PyObject *py_repr(void);
|
||||
|
||||
static PyObject* py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
static PyObject* py_attr_get_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *py_attr_get_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int py_attr_set_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
#endif // WITH_PYTHON
|
||||
};
|
||||
|
|
|
@ -61,7 +61,7 @@ PyTypeObject BL_ArmatureConstraint::Type = {
|
|||
py_base_new
|
||||
};
|
||||
|
||||
PyObject* BL_ArmatureConstraint::py_repr(void)
|
||||
PyObject *BL_ArmatureConstraint::py_repr(void)
|
||||
{
|
||||
return PyUnicode_FromString(m_name);
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ PyAttributeDef BL_ArmatureConstraint::Attributes[] = {
|
|||
};
|
||||
|
||||
|
||||
PyObject* BL_ArmatureConstraint::py_attr_getattr(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ArmatureConstraint::py_attr_getattr(void *self_v, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ArmatureConstraint* self= static_cast<BL_ArmatureConstraint*>(self_v);
|
||||
bConstraint* constraint = self->m_constraint;
|
||||
|
|
|
@ -115,9 +115,9 @@ public:
|
|||
#ifdef WITH_PYTHON
|
||||
|
||||
// Python access
|
||||
virtual PyObject* py_repr(void);
|
||||
virtual PyObject *py_repr(void);
|
||||
|
||||
static PyObject* py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
#endif // WITH_PYTHON
|
||||
};
|
||||
|
|
|
@ -648,12 +648,12 @@ PyAttributeDef BL_ArmatureObject::Attributes[] = {
|
|||
{NULL} //Sentinel
|
||||
};
|
||||
|
||||
PyObject* BL_ArmatureObject::pyattr_get_constraints(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ArmatureObject::pyattr_get_constraints(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
return KX_PythonSeq_CreatePyObject((static_cast<BL_ArmatureObject*>(self_v))->m_proxy, KX_PYGENSEQ_OB_TYPE_CONSTRAINTS);
|
||||
}
|
||||
|
||||
PyObject* BL_ArmatureObject::pyattr_get_channels(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ArmatureObject::pyattr_get_channels(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ArmatureObject* self = static_cast<BL_ArmatureObject*>(self_v);
|
||||
self->LoadChannels(); // make sure we have the channels
|
||||
|
|
|
@ -116,8 +116,8 @@ public:
|
|||
#ifdef WITH_PYTHON
|
||||
|
||||
// PYTHON
|
||||
static PyObject* pyattr_get_constraints(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_channels(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_constraints(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_channels(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ArmatureObject, update);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
|
|
@ -526,7 +526,7 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v);
|
||||
return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : "");
|
||||
|
|
|
@ -1255,7 +1255,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
|
|||
RAS_IPolyMaterial *mat= (*polymit).second;
|
||||
Material *bmat= NULL;
|
||||
|
||||
/* Why do we need to check for RAS_BLENDERMAT if both are cast to a (PyObject*)? - Campbell */
|
||||
/* Why do we need to check for RAS_BLENDERMAT if both are cast to a (PyObject *)? - Campbell */
|
||||
if (mat->GetFlag() & RAS_BLENDERMAT) {
|
||||
KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(mat);
|
||||
bmat= bl_mat->GetBlenderMaterial();
|
||||
|
@ -1280,7 +1280,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
|
|||
RAS_IPolyMaterial *mat= (*polymit).second;
|
||||
Material *bmat= NULL;
|
||||
|
||||
/* Why do we need to check for RAS_BLENDERMAT if both are cast to a (PyObject*)? - Campbell */
|
||||
/* Why do we need to check for RAS_BLENDERMAT if both are cast to a (PyObject *)? - Campbell */
|
||||
if (mat->GetFlag() & RAS_BLENDERMAT) {
|
||||
KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(mat);
|
||||
bmat= bl_mat->GetBlenderMaterial();
|
||||
|
|
|
@ -205,7 +205,7 @@ CValue* CBoolValue::GetReplica()
|
|||
}
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
PyObject* CBoolValue::ConvertValueToPython()
|
||||
PyObject *CBoolValue::ConvertValueToPython()
|
||||
{
|
||||
return PyBool_FromLong(m_bool != 0);
|
||||
}
|
||||
|
|
|
@ -314,7 +314,7 @@ CValue* CFloatValue::GetReplica()
|
|||
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
PyObject* CFloatValue::ConvertValueToPython()
|
||||
PyObject *CFloatValue::ConvertValueToPython()
|
||||
{
|
||||
return PyFloat_FromDouble(m_float);
|
||||
}
|
||||
|
|
|
@ -326,7 +326,7 @@ void CIntValue::SetValue(CValue* newval)
|
|||
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
PyObject* CIntValue::ConvertValueToPython()
|
||||
PyObject *CIntValue::ConvertValueToPython()
|
||||
{
|
||||
if ((m_int > INT_MIN) && (m_int < INT_MAX))
|
||||
return PyLong_FromSsize_t(m_int);
|
||||
|
|
|
@ -278,7 +278,7 @@ bool CListValue::IsModified()
|
|||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
static Py_ssize_t listvalue_bufferlen(PyObject* self)
|
||||
static Py_ssize_t listvalue_bufferlen(PyObject *self)
|
||||
{
|
||||
CListValue *list= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||
if (list==NULL)
|
||||
|
@ -287,7 +287,7 @@ static Py_ssize_t listvalue_bufferlen(PyObject* self)
|
|||
return (Py_ssize_t)list->GetCount();
|
||||
}
|
||||
|
||||
static PyObject* listvalue_buffer_item(PyObject* self, Py_ssize_t index)
|
||||
static PyObject *listvalue_buffer_item(PyObject *self, Py_ssize_t index)
|
||||
{
|
||||
CListValue *list= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||
CValue *cval;
|
||||
|
@ -309,14 +309,14 @@ static PyObject* listvalue_buffer_item(PyObject* self, Py_ssize_t index)
|
|||
|
||||
cval= list->GetValue(index);
|
||||
|
||||
PyObject* pyobj = cval->ConvertValueToPython();
|
||||
PyObject *pyobj = cval->ConvertValueToPython();
|
||||
if (pyobj)
|
||||
return pyobj;
|
||||
else
|
||||
return cval->GetProxy();
|
||||
}
|
||||
|
||||
static PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex)
|
||||
static PyObject *listvalue_mapping_subscript(PyObject *self, PyObject *pyindex)
|
||||
{
|
||||
CListValue *list= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||
if (list==NULL) {
|
||||
|
@ -328,7 +328,7 @@ static PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex)
|
|||
{
|
||||
CValue *item = ((CListValue*) list)->FindValue(_PyUnicode_AsString(pyindex));
|
||||
if (item) {
|
||||
PyObject* pyobj = item->ConvertValueToPython();
|
||||
PyObject *pyobj = item->ConvertValueToPython();
|
||||
if (pyobj)
|
||||
return pyobj;
|
||||
else
|
||||
|
@ -348,7 +348,7 @@ static PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex)
|
|||
|
||||
|
||||
/* just slice it into a python list... */
|
||||
static PyObject* listvalue_buffer_slice(PyObject* self,Py_ssize_t ilow, Py_ssize_t ihigh)
|
||||
static PyObject *listvalue_buffer_slice(PyObject *self,Py_ssize_t ilow, Py_ssize_t ihigh)
|
||||
{
|
||||
CListValue *list= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||
if (list==NULL) {
|
||||
|
@ -374,7 +374,7 @@ static PyObject* listvalue_buffer_slice(PyObject* self,Py_ssize_t ilow, Py_ssize
|
|||
|
||||
for (i = ilow, j = 0; i < ihigh; i++, j++)
|
||||
{
|
||||
PyObject* pyobj = list->GetValue(i)->ConvertValueToPython();
|
||||
PyObject *pyobj = list->GetValue(i)->ConvertValueToPython();
|
||||
if (!pyobj)
|
||||
pyobj = list->GetValue(i)->GetProxy();
|
||||
PyList_SET_ITEM(newlist, i, pyobj);
|
||||
|
@ -384,7 +384,7 @@ static PyObject* listvalue_buffer_slice(PyObject* self,Py_ssize_t ilow, Py_ssize
|
|||
|
||||
|
||||
/* clist + list, return a list that python owns */
|
||||
static PyObject *listvalue_buffer_concat(PyObject * self, PyObject * other)
|
||||
static PyObject *listvalue_buffer_concat(PyObject *self, PyObject *other)
|
||||
{
|
||||
CListValue *listval= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||
Py_ssize_t i, numitems, numitems_orig;
|
||||
|
@ -560,7 +560,7 @@ PyAttributeDef CListValue::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* CListValue::Pyappend(PyObject* value)
|
||||
PyObject *CListValue::Pyappend(PyObject *value)
|
||||
{
|
||||
CValue* objval = ConvertPythonToValue(value, "CList.append(i): CValueList, ");
|
||||
|
||||
|
@ -577,15 +577,15 @@ PyObject* CListValue::Pyappend(PyObject* value)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* CListValue::Pyreverse()
|
||||
PyObject *CListValue::Pyreverse()
|
||||
{
|
||||
std::reverse(m_pValueArray.begin(),m_pValueArray.end());
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* CListValue::Pyindex(PyObject *value)
|
||||
PyObject *CListValue::Pyindex(PyObject *value)
|
||||
{
|
||||
PyObject* result = NULL;
|
||||
PyObject *result = NULL;
|
||||
|
||||
CValue* checkobj = ConvertPythonToValue(value, "val = cList[i]: CValueList, ");
|
||||
if (checkobj==NULL)
|
||||
|
@ -612,7 +612,7 @@ PyObject* CListValue::Pyindex(PyObject *value)
|
|||
|
||||
|
||||
|
||||
PyObject* CListValue::Pycount(PyObject* value)
|
||||
PyObject *CListValue::Pycount(PyObject *value)
|
||||
{
|
||||
int numfound = 0;
|
||||
|
||||
|
@ -638,17 +638,17 @@ PyObject* CListValue::Pycount(PyObject* value)
|
|||
}
|
||||
|
||||
/* Matches python dict.get(key, [default]) */
|
||||
PyObject* CListValue::Pyget(PyObject *args)
|
||||
PyObject *CListValue::Pyget(PyObject *args)
|
||||
{
|
||||
char *key;
|
||||
PyObject* def = Py_None;
|
||||
PyObject *def = Py_None;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s|O:get", &key, &def))
|
||||
return NULL;
|
||||
|
||||
CValue *item = FindValue((const char *)key);
|
||||
if (item) {
|
||||
PyObject* pyobj = item->ConvertValueToPython();
|
||||
PyObject *pyobj = item->ConvertValueToPython();
|
||||
if (pyobj)
|
||||
return pyobj;
|
||||
else
|
||||
|
@ -659,7 +659,7 @@ PyObject* CListValue::Pyget(PyObject *args)
|
|||
}
|
||||
|
||||
|
||||
PyObject* CListValue::Pyfrom_id(PyObject* value)
|
||||
PyObject *CListValue::Pyfrom_id(PyObject *value)
|
||||
{
|
||||
uintptr_t id= (uintptr_t)PyLong_AsVoidPtr(value);
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
bool CheckEqual(CValue* first,CValue* second);
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
virtual PyObject* py_repr(void) {
|
||||
virtual PyObject *py_repr(void) {
|
||||
PyObject *py_proxy= this->GetProxy();
|
||||
PyObject *py_list= PySequence_List(py_proxy);
|
||||
PyObject *py_string= PyObject_Repr(py_list);
|
||||
|
|
|
@ -145,7 +145,7 @@ PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the ent
|
|||
}
|
||||
|
||||
|
||||
PyObject * PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
PyObject *PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
PyTypeObject *base_type;
|
||||
PyObjectPlus_Proxy *base = NULL;
|
||||
|
@ -270,7 +270,7 @@ PyAttributeDef PyObjectPlus::Attributes[] = {
|
|||
|
||||
|
||||
|
||||
PyObject* PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
return PyBool_FromLong(self_v ? 0:1);
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
|
|||
ptr += attrdef->m_offset;
|
||||
if (attrdef->m_length > 1)
|
||||
{
|
||||
PyObject* resultlist = PyList_New(attrdef->m_length);
|
||||
PyObject *resultlist = PyList_New(attrdef->m_length);
|
||||
for (unsigned int i=0; i<attrdef->m_length; i++)
|
||||
{
|
||||
switch (attrdef->m_type) {
|
||||
|
@ -420,7 +420,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
|
|||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject(val, attrdef->m_imax, Py_NEW, NULL);
|
||||
#else
|
||||
PyObject* resultlist = PyList_New(attrdef->m_imax);
|
||||
PyObject *resultlist = PyList_New(attrdef->m_imax);
|
||||
for (unsigned int i=0; i<attrdef->m_imax; i++)
|
||||
{
|
||||
PyList_SET_ITEM(resultlist,i,PyFloat_FromDouble(val[i]));
|
||||
|
@ -437,10 +437,10 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
|
|||
#ifdef USE_MATHUTILS
|
||||
return Matrix_CreatePyObject(val, attrdef->m_imin, attrdef->m_imax, Py_WRAP, NULL);
|
||||
#else
|
||||
PyObject* collist = PyList_New(attrdef->m_imin);
|
||||
PyObject *collist = PyList_New(attrdef->m_imin);
|
||||
for (unsigned int i=0; i<attrdef->m_imin; i++)
|
||||
{
|
||||
PyObject* col = PyList_New(attrdef->m_imax);
|
||||
PyObject *col = PyList_New(attrdef->m_imax);
|
||||
for (unsigned int j=0; j<attrdef->m_imax; j++)
|
||||
{
|
||||
PyList_SET_ITEM(col,j,PyFloat_FromDouble(val[j]));
|
||||
|
@ -460,7 +460,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
|
|||
val->getValue(fval);
|
||||
return Vector_CreatePyObject(fval, 3, Py_NEW, NULL);
|
||||
#else
|
||||
PyObject* resultlist = PyList_New(3);
|
||||
PyObject *resultlist = PyList_New(3);
|
||||
for (unsigned int i=0; i<3; i++)
|
||||
{
|
||||
PyList_SET_ITEM(resultlist,i,PyFloat_FromDouble((*val)[i]));
|
||||
|
@ -1139,7 +1139,7 @@ PyObject *PyObjectPlus::NewProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, v
|
|||
if (!self)
|
||||
{
|
||||
// in case of proxy without reference to game object
|
||||
PyObject* proxy = reinterpret_cast<PyObject *>PyObject_NEW( PyObjectPlus_Proxy, tp);
|
||||
PyObject *proxy = reinterpret_cast<PyObject *>PyObject_NEW( PyObjectPlus_Proxy, tp);
|
||||
BGE_PROXY_PYREF(proxy) = false;
|
||||
BGE_PROXY_PYOWNS(proxy) = py_owns;
|
||||
BGE_PROXY_REF(proxy) = NULL;
|
||||
|
|
|
@ -190,9 +190,9 @@ public: \
|
|||
* macro is one that also requires a documentation string
|
||||
*/
|
||||
#define KX_PYMETHOD(class_name, method_name) \
|
||||
PyObject* Py##method_name(PyObject* args, PyObject* kwds); \
|
||||
static PyObject* \
|
||||
sPy##method_name(PyObject* self, PyObject* args, PyObject* kwds) { \
|
||||
PyObject *Py##method_name(PyObject *args, PyObject *kwds); \
|
||||
static PyObject * \
|
||||
sPy##method_name(PyObject *self, PyObject *args, PyObject *kwds) { \
|
||||
if(BGE_PROXY_REF(self)==NULL) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, \
|
||||
#class_name "." #method_name "() - " \
|
||||
|
@ -203,9 +203,9 @@ public: \
|
|||
} \
|
||||
|
||||
#define KX_PYMETHOD_VARARGS(class_name, method_name) \
|
||||
PyObject* Py##method_name(PyObject* args); \
|
||||
PyObject *Py##method_name(PyObject *args); \
|
||||
static PyObject* \
|
||||
sPy##method_name(PyObject* self, PyObject* args) { \
|
||||
sPy##method_name(PyObject *self, PyObject *args) { \
|
||||
if(BGE_PROXY_REF(self)==NULL) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, \
|
||||
#class_name "." #method_name "() - " \
|
||||
|
@ -215,9 +215,9 @@ public: \
|
|||
} \
|
||||
|
||||
#define KX_PYMETHOD_NOARGS(class_name, method_name) \
|
||||
PyObject* Py##method_name(); \
|
||||
PyObject *Py##method_name(); \
|
||||
static PyObject* \
|
||||
sPy##method_name(PyObject* self) { \
|
||||
sPy##method_name(PyObject *self) { \
|
||||
if(BGE_PROXY_REF(self)==NULL) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, \
|
||||
#class_name "." #method_name "() - " \
|
||||
|
@ -227,9 +227,9 @@ public: \
|
|||
} \
|
||||
|
||||
#define KX_PYMETHOD_O(class_name, method_name) \
|
||||
PyObject* Py##method_name(PyObject* value); \
|
||||
PyObject *Py##method_name(PyObject *value); \
|
||||
static PyObject* \
|
||||
sPy##method_name(PyObject* self, PyObject* value) { \
|
||||
sPy##method_name(PyObject *self, PyObject *value) { \
|
||||
if(BGE_PROXY_REF(self)==NULL) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, \
|
||||
#class_name "." #method_name "(value) - " \
|
||||
|
@ -239,9 +239,9 @@ public: \
|
|||
} \
|
||||
|
||||
#define KX_PYMETHOD_DOC(class_name, method_name) \
|
||||
PyObject* Py##method_name(PyObject* args, PyObject* kwds); \
|
||||
PyObject *Py##method_name(PyObject *args, PyObject *kwds); \
|
||||
static PyObject* \
|
||||
sPy##method_name(PyObject* self, PyObject* args, PyObject* kwds) { \
|
||||
sPy##method_name(PyObject *self, PyObject *args, PyObject *kwds) { \
|
||||
if(BGE_PROXY_REF(self)==NULL) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, \
|
||||
#class_name "." #method_name "(...) - " \
|
||||
|
@ -252,9 +252,9 @@ public: \
|
|||
static const char method_name##_doc[]; \
|
||||
|
||||
#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \
|
||||
PyObject* Py##method_name(PyObject* args); \
|
||||
PyObject *Py##method_name(PyObject *args); \
|
||||
static PyObject* \
|
||||
sPy##method_name(PyObject* self, PyObject* args) { \
|
||||
sPy##method_name(PyObject *self, PyObject *args) { \
|
||||
if(BGE_PROXY_REF(self)==NULL) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, \
|
||||
#class_name "." #method_name "(...) - " \
|
||||
|
@ -266,9 +266,9 @@ public: \
|
|||
static const char method_name##_doc[]; \
|
||||
|
||||
#define KX_PYMETHOD_DOC_O(class_name, method_name) \
|
||||
PyObject* Py##method_name(PyObject* value); \
|
||||
static PyObject* \
|
||||
sPy##method_name(PyObject* self, PyObject* value) { \
|
||||
PyObject *Py##method_name(PyObject *value); \
|
||||
static PyObject * \
|
||||
sPy##method_name(PyObject *self, PyObject *value) { \
|
||||
if(BGE_PROXY_REF(self)==NULL) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, \
|
||||
#class_name "." #method_name "(value) - " \
|
||||
|
@ -280,9 +280,9 @@ public: \
|
|||
static const char method_name##_doc[]; \
|
||||
|
||||
#define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \
|
||||
PyObject* Py##method_name(); \
|
||||
static PyObject* \
|
||||
sPy##method_name(PyObject* self) { \
|
||||
PyObject *Py##method_name(); \
|
||||
static PyObject * \
|
||||
sPy##method_name(PyObject *self) { \
|
||||
if(BGE_PROXY_REF(self)==NULL) { \
|
||||
PyErr_SetString(PyExc_RuntimeError, \
|
||||
#class_name "." #method_name "() - " \
|
||||
|
@ -315,19 +315,19 @@ public: \
|
|||
*/
|
||||
#define KX_PYMETHODDEF_DOC(class_name, method_name, doc_string) \
|
||||
const char class_name::method_name##_doc[] = doc_string; \
|
||||
PyObject* class_name::Py##method_name(PyObject* args, PyObject* kwds)
|
||||
PyObject *class_name::Py##method_name(PyObject *args, PyObject *kwds)
|
||||
|
||||
#define KX_PYMETHODDEF_DOC_VARARGS(class_name, method_name, doc_string) \
|
||||
const char class_name::method_name##_doc[] = doc_string; \
|
||||
PyObject* class_name::Py##method_name(PyObject* args)
|
||||
PyObject *class_name::Py##method_name(PyObject *args)
|
||||
|
||||
#define KX_PYMETHODDEF_DOC_O(class_name, method_name, doc_string) \
|
||||
const char class_name::method_name##_doc[] = doc_string; \
|
||||
PyObject* class_name::Py##method_name(PyObject* value)
|
||||
PyObject *class_name::Py##method_name(PyObject *value)
|
||||
|
||||
#define KX_PYMETHODDEF_DOC_NOARGS(class_name, method_name, doc_string) \
|
||||
const char class_name::method_name##_doc[] = doc_string; \
|
||||
PyObject* class_name::Py##method_name()
|
||||
PyObject *class_name::Py##method_name()
|
||||
|
||||
/**
|
||||
* Attribute management
|
||||
|
@ -354,7 +354,7 @@ enum KX_PYATTRIBUTE_ACCESS {
|
|||
struct KX_PYATTRIBUTE_DEF;
|
||||
typedef int (*KX_PYATTRIBUTE_CHECK_FUNCTION)(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
typedef int (*KX_PYATTRIBUTE_SET_FUNCTION)(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
typedef PyObject* (*KX_PYATTRIBUTE_GET_FUNCTION)(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
typedef PyObject *(*KX_PYATTRIBUTE_GET_FUNCTION)(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
typedef struct KX_PYATTRIBUTE_DEF {
|
||||
const char *m_name; // name of the python attribute
|
||||
|
|
|
@ -530,13 +530,13 @@ PyAttributeDef CValue::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef)
|
||||
PyObject *CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
CValue * self = static_cast<CValue *> (self_v);
|
||||
return PyUnicode_From_STR_String(self->GetName());
|
||||
}
|
||||
|
||||
CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
|
||||
CValue* CValue::ConvertPythonToValue(PyObject *pyobj, const char *error_prefix)
|
||||
{
|
||||
|
||||
CValue* vallie = NULL;
|
||||
|
@ -551,7 +551,7 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
|
|||
Py_ssize_t numitems = PyList_GET_SIZE(pyobj);
|
||||
for (i=0;i<numitems;i++)
|
||||
{
|
||||
PyObject* listitem = PyList_GetItem(pyobj,i); /* borrowed ref */
|
||||
PyObject *listitem = PyList_GetItem(pyobj,i); /* borrowed ref */
|
||||
CValue* listitemval = ConvertPythonToValue(listitem, error_prefix);
|
||||
if (listitemval)
|
||||
{
|
||||
|
@ -597,7 +597,7 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
|
|||
|
||||
}
|
||||
|
||||
PyObject* CValue::ConvertKeysToPython(void)
|
||||
PyObject *CValue::ConvertKeysToPython(void)
|
||||
{
|
||||
if (m_pNamedPropertyArray)
|
||||
{
|
||||
|
|
|
@ -218,21 +218,21 @@ public:
|
|||
CValue();
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
//static PyObject* PyMake(PyObject*,PyObject*);
|
||||
//static PyObject *PyMake(PyObject *, PyObject *);
|
||||
virtual PyObject *py_repr(void)
|
||||
{
|
||||
return PyUnicode_From_STR_String(GetText());
|
||||
}
|
||||
|
||||
virtual PyObject* ConvertValueToPython() {
|
||||
virtual PyObject *ConvertValueToPython() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
virtual CValue* ConvertPythonToValue(PyObject* pyobj, const char *error_prefix);
|
||||
virtual CValue *ConvertPythonToValue(PyObject *pyobj, const char *error_prefix);
|
||||
|
||||
static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
|
||||
static PyObject *pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
|
||||
|
||||
virtual PyObject* ConvertKeysToPython( void );
|
||||
virtual PyObject *ConvertKeysToPython( void );
|
||||
#endif // WITH_PYTHON
|
||||
|
||||
|
||||
|
@ -256,7 +256,7 @@ public:
|
|||
}
|
||||
|
||||
// Add a reference to this value
|
||||
CValue* AddRef()
|
||||
CValue *AddRef()
|
||||
{
|
||||
// Increase global reference count, used to see at the end of the program
|
||||
// if all CValue-derived classes have been dereferenced to 0
|
||||
|
|
|
@ -238,18 +238,18 @@ PyAttributeDef SCA_IController::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_IController* self= static_cast<SCA_IController*>(self_v);
|
||||
return PyLong_FromSsize_t(self->m_statemask);
|
||||
}
|
||||
|
||||
PyObject* SCA_IController::pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_IController::pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
return KX_PythonSeq_CreatePyObject((static_cast<SCA_IController*>(self_v))->m_proxy, KX_PYGENSEQ_CONT_TYPE_SENSORS);
|
||||
}
|
||||
|
||||
PyObject* SCA_IController::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_IController::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
return KX_PythonSeq_CreatePyObject((static_cast<SCA_IController*>(self_v))->m_proxy, KX_PYGENSEQ_CONT_TYPE_ACTUATORS);
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef)
|
|||
}
|
||||
|
||||
/*Attribute functions */
|
||||
PyObject* SCA_ILogicBrick::pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_ILogicBrick::pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_ILogicBrick* self= static_cast<SCA_ILogicBrick*>(self_v);
|
||||
CValue* parent = self->GetParent();
|
||||
|
@ -254,7 +254,7 @@ bool SCA_ILogicBrick::PyArgToBool(int boolArg)
|
|||
}
|
||||
}
|
||||
|
||||
PyObject* SCA_ILogicBrick::BoolToPyArg(bool boolarg)
|
||||
PyObject *SCA_ILogicBrick::BoolToPyArg(bool boolarg)
|
||||
{
|
||||
return PyLong_FromSsize_t(boolarg? KX_TRUE: KX_FALSE);
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ protected:
|
|||
bool PyArgToBool(int boolArg);
|
||||
|
||||
/** Convert a a c++ value to KX_TRUE, KX_FALSE in Python. */
|
||||
PyObject* BoolToPyArg(bool);
|
||||
PyObject *BoolToPyArg(bool);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class SCA_IController;
|
|||
class SCA_IActuator;
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
template<class T> T PyVecTo(PyObject*);
|
||||
template<class T> T PyVecTo(PyObject *);
|
||||
#endif
|
||||
|
||||
typedef std::vector<SCA_ISensor *> SCA_SensorList;
|
||||
|
@ -213,7 +213,7 @@ public:
|
|||
*/
|
||||
unsigned int GetState(void) { return m_state; }
|
||||
|
||||
// const class MT_Point3& ConvertPythonPylist(PyObject* pylist);
|
||||
// const class MT_Point3& ConvertPythonPylist(PyObject *pylist);
|
||||
|
||||
virtual int GetGameObjectType() {return -1;}
|
||||
|
||||
|
|
|
@ -380,7 +380,7 @@ PyAttributeDef SCA_ISensor::Attributes[] = {
|
|||
};
|
||||
|
||||
|
||||
PyObject* SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||
int retval = 0;
|
||||
|
@ -389,13 +389,13 @@ PyObject* SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_D
|
|||
return PyLong_FromSsize_t(retval);
|
||||
}
|
||||
|
||||
PyObject* SCA_ISensor::pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_ISensor::pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||
return PyLong_FromSsize_t(self->GetState());
|
||||
}
|
||||
|
||||
PyObject* SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||
int status = 0;
|
||||
|
@ -417,13 +417,13 @@ PyObject* SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF
|
|||
return PyLong_FromSsize_t(status);
|
||||
}
|
||||
|
||||
PyObject* SCA_ISensor::pyattr_get_posTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_ISensor::pyattr_get_posTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||
return PyLong_FromLong(self->GetPosTicks());
|
||||
}
|
||||
|
||||
PyObject* SCA_ISensor::pyattr_get_negTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_ISensor::pyattr_get_negTicks(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||
return PyLong_FromLong(self->GetNegTicks());
|
||||
|
|
|
@ -308,7 +308,7 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = {
|
|||
const char SCA_JoystickSensor::GetButtonActiveList_doc[] =
|
||||
"getButtonActiveList\n"
|
||||
"\tReturns a list containing the indices of the button currently pressed.\n";
|
||||
PyObject* SCA_JoystickSensor::PyGetButtonActiveList( )
|
||||
PyObject *SCA_JoystickSensor::PyGetButtonActiveList( )
|
||||
{
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
|
||||
PyObject *ls = PyList_New(0);
|
||||
|
@ -331,7 +331,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonActiveList( )
|
|||
const char SCA_JoystickSensor::GetButtonStatus_doc[] =
|
||||
"getButtonStatus(buttonIndex)\n"
|
||||
"\tReturns a bool of the current pressed state of the specified button.\n";
|
||||
PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args )
|
||||
PyObject *SCA_JoystickSensor::PyGetButtonStatus( PyObject *args )
|
||||
{
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
|
||||
int index;
|
||||
|
@ -345,7 +345,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args )
|
|||
return PyBool_FromLong(0);
|
||||
}
|
||||
|
||||
PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||
|
@ -360,7 +360,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYAT
|
|||
return list;
|
||||
}
|
||||
|
||||
PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||
|
@ -373,7 +373,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT
|
|||
return PyLong_FromSsize_t(joy->GetAxisPosition(self->m_axis-1));
|
||||
}
|
||||
|
||||
PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||
|
@ -388,7 +388,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATT
|
|||
return list;
|
||||
}
|
||||
|
||||
PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||
|
@ -396,28 +396,28 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATT
|
|||
return PyLong_FromSsize_t(joy->GetHat(self->m_hat-1));
|
||||
}
|
||||
|
||||
PyObject* SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||
return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 );
|
||||
}
|
||||
|
||||
PyObject* SCA_JoystickSensor::pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_JoystickSensor::pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||
return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 );
|
||||
}
|
||||
|
||||
PyObject* SCA_JoystickSensor::pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_JoystickSensor::pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||
return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 );
|
||||
}
|
||||
|
||||
PyObject* SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||
|
|
|
@ -391,7 +391,8 @@ bool SCA_KeyboardSensor::IsShifted(void)
|
|||
== SCA_InputEvent::KX_JUSTACTIVATED)
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -494,20 +495,20 @@ PyAttributeDef SCA_KeyboardSensor::Attributes[] = {
|
|||
};
|
||||
|
||||
|
||||
PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_KeyboardSensor* self= static_cast<SCA_KeyboardSensor*>(self_v);
|
||||
|
||||
SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)self->m_eventmgr)->GetInputDevice();
|
||||
|
||||
PyObject* resultlist = PyList_New(0);
|
||||
PyObject *resultlist = PyList_New(0);
|
||||
|
||||
for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++)
|
||||
{
|
||||
const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i);
|
||||
if (inevent.m_status != SCA_InputEvent::KX_NO_INPUTSTATUS)
|
||||
{
|
||||
PyObject* keypair = PyList_New(2);
|
||||
PyObject *keypair = PyList_New(2);
|
||||
PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i));
|
||||
PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status));
|
||||
PyList_Append(resultlist,keypair);
|
||||
|
|
|
@ -179,7 +179,7 @@ int SCA_PythonController::IsTriggered(class SCA_ISensor* sensor)
|
|||
#ifdef WITH_PYTHON
|
||||
|
||||
/* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */
|
||||
PyObject* SCA_PythonController::sPyGetCurrentController(PyObject *self)
|
||||
PyObject *SCA_PythonController::sPyGetCurrentController(PyObject *self)
|
||||
{
|
||||
if (m_sCurrentController==NULL)
|
||||
{
|
||||
|
@ -374,7 +374,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
|
|||
m_sCurrentLogicManager = logicmgr;
|
||||
|
||||
PyObject *excdict= NULL;
|
||||
PyObject* resultobj= NULL;
|
||||
PyObject *resultobj= NULL;
|
||||
|
||||
switch(m_mode) {
|
||||
case SCA_PYEXEC_SCRIPT:
|
||||
|
@ -453,7 +453,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
|
|||
m_sCurrentController = NULL;
|
||||
}
|
||||
|
||||
PyObject* SCA_PythonController::PyActivate(PyObject *value)
|
||||
PyObject *SCA_PythonController::PyActivate(PyObject *value)
|
||||
{
|
||||
if (m_sCurrentController != this) {
|
||||
PyErr_SetString(PyExc_SystemError, "Cannot add an actuator from a non-active controller");
|
||||
|
@ -468,7 +468,7 @@ PyObject* SCA_PythonController::PyActivate(PyObject *value)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* SCA_PythonController::PyDeActivate(PyObject *value)
|
||||
PyObject *SCA_PythonController::PyDeActivate(PyObject *value)
|
||||
{
|
||||
if (m_sCurrentController != this) {
|
||||
PyErr_SetString(PyExc_SystemError, "Cannot add an actuator from a non-active controller");
|
||||
|
@ -483,7 +483,7 @@ PyObject* SCA_PythonController::PyDeActivate(PyObject *value)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
//SCA_PythonController* self= static_cast<SCA_PythonController*>(static_cast<SCA_IController*>(static_cast<SCA_ILogicBrick*>(static_cast<CValue*>(static_cast<PyObjectPlus*>(self_v)))));
|
||||
// static_cast<void *>(dynamic_cast<Derived *>(obj)) - static_cast<void *>(obj)
|
||||
|
|
|
@ -96,11 +96,11 @@ class SCA_PythonController : public SCA_IController
|
|||
void ErrorPrint(const char *error_msg);
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
static const char* sPyGetCurrentController__doc__;
|
||||
static PyObject* sPyGetCurrentController(PyObject* self);
|
||||
static const char* sPyAddActiveActuator__doc__;
|
||||
static PyObject* sPyAddActiveActuator(PyObject* self,
|
||||
PyObject* args);
|
||||
static const char *sPyGetCurrentController__doc__;
|
||||
static PyObject *sPyGetCurrentController(PyObject *self);
|
||||
static const char *sPyAddActiveActuator__doc__;
|
||||
static PyObject *sPyAddActiveActuator(PyObject *self,
|
||||
PyObject *args);
|
||||
static SCA_IActuator* LinkedActuatorFromPy(PyObject *value);
|
||||
|
||||
|
||||
|
|
|
@ -58,13 +58,13 @@ SCA_PythonKeyboard::~SCA_PythonKeyboard()
|
|||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* clipboard */
|
||||
static PyObject* gPyGetClipboard(PyObject* args, PyObject* kwds)
|
||||
static PyObject *gPyGetClipboard(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
char *buf = (char *)GHOST_getClipboard(0);
|
||||
return PyUnicode_FromString(buf?buf:"");
|
||||
}
|
||||
|
||||
static PyObject* gPySetClipboard(PyObject* args, PyObject* value)
|
||||
static PyObject *gPySetClipboard(PyObject *args, PyObject *value)
|
||||
{
|
||||
char* buf;
|
||||
if (!PyArg_ParseTuple(value,"s:setClipboard",&buf))
|
||||
|
@ -109,7 +109,7 @@ PyAttributeDef SCA_PythonKeyboard::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* SCA_PythonKeyboard::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_PythonKeyboard::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_PythonKeyboard* self = static_cast<SCA_PythonKeyboard*>(self_v);
|
||||
|
||||
|
@ -123,7 +123,7 @@ PyObject* SCA_PythonKeyboard::pyattr_get_events(void *self_v, const KX_PYATTRIBU
|
|||
return self->m_event_dict;
|
||||
}
|
||||
|
||||
PyObject* SCA_PythonKeyboard::pyattr_get_active_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_PythonKeyboard::pyattr_get_active_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_PythonKeyboard* self = static_cast<SCA_PythonKeyboard*>(self_v);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class SCA_PythonKeyboard : public PyObjectPlus
|
|||
private:
|
||||
class SCA_IInputDevice *m_keyboard;
|
||||
#ifdef WITH_PYTHON
|
||||
PyObject* m_event_dict;
|
||||
PyObject *m_event_dict;
|
||||
#endif
|
||||
public:
|
||||
SCA_PythonKeyboard(class SCA_IInputDevice* keyboard);
|
||||
|
|
|
@ -92,7 +92,7 @@ PyAttributeDef SCA_PythonMouse::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* SCA_PythonMouse::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_PythonMouse::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
|
||||
|
||||
|
@ -106,7 +106,7 @@ PyObject* SCA_PythonMouse::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_
|
|||
return self->m_event_dict;
|
||||
}
|
||||
|
||||
PyObject* SCA_PythonMouse::pyattr_get_active_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_PythonMouse::pyattr_get_active_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
|
||||
|
||||
|
@ -123,7 +123,7 @@ PyObject* SCA_PythonMouse::pyattr_get_active_events(void *self_v, const KX_PYATT
|
|||
return self->m_event_dict;
|
||||
}
|
||||
|
||||
PyObject* SCA_PythonMouse::pyattr_get_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_PythonMouse::pyattr_get_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
|
||||
const SCA_InputEvent & xevent = self->m_mouse->GetEventValue(SCA_IInputDevice::KX_MOUSEX);
|
||||
|
@ -134,7 +134,7 @@ PyObject* SCA_PythonMouse::pyattr_get_position(void *self_v, const KX_PYATTRIBUT
|
|||
x_coord = self->m_canvas->GetMouseNormalizedX(xevent.m_eventval);
|
||||
y_coord = self->m_canvas->GetMouseNormalizedY(yevent.m_eventval);
|
||||
|
||||
PyObject* ret = PyTuple_New(2);
|
||||
PyObject *ret = PyTuple_New(2);
|
||||
|
||||
PyTuple_SET_ITEM(ret, 0, PyFloat_FromDouble(x_coord));
|
||||
PyTuple_SET_ITEM(ret, 1, PyFloat_FromDouble(y_coord));
|
||||
|
@ -158,7 +158,7 @@ int SCA_PythonMouse::pyattr_set_position(void *self_v, const KX_PYATTRIBUTE_DEF
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* SCA_PythonMouse::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_PythonMouse::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ private:
|
|||
class SCA_IInputDevice *m_mouse;
|
||||
class RAS_ICanvas *m_canvas;
|
||||
#ifdef WITH_PYTHON
|
||||
PyObject* m_event_dict;
|
||||
PyObject *m_event_dict;
|
||||
#endif
|
||||
public:
|
||||
SCA_PythonMouse(class SCA_IInputDevice* mouse, class RAS_ICanvas* canvas);
|
||||
|
@ -47,12 +47,12 @@ public:
|
|||
#ifdef WITH_PYTHON
|
||||
KX_PYMETHOD_DOC(SCA_PythonMouse, show);
|
||||
|
||||
static PyObject* pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_active_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_position(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_position(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
|
||||
static PyObject* pyattr_get_visible(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_visible(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
|
||||
static PyObject *pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_active_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_position(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_position(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
static PyObject *pyattr_get_visible(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_visible(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -363,7 +363,7 @@ PyAttributeDef SCA_RandomActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* SCA_RandomActuator::pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_RandomActuator::pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_RandomActuator* act = static_cast<SCA_RandomActuator*>(self);
|
||||
return PyLong_FromSsize_t(act->m_base->GetSeed());
|
||||
|
|
|
@ -98,7 +98,7 @@ class SCA_RandomActuator : public SCA_IActuator
|
|||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
static PyObject* pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolConst);
|
||||
|
|
|
@ -165,7 +165,7 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = {
|
|||
{NULL} //Sentinel
|
||||
};
|
||||
|
||||
PyObject* SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_RandomSensor* self= static_cast<SCA_RandomSensor*>(self_v);
|
||||
return PyLong_FromSsize_t(self->m_basegenerator->GetSeed());
|
||||
|
|
|
@ -67,7 +67,8 @@ void GPC_MouseDevice::NextFrame()
|
|||
for (int mouseevent= KX_BEGINMOUSE; mouseevent< KX_ENDMOUSEBUTTONS; mouseevent++) {
|
||||
SCA_InputEvent& oldevent = m_eventStatusTables[previousTable][mouseevent];
|
||||
if (oldevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
|
||||
oldevent.m_status == SCA_InputEvent::KX_ACTIVE) {
|
||||
oldevent.m_status == SCA_InputEvent::KX_ACTIVE)
|
||||
{
|
||||
m_eventStatusTables[m_currentTable][mouseevent] = oldevent;
|
||||
m_eventStatusTables[m_currentTable][mouseevent].m_status = SCA_InputEvent::KX_ACTIVE;
|
||||
}
|
||||
|
@ -76,7 +77,8 @@ void GPC_MouseDevice::NextFrame()
|
|||
SCA_InputEvent& oldevent = m_eventStatusTables[previousTable][mousemove];
|
||||
m_eventStatusTables[m_currentTable][mousemove] = oldevent;
|
||||
if (oldevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
|
||||
oldevent.m_status == SCA_InputEvent::KX_ACTIVE) {
|
||||
oldevent.m_status == SCA_InputEvent::KX_ACTIVE)
|
||||
{
|
||||
m_eventStatusTables[m_currentTable][mousemove].m_status = SCA_InputEvent::KX_JUSTRELEASED;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -222,7 +222,7 @@ public:
|
|||
|
||||
// Python interface
|
||||
#ifdef WITH_PYTHON
|
||||
virtual PyObject* py_repr(void) { return PyUnicode_FromFormat("BL_Shader\n\tvertex shader:%s\n\n\tfragment shader%s\n\n", vertProg, fragProg); }
|
||||
virtual PyObject *py_repr(void) { return PyUnicode_FromFormat("BL_Shader\n\tvertex shader:%s\n\n\tfragment shader%s\n\n", vertProg, fragProg); }
|
||||
|
||||
// -----------------------------------
|
||||
KX_PYMETHOD_DOC(BL_Shader, setSource);
|
||||
|
|
|
@ -201,7 +201,7 @@ PyAttributeDef KX_NetworkMessageSensor::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_NetworkMessageSensor::pyattr_get_bodies(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_NetworkMessageSensor::pyattr_get_bodies(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_NetworkMessageSensor *self = static_cast<KX_NetworkMessageSensor*>(self_v);
|
||||
if (self->m_BodyList) {
|
||||
|
@ -211,7 +211,7 @@ PyObject* KX_NetworkMessageSensor::pyattr_get_bodies(void *self_v, const KX_PYAT
|
|||
}
|
||||
}
|
||||
|
||||
PyObject* KX_NetworkMessageSensor::pyattr_get_subjects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_NetworkMessageSensor::pyattr_get_subjects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_NetworkMessageSensor *self = static_cast<KX_NetworkMessageSensor*>(self_v);
|
||||
if (self->m_SubjectList) {
|
||||
|
|
|
@ -193,7 +193,7 @@ PyAttributeDef KX_ArmatureSensor::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_ArmatureSensor::pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_ArmatureSensor::pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_ArmatureSensor* sensor = static_cast<KX_ArmatureSensor*>(self);
|
||||
if (sensor->m_gameobj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE) {
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
/* --------------------------------------------------------------------- */
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
static PyObject* pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
||||
|
|
|
@ -835,19 +835,19 @@ PyTypeObject KX_BlenderMaterial::Type = {
|
|||
py_base_new
|
||||
};
|
||||
|
||||
PyObject* KX_BlenderMaterial::pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_BlenderMaterial::pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
|
||||
return self->PygetShader(NULL, NULL);
|
||||
}
|
||||
|
||||
PyObject* KX_BlenderMaterial::pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_BlenderMaterial::pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
|
||||
return PyLong_FromSsize_t(self->GetMaterialIndex());
|
||||
}
|
||||
|
||||
PyObject* KX_BlenderMaterial::pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_BlenderMaterial::pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
|
||||
unsigned int* bfunc = self->getBlendFunc();
|
||||
|
@ -857,7 +857,7 @@ PyObject* KX_BlenderMaterial::pyattr_get_blending(void *self_v, const KX_PYATTRI
|
|||
int KX_BlenderMaterial::pyattr_set_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
|
||||
{
|
||||
KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
|
||||
PyObject* obj = self->PysetBlending(value, NULL);
|
||||
PyObject *obj = self->PysetBlending(value, NULL);
|
||||
if (obj)
|
||||
{
|
||||
Py_DECREF(obj);
|
||||
|
|
|
@ -106,11 +106,11 @@ public:
|
|||
|
||||
#ifdef WITH_PYTHON
|
||||
// --------------------------------
|
||||
virtual PyObject* py_repr(void) { return PyUnicode_From_STR_String(mMaterial->matname); }
|
||||
virtual PyObject *py_repr(void) { return PyUnicode_From_STR_String(mMaterial->matname); }
|
||||
|
||||
static PyObject* pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_blending(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
KX_PYMETHOD_DOC(KX_BlenderMaterial, getShader);
|
||||
|
|
|
@ -712,7 +712,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, setOnTop,
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyBool_FromLong(self->m_camdata.m_perspective);
|
||||
|
@ -732,7 +732,7 @@ int KX_Camera::pyattr_set_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *at
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_camdata.m_lens);
|
||||
|
@ -752,7 +752,7 @@ int KX_Camera::pyattr_set_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef,
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_camdata.m_scale);
|
||||
|
@ -772,7 +772,7 @@ int KX_Camera::pyattr_set_ortho_scale(void *self_v, const KX_PYATTRIBUTE_DEF *at
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_camdata.m_clipstart);
|
||||
|
@ -792,7 +792,7 @@ int KX_Camera::pyattr_set_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef,
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_camdata.m_clipend);
|
||||
|
@ -813,7 +813,7 @@ int KX_Camera::pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, P
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyBool_FromLong(self->GetViewport());
|
||||
|
@ -832,7 +832,7 @@ int KX_Camera::pyattr_set_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *a
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyObjectFrom(self->GetProjectionMatrix());
|
||||
|
@ -849,34 +849,34 @@ int KX_Camera::pyattr_set_projection_matrix(void *self_v, const KX_PYATTRIBUTE_D
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_modelview_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_modelview_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyObjectFrom(self->GetModelviewMatrix());
|
||||
}
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_camera_to_world(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_camera_to_world(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyObjectFrom(self->GetCameraToWorld());
|
||||
}
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_world_to_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_world_to_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Camera* self= static_cast<KX_Camera*>(self_v);
|
||||
return PyObjectFrom(self->GetWorldToCamera());
|
||||
}
|
||||
|
||||
|
||||
PyObject* KX_Camera::pyattr_get_INSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_INSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{ return PyLong_FromSsize_t(INSIDE); }
|
||||
PyObject* KX_Camera::pyattr_get_OUTSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_OUTSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{ return PyLong_FromSsize_t(OUTSIDE); }
|
||||
PyObject* KX_Camera::pyattr_get_INTERSECT(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Camera::pyattr_get_INTERSECT(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{ return PyLong_FromSsize_t(INTERSECT); }
|
||||
|
||||
|
||||
bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok, const char *error_prefix)
|
||||
bool ConvertPythonToCamera(PyObject *value, KX_Camera **object, bool py_none_ok, const char *error_prefix)
|
||||
{
|
||||
if (value==NULL) {
|
||||
PyErr_Format(PyExc_TypeError, "%s, python pointer NULL, should never happen", error_prefix);
|
||||
|
@ -976,7 +976,7 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, getScreenPosition,
|
|||
|
||||
vect[1] = 1.0 - vect[1]; //to follow Blender window coordinate system (Top-Down)
|
||||
|
||||
PyObject* ret = PyTuple_New(2);
|
||||
PyObject *ret = PyTuple_New(2);
|
||||
if (ret) {
|
||||
PyTuple_SET_ITEM(ret, 0, PyFloat_FromDouble(vect[0]));
|
||||
PyTuple_SET_ITEM(ret, 1, PyFloat_FromDouble(vect[1]));
|
||||
|
@ -1040,7 +1040,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay,
|
|||
if (!PyArg_ParseTuple(args,"ddd|s:getScreenRay",&x,&y,&dist,&propName))
|
||||
return NULL;
|
||||
|
||||
PyObject* argValue = PyTuple_New(2);
|
||||
PyObject *argValue = PyTuple_New(2);
|
||||
PyTuple_SET_ITEM(argValue, 0, PyFloat_FromDouble(x));
|
||||
PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(y));
|
||||
|
||||
|
@ -1065,7 +1065,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay,
|
|||
if (propName)
|
||||
PyTuple_SET_ITEM(argValue, 2, PyUnicode_FromString(propName));
|
||||
|
||||
PyObject* ret= this->PyrayCastTo(argValue,NULL);
|
||||
PyObject *ret= this->PyrayCastTo(argValue,NULL);
|
||||
Py_DECREF(argValue);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
#ifdef WITH_PYTHON
|
||||
/* utility conversion function */
|
||||
bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok, const char *error_prefix);
|
||||
bool ConvertPythonToCamera(PyObject *value, KX_Camera **object, bool py_none_ok, const char *error_prefix);
|
||||
#endif
|
||||
|
||||
class KX_Camera : public KX_GameObject
|
||||
|
|
|
@ -394,7 +394,7 @@ PyAttributeDef KX_CameraActuator::Attributes[] = {
|
|||
{NULL}
|
||||
};
|
||||
|
||||
PyObject* KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_CameraActuator* self= static_cast<KX_CameraActuator*>(self_v);
|
||||
if (self->m_ob==NULL)
|
||||
|
|
|
@ -50,13 +50,13 @@ KX_ConstraintWrapper::~KX_ConstraintWrapper()
|
|||
|
||||
#ifdef WITH_PYTHON
|
||||
|
||||
PyObject* KX_ConstraintWrapper::PyGetConstraintId()
|
||||
PyObject *KX_ConstraintWrapper::PyGetConstraintId()
|
||||
{
|
||||
return PyLong_FromSsize_t(m_constraintId);
|
||||
}
|
||||
|
||||
|
||||
PyObject* KX_ConstraintWrapper::PyGetParam(PyObject* args, PyObject* kwds)
|
||||
PyObject *KX_ConstraintWrapper::PyGetParam(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
int dof;
|
||||
float value;
|
||||
|
@ -69,7 +69,7 @@ PyObject* KX_ConstraintWrapper::PyGetParam(PyObject* args, PyObject* kwds)
|
|||
|
||||
}
|
||||
|
||||
PyObject* KX_ConstraintWrapper::PySetParam(PyObject* args, PyObject* kwds)
|
||||
PyObject *KX_ConstraintWrapper::PySetParam(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
int dof;
|
||||
float minLimit,maxLimit;
|
||||
|
@ -117,7 +117,7 @@ PyAttributeDef KX_ConstraintWrapper::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_ConstraintWrapper::pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_ConstraintWrapper::pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_ConstraintWrapper* self= static_cast<KX_ConstraintWrapper*>(self_v);
|
||||
return self->PyGetConstraintId();
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
KX_PYMETHOD(KX_ConstraintWrapper,SetParam);
|
||||
KX_PYMETHOD(KX_ConstraintWrapper,GetParam);
|
||||
|
||||
static PyObject* pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_constraintId(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
@ -252,7 +252,7 @@ PyAttributeDef KX_FontObject::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_FontObject::pyattr_get_text(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_FontObject::pyattr_get_text(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_FontObject* self= static_cast<KX_FontObject*>(self_v);
|
||||
STR_String str = STR_String();
|
||||
|
|
|
@ -1668,7 +1668,7 @@ PyAttributeDef KX_GameObject::Attributes[] = {
|
|||
{NULL} //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_GameObject::PyReplaceMesh(PyObject* args)
|
||||
PyObject *KX_GameObject::PyReplaceMesh(PyObject *args)
|
||||
{
|
||||
KX_Scene *scene = KX_GetActiveScene();
|
||||
|
||||
|
@ -1686,7 +1686,7 @@ PyObject* KX_GameObject::PyReplaceMesh(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyEndObject()
|
||||
PyObject *KX_GameObject::PyEndObject()
|
||||
{
|
||||
SG_Node* node = this->GetSGNode();
|
||||
KX_Scene* scene = static_cast<KX_Scene*>(node->GetSGClientInfo());
|
||||
|
@ -1697,7 +1697,7 @@ PyObject* KX_GameObject::PyEndObject()
|
|||
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyReinstancePhysicsMesh(PyObject* args)
|
||||
PyObject *KX_GameObject::PyReinstancePhysicsMesh(PyObject *args)
|
||||
{
|
||||
KX_GameObject *gameobj= NULL;
|
||||
RAS_MeshObject *mesh= NULL;
|
||||
|
@ -1724,7 +1724,7 @@ static PyObject *Map_GetItem(PyObject *self_v, PyObject *item)
|
|||
KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v);
|
||||
const char *attr_str= _PyUnicode_AsString(item);
|
||||
CValue* resultattr;
|
||||
PyObject* pyconvert;
|
||||
PyObject *pyconvert;
|
||||
|
||||
if (self==NULL) {
|
||||
PyErr_SetString(PyExc_SystemError, "val = gameOb[key]: KX_GameObject, "BGE_PROXY_ERROR_MSG);
|
||||
|
@ -1907,13 +1907,13 @@ PyTypeObject KX_GameObject::Type = {
|
|||
py_base_new
|
||||
};
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
return PyUnicode_From_STR_String(self->GetName());
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
KX_GameObject* parent = self->GetParent();
|
||||
|
@ -1924,7 +1924,7 @@ PyObject* KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DE
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_life(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_life(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
|
||||
|
@ -1937,7 +1937,7 @@ PyObject* KX_GameObject::pyattr_get_life(void *self_v, const KX_PYATTRIBUTE_DEF
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
KX_IPhysicsController *spc = self->GetPhysicsController();
|
||||
|
@ -1960,7 +1960,7 @@ int KX_GameObject::pyattr_set_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrd
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
KX_IPhysicsController *spc = self->GetPhysicsController();
|
||||
|
@ -1983,7 +1983,7 @@ int KX_GameObject::pyattr_set_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
KX_IPhysicsController *spc = self->GetPhysicsController();
|
||||
|
@ -2007,7 +2007,7 @@ int KX_GameObject::pyattr_set_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
return PyBool_FromLong(self->GetVisible());
|
||||
|
@ -2027,7 +2027,7 @@ int KX_GameObject::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *at
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL);
|
||||
|
@ -2049,7 +2049,7 @@ int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_D
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL);
|
||||
|
@ -2071,7 +2071,7 @@ int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_D
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL);
|
||||
|
@ -2083,7 +2083,7 @@ PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIB
|
|||
#endif
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Matrix_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_GLOBAL);
|
||||
|
@ -2108,7 +2108,7 @@ int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUT
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Matrix_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_LOCAL);
|
||||
|
@ -2132,7 +2132,7 @@ int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUT
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL);
|
||||
|
@ -2154,7 +2154,7 @@ int KX_GameObject::pyattr_set_worldScaling(void *self_v, const KX_PYATTRIBUTE_DE
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL);
|
||||
|
@ -2176,7 +2176,7 @@ int KX_GameObject::pyattr_set_localScaling(void *self_v, const KX_PYATTRIBUTE_DE
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_localTransform(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_localTransform(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self = static_cast<KX_GameObject*>(self_v);
|
||||
|
||||
|
@ -2222,7 +2222,7 @@ int KX_GameObject::pyattr_set_localTransform(void *self_v, const KX_PYATTRIBUTE_
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_worldTransform(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_worldTransform(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self = static_cast<KX_GameObject*>(self_v);
|
||||
|
||||
|
@ -2256,7 +2256,7 @@ int KX_GameObject::pyattr_set_worldTransform(void *self_v, const KX_PYATTRIBUTE_
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_worldLinearVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_worldLinearVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_LINVEL_GLOBAL);
|
||||
|
@ -2278,7 +2278,7 @@ int KX_GameObject::pyattr_set_worldLinearVelocity(void *self_v, const KX_PYATTRI
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_localLinearVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_localLinearVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_LINVEL_LOCAL);
|
||||
|
@ -2300,7 +2300,7 @@ int KX_GameObject::pyattr_set_localLinearVelocity(void *self_v, const KX_PYATTRI
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_worldAngularVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_worldAngularVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_ANGVEL_GLOBAL);
|
||||
|
@ -2322,7 +2322,7 @@ int KX_GameObject::pyattr_set_worldAngularVelocity(void *self_v, const KX_PYATTR
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_localAngularVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_localAngularVelocity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_ANGVEL_LOCAL);
|
||||
|
@ -2345,7 +2345,7 @@ int KX_GameObject::pyattr_set_localAngularVelocity(void *self_v, const KX_PYATTR
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
SG_Node* sg_parent;
|
||||
|
@ -2372,7 +2372,7 @@ int KX_GameObject::pyattr_set_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
int state = 0;
|
||||
|
@ -2400,7 +2400,7 @@ int KX_GameObject::pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attr
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
PyObject *meshes= PyList_New(self->m_meshes.size());
|
||||
|
@ -2415,7 +2415,7 @@ PyObject* KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DE
|
|||
return meshes;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_obcolor(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_obcolor(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 4, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_OBJECT_COLOR);
|
||||
|
@ -2437,35 +2437,35 @@ int KX_GameObject::pyattr_set_obcolor(void *self_v, const KX_PYATTRIBUTE_DEF *at
|
|||
}
|
||||
|
||||
/* These are experimental! */
|
||||
PyObject* KX_GameObject::pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
return KX_PythonSeq_CreatePyObject((static_cast<KX_GameObject*>(self_v))->m_proxy, KX_PYGENSEQ_OB_TYPE_SENSORS);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_controllers(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_controllers(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
return KX_PythonSeq_CreatePyObject((static_cast<KX_GameObject*>(self_v))->m_proxy, KX_PYGENSEQ_OB_TYPE_CONTROLLERS);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
return KX_PythonSeq_CreatePyObject((static_cast<KX_GameObject*>(self_v))->m_proxy, KX_PYGENSEQ_OB_TYPE_ACTUATORS);
|
||||
}
|
||||
/* End experimental */
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
return self->GetChildren()->NewProxy(true);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_children_recursive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_children_recursive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
return self->GetChildrenRecursive()->NewProxy(true);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
|
||||
|
@ -2476,10 +2476,10 @@ PyObject* KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_
|
|||
return self->m_attr_dict;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyApplyForce(PyObject* args)
|
||||
PyObject *KX_GameObject::PyApplyForce(PyObject *args)
|
||||
{
|
||||
int local = 0;
|
||||
PyObject* pyvect;
|
||||
PyObject *pyvect;
|
||||
|
||||
if (PyArg_ParseTuple(args, "O|i:applyForce", &pyvect, &local)) {
|
||||
MT_Vector3 force;
|
||||
|
@ -2491,10 +2491,10 @@ PyObject* KX_GameObject::PyApplyForce(PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyApplyTorque(PyObject* args)
|
||||
PyObject *KX_GameObject::PyApplyTorque(PyObject *args)
|
||||
{
|
||||
int local = 0;
|
||||
PyObject* pyvect;
|
||||
PyObject *pyvect;
|
||||
|
||||
if (PyArg_ParseTuple(args, "O|i:applyTorque", &pyvect, &local)) {
|
||||
MT_Vector3 torque;
|
||||
|
@ -2506,10 +2506,10 @@ PyObject* KX_GameObject::PyApplyTorque(PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyApplyRotation(PyObject* args)
|
||||
PyObject *KX_GameObject::PyApplyRotation(PyObject *args)
|
||||
{
|
||||
int local = 0;
|
||||
PyObject* pyvect;
|
||||
PyObject *pyvect;
|
||||
|
||||
if (PyArg_ParseTuple(args, "O|i:applyRotation", &pyvect, &local)) {
|
||||
MT_Vector3 rotation;
|
||||
|
@ -2521,10 +2521,10 @@ PyObject* KX_GameObject::PyApplyRotation(PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyApplyMovement(PyObject* args)
|
||||
PyObject *KX_GameObject::PyApplyMovement(PyObject *args)
|
||||
{
|
||||
int local = 0;
|
||||
PyObject* pyvect;
|
||||
PyObject *pyvect;
|
||||
|
||||
if (PyArg_ParseTuple(args, "O|i:applyMovement", &pyvect, &local)) {
|
||||
MT_Vector3 movement;
|
||||
|
@ -2536,7 +2536,7 @@ PyObject* KX_GameObject::PyApplyMovement(PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* args)
|
||||
PyObject *KX_GameObject::PyGetLinearVelocity(PyObject *args)
|
||||
{
|
||||
// only can get the velocity if we have a physics object connected to us...
|
||||
int local = 0;
|
||||
|
@ -2550,10 +2550,10 @@ PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* args)
|
|||
}
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PySetLinearVelocity(PyObject* args)
|
||||
PyObject *KX_GameObject::PySetLinearVelocity(PyObject *args)
|
||||
{
|
||||
int local = 0;
|
||||
PyObject* pyvect;
|
||||
PyObject *pyvect;
|
||||
|
||||
if (PyArg_ParseTuple(args,"O|i:setLinearVelocity",&pyvect,&local)) {
|
||||
MT_Vector3 velocity;
|
||||
|
@ -2565,7 +2565,7 @@ PyObject* KX_GameObject::PySetLinearVelocity(PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetAngularVelocity(PyObject* args)
|
||||
PyObject *KX_GameObject::PyGetAngularVelocity(PyObject *args)
|
||||
{
|
||||
// only can get the velocity if we have a physics object connected to us...
|
||||
int local = 0;
|
||||
|
@ -2579,10 +2579,10 @@ PyObject* KX_GameObject::PyGetAngularVelocity(PyObject* args)
|
|||
}
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PySetAngularVelocity(PyObject* args)
|
||||
PyObject *KX_GameObject::PySetAngularVelocity(PyObject *args)
|
||||
{
|
||||
int local = 0;
|
||||
PyObject* pyvect;
|
||||
PyObject *pyvect;
|
||||
|
||||
if (PyArg_ParseTuple(args,"O|i:setAngularVelocity",&pyvect,&local)) {
|
||||
MT_Vector3 velocity;
|
||||
|
@ -2594,7 +2594,7 @@ PyObject* KX_GameObject::PySetAngularVelocity(PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PySetVisible(PyObject* args)
|
||||
PyObject *KX_GameObject::PySetVisible(PyObject *args)
|
||||
{
|
||||
int visible, recursive = 0;
|
||||
if (!PyArg_ParseTuple(args,"i|i:setVisible",&visible, &recursive))
|
||||
|
@ -2606,7 +2606,7 @@ PyObject* KX_GameObject::PySetVisible(PyObject* args)
|
|||
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PySetOcclusion(PyObject* args)
|
||||
PyObject *KX_GameObject::PySetOcclusion(PyObject *args)
|
||||
{
|
||||
int occlusion, recursive = 0;
|
||||
if (!PyArg_ParseTuple(args,"i|i:setOcclusion",&occlusion, &recursive))
|
||||
|
@ -2616,11 +2616,11 @@ PyObject* KX_GameObject::PySetOcclusion(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetVelocity(PyObject* args)
|
||||
PyObject *KX_GameObject::PyGetVelocity(PyObject *args)
|
||||
{
|
||||
// only can get the velocity if we have a physics object connected to us...
|
||||
MT_Point3 point(0.0,0.0,0.0);
|
||||
PyObject* pypos = NULL;
|
||||
PyObject *pypos = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|O:getVelocity", &pypos) || (pypos && !PyVecTo(pypos, point)))
|
||||
return NULL;
|
||||
|
@ -2634,7 +2634,7 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* args)
|
|||
}
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetReactionForce()
|
||||
PyObject *KX_GameObject::PyGetReactionForce()
|
||||
{
|
||||
// only can get the velocity if we have a physics object connected to us...
|
||||
|
||||
|
@ -2651,7 +2651,7 @@ PyObject* KX_GameObject::PyGetReactionForce()
|
|||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyEnableRigidBody()
|
||||
PyObject *KX_GameObject::PyEnableRigidBody()
|
||||
{
|
||||
if (GetPhysicsController())
|
||||
GetPhysicsController()->setRigidBody(true);
|
||||
|
@ -2661,7 +2661,7 @@ PyObject* KX_GameObject::PyEnableRigidBody()
|
|||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyDisableRigidBody()
|
||||
PyObject *KX_GameObject::PyDisableRigidBody()
|
||||
{
|
||||
if (GetPhysicsController())
|
||||
GetPhysicsController()->setRigidBody(false);
|
||||
|
@ -2670,10 +2670,10 @@ PyObject* KX_GameObject::PyDisableRigidBody()
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PySetParent(PyObject* args)
|
||||
PyObject *KX_GameObject::PySetParent(PyObject *args)
|
||||
{
|
||||
KX_Scene *scene = KX_GetActiveScene();
|
||||
PyObject* pyobj;
|
||||
PyObject *pyobj;
|
||||
KX_GameObject *obj;
|
||||
int addToCompound=1, ghost=1;
|
||||
|
||||
|
@ -2687,7 +2687,7 @@ PyObject* KX_GameObject::PySetParent(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyRemoveParent()
|
||||
PyObject *KX_GameObject::PyRemoveParent()
|
||||
{
|
||||
KX_Scene *scene = KX_GetActiveScene();
|
||||
|
||||
|
@ -2696,7 +2696,7 @@ PyObject* KX_GameObject::PyRemoveParent()
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PySetCollisionMargin(PyObject* value)
|
||||
PyObject *KX_GameObject::PySetCollisionMargin(PyObject *value)
|
||||
{
|
||||
float collisionMargin = PyFloat_AsDouble(value);
|
||||
|
||||
|
@ -2716,10 +2716,10 @@ PyObject* KX_GameObject::PySetCollisionMargin(PyObject* value)
|
|||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyApplyImpulse(PyObject* args)
|
||||
PyObject *KX_GameObject::PyApplyImpulse(PyObject *args)
|
||||
{
|
||||
PyObject* pyattach;
|
||||
PyObject* pyimpulse;
|
||||
PyObject *pyattach;
|
||||
PyObject *pyimpulse;
|
||||
|
||||
if (!m_pPhysicsController1) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "This object has no physics controller");
|
||||
|
@ -2743,7 +2743,7 @@ PyObject* KX_GameObject::PyApplyImpulse(PyObject* args)
|
|||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PySuspendDynamics()
|
||||
PyObject *KX_GameObject::PySuspendDynamics()
|
||||
{
|
||||
SuspendDynamics();
|
||||
Py_RETURN_NONE;
|
||||
|
@ -2751,16 +2751,16 @@ PyObject* KX_GameObject::PySuspendDynamics()
|
|||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyRestoreDynamics()
|
||||
PyObject *KX_GameObject::PyRestoreDynamics()
|
||||
{
|
||||
RestoreDynamics();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* args)
|
||||
PyObject *KX_GameObject::PyAlignAxisToVect(PyObject *args)
|
||||
{
|
||||
PyObject* pyvect;
|
||||
PyObject *pyvect;
|
||||
int axis = 2; //z axis is the default
|
||||
float fac = 1.0f;
|
||||
|
||||
|
@ -2780,7 +2780,7 @@ PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetAxisVect(PyObject* value)
|
||||
PyObject *KX_GameObject::PyGetAxisVect(PyObject *value)
|
||||
{
|
||||
MT_Vector3 vect;
|
||||
if (PyVecTo(value, vect))
|
||||
|
@ -2791,7 +2791,7 @@ PyObject* KX_GameObject::PyGetAxisVect(PyObject* value)
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyGetPhysicsId()
|
||||
PyObject *KX_GameObject::PyGetPhysicsId()
|
||||
{
|
||||
KX_IPhysicsController* ctrl = GetPhysicsController();
|
||||
uint_ptr physid=0;
|
||||
|
@ -2802,7 +2802,7 @@ PyObject* KX_GameObject::PyGetPhysicsId()
|
|||
return PyLong_FromSsize_t((long)physid);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetPropertyNames()
|
||||
PyObject *KX_GameObject::PyGetPropertyNames()
|
||||
{
|
||||
PyObject *list= ConvertKeysToPython();
|
||||
|
||||
|
@ -2932,7 +2932,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
|
|||
" other = 3-tuple or object reference")
|
||||
{
|
||||
MT_Point3 toPoint;
|
||||
PyObject* pyarg;
|
||||
PyObject *pyarg;
|
||||
float dist = 0.0f;
|
||||
char *propName = NULL;
|
||||
|
||||
|
@ -3050,8 +3050,8 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
|
|||
{
|
||||
MT_Point3 toPoint;
|
||||
MT_Point3 fromPoint;
|
||||
PyObject* pyto;
|
||||
PyObject* pyfrom = NULL;
|
||||
PyObject *pyto;
|
||||
PyObject *pyfrom = NULL;
|
||||
float dist = 0.0f;
|
||||
char *propName = NULL;
|
||||
KX_GameObject *other;
|
||||
|
@ -3125,7 +3125,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
|
|||
|
||||
if (m_pHitObject)
|
||||
{
|
||||
PyObject* returnValue = (poly==2) ? PyTuple_New(5) : (poly) ? PyTuple_New(4) : PyTuple_New(3);
|
||||
PyObject *returnValue = (poly == 2) ? PyTuple_New(5) : (poly) ? PyTuple_New(4) : PyTuple_New(3);
|
||||
if (returnValue) { // unlikely this would ever fail, if it does python sets an error
|
||||
PyTuple_SET_ITEM(returnValue, 0, m_pHitObject->GetProxy());
|
||||
PyTuple_SET_ITEM(returnValue, 1, PyObjectFrom(callback.m_hitPoint));
|
||||
|
@ -3301,11 +3301,11 @@ KX_PYMETHODDEF_DOC(KX_GameObject, isPlayingAction,
|
|||
|
||||
|
||||
/* Matches python dict.get(key, [default]) */
|
||||
PyObject* KX_GameObject::Pyget(PyObject *args)
|
||||
PyObject *KX_GameObject::Pyget(PyObject *args)
|
||||
{
|
||||
PyObject *key;
|
||||
PyObject* def = Py_None;
|
||||
PyObject* ret;
|
||||
PyObject *def = Py_None;
|
||||
PyObject *ret;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O|O:get", &key, &def))
|
||||
return NULL;
|
||||
|
@ -3331,7 +3331,7 @@ PyObject* KX_GameObject::Pyget(PyObject *args)
|
|||
return def;
|
||||
}
|
||||
|
||||
bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok, const char *error_prefix)
|
||||
bool ConvertPythonToGameObject(PyObject *value, KX_GameObject **object, bool py_none_ok, const char *error_prefix)
|
||||
{
|
||||
if (value==NULL) {
|
||||
PyErr_Format(PyExc_TypeError, "%s, python pointer NULL, should never happen", error_prefix);
|
||||
|
|
|
@ -68,7 +68,7 @@ struct bAction;
|
|||
|
||||
#ifdef WITH_PYTHON
|
||||
/* utility conversion function */
|
||||
bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok, const char *error_prefix);
|
||||
bool ConvertPythonToGameObject(PyObject *value, KX_GameObject **object, bool py_none_ok, const char *error_prefix);
|
||||
#endif
|
||||
|
||||
#ifdef USE_MATHUTILS
|
||||
|
@ -159,7 +159,7 @@ public:
|
|||
* side effect of storing the result internally. The
|
||||
* memory for the matrix remains the property of this class.
|
||||
*/
|
||||
double*
|
||||
double *
|
||||
GetOpenGLMatrix(
|
||||
);
|
||||
|
||||
|
@ -170,7 +170,7 @@ public:
|
|||
* memory for the returned matrix.
|
||||
*/
|
||||
|
||||
MT_CmMatrix4x4*
|
||||
MT_CmMatrix4x4 *
|
||||
GetOpenGLMatrixPtr(
|
||||
) {
|
||||
return &m_OpenGL_4x4Matrix;
|
||||
|
@ -887,7 +887,7 @@ public:
|
|||
/**
|
||||
* \section Python interface functions.
|
||||
*/
|
||||
virtual PyObject* py_repr(void)
|
||||
virtual PyObject *py_repr(void)
|
||||
{
|
||||
return PyUnicode_From_STR_String(GetName());
|
||||
}
|
||||
|
|
|
@ -453,7 +453,7 @@ PyAttributeDef KX_IpoActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_IpoActuator::pyattr_get_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_IpoActuator::pyattr_get_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_startframe);
|
||||
|
@ -474,7 +474,7 @@ int KX_IpoActuator::pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DE
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_IpoActuator::pyattr_get_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_IpoActuator::pyattr_get_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_IpoActuator* self= static_cast<KX_IpoActuator*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_endframe);
|
||||
|
|
|
@ -253,7 +253,7 @@ void KX_KetsjiEngine::SetRasterizer(RAS_IRasterizer* rasterizer)
|
|||
* At the moment the bge.logic module is imported into 'pythondictionary' after this function is called.
|
||||
* if this function ever changes to assign a copy, make sure the game logic module is imported into this dictionary before hand.
|
||||
*/
|
||||
void KX_KetsjiEngine::SetPyNamespace(PyObject* pythondictionary)
|
||||
void KX_KetsjiEngine::SetPyNamespace(PyObject *pythondictionary)
|
||||
{
|
||||
MT_assert(pythondictionary);
|
||||
m_pythondictionary = pythondictionary;
|
||||
|
|
|
@ -220,7 +220,7 @@ public:
|
|||
void SetRenderTools(RAS_IRenderTools* rendertools);
|
||||
void SetRasterizer(RAS_IRasterizer* rasterizer);
|
||||
#ifdef WITH_PYTHON
|
||||
void SetPyNamespace(PyObject* pythondictionary);
|
||||
void SetPyNamespace(PyObject *pythondictionary);
|
||||
PyObject* GetPyNamespace() { return m_pythondictionary; }
|
||||
#endif
|
||||
void SetSceneConverter(KX_ISceneConverter* sceneconverter);
|
||||
|
|
|
@ -344,7 +344,7 @@ PyAttributeDef KX_LightObject::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_LightObject::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_LightObject::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_LightObject* self = static_cast<KX_LightObject*>(self_v);
|
||||
return Py_BuildValue("[fff]", self->m_lightobj.m_red, self->m_lightobj.m_green, self->m_lightobj.m_blue);
|
||||
|
@ -365,9 +365,9 @@ int KX_LightObject::pyattr_set_color(void *self_v, const KX_PYATTRIBUTE_DEF *att
|
|||
return PY_SET_ATTR_FAIL;
|
||||
}
|
||||
|
||||
PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
PyObject* retvalue;
|
||||
PyObject *retvalue;
|
||||
|
||||
const char* type = attrdef->m_name;
|
||||
|
||||
|
@ -387,13 +387,13 @@ PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUT
|
|||
return retvalue;
|
||||
}
|
||||
|
||||
PyObject* KX_LightObject::pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_LightObject::pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_LightObject* self = static_cast<KX_LightObject*>(self_v);
|
||||
return PyLong_FromSsize_t(self->m_lightobj.m_type);
|
||||
}
|
||||
|
||||
int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value)
|
||||
int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
|
||||
{
|
||||
KX_LightObject* self = static_cast<KX_LightObject*>(self_v);
|
||||
int val = PyLong_AsSsize_t(value);
|
||||
|
|
|
@ -76,10 +76,10 @@ public:
|
|||
#ifdef WITH_PYTHON
|
||||
/* attributes */
|
||||
static PyObject* pyattr_get_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
|
||||
static int pyattr_set_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
static PyObject* pyattr_get_typeconst(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
|
||||
static int pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ CValue* KX_MeshProxy::GetReplica() { return NULL;}
|
|||
|
||||
// stuff for python integration
|
||||
|
||||
PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds)
|
||||
PyObject *KX_MeshProxy::PyGetMaterialName(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
int matid= 1;
|
||||
STR_String matname;
|
||||
|
@ -134,7 +134,7 @@ PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds)
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds)
|
||||
PyObject *KX_MeshProxy::PyGetTextureName(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
int matid= 1;
|
||||
STR_String matname;
|
||||
|
@ -151,7 +151,7 @@ PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds)
|
|||
|
||||
}
|
||||
|
||||
PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* args, PyObject* kwds)
|
||||
PyObject *KX_MeshProxy::PyGetVertexArrayLength(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
int matid= 0;
|
||||
int length = 0;
|
||||
|
@ -174,7 +174,7 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* args, PyObject* kwds)
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_MeshProxy::PyGetVertex(PyObject* args, PyObject* kwds)
|
||||
PyObject *KX_MeshProxy::PyGetVertex(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
int vertexindex;
|
||||
int matindex;
|
||||
|
@ -192,10 +192,10 @@ PyObject* KX_MeshProxy::PyGetVertex(PyObject* args, PyObject* kwds)
|
|||
return (new KX_VertexProxy(this, vertex))->NewProxy(true);
|
||||
}
|
||||
|
||||
PyObject* KX_MeshProxy::PyGetPolygon(PyObject* args, PyObject* kwds)
|
||||
PyObject *KX_MeshProxy::PyGetPolygon(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
int polyindex= 1;
|
||||
PyObject* polyob = NULL;
|
||||
PyObject *polyob = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args,"i:getPolygon",&polyindex))
|
||||
return NULL;
|
||||
|
@ -218,7 +218,7 @@ PyObject* KX_MeshProxy::PyGetPolygon(PyObject* args, PyObject* kwds)
|
|||
return polyob;
|
||||
}
|
||||
|
||||
PyObject* KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_MeshProxy* self= static_cast<KX_MeshProxy*>(self_v);
|
||||
|
||||
|
@ -233,7 +233,7 @@ PyObject* KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_
|
|||
for (i=0; i<tot; mit++, i++) {
|
||||
RAS_IPolyMaterial *polymat = mit->m_bucket->GetPolyMaterial();
|
||||
|
||||
/* Why do we need to check for RAS_BLENDERMAT if both are cast to a (PyObject*)? - Campbell */
|
||||
/* Why do we need to check for RAS_BLENDERMAT if both are cast to a (PyObject *)? - Campbell */
|
||||
if (polymat->GetFlag() & RAS_BLENDERMAT)
|
||||
{
|
||||
KX_BlenderMaterial *mat = static_cast<KX_BlenderMaterial*>(polymat);
|
||||
|
@ -260,7 +260,7 @@ PyObject * KX_MeshProxy::pyattr_get_numPolygons(void * selfv, const KX_PYATTRIBU
|
|||
}
|
||||
|
||||
/* a close copy of ConvertPythonToGameObject but for meshes */
|
||||
bool ConvertPythonToMesh(PyObject * value, RAS_MeshObject **object, bool py_none_ok, const char *error_prefix)
|
||||
bool ConvertPythonToMesh(PyObject *value, RAS_MeshObject **object, bool py_none_ok, const char *error_prefix)
|
||||
{
|
||||
if (value==NULL) {
|
||||
PyErr_Format(PyExc_TypeError, "%s, python pointer NULL, should never happen", error_prefix);
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include "SCA_IObject.h"
|
||||
|
||||
/* utility conversion function */
|
||||
bool ConvertPythonToMesh(PyObject * value, class RAS_MeshObject **object, bool py_none_ok, const char *error_prefix);
|
||||
bool ConvertPythonToMesh(PyObject *value, class RAS_MeshObject **object, bool py_none_ok, const char *error_prefix);
|
||||
|
||||
class KX_MeshProxy : public CValue
|
||||
{
|
||||
|
@ -73,8 +73,8 @@ public:
|
|||
KX_PYMETHOD(KX_MeshProxy,GetPolygon);
|
||||
|
||||
static PyObject* pyattr_get_materials(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject * pyattr_get_numMaterials(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
|
||||
static PyObject * pyattr_get_numPolygons(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
|
||||
static PyObject *pyattr_get_numMaterials(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
|
||||
static PyObject *pyattr_get_numPolygons(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
|
||||
};
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
|
|
@ -392,19 +392,19 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = {
|
|||
};
|
||||
|
||||
/* Attributes */
|
||||
PyObject* KX_MouseFocusSensor::pyattr_get_ray_source(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_MouseFocusSensor::pyattr_get_ray_source(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v);
|
||||
return PyObjectFrom(self->RaySource());
|
||||
}
|
||||
|
||||
PyObject* KX_MouseFocusSensor::pyattr_get_ray_target(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_MouseFocusSensor::pyattr_get_ray_target(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v);
|
||||
return PyObjectFrom(self->RayTarget());
|
||||
}
|
||||
|
||||
PyObject* KX_MouseFocusSensor::pyattr_get_ray_direction(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_MouseFocusSensor::pyattr_get_ray_direction(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v);
|
||||
MT_Vector3 dir = self->RayTarget() - self->RaySource();
|
||||
|
@ -413,7 +413,7 @@ PyObject* KX_MouseFocusSensor::pyattr_get_ray_direction(void *self_v, const KX_P
|
|||
return PyObjectFrom(dir);
|
||||
}
|
||||
|
||||
PyObject* KX_MouseFocusSensor::pyattr_get_hit_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_MouseFocusSensor::pyattr_get_hit_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v);
|
||||
|
||||
|
@ -423,19 +423,19 @@ PyObject* KX_MouseFocusSensor::pyattr_get_hit_object(void *self_v, const KX_PYAT
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_MouseFocusSensor::pyattr_get_hit_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_MouseFocusSensor::pyattr_get_hit_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v);
|
||||
return PyObjectFrom(self->HitPosition());
|
||||
}
|
||||
|
||||
PyObject* KX_MouseFocusSensor::pyattr_get_hit_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_MouseFocusSensor::pyattr_get_hit_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v);
|
||||
return PyObjectFrom(self->HitNormal());
|
||||
}
|
||||
|
||||
PyObject* KX_MouseFocusSensor::pyattr_get_hit_uv(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_MouseFocusSensor::pyattr_get_hit_uv(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_MouseFocusSensor* self= static_cast<KX_MouseFocusSensor*>(self_v);
|
||||
return PyObjectFrom(self->HitUV());
|
||||
|
|
|
@ -460,7 +460,7 @@ Mathutils_Callback mathutils_obactu_vector_cb = {
|
|||
mathutils_obactu_vector_set_index
|
||||
};
|
||||
|
||||
PyObject* KX_ObjectActuator::pyattr_get_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_ObjectActuator::pyattr_get_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_LINV);
|
||||
}
|
||||
|
@ -476,7 +476,7 @@ int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *a
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_ObjectActuator::pyattr_get_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_ObjectActuator::pyattr_get_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
return Vector_CreatePyObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_ANGV);
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ void KX_ObjectActuator_Mathutils_Callback_Init(void)
|
|||
|
||||
#endif // USE_MATHUTILS
|
||||
|
||||
PyObject* KX_ObjectActuator::pyattr_get_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_ObjectActuator::pyattr_get_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_ObjectActuator* self = reinterpret_cast<KX_ObjectActuator*>(self_v);
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
@ -517,7 +517,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE
|
|||
{
|
||||
KX_ObjectActuator* self = reinterpret_cast<KX_ObjectActuator*>(self_v);
|
||||
|
||||
PyObject* seq = PySequence_Fast(value, "");
|
||||
PyObject *seq = PySequence_Fast(value, "");
|
||||
if (seq && PySequence_Fast_GET_SIZE(seq) == 3)
|
||||
{
|
||||
self->m_drot[0] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0));
|
||||
|
@ -537,7 +537,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE
|
|||
return PY_SET_ATTR_FAIL;
|
||||
}
|
||||
|
||||
PyObject* KX_ObjectActuator::pyattr_get_forceLimitY(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_ObjectActuator::pyattr_get_forceLimitY(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_ObjectActuator* self = reinterpret_cast<KX_ObjectActuator*>(self_v);
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
@ -553,7 +553,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitY(void *self_v, const KX_PYATTRIBUTE
|
|||
{
|
||||
KX_ObjectActuator* self = reinterpret_cast<KX_ObjectActuator*>(self_v);
|
||||
|
||||
PyObject* seq = PySequence_Fast(value, "");
|
||||
PyObject *seq = PySequence_Fast(value, "");
|
||||
if (seq && PySequence_Fast_GET_SIZE(seq) == 3)
|
||||
{
|
||||
self->m_drot[1] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0));
|
||||
|
@ -573,7 +573,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitY(void *self_v, const KX_PYATTRIBUTE
|
|||
return PY_SET_ATTR_FAIL;
|
||||
}
|
||||
|
||||
PyObject* KX_ObjectActuator::pyattr_get_forceLimitZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_ObjectActuator::pyattr_get_forceLimitZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_ObjectActuator* self = reinterpret_cast<KX_ObjectActuator*>(self_v);
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
@ -589,7 +589,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitZ(void *self_v, const KX_PYATTRIBUTE
|
|||
{
|
||||
KX_ObjectActuator* self = reinterpret_cast<KX_ObjectActuator*>(self_v);
|
||||
|
||||
PyObject* seq = PySequence_Fast(value, "");
|
||||
PyObject *seq = PySequence_Fast(value, "");
|
||||
if (seq && PySequence_Fast_GET_SIZE(seq) == 3)
|
||||
{
|
||||
self->m_drot[2] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0));
|
||||
|
@ -609,7 +609,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitZ(void *self_v, const KX_PYATTRIBUTE
|
|||
return PY_SET_ATTR_FAIL;
|
||||
}
|
||||
|
||||
PyObject* KX_ObjectActuator::pyattr_get_reference(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_ObjectActuator::pyattr_get_reference(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_ObjectActuator* actuator = static_cast<KX_ObjectActuator*>(self);
|
||||
if (!actuator->m_reference)
|
||||
|
|
|
@ -172,7 +172,7 @@ PyAttributeDef KX_ParentActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_ParentActuator::pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_ParentActuator::pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_ParentActuator* actuator = static_cast<KX_ParentActuator*>(self);
|
||||
if (!actuator->m_ob)
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* These are used to get and set m_ob */
|
||||
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
|
|
@ -51,7 +51,7 @@ KX_PhysicsObjectWrapper::~KX_PhysicsObjectWrapper()
|
|||
|
||||
#ifdef WITH_PYTHON
|
||||
|
||||
PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* args)
|
||||
PyObject *KX_PhysicsObjectWrapper::PySetPosition(PyObject *args)
|
||||
{
|
||||
float x,y,z;
|
||||
if (PyArg_ParseTuple(args,"fff:setPosition",&x,&y,&z))
|
||||
|
@ -65,7 +65,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* args)
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* args)
|
||||
PyObject *KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject *args)
|
||||
{
|
||||
float x,y,z;
|
||||
int local;
|
||||
|
@ -79,7 +79,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* args)
|
||||
PyObject *KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject *args)
|
||||
{
|
||||
float x,y,z;
|
||||
int local;
|
||||
|
@ -93,7 +93,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* args)
|
||||
PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject *args)
|
||||
{
|
||||
int active;
|
||||
if (PyArg_ParseTuple(args,"i:setActive",&active))
|
||||
|
|
|
@ -112,52 +112,52 @@ CValue* KX_PolyProxy::GetReplica() { return NULL;}
|
|||
|
||||
// stuff for python integration
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
return self->PygetMaterialName();
|
||||
}
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
return self->PygetTextureName();
|
||||
}
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
return self->PygetMaterial();
|
||||
}
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
return self->PygetMaterialIndex();
|
||||
}
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
|
||||
return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 0));
|
||||
}
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
|
||||
return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 1));
|
||||
}
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
|
||||
return PyLong_FromSsize_t(self->m_polygon->GetVertexOffsetAbs(self->m_mesh, 2));
|
||||
}
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
|
||||
|
@ -168,13 +168,13 @@ PyObject* KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *at
|
|||
return PyLong_FromSsize_t(0);
|
||||
}
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
return self->PyisVisible();
|
||||
}
|
||||
|
||||
PyObject* KX_PolyProxy::pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolyProxy::pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolyProxy* self= static_cast<KX_PolyProxy*>(self_v);
|
||||
return self->PyisCollider();
|
||||
|
|
|
@ -57,16 +57,16 @@ public:
|
|||
|
||||
|
||||
// stuff for python integration
|
||||
static PyObject* pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialIndex)
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getNumVertex)
|
||||
|
|
|
@ -143,7 +143,7 @@ bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingI
|
|||
{
|
||||
PyObject *pyRasty = PyCapsule_New((void*)rasty, KX_POLYGONMATERIAL_CAPSULE_ID, NULL); /* new reference */
|
||||
PyObject *pyCachingInfo = PyCapsule_New((void*) &cachingInfo, KX_POLYGONMATERIAL_CAPSULE_ID, NULL); /* new reference */
|
||||
PyObject *ret = PyObject_CallMethod(m_pymaterial, (char *)"activate", (char *)"(NNO)", pyRasty, pyCachingInfo, (PyObject*) this->m_proxy);
|
||||
PyObject *ret = PyObject_CallMethod(m_pymaterial, (char *)"activate", (char *)"(NNO)", pyRasty, pyCachingInfo, (PyObject *) this->m_proxy);
|
||||
if (ret)
|
||||
{
|
||||
bool value = PyLong_AsSsize_t(ret);
|
||||
|
@ -355,26 +355,26 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, activate, "activate(rasty, cachingInfo)")
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_PolygonMaterial::pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolygonMaterial::pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v);
|
||||
return PyUnicode_From_STR_String(self->m_texturename);
|
||||
}
|
||||
|
||||
PyObject* KX_PolygonMaterial::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolygonMaterial::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v);
|
||||
return PyUnicode_From_STR_String(self->m_materialname);
|
||||
}
|
||||
|
||||
/* this does not seem useful */
|
||||
PyObject* KX_PolygonMaterial::pyattr_get_tface(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolygonMaterial::pyattr_get_tface(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v);
|
||||
return PyCapsule_New(&self->m_tface, KX_POLYGONMATERIAL_CAPSULE_ID, NULL);
|
||||
}
|
||||
|
||||
PyObject* KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v);
|
||||
int bindcode= 0;
|
||||
|
@ -385,7 +385,7 @@ PyObject* KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATT
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_PolygonMaterial::pyattr_get_diffuse(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolygonMaterial::pyattr_get_diffuse(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v);
|
||||
return PyObjectFrom(self->m_diffuse);
|
||||
|
@ -403,7 +403,7 @@ int KX_PolygonMaterial::pyattr_set_diffuse(void *self_v, const KX_PYATTRIBUTE_DE
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_PolygonMaterial::pyattr_get_specular(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_PolygonMaterial::pyattr_get_specular(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_PolygonMaterial* self= static_cast<KX_PolygonMaterial*>(self_v);
|
||||
return PyObjectFrom(self->m_specular);
|
||||
|
|
|
@ -137,7 +137,7 @@ public:
|
|||
KX_PYMETHOD_DOC(KX_PolygonMaterial, setCustomMaterial);
|
||||
KX_PYMETHOD_DOC(KX_PolygonMaterial, loadProgram);
|
||||
|
||||
virtual PyObject* py_repr(void) { return PyUnicode_FromString(m_material ? ((ID *)m_material)->name+2 : ""); }
|
||||
virtual PyObject *py_repr(void) { return PyUnicode_FromString(m_material ? ((ID *)m_material)->name+2 : ""); }
|
||||
|
||||
static PyObject* pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
|
|
@ -89,9 +89,9 @@ static char gPyGetAppliedImpulse__doc__[] = "getAppliedImpulse(int constraintId)
|
|||
|
||||
|
||||
|
||||
static PyObject* gPySetGravity(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetGravity(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float x,y,z;
|
||||
if (PyArg_ParseTuple(args,"fff",&x,&y,&z))
|
||||
|
@ -106,9 +106,9 @@ static PyObject* gPySetGravity(PyObject* self,
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPySetDebugMode(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetDebugMode(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
int mode;
|
||||
if (PyArg_ParseTuple(args,"i",&mode))
|
||||
|
@ -129,9 +129,9 @@ static PyObject* gPySetDebugMode(PyObject* self,
|
|||
|
||||
|
||||
|
||||
static PyObject* gPySetNumTimeSubSteps(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetNumTimeSubSteps(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
int substep;
|
||||
if (PyArg_ParseTuple(args,"i",&substep))
|
||||
|
@ -148,9 +148,9 @@ static PyObject* gPySetNumTimeSubSteps(PyObject* self,
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPySetNumIterations(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetNumIterations(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
int iter;
|
||||
if (PyArg_ParseTuple(args,"i",&iter))
|
||||
|
@ -167,9 +167,9 @@ static PyObject* gPySetNumIterations(PyObject* self,
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPySetDeactivationTime(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetDeactivationTime(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float deactive_time;
|
||||
if (PyArg_ParseTuple(args,"f",&deactive_time))
|
||||
|
@ -186,9 +186,9 @@ static PyObject* gPySetDeactivationTime(PyObject* self,
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPySetDeactivationLinearTreshold(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetDeactivationLinearTreshold(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float linearDeactivationTreshold;
|
||||
if (PyArg_ParseTuple(args,"f",&linearDeactivationTreshold))
|
||||
|
@ -205,9 +205,9 @@ static PyObject* gPySetDeactivationLinearTreshold(PyObject* self,
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPySetDeactivationAngularTreshold(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetDeactivationAngularTreshold(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float angularDeactivationTreshold;
|
||||
if (PyArg_ParseTuple(args,"f",&angularDeactivationTreshold))
|
||||
|
@ -223,9 +223,9 @@ static PyObject* gPySetDeactivationAngularTreshold(PyObject* self,
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPySetContactBreakingTreshold(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetContactBreakingTreshold(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float contactBreakingTreshold;
|
||||
if (PyArg_ParseTuple(args,"f",&contactBreakingTreshold))
|
||||
|
@ -242,9 +242,9 @@ static PyObject* gPySetContactBreakingTreshold(PyObject* self,
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPySetCcdMode(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetCcdMode(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float ccdMode;
|
||||
if (PyArg_ParseTuple(args,"f",&ccdMode))
|
||||
|
@ -260,9 +260,9 @@ static PyObject* gPySetCcdMode(PyObject* self,
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPySetSorConstant(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetSorConstant(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float sor;
|
||||
if (PyArg_ParseTuple(args,"f",&sor))
|
||||
|
@ -278,9 +278,9 @@ static PyObject* gPySetSorConstant(PyObject* self,
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPySetSolverTau(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetSolverTau(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float tau;
|
||||
if (PyArg_ParseTuple(args,"f",&tau))
|
||||
|
@ -297,9 +297,9 @@ static PyObject* gPySetSolverTau(PyObject* self,
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPySetSolverDamping(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetSolverDamping(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float damping;
|
||||
if (PyArg_ParseTuple(args,"f",&damping))
|
||||
|
@ -315,9 +315,9 @@ static PyObject* gPySetSolverDamping(PyObject* self,
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPySetLinearAirDamping(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetLinearAirDamping(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float damping;
|
||||
if (PyArg_ParseTuple(args,"f",&damping))
|
||||
|
@ -334,9 +334,9 @@ static PyObject* gPySetLinearAirDamping(PyObject* self,
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPySetUseEpa(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetUseEpa(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
int epa;
|
||||
if (PyArg_ParseTuple(args,"i",&epa))
|
||||
|
@ -351,9 +351,9 @@ static PyObject* gPySetUseEpa(PyObject* self,
|
|||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
static PyObject* gPySetSolverType(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPySetSolverType(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
int solverType;
|
||||
if (PyArg_ParseTuple(args,"i",&solverType))
|
||||
|
@ -371,9 +371,9 @@ static PyObject* gPySetSolverType(PyObject* self,
|
|||
|
||||
|
||||
|
||||
static PyObject* gPyGetVehicleConstraint(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPyGetVehicleConstraint(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
__int64 constraintid;
|
||||
|
@ -403,9 +403,9 @@ static PyObject* gPyGetVehicleConstraint(PyObject* self,
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPyCreateConstraint(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPyCreateConstraint(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
/* FIXME - physicsid is a long being cast to a pointer, should at least use PyCapsule */
|
||||
#if defined(_WIN64)
|
||||
|
@ -521,9 +521,9 @@ static PyObject* gPyCreateConstraint(PyObject* self,
|
|||
|
||||
|
||||
|
||||
static PyObject* gPyGetAppliedImpulse(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPyGetAppliedImpulse(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
float appliedImpulse = 0.f;
|
||||
|
||||
|
@ -548,9 +548,9 @@ static PyObject* gPyGetAppliedImpulse(PyObject* self,
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPyRemoveConstraint(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
static PyObject *gPyRemoveConstraint(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
__int64 constraintid;
|
||||
|
@ -572,7 +572,7 @@ static PyObject* gPyRemoveConstraint(PyObject* self,
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyExportBulletFile(PyObject*, PyObject* args)
|
||||
static PyObject *gPyExportBulletFile(PyObject *, PyObject *args)
|
||||
{
|
||||
char* filename;
|
||||
if (!PyArg_ParseTuple(args,"s:exportBulletFile",&filename))
|
||||
|
@ -655,13 +655,13 @@ static struct PyModuleDef PhysicsConstraints_module_def = {
|
|||
0, /* m_free */
|
||||
};
|
||||
|
||||
PyObject* initPythonConstraintBinding()
|
||||
PyObject *initPythonConstraintBinding()
|
||||
{
|
||||
|
||||
PyObject* ErrorObject;
|
||||
PyObject* m;
|
||||
PyObject* d;
|
||||
PyObject* item;
|
||||
PyObject *ErrorObject;
|
||||
PyObject *m;
|
||||
PyObject *d;
|
||||
PyObject *item;
|
||||
|
||||
/* Use existing module where possible
|
||||
* be careful not to init any runtime vars after this */
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "KX_Python.h"
|
||||
#include "KX_PyMath.h"
|
||||
|
||||
bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &rot, const char *error_prefix)
|
||||
bool PyOrientationTo(PyObject *pyval, MT_Matrix3x3 &rot, const char *error_prefix)
|
||||
{
|
||||
int size= PySequence_Size(pyval);
|
||||
|
||||
|
@ -80,7 +80,7 @@ bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &rot, const char *error_prefi
|
|||
return false;
|
||||
}
|
||||
|
||||
bool PyQuatTo(PyObject* pyval, MT_Quaternion &qrot)
|
||||
bool PyQuatTo(PyObject *pyval, MT_Quaternion &qrot)
|
||||
{
|
||||
if (!PyVecTo(pyval, qrot))
|
||||
return false;
|
||||
|
@ -95,7 +95,7 @@ bool PyQuatTo(PyObject* pyval, MT_Quaternion &qrot)
|
|||
return true;
|
||||
}
|
||||
|
||||
PyObject* PyObjectFrom(const MT_Matrix4x4 &mat)
|
||||
PyObject *PyObjectFrom(const MT_Matrix4x4 &mat)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
float fmat[16];
|
||||
|
@ -119,7 +119,7 @@ PyObject* PyObjectFrom(const MT_Matrix4x4 &mat)
|
|||
#endif
|
||||
}
|
||||
|
||||
PyObject* PyObjectFrom(const MT_Matrix3x3 &mat)
|
||||
PyObject *PyObjectFrom(const MT_Matrix3x3 &mat)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
float fmat[9];
|
||||
|
@ -143,7 +143,7 @@ PyObject* PyObjectFrom(const MT_Matrix3x3 &mat)
|
|||
}
|
||||
|
||||
#ifdef USE_MATHUTILS
|
||||
PyObject* PyObjectFrom(const MT_Quaternion &qrot)
|
||||
PyObject *PyObjectFrom(const MT_Quaternion &qrot)
|
||||
{
|
||||
/* NOTE, were re-ordering here for Mathutils compat */
|
||||
float fvec[4];
|
||||
|
@ -152,7 +152,7 @@ PyObject* PyObjectFrom(const MT_Quaternion &qrot)
|
|||
}
|
||||
#endif
|
||||
|
||||
PyObject* PyObjectFrom(const MT_Tuple4 &vec)
|
||||
PyObject *PyObjectFrom(const MT_Tuple4 &vec)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
float fvec[4];
|
||||
|
@ -168,7 +168,7 @@ PyObject* PyObjectFrom(const MT_Tuple4 &vec)
|
|||
#endif
|
||||
}
|
||||
|
||||
PyObject* PyObjectFrom(const MT_Tuple3 &vec)
|
||||
PyObject *PyObjectFrom(const MT_Tuple3 &vec)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
float fvec[3];
|
||||
|
@ -183,7 +183,7 @@ PyObject* PyObjectFrom(const MT_Tuple3 &vec)
|
|||
#endif
|
||||
}
|
||||
|
||||
PyObject* PyObjectFrom(const MT_Tuple2 &vec)
|
||||
PyObject *PyObjectFrom(const MT_Tuple2 &vec)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
float fvec[2];
|
||||
|
|
|
@ -61,7 +61,7 @@ inline unsigned int Size(const MT_Tuple4&) { return 4; }
|
|||
* Converts the given python matrix (column-major) to an MT class (row-major).
|
||||
*/
|
||||
template<class T>
|
||||
bool PyMatTo(PyObject* pymat, T& mat)
|
||||
bool PyMatTo(PyObject *pymat, T& mat)
|
||||
{
|
||||
bool noerror = true;
|
||||
mat.setIdentity();
|
||||
|
@ -133,7 +133,7 @@ bool PyMatTo(PyObject* pymat, T& mat)
|
|||
* Converts a python sequence to a MT class.
|
||||
*/
|
||||
template<class T>
|
||||
bool PyVecTo(PyObject* pyval, T& vec)
|
||||
bool PyVecTo(PyObject *pyval, T& vec)
|
||||
{
|
||||
#ifdef USE_MATHUTILS
|
||||
/* no need for BaseMath_ReadCallback() here, reading the sequences will do this */
|
||||
|
@ -235,41 +235,41 @@ bool PyVecTo(PyObject* pyval, T& vec)
|
|||
}
|
||||
|
||||
|
||||
bool PyQuatTo(PyObject* pyval, MT_Quaternion &qrot);
|
||||
bool PyQuatTo(PyObject *pyval, MT_Quaternion &qrot);
|
||||
|
||||
bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &mat, const char *error_prefix);
|
||||
bool PyOrientationTo(PyObject *pyval, MT_Matrix3x3 &mat, const char *error_prefix);
|
||||
|
||||
/**
|
||||
* Converts an MT_Matrix4x4 to a python object.
|
||||
*/
|
||||
PyObject* PyObjectFrom(const MT_Matrix4x4 &mat);
|
||||
PyObject *PyObjectFrom(const MT_Matrix4x4 &mat);
|
||||
|
||||
/**
|
||||
* Converts an MT_Matrix3x3 to a python object.
|
||||
*/
|
||||
PyObject* PyObjectFrom(const MT_Matrix3x3 &mat);
|
||||
PyObject *PyObjectFrom(const MT_Matrix3x3 &mat);
|
||||
|
||||
/**
|
||||
* Converts an MT_Tuple2 to a python object.
|
||||
*/
|
||||
PyObject* PyObjectFrom(const MT_Tuple2 &vec);
|
||||
PyObject *PyObjectFrom(const MT_Tuple2 &vec);
|
||||
|
||||
/**
|
||||
* Converts an MT_Tuple3 to a python object
|
||||
*/
|
||||
PyObject* PyObjectFrom(const MT_Tuple3 &vec);
|
||||
PyObject *PyObjectFrom(const MT_Tuple3 &vec);
|
||||
|
||||
#ifdef USE_MATHUTILS
|
||||
/**
|
||||
* Converts an MT_Quaternion to a python object.
|
||||
*/
|
||||
PyObject* PyObjectFrom(const MT_Quaternion &qrot);
|
||||
PyObject *PyObjectFrom(const MT_Quaternion &qrot);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Converts an MT_Tuple4 to a python object.
|
||||
*/
|
||||
PyObject* PyObjectFrom(const MT_Tuple4 &pos);
|
||||
PyObject *PyObjectFrom(const MT_Tuple4 &pos);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -210,15 +210,15 @@ static PyObject *gp_OrigPythonSysModules= NULL;
|
|||
#include "SCA_PythonController.h"
|
||||
// List of methods defined in the module
|
||||
|
||||
static PyObject* ErrorObject;
|
||||
static PyObject *ErrorObject;
|
||||
static const char *gPyGetRandomFloat_doc="getRandomFloat returns a random floating point value in the range [0..1]";
|
||||
|
||||
static PyObject* gPyGetRandomFloat(PyObject*)
|
||||
static PyObject *gPyGetRandomFloat(PyObject *)
|
||||
{
|
||||
return PyFloat_FromDouble(MT_random());
|
||||
}
|
||||
|
||||
static PyObject* gPySetGravity(PyObject*, PyObject* value)
|
||||
static PyObject *gPySetGravity(PyObject *, PyObject *value)
|
||||
{
|
||||
MT_Vector3 vec;
|
||||
if (!PyVecTo(value, vec))
|
||||
|
@ -240,7 +240,7 @@ file to make a full path name (doesn't change during the game, even if you load\
|
|||
other .blend).\n\
|
||||
The function also converts the directory separator to the local file system format.";
|
||||
|
||||
static PyObject* gPyExpandPath(PyObject*, PyObject* args)
|
||||
static PyObject *gPyExpandPath(PyObject *, PyObject *args)
|
||||
{
|
||||
char expanded[FILE_MAX];
|
||||
char* filename;
|
||||
|
@ -257,7 +257,7 @@ static char gPyStartGame_doc[] =
|
|||
"startGame(blend)\n\
|
||||
Loads the blend file";
|
||||
|
||||
static PyObject* gPyStartGame(PyObject*, PyObject* args)
|
||||
static PyObject *gPyStartGame(PyObject *, PyObject *args)
|
||||
{
|
||||
char* blendfile;
|
||||
|
||||
|
@ -274,7 +274,7 @@ static char gPyEndGame_doc[] =
|
|||
"endGame()\n\
|
||||
Ends the current game";
|
||||
|
||||
static PyObject* gPyEndGame(PyObject*)
|
||||
static PyObject *gPyEndGame(PyObject *)
|
||||
{
|
||||
gp_KetsjiEngine->RequestExit(KX_EXIT_REQUEST_QUIT_GAME);
|
||||
|
||||
|
@ -287,7 +287,7 @@ static char gPyRestartGame_doc[] =
|
|||
"restartGame()\n\
|
||||
Restarts the current game by reloading the .blend file";
|
||||
|
||||
static PyObject* gPyRestartGame(PyObject*)
|
||||
static PyObject *gPyRestartGame(PyObject *)
|
||||
{
|
||||
gp_KetsjiEngine->RequestExit(KX_EXIT_REQUEST_RESTART_GAME);
|
||||
gp_KetsjiEngine->SetNameNextGame(gp_GamePythonPath);
|
||||
|
@ -299,7 +299,7 @@ static char gPySaveGlobalDict_doc[] =
|
|||
"saveGlobalDict()\n"
|
||||
"Saves bge.logic.globalDict to a file";
|
||||
|
||||
static PyObject* gPySaveGlobalDict(PyObject*)
|
||||
static PyObject *gPySaveGlobalDict(PyObject *)
|
||||
{
|
||||
char marshal_path[512];
|
||||
char *marshal_buffer = NULL;
|
||||
|
@ -336,7 +336,7 @@ static char gPyLoadGlobalDict_doc[] =
|
|||
"LoadGlobalDict()\n"
|
||||
"Loads bge.logic.globalDict from a file";
|
||||
|
||||
static PyObject* gPyLoadGlobalDict(PyObject*)
|
||||
static PyObject *gPyLoadGlobalDict(PyObject *)
|
||||
{
|
||||
char marshal_path[512];
|
||||
char *marshal_buffer = NULL;
|
||||
|
@ -381,7 +381,7 @@ body = Message body\
|
|||
to = Name of object to send the message to\
|
||||
from = Name of object to send the string from";
|
||||
|
||||
static PyObject* gPySendMessage(PyObject*, PyObject* args)
|
||||
static PyObject *gPySendMessage(PyObject *, PyObject *args)
|
||||
{
|
||||
char* subject;
|
||||
char* body = (char *)"";
|
||||
|
@ -397,9 +397,9 @@ static PyObject* gPySendMessage(PyObject*, PyObject* args)
|
|||
}
|
||||
|
||||
// this gets a pointer to an array filled with floats
|
||||
static PyObject* gPyGetSpectrum(PyObject*)
|
||||
static PyObject *gPyGetSpectrum(PyObject *)
|
||||
{
|
||||
PyObject* resultlist = PyList_New(512);
|
||||
PyObject *resultlist = PyList_New(512);
|
||||
|
||||
for (int index = 0; index < 512; index++)
|
||||
{
|
||||
|
@ -409,7 +409,7 @@ static PyObject* gPyGetSpectrum(PyObject*)
|
|||
return resultlist;
|
||||
}
|
||||
|
||||
static PyObject* gPySetLogicTicRate(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetLogicTicRate(PyObject *, PyObject *args)
|
||||
{
|
||||
float ticrate;
|
||||
if (!PyArg_ParseTuple(args, "f:setLogicTicRate", &ticrate))
|
||||
|
@ -419,12 +419,12 @@ static PyObject* gPySetLogicTicRate(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyGetLogicTicRate(PyObject*)
|
||||
static PyObject *gPyGetLogicTicRate(PyObject *)
|
||||
{
|
||||
return PyFloat_FromDouble(KX_KetsjiEngine::GetTicRate());
|
||||
}
|
||||
|
||||
static PyObject* gPySetExitKey(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetExitKey(PyObject *, PyObject *args)
|
||||
{
|
||||
short exitkey;
|
||||
if (!PyArg_ParseTuple(args, "h:setExitKey", &exitkey))
|
||||
|
@ -433,12 +433,12 @@ static PyObject* gPySetExitKey(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyGetExitKey(PyObject*)
|
||||
static PyObject *gPyGetExitKey(PyObject *)
|
||||
{
|
||||
return PyLong_FromSsize_t(KX_KetsjiEngine::GetExitKey());
|
||||
}
|
||||
|
||||
static PyObject* gPySetMaxLogicFrame(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetMaxLogicFrame(PyObject *, PyObject *args)
|
||||
{
|
||||
int frame;
|
||||
if (!PyArg_ParseTuple(args, "i:setMaxLogicFrame", &frame))
|
||||
|
@ -448,12 +448,12 @@ static PyObject* gPySetMaxLogicFrame(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyGetMaxLogicFrame(PyObject*)
|
||||
static PyObject *gPyGetMaxLogicFrame(PyObject *)
|
||||
{
|
||||
return PyLong_FromSsize_t(KX_KetsjiEngine::GetMaxLogicFrame());
|
||||
}
|
||||
|
||||
static PyObject* gPySetMaxPhysicsFrame(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetMaxPhysicsFrame(PyObject *, PyObject *args)
|
||||
{
|
||||
int frame;
|
||||
if (!PyArg_ParseTuple(args, "i:setMaxPhysicsFrame", &frame))
|
||||
|
@ -463,12 +463,12 @@ static PyObject* gPySetMaxPhysicsFrame(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyGetMaxPhysicsFrame(PyObject*)
|
||||
static PyObject *gPyGetMaxPhysicsFrame(PyObject *)
|
||||
{
|
||||
return PyLong_FromSsize_t(KX_KetsjiEngine::GetMaxPhysicsFrame());
|
||||
}
|
||||
|
||||
static PyObject* gPySetPhysicsTicRate(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetPhysicsTicRate(PyObject *, PyObject *args)
|
||||
{
|
||||
float ticrate;
|
||||
if (!PyArg_ParseTuple(args, "f:setPhysicsTicRate", &ticrate))
|
||||
|
@ -478,7 +478,7 @@ static PyObject* gPySetPhysicsTicRate(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
#if 0 // unused
|
||||
static PyObject* gPySetPhysicsDebug(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetPhysicsDebug(PyObject *, PyObject *args)
|
||||
{
|
||||
int debugMode;
|
||||
if (!PyArg_ParseTuple(args, "i:setPhysicsDebug", &debugMode))
|
||||
|
@ -490,21 +490,21 @@ static PyObject* gPySetPhysicsDebug(PyObject*, PyObject* args)
|
|||
#endif
|
||||
|
||||
|
||||
static PyObject* gPyGetPhysicsTicRate(PyObject*)
|
||||
static PyObject *gPyGetPhysicsTicRate(PyObject *)
|
||||
{
|
||||
return PyFloat_FromDouble(PHY_GetActiveEnvironment()->getFixedTimeStep());
|
||||
}
|
||||
|
||||
static PyObject* gPyGetAverageFrameRate(PyObject*)
|
||||
static PyObject *gPyGetAverageFrameRate(PyObject *)
|
||||
{
|
||||
return PyFloat_FromDouble(KX_KetsjiEngine::GetAverageFrameRate());
|
||||
}
|
||||
|
||||
static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
|
||||
static PyObject *gPyGetBlendFileList(PyObject *, PyObject *args)
|
||||
{
|
||||
char cpath[sizeof(gp_GamePythonPath)];
|
||||
char *searchpath = NULL;
|
||||
PyObject* list, *value;
|
||||
PyObject *list, *value;
|
||||
|
||||
DIR *dp;
|
||||
struct dirent *dirp;
|
||||
|
@ -545,7 +545,7 @@ static char gPyAddScene_doc[] =
|
|||
adds a scene to the game engine\n\
|
||||
name = Name of the scene\n\
|
||||
overlay = Overlay or underlay";
|
||||
static PyObject* gPyAddScene(PyObject*, PyObject* args)
|
||||
static PyObject *gPyAddScene(PyObject *, PyObject *args)
|
||||
{
|
||||
char* name;
|
||||
int overlay = 1;
|
||||
|
@ -561,7 +561,7 @@ static PyObject* gPyAddScene(PyObject*, PyObject* args)
|
|||
static const char *gPyGetCurrentScene_doc =
|
||||
"getCurrentScene()\n"
|
||||
"Gets a reference to the current scene.\n";
|
||||
static PyObject* gPyGetCurrentScene(PyObject* self)
|
||||
static PyObject *gPyGetCurrentScene(PyObject *self)
|
||||
{
|
||||
return gp_KetsjiScene->GetProxy();
|
||||
}
|
||||
|
@ -569,10 +569,10 @@ static PyObject* gPyGetCurrentScene(PyObject* self)
|
|||
static const char *gPyGetSceneList_doc =
|
||||
"getSceneList()\n"
|
||||
"Return a list of converted scenes.\n";
|
||||
static PyObject* gPyGetSceneList(PyObject* self)
|
||||
static PyObject *gPyGetSceneList(PyObject *self)
|
||||
{
|
||||
KX_KetsjiEngine* m_engine = KX_GetActiveEngine();
|
||||
PyObject* list;
|
||||
PyObject *list;
|
||||
KX_SceneList* scenes = m_engine->CurrentScenes();
|
||||
int numScenes = scenes->size();
|
||||
int i;
|
||||
|
@ -665,7 +665,7 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject *gLibLoad(PyObject*, PyObject* args, PyObject* kwds)
|
||||
static PyObject *gLibLoad(PyObject *, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
KX_Scene *kx_scene= gp_KetsjiScene;
|
||||
char *path;
|
||||
|
@ -721,7 +721,7 @@ static PyObject *gLibLoad(PyObject*, PyObject* args, PyObject* kwds)
|
|||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static PyObject *gLibNew(PyObject*, PyObject* args)
|
||||
static PyObject *gLibNew(PyObject *, PyObject *args)
|
||||
{
|
||||
KX_Scene *kx_scene= gp_KetsjiScene;
|
||||
char *path;
|
||||
|
@ -779,7 +779,7 @@ static PyObject *gLibNew(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject *gLibFree(PyObject*, PyObject* args)
|
||||
static PyObject *gLibFree(PyObject *, PyObject *args)
|
||||
{
|
||||
KX_Scene *kx_scene= gp_KetsjiScene;
|
||||
char *path;
|
||||
|
@ -796,7 +796,7 @@ static PyObject *gLibFree(PyObject*, PyObject* args)
|
|||
}
|
||||
}
|
||||
|
||||
static PyObject *gLibList(PyObject*, PyObject* args)
|
||||
static PyObject *gLibList(PyObject *, PyObject *args)
|
||||
{
|
||||
vector<Main*> &dynMaggie = gp_KetsjiScene->GetSceneConverter()->GetMainDynamic();
|
||||
int i= 0;
|
||||
|
@ -866,14 +866,14 @@ static struct PyMethodDef game_methods[] = {
|
|||
{NULL, (PyCFunction) NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static PyObject* gPyGetWindowHeight(PyObject*, PyObject* args)
|
||||
static PyObject *gPyGetWindowHeight(PyObject *, PyObject *args)
|
||||
{
|
||||
return PyLong_FromSsize_t((gp_Canvas ? gp_Canvas->GetHeight() : 0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
static PyObject* gPyGetWindowWidth(PyObject*, PyObject* args)
|
||||
static PyObject *gPyGetWindowWidth(PyObject *, PyObject *args)
|
||||
{
|
||||
return PyLong_FromSsize_t((gp_Canvas ? gp_Canvas->GetWidth() : 0));
|
||||
}
|
||||
|
@ -883,7 +883,7 @@ static PyObject* gPyGetWindowWidth(PyObject*, PyObject* args)
|
|||
// temporarility visibility thing, will be moved to rasterizer/renderer later
|
||||
bool gUseVisibilityTemp = false;
|
||||
|
||||
static PyObject* gPyEnableVisibility(PyObject*, PyObject* args)
|
||||
static PyObject *gPyEnableVisibility(PyObject *, PyObject *args)
|
||||
{
|
||||
int visible;
|
||||
if (!PyArg_ParseTuple(args,"i:enableVisibility",&visible))
|
||||
|
@ -895,7 +895,7 @@ static PyObject* gPyEnableVisibility(PyObject*, PyObject* args)
|
|||
|
||||
|
||||
|
||||
static PyObject* gPyShowMouse(PyObject*, PyObject* args)
|
||||
static PyObject *gPyShowMouse(PyObject *, PyObject *args)
|
||||
{
|
||||
int visible;
|
||||
if (!PyArg_ParseTuple(args,"i:showMouse",&visible))
|
||||
|
@ -916,7 +916,7 @@ static PyObject* gPyShowMouse(PyObject*, PyObject* args)
|
|||
|
||||
|
||||
|
||||
static PyObject* gPySetMousePosition(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetMousePosition(PyObject *, PyObject *args)
|
||||
{
|
||||
int x,y;
|
||||
if (!PyArg_ParseTuple(args,"ii:setMousePosition",&x,&y))
|
||||
|
@ -928,7 +928,7 @@ static PyObject* gPySetMousePosition(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPySetEyeSeparation(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetEyeSeparation(PyObject *, PyObject *args)
|
||||
{
|
||||
float sep;
|
||||
if (!PyArg_ParseTuple(args, "f:setEyeSeparation", &sep))
|
||||
|
@ -944,7 +944,7 @@ static PyObject* gPySetEyeSeparation(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyGetEyeSeparation(PyObject*)
|
||||
static PyObject *gPyGetEyeSeparation(PyObject *)
|
||||
{
|
||||
if (!gp_Rasterizer) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Rasterizer.getEyeSeparation(), Rasterizer not available");
|
||||
|
@ -954,7 +954,7 @@ static PyObject* gPyGetEyeSeparation(PyObject*)
|
|||
return PyFloat_FromDouble(gp_Rasterizer->GetEyeSeparation());
|
||||
}
|
||||
|
||||
static PyObject* gPySetFocalLength(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetFocalLength(PyObject *, PyObject *args)
|
||||
{
|
||||
float focus;
|
||||
if (!PyArg_ParseTuple(args, "f:setFocalLength", &focus))
|
||||
|
@ -970,7 +970,7 @@ static PyObject* gPySetFocalLength(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyGetFocalLength(PyObject*, PyObject*, PyObject*)
|
||||
static PyObject *gPyGetFocalLength(PyObject *, PyObject *, PyObject *)
|
||||
{
|
||||
if (!gp_Rasterizer) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Rasterizer.getFocalLength(), Rasterizer not available");
|
||||
|
@ -982,7 +982,7 @@ static PyObject* gPyGetFocalLength(PyObject*, PyObject*, PyObject*)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPySetBackgroundColor(PyObject*, PyObject* value)
|
||||
static PyObject *gPySetBackgroundColor(PyObject *, PyObject *value)
|
||||
{
|
||||
|
||||
MT_Vector4 vec;
|
||||
|
@ -1003,7 +1003,7 @@ static PyObject* gPySetBackgroundColor(PyObject*, PyObject* value)
|
|||
|
||||
|
||||
|
||||
static PyObject* gPySetMistColor(PyObject*, PyObject* value)
|
||||
static PyObject *gPySetMistColor(PyObject *, PyObject *value)
|
||||
{
|
||||
|
||||
MT_Vector3 vec;
|
||||
|
@ -1019,7 +1019,7 @@ static PyObject* gPySetMistColor(PyObject*, PyObject* value)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyDisableMist(PyObject*)
|
||||
static PyObject *gPyDisableMist(PyObject *)
|
||||
{
|
||||
|
||||
if (!gp_Rasterizer) {
|
||||
|
@ -1031,7 +1031,7 @@ static PyObject* gPyDisableMist(PyObject*)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPySetMistStart(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetMistStart(PyObject *, PyObject *args)
|
||||
{
|
||||
|
||||
float miststart;
|
||||
|
@ -1050,7 +1050,7 @@ static PyObject* gPySetMistStart(PyObject*, PyObject* args)
|
|||
|
||||
|
||||
|
||||
static PyObject* gPySetMistEnd(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetMistEnd(PyObject *, PyObject *args)
|
||||
{
|
||||
|
||||
float mistend;
|
||||
|
@ -1068,7 +1068,7 @@ static PyObject* gPySetMistEnd(PyObject*, PyObject* args)
|
|||
}
|
||||
|
||||
|
||||
static PyObject* gPySetAmbientColor(PyObject*, PyObject* value)
|
||||
static PyObject *gPySetAmbientColor(PyObject *, PyObject *value)
|
||||
{
|
||||
|
||||
MT_Vector3 vec;
|
||||
|
@ -1087,7 +1087,7 @@ static PyObject* gPySetAmbientColor(PyObject*, PyObject* value)
|
|||
|
||||
|
||||
|
||||
static PyObject* gPyMakeScreenshot(PyObject*, PyObject* args)
|
||||
static PyObject *gPyMakeScreenshot(PyObject *, PyObject *args)
|
||||
{
|
||||
char* filename;
|
||||
if (!PyArg_ParseTuple(args,"s:makeScreenshot",&filename))
|
||||
|
@ -1101,7 +1101,7 @@ static PyObject* gPyMakeScreenshot(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyEnableMotionBlur(PyObject*, PyObject* args)
|
||||
static PyObject *gPyEnableMotionBlur(PyObject *, PyObject *args)
|
||||
{
|
||||
float motionblurvalue;
|
||||
if (!PyArg_ParseTuple(args,"f:enableMotionBlur",&motionblurvalue))
|
||||
|
@ -1117,7 +1117,7 @@ static PyObject* gPyEnableMotionBlur(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyDisableMotionBlur(PyObject*)
|
||||
static PyObject *gPyDisableMotionBlur(PyObject *)
|
||||
{
|
||||
if (!gp_Rasterizer) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Rasterizer.disableMotionBlur(), Rasterizer not available");
|
||||
|
@ -1147,9 +1147,9 @@ static int getGLSLSettingFlag(const char *setting)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static PyObject* gPySetGLSLMaterialSetting(PyObject*,
|
||||
PyObject* args,
|
||||
PyObject*)
|
||||
static PyObject *gPySetGLSLMaterialSetting(PyObject *,
|
||||
PyObject *args,
|
||||
PyObject *)
|
||||
{
|
||||
GlobalSettings *gs= gp_KetsjiEngine->GetGlobalSettings();
|
||||
char *setting;
|
||||
|
@ -1190,9 +1190,9 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*,
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyGetGLSLMaterialSetting(PyObject*,
|
||||
PyObject* args,
|
||||
PyObject*)
|
||||
static PyObject *gPyGetGLSLMaterialSetting(PyObject *,
|
||||
PyObject *args,
|
||||
PyObject *)
|
||||
{
|
||||
GlobalSettings *gs= gp_KetsjiEngine->GetGlobalSettings();
|
||||
char *setting;
|
||||
|
@ -1216,9 +1216,9 @@ static PyObject* gPyGetGLSLMaterialSetting(PyObject*,
|
|||
#define KX_BLENDER_MULTITEX_MATERIAL 1
|
||||
#define KX_BLENDER_GLSL_MATERIAL 2
|
||||
|
||||
static PyObject* gPySetMaterialType(PyObject*,
|
||||
PyObject* args,
|
||||
PyObject*)
|
||||
static PyObject *gPySetMaterialType(PyObject *,
|
||||
PyObject *args,
|
||||
PyObject *)
|
||||
{
|
||||
GlobalSettings *gs= gp_KetsjiEngine->GetGlobalSettings();
|
||||
int type;
|
||||
|
@ -1240,7 +1240,7 @@ static PyObject* gPySetMaterialType(PyObject*,
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyGetMaterialType(PyObject*)
|
||||
static PyObject *gPyGetMaterialType(PyObject *)
|
||||
{
|
||||
GlobalSettings *gs= gp_KetsjiEngine->GetGlobalSettings();
|
||||
int flag;
|
||||
|
@ -1255,7 +1255,7 @@ static PyObject* gPyGetMaterialType(PyObject*)
|
|||
return PyLong_FromSsize_t(flag);
|
||||
}
|
||||
|
||||
static PyObject* gPySetAnisotropicFiltering(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetAnisotropicFiltering(PyObject *, PyObject *args)
|
||||
{
|
||||
short level;
|
||||
|
||||
|
@ -1272,16 +1272,16 @@ static PyObject* gPySetAnisotropicFiltering(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPyGetAnisotropicFiltering(PyObject*, PyObject* args)
|
||||
static PyObject *gPyGetAnisotropicFiltering(PyObject *, PyObject *args)
|
||||
{
|
||||
return PyLong_FromLong(gp_Rasterizer->GetAnisotropicFiltering());
|
||||
}
|
||||
|
||||
static PyObject* gPyDrawLine(PyObject*, PyObject* args)
|
||||
static PyObject *gPyDrawLine(PyObject *, PyObject *args)
|
||||
{
|
||||
PyObject* ob_from;
|
||||
PyObject* ob_to;
|
||||
PyObject* ob_color;
|
||||
PyObject *ob_from;
|
||||
PyObject *ob_to;
|
||||
PyObject *ob_color;
|
||||
|
||||
if (!gp_Rasterizer) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Rasterizer.drawLine(obFrom, obTo, color): Rasterizer not available");
|
||||
|
@ -1306,7 +1306,7 @@ static PyObject* gPyDrawLine(PyObject*, PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject* gPySetWindowSize(PyObject*, PyObject* args)
|
||||
static PyObject *gPySetWindowSize(PyObject *, PyObject *args)
|
||||
{
|
||||
int width, height;
|
||||
if (!PyArg_ParseTuple(args, "ii:resize", &width, &height))
|
||||
|
@ -1383,11 +1383,11 @@ static struct PyModuleDef GameLogic_module_def = {
|
|||
0, /* m_free */
|
||||
};
|
||||
|
||||
PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack to get gravity hook
|
||||
PyObject *initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack to get gravity hook
|
||||
{
|
||||
PyObject* m;
|
||||
PyObject* d;
|
||||
PyObject* item; /* temp PyObject* storage */
|
||||
PyObject *m;
|
||||
PyObject *d;
|
||||
PyObject *item; /* temp PyObject *storage */
|
||||
|
||||
gp_KetsjiEngine = engine;
|
||||
gp_KetsjiScene = scene;
|
||||
|
@ -1862,7 +1862,7 @@ static struct _inittab bge_internal_modules[]= {
|
|||
* Python is not initialized.
|
||||
* see bpy_interface.c's BPY_python_start() which shares the same functionality in blender.
|
||||
*/
|
||||
PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie, int argc, char** argv)
|
||||
PyObject *initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie, int argc, char** argv)
|
||||
{
|
||||
/* Yet another gotcha in the py api
|
||||
* Cant run PySys_SetArgv more then once because this adds the
|
||||
|
@ -1956,7 +1956,7 @@ void exitGamePlayerPythonScripting()
|
|||
/**
|
||||
* Python is already initialized.
|
||||
*/
|
||||
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie)
|
||||
PyObject *initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie)
|
||||
{
|
||||
#if 0 // XXX TODO Py3
|
||||
STR_String pname = progname;
|
||||
|
@ -1998,9 +1998,10 @@ void exitGamePythonScripting()
|
|||
|
||||
/* similar to the above functions except it sets up the namespace
|
||||
* and other more general things */
|
||||
void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main *blenderdata, PyObject * pyGlobalDict, PyObject **gameLogic, PyObject **gameLogic_keys, int argc, char** argv)
|
||||
void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene *startscene, Main *blenderdata,
|
||||
PyObject *pyGlobalDict, PyObject **gameLogic, PyObject **gameLogic_keys, int argc, char** argv)
|
||||
{
|
||||
PyObject* dictionaryobject;
|
||||
PyObject *dictionaryobject;
|
||||
|
||||
if (argv) /* player only */
|
||||
dictionaryobject= initGamePlayerPythonScripting("Ketsji", psl_Lowest, blenderdata, argc, argv);
|
||||
|
@ -2053,15 +2054,15 @@ static struct PyModuleDef Rasterizer_module_def = {
|
|||
0, /* m_free */
|
||||
};
|
||||
|
||||
PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas)
|
||||
PyObject *initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas)
|
||||
{
|
||||
gp_Canvas = canvas;
|
||||
gp_Rasterizer = rasty;
|
||||
|
||||
|
||||
PyObject* m;
|
||||
PyObject* d;
|
||||
PyObject* item;
|
||||
PyObject *m;
|
||||
PyObject *d;
|
||||
PyObject *item;
|
||||
|
||||
/* Use existing module where possible
|
||||
* be careful not to init any runtime vars after this */
|
||||
|
@ -2114,9 +2115,9 @@ static char gPyEventToString_doc[] =
|
|||
"EventToString(event) - Take a valid event from the GameKeys module or Keyboard Sensor and return a name"
|
||||
;
|
||||
|
||||
static PyObject* gPyEventToString(PyObject*, PyObject* value)
|
||||
static PyObject *gPyEventToString(PyObject *, PyObject *value)
|
||||
{
|
||||
PyObject* mod, *dict, *key, *val, *ret = NULL;
|
||||
PyObject *mod, *dict, *key, *val, *ret = NULL;
|
||||
Py_ssize_t pos = 0;
|
||||
|
||||
mod = PyImport_ImportModule( "GameKeys" );
|
||||
|
@ -2144,7 +2145,7 @@ static char gPyEventToCharacter_doc[] =
|
|||
"EventToCharacter(event, is_shift) - Take a valid event from the GameKeys module or Keyboard Sensor and return a character"
|
||||
;
|
||||
|
||||
static PyObject* gPyEventToCharacter(PyObject*, PyObject* args)
|
||||
static PyObject *gPyEventToCharacter(PyObject *, PyObject *args)
|
||||
{
|
||||
int event, shift;
|
||||
if (!PyArg_ParseTuple(args,"ii:EventToCharacter", &event, &shift))
|
||||
|
@ -2179,11 +2180,11 @@ static struct PyModuleDef GameKeys_module_def = {
|
|||
0, /* m_free */
|
||||
};
|
||||
|
||||
PyObject* initGameKeys()
|
||||
PyObject *initGameKeys()
|
||||
{
|
||||
PyObject* m;
|
||||
PyObject* d;
|
||||
PyObject* item;
|
||||
PyObject *m;
|
||||
PyObject *d;
|
||||
PyObject *item;
|
||||
|
||||
/* Use existing module where possible */
|
||||
m = PyImport_ImportModule( "GameKeys" );
|
||||
|
@ -2347,14 +2348,14 @@ PyObject* initGameKeys()
|
|||
int saveGamePythonConfig( char **marshal_buffer)
|
||||
{
|
||||
int marshal_length = 0;
|
||||
PyObject* gameLogic = PyImport_ImportModule("GameLogic");
|
||||
PyObject *gameLogic = PyImport_ImportModule("GameLogic");
|
||||
if (gameLogic) {
|
||||
PyObject* pyGlobalDict = PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as importing the module
|
||||
PyObject *pyGlobalDict = PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as importing the module
|
||||
if (pyGlobalDict) {
|
||||
#ifdef Py_MARSHAL_VERSION
|
||||
PyObject* pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict, 2); // Py_MARSHAL_VERSION == 2 as of Py2.5
|
||||
PyObject *pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict, 2); // Py_MARSHAL_VERSION == 2 as of Py2.5
|
||||
#else
|
||||
PyObject* pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict );
|
||||
PyObject *pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict );
|
||||
#endif
|
||||
if (pyGlobalDictMarshal) {
|
||||
// for testing only
|
||||
|
@ -2384,12 +2385,12 @@ int loadGamePythonConfig(char *marshal_buffer, int marshal_length)
|
|||
{
|
||||
/* Restore the dict */
|
||||
if (marshal_buffer) {
|
||||
PyObject* gameLogic = PyImport_ImportModule("GameLogic");
|
||||
PyObject *gameLogic = PyImport_ImportModule("GameLogic");
|
||||
|
||||
if (gameLogic) {
|
||||
PyObject* pyGlobalDict = PyMarshal_ReadObjectFromString(marshal_buffer, marshal_length);
|
||||
PyObject *pyGlobalDict = PyMarshal_ReadObjectFromString(marshal_buffer, marshal_length);
|
||||
if (pyGlobalDict) {
|
||||
PyObject* pyGlobalDict_orig = PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as importing the module.
|
||||
PyObject *pyGlobalDict_orig = PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as importing the module.
|
||||
if (pyGlobalDict_orig) {
|
||||
PyDict_Clear(pyGlobalDict_orig);
|
||||
PyDict_Update(pyGlobalDict_orig, pyGlobalDict);
|
||||
|
@ -2405,7 +2406,8 @@ int loadGamePythonConfig(char *marshal_buffer, int marshal_length)
|
|||
PyErr_Clear();
|
||||
printf("Error could not marshall string\n");
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
PyErr_Clear();
|
||||
printf("Error, bge.logic failed to import bge.logic.globalDict will be lost\n");
|
||||
}
|
||||
|
|
|
@ -52,7 +52,8 @@ void exitGamePlayerPythonScripting();
|
|||
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level, struct Main *maggie);
|
||||
void exitGamePythonScripting();
|
||||
|
||||
void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main *blenderdata, PyObject *pyGlobalDict, PyObject **gameLogic, PyObject **gameLogic_keys, int argc, char** argv);
|
||||
void setupGamePython(KX_KetsjiEngine *ketsjiengine, KX_Scene *startscene, Main *blenderdata,
|
||||
PyObject *pyGlobalDict, PyObject **gameLogic, PyObject **gameLogic_keys, int argc, char** argv);
|
||||
|
||||
void setGamePythonPath(const char *path);
|
||||
void resetGamePythonPath();
|
||||
|
@ -72,10 +73,11 @@ class KX_Scene* KX_GetActiveScene();
|
|||
class KX_KetsjiEngine* KX_GetActiveEngine();
|
||||
|
||||
typedef int (*PyNextFrameFunc)(void *);
|
||||
|
||||
struct PyNextFrameState {
|
||||
//state: can be either a GPG_NextFrameState or a BL_KetsjiNextFrameState
|
||||
/** can be either a GPG_NextFrameState or a BL_KetsjiNextFrameState */
|
||||
void *state;
|
||||
//func: can be either GPG_PyNextFrame or BL_KetsjiPyNextFrame
|
||||
/** can be either GPG_PyNextFrame or BL_KetsjiPyNextFrame */
|
||||
PyNextFrameFunc func;
|
||||
};
|
||||
extern struct PyNextFrameState pynextframestate;
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
* \ingroup ketsji
|
||||
*/
|
||||
|
||||
#ifndef _adr_py_init_types_h_ // only process once,
|
||||
#define _adr_py_init_types_h_ // even if multiply included
|
||||
#ifndef __KX_PYTHON_INIT_TYPES__
|
||||
#define __KX_PYTHON_INIT_TYPES__
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
void initPyTypes(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* __KX_PYTHON_INIT_TYPES__ */
|
||||
|
|
|
@ -69,7 +69,7 @@ static void KX_PythonSeq_dealloc(KX_PythonSeq * self)
|
|||
PyObject_GC_Del(self);
|
||||
}
|
||||
|
||||
static Py_ssize_t KX_PythonSeq_len( PyObject * self )
|
||||
static Py_ssize_t KX_PythonSeq_len( PyObject *self )
|
||||
{
|
||||
PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base);
|
||||
|
||||
|
@ -100,7 +100,7 @@ static Py_ssize_t KX_PythonSeq_len( PyObject * self )
|
|||
}
|
||||
}
|
||||
|
||||
static PyObject *KX_PythonSeq_getIndex(PyObject* self, int index)
|
||||
static PyObject *KX_PythonSeq_getIndex(PyObject *self, int index)
|
||||
{
|
||||
PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base);
|
||||
|
||||
|
@ -264,7 +264,7 @@ static PyObjectPlus * KX_PythonSeq_subscript__internal(PyObject *self, const cha
|
|||
}
|
||||
|
||||
|
||||
static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key)
|
||||
static PyObject * KX_PythonSeq_subscript(PyObject *self, PyObject *key)
|
||||
{
|
||||
PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base);
|
||||
|
||||
|
@ -314,10 +314,10 @@ static int KX_PythonSeq_contains(PyObject *self, PyObject *key)
|
|||
}
|
||||
|
||||
/* Matches python dict.get(key, [default]) */
|
||||
static PyObject* KX_PythonSeq_get(PyObject * self, PyObject *args)
|
||||
static PyObject *KX_PythonSeq_get(PyObject *self, PyObject *args)
|
||||
{
|
||||
char *key;
|
||||
PyObject* def = Py_None;
|
||||
PyObject *def = Py_None;
|
||||
PyObjectPlus* ret_plus;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s|O:get", &key, &def))
|
||||
|
|
|
@ -217,7 +217,7 @@ PyAttributeDef KX_RadarSensor::Attributes[] = {
|
|||
{NULL} //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_RadarSensor::pyattr_get_angle(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_RadarSensor::pyattr_get_angle(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_RadarSensor* self= static_cast<KX_RadarSensor*>(self_v);
|
||||
|
||||
|
|
|
@ -361,7 +361,7 @@ PyAttributeDef KX_RaySensor::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_RaySensor::pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_RaySensor::pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_RaySensor* self = static_cast<KX_RaySensor*>(self_v);
|
||||
if (self->m_hitObject)
|
||||
|
|
|
@ -94,7 +94,7 @@ public:
|
|||
#ifdef WITH_PYTHON
|
||||
|
||||
/* Attributes */
|
||||
static PyObject* pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ PyAttributeDef KX_SCA_AddObjectActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SCA_AddObjectActuator::pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SCA_AddObjectActuator* actuator = static_cast<KX_SCA_AddObjectActuator*>(self);
|
||||
if (!actuator->m_OriginalObject)
|
||||
|
@ -231,7 +231,7 @@ int KX_SCA_AddObjectActuator::pyattr_set_object(void *self, const struct KX_PYAT
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SCA_AddObjectActuator* actuator = static_cast<KX_SCA_AddObjectActuator*>(self);
|
||||
if (!actuator->m_lastCreatedObject)
|
||||
|
@ -240,7 +240,7 @@ PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, con
|
|||
return actuator->m_lastCreatedObject->GetProxy();
|
||||
}
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject()
|
||||
PyObject *KX_SCA_AddObjectActuator::PyInstantAddObject()
|
||||
{
|
||||
InstantAddObject();
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
virtual bool
|
||||
Update();
|
||||
|
||||
SCA_IObject*
|
||||
SCA_IObject *
|
||||
GetLastCreatedObject(
|
||||
) const;
|
||||
|
||||
|
@ -122,9 +122,9 @@ public:
|
|||
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,InstantAddObject);
|
||||
|
||||
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
static PyObject* pyattr_get_objectLastCreated(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_objectLastCreated(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ PyAttributeDef KX_SCA_ReplaceMeshActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_SCA_ReplaceMeshActuator::pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SCA_ReplaceMeshActuator::pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SCA_ReplaceMeshActuator* actuator = static_cast<KX_SCA_ReplaceMeshActuator*>(self);
|
||||
if (!actuator->m_mesh)
|
||||
|
|
|
@ -84,7 +84,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator
|
|||
m_scene= val;
|
||||
};
|
||||
|
||||
static PyObject* pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,instantReplaceMesh);
|
||||
|
|
|
@ -1634,12 +1634,13 @@ void KX_Scene::UpdateObjectActivity(void)
|
|||
* Manhattan distance. */
|
||||
MT_Point3 obpos = ob->NodeGetWorldPosition();
|
||||
|
||||
if ( (fabs(camloc[0] - obpos[0]) > m_activity_box_radius)
|
||||
|| (fabs(camloc[1] - obpos[1]) > m_activity_box_radius)
|
||||
|| (fabs(camloc[2] - obpos[2]) > m_activity_box_radius) )
|
||||
if ((fabs(camloc[0] - obpos[0]) > m_activity_box_radius) ||
|
||||
(fabs(camloc[1] - obpos[1]) > m_activity_box_radius) ||
|
||||
(fabs(camloc[2] - obpos[2]) > m_activity_box_radius) )
|
||||
{
|
||||
ob->Suspend();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ob->Resume();
|
||||
}
|
||||
}
|
||||
|
@ -1944,15 +1945,15 @@ void KX_Scene::Render2DFilters(RAS_ICanvas* canvas)
|
|||
|
||||
#ifdef WITH_PYTHON
|
||||
|
||||
void KX_Scene::RunDrawingCallbacks(PyObject* cb_list)
|
||||
void KX_Scene::RunDrawingCallbacks(PyObject *cb_list)
|
||||
{
|
||||
Py_ssize_t len;
|
||||
|
||||
if (cb_list && (len=PyList_GET_SIZE(cb_list)))
|
||||
{
|
||||
PyObject* args= PyTuple_New(0); // save python creating each call
|
||||
PyObject* func;
|
||||
PyObject* ret;
|
||||
PyObject *args = PyTuple_New(0); // save python creating each call
|
||||
PyObject *func;
|
||||
PyObject *ret;
|
||||
|
||||
// Iterate the list and run the callbacks
|
||||
for (Py_ssize_t pos=0; pos < len; pos++)
|
||||
|
@ -2019,7 +2020,7 @@ static PyObject *Map_GetItem(PyObject *self_v, PyObject *item)
|
|||
{
|
||||
KX_Scene* self= static_cast<KX_Scene*>BGE_PROXY_REF(self_v);
|
||||
const char *attr_str= _PyUnicode_AsString(item);
|
||||
PyObject* pyconvert;
|
||||
PyObject *pyconvert;
|
||||
|
||||
if (self==NULL) {
|
||||
PyErr_SetString(PyExc_SystemError, "val = scene[key]: KX_Scene, "BGE_PROXY_ERROR_MSG);
|
||||
|
@ -2122,31 +2123,31 @@ PySequenceMethods KX_Scene::Sequence = {
|
|||
(ssizeargfunc) NULL, /* sq_inplace_repeat */
|
||||
};
|
||||
|
||||
PyObject* KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Scene* self= static_cast<KX_Scene*>(self_v);
|
||||
return PyUnicode_From_STR_String(self->GetName());
|
||||
}
|
||||
|
||||
PyObject* KX_Scene::pyattr_get_objects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Scene::pyattr_get_objects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Scene* self= static_cast<KX_Scene*>(self_v);
|
||||
return self->GetObjectList()->GetProxy();
|
||||
}
|
||||
|
||||
PyObject* KX_Scene::pyattr_get_objects_inactive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Scene::pyattr_get_objects_inactive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Scene* self= static_cast<KX_Scene*>(self_v);
|
||||
return self->GetInactiveList()->GetProxy();
|
||||
}
|
||||
|
||||
PyObject* KX_Scene::pyattr_get_lights(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Scene::pyattr_get_lights(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Scene* self= static_cast<KX_Scene*>(self_v);
|
||||
return self->GetLightList()->GetProxy();
|
||||
}
|
||||
|
||||
PyObject* KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
/* With refcounts in this case...
|
||||
* the new CListValue is owned by python, so its possible python holds onto it longer then the BGE
|
||||
|
@ -2167,7 +2168,7 @@ PyObject* KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *a
|
|||
return clist->NewProxy(true);
|
||||
}
|
||||
|
||||
PyObject* KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Scene* self= static_cast<KX_Scene*>(self_v);
|
||||
KX_Camera* cam= self->GetActiveCamera();
|
||||
|
@ -2190,7 +2191,7 @@ int KX_Scene::pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *a
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_Scene::pyattr_get_drawing_callback_pre(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Scene::pyattr_get_drawing_callback_pre(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Scene* self = static_cast<KX_Scene*>(self_v);
|
||||
|
||||
|
@ -2200,7 +2201,7 @@ PyObject* KX_Scene::pyattr_get_drawing_callback_pre(void *self_v, const KX_PYATT
|
|||
return self->m_draw_call_pre;
|
||||
}
|
||||
|
||||
PyObject* KX_Scene::pyattr_get_drawing_callback_post(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_Scene::pyattr_get_drawing_callback_post(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_Scene* self = static_cast<KX_Scene*>(self_v);
|
||||
|
||||
|
@ -2354,8 +2355,8 @@ KX_PYMETHODDEF_DOC(KX_Scene, drawObstacleSimulation,
|
|||
KX_PYMETHODDEF_DOC(KX_Scene, get, "")
|
||||
{
|
||||
PyObject *key;
|
||||
PyObject* def = Py_None;
|
||||
PyObject* ret;
|
||||
PyObject *def = Py_None;
|
||||
PyObject *ret;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O|O:get", &key, &def))
|
||||
return NULL;
|
||||
|
|
|
@ -373,11 +373,11 @@ public:
|
|||
GetLightList(
|
||||
);
|
||||
|
||||
SCA_LogicManager*
|
||||
SCA_LogicManager *
|
||||
GetLogicManager(
|
||||
);
|
||||
|
||||
SCA_TimeEventManager*
|
||||
SCA_TimeEventManager *
|
||||
GetTimeEventManager(
|
||||
);
|
||||
|
||||
|
@ -617,7 +617,7 @@ public:
|
|||
static PyObject* pyattr_get_drawing_callback_post(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_drawing_callback_post(void *selv_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
virtual PyObject* py_repr(void) { return PyUnicode_From_STR_String(GetName()); }
|
||||
virtual PyObject *py_repr(void) { return PyUnicode_From_STR_String(GetName()); }
|
||||
|
||||
/* getitem/setitem */
|
||||
static PyMappingMethods Mapping;
|
||||
|
@ -626,10 +626,10 @@ public:
|
|||
/**
|
||||
* Run the registered python drawing functions.
|
||||
*/
|
||||
void RunDrawingCallbacks(PyObject* cb_list);
|
||||
void RunDrawingCallbacks(PyObject *cb_list);
|
||||
|
||||
PyObject* GetPreDrawCB() { return m_draw_call_pre; }
|
||||
PyObject* GetPostDrawCB() { return m_draw_call_post; }
|
||||
PyObject *GetPreDrawCB() { return m_draw_call_pre; }
|
||||
PyObject *GetPostDrawCB() { return m_draw_call_post; }
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -256,7 +256,7 @@ PyAttributeDef KX_SceneActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_SceneActuator::pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SceneActuator::pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SceneActuator* actuator = static_cast<KX_SceneActuator*>(self);
|
||||
if (!actuator->m_camera)
|
||||
|
|
|
@ -99,7 +99,7 @@ class KX_SceneActuator : public SCA_IActuator
|
|||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
static PyObject* pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
|
|
@ -358,7 +358,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, stopSound,
|
|||
}
|
||||
|
||||
/* Atribute setting and getting -------------------------------------------- */
|
||||
PyObject* KX_SoundActuator::pyattr_get_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SoundActuator::pyattr_get_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
|
||||
const char* prop = attrdef->m_name;
|
||||
|
@ -392,11 +392,11 @@ PyObject* KX_SoundActuator::pyattr_get_3d_property(void *self, const struct KX_P
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* result = PyFloat_FromDouble(result_value);
|
||||
PyObject *result = PyFloat_FromDouble(result_value);
|
||||
return result;
|
||||
}
|
||||
|
||||
PyObject* KX_SoundActuator::pyattr_get_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SoundActuator::pyattr_get_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
|
||||
float position = 0.0;
|
||||
|
@ -404,32 +404,32 @@ PyObject* KX_SoundActuator::pyattr_get_audposition(void *self, const struct KX_P
|
|||
if (!actuator->m_handle.isNull())
|
||||
position = actuator->m_handle->getPosition();
|
||||
|
||||
PyObject* result = PyFloat_FromDouble(position);
|
||||
PyObject *result = PyFloat_FromDouble(position);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
PyObject* KX_SoundActuator::pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SoundActuator::pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
|
||||
float gain = actuator->m_volume;
|
||||
|
||||
PyObject* result = PyFloat_FromDouble(gain);
|
||||
PyObject *result = PyFloat_FromDouble(gain);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
PyObject* KX_SoundActuator::pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SoundActuator::pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
|
||||
float pitch = actuator->m_pitch;
|
||||
|
||||
PyObject* result = PyFloat_FromDouble(pitch);
|
||||
PyObject *result = PyFloat_FromDouble(pitch);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
PyObject* KX_SoundActuator::pyattr_get_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SoundActuator::pyattr_get_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
|
||||
if (!actuator->m_sound.isNull())
|
||||
|
@ -542,7 +542,7 @@ int KX_SoundActuator::pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_D
|
|||
|
||||
int KX_SoundActuator::pyattr_set_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
|
||||
{
|
||||
PyObject* sound = NULL;
|
||||
PyObject *sound = NULL;
|
||||
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
|
||||
if (!PyArg_Parse(value, "O", &sound))
|
||||
return PY_SET_ATTR_FAIL;
|
||||
|
|
|
@ -115,12 +115,12 @@ public:
|
|||
static int pyattr_set_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
static int pyattr_set_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
static PyObject* pyattr_get_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
||||
|
|
|
@ -557,7 +557,7 @@ PyAttributeDef KX_SteeringActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_SteeringActuator::pyattr_get_target(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SteeringActuator::pyattr_get_target(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SteeringActuator* actuator = static_cast<KX_SteeringActuator*>(self);
|
||||
if (!actuator->m_target)
|
||||
|
@ -585,7 +585,7 @@ int KX_SteeringActuator::pyattr_set_target(void *self, const struct KX_PYATTRIBU
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_SteeringActuator::pyattr_get_navmesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SteeringActuator::pyattr_get_navmesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SteeringActuator* actuator = static_cast<KX_SteeringActuator*>(self);
|
||||
if (!actuator->m_navmesh)
|
||||
|
@ -619,7 +619,7 @@ int KX_SteeringActuator::pyattr_set_navmesh(void *self, const struct KX_PYATTRIB
|
|||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_SteeringActuator::pyattr_get_steeringVec(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_SteeringActuator::pyattr_get_steeringVec(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_SteeringActuator* actuator = static_cast<KX_SteeringActuator*>(self);
|
||||
const MT_Vector3& steeringVec = actuator->GetSteeringVec();
|
||||
|
|
|
@ -107,11 +107,11 @@ public:
|
|||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* These are used to get and set m_target */
|
||||
static PyObject* pyattr_get_target(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_target(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_target(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
static PyObject* pyattr_get_navmesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_navmesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_navmesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
static PyObject* pyattr_get_steeringVec(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_steeringVec(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
|
|
@ -331,7 +331,7 @@ PyAttributeDef KX_TouchSensor::Attributes[] = {
|
|||
|
||||
/* Python API */
|
||||
|
||||
PyObject* KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_TouchSensor* self= static_cast<KX_TouchSensor*>(self_v);
|
||||
|
||||
|
@ -341,7 +341,7 @@ PyObject* KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBU
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_TouchSensor::pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_TouchSensor::pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_TouchSensor* self= static_cast<KX_TouchSensor*>(self_v);
|
||||
return self->m_colliders->GetProxy();
|
||||
|
|
|
@ -458,7 +458,7 @@ PyAttributeDef KX_TrackToActuator::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_TrackToActuator::pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_TrackToActuator::pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_TrackToActuator* actuator = static_cast<KX_TrackToActuator*>(self);
|
||||
if (!actuator->m_object)
|
||||
|
|
|
@ -74,7 +74,7 @@ class KX_TrackToActuator : public SCA_IActuator
|
|||
/* Python part */
|
||||
|
||||
/* These are used to get and set m_ob */
|
||||
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
|
|
@ -34,11 +34,11 @@ KX_VehicleWrapper::~KX_VehicleWrapper()
|
|||
|
||||
#ifdef WITH_PYTHON
|
||||
|
||||
PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PyAddWheel(PyObject *args)
|
||||
{
|
||||
|
||||
PyObject* pylistPos,*pylistDir,*pylistAxleDir;
|
||||
PyObject* wheelGameObject;
|
||||
PyObject *pylistPos,*pylistDir,*pylistAxleDir;
|
||||
PyObject *wheelGameObject;
|
||||
float suspensionRestLength,wheelRadius;
|
||||
int hasSteering;
|
||||
|
||||
|
@ -83,7 +83,7 @@ PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* args)
|
|||
|
||||
|
||||
|
||||
PyObject* KX_VehicleWrapper::PyGetWheelPosition(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PyGetWheelPosition(PyObject *args)
|
||||
{
|
||||
|
||||
int wheelIndex;
|
||||
|
@ -98,7 +98,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelPosition(PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_VehicleWrapper::PyGetWheelRotation(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PyGetWheelRotation(PyObject *args)
|
||||
{
|
||||
int wheelIndex;
|
||||
if (PyArg_ParseTuple(args,"i:getWheelRotation",&wheelIndex))
|
||||
|
@ -108,7 +108,7 @@ PyObject* KX_VehicleWrapper::PyGetWheelRotation(PyObject* args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject *args)
|
||||
{
|
||||
int wheelIndex;
|
||||
if (PyArg_ParseTuple(args,"i:getWheelOrientationQuaternion",&wheelIndex))
|
||||
|
@ -124,20 +124,20 @@ PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* args)
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_VehicleWrapper::PyGetNumWheels(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PyGetNumWheels(PyObject *args)
|
||||
{
|
||||
return PyLong_FromSsize_t(m_vehicle->GetNumWheels());
|
||||
}
|
||||
|
||||
|
||||
PyObject* KX_VehicleWrapper::PyGetConstraintId(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PyGetConstraintId(PyObject *args)
|
||||
{
|
||||
return PyLong_FromSsize_t(m_vehicle->GetUserConstraintId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PyApplyEngineForce(PyObject *args)
|
||||
{
|
||||
float force;
|
||||
int wheelIndex;
|
||||
|
@ -153,7 +153,7 @@ PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PySetTyreFriction(PyObject *args)
|
||||
{
|
||||
float wheelFriction;
|
||||
int wheelIndex;
|
||||
|
@ -168,7 +168,7 @@ PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PySetSuspensionStiffness(PyObject *args)
|
||||
{
|
||||
float suspensionStiffness;
|
||||
int wheelIndex;
|
||||
|
@ -183,7 +183,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PySetSuspensionDamping(PyObject *args)
|
||||
{
|
||||
float suspensionDamping;
|
||||
int wheelIndex;
|
||||
|
@ -197,7 +197,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PySetSuspensionCompression(PyObject *args)
|
||||
{
|
||||
float suspensionCompression;
|
||||
int wheelIndex;
|
||||
|
@ -211,7 +211,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* args)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PySetRollInfluence(PyObject *args)
|
||||
{
|
||||
float rollInfluence;
|
||||
int wheelIndex;
|
||||
|
@ -227,7 +227,7 @@ PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* args)
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PyApplyBraking(PyObject *args)
|
||||
{
|
||||
float braking;
|
||||
int wheelIndex;
|
||||
|
@ -245,7 +245,7 @@ PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* args)
|
|||
|
||||
|
||||
|
||||
PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PySetSteeringValue(PyObject *args)
|
||||
{
|
||||
float steeringValue;
|
||||
int wheelIndex;
|
||||
|
@ -261,7 +261,7 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* args)
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_VehicleWrapper::PyGetConstraintType(PyObject* args)
|
||||
PyObject *KX_VehicleWrapper::PyGetConstraintType(PyObject *args)
|
||||
{
|
||||
return PyLong_FromSsize_t(m_vehicle->GetUserConstraintType());
|
||||
}
|
||||
|
|
|
@ -101,85 +101,85 @@ PyAttributeDef KX_VertexProxy::Attributes[] = {
|
|||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getXYZ()[0]);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getXYZ()[1]);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getXYZ()[2]);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getRGBA()[0]/255.0);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getRGBA()[1]/255.0);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getRGBA()[2]/255.0);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getRGBA()[3]/255.0);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getUV1()[0]);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getUV1()[1]);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getUV2()[0]);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyFloat_FromDouble(self->m_vertex->getUV2()[1]);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyObjectFrom(MT_Vector3(self->m_vertex->getXYZ()));
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyObjectFrom(MT_Point2(self->m_vertex->getUV1()));
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
const unsigned char *colp = self->m_vertex->getRGBA();
|
||||
|
@ -188,7 +188,7 @@ PyObject* KX_VertexProxy::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DE
|
|||
return PyObjectFrom(color);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
PyObject *KX_VertexProxy::pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_VertexProxy* self= static_cast<KX_VertexProxy*>(self_v);
|
||||
return PyObjectFrom(MT_Vector3(self->m_vertex->getNormal()));
|
||||
|
@ -459,12 +459,12 @@ CValue* KX_VertexProxy::GetReplica() { return NULL;}
|
|||
|
||||
// stuff for python integration
|
||||
|
||||
PyObject* KX_VertexProxy::PyGetXYZ()
|
||||
PyObject *KX_VertexProxy::PyGetXYZ()
|
||||
{
|
||||
return PyObjectFrom(MT_Point3(m_vertex->getXYZ()));
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::PySetXYZ(PyObject* value)
|
||||
PyObject *KX_VertexProxy::PySetXYZ(PyObject *value)
|
||||
{
|
||||
MT_Point3 vec;
|
||||
if (!PyVecTo(value, vec))
|
||||
|
@ -475,12 +475,12 @@ PyObject* KX_VertexProxy::PySetXYZ(PyObject* value)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::PyGetNormal()
|
||||
PyObject *KX_VertexProxy::PyGetNormal()
|
||||
{
|
||||
return PyObjectFrom(MT_Vector3(m_vertex->getNormal()));
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::PySetNormal(PyObject* value)
|
||||
PyObject *KX_VertexProxy::PySetNormal(PyObject *value)
|
||||
{
|
||||
MT_Vector3 vec;
|
||||
if (!PyVecTo(value, vec))
|
||||
|
@ -492,13 +492,13 @@ PyObject* KX_VertexProxy::PySetNormal(PyObject* value)
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_VertexProxy::PyGetRGBA()
|
||||
PyObject *KX_VertexProxy::PyGetRGBA()
|
||||
{
|
||||
int *rgba = (int *) m_vertex->getRGBA();
|
||||
return PyLong_FromSsize_t(*rgba);
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::PySetRGBA(PyObject* value)
|
||||
PyObject *KX_VertexProxy::PySetRGBA(PyObject *value)
|
||||
{
|
||||
if (PyLong_Check(value)) {
|
||||
int rgba = PyLong_AsSsize_t(value);
|
||||
|
@ -521,12 +521,12 @@ PyObject* KX_VertexProxy::PySetRGBA(PyObject* value)
|
|||
}
|
||||
|
||||
|
||||
PyObject* KX_VertexProxy::PyGetUV()
|
||||
PyObject *KX_VertexProxy::PyGetUV()
|
||||
{
|
||||
return PyObjectFrom(MT_Vector2(m_vertex->getUV1()));
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::PySetUV(PyObject* value)
|
||||
PyObject *KX_VertexProxy::PySetUV(PyObject *value)
|
||||
{
|
||||
MT_Point2 vec;
|
||||
if (!PyVecTo(value, vec))
|
||||
|
@ -537,17 +537,17 @@ PyObject* KX_VertexProxy::PySetUV(PyObject* value)
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::PyGetUV2()
|
||||
PyObject *KX_VertexProxy::PyGetUV2()
|
||||
{
|
||||
return PyObjectFrom(MT_Vector2(m_vertex->getUV2()));
|
||||
}
|
||||
|
||||
PyObject* KX_VertexProxy::PySetUV2(PyObject* args)
|
||||
PyObject *KX_VertexProxy::PySetUV2(PyObject *args)
|
||||
{
|
||||
MT_Point2 vec;
|
||||
unsigned int unit= RAS_TexVert::SECOND_UV;
|
||||
|
||||
PyObject* list= NULL;
|
||||
PyObject *list = NULL;
|
||||
if (!PyArg_ParseTuple(args, "O|i:setUV2", &list, &unit))
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -59,21 +59,21 @@ public:
|
|||
|
||||
// stuff for python integration
|
||||
|
||||
static PyObject* pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject *pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_x(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
static int pyattr_set_y(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
static int pyattr_set_z(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
|
|
@ -485,8 +485,7 @@ void CcdPhysicsEnvironment::updateCcdPhysicsController(CcdPhysicsController* ctr
|
|||
body->setMassProps(newMass, inertia);
|
||||
m_dynamicsWorld->addRigidBody(body, newCollisionGroup, newCollisionMask);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
m_dynamicsWorld->addCollisionObject(obj, newCollisionGroup, newCollisionMask);
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue