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!";
|
static const char* device_not_3d_error = "Device is not a 3D device!";
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ Factory_dealloc(Factory* self)
|
||||||
if(self->factory)
|
if(self->factory)
|
||||||
delete reinterpret_cast<AUD_Reference<AUD_IFactory>*>(self->factory);
|
delete reinterpret_cast<AUD_Reference<AUD_IFactory>*>(self->factory);
|
||||||
Py_XDECREF(self->child_list);
|
Py_XDECREF(self->child_list);
|
||||||
Py_TYPE(self)->tp_free((PyObject*)self);
|
Py_TYPE(self)->tp_free((PyObject *)self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
@ -139,7 +139,7 @@ PyDoc_STRVAR(M_aud_Factory_sine_doc,
|
||||||
":rtype: :class:`Factory`");
|
":rtype: :class:`Factory`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_sine(PyTypeObject* type, PyObject* args)
|
Factory_sine(PyTypeObject* type, PyObject *args)
|
||||||
{
|
{
|
||||||
float frequency;
|
float frequency;
|
||||||
double rate = 44100;
|
double rate = 44100;
|
||||||
|
@ -179,7 +179,7 @@ PyDoc_STRVAR(M_aud_Factory_file_doc,
|
||||||
"playback of that factory.");
|
"playback of that factory.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_file(PyTypeObject* type, PyObject* args)
|
Factory_file(PyTypeObject* type, PyObject *args)
|
||||||
{
|
{
|
||||||
const char* filename = NULL;
|
const char* filename = NULL;
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ PyDoc_STRVAR(M_aud_Factory_lowpass_doc,
|
||||||
":rtype: :class:`Factory`");
|
":rtype: :class:`Factory`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_lowpass(Factory* self, PyObject* args)
|
Factory_lowpass(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
float frequency;
|
float frequency;
|
||||||
float Q = 0.5;
|
float Q = 0.5;
|
||||||
|
@ -232,7 +232,7 @@ Factory_lowpass(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -260,7 +260,7 @@ PyDoc_STRVAR(M_aud_Factory_delay_doc,
|
||||||
":rtype: :class:`Factory`");
|
":rtype: :class:`Factory`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_delay(Factory* self, PyObject* args)
|
Factory_delay(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
float delay;
|
float delay;
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ Factory_delay(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -301,7 +301,7 @@ PyDoc_STRVAR(M_aud_Factory_join_doc,
|
||||||
"(channels and samplerate).");
|
"(channels and samplerate).");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_join(Factory* self, PyObject* object)
|
Factory_join(Factory* self, PyObject *object)
|
||||||
{
|
{
|
||||||
PyTypeObject* type = Py_TYPE(self);
|
PyTypeObject* type = Py_TYPE(self);
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ PyDoc_STRVAR(M_aud_Factory_highpass_doc,
|
||||||
":rtype: :class:`Factory`");
|
":rtype: :class:`Factory`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_highpass(Factory* self, PyObject* args)
|
Factory_highpass(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
float frequency;
|
float frequency;
|
||||||
float Q = 0.5;
|
float Q = 0.5;
|
||||||
|
@ -360,7 +360,7 @@ Factory_highpass(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -388,7 +388,7 @@ PyDoc_STRVAR(M_aud_Factory_limit_doc,
|
||||||
":rtype: :class:`Factory`");
|
":rtype: :class:`Factory`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_limit(Factory* self, PyObject* args)
|
Factory_limit(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
float start, end;
|
float start, end;
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ Factory_limit(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -432,7 +432,7 @@ PyDoc_STRVAR(M_aud_Factory_pitch_doc,
|
||||||
":attr:`Handle.pitch` instead.");
|
":attr:`Handle.pitch` instead.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_pitch(Factory* self, PyObject* args)
|
Factory_pitch(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
float factor;
|
float factor;
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ Factory_pitch(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -474,7 +474,7 @@ PyDoc_STRVAR(M_aud_Factory_volume_doc,
|
||||||
":attr:`Handle.volume` instead.");
|
":attr:`Handle.volume` instead.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_volume(Factory* self, PyObject* args)
|
Factory_volume(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
float volume;
|
float volume;
|
||||||
|
|
||||||
|
@ -487,7 +487,7 @@ Factory_volume(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -517,7 +517,7 @@ PyDoc_STRVAR(M_aud_Factory_fadein_doc,
|
||||||
".. note:: Before the fade starts it plays silence.");
|
".. note:: Before the fade starts it plays silence.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_fadein(Factory* self, PyObject* args)
|
Factory_fadein(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
float start, length;
|
float start, length;
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ Factory_fadein(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -561,7 +561,7 @@ PyDoc_STRVAR(M_aud_Factory_fadeout_doc,
|
||||||
"the length of the factory is not altered.");
|
"the length of the factory is not altered.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_fadeout(Factory* self, PyObject* args)
|
Factory_fadeout(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
float start, length;
|
float start, length;
|
||||||
|
|
||||||
|
@ -574,7 +574,7 @@ Factory_fadeout(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -603,7 +603,7 @@ PyDoc_STRVAR(M_aud_Factory_loop_doc,
|
||||||
":attr:`Handle.loop_count` instead.");
|
":attr:`Handle.loop_count` instead.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_loop(Factory* self, PyObject* args)
|
Factory_loop(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
int loop;
|
int loop;
|
||||||
|
|
||||||
|
@ -616,7 +616,7 @@ Factory_loop(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -644,7 +644,7 @@ PyDoc_STRVAR(M_aud_Factory_mix_doc,
|
||||||
"(channels and samplerate).");
|
"(channels and samplerate).");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_mix(Factory* self, PyObject* object)
|
Factory_mix(Factory* self, PyObject *object)
|
||||||
{
|
{
|
||||||
PyTypeObject* type = Py_TYPE(self);
|
PyTypeObject* type = Py_TYPE(self);
|
||||||
|
|
||||||
|
@ -692,7 +692,7 @@ Factory_pingpong(Factory* self)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -731,7 +731,7 @@ Factory_reverse(Factory* self)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -795,7 +795,7 @@ PyDoc_STRVAR(M_aud_Factory_square_doc,
|
||||||
":rtype: :class:`Factory`");
|
":rtype: :class:`Factory`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_square(Factory* self, PyObject* args)
|
Factory_square(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
float threshold = 0;
|
float threshold = 0;
|
||||||
|
|
||||||
|
@ -808,7 +808,7 @@ Factory_square(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -842,10 +842,10 @@ PyDoc_STRVAR(M_aud_Factory_filter_doc,
|
||||||
":rtype: :class:`Factory`");
|
":rtype: :class:`Factory`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Factory_filter(Factory* self, PyObject* args)
|
Factory_filter(Factory* self, PyObject *args)
|
||||||
{
|
{
|
||||||
PyObject* py_b;
|
PyObject *py_b;
|
||||||
PyObject* py_a = NULL;
|
PyObject *py_a = NULL;
|
||||||
Py_ssize_t py_a_len;
|
Py_ssize_t py_a_len;
|
||||||
Py_ssize_t py_b_len;
|
Py_ssize_t py_b_len;
|
||||||
|
|
||||||
|
@ -868,7 +868,7 @@ Factory_filter(Factory* self, PyObject* args)
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<float> a, b;
|
std::vector<float> a, b;
|
||||||
PyObject* py_value;
|
PyObject *py_value;
|
||||||
float value;
|
float value;
|
||||||
|
|
||||||
for(Py_ssize_t i = 0; i < py_b_len; i++)
|
for(Py_ssize_t i = 0; i < py_b_len; i++)
|
||||||
|
@ -911,7 +911,7 @@ Factory_filter(Factory* self, PyObject* args)
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
{
|
{
|
||||||
Py_INCREF(self);
|
Py_INCREF(self);
|
||||||
parent->child_list = (PyObject*)self;
|
parent->child_list = (PyObject *)self;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1040,7 +1040,7 @@ Handle_dealloc(Handle* self)
|
||||||
{
|
{
|
||||||
if(self->handle)
|
if(self->handle)
|
||||||
delete reinterpret_cast<AUD_Reference<AUD_IHandle>*>(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,
|
PyDoc_STRVAR(M_aud_Handle_pause_doc,
|
||||||
|
@ -1135,7 +1135,7 @@ Handle_get_position(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_position(Handle *self, PyObject* args, void* nothing)
|
Handle_set_position(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float position;
|
float position;
|
||||||
|
|
||||||
|
@ -1180,7 +1180,7 @@ Handle_get_keep(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_keep(Handle *self, PyObject* args, void* nothing)
|
Handle_set_keep(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
if(!PyBool_Check(args))
|
if(!PyBool_Check(args))
|
||||||
{
|
{
|
||||||
|
@ -1239,7 +1239,7 @@ Handle_get_volume(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_volume(Handle *self, PyObject* args, void* nothing)
|
Handle_set_volume(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float volume;
|
float volume;
|
||||||
|
|
||||||
|
@ -1278,7 +1278,7 @@ Handle_get_pitch(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_pitch(Handle *self, PyObject* args, void* nothing)
|
Handle_set_pitch(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float pitch;
|
float pitch;
|
||||||
|
|
||||||
|
@ -1317,7 +1317,7 @@ Handle_get_loop_count(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_loop_count(Handle *self, PyObject* args, void* nothing)
|
Handle_set_loop_count(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
int loops;
|
int loops;
|
||||||
|
|
||||||
|
@ -1366,7 +1366,7 @@ Handle_get_location(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_location(Handle *self, PyObject* args, void* nothing)
|
Handle_set_location(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
|
|
||||||
|
@ -1422,7 +1422,7 @@ Handle_get_velocity(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_velocity(Handle *self, PyObject* args, void* nothing)
|
Handle_set_velocity(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
|
|
||||||
|
@ -1478,7 +1478,7 @@ Handle_get_orientation(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
float w, x, y, z;
|
||||||
|
|
||||||
|
@ -1533,7 +1533,7 @@ Handle_get_relative(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_relative(Handle *self, PyObject* args, void* nothing)
|
Handle_set_relative(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
if(!PyBool_Check(args))
|
if(!PyBool_Check(args))
|
||||||
{
|
{
|
||||||
|
@ -1591,7 +1591,7 @@ Handle_get_volume_minimum(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_volume_minimum(Handle *self, PyObject* args, void* nothing)
|
Handle_set_volume_minimum(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float volume;
|
float volume;
|
||||||
|
|
||||||
|
@ -1646,7 +1646,7 @@ Handle_get_volume_maximum(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_volume_maximum(Handle *self, PyObject* args, void* nothing)
|
Handle_set_volume_maximum(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float volume;
|
float volume;
|
||||||
|
|
||||||
|
@ -1702,7 +1702,7 @@ Handle_get_distance_reference(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_distance_reference(Handle *self, PyObject* args, void* nothing)
|
Handle_set_distance_reference(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float distance;
|
float distance;
|
||||||
|
|
||||||
|
@ -1758,7 +1758,7 @@ Handle_get_distance_maximum(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_distance_maximum(Handle *self, PyObject* args, void* nothing)
|
Handle_set_distance_maximum(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float distance;
|
float distance;
|
||||||
|
|
||||||
|
@ -1814,7 +1814,7 @@ Handle_get_attenuation(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Handle_set_attenuation(Handle *self, PyObject* args, void* nothing)
|
Handle_set_attenuation(Handle *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float factor;
|
float factor;
|
||||||
|
|
||||||
|
@ -1875,7 +1875,7 @@ Handle_get_cone_angle_inner(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
float angle;
|
||||||
|
|
||||||
|
@ -1930,7 +1930,7 @@ Handle_get_cone_angle_outer(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
float angle;
|
||||||
|
|
||||||
|
@ -1985,7 +1985,7 @@ Handle_get_cone_volume_outer(Handle *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
float volume;
|
||||||
|
|
||||||
|
@ -2105,7 +2105,7 @@ Device_dealloc(Device* self)
|
||||||
{
|
{
|
||||||
if(self->device)
|
if(self->device)
|
||||||
delete reinterpret_cast<AUD_Reference<AUD_IDevice>*>(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 *
|
static PyObject *
|
||||||
|
@ -2201,8 +2201,8 @@ PyDoc_STRVAR(M_aud_Device_play_doc,
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Device_play(Device *self, PyObject *args, PyObject *kwds)
|
Device_play(Device *self, PyObject *args, PyObject *kwds)
|
||||||
{
|
{
|
||||||
PyObject* object;
|
PyObject *object;
|
||||||
PyObject* keepo = NULL;
|
PyObject *keepo = NULL;
|
||||||
|
|
||||||
bool keep = false;
|
bool keep = false;
|
||||||
|
|
||||||
|
@ -2402,7 +2402,7 @@ Device_get_volume(Device *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Device_set_volume(Device *self, PyObject* args, void* nothing)
|
Device_set_volume(Device *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float volume;
|
float volume;
|
||||||
|
|
||||||
|
@ -2449,7 +2449,7 @@ Device_get_listener_location(Device *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
float x, y, z;
|
||||||
|
|
||||||
|
@ -2504,7 +2504,7 @@ Device_get_listener_velocity(Device *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
float x, y, z;
|
||||||
|
|
||||||
|
@ -2559,7 +2559,7 @@ Device_get_listener_orientation(Device *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
float w, x, y, z;
|
||||||
|
|
||||||
|
@ -2614,7 +2614,7 @@ Device_get_speed_of_sound(Device *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
float speed;
|
||||||
|
|
||||||
|
@ -2670,7 +2670,7 @@ Device_get_doppler_factor(Device *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Device_set_doppler_factor(Device *self, PyObject* args, void* nothing)
|
Device_set_doppler_factor(Device *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
float factor;
|
float factor;
|
||||||
|
|
||||||
|
@ -2724,7 +2724,7 @@ Device_get_distance_model(Device *self, void* nothing)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Device_set_distance_model(Device *self, PyObject* args, void* nothing)
|
Device_set_distance_model(Device *self, PyObject *args, void* nothing)
|
||||||
{
|
{
|
||||||
int model;
|
int model;
|
||||||
|
|
||||||
|
@ -2833,7 +2833,7 @@ Factory_empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
Factory*
|
Factory*
|
||||||
checkFactory(PyObject* factory)
|
checkFactory(PyObject *factory)
|
||||||
{
|
{
|
||||||
if(!PyObject_TypeCheck(factory, &FactoryType))
|
if(!PyObject_TypeCheck(factory, &FactoryType))
|
||||||
{
|
{
|
||||||
|
@ -2862,7 +2862,7 @@ static struct PyModuleDef audmodule = {
|
||||||
PyMODINIT_FUNC
|
PyMODINIT_FUNC
|
||||||
PyInit_aud(void)
|
PyInit_aud(void)
|
||||||
{
|
{
|
||||||
PyObject* m;
|
PyObject *m;
|
||||||
|
|
||||||
if(PyType_Ready(&FactoryType) < 0)
|
if(PyType_Ready(&FactoryType) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2878,13 +2878,13 @@ PyInit_aud(void)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Py_INCREF(&FactoryType);
|
Py_INCREF(&FactoryType);
|
||||||
PyModule_AddObject(m, "Factory", (PyObject*)&FactoryType);
|
PyModule_AddObject(m, "Factory", (PyObject *)&FactoryType);
|
||||||
|
|
||||||
Py_INCREF(&DeviceType);
|
Py_INCREF(&DeviceType);
|
||||||
PyModule_AddObject(m, "Device", (PyObject*)&DeviceType);
|
PyModule_AddObject(m, "Device", (PyObject *)&DeviceType);
|
||||||
|
|
||||||
Py_INCREF(&HandleType);
|
Py_INCREF(&HandleType);
|
||||||
PyModule_AddObject(m, "Handle", (PyObject*)&HandleType);
|
PyModule_AddObject(m, "Handle", (PyObject *)&HandleType);
|
||||||
|
|
||||||
AUDError = PyErr_NewException("aud.error", NULL, NULL);
|
AUDError = PyErr_NewException("aud.error", NULL, NULL);
|
||||||
Py_INCREF(AUDError);
|
Py_INCREF(AUDError);
|
||||||
|
|
|
@ -46,7 +46,7 @@ typedef void AUD_Reference_AUD_IHandle;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PyObject_HEAD
|
PyObject_HEAD
|
||||||
PyObject* child_list;
|
PyObject *child_list;
|
||||||
AUD_Reference_AUD_IFactory* factory;
|
AUD_Reference_AUD_IFactory* factory;
|
||||||
} Factory;
|
} Factory;
|
||||||
|
|
||||||
|
@ -63,9 +63,9 @@ typedef struct {
|
||||||
PyMODINIT_FUNC
|
PyMODINIT_FUNC
|
||||||
PyInit_aud(void);
|
PyInit_aud(void);
|
||||||
|
|
||||||
extern PyObject* Device_empty();
|
extern PyObject *Device_empty();
|
||||||
extern PyObject* Factory_empty();
|
extern PyObject *Factory_empty();
|
||||||
extern Factory* checkFactory(PyObject* factory);
|
extern Factory *checkFactory(PyObject *factory);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ extern "C" {
|
||||||
/**
|
/**
|
||||||
* Initalizes the Python module.
|
* Initalizes the Python module.
|
||||||
*/
|
*/
|
||||||
extern PyObject* AUD_initPython(void);
|
extern PyObject *AUD_initPython(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
* private :
|
* private :
|
||||||
* MEM_SmartPtr<foo> m_foo;
|
* MEM_SmartPtr<foo> m_foo;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* You may also safely construct vectors of MEM_SmartPtrs and
|
* You may also safely construct vectors of MEM_SmartPtrs and
|
||||||
* have the vector own stuff you put into it.
|
* have the vector own stuff you put into it.
|
||||||
*
|
*
|
||||||
|
@ -167,7 +167,7 @@ public :
|
||||||
Ref(
|
Ref(
|
||||||
) const {
|
) const {
|
||||||
return *m_val;
|
return *m_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assignment operator - ownership is transfered from rhs to lhs.
|
* Assignment operator - ownership is transfered from rhs to lhs.
|
||||||
|
@ -207,7 +207,7 @@ public :
|
||||||
Release(
|
Release(
|
||||||
) const {
|
) const {
|
||||||
T* temp = m_val;
|
T* temp = m_val;
|
||||||
(const_cast<MEM_SmartPtr *>(this))->m_val = NULL;
|
(const_cast<MEM_SmartPtr *>(this))->m_val = NULL;
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ static void icon_free(void *val)
|
||||||
Icon *icon = val;
|
Icon *icon = val;
|
||||||
|
|
||||||
if (icon) {
|
if (icon) {
|
||||||
if (icon->drawinfo_free) {
|
if (icon->drawinfo_free) {
|
||||||
icon->drawinfo_free(icon->drawinfo);
|
icon->drawinfo_free(icon->drawinfo);
|
||||||
}
|
}
|
||||||
else if (icon->drawinfo) {
|
else if (icon->drawinfo) {
|
||||||
|
@ -255,7 +255,7 @@ void BKE_icon_changed(int id)
|
||||||
prv->changed_timestamp[i]++;
|
prv->changed_timestamp[i]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int BKE_icon_getid(struct ID *id)
|
int BKE_icon_getid(struct ID *id)
|
||||||
|
|
|
@ -484,7 +484,7 @@ void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
|
||||||
|
|
||||||
BLI_remlink(&group->data.group, loop);
|
BLI_remlink(&group->data.group, loop);
|
||||||
IDP_FreeProperty(loop);
|
IDP_FreeProperty(loop);
|
||||||
MEM_freeN(loop);
|
MEM_freeN(loop);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
group->len++;
|
group->len++;
|
||||||
|
@ -679,7 +679,7 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
|
||||||
case IDP_DOUBLE:
|
case IDP_DOUBLE:
|
||||||
prop = MEM_callocN(sizeof(IDProperty), "IDProperty float");
|
prop = MEM_callocN(sizeof(IDProperty), "IDProperty float");
|
||||||
*(double *)&prop->data.val = val->d;
|
*(double *)&prop->data.val = val->d;
|
||||||
break;
|
break;
|
||||||
case IDP_ARRAY:
|
case IDP_ARRAY:
|
||||||
{
|
{
|
||||||
/* for now, we only support float and int and double arrays */
|
/* for now, we only support float and int and double arrays */
|
||||||
|
|
|
@ -186,7 +186,7 @@ void BKE_mball_unlink(MetaBall *mb)
|
||||||
/* do not free mball itself */
|
/* do not free mball itself */
|
||||||
void BKE_mball_free(MetaBall *mb)
|
void BKE_mball_free(MetaBall *mb)
|
||||||
{
|
{
|
||||||
BKE_mball_unlink(mb);
|
BKE_mball_unlink(mb);
|
||||||
|
|
||||||
if (mb->adt) {
|
if (mb->adt) {
|
||||||
BKE_free_animdata((ID *)mb);
|
BKE_free_animdata((ID *)mb);
|
||||||
|
@ -562,7 +562,7 @@ Object *BKE_mball_basis_find(Scene *scene, Object *basis)
|
||||||
basis = ob;
|
basis = ob;
|
||||||
basisnr = obnr;
|
basisnr = obnr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -732,7 +732,7 @@ static octal_node *find_metaball_octal_node(octal_node *node, float x, float y,
|
||||||
return find_metaball_octal_node(node->nodes[2], x, y, z, depth--);
|
return find_metaball_octal_node(node->nodes[2], x, y, z, depth--);
|
||||||
else
|
else
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -762,7 +762,7 @@ static octal_node *find_metaball_octal_node(octal_node *node, float x, float y,
|
||||||
return find_metaball_octal_node(node->nodes[6], x, y, z, depth--);
|
return find_metaball_octal_node(node->nodes[6], x, y, z, depth--);
|
||||||
else
|
else
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -861,7 +861,7 @@ static void *new_pgn_element(int size)
|
||||||
}
|
}
|
||||||
BLI_freelistN(&lb);
|
BLI_freelistN(&lb);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = 4 * ( (size + 3) / 4);
|
size = 4 * ( (size + 3) / 4);
|
||||||
|
@ -1628,7 +1628,7 @@ static void polygonize(PROCESS *mbproc, MetaBall *mb)
|
||||||
for (a = 0; a < G_mb.totelem; a++) {
|
for (a = 0; a < G_mb.totelem; a++) {
|
||||||
|
|
||||||
/* try to find 8 points on the surface for each MetaElem */
|
/* try to find 8 points on the surface for each MetaElem */
|
||||||
find_first_points(mbproc, mb, a);
|
find_first_points(mbproc, mb, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* polygonize all MetaElems of current MetaBall */
|
/* polygonize all MetaElems of current MetaBall */
|
||||||
|
@ -2038,7 +2038,7 @@ static void subdivide_metaball_octal_node(octal_node *node, float size_x, float
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ml belongs to the (4)5th node too */
|
/* ml belongs to the (4)5th node too */
|
||||||
if (ml->bb->vec[6][2] >= z) {
|
if (ml->bb->vec[6][2] >= z) {
|
||||||
fill_metaball_octal_node(node, ml, 4);
|
fill_metaball_octal_node(node, ml, 4);
|
||||||
}
|
}
|
||||||
|
@ -2226,7 +2226,7 @@ static void init_metaball_octal_tree(int depth)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* size of first node */
|
/* size of first node */
|
||||||
size[0] = node->x_max - node->x_min;
|
size[0] = node->x_max - node->x_min;
|
||||||
size[1] = node->y_max - node->y_min;
|
size[1] = node->y_max - node->y_min;
|
||||||
size[2] = node->z_max - node->z_min;
|
size[2] = node->z_max - node->z_min;
|
||||||
|
|
|
@ -210,7 +210,7 @@ void unlink_controllers(ListBase *lb)
|
||||||
bController *cont;
|
bController *cont;
|
||||||
|
|
||||||
for (cont= lb->first; cont; cont= cont->next)
|
for (cont= lb->first; cont; cont= cont->next)
|
||||||
unlink_controller(cont);
|
unlink_controller(cont);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_controller(bController *cont)
|
void free_controller(bController *cont)
|
||||||
|
@ -536,7 +536,7 @@ void clear_sca_new_poins(void)
|
||||||
ob= G.main->object.first;
|
ob= G.main->object.first;
|
||||||
while (ob) {
|
while (ob) {
|
||||||
clear_sca_new_poins_ob(ob);
|
clear_sca_new_poins_ob(ob);
|
||||||
ob= ob->id.next;
|
ob= ob->id.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@ void set_sca_new_poins(void)
|
||||||
ob= G.main->object.first;
|
ob= G.main->object.first;
|
||||||
while (ob) {
|
while (ob) {
|
||||||
set_sca_new_poins_ob(ob);
|
set_sca_new_poins_ob(ob);
|
||||||
ob= ob->id.next;
|
ob= ob->id.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ void sca_remove_ob_poin(Object *obt, Object *ob)
|
||||||
if (sta->target == ob) sta->target = NULL;
|
if (sta->target == ob) sta->target = NULL;
|
||||||
}
|
}
|
||||||
act= act->next;
|
act= act->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** INTERFACE ******************* */
|
/* ******************** INTERFACE ******************* */
|
||||||
|
|
|
@ -1368,7 +1368,7 @@ int BLI_testextensie(const char *str, const char *ext)
|
||||||
retval = 0;
|
retval = 0;
|
||||||
}
|
}
|
||||||
else if (BLI_strcasecmp(ext, str + a - b)) {
|
else if (BLI_strcasecmp(ext, str + a - b)) {
|
||||||
retval = 0;
|
retval = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
retval = 1;
|
retval = 1;
|
||||||
|
|
|
@ -211,7 +211,7 @@ ScanFillVert *BLI_scanfill_vert_add(ScanFillContext *sf_ctx, const float vec[3])
|
||||||
|
|
||||||
copy_v3_v3(eve->co, vec);
|
copy_v3_v3(eve->co, vec);
|
||||||
|
|
||||||
return eve;
|
return eve;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScanFillEdge *BLI_scanfill_edge_add(ScanFillContext *sf_ctx, ScanFillVert *v1, ScanFillVert *v2)
|
ScanFillEdge *BLI_scanfill_edge_add(ScanFillContext *sf_ctx, ScanFillVert *v1, ScanFillVert *v2)
|
||||||
|
@ -521,7 +521,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf)
|
||||||
while (eve) {
|
while (eve) {
|
||||||
printf("vert: %x co: %f %f\n", eve, eve->xy[0], eve->xy[1]);
|
printf("vert: %x co: %f %f\n", eve, eve->xy[0], eve->xy[1]);
|
||||||
eve = eve->next;
|
eve = eve->next;
|
||||||
}
|
}
|
||||||
eed = sf_ctx->filledgebase.first;
|
eed = sf_ctx->filledgebase.first;
|
||||||
while (eed) {
|
while (eed) {
|
||||||
printf("edge: %x verts: %x %x\n", eed, eed->v1, eed->v2);
|
printf("edge: %x verts: %x %x\n", eed, eed->v1, eed->v2);
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
|
@ -1051,7 +1051,7 @@ static ImBuf *scaledowny(struct ImBuf *ibuf, int newy)
|
||||||
|
|
||||||
sample -= 1.0f;
|
sample -= 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_rect) {
|
if (do_rect) {
|
||||||
// printf("%ld %ld\n", (uchar *)rect - ((uchar *)ibuf->rect), rect_size);
|
// printf("%ld %ld\n", (uchar *)rect - ((uchar *)ibuf->rect), rect_size);
|
||||||
|
|
|
@ -552,7 +552,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
|
||||||
ketsjinextframestate.draw_letterbox = draw_letterbox;
|
ketsjinextframestate.draw_letterbox = draw_letterbox;
|
||||||
|
|
||||||
pynextframestate.state = &ketsjinextframestate;
|
pynextframestate.state = &ketsjinextframestate;
|
||||||
pynextframestate.func = &BL_KetsjiPyNextFrame;
|
pynextframestate.func = &BL_KetsjiPyNextFrame;
|
||||||
printf("Yielding control to Python script '%s'...\n", python_main);
|
printf("Yielding control to Python script '%s'...\n", python_main);
|
||||||
PyRun_SimpleString(python_code);
|
PyRun_SimpleString(python_code);
|
||||||
printf("Exit Python script '%s'\n", python_main);
|
printf("Exit Python script '%s'\n", python_main);
|
||||||
|
@ -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);
|
const Py_ssize_t numitems= PyList_GET_SIZE(gameLogic_keys_new);
|
||||||
Py_ssize_t listIndex;
|
Py_ssize_t listIndex;
|
||||||
for (listIndex=0; listIndex < numitems; 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)) {
|
if (!PySequence_Contains(gameLogic_keys, item)) {
|
||||||
PyDict_DelItem( PyModule_GetDict(gameLogic), item);
|
PyDict_DelItem( PyModule_GetDict(gameLogic), item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ KX_BlenderCanvas::~KX_BlenderCanvas()
|
||||||
void KX_BlenderCanvas::Init()
|
void KX_BlenderCanvas::Init()
|
||||||
{
|
{
|
||||||
glDepthFunc(GL_LEQUAL);
|
glDepthFunc(GL_LEQUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void KX_BlenderCanvas::SwapBuffers()
|
void KX_BlenderCanvas::SwapBuffers()
|
||||||
|
@ -143,7 +143,7 @@ KX_BlenderCanvas::
|
||||||
GetWindowArea(
|
GetWindowArea(
|
||||||
) {
|
) {
|
||||||
return m_area_rect;
|
return m_area_rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
KX_BlenderCanvas::
|
KX_BlenderCanvas::
|
||||||
|
|
|
@ -153,7 +153,7 @@ void BL_print_game_line(int fontid, const char* text, int size, int dpi, float*
|
||||||
}
|
}
|
||||||
|
|
||||||
void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height)
|
void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height)
|
||||||
{
|
{
|
||||||
/* gl prepping */
|
/* gl prepping */
|
||||||
DisableForText();
|
DisableForText();
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
|
|
@ -344,7 +344,7 @@ void KX_BlenderRenderTools::PopMatrix()
|
||||||
|
|
||||||
int KX_BlenderRenderTools::applyLights(int objectlayer, const MT_Transform& viewmat)
|
int KX_BlenderRenderTools::applyLights(int objectlayer, const MT_Transform& viewmat)
|
||||||
{
|
{
|
||||||
// taken from blender source, incompatibility between Blender Object / GameObject
|
// taken from blender source, incompatibility between Blender Object / GameObject
|
||||||
KX_Scene* kxscene = (KX_Scene*)m_auxilaryClientInfo;
|
KX_Scene* kxscene = (KX_Scene*)m_auxilaryClientInfo;
|
||||||
float glviewmat[16];
|
float glviewmat[16];
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
|
|
|
@ -62,7 +62,7 @@ class KX_BlenderRenderTools : public RAS_IRenderTools
|
||||||
|
|
||||||
public:
|
public:
|
||||||
KX_BlenderRenderTools();
|
KX_BlenderRenderTools();
|
||||||
virtual ~KX_BlenderRenderTools();
|
virtual ~KX_BlenderRenderTools();
|
||||||
|
|
||||||
void EndFrame(RAS_IRasterizer* rasty);
|
void EndFrame(RAS_IRasterizer* rasty);
|
||||||
void BeginFrame(RAS_IRasterizer* rasty);
|
void BeginFrame(RAS_IRasterizer* rasty);
|
||||||
|
|
|
@ -96,7 +96,7 @@ BL_ActionActuator::BL_ActionActuator(SCA_IObject* gameobj,
|
||||||
m_userpose(NULL),
|
m_userpose(NULL),
|
||||||
m_action(action),
|
m_action(action),
|
||||||
m_propname(propname),
|
m_propname(propname),
|
||||||
m_framepropname(framepropname)
|
m_framepropname(framepropname)
|
||||||
{
|
{
|
||||||
if (!end_reset)
|
if (!end_reset)
|
||||||
m_flag |= ACT_FLAG_CONTINUE;
|
m_flag |= ACT_FLAG_CONTINUE;
|
||||||
|
@ -299,7 +299,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
|
||||||
m_flag |= ACT_FLAG_ATTEMPT_PLAY;
|
m_flag |= ACT_FLAG_ATTEMPT_PLAY;
|
||||||
}
|
}
|
||||||
else if ((m_flag & ACT_FLAG_ACTIVE) && bNegativeEvent)
|
else if ((m_flag & ACT_FLAG_ACTIVE) && bNegativeEvent)
|
||||||
{
|
{
|
||||||
m_flag &= ~ACT_FLAG_ATTEMPT_PLAY;
|
m_flag &= ~ACT_FLAG_ATTEMPT_PLAY;
|
||||||
m_localtime = obj->GetActionFrame(m_layer);
|
m_localtime = obj->GetActionFrame(m_layer);
|
||||||
bAction *curr_action = obj->GetCurrentAction(m_layer);
|
bAction *curr_action = obj->GetCurrentAction(m_layer);
|
||||||
|
@ -347,7 +347,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
|
||||||
/* Python functions */
|
/* 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");
|
PyErr_SetString(PyExc_NotImplementedError, "BL_ActionActuator.getChannel() no longer works, please use BL_ArmatureObject.channels instead");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -555,7 +555,7 @@ PyAttributeDef BL_ActionActuator::Attributes[] = {
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v);
|
||||||
return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : "");
|
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");
|
PyErr_SetString(PyExc_NotImplementedError, "BL_ActionActuator.channelNames no longer works, please use BL_ArmatureObject.channels instead");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -620,7 +620,7 @@ PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA
|
||||||
#endif
|
#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);
|
BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v);
|
||||||
return PyBool_FromLong(self->m_flag & ACT_FLAG_CONTINUE);
|
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;
|
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);
|
BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v);
|
||||||
return PyFloat_FromDouble(((KX_GameObject*)self->m_gameobj)->GetActionFrame(self->m_layer));
|
return PyFloat_FromDouble(((KX_GameObject*)self->m_gameobj)->GetActionFrame(self->m_layer));
|
||||||
|
|
|
@ -146,7 +146,7 @@ void BL_ArmatureActuator::FindConstraint()
|
||||||
bool BL_ArmatureActuator::Update(double curtime, bool frame)
|
bool BL_ArmatureActuator::Update(double curtime, bool frame)
|
||||||
{
|
{
|
||||||
// the only role of this actuator is to ensure that the armature pose will be evaluated
|
// the only role of this actuator is to ensure that the armature pose will be evaluated
|
||||||
bool result = false;
|
bool result = false;
|
||||||
bool bNegativeEvent = IsNegativeEvent();
|
bool bNegativeEvent = IsNegativeEvent();
|
||||||
RemoveAllEvents();
|
RemoveAllEvents();
|
||||||
|
|
||||||
|
@ -227,11 +227,11 @@ PyAttributeDef BL_ArmatureActuator::Attributes[] = {
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
BL_ArmatureActuator* actuator = static_cast<BL_ArmatureActuator*>(self);
|
||||||
KX_GameObject *target = (!strcmp(attrdef->m_name, "target")) ? actuator->m_gametarget : actuator->m_gamesubtarget;
|
KX_GameObject *target = (!strcmp(attrdef->m_name, "target")) ? actuator->m_gametarget : actuator->m_gamesubtarget;
|
||||||
if (!target)
|
if (!target)
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
else
|
else
|
||||||
return target->GetProxy();
|
return target->GetProxy();
|
||||||
|
@ -247,7 +247,7 @@ int BL_ArmatureActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBU
|
||||||
return PY_SET_ATTR_FAIL; // ConvertPythonToGameObject sets the error
|
return PY_SET_ATTR_FAIL; // ConvertPythonToGameObject sets the error
|
||||||
|
|
||||||
if (target != NULL)
|
if (target != NULL)
|
||||||
target->UnregisterActuator(actuator);
|
target->UnregisterActuator(actuator);
|
||||||
|
|
||||||
target = gameobj;
|
target = gameobj;
|
||||||
|
|
||||||
|
@ -257,11 +257,11 @@ int BL_ArmatureActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBU
|
||||||
return PY_SET_ATTR_SUCCESS;
|
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_ArmatureActuator* actuator = static_cast<BL_ArmatureActuator*>(self);
|
||||||
BL_ArmatureConstraint* constraint = actuator->m_constraint;
|
BL_ArmatureConstraint* constraint = actuator->m_constraint;
|
||||||
if (!constraint)
|
if (!constraint)
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
else
|
else
|
||||||
return constraint->GetProxy();
|
return constraint->GetProxy();
|
||||||
|
|
|
@ -73,8 +73,8 @@ public:
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
|
|
||||||
/* These are used to get and set m_target */
|
/* 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_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_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 int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||||
|
|
||||||
#endif // WITH_PYTHON
|
#endif // WITH_PYTHON
|
||||||
|
|
|
@ -62,7 +62,7 @@ PyTypeObject BL_ArmatureChannel::Type = {
|
||||||
py_base_new
|
py_base_new
|
||||||
};
|
};
|
||||||
|
|
||||||
PyObject* BL_ArmatureChannel::py_repr(void)
|
PyObject *BL_ArmatureChannel::py_repr(void)
|
||||||
{
|
{
|
||||||
return PyUnicode_FromString(m_posechannel->name);
|
return PyUnicode_FromString(m_posechannel->name);
|
||||||
}
|
}
|
||||||
|
@ -104,8 +104,8 @@ PyMethodDef BL_ArmatureChannel::Methods[] = {
|
||||||
|
|
||||||
PyAttributeDef BL_ArmatureChannel::Attributes[] = {
|
PyAttributeDef BL_ArmatureChannel::Attributes[] = {
|
||||||
// Keep these attributes in order of BCA_ defines!!! used by py_attr_getattr and py_attr_setattr
|
// Keep these attributes in order of BCA_ defines!!! used by py_attr_getattr and py_attr_setattr
|
||||||
KX_PYATTRIBUTE_RO_FUNCTION("bone",BL_ArmatureChannel,py_attr_getattr),
|
KX_PYATTRIBUTE_RO_FUNCTION("bone",BL_ArmatureChannel,py_attr_getattr),
|
||||||
KX_PYATTRIBUTE_RO_FUNCTION("parent",BL_ArmatureChannel,py_attr_getattr),
|
KX_PYATTRIBUTE_RO_FUNCTION("parent",BL_ArmatureChannel,py_attr_getattr),
|
||||||
|
|
||||||
{ NULL } //Sentinel
|
{ NULL } //Sentinel
|
||||||
};
|
};
|
||||||
|
@ -147,7 +147,7 @@ PyAttributeDef BL_ArmatureChannel::AttributesPtr[] = {
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
BL_ArmatureChannel* self= static_cast<BL_ArmatureChannel*>(self_v);
|
||||||
bPoseChannel* channel = self->m_posechannel;
|
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;
|
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);
|
bPoseChannel* pchan = static_cast<bPoseChannel*>(self_v);
|
||||||
// decompose the pose matrix in euler rotation
|
// decompose the pose matrix in euler rotation
|
||||||
|
@ -223,7 +223,7 @@ PyObject* BL_ArmatureChannel::py_attr_get_joint_rotation(void *self_v, const str
|
||||||
}
|
}
|
||||||
// remove the rest pose to get the joint movement
|
// remove the rest pose to get the joint movement
|
||||||
transpose_m3(rest_mat);
|
transpose_m3(rest_mat);
|
||||||
mul_m3_m3m3(joint_mat, rest_mat, pose_mat);
|
mul_m3_m3m3(joint_mat, rest_mat, pose_mat);
|
||||||
joints[0] = joints[1] = joints[2] = 0.f;
|
joints[0] = joints[1] = joints[2] = 0.f;
|
||||||
// returns a 3 element list that gives corresponding joint
|
// returns a 3 element list that gives corresponding joint
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
|
@ -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)
|
for (child=(Bone*)bone->childbase.first; child; child=(Bone*)child->next)
|
||||||
count++;
|
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)
|
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));
|
PyList_SET_ITEM(childrenlist,count,NewProxyPlus_Ext(NULL,&Type,child,false));
|
||||||
|
|
|
@ -62,11 +62,11 @@ public:
|
||||||
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
// Python access
|
// 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 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);
|
static int py_attr_set_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||||
#endif // WITH_PYTHON
|
#endif // WITH_PYTHON
|
||||||
};
|
};
|
||||||
|
|
|
@ -61,7 +61,7 @@ PyTypeObject BL_ArmatureConstraint::Type = {
|
||||||
py_base_new
|
py_base_new
|
||||||
};
|
};
|
||||||
|
|
||||||
PyObject* BL_ArmatureConstraint::py_repr(void)
|
PyObject *BL_ArmatureConstraint::py_repr(void)
|
||||||
{
|
{
|
||||||
return PyUnicode_FromString(m_name);
|
return PyUnicode_FromString(m_name);
|
||||||
}
|
}
|
||||||
|
@ -267,8 +267,8 @@ PyMethodDef BL_ArmatureConstraint::Methods[] = {
|
||||||
|
|
||||||
PyAttributeDef BL_ArmatureConstraint::Attributes[] = {
|
PyAttributeDef BL_ArmatureConstraint::Attributes[] = {
|
||||||
// Keep these attributes in order of BCA_ defines!!! used by py_attr_getattr and py_attr_setattr
|
// Keep these attributes in order of BCA_ defines!!! used by py_attr_getattr and py_attr_setattr
|
||||||
KX_PYATTRIBUTE_RO_FUNCTION("type",BL_ArmatureConstraint,py_attr_getattr),
|
KX_PYATTRIBUTE_RO_FUNCTION("type",BL_ArmatureConstraint,py_attr_getattr),
|
||||||
KX_PYATTRIBUTE_RO_FUNCTION("name",BL_ArmatureConstraint,py_attr_getattr),
|
KX_PYATTRIBUTE_RO_FUNCTION("name",BL_ArmatureConstraint,py_attr_getattr),
|
||||||
KX_PYATTRIBUTE_RW_FUNCTION("enforce",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr),
|
KX_PYATTRIBUTE_RW_FUNCTION("enforce",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr),
|
||||||
KX_PYATTRIBUTE_RW_FUNCTION("headtail",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr),
|
KX_PYATTRIBUTE_RW_FUNCTION("headtail",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr),
|
||||||
KX_PYATTRIBUTE_RO_FUNCTION("lin_error",BL_ArmatureConstraint,py_attr_getattr),
|
KX_PYATTRIBUTE_RO_FUNCTION("lin_error",BL_ArmatureConstraint,py_attr_getattr),
|
||||||
|
@ -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);
|
BL_ArmatureConstraint* self= static_cast<BL_ArmatureConstraint*>(self_v);
|
||||||
bConstraint* constraint = self->m_constraint;
|
bConstraint* constraint = self->m_constraint;
|
||||||
|
@ -312,12 +312,12 @@ PyObject* BL_ArmatureConstraint::py_attr_getattr(void *self_v, const struct KX_P
|
||||||
case BCA_ROTERROR:
|
case BCA_ROTERROR:
|
||||||
return PyFloat_FromDouble(constraint->rot_error);
|
return PyFloat_FromDouble(constraint->rot_error);
|
||||||
case BCA_TARGET:
|
case BCA_TARGET:
|
||||||
if (!self->m_target)
|
if (!self->m_target)
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
else
|
else
|
||||||
return self->m_target->GetProxy();
|
return self->m_target->GetProxy();
|
||||||
case BCA_SUBTARGET:
|
case BCA_SUBTARGET:
|
||||||
if (!self->m_subtarget)
|
if (!self->m_subtarget)
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
else
|
else
|
||||||
return self->m_subtarget->GetProxy();
|
return self->m_subtarget->GetProxy();
|
||||||
|
|
|
@ -115,9 +115,9 @@ public:
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
|
|
||||||
// Python access
|
// 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 int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||||
#endif // WITH_PYTHON
|
#endif // WITH_PYTHON
|
||||||
};
|
};
|
||||||
|
|
|
@ -430,7 +430,7 @@ void BL_ArmatureObject::ProcessReplica()
|
||||||
|
|
||||||
m_pose = NULL;
|
m_pose = NULL;
|
||||||
m_framePose = NULL;
|
m_framePose = NULL;
|
||||||
game_copy_pose(&m_pose, pose, 1);
|
game_copy_pose(&m_pose, pose, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BL_ArmatureObject::ReParentLogic()
|
void BL_ArmatureObject::ReParentLogic()
|
||||||
|
@ -521,7 +521,7 @@ bool BL_ArmatureObject::SetActiveAction(BL_ActionActuator *act, short priority,
|
||||||
SetPose(m_framePose);
|
SetPose(m_framePose);
|
||||||
if (m_activeAct && (m_activeAct!=act))
|
if (m_activeAct && (m_activeAct!=act))
|
||||||
/* Reset the blend timer since this new action cancels the old one */
|
/* Reset the blend timer since this new action cancels the old one */
|
||||||
m_activeAct->SetBlendTime(0.0);
|
m_activeAct->SetBlendTime(0.0);
|
||||||
}
|
}
|
||||||
m_activeAct = act;
|
m_activeAct = act;
|
||||||
m_activePriority = priority;
|
m_activePriority = priority;
|
||||||
|
@ -648,12 +648,12 @@ PyAttributeDef BL_ArmatureObject::Attributes[] = {
|
||||||
{NULL} //Sentinel
|
{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);
|
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);
|
BL_ArmatureObject* self = static_cast<BL_ArmatureObject*>(self_v);
|
||||||
self->LoadChannels(); // make sure we have the channels
|
self->LoadChannels(); // make sure we have the channels
|
||||||
|
|
|
@ -116,8 +116,8 @@ public:
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
|
|
||||||
// PYTHON
|
// PYTHON
|
||||||
static PyObject* pyattr_get_constraints(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);
|
static PyObject *pyattr_get_channels(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||||
KX_PYMETHOD_DOC_NOARGS(BL_ArmatureObject, update);
|
KX_PYMETHOD_DOC_NOARGS(BL_ArmatureObject, update);
|
||||||
|
|
||||||
#endif // WITH_PYTHON
|
#endif // WITH_PYTHON
|
||||||
|
|
|
@ -216,7 +216,7 @@ static std::map<int, SCA_IInputDevice::KX_EnumInputs> create_translate_table()
|
||||||
|
|
||||||
// SYSTEM
|
// SYSTEM
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* **** XXX **** */
|
/* **** XXX **** */
|
||||||
m[KEYBD ] = SCA_IInputDevice::KX_KEYBD;
|
m[KEYBD ] = SCA_IInputDevice::KX_KEYBD;
|
||||||
m[RAWKEYBD ] = SCA_IInputDevice::KX_RAWKEYBD;
|
m[RAWKEYBD ] = SCA_IInputDevice::KX_RAWKEYBD;
|
||||||
|
@ -229,7 +229,7 @@ static std::map<int, SCA_IInputDevice::KX_EnumInputs> create_translate_table()
|
||||||
m[WINQUIT ] = SCA_IInputDevice::KX_WINQUIT;
|
m[WINQUIT ] = SCA_IInputDevice::KX_WINQUIT;
|
||||||
m[Q_FIRSTTIME ] = SCA_IInputDevice::KX_Q_FIRSTTIME;
|
m[Q_FIRSTTIME ] = SCA_IInputDevice::KX_Q_FIRSTTIME;
|
||||||
/* **** XXX **** */
|
/* **** XXX **** */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// standard keyboard
|
// standard keyboard
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ static void GetRGB(short type,
|
||||||
else { // backup white
|
else { // backup white
|
||||||
c0 = KX_rgbaint2uint_new(color);
|
c0 = KX_rgbaint2uint_new(color);
|
||||||
c1 = KX_rgbaint2uint_new(color);
|
c1 = KX_rgbaint2uint_new(color);
|
||||||
c2 = KX_rgbaint2uint_new(color);
|
c2 = KX_rgbaint2uint_new(color);
|
||||||
if (mface->v4)
|
if (mface->v4)
|
||||||
c3 = KX_rgbaint2uint_new( color );
|
c3 = KX_rgbaint2uint_new( color );
|
||||||
}
|
}
|
||||||
|
@ -469,7 +469,7 @@ static void GetRGB(short type,
|
||||||
}
|
}
|
||||||
c0 = KX_rgbaint2uint_new(color);
|
c0 = KX_rgbaint2uint_new(color);
|
||||||
c1 = KX_rgbaint2uint_new(color);
|
c1 = KX_rgbaint2uint_new(color);
|
||||||
c2 = KX_rgbaint2uint_new(color);
|
c2 = KX_rgbaint2uint_new(color);
|
||||||
if (mface->v4)
|
if (mface->v4)
|
||||||
c3 = KX_rgbaint2uint_new(color);
|
c3 = KX_rgbaint2uint_new(color);
|
||||||
} break;
|
} break;
|
||||||
|
@ -478,7 +478,7 @@ static void GetRGB(short type,
|
||||||
{
|
{
|
||||||
c0 = KX_rgbaint2uint_new(color);
|
c0 = KX_rgbaint2uint_new(color);
|
||||||
c1 = KX_rgbaint2uint_new(color);
|
c1 = KX_rgbaint2uint_new(color);
|
||||||
c2 = KX_rgbaint2uint_new(color);
|
c2 = KX_rgbaint2uint_new(color);
|
||||||
if (mface->v4)
|
if (mface->v4)
|
||||||
c3 = KX_rgbaint2uint_new(color);
|
c3 = KX_rgbaint2uint_new(color);
|
||||||
} break;
|
} break;
|
||||||
|
@ -1150,7 +1150,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
|
||||||
|
|
||||||
rgb0 = KX_rgbaint2uint_new(color);
|
rgb0 = KX_rgbaint2uint_new(color);
|
||||||
rgb1 = KX_rgbaint2uint_new(color);
|
rgb1 = KX_rgbaint2uint_new(color);
|
||||||
rgb2 = KX_rgbaint2uint_new(color);
|
rgb2 = KX_rgbaint2uint_new(color);
|
||||||
|
|
||||||
if (mface->v4)
|
if (mface->v4)
|
||||||
rgb3 = KX_rgbaint2uint_new(color);
|
rgb3 = KX_rgbaint2uint_new(color);
|
||||||
|
@ -1694,7 +1694,7 @@ static void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
|
||||||
objprop.m_soft_numclusteriterations= blenderobject->bsoft->numclusteriterations; /* number of iterations to refine collision clusters*/
|
objprop.m_soft_numclusteriterations= blenderobject->bsoft->numclusteriterations; /* number of iterations to refine collision clusters*/
|
||||||
//objprop.m_soft_welding = blenderobject->bsoft->welding; /* welding */
|
//objprop.m_soft_welding = blenderobject->bsoft->welding; /* welding */
|
||||||
/* disable welding: it doesn't bring any additional stability and it breaks the relation between soft body collision shape and graphic mesh */
|
/* disable welding: it doesn't bring any additional stability and it breaks the relation between soft body collision shape and graphic mesh */
|
||||||
objprop.m_soft_welding = 0.f;
|
objprop.m_soft_welding = 0.f;
|
||||||
objprop.m_margin = blenderobject->bsoft->margin;
|
objprop.m_margin = blenderobject->bsoft->margin;
|
||||||
objprop.m_contactProcessingThreshold = 0.f;
|
objprop.m_contactProcessingThreshold = 0.f;
|
||||||
} else
|
} else
|
||||||
|
@ -2617,7 +2617,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
|
||||||
KX_SlowParentRelation * slow_parent_relation = KX_SlowParentRelation::New(blenderchild->sf);
|
KX_SlowParentRelation * slow_parent_relation = KX_SlowParentRelation::New(blenderchild->sf);
|
||||||
pcit->m_gamechildnode->SetParentRelation(slow_parent_relation);
|
pcit->m_gamechildnode->SetParentRelation(slow_parent_relation);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PARBONE:
|
case PARBONE:
|
||||||
{
|
{
|
||||||
// parent this to a bone
|
// parent this to a bone
|
||||||
|
@ -2741,7 +2741,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create physics joints
|
// create physics joints
|
||||||
for (i=0;i<sumolist->GetCount();i++)
|
for (i=0;i<sumolist->GetCount();i++)
|
||||||
|
@ -2825,7 +2825,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
|
||||||
kxscene->GetPhysicsEnvironment()->setConstraintParam(constraintId,dof,1,-1);
|
kxscene->GetPhysicsEnvironment()->setConstraintParam(constraintId,dof,1,-1);
|
||||||
}
|
}
|
||||||
dofbit<<=1;
|
dofbit<<=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dat->type == PHY_LINEHINGE_CONSTRAINT)
|
else if (dat->type == PHY_LINEHINGE_CONSTRAINT)
|
||||||
{
|
{
|
||||||
|
|
|
@ -89,7 +89,7 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
RAS_Deformer *m_pDeformer;
|
RAS_Deformer *m_pDeformer;
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ bool BL_MeshDeformer::Apply(RAS_IPolyMaterial*)
|
||||||
}
|
}
|
||||||
|
|
||||||
BL_MeshDeformer::~BL_MeshDeformer()
|
BL_MeshDeformer::~BL_MeshDeformer()
|
||||||
{
|
{
|
||||||
if (m_transverts)
|
if (m_transverts)
|
||||||
delete [] m_transverts;
|
delete [] m_transverts;
|
||||||
if (m_transnors)
|
if (m_transnors)
|
||||||
|
|
|
@ -175,7 +175,7 @@ bool BL_ModifierDeformer::Update(void)
|
||||||
* It may not be the case here because of replace mesh actuator */
|
* It may not be the case here because of replace mesh actuator */
|
||||||
Mesh *oldmesh = (Mesh*)blendobj->data;
|
Mesh *oldmesh = (Mesh*)blendobj->data;
|
||||||
blendobj->data = m_bmesh;
|
blendobj->data = m_bmesh;
|
||||||
/* execute the modifiers */
|
/* execute the modifiers */
|
||||||
DerivedMesh *dm = mesh_create_derived_no_virtual(m_scene, blendobj, m_transverts, CD_MASK_MESH);
|
DerivedMesh *dm = mesh_create_derived_no_virtual(m_scene, blendobj, m_transverts, CD_MASK_MESH);
|
||||||
/* restore object data */
|
/* restore object data */
|
||||||
blendobj->data = oldmesh;
|
blendobj->data = oldmesh;
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
Scene *scene,
|
Scene *scene,
|
||||||
Object *bmeshobj,
|
Object *bmeshobj,
|
||||||
RAS_MeshObject *mesh)
|
RAS_MeshObject *mesh)
|
||||||
:
|
:
|
||||||
BL_ShapeDeformer(gameobj,bmeshobj, mesh),
|
BL_ShapeDeformer(gameobj,bmeshobj, mesh),
|
||||||
m_lastModifierUpdate(-1),
|
m_lastModifierUpdate(-1),
|
||||||
m_scene(scene),
|
m_scene(scene),
|
||||||
|
|
|
@ -83,7 +83,7 @@ BL_ShapeActionActuator::BL_ShapeActionActuator(SCA_IObject* gameobj,
|
||||||
m_playtype(playtype),
|
m_playtype(playtype),
|
||||||
m_priority(priority),
|
m_priority(priority),
|
||||||
m_action(action),
|
m_action(action),
|
||||||
m_framepropname(framepropname),
|
m_framepropname(framepropname),
|
||||||
m_propname(propname)
|
m_propname(propname)
|
||||||
{
|
{
|
||||||
m_idptr = new PointerRNA();
|
m_idptr = new PointerRNA();
|
||||||
|
@ -526,7 +526,7 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = {
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v);
|
||||||
return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : "");
|
return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : "");
|
||||||
|
|
|
@ -73,7 +73,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_useShapeDrivers;
|
bool m_useShapeDrivers;
|
||||||
double m_lastShapeUpdate;
|
double m_lastShapeUpdate;
|
||||||
struct Key* m_key;
|
struct Key* m_key;
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ BL_SkinDeformer::BL_SkinDeformer(
|
||||||
class RAS_MeshObject *mesh,
|
class RAS_MeshObject *mesh,
|
||||||
bool release_object,
|
bool release_object,
|
||||||
bool recalc_normal,
|
bool recalc_normal,
|
||||||
BL_ArmatureObject* arma) :
|
BL_ArmatureObject* arma) :
|
||||||
BL_MeshDeformer(gameobj, bmeshobj_old, mesh),
|
BL_MeshDeformer(gameobj, bmeshobj_old, mesh),
|
||||||
m_armobj(arma),
|
m_armobj(arma),
|
||||||
m_lastArmaUpdate(-1),
|
m_lastArmaUpdate(-1),
|
||||||
|
@ -327,7 +327,7 @@ void BL_SkinDeformer::BGEDeformVerts()
|
||||||
bool BL_SkinDeformer::UpdateInternal(bool shape_applied)
|
bool BL_SkinDeformer::UpdateInternal(bool shape_applied)
|
||||||
{
|
{
|
||||||
/* See if the armature has been updated for this frame */
|
/* See if the armature has been updated for this frame */
|
||||||
if (PoseUpdated()) {
|
if (PoseUpdated()) {
|
||||||
|
|
||||||
if (!shape_applied) {
|
if (!shape_applied) {
|
||||||
/* store verts locally */
|
/* store verts locally */
|
||||||
|
|
|
@ -199,7 +199,7 @@ void BlenderWorldInfo::setBackColor(float r, float g, float b)
|
||||||
m_backgroundcolor[2] = b;
|
m_backgroundcolor[2] = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BlenderWorldInfo::setMistStart(
|
BlenderWorldInfo::setMistStart(
|
||||||
float d
|
float d
|
||||||
) {
|
) {
|
||||||
|
@ -215,7 +215,7 @@ BlenderWorldInfo::setMistDistance(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BlenderWorldInfo::setMistColorRed(
|
BlenderWorldInfo::setMistColorRed(
|
||||||
float d
|
float d
|
||||||
) {
|
) {
|
||||||
|
@ -231,7 +231,7 @@ BlenderWorldInfo::setMistColorGreen(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BlenderWorldInfo::setMistColorBlue(
|
BlenderWorldInfo::setMistColorBlue(
|
||||||
float d
|
float d
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -73,27 +73,27 @@ public:
|
||||||
float g,
|
float g,
|
||||||
float b
|
float b
|
||||||
);
|
);
|
||||||
void
|
void
|
||||||
setMistStart(
|
setMistStart(
|
||||||
float d
|
float d
|
||||||
);
|
);
|
||||||
|
|
||||||
void
|
void
|
||||||
setMistDistance(
|
setMistDistance(
|
||||||
float d
|
float d
|
||||||
);
|
);
|
||||||
|
|
||||||
void
|
void
|
||||||
setMistColorRed(
|
setMistColorRed(
|
||||||
float d
|
float d
|
||||||
);
|
);
|
||||||
|
|
||||||
void
|
void
|
||||||
setMistColorGreen(
|
setMistColorGreen(
|
||||||
float d
|
float d
|
||||||
);
|
);
|
||||||
|
|
||||||
void
|
void
|
||||||
setMistColorBlue(
|
setMistColorBlue(
|
||||||
float d
|
float d
|
||||||
);
|
);
|
||||||
|
|
|
@ -78,5 +78,5 @@ KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(const char *r
|
||||||
return *i;
|
return *i;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
BL_InterpolatorList(struct bAction *action);
|
BL_InterpolatorList(struct bAction *action);
|
||||||
~BL_InterpolatorList();
|
~BL_InterpolatorList();
|
||||||
|
|
||||||
KX_IScalarInterpolator *GetScalarInterpolator(const char *rna_path, int array_index);
|
KX_IScalarInterpolator *GetScalarInterpolator(const char *rna_path, int array_index);
|
||||||
|
|
||||||
|
|
||||||
#ifdef WITH_CXX_GUARDEDALLOC
|
#ifdef WITH_CXX_GUARDEDALLOC
|
||||||
|
|
|
@ -160,7 +160,7 @@ KX_BlenderSceneConverter::~KX_BlenderSceneConverter()
|
||||||
while (itmat != m_materials.end()) {
|
while (itmat != m_materials.end()) {
|
||||||
delete (*itmat).second;
|
delete (*itmat).second;
|
||||||
itmat++;
|
itmat++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vector<pair<KX_Scene*,RAS_MeshObject*> >::iterator itm = m_meshobjects.begin();
|
vector<pair<KX_Scene*,RAS_MeshObject*> >::iterator itm = m_meshobjects.begin();
|
||||||
|
@ -201,7 +201,7 @@ bool KX_BlenderSceneConverter::TryAndLoadNewFile()
|
||||||
// if not, clear the newfilename
|
// if not, clear the newfilename
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_newfilename = "";
|
m_newfilename = "";
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return result;
|
return result;
|
||||||
|
@ -335,7 +335,7 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene,
|
||||||
ccdPhysEnv->setDebugMode(btIDebugDraw::DBG_DrawWireframe|btIDebugDraw::DBG_DrawAabb|btIDebugDraw::DBG_DrawContactPoints|btIDebugDraw::DBG_DrawText|btIDebugDraw::DBG_DrawConstraintLimits|btIDebugDraw::DBG_DrawConstraints);
|
ccdPhysEnv->setDebugMode(btIDebugDraw::DBG_DrawWireframe|btIDebugDraw::DBG_DrawAabb|btIDebugDraw::DBG_DrawContactPoints|btIDebugDraw::DBG_DrawText|btIDebugDraw::DBG_DrawConstraintLimits|btIDebugDraw::DBG_DrawConstraints);
|
||||||
|
|
||||||
//todo: get a button in blender ?
|
//todo: get a button in blender ?
|
||||||
//disable / enable debug drawing (contact points, aabb's etc)
|
//disable / enable debug drawing (contact points, aabb's etc)
|
||||||
//ccdPhysEnv->setDebugMode(1);
|
//ccdPhysEnv->setDebugMode(1);
|
||||||
destinationscene->SetPhysicsEnvironment(ccdPhysEnv);
|
destinationscene->SetPhysicsEnvironment(ccdPhysEnv);
|
||||||
break;
|
break;
|
||||||
|
@ -689,7 +689,7 @@ void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo(bool clearIpo)
|
||||||
|
|
||||||
void KX_BlenderSceneConverter::resetNoneDynamicObjectToIpo()
|
void KX_BlenderSceneConverter::resetNoneDynamicObjectToIpo()
|
||||||
{
|
{
|
||||||
if (addInitFromFrame) {
|
if (addInitFromFrame) {
|
||||||
KX_SceneList* scenes = m_ketsjiEngine->CurrentScenes();
|
KX_SceneList* scenes = m_ketsjiEngine->CurrentScenes();
|
||||||
int numScenes = scenes->size();
|
int numScenes = scenes->size();
|
||||||
if (numScenes>=0) {
|
if (numScenes>=0) {
|
||||||
|
@ -704,7 +704,7 @@ void KX_BlenderSceneConverter::resetNoneDynamicObjectToIpo()
|
||||||
if (blenderobject->type==OB_ARMATURE)
|
if (blenderobject->type==OB_ARMATURE)
|
||||||
continue;
|
continue;
|
||||||
float eu[3];
|
float eu[3];
|
||||||
mat4_to_eul(eu,blenderobject->obmat);
|
mat4_to_eul(eu,blenderobject->obmat);
|
||||||
MT_Point3 pos = MT_Point3(
|
MT_Point3 pos = MT_Point3(
|
||||||
blenderobject->obmat[3][0],
|
blenderobject->obmat[3][0],
|
||||||
blenderobject->obmat[3][1],
|
blenderobject->obmat[3][1],
|
||||||
|
@ -779,8 +779,8 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
|
||||||
//const MT_Vector3& scale = gameObj->NodeGetWorldScaling();
|
//const MT_Vector3& scale = gameObj->NodeGetWorldScaling();
|
||||||
const MT_Matrix3x3& orn = gameObj->NodeGetWorldOrientation();
|
const MT_Matrix3x3& orn = gameObj->NodeGetWorldOrientation();
|
||||||
|
|
||||||
float eulerAngles[3];
|
float eulerAngles[3];
|
||||||
float eulerAnglesOld[3] = {0.0f, 0.0f, 0.0f};
|
float eulerAnglesOld[3] = {0.0f, 0.0f, 0.0f};
|
||||||
float tmat[3][3];
|
float tmat[3][3];
|
||||||
|
|
||||||
// XXX animato
|
// XXX animato
|
||||||
|
@ -984,7 +984,7 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
|
||||||
}
|
}
|
||||||
|
|
||||||
main_newlib= (Main *)MEM_callocN( sizeof(Main), "BgeMain");
|
main_newlib= (Main *)MEM_callocN( sizeof(Main), "BgeMain");
|
||||||
BKE_reports_init(&reports, RPT_STORE);
|
BKE_reports_init(&reports, RPT_STORE);
|
||||||
|
|
||||||
load_datablocks(main_newlib, bpy_openlib, path, idcode);
|
load_datablocks(main_newlib, bpy_openlib, path, idcode);
|
||||||
|
|
||||||
|
@ -1000,11 +1000,11 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
|
||||||
BLO_blendhandle_close(bpy_openlib);
|
BLO_blendhandle_close(bpy_openlib);
|
||||||
|
|
||||||
BKE_reports_clear(&reports);
|
BKE_reports_clear(&reports);
|
||||||
/* done linking */
|
/* done linking */
|
||||||
|
|
||||||
/* needed for lookups*/
|
/* needed for lookups*/
|
||||||
GetMainDynamic().push_back(main_newlib);
|
GetMainDynamic().push_back(main_newlib);
|
||||||
strncpy(main_newlib->name, path, sizeof(main_newlib->name));
|
strncpy(main_newlib->name, path, sizeof(main_newlib->name));
|
||||||
|
|
||||||
|
|
||||||
if (idcode==ID_ME) {
|
if (idcode==ID_ME) {
|
||||||
|
@ -1028,7 +1028,7 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
|
||||||
scene_merge->GetLogicManager()->RegisterActionName(action->name+2, action);
|
scene_merge->GetLogicManager()->RegisterActionName(action->name+2, action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (idcode==ID_SCE) {
|
else if (idcode==ID_SCE) {
|
||||||
/* Merge all new linked in scene into the existing one */
|
/* Merge all new linked in scene into the existing one */
|
||||||
ID *scene;
|
ID *scene;
|
||||||
for (scene= (ID *)main_newlib->scene.first; scene; scene= (ID *)scene->next ) {
|
for (scene= (ID *)main_newlib->scene.first; scene; scene= (ID *)scene->next ) {
|
||||||
|
@ -1117,7 +1117,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
|
||||||
{
|
{
|
||||||
RAS_MeshObject *meshobj= (RAS_MeshObject *) *mapStringToMeshes.at(i);
|
RAS_MeshObject *meshobj= (RAS_MeshObject *) *mapStringToMeshes.at(i);
|
||||||
if (meshobj && IS_TAGGED(meshobj->GetMesh()))
|
if (meshobj && IS_TAGGED(meshobj->GetMesh()))
|
||||||
{
|
{
|
||||||
STR_HashedString mn = meshobj->GetName();
|
STR_HashedString mn = meshobj->GetName();
|
||||||
mapStringToMeshes.remove(mn);
|
mapStringToMeshes.remove(mn);
|
||||||
m_map_mesh_to_gamemesh.remove(CHashedPtr(meshobj->GetMesh()));
|
m_map_mesh_to_gamemesh.remove(CHashedPtr(meshobj->GetMesh()));
|
||||||
|
@ -1255,7 +1255,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
|
||||||
RAS_IPolyMaterial *mat= (*polymit).second;
|
RAS_IPolyMaterial *mat= (*polymit).second;
|
||||||
Material *bmat= NULL;
|
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) {
|
if (mat->GetFlag() & RAS_BLENDERMAT) {
|
||||||
KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(mat);
|
KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(mat);
|
||||||
bmat= bl_mat->GetBlenderMaterial();
|
bmat= bl_mat->GetBlenderMaterial();
|
||||||
|
@ -1280,7 +1280,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
|
||||||
RAS_IPolyMaterial *mat= (*polymit).second;
|
RAS_IPolyMaterial *mat= (*polymit).second;
|
||||||
Material *bmat= NULL;
|
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) {
|
if (mat->GetFlag() & RAS_BLENDERMAT) {
|
||||||
KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(mat);
|
KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(mat);
|
||||||
bmat= bl_mat->GetBlenderMaterial();
|
bmat= bl_mat->GetBlenderMaterial();
|
||||||
|
|
|
@ -903,7 +903,7 @@ void BL_ConvertActuators(const char* maggiename,
|
||||||
modeArg = SCA_RandomActuator::KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL;
|
modeArg = SCA_RandomActuator::KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
; /* error */
|
; /* error */
|
||||||
}
|
}
|
||||||
tmprandomact = new SCA_RandomActuator(gameobj,
|
tmprandomact = new SCA_RandomActuator(gameobj,
|
||||||
seedArg,
|
seedArg,
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
static void
|
static void
|
||||||
LinkControllerToActuators(
|
LinkControllerToActuators(
|
||||||
SCA_IController *game_controller,
|
SCA_IController *game_controller,
|
||||||
bController* bcontr,
|
bController* bcontr,
|
||||||
SCA_LogicManager* logicmgr,
|
SCA_LogicManager* logicmgr,
|
||||||
KX_BlenderSceneConverter* converter
|
KX_BlenderSceneConverter* converter
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan
|
||||||
{
|
{
|
||||||
|
|
||||||
bProperty* prop = (bProperty*)object->prop.first;
|
bProperty* prop = (bProperty*)object->prop.first;
|
||||||
CValue* propval;
|
CValue* propval;
|
||||||
bool show_debug_info;
|
bool show_debug_info;
|
||||||
while(prop)
|
while(prop)
|
||||||
{
|
{
|
||||||
|
|
|
@ -183,7 +183,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
|
||||||
|
|
||||||
|
|
||||||
if (gameobj->GetPhysicsController())
|
if (gameobj->GetPhysicsController())
|
||||||
{
|
{
|
||||||
gamesensor = new KX_TouchSensor(eventmgr,
|
gamesensor = new KX_TouchSensor(eventmgr,
|
||||||
gameobj,
|
gameobj,
|
||||||
bFindMaterial,
|
bFindMaterial,
|
||||||
|
@ -209,7 +209,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
|
||||||
}
|
}
|
||||||
bool bFindMaterial = true;
|
bool bFindMaterial = true;
|
||||||
if (gameobj->GetPhysicsController())
|
if (gameobj->GetPhysicsController())
|
||||||
{
|
{
|
||||||
gamesensor = new KX_TouchSensor(eventmgr,
|
gamesensor = new KX_TouchSensor(eventmgr,
|
||||||
gameobj,
|
gameobj,
|
||||||
bFindMaterial,
|
bFindMaterial,
|
||||||
|
@ -224,7 +224,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
|
||||||
KX_NetworkEventManager* eventmgr = (KX_NetworkEventManager*)
|
KX_NetworkEventManager* eventmgr = (KX_NetworkEventManager*)
|
||||||
logicmgr->FindEventManager(SCA_EventManager::NETWORK_EVENTMGR);
|
logicmgr->FindEventManager(SCA_EventManager::NETWORK_EVENTMGR);
|
||||||
if (eventmgr) {
|
if (eventmgr) {
|
||||||
bMessageSensor* msgSens = (bMessageSensor*) sens->data;
|
bMessageSensor* msgSens = (bMessageSensor*) sens->data;
|
||||||
|
|
||||||
/* Get our NetworkScene */
|
/* Get our NetworkScene */
|
||||||
NG_NetworkScene *NetworkScene = kxscene->GetNetworkScene();
|
NG_NetworkScene *NetworkScene = kxscene->GetNetworkScene();
|
||||||
|
@ -247,7 +247,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
|
||||||
SCA_EventManager* eventmgr = logicmgr->FindEventManager(SCA_EventManager::TOUCH_EVENTMGR);
|
SCA_EventManager* eventmgr = logicmgr->FindEventManager(SCA_EventManager::TOUCH_EVENTMGR);
|
||||||
if (eventmgr)
|
if (eventmgr)
|
||||||
{
|
{
|
||||||
STR_String nearpropertyname;
|
STR_String nearpropertyname;
|
||||||
bNearSensor* blendernearsensor = (bNearSensor*)sens->data;
|
bNearSensor* blendernearsensor = (bNearSensor*)sens->data;
|
||||||
if (blendernearsensor->name)
|
if (blendernearsensor->name)
|
||||||
{
|
{
|
||||||
|
@ -311,7 +311,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
|
||||||
}
|
}
|
||||||
case SENS_MOUSE:
|
case SENS_MOUSE:
|
||||||
{
|
{
|
||||||
int keytype = SCA_MouseSensor::KX_MOUSESENSORMODE_NODEF;
|
int keytype = SCA_MouseSensor::KX_MOUSESENSORMODE_NODEF;
|
||||||
int trackfocus = 0;
|
int trackfocus = 0;
|
||||||
bMouseSensor *bmouse = (bMouseSensor *)sens->data;
|
bMouseSensor *bmouse = (bMouseSensor *)sens->data;
|
||||||
|
|
||||||
|
@ -639,7 +639,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
|
||||||
gamesensor->SetInvert(invert);
|
gamesensor->SetInvert(invert);
|
||||||
gamesensor->SetLevel(level);
|
gamesensor->SetLevel(level);
|
||||||
gamesensor->SetTap(tap);
|
gamesensor->SetTap(tap);
|
||||||
gamesensor->SetName(sens->name);
|
gamesensor->SetName(sens->name);
|
||||||
|
|
||||||
gameobj->AddSensor(gamesensor);
|
gameobj->AddSensor(gamesensor);
|
||||||
|
|
||||||
|
|
|
@ -76,12 +76,12 @@ static BL_InterpolatorList *GetAdtList(struct bAction *for_act, KX_BlenderSceneC
|
||||||
{
|
{
|
||||||
BL_InterpolatorList *adtList= converter->FindInterpolatorList(for_act);
|
BL_InterpolatorList *adtList= converter->FindInterpolatorList(for_act);
|
||||||
|
|
||||||
if (!adtList) {
|
if (!adtList) {
|
||||||
adtList = new BL_InterpolatorList(for_act);
|
adtList = new BL_InterpolatorList(for_act);
|
||||||
converter->RegisterInterpolatorList(adtList, for_act);
|
converter->RegisterInterpolatorList(adtList, for_act);
|
||||||
}
|
}
|
||||||
|
|
||||||
return adtList;
|
return adtList;
|
||||||
}
|
}
|
||||||
|
|
||||||
SG_Controller *BL_CreateIPO(struct bAction *action, KX_GameObject* gameobj, KX_BlenderSceneConverter *converter)
|
SG_Controller *BL_CreateIPO(struct bAction *action, KX_GameObject* gameobj, KX_BlenderSceneConverter *converter)
|
||||||
|
@ -441,7 +441,7 @@ static void ConvertMaterialIpos(
|
||||||
}
|
}
|
||||||
interpolator= new KX_ScalarInterpolator(&ipocontr->m_ref, sinterp);
|
interpolator= new KX_ScalarInterpolator(&ipocontr->m_ref, sinterp);
|
||||||
ipocontr->AddInterpolator(interpolator);
|
ipocontr->AddInterpolator(interpolator);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sinterp = adtList->GetScalarInterpolator("emit", 0))) {
|
if ((sinterp = adtList->GetScalarInterpolator("emit", 0))) {
|
||||||
if (!ipocontr) {
|
if (!ipocontr) {
|
||||||
|
@ -452,7 +452,7 @@ static void ConvertMaterialIpos(
|
||||||
interpolator= new KX_ScalarInterpolator(&ipocontr->m_emit, sinterp);
|
interpolator= new KX_ScalarInterpolator(&ipocontr->m_emit, sinterp);
|
||||||
ipocontr->AddInterpolator(interpolator);
|
ipocontr->AddInterpolator(interpolator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BL_ConvertMaterialIpos(
|
void BL_ConvertMaterialIpos(
|
||||||
|
|
|
@ -205,7 +205,7 @@ CValue* CBoolValue::GetReplica()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
PyObject* CBoolValue::ConvertValueToPython()
|
PyObject *CBoolValue::ConvertValueToPython()
|
||||||
{
|
{
|
||||||
return PyBool_FromLong(m_bool != 0);
|
return PyBool_FromLong(m_bool != 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
class CBoolValue : public CPropValue
|
class CBoolValue : public CPropValue
|
||||||
{
|
{
|
||||||
|
|
||||||
//PLUGIN_DECLARE_SERIAL(CBoolValue,CValue)
|
//PLUGIN_DECLARE_SERIAL(CBoolValue,CValue)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const STR_String sTrueString;
|
static const STR_String sTrueString;
|
||||||
|
|
|
@ -314,7 +314,7 @@ CValue* CFloatValue::GetReplica()
|
||||||
|
|
||||||
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
PyObject* CFloatValue::ConvertValueToPython()
|
PyObject *CFloatValue::ConvertValueToPython()
|
||||||
{
|
{
|
||||||
return PyFloat_FromDouble(m_float);
|
return PyFloat_FromDouble(m_float);
|
||||||
}
|
}
|
||||||
|
|
|
@ -543,7 +543,7 @@ CExpression *CParser::Ex(int i)
|
||||||
}
|
}
|
||||||
e1 = Error(errtext);
|
e1 = Error(errtext);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
NextSym();
|
NextSym();
|
||||||
|
@ -573,7 +573,7 @@ CExpression* CParser::ProcessText
|
||||||
text = intext;
|
text = intext;
|
||||||
|
|
||||||
|
|
||||||
chcount = 0;
|
chcount = 0;
|
||||||
if (text.Length() == 0) {
|
if (text.Length() == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -326,7 +326,7 @@ void CIntValue::SetValue(CValue* newval)
|
||||||
|
|
||||||
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
PyObject* CIntValue::ConvertValueToPython()
|
PyObject *CIntValue::ConvertValueToPython()
|
||||||
{
|
{
|
||||||
if ((m_int > INT_MIN) && (m_int < INT_MAX))
|
if ((m_int > INT_MIN) && (m_int < INT_MAX))
|
||||||
return PyLong_FromSsize_t(m_int);
|
return PyLong_FromSsize_t(m_int);
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
inline friend bool operator ==( const CHashedPtr & rhs,const CHashedPtr & lhs)
|
inline friend bool operator ==( const CHashedPtr & rhs,const CHashedPtr & lhs)
|
||||||
{
|
{
|
||||||
return rhs.m_valptr == lhs.m_valptr;
|
return rhs.m_valptr == lhs.m_valptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef WITH_CXX_GUARDEDALLOC
|
#ifdef WITH_CXX_GUARDEDALLOC
|
||||||
|
|
|
@ -278,7 +278,7 @@ bool CListValue::IsModified()
|
||||||
/* Python interface ---------------------------------------------------- */
|
/* 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));
|
CListValue *list= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||||
if (list==NULL)
|
if (list==NULL)
|
||||||
|
@ -287,7 +287,7 @@ static Py_ssize_t listvalue_bufferlen(PyObject* self)
|
||||||
return (Py_ssize_t)list->GetCount();
|
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));
|
CListValue *list= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||||
CValue *cval;
|
CValue *cval;
|
||||||
|
@ -309,14 +309,14 @@ static PyObject* listvalue_buffer_item(PyObject* self, Py_ssize_t index)
|
||||||
|
|
||||||
cval= list->GetValue(index);
|
cval= list->GetValue(index);
|
||||||
|
|
||||||
PyObject* pyobj = cval->ConvertValueToPython();
|
PyObject *pyobj = cval->ConvertValueToPython();
|
||||||
if (pyobj)
|
if (pyobj)
|
||||||
return pyobj;
|
return pyobj;
|
||||||
else
|
else
|
||||||
return cval->GetProxy();
|
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));
|
CListValue *list= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||||
if (list==NULL) {
|
if (list==NULL) {
|
||||||
|
@ -328,7 +328,7 @@ static PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex)
|
||||||
{
|
{
|
||||||
CValue *item = ((CListValue*) list)->FindValue(_PyUnicode_AsString(pyindex));
|
CValue *item = ((CListValue*) list)->FindValue(_PyUnicode_AsString(pyindex));
|
||||||
if (item) {
|
if (item) {
|
||||||
PyObject* pyobj = item->ConvertValueToPython();
|
PyObject *pyobj = item->ConvertValueToPython();
|
||||||
if (pyobj)
|
if (pyobj)
|
||||||
return pyobj;
|
return pyobj;
|
||||||
else
|
else
|
||||||
|
@ -348,7 +348,7 @@ static PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex)
|
||||||
|
|
||||||
|
|
||||||
/* just slice it into a python list... */
|
/* 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));
|
CListValue *list= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||||
if (list==NULL) {
|
if (list==NULL) {
|
||||||
|
@ -374,17 +374,17 @@ static PyObject* listvalue_buffer_slice(PyObject* self,Py_ssize_t ilow, Py_ssize
|
||||||
|
|
||||||
for (i = ilow, j = 0; i < ihigh; i++, j++)
|
for (i = ilow, j = 0; i < ihigh; i++, j++)
|
||||||
{
|
{
|
||||||
PyObject* pyobj = list->GetValue(i)->ConvertValueToPython();
|
PyObject *pyobj = list->GetValue(i)->ConvertValueToPython();
|
||||||
if (!pyobj)
|
if (!pyobj)
|
||||||
pyobj = list->GetValue(i)->GetProxy();
|
pyobj = list->GetValue(i)->GetProxy();
|
||||||
PyList_SET_ITEM(newlist, i, pyobj);
|
PyList_SET_ITEM(newlist, i, pyobj);
|
||||||
}
|
}
|
||||||
return newlist;
|
return newlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* clist + list, return a list that python owns */
|
/* 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));
|
CListValue *listval= static_cast<CListValue *>(BGE_PROXY_REF(self));
|
||||||
Py_ssize_t i, numitems, numitems_orig;
|
Py_ssize_t i, numitems, numitems_orig;
|
||||||
|
@ -560,7 +560,7 @@ PyAttributeDef CListValue::Attributes[] = {
|
||||||
{ NULL } //Sentinel
|
{ NULL } //Sentinel
|
||||||
};
|
};
|
||||||
|
|
||||||
PyObject* CListValue::Pyappend(PyObject* value)
|
PyObject *CListValue::Pyappend(PyObject *value)
|
||||||
{
|
{
|
||||||
CValue* objval = ConvertPythonToValue(value, "CList.append(i): CValueList, ");
|
CValue* objval = ConvertPythonToValue(value, "CList.append(i): CValueList, ");
|
||||||
|
|
||||||
|
@ -577,15 +577,15 @@ PyObject* CListValue::Pyappend(PyObject* value)
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* CListValue::Pyreverse()
|
PyObject *CListValue::Pyreverse()
|
||||||
{
|
{
|
||||||
std::reverse(m_pValueArray.begin(),m_pValueArray.end());
|
std::reverse(m_pValueArray.begin(),m_pValueArray.end());
|
||||||
Py_RETURN_NONE;
|
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, ");
|
CValue* checkobj = ConvertPythonToValue(value, "val = cList[i]: CValueList, ");
|
||||||
if (checkobj==NULL)
|
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;
|
int numfound = 0;
|
||||||
|
|
||||||
|
@ -638,17 +638,17 @@ PyObject* CListValue::Pycount(PyObject* value)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Matches python dict.get(key, [default]) */
|
/* Matches python dict.get(key, [default]) */
|
||||||
PyObject* CListValue::Pyget(PyObject *args)
|
PyObject *CListValue::Pyget(PyObject *args)
|
||||||
{
|
{
|
||||||
char *key;
|
char *key;
|
||||||
PyObject* def = Py_None;
|
PyObject *def = Py_None;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "s|O:get", &key, &def))
|
if (!PyArg_ParseTuple(args, "s|O:get", &key, &def))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
CValue *item = FindValue((const char *)key);
|
CValue *item = FindValue((const char *)key);
|
||||||
if (item) {
|
if (item) {
|
||||||
PyObject* pyobj = item->ConvertValueToPython();
|
PyObject *pyobj = item->ConvertValueToPython();
|
||||||
if (pyobj)
|
if (pyobj)
|
||||||
return pyobj;
|
return pyobj;
|
||||||
else
|
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);
|
uintptr_t id= (uintptr_t)PyLong_AsVoidPtr(value);
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
bool CheckEqual(CValue* first,CValue* second);
|
bool CheckEqual(CValue* first,CValue* second);
|
||||||
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
virtual PyObject* py_repr(void) {
|
virtual PyObject *py_repr(void) {
|
||||||
PyObject *py_proxy= this->GetProxy();
|
PyObject *py_proxy= this->GetProxy();
|
||||||
PyObject *py_list= PySequence_List(py_proxy);
|
PyObject *py_list= PySequence_List(py_proxy);
|
||||||
PyObject *py_string= PyObject_Repr(py_list);
|
PyObject *py_string= PyObject_Repr(py_list);
|
||||||
|
|
|
@ -102,7 +102,7 @@ and m_rhs
|
||||||
|
|
||||||
m_cached_calculate = ffleft->Calc(m_op,ffright);
|
m_cached_calculate = ffleft->Calc(m_op,ffright);
|
||||||
|
|
||||||
//if (m_cached_calculate)
|
//if (m_cached_calculate)
|
||||||
// m_cached_calculate->Action(CValue::SETOWNEREXPR,&CVoidValue(this,false,CValue::STACKVALUE));
|
// m_cached_calculate->Action(CValue::SETOWNEREXPR,&CVoidValue(this,false,CValue::STACKVALUE));
|
||||||
|
|
||||||
ffleft->Release();
|
ffleft->Release();
|
||||||
|
@ -163,7 +163,7 @@ bool COperator2Expr::IsInside(float x, float y, float z,bool bBorderInclude)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return inside;
|
return inside;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ CExpression* COperator2Expr::CheckLink(std::vector<CBrokenLinkInfo*>& brokenlink
|
||||||
|
|
||||||
if (m_rhs)
|
if (m_rhs)
|
||||||
return Release(m_rhs->AddRef());
|
return Release(m_rhs->AddRef());
|
||||||
/
|
/
|
||||||
|
|
||||||
*/
|
*/
|
||||||
return Release();
|
return Release();
|
||||||
|
|
|
@ -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;
|
PyTypeObject *base_type;
|
||||||
PyObjectPlus_Proxy *base = NULL;
|
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);
|
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;
|
ptr += attrdef->m_offset;
|
||||||
if (attrdef->m_length > 1)
|
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++)
|
for (unsigned int i=0; i<attrdef->m_length; i++)
|
||||||
{
|
{
|
||||||
switch (attrdef->m_type) {
|
switch (attrdef->m_type) {
|
||||||
|
@ -420,7 +420,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
|
||||||
#ifdef USE_MATHUTILS
|
#ifdef USE_MATHUTILS
|
||||||
return Vector_CreatePyObject(val, attrdef->m_imax, Py_NEW, NULL);
|
return Vector_CreatePyObject(val, attrdef->m_imax, Py_NEW, NULL);
|
||||||
#else
|
#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++)
|
for (unsigned int i=0; i<attrdef->m_imax; i++)
|
||||||
{
|
{
|
||||||
PyList_SET_ITEM(resultlist,i,PyFloat_FromDouble(val[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
|
#ifdef USE_MATHUTILS
|
||||||
return Matrix_CreatePyObject(val, attrdef->m_imin, attrdef->m_imax, Py_WRAP, NULL);
|
return Matrix_CreatePyObject(val, attrdef->m_imin, attrdef->m_imax, Py_WRAP, NULL);
|
||||||
#else
|
#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++)
|
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++)
|
for (unsigned int j=0; j<attrdef->m_imax; j++)
|
||||||
{
|
{
|
||||||
PyList_SET_ITEM(col,j,PyFloat_FromDouble(val[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);
|
val->getValue(fval);
|
||||||
return Vector_CreatePyObject(fval, 3, Py_NEW, NULL);
|
return Vector_CreatePyObject(fval, 3, Py_NEW, NULL);
|
||||||
#else
|
#else
|
||||||
PyObject* resultlist = PyList_New(3);
|
PyObject *resultlist = PyList_New(3);
|
||||||
for (unsigned int i=0; i<3; i++)
|
for (unsigned int i=0; i<3; i++)
|
||||||
{
|
{
|
||||||
PyList_SET_ITEM(resultlist,i,PyFloat_FromDouble((*val)[i]));
|
PyList_SET_ITEM(resultlist,i,PyFloat_FromDouble((*val)[i]));
|
||||||
|
@ -1100,7 +1100,7 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt
|
||||||
}
|
}
|
||||||
if (undoBuffer)
|
if (undoBuffer)
|
||||||
free(undoBuffer);
|
free(undoBuffer);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1139,7 +1139,7 @@ PyObject *PyObjectPlus::NewProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, v
|
||||||
if (!self)
|
if (!self)
|
||||||
{
|
{
|
||||||
// in case of proxy without reference to game object
|
// 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_PYREF(proxy) = false;
|
||||||
BGE_PROXY_PYOWNS(proxy) = py_owns;
|
BGE_PROXY_PYOWNS(proxy) = py_owns;
|
||||||
BGE_PROXY_REF(proxy) = NULL;
|
BGE_PROXY_REF(proxy) = NULL;
|
||||||
|
|
|
@ -190,9 +190,9 @@ public: \
|
||||||
* macro is one that also requires a documentation string
|
* macro is one that also requires a documentation string
|
||||||
*/
|
*/
|
||||||
#define KX_PYMETHOD(class_name, method_name) \
|
#define KX_PYMETHOD(class_name, method_name) \
|
||||||
PyObject* Py##method_name(PyObject* args, PyObject* kwds); \
|
PyObject *Py##method_name(PyObject *args, PyObject *kwds); \
|
||||||
static PyObject* \
|
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) { \
|
if(BGE_PROXY_REF(self)==NULL) { \
|
||||||
PyErr_SetString(PyExc_RuntimeError, \
|
PyErr_SetString(PyExc_RuntimeError, \
|
||||||
#class_name "." #method_name "() - " \
|
#class_name "." #method_name "() - " \
|
||||||
|
@ -203,9 +203,9 @@ public: \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
#define KX_PYMETHOD_VARARGS(class_name, method_name) \
|
#define KX_PYMETHOD_VARARGS(class_name, method_name) \
|
||||||
PyObject* Py##method_name(PyObject* args); \
|
PyObject *Py##method_name(PyObject *args); \
|
||||||
static PyObject* \
|
static PyObject* \
|
||||||
sPy##method_name(PyObject* self, PyObject* args) { \
|
sPy##method_name(PyObject *self, PyObject *args) { \
|
||||||
if(BGE_PROXY_REF(self)==NULL) { \
|
if(BGE_PROXY_REF(self)==NULL) { \
|
||||||
PyErr_SetString(PyExc_RuntimeError, \
|
PyErr_SetString(PyExc_RuntimeError, \
|
||||||
#class_name "." #method_name "() - " \
|
#class_name "." #method_name "() - " \
|
||||||
|
@ -215,9 +215,9 @@ public: \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
#define KX_PYMETHOD_NOARGS(class_name, method_name) \
|
#define KX_PYMETHOD_NOARGS(class_name, method_name) \
|
||||||
PyObject* Py##method_name(); \
|
PyObject *Py##method_name(); \
|
||||||
static PyObject* \
|
static PyObject* \
|
||||||
sPy##method_name(PyObject* self) { \
|
sPy##method_name(PyObject *self) { \
|
||||||
if(BGE_PROXY_REF(self)==NULL) { \
|
if(BGE_PROXY_REF(self)==NULL) { \
|
||||||
PyErr_SetString(PyExc_RuntimeError, \
|
PyErr_SetString(PyExc_RuntimeError, \
|
||||||
#class_name "." #method_name "() - " \
|
#class_name "." #method_name "() - " \
|
||||||
|
@ -227,9 +227,9 @@ public: \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
#define KX_PYMETHOD_O(class_name, method_name) \
|
#define KX_PYMETHOD_O(class_name, method_name) \
|
||||||
PyObject* Py##method_name(PyObject* value); \
|
PyObject *Py##method_name(PyObject *value); \
|
||||||
static PyObject* \
|
static PyObject* \
|
||||||
sPy##method_name(PyObject* self, PyObject* value) { \
|
sPy##method_name(PyObject *self, PyObject *value) { \
|
||||||
if(BGE_PROXY_REF(self)==NULL) { \
|
if(BGE_PROXY_REF(self)==NULL) { \
|
||||||
PyErr_SetString(PyExc_RuntimeError, \
|
PyErr_SetString(PyExc_RuntimeError, \
|
||||||
#class_name "." #method_name "(value) - " \
|
#class_name "." #method_name "(value) - " \
|
||||||
|
@ -239,9 +239,9 @@ public: \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
#define KX_PYMETHOD_DOC(class_name, method_name) \
|
#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* \
|
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) { \
|
if(BGE_PROXY_REF(self)==NULL) { \
|
||||||
PyErr_SetString(PyExc_RuntimeError, \
|
PyErr_SetString(PyExc_RuntimeError, \
|
||||||
#class_name "." #method_name "(...) - " \
|
#class_name "." #method_name "(...) - " \
|
||||||
|
@ -252,9 +252,9 @@ public: \
|
||||||
static const char method_name##_doc[]; \
|
static const char method_name##_doc[]; \
|
||||||
|
|
||||||
#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \
|
#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \
|
||||||
PyObject* Py##method_name(PyObject* args); \
|
PyObject *Py##method_name(PyObject *args); \
|
||||||
static PyObject* \
|
static PyObject* \
|
||||||
sPy##method_name(PyObject* self, PyObject* args) { \
|
sPy##method_name(PyObject *self, PyObject *args) { \
|
||||||
if(BGE_PROXY_REF(self)==NULL) { \
|
if(BGE_PROXY_REF(self)==NULL) { \
|
||||||
PyErr_SetString(PyExc_RuntimeError, \
|
PyErr_SetString(PyExc_RuntimeError, \
|
||||||
#class_name "." #method_name "(...) - " \
|
#class_name "." #method_name "(...) - " \
|
||||||
|
@ -266,9 +266,9 @@ public: \
|
||||||
static const char method_name##_doc[]; \
|
static const char method_name##_doc[]; \
|
||||||
|
|
||||||
#define KX_PYMETHOD_DOC_O(class_name, method_name) \
|
#define KX_PYMETHOD_DOC_O(class_name, method_name) \
|
||||||
PyObject* Py##method_name(PyObject* value); \
|
PyObject *Py##method_name(PyObject *value); \
|
||||||
static PyObject* \
|
static PyObject * \
|
||||||
sPy##method_name(PyObject* self, PyObject* value) { \
|
sPy##method_name(PyObject *self, PyObject *value) { \
|
||||||
if(BGE_PROXY_REF(self)==NULL) { \
|
if(BGE_PROXY_REF(self)==NULL) { \
|
||||||
PyErr_SetString(PyExc_RuntimeError, \
|
PyErr_SetString(PyExc_RuntimeError, \
|
||||||
#class_name "." #method_name "(value) - " \
|
#class_name "." #method_name "(value) - " \
|
||||||
|
@ -280,9 +280,9 @@ public: \
|
||||||
static const char method_name##_doc[]; \
|
static const char method_name##_doc[]; \
|
||||||
|
|
||||||
#define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \
|
#define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \
|
||||||
PyObject* Py##method_name(); \
|
PyObject *Py##method_name(); \
|
||||||
static PyObject* \
|
static PyObject * \
|
||||||
sPy##method_name(PyObject* self) { \
|
sPy##method_name(PyObject *self) { \
|
||||||
if(BGE_PROXY_REF(self)==NULL) { \
|
if(BGE_PROXY_REF(self)==NULL) { \
|
||||||
PyErr_SetString(PyExc_RuntimeError, \
|
PyErr_SetString(PyExc_RuntimeError, \
|
||||||
#class_name "." #method_name "() - " \
|
#class_name "." #method_name "() - " \
|
||||||
|
@ -315,19 +315,19 @@ public: \
|
||||||
*/
|
*/
|
||||||
#define KX_PYMETHODDEF_DOC(class_name, method_name, doc_string) \
|
#define KX_PYMETHODDEF_DOC(class_name, method_name, doc_string) \
|
||||||
const char class_name::method_name##_doc[] = 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) \
|
#define KX_PYMETHODDEF_DOC_VARARGS(class_name, method_name, doc_string) \
|
||||||
const char class_name::method_name##_doc[] = 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) \
|
#define KX_PYMETHODDEF_DOC_O(class_name, method_name, doc_string) \
|
||||||
const char class_name::method_name##_doc[] = 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) \
|
#define KX_PYMETHODDEF_DOC_NOARGS(class_name, method_name, doc_string) \
|
||||||
const char class_name::method_name##_doc[] = 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
|
* Attribute management
|
||||||
|
@ -354,7 +354,7 @@ enum KX_PYATTRIBUTE_ACCESS {
|
||||||
struct KX_PYATTRIBUTE_DEF;
|
struct KX_PYATTRIBUTE_DEF;
|
||||||
typedef int (*KX_PYATTRIBUTE_CHECK_FUNCTION)(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
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 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 {
|
typedef struct KX_PYATTRIBUTE_DEF {
|
||||||
const char *m_name; // name of the python attribute
|
const char *m_name; // name of the python attribute
|
||||||
|
|
|
@ -25,7 +25,7 @@ class CStringValue : public CPropValue
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
//PLUGIN_DECLARE_SERIAL(CStringValue,CValue)
|
//PLUGIN_DECLARE_SERIAL(CStringValue,CValue)
|
||||||
public:
|
public:
|
||||||
/// Construction / destruction
|
/// Construction / destruction
|
||||||
CStringValue();
|
CStringValue();
|
||||||
|
|
|
@ -340,7 +340,7 @@ vector<STR_String> CValue::GetPropertyNames()
|
||||||
// Clear all properties
|
// Clear all properties
|
||||||
//
|
//
|
||||||
void CValue::ClearProperties()
|
void CValue::ClearProperties()
|
||||||
{
|
{
|
||||||
// Check if we have any properties
|
// Check if we have any properties
|
||||||
if (m_pNamedPropertyArray == NULL)
|
if (m_pNamedPropertyArray == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -530,13 +530,13 @@ PyAttributeDef CValue::Attributes[] = {
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
CValue * self = static_cast<CValue *> (self_v);
|
||||||
return PyUnicode_From_STR_String(self->GetName());
|
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;
|
CValue* vallie = NULL;
|
||||||
|
@ -551,7 +551,7 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
|
||||||
Py_ssize_t numitems = PyList_GET_SIZE(pyobj);
|
Py_ssize_t numitems = PyList_GET_SIZE(pyobj);
|
||||||
for (i=0;i<numitems;i++)
|
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);
|
CValue* listitemval = ConvertPythonToValue(listitem, error_prefix);
|
||||||
if (listitemval)
|
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)
|
if (m_pNamedPropertyArray)
|
||||||
{
|
{
|
||||||
|
@ -636,5 +636,5 @@ void CValue::SetColorOperator(VALUE_OPERATOR op)
|
||||||
void CValue::SetValue(CValue* newval)
|
void CValue::SetValue(CValue* newval)
|
||||||
{
|
{
|
||||||
// no one should get here
|
// no one should get here
|
||||||
assertd(newval->GetNumber() == 10121969);
|
assertd(newval->GetNumber() == 10121969);
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,21 +218,21 @@ public:
|
||||||
CValue();
|
CValue();
|
||||||
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
//static PyObject* PyMake(PyObject*,PyObject*);
|
//static PyObject *PyMake(PyObject *, PyObject *);
|
||||||
virtual PyObject *py_repr(void)
|
virtual PyObject *py_repr(void)
|
||||||
{
|
{
|
||||||
return PyUnicode_From_STR_String(GetText());
|
return PyUnicode_From_STR_String(GetText());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual PyObject* ConvertValueToPython() {
|
virtual PyObject *ConvertValueToPython() {
|
||||||
return NULL;
|
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
|
#endif // WITH_PYTHON
|
||||||
|
|
||||||
|
|
||||||
|
@ -250,13 +250,13 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Reference Counting
|
/// Reference Counting
|
||||||
int GetRefCount()
|
int GetRefCount()
|
||||||
{
|
{
|
||||||
return m_refcount;
|
return m_refcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a reference to this value
|
// Add a reference to this value
|
||||||
CValue* AddRef()
|
CValue *AddRef()
|
||||||
{
|
{
|
||||||
// Increase global reference count, used to see at the end of the program
|
// Increase global reference count, used to see at the end of the program
|
||||||
// if all CValue-derived classes have been dereferenced to 0
|
// if all CValue-derived classes have been dereferenced to 0
|
||||||
|
@ -269,7 +269,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release a reference to this value (when reference count reaches 0, the value is removed from the heap)
|
// Release a reference to this value (when reference count reaches 0, the value is removed from the heap)
|
||||||
int Release()
|
int Release()
|
||||||
{
|
{
|
||||||
// Decrease global reference count, used to see at the end of the program
|
// Decrease global reference count, used to see at the end of the program
|
||||||
// if all CValue-derived classes have been dereferenced to 0
|
// if all CValue-derived classes have been dereferenced to 0
|
||||||
|
@ -354,16 +354,16 @@ public:
|
||||||
virtual void SetCustomFlag2(bool bCustomFlag) { m_ValFlags.CustomFlag2 = bCustomFlag;}
|
virtual void SetCustomFlag2(bool bCustomFlag) { m_ValFlags.CustomFlag2 = bCustomFlag;}
|
||||||
virtual bool IsCustomFlag2() { return m_ValFlags.CustomFlag2;}
|
virtual bool IsCustomFlag2() { return m_ValFlags.CustomFlag2;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DisableRefCount(); // Disable reference counting for this value
|
virtual void DisableRefCount(); // Disable reference counting for this value
|
||||||
//virtual void AddDataToReplica(CValue* replica);
|
//virtual void AddDataToReplica(CValue* replica);
|
||||||
virtual ~CValue();
|
virtual ~CValue();
|
||||||
private:
|
private:
|
||||||
// Member variables
|
// Member variables
|
||||||
std::map<STR_String,CValue*>* m_pNamedPropertyArray; // Properties for user/game etc
|
std::map<STR_String,CValue*>* m_pNamedPropertyArray; // Properties for user/game etc
|
||||||
ValueFlags m_ValFlags; // Frequently used flags in a bitfield (low memoryusage)
|
ValueFlags m_ValFlags; // Frequently used flags in a bitfield (low memoryusage)
|
||||||
int m_refcount; // Reference Counter
|
int m_refcount; // Reference Counter
|
||||||
static double m_sZeroVec[3];
|
static double m_sZeroVec[3];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class SCA_Joystick
|
||||||
/**
|
/**
|
||||||
*support for JOYHAT_MAX hats (each is a direction)
|
*support for JOYHAT_MAX hats (each is a direction)
|
||||||
*/
|
*/
|
||||||
int m_hat_array[JOYHAT_MAX];
|
int m_hat_array[JOYHAT_MAX];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Precision or range of the axes
|
* Precision or range of the axes
|
||||||
|
|
|
@ -238,19 +238,19 @@ PyAttributeDef SCA_IController::Attributes[] = {
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
SCA_IController* self= static_cast<SCA_IController*>(self_v);
|
||||||
return PyLong_FromSsize_t(self->m_statemask);
|
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);
|
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);
|
return KX_PythonSeq_CreatePyObject((static_cast<SCA_IController*>(self_v))->m_proxy, KX_PYGENSEQ_CONT_TYPE_ACTUATORS);
|
||||||
}
|
}
|
||||||
#endif // WITH_PYTHON
|
#endif // WITH_PYTHON
|
||||||
|
|
|
@ -45,7 +45,7 @@ SCA_IInputDevice::SCA_IInputDevice()
|
||||||
|
|
||||||
SCA_IInputDevice::~SCA_IInputDevice()
|
SCA_IInputDevice::~SCA_IInputDevice()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCA_IInputDevice::HookEscape()
|
void SCA_IInputDevice::HookEscape()
|
||||||
{
|
{
|
||||||
|
@ -134,6 +134,6 @@ void SCA_IInputDevice::NextFrame()
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
; /* error */
|
; /* error */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ class SCA_IInputDevice
|
||||||
public:
|
public:
|
||||||
|
|
||||||
SCA_IInputDevice();
|
SCA_IInputDevice();
|
||||||
virtual ~SCA_IInputDevice();
|
virtual ~SCA_IInputDevice();
|
||||||
|
|
||||||
enum KX_EnumInputs {
|
enum KX_EnumInputs {
|
||||||
|
|
||||||
|
@ -120,17 +120,17 @@ public:
|
||||||
KX_RETKEY = 13,
|
KX_RETKEY = 13,
|
||||||
KX_SPACEKEY = 32,
|
KX_SPACEKEY = 32,
|
||||||
KX_PADASTERKEY = 42,
|
KX_PADASTERKEY = 42,
|
||||||
KX_COMMAKEY = 44,
|
KX_COMMAKEY = 44,
|
||||||
KX_MINUSKEY = 45,
|
KX_MINUSKEY = 45,
|
||||||
KX_PERIODKEY = 46,
|
KX_PERIODKEY = 46,
|
||||||
KX_ZEROKEY = 48,
|
KX_ZEROKEY = 48,
|
||||||
|
|
||||||
KX_ONEKEY, // =49
|
KX_ONEKEY, // =49
|
||||||
KX_TWOKEY,
|
KX_TWOKEY,
|
||||||
KX_THREEKEY,
|
KX_THREEKEY,
|
||||||
KX_FOURKEY,
|
KX_FOURKEY,
|
||||||
KX_FIVEKEY,
|
KX_FIVEKEY,
|
||||||
KX_SIXKEY,
|
KX_SIXKEY,
|
||||||
KX_SEVENKEY,
|
KX_SEVENKEY,
|
||||||
KX_EIGHTKEY,
|
KX_EIGHTKEY,
|
||||||
KX_NINEKEY, // = 57
|
KX_NINEKEY, // = 57
|
||||||
|
@ -170,14 +170,14 @@ public:
|
||||||
KX_LEFTALTKEY,
|
KX_LEFTALTKEY,
|
||||||
KX_RIGHTALTKEY,
|
KX_RIGHTALTKEY,
|
||||||
KX_RIGHTCTRLKEY,
|
KX_RIGHTCTRLKEY,
|
||||||
KX_RIGHTSHIFTKEY,
|
KX_RIGHTSHIFTKEY,
|
||||||
KX_LEFTSHIFTKEY,// 129
|
KX_LEFTSHIFTKEY,// 129
|
||||||
|
|
||||||
KX_ESCKEY, // 130
|
KX_ESCKEY, // 130
|
||||||
KX_TABKEY, //131
|
KX_TABKEY, //131
|
||||||
|
|
||||||
|
|
||||||
KX_LINEFEEDKEY, // 132
|
KX_LINEFEEDKEY, // 132
|
||||||
KX_BACKSPACEKEY,
|
KX_BACKSPACEKEY,
|
||||||
KX_DELKEY,
|
KX_DELKEY,
|
||||||
KX_SEMICOLONKEY, // 135
|
KX_SEMICOLONKEY, // 135
|
||||||
|
@ -188,13 +188,13 @@ public:
|
||||||
|
|
||||||
KX_SLASHKEY, //138
|
KX_SLASHKEY, //138
|
||||||
KX_BACKSLASHKEY,
|
KX_BACKSLASHKEY,
|
||||||
KX_EQUALKEY,
|
KX_EQUALKEY,
|
||||||
KX_LEFTBRACKETKEY,
|
KX_LEFTBRACKETKEY,
|
||||||
KX_RIGHTBRACKETKEY, // 142
|
KX_RIGHTBRACKETKEY, // 142
|
||||||
|
|
||||||
KX_LEFTARROWKEY, // 145
|
KX_LEFTARROWKEY, // 145
|
||||||
KX_DOWNARROWKEY,
|
KX_DOWNARROWKEY,
|
||||||
KX_RIGHTARROWKEY,
|
KX_RIGHTARROWKEY,
|
||||||
KX_UPARROWKEY, // 148
|
KX_UPARROWKEY, // 148
|
||||||
|
|
||||||
KX_PAD2 ,
|
KX_PAD2 ,
|
||||||
|
|
|
@ -231,7 +231,7 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Attribute functions */
|
/*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);
|
SCA_ILogicBrick* self= static_cast<SCA_ILogicBrick*>(self_v);
|
||||||
CValue* parent = self->GetParent();
|
CValue* parent = self->GetParent();
|
||||||
|
@ -254,9 +254,9 @@ 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);
|
return PyLong_FromSsize_t(boolarg? KX_TRUE: KX_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // WITH_PYTHON
|
#endif // WITH_PYTHON
|
||||||
|
|
|
@ -157,7 +157,7 @@ protected:
|
||||||
bool PyArgToBool(int boolArg);
|
bool PyArgToBool(int boolArg);
|
||||||
|
|
||||||
/** Convert a a c++ value to KX_TRUE, KX_FALSE in Python. */
|
/** Convert a a c++ value to KX_TRUE, KX_FALSE in Python. */
|
||||||
PyObject* BoolToPyArg(bool);
|
PyObject *BoolToPyArg(bool);
|
||||||
|
|
||||||
#endif // WITH_PYTHON
|
#endif // WITH_PYTHON
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,7 @@ SCA_IController* SCA_IObject::FindController(const STR_String& controllername)
|
||||||
{
|
{
|
||||||
foundcontroller = (*itc);
|
foundcontroller = (*itc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return foundcontroller;
|
return foundcontroller;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ class SCA_IController;
|
||||||
class SCA_IActuator;
|
class SCA_IActuator;
|
||||||
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
template<class T> T PyVecTo(PyObject*);
|
template<class T> T PyVecTo(PyObject *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef std::vector<SCA_ISensor *> SCA_SensorList;
|
typedef std::vector<SCA_ISensor *> SCA_SensorList;
|
||||||
|
@ -213,7 +213,7 @@ public:
|
||||||
*/
|
*/
|
||||||
unsigned int GetState(void) { return m_state; }
|
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;}
|
virtual int GetGameObjectType() {return -1;}
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,7 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr)
|
||||||
if (result) {
|
if (result) {
|
||||||
// the sensor triggered this frame
|
// the sensor triggered this frame
|
||||||
if (m_state || !m_tap) {
|
if (m_state || !m_tap) {
|
||||||
ActivateControllers(logicmgr);
|
ActivateControllers(logicmgr);
|
||||||
// reset these counters so that pulse are synchronized with transition
|
// reset these counters so that pulse are synchronized with transition
|
||||||
m_pos_ticks = 0;
|
m_pos_ticks = 0;
|
||||||
m_neg_ticks = 0;
|
m_neg_ticks = 0;
|
||||||
|
@ -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);
|
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||||
int retval = 0;
|
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);
|
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);
|
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||||
return PyLong_FromSsize_t(self->GetState());
|
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);
|
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||||
int status = 0;
|
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);
|
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);
|
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||||
return PyLong_FromLong(self->GetPosTicks());
|
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);
|
SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v);
|
||||||
return PyLong_FromLong(self->GetNegTicks());
|
return PyLong_FromLong(self->GetNegTicks());
|
||||||
|
|
|
@ -60,7 +60,7 @@ SCA_JoystickSensor::SCA_JoystickSensor(class SCA_JoystickManager* eventmgr,
|
||||||
m_joymode(joymode),
|
m_joymode(joymode),
|
||||||
m_joyindex(joyindex),
|
m_joyindex(joyindex),
|
||||||
m_bAllEvents(allevents)
|
m_bAllEvents(allevents)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
std::cout << " axis " << m_axis << std::endl;
|
std::cout << " axis " << m_axis << std::endl;
|
||||||
std::cout << " axis flag " << m_axisf << std::endl;
|
std::cout << " axis flag " << m_axisf << std::endl;
|
||||||
|
@ -308,7 +308,7 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = {
|
||||||
const char SCA_JoystickSensor::GetButtonActiveList_doc[] =
|
const char SCA_JoystickSensor::GetButtonActiveList_doc[] =
|
||||||
"getButtonActiveList\n"
|
"getButtonActiveList\n"
|
||||||
"\tReturns a list containing the indices of the button currently pressed.\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);
|
SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
|
||||||
PyObject *ls = PyList_New(0);
|
PyObject *ls = PyList_New(0);
|
||||||
|
@ -331,7 +331,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonActiveList( )
|
||||||
const char SCA_JoystickSensor::GetButtonStatus_doc[] =
|
const char SCA_JoystickSensor::GetButtonStatus_doc[] =
|
||||||
"getButtonStatus(buttonIndex)\n"
|
"getButtonStatus(buttonIndex)\n"
|
||||||
"\tReturns a bool of the current pressed state of the specified button.\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);
|
SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
|
||||||
int index;
|
int index;
|
||||||
|
@ -345,7 +345,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args )
|
||||||
return PyBool_FromLong(0);
|
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_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
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;
|
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_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
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));
|
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_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
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;
|
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_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
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));
|
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_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||||
return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 );
|
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_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||||
return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 );
|
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_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||||
return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 );
|
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_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||||
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
|
|
||||||
bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
|
bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
|
||||||
|
|
||||||
virtual void NextFrame();
|
virtual void NextFrame();
|
||||||
SCA_IInputDevice* GetInputDevice();
|
SCA_IInputDevice* GetInputDevice();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -351,12 +351,12 @@ void SCA_KeyboardSensor::AddToTargetProp(int keyIndex)
|
||||||
CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
|
CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
|
||||||
GetParent()->SetProperty(m_targetprop, newstringprop);
|
GetParent()->SetProperty(m_targetprop, newstringprop);
|
||||||
newstringprop->Release();
|
newstringprop->Release();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* append */
|
/* append */
|
||||||
char pchar = ToCharacter(keyIndex, IsShifted());
|
char pchar = ToCharacter(keyIndex, IsShifted());
|
||||||
STR_String newprop = tprop->GetText() + pchar;
|
STR_String newprop = tprop->GetText() + pchar;
|
||||||
CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
|
CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
|
||||||
GetParent()->SetProperty(m_targetprop, newstringprop);
|
GetParent()->SetProperty(m_targetprop, newstringprop);
|
||||||
newstringprop->Release();
|
newstringprop->Release();
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ void SCA_KeyboardSensor::AddToTargetProp(int keyIndex)
|
||||||
/* Make a new property. Deletes can be ignored. */
|
/* Make a new property. Deletes can be ignored. */
|
||||||
char pchar = ToCharacter(keyIndex, IsShifted());
|
char pchar = ToCharacter(keyIndex, IsShifted());
|
||||||
STR_String newprop = pchar;
|
STR_String newprop = pchar;
|
||||||
CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
|
CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
|
||||||
GetParent()->SetProperty(m_targetprop, newstringprop);
|
GetParent()->SetProperty(m_targetprop, newstringprop);
|
||||||
newstringprop->Release();
|
newstringprop->Release();
|
||||||
}
|
}
|
||||||
|
@ -376,7 +376,7 @@ void SCA_KeyboardSensor::AddToTargetProp(int keyIndex)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests whether shift is pressed
|
* Tests whether shift is pressed
|
||||||
*/
|
*/
|
||||||
bool SCA_KeyboardSensor::IsShifted(void)
|
bool SCA_KeyboardSensor::IsShifted(void)
|
||||||
{
|
{
|
||||||
SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
|
SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
|
||||||
|
@ -391,9 +391,10 @@ bool SCA_KeyboardSensor::IsShifted(void)
|
||||||
== SCA_InputEvent::KX_JUSTACTIVATED)
|
== SCA_InputEvent::KX_JUSTACTIVATED)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCA_KeyboardSensor::LogKeystrokes(void)
|
void SCA_KeyboardSensor::LogKeystrokes(void)
|
||||||
|
@ -494,25 +495,25 @@ 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_KeyboardSensor* self= static_cast<SCA_KeyboardSensor*>(self_v);
|
||||||
|
|
||||||
SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)self->m_eventmgr)->GetInputDevice();
|
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++)
|
for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++)
|
||||||
{
|
{
|
||||||
const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i);
|
const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i);
|
||||||
if (inevent.m_status != SCA_InputEvent::KX_NO_INPUTSTATUS)
|
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,0,PyLong_FromSsize_t(i));
|
||||||
PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status));
|
PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status));
|
||||||
PyList_Append(resultlist,keypair);
|
PyList_Append(resultlist,keypair);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resultlist;
|
return resultlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -655,7 +656,7 @@ bool IsPrintable(int keyIndex)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests whether this is a delete key.
|
* Tests whether this is a delete key.
|
||||||
*/
|
*/
|
||||||
bool IsDelete(int keyIndex)
|
bool IsDelete(int keyIndex)
|
||||||
{
|
{
|
||||||
if ( (keyIndex == SCA_IInputDevice::KX_DELKEY)
|
if ( (keyIndex == SCA_IInputDevice::KX_DELKEY)
|
||||||
|
|
|
@ -134,7 +134,7 @@ bool IsPrintable(int keyIndex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests whether this is a delete key.
|
* Tests whether this is a delete key.
|
||||||
*/
|
*/
|
||||||
bool IsDelete(int keyIndex);
|
bool IsDelete(int keyIndex);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
* mouse related events. Can also flag mouse movement.
|
* mouse related events. Can also flag mouse movement.
|
||||||
*/
|
*/
|
||||||
bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
|
bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
|
||||||
virtual void NextFrame();
|
virtual void NextFrame();
|
||||||
SCA_IInputDevice* GetInputDevice();
|
SCA_IInputDevice* GetInputDevice();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ bool SCA_MouseSensor::Evaluate()
|
||||||
case KX_MOUSESENSORMODE_WHEELDOWN:
|
case KX_MOUSESENSORMODE_WHEELDOWN:
|
||||||
{
|
{
|
||||||
const SCA_InputEvent& mevent = mousedev->GetEventValue(m_hotkey);
|
const SCA_InputEvent& mevent = mousedev->GetEventValue(m_hotkey);
|
||||||
switch (mevent.m_status) {
|
switch (mevent.m_status) {
|
||||||
case SCA_InputEvent::KX_JUSTACTIVATED:
|
case SCA_InputEvent::KX_JUSTACTIVATED:
|
||||||
m_val = 1;
|
m_val = 1;
|
||||||
result = true;
|
result = true;
|
||||||
|
@ -189,15 +189,15 @@ bool SCA_MouseSensor::Evaluate()
|
||||||
const SCA_InputEvent& eventY = mousedev->GetEventValue(SCA_IInputDevice::KX_MOUSEY);
|
const SCA_InputEvent& eventY = mousedev->GetEventValue(SCA_IInputDevice::KX_MOUSEY);
|
||||||
|
|
||||||
if (eventX.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
|
if (eventX.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
|
||||||
eventY.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
|
eventY.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
|
||||||
eventX.m_status == SCA_InputEvent::KX_ACTIVE ||
|
eventX.m_status == SCA_InputEvent::KX_ACTIVE ||
|
||||||
eventY.m_status == SCA_InputEvent::KX_ACTIVE)
|
eventY.m_status == SCA_InputEvent::KX_ACTIVE)
|
||||||
{
|
{
|
||||||
m_val = 1;
|
m_val = 1;
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
else if (eventX.m_status == SCA_InputEvent::KX_JUSTRELEASED ||
|
else if (eventX.m_status == SCA_InputEvent::KX_JUSTRELEASED ||
|
||||||
eventY.m_status == SCA_InputEvent::KX_JUSTRELEASED )
|
eventY.m_status == SCA_InputEvent::KX_JUSTRELEASED )
|
||||||
{
|
{
|
||||||
m_val = 0;
|
m_val = 0;
|
||||||
result = true;
|
result = true;
|
||||||
|
|
|
@ -173,7 +173,7 @@ isValid(
|
||||||
SCA_PropertyActuator::KX_ACT_PROP_MODE mode
|
SCA_PropertyActuator::KX_ACT_PROP_MODE mode
|
||||||
|
|
||||||
) {
|
) {
|
||||||
bool res = false;
|
bool res = false;
|
||||||
res = ((mode > KX_ACT_PROP_NODEF) && (mode < KX_ACT_PROP_MAX));
|
res = ((mode > KX_ACT_PROP_NODEF) && (mode < KX_ACT_PROP_MAX));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,7 +179,7 @@ int SCA_PythonController::IsTriggered(class SCA_ISensor* sensor)
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
|
|
||||||
/* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */
|
/* 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)
|
if (m_sCurrentController==NULL)
|
||||||
{
|
{
|
||||||
|
@ -271,7 +271,7 @@ void SCA_PythonController::ErrorPrint(const char *error_msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SCA_PythonController::Compile()
|
bool SCA_PythonController::Compile()
|
||||||
{
|
{
|
||||||
//printf("py script modified '%s'\n", m_scriptName.Ptr());
|
//printf("py script modified '%s'\n", m_scriptName.Ptr());
|
||||||
m_bModified= false;
|
m_bModified= false;
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
|
||||||
m_sCurrentLogicManager = logicmgr;
|
m_sCurrentLogicManager = logicmgr;
|
||||||
|
|
||||||
PyObject *excdict= NULL;
|
PyObject *excdict= NULL;
|
||||||
PyObject* resultobj= NULL;
|
PyObject *resultobj= NULL;
|
||||||
|
|
||||||
switch(m_mode) {
|
switch(m_mode) {
|
||||||
case SCA_PYEXEC_SCRIPT:
|
case SCA_PYEXEC_SCRIPT:
|
||||||
|
@ -447,13 +447,13 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
|
||||||
// This doesn't appear to be needed anymore
|
// This doesn't appear to be needed anymore
|
||||||
//PyDict_Clear(excdict);
|
//PyDict_Clear(excdict);
|
||||||
Py_DECREF(excdict);
|
Py_DECREF(excdict);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_triggeredSensors.clear();
|
m_triggeredSensors.clear();
|
||||||
m_sCurrentController = NULL;
|
m_sCurrentController = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* SCA_PythonController::PyActivate(PyObject *value)
|
PyObject *SCA_PythonController::PyActivate(PyObject *value)
|
||||||
{
|
{
|
||||||
if (m_sCurrentController != this) {
|
if (m_sCurrentController != this) {
|
||||||
PyErr_SetString(PyExc_SystemError, "Cannot add an actuator from a non-active controller");
|
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;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* SCA_PythonController::PyDeActivate(PyObject *value)
|
PyObject *SCA_PythonController::PyDeActivate(PyObject *value)
|
||||||
{
|
{
|
||||||
if (m_sCurrentController != this) {
|
if (m_sCurrentController != this) {
|
||||||
PyErr_SetString(PyExc_SystemError, "Cannot add an actuator from a non-active controller");
|
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;
|
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)))));
|
//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)
|
// static_cast<void *>(dynamic_cast<Derived *>(obj)) - static_cast<void *>(obj)
|
||||||
|
|
|
@ -74,7 +74,7 @@ class SCA_PythonController : public SCA_IController
|
||||||
|
|
||||||
//for debugging
|
//for debugging
|
||||||
//virtual CValue* AddRef();
|
//virtual CValue* AddRef();
|
||||||
//virtual int Release(); // Release a reference to this value (when reference count reaches 0, the value is removed from the heap)
|
//virtual int Release(); // Release a reference to this value (when reference count reaches 0, the value is removed from the heap)
|
||||||
|
|
||||||
SCA_PythonController(SCA_IObject* gameobj, int mode);
|
SCA_PythonController(SCA_IObject* gameobj, int mode);
|
||||||
virtual ~SCA_PythonController();
|
virtual ~SCA_PythonController();
|
||||||
|
@ -96,11 +96,11 @@ class SCA_PythonController : public SCA_IController
|
||||||
void ErrorPrint(const char *error_msg);
|
void ErrorPrint(const char *error_msg);
|
||||||
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
static const char* sPyGetCurrentController__doc__;
|
static const char *sPyGetCurrentController__doc__;
|
||||||
static PyObject* sPyGetCurrentController(PyObject* self);
|
static PyObject *sPyGetCurrentController(PyObject *self);
|
||||||
static const char* sPyAddActiveActuator__doc__;
|
static const char *sPyAddActiveActuator__doc__;
|
||||||
static PyObject* sPyAddActiveActuator(PyObject* self,
|
static PyObject *sPyAddActiveActuator(PyObject *self,
|
||||||
PyObject* args);
|
PyObject *args);
|
||||||
static SCA_IActuator* LinkedActuatorFromPy(PyObject *value);
|
static SCA_IActuator* LinkedActuatorFromPy(PyObject *value);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -58,13 +58,13 @@ SCA_PythonKeyboard::~SCA_PythonKeyboard()
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* clipboard */
|
/* clipboard */
|
||||||
static PyObject* gPyGetClipboard(PyObject* args, PyObject* kwds)
|
static PyObject *gPyGetClipboard(PyObject *args, PyObject *kwds)
|
||||||
{
|
{
|
||||||
char *buf = (char *)GHOST_getClipboard(0);
|
char *buf = (char *)GHOST_getClipboard(0);
|
||||||
return PyUnicode_FromString(buf?buf:"");
|
return PyUnicode_FromString(buf?buf:"");
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject* gPySetClipboard(PyObject* args, PyObject* value)
|
static PyObject *gPySetClipboard(PyObject *args, PyObject *value)
|
||||||
{
|
{
|
||||||
char* buf;
|
char* buf;
|
||||||
if (!PyArg_ParseTuple(value,"s:setClipboard",&buf))
|
if (!PyArg_ParseTuple(value,"s:setClipboard",&buf))
|
||||||
|
@ -109,7 +109,7 @@ PyAttributeDef SCA_PythonKeyboard::Attributes[] = {
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
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;
|
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);
|
SCA_PythonKeyboard* self = static_cast<SCA_PythonKeyboard*>(self_v);
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class SCA_PythonKeyboard : public PyObjectPlus
|
||||||
private:
|
private:
|
||||||
class SCA_IInputDevice *m_keyboard;
|
class SCA_IInputDevice *m_keyboard;
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
PyObject* m_event_dict;
|
PyObject *m_event_dict;
|
||||||
#endif
|
#endif
|
||||||
public:
|
public:
|
||||||
SCA_PythonKeyboard(class SCA_IInputDevice* keyboard);
|
SCA_PythonKeyboard(class SCA_IInputDevice* keyboard);
|
||||||
|
|
|
@ -90,9 +90,9 @@ PyAttributeDef SCA_PythonMouse::Attributes[] = {
|
||||||
KX_PYATTRIBUTE_RW_FUNCTION("position", SCA_PythonMouse, pyattr_get_position, pyattr_set_position),
|
KX_PYATTRIBUTE_RW_FUNCTION("position", SCA_PythonMouse, pyattr_get_position, pyattr_set_position),
|
||||||
KX_PYATTRIBUTE_RW_FUNCTION("visible", SCA_PythonMouse, pyattr_get_visible, pyattr_set_visible),
|
KX_PYATTRIBUTE_RW_FUNCTION("visible", SCA_PythonMouse, pyattr_get_visible, pyattr_set_visible),
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
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;
|
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);
|
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;
|
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);
|
SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
|
||||||
const SCA_InputEvent & xevent = self->m_mouse->GetEventValue(SCA_IInputDevice::KX_MOUSEX);
|
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);
|
x_coord = self->m_canvas->GetMouseNormalizedX(xevent.m_eventval);
|
||||||
y_coord = self->m_canvas->GetMouseNormalizedY(yevent.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, 0, PyFloat_FromDouble(x_coord));
|
||||||
PyTuple_SET_ITEM(ret, 1, PyFloat_FromDouble(y_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;
|
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);
|
SCA_PythonMouse* self = static_cast<SCA_PythonMouse*>(self_v);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ private:
|
||||||
class SCA_IInputDevice *m_mouse;
|
class SCA_IInputDevice *m_mouse;
|
||||||
class RAS_ICanvas *m_canvas;
|
class RAS_ICanvas *m_canvas;
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
PyObject* m_event_dict;
|
PyObject *m_event_dict;
|
||||||
#endif
|
#endif
|
||||||
public:
|
public:
|
||||||
SCA_PythonMouse(class SCA_IInputDevice* mouse, class RAS_ICanvas* canvas);
|
SCA_PythonMouse(class SCA_IInputDevice* mouse, class RAS_ICanvas* canvas);
|
||||||
|
@ -47,12 +47,12 @@ public:
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
KX_PYMETHOD_DOC(SCA_PythonMouse, show);
|
KX_PYMETHOD_DOC(SCA_PythonMouse, show);
|
||||||
|
|
||||||
static PyObject* pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
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_active_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||||
static PyObject* pyattr_get_position(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 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 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 int pyattr_set_visible(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ bool SCA_RandomActuator::Update()
|
||||||
while (b >= a) {
|
while (b >= a) {
|
||||||
b = b * m_base->DrawFloat();
|
b = b * m_base->DrawFloat();
|
||||||
res++;
|
res++;
|
||||||
};
|
};
|
||||||
tmpval = new CIntValue(res);
|
tmpval = new CIntValue(res);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -361,9 +361,9 @@ PyAttributeDef SCA_RandomActuator::Attributes[] = {
|
||||||
KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,MAX_PROP_NAME,false,SCA_RandomActuator,m_propname,CheckProperty),
|
KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,MAX_PROP_NAME,false,SCA_RandomActuator,m_propname,CheckProperty),
|
||||||
KX_PYATTRIBUTE_RW_FUNCTION("seed",SCA_RandomActuator,pyattr_get_seed,pyattr_set_seed),
|
KX_PYATTRIBUTE_RW_FUNCTION("seed",SCA_RandomActuator,pyattr_get_seed,pyattr_set_seed),
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
SCA_RandomActuator* act = static_cast<SCA_RandomActuator*>(self);
|
||||||
return PyLong_FromSsize_t(act->m_base->GetSeed());
|
return PyLong_FromSsize_t(act->m_base->GetSeed());
|
||||||
|
@ -420,7 +420,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setBoolBernouilli,
|
||||||
}
|
}
|
||||||
|
|
||||||
m_distribution = KX_RANDOMACT_BOOL_BERNOUILLI;
|
m_distribution = KX_RANDOMACT_BOOL_BERNOUILLI;
|
||||||
m_parameter1 = paraArg;
|
m_parameter1 = paraArg;
|
||||||
enforceConstraints();
|
enforceConstraints();
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
@ -473,7 +473,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setIntPoisson,
|
||||||
}
|
}
|
||||||
|
|
||||||
m_distribution = KX_RANDOMACT_INT_POISSON;
|
m_distribution = KX_RANDOMACT_INT_POISSON;
|
||||||
m_parameter1 = paraArg;
|
m_parameter1 = paraArg;
|
||||||
enforceConstraints();
|
enforceConstraints();
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
@ -489,7 +489,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setFloatConst,
|
||||||
}
|
}
|
||||||
|
|
||||||
m_distribution = KX_RANDOMACT_FLOAT_CONST;
|
m_distribution = KX_RANDOMACT_FLOAT_CONST;
|
||||||
m_parameter1 = paraArg;
|
m_parameter1 = paraArg;
|
||||||
enforceConstraints();
|
enforceConstraints();
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setFloatNegativeExponential,
|
||||||
}
|
}
|
||||||
|
|
||||||
m_distribution = KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL;
|
m_distribution = KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL;
|
||||||
m_parameter1 = paraArg;
|
m_parameter1 = paraArg;
|
||||||
enforceConstraints();
|
enforceConstraints();
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,10 +67,10 @@ class SCA_RandomActuator : public SCA_IActuator
|
||||||
KX_RANDOMACT_NODEF,
|
KX_RANDOMACT_NODEF,
|
||||||
KX_RANDOMACT_BOOL_CONST,
|
KX_RANDOMACT_BOOL_CONST,
|
||||||
KX_RANDOMACT_BOOL_UNIFORM,
|
KX_RANDOMACT_BOOL_UNIFORM,
|
||||||
KX_RANDOMACT_BOOL_BERNOUILLI,
|
KX_RANDOMACT_BOOL_BERNOUILLI,
|
||||||
KX_RANDOMACT_INT_CONST,
|
KX_RANDOMACT_INT_CONST,
|
||||||
KX_RANDOMACT_INT_UNIFORM,
|
KX_RANDOMACT_INT_UNIFORM,
|
||||||
KX_RANDOMACT_INT_POISSON,
|
KX_RANDOMACT_INT_POISSON,
|
||||||
KX_RANDOMACT_FLOAT_CONST,
|
KX_RANDOMACT_FLOAT_CONST,
|
||||||
KX_RANDOMACT_FLOAT_UNIFORM,
|
KX_RANDOMACT_FLOAT_UNIFORM,
|
||||||
KX_RANDOMACT_FLOAT_NORMAL,
|
KX_RANDOMACT_FLOAT_NORMAL,
|
||||||
|
@ -98,7 +98,7 @@ class SCA_RandomActuator : public SCA_IActuator
|
||||||
/* Python interface ---------------------------------------------------- */
|
/* 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);
|
static int pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||||
|
|
||||||
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolConst);
|
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolConst);
|
||||||
|
|
|
@ -165,7 +165,7 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = {
|
||||||
{NULL} //Sentinel
|
{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);
|
SCA_RandomSensor* self= static_cast<SCA_RandomSensor*>(self_v);
|
||||||
return PyLong_FromSsize_t(self->m_basegenerator->GetSeed());
|
return PyLong_FromSsize_t(self->m_basegenerator->GetSeed());
|
||||||
|
|
|
@ -54,7 +54,7 @@ SCA_TimeEventManager::~SCA_TimeEventManager()
|
||||||
!(it == m_timevalues.end()); ++it)
|
!(it == m_timevalues.end()); ++it)
|
||||||
{
|
{
|
||||||
(*it)->Release();
|
(*it)->Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ void GPC_Canvas::Resize(int width, int height)
|
||||||
void GPC_Canvas::EndFrame()
|
void GPC_Canvas::EndFrame()
|
||||||
{
|
{
|
||||||
if (m_bannersEnabled)
|
if (m_bannersEnabled)
|
||||||
DrawAllBanners();
|
DrawAllBanners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ public:
|
||||||
|
|
||||||
void SetMouseState(RAS_MouseState mousestate)
|
void SetMouseState(RAS_MouseState mousestate)
|
||||||
{
|
{
|
||||||
// not yet
|
// not yet
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetMousePosition(int x, int y)
|
void SetMousePosition(int x, int y)
|
||||||
|
@ -250,7 +250,7 @@ protected:
|
||||||
int oldWriteMask;
|
int oldWriteMask;
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
PushRenderState(
|
PushRenderState(
|
||||||
CanvasRenderState & render_state
|
CanvasRenderState & render_state
|
||||||
);
|
);
|
||||||
|
|
|
@ -67,7 +67,8 @@ void GPC_MouseDevice::NextFrame()
|
||||||
for (int mouseevent= KX_BEGINMOUSE; mouseevent< KX_ENDMOUSEBUTTONS; mouseevent++) {
|
for (int mouseevent= KX_BEGINMOUSE; mouseevent< KX_ENDMOUSEBUTTONS; mouseevent++) {
|
||||||
SCA_InputEvent& oldevent = m_eventStatusTables[previousTable][mouseevent];
|
SCA_InputEvent& oldevent = m_eventStatusTables[previousTable][mouseevent];
|
||||||
if (oldevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
|
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] = oldevent;
|
||||||
m_eventStatusTables[m_currentTable][mouseevent].m_status = SCA_InputEvent::KX_ACTIVE;
|
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];
|
SCA_InputEvent& oldevent = m_eventStatusTables[previousTable][mousemove];
|
||||||
m_eventStatusTables[m_currentTable][mousemove] = oldevent;
|
m_eventStatusTables[m_currentTable][mousemove] = oldevent;
|
||||||
if (oldevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED ||
|
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;
|
m_eventStatusTables[m_currentTable][mousemove].m_status = SCA_InputEvent::KX_JUSTRELEASED;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -89,7 +89,7 @@ bool GPC_RawImage::Load(
|
||||||
// Put original in upper left corner
|
// Put original in upper left corner
|
||||||
|
|
||||||
// Add vertical offset
|
// Add vertical offset
|
||||||
dst += offsetY * dstBytesWidth;
|
dst += offsetY * dstBytesWidth;
|
||||||
// Add horizontal offset
|
// Add horizontal offset
|
||||||
dst += offsetX * 4;
|
dst += offsetX * 4;
|
||||||
for (int row = 0; row < numRows; row++)
|
for (int row = 0; row < numRows; row++)
|
||||||
|
|
|
@ -442,7 +442,7 @@ void GPC_RenderTools::PopMatrix()
|
||||||
|
|
||||||
int GPC_RenderTools::applyLights(int objectlayer, const MT_Transform& viewmat)
|
int GPC_RenderTools::applyLights(int objectlayer, const MT_Transform& viewmat)
|
||||||
{
|
{
|
||||||
// taken from blender source, incompatibility between Blender Object / GameObject
|
// taken from blender source, incompatibility between Blender Object / GameObject
|
||||||
KX_Scene* kxscene = (KX_Scene*)m_auxilaryClientInfo;
|
KX_Scene* kxscene = (KX_Scene*)m_auxilaryClientInfo;
|
||||||
float glviewmat[16];
|
float glviewmat[16];
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
|
|
|
@ -110,7 +110,7 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
|
||||||
|
|
||||||
buffer = (unsigned char*)MEM_mallocN(bytes, "readBitmapFontVersion0:buffer");
|
buffer = (unsigned char*)MEM_mallocN(bytes, "readBitmapFontVersion0:buffer");
|
||||||
|
|
||||||
index = 0;
|
index = 0;
|
||||||
for (i = 0; i < bytes; i++) {
|
for (i = 0; i < bytes; i++) {
|
||||||
buffer[i] = rect[index];
|
buffer[i] = rect[index];
|
||||||
index += step;
|
index += step;
|
||||||
|
|
|
@ -479,7 +479,7 @@ bool GPG_Application::processEvent(GHOST_IEvent* event)
|
||||||
|
|
||||||
// // first check if we want to exit
|
// // first check if we want to exit
|
||||||
// m_exitRequested = m_ketsjiengine->GetExitCode();
|
// m_exitRequested = m_ketsjiengine->GetExitCode();
|
||||||
//
|
//
|
||||||
// // kick the engine
|
// // kick the engine
|
||||||
// bool renderFrame = m_ketsjiengine->NextFrame();
|
// bool renderFrame = m_ketsjiengine->NextFrame();
|
||||||
// if (renderFrame)
|
// if (renderFrame)
|
||||||
|
@ -546,7 +546,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// SYS_WriteCommandLineInt(syshandle, "fixedtime", 0);
|
// SYS_WriteCommandLineInt(syshandle, "fixedtime", 0);
|
||||||
// SYS_WriteCommandLineInt(syshandle, "vertexarrays",1);
|
// SYS_WriteCommandLineInt(syshandle, "vertexarrays",1);
|
||||||
GameData *gm= &m_startScene->gm;
|
GameData *gm= &m_startScene->gm;
|
||||||
bool properties = (SYS_GetCommandLineInt(syshandle, "show_properties", 0) != 0);
|
bool properties = (SYS_GetCommandLineInt(syshandle, "show_properties", 0) != 0);
|
||||||
bool profile = (SYS_GetCommandLineInt(syshandle, "show_profile", 0) != 0);
|
bool profile = (SYS_GetCommandLineInt(syshandle, "show_profile", 0) != 0);
|
||||||
|
@ -576,7 +576,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
|
||||||
|
|
||||||
m_canvas->Init();
|
m_canvas->Init();
|
||||||
if (gm->flag & GAME_SHOW_MOUSE)
|
if (gm->flag & GAME_SHOW_MOUSE)
|
||||||
m_canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL);
|
m_canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL);
|
||||||
|
|
||||||
m_rendertools = new GPC_RenderTools();
|
m_rendertools = new GPC_RenderTools();
|
||||||
if (!m_rendertools)
|
if (!m_rendertools)
|
||||||
|
@ -681,7 +681,7 @@ bool GPG_Application::startEngine(void)
|
||||||
|
|
||||||
// Temporary hack to disable banner display for NaN approved content.
|
// Temporary hack to disable banner display for NaN approved content.
|
||||||
/*
|
/*
|
||||||
m_canvas->SetBannerDisplayEnabled(true);
|
m_canvas->SetBannerDisplayEnabled(true);
|
||||||
Camera* cam;
|
Camera* cam;
|
||||||
cam = (Camera*)scene->camera->data;
|
cam = (Camera*)scene->camera->data;
|
||||||
if (cam) {
|
if (cam) {
|
||||||
|
@ -730,7 +730,7 @@ bool GPG_Application::startEngine(void)
|
||||||
// Set the GameLogic.globalDict from marshal'd data, so we can
|
// Set the GameLogic.globalDict from marshal'd data, so we can
|
||||||
// load new blend files and keep data in GameLogic.globalDict
|
// load new blend files and keep data in GameLogic.globalDict
|
||||||
loadGamePythonConfig(m_pyGlobalDictString, m_pyGlobalDictString_Length);
|
loadGamePythonConfig(m_pyGlobalDictString, m_pyGlobalDictString_Length);
|
||||||
#endif
|
#endif
|
||||||
m_sceneconverter->ConvertScene(
|
m_sceneconverter->ConvertScene(
|
||||||
startscene,
|
startscene,
|
||||||
m_rendertools,
|
m_rendertools,
|
||||||
|
|
|
@ -57,10 +57,10 @@ extern "C"
|
||||||
{
|
{
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
#include "BKE_blender.h"
|
#include "BKE_blender.h"
|
||||||
#include "BKE_global.h"
|
#include "BKE_global.h"
|
||||||
#include "BKE_icons.h"
|
#include "BKE_icons.h"
|
||||||
#include "BKE_node.h"
|
#include "BKE_node.h"
|
||||||
#include "BKE_report.h"
|
#include "BKE_report.h"
|
||||||
#include "BKE_library.h"
|
#include "BKE_library.h"
|
||||||
#include "BLI_threads.h"
|
#include "BLI_threads.h"
|
||||||
|
@ -223,7 +223,7 @@ void usage(const char* program, bool isBlenderPlayer)
|
||||||
printf(" --Optional parameters--\n");
|
printf(" --Optional parameters--\n");
|
||||||
printf(" angle = field of view in degrees\n");
|
printf(" angle = field of view in degrees\n");
|
||||||
printf(" tilt = tilt angle in degrees\n");
|
printf(" tilt = tilt angle in degrees\n");
|
||||||
printf(" warpdata = a file to use for warping the image (absolute path)\n");
|
printf(" warpdata = a file to use for warping the image (absolute path)\n");
|
||||||
printf(" mode: fisheye (Fisheye)\n");
|
printf(" mode: fisheye (Fisheye)\n");
|
||||||
printf(" truncatedfront (Front-Truncated)\n");
|
printf(" truncatedfront (Front-Truncated)\n");
|
||||||
printf(" truncatedrear (Rear-Truncated)\n");
|
printf(" truncatedrear (Rear-Truncated)\n");
|
||||||
|
@ -1016,12 +1016,12 @@ int main(int argc, char** argv)
|
||||||
gpg_nextframestate.app = &app;
|
gpg_nextframestate.app = &app;
|
||||||
gpg_nextframestate.gs = &gs;
|
gpg_nextframestate.gs = &gs;
|
||||||
pynextframestate.state = &gpg_nextframestate;
|
pynextframestate.state = &gpg_nextframestate;
|
||||||
pynextframestate.func = &GPG_PyNextFrame;
|
pynextframestate.func = &GPG_PyNextFrame;
|
||||||
|
|
||||||
printf("Yielding control to Python script '%s'...\n", python_main);
|
printf("Yielding control to Python script '%s'...\n", python_main);
|
||||||
PyRun_SimpleString(python_code);
|
PyRun_SimpleString(python_code);
|
||||||
printf("Exit Python script '%s'\n", python_main);
|
printf("Exit Python script '%s'\n", python_main);
|
||||||
#endif // WITH_PYTHON
|
#endif // WITH_PYTHON
|
||||||
MEM_freeN(python_code);
|
MEM_freeN(python_code);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -431,7 +431,7 @@ void BL_Shader::SetProg(bool enable)
|
||||||
glUseProgramObjectARB(mShader);
|
glUseProgramObjectARB(mShader);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
glUseProgramObjectARB(0);
|
glUseProgramObjectARB(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -613,7 +613,7 @@ void BL_Shader::SetUniform(int uniform, const MT_Tuple3& vec)
|
||||||
GLEW_ARB_vertex_shader &&
|
GLEW_ARB_vertex_shader &&
|
||||||
GLEW_ARB_shader_objects
|
GLEW_ARB_shader_objects
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
float value[3];
|
float value[3];
|
||||||
vec.getValue(value);
|
vec.getValue(value);
|
||||||
glUniform3fvARB(uniform, 1, value);
|
glUniform3fvARB(uniform, 1, value);
|
||||||
|
@ -931,7 +931,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" )
|
||||||
{
|
{
|
||||||
#ifdef SORT_UNIFORMS
|
#ifdef SORT_UNIFORMS
|
||||||
SetUniformfv(loc, BL_Uniform::UNI_FLOAT, &value, sizeof(float));
|
SetUniformfv(loc, BL_Uniform::UNI_FLOAT, &value, sizeof(float));
|
||||||
#else
|
#else
|
||||||
SetUniform( loc, (float)value );
|
SetUniform( loc, (float)value );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1142,7 +1142,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv, "setUniformfv( float (list2 or list
|
||||||
#ifdef SORT_UNIFORMS
|
#ifdef SORT_UNIFORMS
|
||||||
SetUniformfv(loc, BL_Uniform::UNI_FLOAT2, array2, sizeof(float)*2);
|
SetUniformfv(loc, BL_Uniform::UNI_FLOAT2, array2, sizeof(float)*2);
|
||||||
#else
|
#else
|
||||||
SetUniform(loc, array2, 2);
|
SetUniform(loc, array2, 2);
|
||||||
#endif
|
#endif
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
} break;
|
} break;
|
||||||
|
@ -1152,7 +1152,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv, "setUniformfv( float (list2 or list
|
||||||
#ifdef SORT_UNIFORMS
|
#ifdef SORT_UNIFORMS
|
||||||
SetUniformfv(loc, BL_Uniform::UNI_FLOAT3, array3, sizeof(float)*3);
|
SetUniformfv(loc, BL_Uniform::UNI_FLOAT3, array3, sizeof(float)*3);
|
||||||
#else
|
#else
|
||||||
SetUniform(loc, array3, 3);
|
SetUniform(loc, array3, 3);
|
||||||
#endif
|
#endif
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}break;
|
}break;
|
||||||
|
@ -1162,7 +1162,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv, "setUniformfv( float (list2 or list
|
||||||
#ifdef SORT_UNIFORMS
|
#ifdef SORT_UNIFORMS
|
||||||
SetUniformfv(loc, BL_Uniform::UNI_FLOAT4, array4, sizeof(float)*4);
|
SetUniformfv(loc, BL_Uniform::UNI_FLOAT4, array4, sizeof(float)*4);
|
||||||
#else
|
#else
|
||||||
SetUniform(loc, array4, 4);
|
SetUniform(loc, array4, 4);
|
||||||
#endif
|
#endif
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}break;
|
}break;
|
||||||
|
@ -1226,7 +1226,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( uniform_name, (list2
|
||||||
#ifdef SORT_UNIFORMS
|
#ifdef SORT_UNIFORMS
|
||||||
SetUniformiv(loc, BL_Uniform::UNI_INT2, array2, sizeof(int)*2);
|
SetUniformiv(loc, BL_Uniform::UNI_INT2, array2, sizeof(int)*2);
|
||||||
#else
|
#else
|
||||||
SetUniform(loc, array2, 2);
|
SetUniform(loc, array2, 2);
|
||||||
#endif
|
#endif
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
} break;
|
} break;
|
||||||
|
@ -1237,7 +1237,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( uniform_name, (list2
|
||||||
SetUniformiv(loc, BL_Uniform::UNI_INT3, array3, sizeof(int)*3);
|
SetUniformiv(loc, BL_Uniform::UNI_INT3, array3, sizeof(int)*3);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
SetUniform(loc, array3, 3);
|
SetUniform(loc, array3, 3);
|
||||||
#endif
|
#endif
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}break;
|
}break;
|
||||||
|
@ -1248,7 +1248,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( uniform_name, (list2
|
||||||
SetUniformiv(loc, BL_Uniform::UNI_INT4, array4, sizeof(int)*4);
|
SetUniformiv(loc, BL_Uniform::UNI_INT4, array4, sizeof(int)*4);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
SetUniform(loc, array4, 4);
|
SetUniform(loc, array4, 4);
|
||||||
#endif
|
#endif
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}break;
|
}break;
|
||||||
|
|
|
@ -222,7 +222,7 @@ public:
|
||||||
|
|
||||||
// Python interface
|
// Python interface
|
||||||
#ifdef WITH_PYTHON
|
#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);
|
KX_PYMETHOD_DOC(BL_Shader, setSource);
|
||||||
|
|
|
@ -47,7 +47,7 @@ static int power_of_2_min_i(int num)
|
||||||
{
|
{
|
||||||
while (!is_power_of_2_i(num))
|
while (!is_power_of_2_i(num))
|
||||||
num= num&(num-1);
|
num= num&(num-1);
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Place holder for a full texture manager
|
// Place holder for a full texture manager
|
||||||
|
@ -427,7 +427,7 @@ void BL_Texture::DisableAllTextures()
|
||||||
glMatrixMode(GL_TEXTURE);
|
glMatrixMode(GL_TEXTURE);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
glDisable(GL_TEXTURE_GEN_S);
|
glDisable(GL_TEXTURE_GEN_S);
|
||||||
glDisable(GL_TEXTURE_GEN_T);
|
glDisable(GL_TEXTURE_GEN_T);
|
||||||
glDisable(GL_TEXTURE_GEN_R);
|
glDisable(GL_TEXTURE_GEN_R);
|
||||||
|
@ -447,14 +447,14 @@ void BL_Texture::ActivateTexture()
|
||||||
|
|
||||||
if (mType == GL_TEXTURE_CUBE_MAP_ARB && GLEW_ARB_texture_cube_map)
|
if (mType == GL_TEXTURE_CUBE_MAP_ARB && GLEW_ARB_texture_cube_map)
|
||||||
{
|
{
|
||||||
glBindTexture( GL_TEXTURE_CUBE_MAP_ARB, mTexture );
|
glBindTexture( GL_TEXTURE_CUBE_MAP_ARB, mTexture );
|
||||||
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
|
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (GLEW_ARB_texture_cube_map )
|
if (GLEW_ARB_texture_cube_map )
|
||||||
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
|
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
|
||||||
|
|
||||||
glBindTexture( GL_TEXTURE_2D, mTexture );
|
glBindTexture( GL_TEXTURE_2D, mTexture );
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -659,7 +659,7 @@ void my_envmap_split_ima(EnvMap *env, ImBuf *ibuf)
|
||||||
{
|
{
|
||||||
int dx, part;
|
int dx, part;
|
||||||
|
|
||||||
my_free_envmapdata(env);
|
my_free_envmapdata(env);
|
||||||
|
|
||||||
dx= ibuf->y;
|
dx= ibuf->y;
|
||||||
dx/= 2;
|
dx/= 2;
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "NG_NetworkMessage.h"
|
#include "NG_NetworkMessage.h"
|
||||||
#include "NG_NetworkScene.h"
|
#include "NG_NetworkScene.h"
|
||||||
#include "NG_NetworkObject.h"
|
#include "NG_NetworkObject.h"
|
||||||
#include "SCA_IObject.h"
|
#include "SCA_IObject.h"
|
||||||
#include "InputParser.h"
|
#include "InputParser.h"
|
||||||
#include "ListValue.h"
|
#include "ListValue.h"
|
||||||
#include "StringValue.h"
|
#include "StringValue.h"
|
||||||
|
@ -201,7 +201,7 @@ PyAttributeDef KX_NetworkMessageSensor::Attributes[] = {
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
KX_NetworkMessageSensor *self = static_cast<KX_NetworkMessageSensor*>(self_v);
|
||||||
if (self->m_BodyList) {
|
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);
|
KX_NetworkMessageSensor *self = static_cast<KX_NetworkMessageSensor*>(self_v);
|
||||||
if (self->m_SubjectList) {
|
if (self->m_SubjectList) {
|
||||||
|
|
|
@ -80,7 +80,7 @@ public:
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
/* attributes */
|
/* attributes */
|
||||||
static PyObject* pyattr_get_bodies(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
static PyObject* pyattr_get_bodies(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||||
static PyObject* pyattr_get_subjects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
static PyObject* pyattr_get_subjects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||||
|
|
||||||
#endif // WITH_PYTHON
|
#endif // WITH_PYTHON
|
||||||
|
|
|
@ -86,7 +86,7 @@ void KX_ArmatureSensor::FindConstraint()
|
||||||
/* this constraint is not valid, can't use it */
|
/* this constraint is not valid, can't use it */
|
||||||
break;
|
break;
|
||||||
m_constraint = pcon;
|
m_constraint = pcon;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -193,13 +193,13 @@ PyAttributeDef KX_ArmatureSensor::Attributes[] = {
|
||||||
{ NULL } //Sentinel
|
{ 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);
|
KX_ArmatureSensor* sensor = static_cast<KX_ArmatureSensor*>(self);
|
||||||
if (sensor->m_gameobj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE) {
|
if (sensor->m_gameobj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE) {
|
||||||
BL_ArmatureObject* armobj = (BL_ArmatureObject*)sensor->m_gameobj;
|
BL_ArmatureObject* armobj = (BL_ArmatureObject*)sensor->m_gameobj;
|
||||||
BL_ArmatureConstraint* constraint = armobj->GetConstraint(sensor->m_posechannel, sensor->m_constraintname);
|
BL_ArmatureConstraint* constraint = armobj->GetConstraint(sensor->m_posechannel, sensor->m_constraintname);
|
||||||
if (constraint)
|
if (constraint)
|
||||||
return constraint->GetProxy();
|
return constraint->GetProxy();
|
||||||
}
|
}
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
|
|
|
@ -72,7 +72,7 @@ public:
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
/* Python interface ---------------------------------------------------- */
|
/* 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
|
#endif // WITH_PYTHON
|
||||||
|
|
||||||
|
|
|
@ -412,7 +412,7 @@ KX_BlenderMaterial::ActivatShaders(
|
||||||
|
|
||||||
if ((mMaterial->ras_mode &WIRE) ||
|
if ((mMaterial->ras_mode &WIRE) ||
|
||||||
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
|
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
|
||||||
{
|
{
|
||||||
if (mMaterial->ras_mode &WIRE)
|
if (mMaterial->ras_mode &WIRE)
|
||||||
rasty->SetCullFace(false);
|
rasty->SetCullFace(false);
|
||||||
rasty->SetLines(true);
|
rasty->SetLines(true);
|
||||||
|
@ -457,7 +457,7 @@ KX_BlenderMaterial::ActivateBlenderShaders(
|
||||||
|
|
||||||
if ((mMaterial->ras_mode &WIRE) ||
|
if ((mMaterial->ras_mode &WIRE) ||
|
||||||
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
|
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
|
||||||
{
|
{
|
||||||
if (mMaterial->ras_mode &WIRE)
|
if (mMaterial->ras_mode &WIRE)
|
||||||
rasty->SetCullFace(false);
|
rasty->SetCullFace(false);
|
||||||
rasty->SetLines(true);
|
rasty->SetLines(true);
|
||||||
|
@ -506,7 +506,7 @@ KX_BlenderMaterial::ActivateMat(
|
||||||
|
|
||||||
if ((mMaterial->ras_mode &WIRE) ||
|
if ((mMaterial->ras_mode &WIRE) ||
|
||||||
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
|
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
|
||||||
{
|
{
|
||||||
if (mMaterial->ras_mode &WIRE)
|
if (mMaterial->ras_mode &WIRE)
|
||||||
rasty->SetCullFace(false);
|
rasty->SetCullFace(false);
|
||||||
rasty->SetLines(true);
|
rasty->SetLines(true);
|
||||||
|
@ -614,7 +614,7 @@ void KX_BlenderMaterial::ActivatGLMaterials( RAS_IRasterizer* rasty )const
|
||||||
mMaterial->matcolor[2]*mMaterial->ref+mMaterial->emit,
|
mMaterial->matcolor[2]*mMaterial->ref+mMaterial->emit,
|
||||||
1.0f);
|
1.0f);
|
||||||
|
|
||||||
rasty->SetEmissive(
|
rasty->SetEmissive(
|
||||||
mMaterial->matcolor[0]*mMaterial->emit,
|
mMaterial->matcolor[0]*mMaterial->emit,
|
||||||
mMaterial->matcolor[1]*mMaterial->emit,
|
mMaterial->matcolor[1]*mMaterial->emit,
|
||||||
mMaterial->matcolor[2]*mMaterial->emit,
|
mMaterial->matcolor[2]*mMaterial->emit,
|
||||||
|
@ -835,19 +835,19 @@ PyTypeObject KX_BlenderMaterial::Type = {
|
||||||
py_base_new
|
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);
|
KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
|
||||||
return self->PygetShader(NULL, NULL);
|
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);
|
KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
|
||||||
return PyLong_FromSsize_t(self->GetMaterialIndex());
|
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);
|
KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
|
||||||
unsigned int* bfunc = self->getBlendFunc();
|
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)
|
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);
|
KX_BlenderMaterial* self= static_cast<KX_BlenderMaterial*>(self_v);
|
||||||
PyObject* obj = self->PysetBlending(value, NULL);
|
PyObject *obj = self->PysetBlending(value, NULL);
|
||||||
if (obj)
|
if (obj)
|
||||||
{
|
{
|
||||||
Py_DECREF(obj);
|
Py_DECREF(obj);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue