code cleanup: remove Python.h include from blenkernel.

This commit is contained in:
Campbell Barton 2012-07-04 20:13:39 +00:00
parent 6e97ecee00
commit 21bf13989f
5 changed files with 7 additions and 15 deletions

@ -244,7 +244,7 @@ PyObject* AUD_initPython()
return module; return module;
} }
PyObject* AUD_getPythonFactory(AUD_Sound* sound) void* AUD_getPythonFactory(AUD_Sound* sound)
{ {
if(sound) if(sound)
{ {
@ -259,9 +259,9 @@ PyObject* AUD_getPythonFactory(AUD_Sound* sound)
return NULL; return NULL;
} }
AUD_Sound* AUD_getPythonSound(PyObject* sound) AUD_Sound* AUD_getPythonSound(void* sound)
{ {
Factory* factory = checkFactory(sound); Factory* factory = checkFactory((PyObject *)sound);
if(!factory) if(!factory)
return NULL; return NULL;

@ -29,10 +29,6 @@
#ifndef __AUD_C_API_H__ #ifndef __AUD_C_API_H__
#define __AUD_C_API_H__ #define __AUD_C_API_H__
#ifdef WITH_PYTHON
#include "Python.h"
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -740,14 +736,14 @@ extern AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* seque
* \param sound The sound factory. * \param sound The sound factory.
* \return The python factory. * \return The python factory.
*/ */
extern PyObject* AUD_getPythonFactory(AUD_Sound* sound); extern void* AUD_getPythonFactory(AUD_Sound* sound);
/** /**
* Retrieves the sound factory of a python factory. * Retrieves the sound factory of a python factory.
* \param sound The python factory. * \param sound The python factory.
* \return The sound factory. * \return The sound factory.
*/ */
extern AUD_Sound* AUD_getPythonSound(PyObject* sound); extern AUD_Sound* AUD_getPythonSound(void* sound);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

@ -317,9 +317,6 @@ if(WITH_PYTHON)
list(APPEND INC list(APPEND INC
../python ../python
) )
list(APPEND INC_SYS
${PYTHON_INCLUDE_DIRS}
)
add_definitions(-DWITH_PYTHON) add_definitions(-DWITH_PYTHON)
if(WITH_PYTHON_SECURITY) if(WITH_PYTHON_SECURITY)

@ -32,7 +32,6 @@ if env['WITH_BF_FRAMESERVER']:
if env['WITH_BF_PYTHON']: if env['WITH_BF_PYTHON']:
incs += ' ../python' incs += ' ../python'
incs += ' ' + env['BF_PYTHON_INC']
defs.append('WITH_PYTHON') defs.append('WITH_PYTHON')
if env['BF_DEBUG']: if env['BF_DEBUG']:
defs.append('DEBUG') defs.append('DEBUG')

@ -433,7 +433,7 @@ PyObject* KX_SoundActuator::pyattr_get_sound(void *self, const struct KX_PYATTRI
{ {
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self); KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
if (!actuator->m_sound.isNull()) if (!actuator->m_sound.isNull())
return AUD_getPythonFactory(&actuator->m_sound); return (PyObject *)AUD_getPythonFactory(&actuator->m_sound);
else else
Py_RETURN_NONE; Py_RETURN_NONE;
} }
@ -547,7 +547,7 @@ int KX_SoundActuator::pyattr_set_sound(void *self, const struct KX_PYATTRIBUTE_D
if (!PyArg_Parse(value, "O", &sound)) if (!PyArg_Parse(value, "O", &sound))
return PY_SET_ATTR_FAIL; return PY_SET_ATTR_FAIL;
AUD_Reference<AUD_IFactory>* snd = reinterpret_cast<AUD_Reference<AUD_IFactory>*>(AUD_getPythonSound(sound)); AUD_Reference<AUD_IFactory>* snd = reinterpret_cast<AUD_Reference<AUD_IFactory>*>(AUD_getPythonSound((void *)sound));
if (snd) if (snd)
{ {
actuator->m_sound = *snd; actuator->m_sound = *snd;