diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-07-03 04:02:45 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-07-03 04:02:45 +0400 |
commit | 98a7ca61fa905792bd3fdfa6c29f44691c9582ac (patch) | |
tree | 47455f2482f6eca0352c10c57482641eec6afb57 /source/gameengine/Ketsji | |
parent | 4e39a854b4589cddff484649d95cce4c71d4e9f4 (diff) | |
parent | 2ed69a95f499081aacc15c0295f3461c38430554 (diff) |
Merged changes in the trunk up to revision 48505.
Diffstat (limited to 'source/gameengine/Ketsji')
40 files changed, 89 insertions, 136 deletions
diff --git a/source/gameengine/Ketsji/BL_Action.h b/source/gameengine/Ketsji/BL_Action.h index e5e325a2ba0..ab2adf7fe34 100644 --- a/source/gameengine/Ketsji/BL_Action.h +++ b/source/gameengine/Ketsji/BL_Action.h @@ -132,9 +132,7 @@ public: }; #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Action"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Action") #endif }; diff --git a/source/gameengine/Ketsji/BL_ActionManager.h b/source/gameengine/Ketsji/BL_ActionManager.h index d4351e3c704..dbdaa6652ad 100644 --- a/source/gameengine/Ketsji/BL_ActionManager.h +++ b/source/gameengine/Ketsji/BL_ActionManager.h @@ -94,9 +94,7 @@ public: void Update(float); #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ActionManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_ActionManager") #endif }; diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h index d309b1236fc..f23dbfdf3a5 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.h +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -97,9 +97,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderShader"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_BlenderShader") #endif }; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 70fd640a07e..b67bd95f878 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -110,9 +110,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Material"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Material") #endif }; diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 47221365816..2bb094f12ee 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -32,9 +32,7 @@ public: int mLoc; // Sampler location #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Sampler"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Sampler") #endif }; @@ -79,9 +77,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Uniform"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Uniform") #endif }; @@ -104,9 +100,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DefUniform"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_DefUniform") #endif }; diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index 576da0d3f40..19247664dfa 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -144,7 +144,15 @@ bool BL_Texture::InitFromImage(int unit, Image *img, bool mipmap) mNeedsDeleted = 1; glGenTextures(1, (GLuint*)&mTexture); + +#ifdef WITH_DDS + if (ibuf->ftype & DDS) + InitGLCompressedTex(ibuf, mipmap); + else + InitGLTex(ibuf->rect, ibuf->x, ibuf->y, mipmap); +#else InitGLTex(ibuf->rect, ibuf->x, ibuf->y, mipmap); +#endif // track created units BL_TextureObject obj; @@ -183,6 +191,26 @@ void BL_Texture::InitGLTex(unsigned int *pix,int x,int y,bool mipmap) glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } +void BL_Texture::InitGLCompressedTex(ImBuf* ibuf, bool mipmap) +{ +#ifndef WITH_DDS + // Fall back to uncompressed if DDS isn't enabled + InitGLTex(ibuf->rect, ibuf->x, ibuf->y, mipmap); + return; +#else + glBindTexture(GL_TEXTURE_2D, mTexture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + + + if (GPU_upload_dxt_texture(ibuf) == 0) { + InitGLTex(ibuf->rect, ibuf->x, ibuf->y, mipmap); + return; + } +#endif +} void BL_Texture::InitNonPow2Tex(unsigned int *pix,int x,int y,bool mipmap) { diff --git a/source/gameengine/Ketsji/BL_Texture.h b/source/gameengine/Ketsji/BL_Texture.h index 3c60cad4fbf..a6bd354d260 100644 --- a/source/gameengine/Ketsji/BL_Texture.h +++ b/source/gameengine/Ketsji/BL_Texture.h @@ -35,6 +35,7 @@ private: void InitNonPow2Tex(unsigned int *p,int x,int y,bool mipmap ); void InitGLTex(unsigned int *p,int x,int y,bool mipmap ); + void InitGLCompressedTex(struct ImBuf *p, bool mipmap); public: BL_Texture(); ~BL_Texture( ); @@ -74,9 +75,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Texture"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Texture") #endif }; diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index c7f54838c10..4b3426e0784 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -221,6 +221,10 @@ set(SRC add_definitions(-DGLEW_STATIC) +if(WITH_IMAGE_DDS) + add_definitions(-DWITH_DDS) +endif() + if(WITH_SDL) list(APPEND INC_SYS ${SDL_INCLUDE_DIR} diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 5fcd591d822..71e806686ca 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -92,9 +92,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BulletPhysicsController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BulletPhysicsController") #endif }; diff --git a/source/gameengine/Ketsji/KX_CameraIpoSGController.h b/source/gameengine/Ketsji/KX_CameraIpoSGController.h index f24d0942290..06058760332 100644 --- a/source/gameengine/Ketsji/KX_CameraIpoSGController.h +++ b/source/gameengine/Ketsji/KX_CameraIpoSGController.h @@ -90,9 +90,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_CameraIpoSGController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_CameraIpoSGController") #endif }; diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h index 1a94c39441f..6fd1271160a 100644 --- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h +++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h @@ -80,9 +80,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ClientObjectInfo"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ClientObjectInfo") #endif }; diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 125df573893..24177af5d60 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -191,9 +191,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_Dome"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_Dome") #endif }; diff --git a/source/gameengine/Ketsji/KX_EmptyObject.h b/source/gameengine/Ketsji/KX_EmptyObject.h index 7ad9984888d..b99f44c38c5 100644 --- a/source/gameengine/Ketsji/KX_EmptyObject.h +++ b/source/gameengine/Ketsji/KX_EmptyObject.h @@ -43,9 +43,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_EmptyObject"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_EmptyObject") #endif }; diff --git a/source/gameengine/Ketsji/KX_FontObject.h b/source/gameengine/Ketsji/KX_FontObject.h index 30fe89162c0..ae8b4166238 100644 --- a/source/gameengine/Ketsji/KX_FontObject.h +++ b/source/gameengine/Ketsji/KX_FontObject.h @@ -69,14 +69,6 @@ protected: class RAS_IRenderTools* m_rendertools; //needed for drawing routine -#if 0 // WHY COMMENTED? - campbell -#ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_FontObject"); } - void operator delete( void *mem ) { MEM_freeN(mem); } -#endif -#endif - #ifdef WITH_PYTHON static PyObject* pyattr_get_text(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_text(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_IInterpolator.h b/source/gameengine/Ketsji/KX_IInterpolator.h index 2e30d77f8e5..6ca44e1f6e5 100644 --- a/source/gameengine/Ketsji/KX_IInterpolator.h +++ b/source/gameengine/Ketsji/KX_IInterpolator.h @@ -46,9 +46,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_IInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.h b/source/gameengine/Ketsji/KX_IPO_SGController.h index 3abcaa3a39e..266b89ff969 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.h +++ b/source/gameengine/Ketsji/KX_IPO_SGController.h @@ -119,11 +119,10 @@ public: m_ipotime = time; m_modified = true; } - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IpoSGController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_IpoSGController") #endif }; diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h index 528bf00d574..dd34549c1fb 100644 --- a/source/gameengine/Ketsji/KX_IPhysicsController.h +++ b/source/gameengine/Ketsji/KX_IPhysicsController.h @@ -141,9 +141,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IPhysicsController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_IPhysicsController") #endif }; diff --git a/source/gameengine/Ketsji/KX_IScalarInterpolator.h b/source/gameengine/Ketsji/KX_IScalarInterpolator.h index 72842f311c9..2b5aefccfe7 100644 --- a/source/gameengine/Ketsji/KX_IScalarInterpolator.h +++ b/source/gameengine/Ketsji/KX_IScalarInterpolator.h @@ -44,9 +44,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IScalarInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_IScalarInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h index 50390005f2b..919ae1d6de5 100644 --- a/source/gameengine/Ketsji/KX_ISceneConverter.h +++ b/source/gameengine/Ketsji/KX_ISceneConverter.h @@ -89,9 +89,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISceneConverter"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ISceneConverter") #endif }; diff --git a/source/gameengine/Ketsji/KX_ISystem.h b/source/gameengine/Ketsji/KX_ISystem.h index 4a6f7223d0a..4ba71f8d239 100644 --- a/source/gameengine/Ketsji/KX_ISystem.h +++ b/source/gameengine/Ketsji/KX_ISystem.h @@ -55,9 +55,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISystem"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ISystem") #endif }; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index f9c6d59b668..b3bef016b0f 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -443,9 +443,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_KetsjiEngine"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_KetsjiEngine") #endif }; diff --git a/source/gameengine/Ketsji/KX_LightIpoSGController.h b/source/gameengine/Ketsji/KX_LightIpoSGController.h index 15591bfa981..3a3a9677b04 100644 --- a/source/gameengine/Ketsji/KX_LightIpoSGController.h +++ b/source/gameengine/Ketsji/KX_LightIpoSGController.h @@ -98,9 +98,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_LightIpoSGController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_LightIpoSGController") #endif }; diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.h b/source/gameengine/Ketsji/KX_MaterialIpoController.h index 11d92925a02..ee5546641c2 100644 --- a/source/gameengine/Ketsji/KX_MaterialIpoController.h +++ b/source/gameengine/Ketsji/KX_MaterialIpoController.h @@ -58,9 +58,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MaterialIpoController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_MaterialIpoController") #endif }; diff --git a/source/gameengine/Ketsji/KX_MotionState.h b/source/gameengine/Ketsji/KX_MotionState.h index 02470f88c5e..3bead93cbda 100644 --- a/source/gameengine/Ketsji/KX_MotionState.h +++ b/source/gameengine/Ketsji/KX_MotionState.h @@ -58,8 +58,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MotionState"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_MotionState") #endif }; diff --git a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h index d2f4c69bf47..9a9b3dac098 100644 --- a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h +++ b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h @@ -73,9 +73,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ObColorIpoSGController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ObColorIpoSGController") #endif }; diff --git a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp index b8169899c78..fd47587e2c8 100644 --- a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp +++ b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp @@ -40,7 +40,7 @@ namespace inline float vdist(const float* a, const float* b) { return sqrtf(vdistsqr(a,b)); } inline void vcpy(float* a, const float* b) { a[0]=b[0]; a[1]=b[1]; } inline float vdot(const float* a, const float* b) { return a[0]*b[0] + a[1]*b[1]; } - inline float vperp(const float* a, const float* b) { return a[0]*b[1] - a[1]*b[0]; } +/* inline float vperp(const float* a, const float* b) { return a[0]*b[1] - a[1]*b[0]; } */ /* UNUSED */ inline void vsub(float* v, const float* a, const float* b) { v[0] = a[0]-b[0]; v[1] = a[1]-b[1]; } inline void vadd(float* v, const float* a, const float* b) { v[0] = a[0]+b[0]; v[1] = a[1]+b[1]; } inline void vscale(float* v, const float* a, const float s) { v[0] = a[0]*s; v[1] = a[1]*s; } @@ -48,7 +48,7 @@ namespace inline float vlensqr(const float* v) { return vdot(v,v); } inline float vlen(const float* v) { return sqrtf(vlensqr(v)); } inline void vlerp(float* v, const float* a, const float* b, float t) { v[0] = lerp(a[0], b[0], t); v[1] = lerp(a[1], b[1], t); } - inline void vmad(float* v, const float* a, const float* b, float s) { v[0] = a[0] + b[0]*s; v[1] = a[1] + b[1]*s; } +/* inline void vmad(float* v, const float* a, const float* b, float s) { v[0] = a[0] + b[0]*s; v[1] = a[1] + b[1]*s; } */ /* UNUSED */ inline void vnorm(float* v) { float d = vlen(v); @@ -549,6 +549,9 @@ void KX_ObstacleSimulationTOI_rays::sampleRVO(KX_Obstacle* activeObst, KX_NavMes p1, p2, ob->m_rad, htmin, htmax)) continue; } + else { + continue; + } if (htmin > 0.0f) { @@ -743,6 +746,9 @@ static void processSamples(KX_Obstacle* activeObst, KX_NavMeshObject* activeNavM // Avoid less when facing walls. htmin *= 2.0f; } + else { + continue; + } if (htmin >= 0.0f) { diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.h b/source/gameengine/Ketsji/KX_OrientationInterpolator.h index 1a4ed534d16..59014b70174 100644 --- a/source/gameengine/Ketsji/KX_OrientationInterpolator.h +++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.h @@ -56,9 +56,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -private: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_OrientationInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_OrientationInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_PositionInterpolator.h b/source/gameengine/Ketsji/KX_PositionInterpolator.h index ef5dfc8ac6b..b5ab053bb0e 100644 --- a/source/gameengine/Ketsji/KX_PositionInterpolator.h +++ b/source/gameengine/Ketsji/KX_PositionInterpolator.h @@ -56,9 +56,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -private: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_PositionInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_PositionInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 2a648303c52..823363dfd11 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1130,8 +1130,8 @@ static int getGLSLSettingFlag(const char *setting) } static PyObject* gPySetGLSLMaterialSetting(PyObject*, - PyObject* args, - PyObject*) + PyObject* args, + PyObject*) { GlobalSettings *gs= gp_KetsjiEngine->GetGlobalSettings(); char *setting; @@ -1142,7 +1142,7 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*, flag = getGLSLSettingFlag(setting); - if (flag==-1) { + if (flag == -1) { PyErr_SetString(PyExc_ValueError, "Rasterizer.setGLSLMaterialSetting(string): glsl setting is not known"); return NULL; } @@ -1173,8 +1173,8 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*, } static PyObject* gPyGetGLSLMaterialSetting(PyObject*, - PyObject* args, - PyObject*) + PyObject* args, + PyObject*) { GlobalSettings *gs= gp_KetsjiEngine->GetGlobalSettings(); char *setting; @@ -1185,7 +1185,7 @@ static PyObject* gPyGetGLSLMaterialSetting(PyObject*, flag = getGLSLSettingFlag(setting); - if (flag==-1) { + if (flag == -1) { PyErr_SetString(PyExc_ValueError, "Rasterizer.getGLSLMaterialSetting(string): glsl setting is not known"); return NULL; } diff --git a/source/gameengine/Ketsji/KX_RayCast.h b/source/gameengine/Ketsji/KX_RayCast.h index 814443f5c64..544080f31d0 100644 --- a/source/gameengine/Ketsji/KX_RayCast.h +++ b/source/gameengine/Ketsji/KX_RayCast.h @@ -96,9 +96,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_RayCast") #endif }; @@ -135,9 +133,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast::Callback"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_RayCast::Callback") #endif }; diff --git a/source/gameengine/Ketsji/KX_RayEventManager.h b/source/gameengine/Ketsji/KX_RayEventManager.h index fee2fe53227..f795495d1c9 100644 --- a/source/gameengine/Ketsji/KX_RayEventManager.h +++ b/source/gameengine/Ketsji/KX_RayEventManager.h @@ -46,9 +46,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_RayEventManager") #endif }; diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h index 734f82731b8..76fefdebe08 100644 --- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h +++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h @@ -89,9 +89,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BoneParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BoneParentRelation") #endif }; diff --git a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h index 44864c87cd7..b5ab5302910 100644 --- a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h +++ b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h @@ -88,9 +88,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_NormalParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_NormalParentRelation") #endif }; @@ -145,9 +143,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_VertexParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_VertexParentRelation") #endif }; @@ -228,9 +224,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_SlowParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_SlowParentRelation") #endif }; diff --git a/source/gameengine/Ketsji/KX_ScalarInterpolator.h b/source/gameengine/Ketsji/KX_ScalarInterpolator.h index d08a32ce0aa..5d8c3163376 100644 --- a/source/gameengine/Ketsji/KX_ScalarInterpolator.h +++ b/source/gameengine/Ketsji/KX_ScalarInterpolator.h @@ -61,9 +61,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalarInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ScalarInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_ScalingInterpolator.h b/source/gameengine/Ketsji/KX_ScalingInterpolator.h index ae8b25f9185..52b6d0cf8cc 100644 --- a/source/gameengine/Ketsji/KX_ScalingInterpolator.h +++ b/source/gameengine/Ketsji/KX_ScalingInterpolator.h @@ -56,9 +56,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalingInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ScalingInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h index 62b74871603..ea780739695 100644 --- a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h +++ b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h @@ -129,9 +129,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeCategoryLogger"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_TimeCategoryLogger") #endif }; diff --git a/source/gameengine/Ketsji/KX_TimeLogger.h b/source/gameengine/Ketsji/KX_TimeLogger.h index b2336c2c512..83c934ea81b 100644 --- a/source/gameengine/Ketsji/KX_TimeLogger.h +++ b/source/gameengine/Ketsji/KX_TimeLogger.h @@ -107,9 +107,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeLogger"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_TimeLogger") #endif }; diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.h b/source/gameengine/Ketsji/KX_TouchEventManager.h index 38286cba9aa..d9a0164fd05 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.h +++ b/source/gameengine/Ketsji/KX_TouchEventManager.h @@ -81,9 +81,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TouchEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_TouchEventManager") #endif }; diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h b/source/gameengine/Ketsji/KX_WorldInfo.h index cb4e9de50c2..e4a73873fa1 100644 --- a/source/gameengine/Ketsji/KX_WorldInfo.h +++ b/source/gameengine/Ketsji/KX_WorldInfo.h @@ -70,9 +70,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldInfo"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_WorldInfo") #endif }; diff --git a/source/gameengine/Ketsji/KX_WorldIpoController.h b/source/gameengine/Ketsji/KX_WorldIpoController.h index 9578130b51e..409b1fec321 100644 --- a/source/gameengine/Ketsji/KX_WorldIpoController.h +++ b/source/gameengine/Ketsji/KX_WorldIpoController.h @@ -96,9 +96,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldIpoController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_WorldIpoController") #endif }; |