BGE guardedalloc, Uses WITH_CXX_GUARDEDALLOC but gives a string to MEM_mallocN for better tracking memory usage.

* off by default.
* new/delete are at the bottom of each class
* python BGE objects have the new/delete in the Py_Header macro.
This commit is contained in:
Campbell Barton
2009-08-18 15:37:31 +00:00
parent 3682624616
commit 14d33b3c1f
123 changed files with 1068 additions and 36 deletions

View File

@@ -40,6 +40,10 @@
#include "KX_BlenderGL.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
struct ARegion;
struct wmWindow;
@@ -166,6 +170,13 @@ private:
struct ARegion* m_ar;
struct wmWindow* m_win;
RAS_Rect m_area_rect;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderCanvas"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // __KX_BLENDERCANVAS

View File

@@ -39,7 +39,9 @@
#include "WM_types.h"
#include "SCA_IInputDevice.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
/**
Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode.
@@ -222,6 +224,12 @@ public:
// virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0;
virtual bool ConvertBlenderEvent(unsigned short incode,short val)=0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderInputDevice"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_BLENDERINPUTDEVICE

View File

@@ -31,6 +31,10 @@
#include "KX_BlenderInputDevice.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class KX_BlenderKeyboardDevice : public BL_BlenderInputDevice
{
bool m_hookesc;
@@ -43,6 +47,13 @@ public:
virtual bool ConvertBlenderEvent(unsigned short incode,short val);
virtual void NextFrame();
virtual void HookEscape();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderKeyboardDevice"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_BLENDERKEYBOARDDEVICE

View File

@@ -31,6 +31,10 @@
#include "KX_BlenderInputDevice.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class KX_BlenderMouseDevice : public BL_BlenderInputDevice
{
public:
@@ -41,6 +45,13 @@ public:
// virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode);
virtual bool ConvertBlenderEvent(unsigned short incode,short val);
virtual void NextFrame();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderMouseDevice"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_BLENDERMOUSEDEVICE

View File

@@ -37,6 +37,10 @@
#include "RAS_IRenderTools.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
struct KX_ClientObjectInfo;
class KX_RayCast;
@@ -95,6 +99,13 @@ public:
virtual void Render2DFilters(RAS_ICanvas* canvas);
virtual void SetClientObject(RAS_IRasterizer *rasty, void* obj);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderRenderTools"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_BLENDERRENDERTOOLS

View File

@@ -34,6 +34,10 @@
*/
#include "KX_ISystem.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class KX_BlenderSystem : public KX_ISystem
{
double m_starttime;
@@ -42,6 +46,14 @@ public:
KX_BlenderSystem();
virtual ~KX_BlenderSystem() {};
virtual double GetTimeInSeconds();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSystem"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_BLENDERSYSTEM

View File

@@ -93,6 +93,13 @@ protected:
short m_activePriority;
double m_lastapplyframe;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ArmatureObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -45,7 +45,6 @@ struct Key;
class BL_DeformableGameObject : public KX_GameObject
{
public:
CValue* GetReplica();
double GetLastFrame ()
@@ -100,6 +99,12 @@ protected:
Object* m_blendobj;
short m_activePriority;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DeformableGameObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -85,6 +85,13 @@ protected:
int m_tvtot;
BL_DeformableGameObject* m_gameobj;
double m_lastDeformUpdate;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_MeshDeformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -101,6 +101,12 @@ protected:
Scene *m_scene;
DerivedMesh *m_dm;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ModifierDeformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -83,6 +83,12 @@ protected:
vector<IpoCurve*> m_shapeDrivers;
double m_lastShapeUpdate;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -105,6 +105,12 @@ protected:
bool m_poseApplied;
bool m_recalcNormal;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinDeformer"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -54,6 +54,13 @@ public:
// for shape keys,
void CheckWeightCache(struct Object* obj);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinMeshObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -94,6 +94,13 @@ public:
setMistColorBlue(
float d
);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BlenderWorldInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__BLENDERWORLDINFO_H

View File

@@ -49,6 +49,13 @@ public:
private:
struct FCurve *m_fcu;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ScalarInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -58,6 +65,13 @@ public:
~BL_InterpolatorList();
KX_IScalarInterpolator *GetScalarInterpolator(char *rna_path, int array_index);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_InterpolatorList"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_SCALARINTERPOLATOR_H

View File

@@ -143,6 +143,12 @@ public:
struct Main* GetMain() { return m_maggie; };
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSceneConverter"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_BLENDERSCENECONVERTER_H

View File

@@ -49,6 +49,13 @@ public:
private:
bool m_bool;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBoolValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _BOOLVALUE_H

View File

@@ -41,6 +41,13 @@ public:
private:
CValue* m_value;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CConstExpr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined(AFX_CONSTEXPR_H__061ECFC3_BE87_11D1_A51C_00A02472FC58__INCLUDED_)

View File

@@ -34,6 +34,13 @@ public:
CValue * Calc(VALUE_OPERATOR op, CValue *val);
CValue * CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val);
virtual CValue* GetReplica();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CEmptyValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _EMPTYVALUE_H

View File

@@ -33,6 +33,13 @@ public:
private:
STR_String m_strErrorText;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CErrorValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _ERRORVALUE_H

View File

@@ -63,6 +63,12 @@ class CBrokenLinkInfo
CExpression* m_pExpr;
bool m_bRestored;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBrokenLinkInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -126,6 +132,13 @@ public:
protected:
int m_refcount;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CExpression"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _EXPRESSION_H

View File

@@ -42,6 +42,12 @@ protected:
float m_float;
STR_String* m_pstrRep;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _FLOATVALUE_H

View File

@@ -46,6 +46,13 @@ public:
virtual CExpression* CheckLink(std::vector<CBrokenLinkInfo*>& brokenlinks);
virtual void ClearModified();
virtual void BroadcastOperators(VALUE_OPERATOR op);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIdentifierExpr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__IDENTIFIER_EXPR

View File

@@ -44,6 +44,13 @@ public:
virtual CExpression* CheckLink(std::vector<CBrokenLinkInfo*>& brokenlinks);
virtual void ClearModified();
virtual void BroadcastOperators(VALUE_OPERATOR op);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIfExpr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined(AFX_IFEXPR_H__1F691841_C5C7_11D1_A863_0000B4542BD8__INCLUDED_)

View File

@@ -102,7 +102,13 @@ private:
int Priority(int optor);
CExpression *Ex(int i);
CExpression *Expr();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CParser"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -56,6 +56,12 @@ private:
cInt m_int;
STR_String* m_pstrRep;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _INTVALUE_H

View File

@@ -29,6 +29,10 @@
#ifndef __KX_HASHEDPTR
#define __KX_HASHEDPTR
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
unsigned int KX_Hash(void * inDWord);
class CHashedPtr
@@ -44,6 +48,13 @@ public:
{
return rhs.m_valptr == lhs.m_valptr;
}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CHashedPtr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_HASHEDPTR

View File

@@ -46,6 +46,13 @@ public:
private:
VALUE_OPERATOR m_op;
CExpression * m_lhs;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator1Expr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined(AFX_OPERATOR1EXPR_H__A1653901_BF41_11D1_A51C_00A02472FC58__INCLUDED_)

View File

@@ -52,7 +52,13 @@ protected:
private:
VALUE_OPERATOR m_op;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator2Expr"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _OPERATOR2EXPR_H

View File

@@ -102,7 +102,7 @@ typedef struct {
// This must be the first line of each
// PyC++ class
#define Py_Header \
#define __Py_Header \
public: \
static PyTypeObject Type; \
static PyMethodDef Methods[]; \
@@ -111,6 +111,16 @@ typedef struct {
virtual PyObject *GetProxy() {return GetProxy_Ext(this, &Type);}; \
virtual PyObject *NewProxy(bool py_owns) {return NewProxy_Ext(this, &Type, py_owns);}; \
#ifdef WITH_CXX_GUARDEDALLOC
#define Py_Header __Py_Header \
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \
void operator delete( void *mem ) { MEM_freeN(mem); } \
#else
#define Py_Header __Py_Header
#endif
/*
* nonzero values are an error for setattr
* however because of the nested lookups we need to know if the errors

View File

@@ -46,6 +46,13 @@ public:
private:
// data member
STR_String m_strString;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CStringValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -42,6 +42,10 @@
#include <map> // array functionality for the propertylist
#include "STR_String.h" // STR_String class
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
#ifndef GEN_NO_ASSERT
#undef assert
#define assert(exp) ((void)NULL)
@@ -173,6 +177,13 @@ public:
virtual ~CAction(){
};
virtual void Execute() const =0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CAction"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
//
@@ -407,7 +418,6 @@ public: \
class CPropValue : public CValue
{
public:
#ifndef NO_EXP_PYTHON_EMBEDDING
CPropValue() :
CValue(),
@@ -436,6 +446,13 @@ public:
protected:
STR_String m_strNewName; // Identification
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CPropValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _VALUEBASECLASS_H

View File

@@ -79,6 +79,13 @@ public:
protected:
double m_vec[3];
double m_transformedvec[3];
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVectorValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _VECTORVALUE_H

View File

@@ -59,6 +59,13 @@ public:
/// Data members
bool m_bDeleteOnDestruct;
void* m_pAnything;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVoidValue"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // !defined _VOIDVALUE_H

View File

@@ -45,6 +45,13 @@ public:
virtual void NextFrame();
virtual void UpdateFrame();
//SCA_LogicManager* GetLogicManager() { return m_logicmgr;}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ActuatorEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_ACTUATOREVENTMANAGER

View File

@@ -41,6 +41,11 @@ public:
virtual void NextFrame();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_AlwaysEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_ALWAYSEVENTMGR

View File

@@ -71,6 +71,13 @@ public:
protected:
EVENT_MANAGER_TYPE m_mgrtype;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_EventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -53,6 +53,13 @@ public:
* so that self references are removed before the controller itself is released
*/
virtual void Delete();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ExpressionController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_EXPRESSIONCONTROLLER

View File

@@ -127,6 +127,13 @@ public:
void IncLink() { m_links++; }
void DecLink();
bool IsNoLink() const { return !m_links; }
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IActuator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_IACTUATOR

View File

@@ -33,6 +33,10 @@
#ifndef KX_INPUTDEVICE_H
#define KX_INPUTDEVICE_H
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class SCA_InputEvent
{
@@ -302,6 +306,12 @@ public:
*/
virtual void NextFrame();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_InputEvent"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //KX_INPUTDEVICE_H

View File

@@ -33,6 +33,10 @@
#include "STR_String.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
struct SCA_DebugProp
{
class CValue* m_obj;
@@ -60,6 +64,13 @@ public:
void AddDebugProperty(class CValue* debugprop,
const STR_String &name);
void RemoveAllDebugProperties();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IScene"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_ISCENE_H

View File

@@ -47,6 +47,12 @@ public:
virtual void NextFrame(double curtime,double deltatime);
SCA_Joystick* GetJoystickDevice(short int joyindex);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_JoystickManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -56,6 +56,13 @@ public:
virtual void NextFrame();
SCA_IInputDevice* GetInputDevice();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_KeyboardManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_KEYBOARDMANAGER

View File

@@ -137,6 +137,13 @@ public:
void RegisterGameObj(void* blendobj, CValue* gameobj);
void UnregisterGameObj(void* blendobj, CValue* gameobj);
CValue* FindGameObjByBlendObj(void* blendobj);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_LogicManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_LOGICMANAGER

View File

@@ -63,6 +63,13 @@ public:
bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
virtual void NextFrame();
SCA_IInputDevice* GetInputDevice();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_MouseManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_MOUSEMANAGER

View File

@@ -40,6 +40,12 @@ class SCA_PropertyEventManager : public SCA_EventManager
class SCA_LogicManager* m_logicmgr;
public:
#ifdef WITH_CXX_GUARDEDALLOC
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
SCA_PropertyEventManager(class SCA_LogicManager* logicmgr);
virtual ~SCA_PropertyEventManager();
virtual void NextFrame();

View File

@@ -45,6 +45,13 @@ public:
SCA_RandomEventManager(class SCA_LogicManager* logicmgr);
virtual void NextFrame();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_RANDOMEVENTMGR

View File

@@ -34,6 +34,10 @@
#ifndef __KX_RANDOMNUMBERGENERATOR
#define __KX_RANDOMNUMBERGENERATOR
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class SCA_RandomNumberGenerator {
/* reference counted for memleak */
@@ -69,6 +73,13 @@ class SCA_RandomNumberGenerator {
if (--m_refcount == 0)
delete this;
}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomNumberGenerator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif /* __KX_RANDOMNUMBERGENERATOR */

View File

@@ -48,6 +48,13 @@ public:
virtual void RemoveSensor(class SCA_ISensor* sensor);
void AddTimeProperty(CValue* timeval);
void RemoveTimeProperty(CValue* timeval);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_TimeEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_TIMEEVENTMANAGER

View File

@@ -57,6 +57,13 @@ public:
int GetBlendMode();
bool Equals(BL_BlenderShader *blshader);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderShader"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif//__BL_GPUSHADER_H__

View File

@@ -4,6 +4,10 @@
#include "STR_String.h"
#include "MT_Point2.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
// --
struct MTex;
struct Material;
@@ -98,6 +102,13 @@ public:
void SetSharedMaterial(bool v);
bool IsShared();
void SetUsers(int num);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Material"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
// BL_Material::IdMode

View File

@@ -25,6 +25,12 @@ public:
{
}
int mLoc; // Sampler location
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Sampler"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
/**
@@ -65,6 +71,13 @@ public:
int GetLocation() { return mLoc; }
void* getData() { return mData; }
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Uniform"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
/**
@@ -83,6 +96,13 @@ public:
int mType;
int mLoc;
unsigned int mFlag;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DefUniform"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
/**

View File

@@ -67,6 +67,12 @@ public:
return tmp;
}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Texture"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif//__BL_TEXTURE_H__

View File

@@ -15,6 +15,10 @@
#include "MT_Vector3.h"
#include "MT_Vector4.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
struct MTFace;
class KX_Scene;

View File

@@ -18,7 +18,6 @@ private:
btCollisionShape* m_bulletChildShape;
public:
KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool compound);
virtual ~KX_BulletPhysicsController ();
@@ -81,6 +80,12 @@ public:
// intentionally empty
};
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BulletPhysicsController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //KX_BULLET2PHYSICS_CONTROLLER

View File

@@ -84,6 +84,13 @@ public:
m_modify_clipstart = modify;
}
void AddInterpolator(KX_IInterpolator* interp);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_CameraIpoSGController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // KX_CAMERAIPOSGCONTROLLER_H

View File

@@ -74,6 +74,13 @@ public:
bool isActor() { return m_type <= ACTOR; }
bool isSensor() { return m_type >= SENSOR && m_type <= OBACTORSENSOR; }
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ClientObjectInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_CLIENTOBJECT_INFO_H

View File

@@ -18,7 +18,7 @@ http://www.gnu.org/copyleft/lesser.txt.
Contributor(s): Dalai Felinto
This source uses some of the ideas and code from Paul Bourke.
Developed as part of a Research and Development project for SAT - La Soci<63>t<EFBFBD> des arts technologiques.
Developed as part of a Research and Development project for SAT - La Soci<63>t<EFBFBD> des arts technologiques.
-----------------------------------------------------------------------------
*/
@@ -78,7 +78,7 @@ public:
bool fboSupported;
//openGL names:
GLuint domefacesId[7]; // ID of the images -- room for 7 images, using only 4 for 180<38> x 360<36> dome, 6 for panoramic and +1 for warp mesh
GLuint domefacesId[7]; // ID of the images -- room for 7 images, using only 4 for 180<38> x 360<36> dome, 6 for panoramic and +1 for warp mesh
GLuint dlistId; // ID of the Display Lists of the images (used as an offset)
typedef struct {
@@ -184,6 +184,13 @@ protected:
RAS_IRenderTools* m_rendertools;
/// engine
KX_KetsjiEngine* m_engine;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_Dome"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -37,7 +37,13 @@ public:
KX_GameObject(sgReplicationInfo,callbacks)
{};
virtual ~KX_EmptyObject();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_EmptyObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_EMPTYOBJECT

View File

@@ -31,11 +31,22 @@
#include <vector>
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class KX_IInterpolator {
public:
virtual ~KX_IInterpolator() {}
virtual void Execute(float currentTime) const = 0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
typedef std::vector<KX_IInterpolator *> T_InterpolatorList;

View File

@@ -116,6 +116,12 @@ public:
m_ipotime = time;
m_modified = true;
}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IpoSGController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__IPO_SGCONTROLLER_H

View File

@@ -126,6 +126,13 @@ public:
// call from scene graph to update
virtual bool Update(double time)=0;
void* GetUserData() { return m_userdata;}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IPhysicsController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_IPHYSICSCONTROLLER_H

View File

@@ -29,11 +29,22 @@
#ifndef KX_ISCALARINTERPOLATOR_H
#define KX_ISCALARINTERPOLATOR_H
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class KX_IScalarInterpolator {
public:
virtual ~KX_IScalarInterpolator() {}
virtual float GetValue(float currentTime) const = 0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IScalarInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -32,6 +32,10 @@
#include "STR_String.h"
#include "KX_Python.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
struct Scene;
class KX_ISceneConverter
@@ -80,6 +84,13 @@ public:
virtual bool GetGLSLMaterials()=0;
virtual struct Scene* GetBlenderSceneForName(const STR_String& name)=0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISceneConverter"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_ISCENECONVERTER_H

View File

@@ -37,6 +37,10 @@ using namespace std;
#include "STR_String.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
/**
* System Abstraction, needed only for getting some timing stuff from the host.
*/
@@ -47,6 +51,13 @@ public:
virtual ~KX_ISystem() {};
virtual double GetTimeInSeconds()=0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISystem"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -190,7 +190,6 @@ private:
void DoSound(KX_Scene* scene);
public:
KX_KetsjiEngine(class KX_ISystem* system);
virtual ~KX_KetsjiEngine();
@@ -396,6 +395,13 @@ protected:
bool BeginFrame();
void ClearFrame();
void EndFrame();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_KetsjiEngine"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_KETSJI_ENGINE

View File

@@ -92,6 +92,13 @@ public:
};
void AddInterpolator(KX_IInterpolator* interp);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_LightIpoSGController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // KX_LIGHTIPOSGCONTROLLER_H

View File

@@ -50,6 +50,13 @@ public:
void AddInterpolator(KX_IInterpolator* interp);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MaterialIpoController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};

View File

@@ -31,6 +31,10 @@
#include "PHY_IMotionState.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class KX_MotionState : public PHY_IMotionState
{
class SG_Spatial* m_node;
@@ -48,6 +52,12 @@ public:
virtual void setWorldOrientation(const float* ori);
virtual void calculateWorldTransformations();
#ifdef WITH_CXX_GUARDEDALLOC
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MotionState"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_MOTIONSTATE

View File

@@ -67,6 +67,13 @@ public:
void AddInterpolator(KX_IInterpolator* interp);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ObColorIpoSGController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // KX_OBCOLORIPOSGCONTROLLER_H

View File

@@ -50,6 +50,13 @@ public:
private:
MT_Matrix3x3& m_target;
KX_IScalarInterpolator *m_ipos[3];
#ifdef WITH_CXX_GUARDEDALLOC
private:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_OrientationInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -35,6 +35,10 @@
#include "RAS_IRasterizer.h"
#include "DNA_ID.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
struct MTFace;
struct Material;
struct MTex;
@@ -57,6 +61,7 @@ private:
mutable int m_pass;
public:
KX_PolygonMaterial();
void Initialize(const STR_String &texname,
Material* ma,

View File

@@ -50,6 +50,13 @@ public:
private:
MT_Point3& m_target;
KX_IScalarInterpolator *m_ipos[3];
#ifdef WITH_CXX_GUARDEDALLOC
private:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_PositionInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -89,6 +89,12 @@ public:
const MT_Point3& topoint,
KX_RayCast& callback);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
template<class T> class KX_RayCast::Callback : public KX_RayCast
@@ -121,7 +127,13 @@ public:
}
return self->NeedRayCast(info);
}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast::Callback"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};

View File

@@ -45,6 +45,13 @@ public:
m_logicmgr(logicmgr)
{}
virtual void NextFrame();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_RAYEVENTMGR

View File

@@ -59,7 +59,6 @@ class KX_BoneParentRelation : public SG_ParentRelation
{
public :
/**
* Allocate and construct a new KX_SG_BoneParentRelation
* on the heap.
@@ -101,6 +100,12 @@ private :
KX_BoneParentRelation(Bone* bone
);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BoneParentRelation"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -53,7 +53,6 @@ class KX_NormalParentRelation : public SG_ParentRelation
{
public :
/**
* Allocate and construct a new KX_NormalParentRelation
* on the heap.
@@ -91,6 +90,12 @@ private :
KX_NormalParentRelation(
);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_NormalParentRelation"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -142,6 +147,12 @@ private :
KX_VertexParentRelation(
);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_VertexParentRelation"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -219,6 +230,12 @@ private :
bool m_initialized;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_SlowParentRelation"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -55,6 +55,13 @@ public:
private:
MT_Scalar* m_target;
KX_IScalarInterpolator *m_ipo;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalarInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -50,6 +50,13 @@ public:
private:
MT_Vector3& m_target;
KX_IScalarInterpolator *m_ipos[3];
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalingInterpolator"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -125,6 +125,12 @@ protected:
/** Maximum number of measurements. */
unsigned int m_maxNumMeasurements;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeCategoryLogger"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // __KX_TIME_CATEGORY_LOGGER_H

View File

@@ -36,6 +36,10 @@
#include <deque>
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
/**
* Stores and manages time measurements.
*/
@@ -98,6 +102,13 @@ protected:
/** State of logging. */
bool m_logging;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeLogger"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // __KX_TIME_LOGGER_H

View File

@@ -76,6 +76,12 @@ public:
SCA_LogicManager* GetLogicManager() { return m_logicmgr;}
PHY_IPhysicsEnvironment *GetPhysicsEnvironment() { return m_physEnv; }
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TouchEventManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_TOUCHEVENTMANAGER

View File

@@ -31,6 +31,10 @@
#include "MT_Scalar.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class MT_CmMatrix4x4;
class KX_WorldInfo
@@ -59,6 +63,13 @@ public:
virtual void setMistColorRed(float)=0;
virtual void setMistColorGreen(float)=0;
virtual void setMistColorBlue(float)=0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__KX_WORLDINFO_H

View File

@@ -90,6 +90,13 @@ public:
};
void AddInterpolator(KX_IInterpolator* interp);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldIpoController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif // KX_LIGHTIPOSGCONTROLLER_H

View File

@@ -76,6 +76,13 @@ public:
*/
virtual STR_String GetNetworkVersion(void)=0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkDeviceInterface"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //NG_NETWORKDEVICEINTERFACE_H

View File

@@ -32,6 +32,10 @@
#include "STR_HashedString.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class NG_NetworkMessage
{
static int s_nextID;
@@ -122,6 +126,13 @@ public:
int GetMessageID() {
return m_uniqueMessageID;
}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkMessage"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //NG_NETWORKMESSAGE_H

View File

@@ -32,6 +32,10 @@
#include "STR_String.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class NG_NetworkObject
{
STR_String m_name;
@@ -39,6 +43,13 @@ public:
NG_NetworkObject();
~NG_NetworkObject();
const STR_String& GetName();
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkObject"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //NG_NETWORKOBJECT_H

View File

@@ -34,6 +34,10 @@
#include "STR_HashedString.h"
#include <vector>
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
//MSVC defines SendMessage as a win api function, even though we aren't using it
#ifdef SendMessage
#undef SendMessage
@@ -52,7 +56,7 @@ class NG_NetworkScene
TMessageMap m_messagesBySenderName;
TMessageMap m_messagesBySubject;
public:
public:
NG_NetworkScene(NG_NetworkDeviceInterface *nic);
~NG_NetworkScene();
@@ -100,6 +104,13 @@ protected:
* @param map Message map with messages.
*/
void ClearMessageMap(TMessageMap& map);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkScene"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__NG_NETWORKSCENE_H

View File

@@ -75,6 +75,12 @@ private:
btBroadphaseProxy* m_handle;
void* m_newClientInfo;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdGraphicController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //BULLET2_PHYSICSCONTROLLER_H

View File

@@ -58,8 +58,6 @@ class btCollisionShape;
class CcdShapeConstructionInfo
{
public:
static CcdShapeConstructionInfo* FindMesh(class RAS_MeshObject* mesh, struct DerivedMesh* dm, bool polytope, bool gimpact);
CcdShapeConstructionInfo() :
@@ -191,6 +189,13 @@ protected:
bool m_forceReInstance; //use gimpact for concave dynamic/moving collision detection
float m_weldingThreshold1; //welding closeby vertices together can improve softbody stability etc.
CcdShapeConstructionInfo* m_shapeProxy; // only used for PHY_SHAPE_PROXY, pointer to actual shape info
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdShapeConstructionInfo"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
struct CcdConstructionInfo
@@ -559,7 +564,11 @@ protected:
}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
@@ -587,7 +596,13 @@ class DefaultMotionState : public PHY_IMotionState
btTransform m_worldTransform;
btVector3 m_localScaling;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DefaultMotionState"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};

View File

@@ -275,7 +275,11 @@ protected:
bool m_scalingPropagated;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsEnvironment"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //CCDPHYSICSENVIRONMENT

View File

@@ -93,6 +93,12 @@ public:
return 0.f;
}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DummyPhysicsEnvironment"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //_DUMMYPHYSICSENVIRONMENT

View File

@@ -31,7 +31,9 @@
#include "PHY_DynamicTypes.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
/**
PHY_IController is the abstract simplified Interface to objects
@@ -41,12 +43,17 @@
class PHY_IController
{
public:
virtual ~PHY_IController();
// clientinfo for raycasts for example
virtual void* getNewClientInfo()=0;
virtual void setNewClientInfo(void* clientinfo)=0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //PHY_ICONTROLLER_H

View File

@@ -39,9 +39,7 @@
*/
class PHY_IGraphicController : public PHY_IController
{
public:
virtual ~PHY_IGraphicController();
/**
SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
@@ -53,6 +51,11 @@ class PHY_IGraphicController : public PHY_IController
virtual PHY_IGraphicController* GetReplica(class PHY_IMotionState* motionstate) {return 0;}
#ifdef WITH_CXX_GUARDEDALLOC
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //PHY_IGRAPHICCONTROLLER_H

View File

@@ -29,6 +29,10 @@
#ifndef PHY__MOTIONSTATE_H
#define PHY__MOTIONSTATE_H
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
/**
PHY_IMotionState is the Interface to explicitly synchronize the world transformation.
Default implementations for mayor graphics libraries like OpenGL and DirectX can be provided.
@@ -36,8 +40,7 @@
class PHY_IMotionState
{
public:
public:
virtual ~PHY_IMotionState();
virtual void getWorldPosition(float& posX,float& posY,float& posZ)=0;
@@ -52,6 +55,13 @@ class PHY_IMotionState
virtual void calculateWorldTransformations()=0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IMotionState"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //PHY__MOTIONSTATE_H

View File

@@ -41,7 +41,6 @@ class PHY_IPhysicsController : public PHY_IController
{
public:
virtual ~PHY_IPhysicsController();
/**
SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
@@ -99,6 +98,11 @@ class PHY_IPhysicsController : public PHY_IController
PHY__Vector3 GetWorldPosition(PHY__Vector3& localpos);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsController"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //PHY_IPHYSICSCONTROLLER_H

View File

@@ -32,6 +32,11 @@
#include <vector>
#include "PHY_DynamicTypes.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class PHY_IVehicle;
class RAS_MeshObject;
class PHY_IPhysicsController;
@@ -76,6 +81,12 @@ public:
m_faceNormal(faceNormal)
{
}
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IRayCastFilterCallback"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
/**
@@ -160,6 +171,13 @@ class PHY_IPhysicsEnvironment
virtual void setConstraintParam(int constraintId,int param,float value,float value1) = 0;
virtual float getConstraintParam(int constraintId,int param) = 0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsEnvironment"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //_IPHYSICSENVIRONMENT

View File

@@ -6,10 +6,13 @@
class PHY_IMotionState;
#include "PHY_DynamicTypes.h"
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class PHY_IVehicle
{
public:
virtual ~PHY_IVehicle();
virtual void AddWheel(
@@ -52,6 +55,12 @@ public:
virtual void SetCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) =0;
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IVehicle"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //PHY_IVEHICLE_H

View File

@@ -30,6 +30,10 @@
#define MAX_RENDER_PASS 100
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
#endif
class RAS_2DFilterManager
{
private:
@@ -97,5 +101,12 @@ public:
void RenderFilters(RAS_ICanvas* canvas);
void EnableFilter(vector<STR_String>& propNames, void* gameObj, RAS_2DFILTER_MODE mode, int pass, STR_String& text);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_2DFilterManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif

View File

@@ -67,6 +67,12 @@ private:
RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools);
void RenderAlphaBuckets(const MT_Transform& cameratrans,
RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools);
#ifdef WITH_CXX_GUARDEDALLOC
public:
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_BucketManager"); }
void operator delete( void *mem ) { MEM_freeN(mem); }
#endif
};
#endif //__RAS_BUCKETMANAGER

Some files were not shown because too many files have changed in this diff Show More