This commit is contained in:
Daveo 2001-05-17 16:39:58 +00:00
parent 64c42e88d3
commit 1316434cc7
3 changed files with 19 additions and 28 deletions

View file

@ -111,7 +111,7 @@ ACTOR_SPONGEBOB := SpongeBob SpongeBob_CoralBlower SpongeBob_JellyLauncher Spon
ACTOR_NPC := BarnacleBoy Krusty Squidward Gary Sandy Patrick MermaidMan ACTOR_NPC := BarnacleBoy Krusty Squidward Gary Sandy Patrick MermaidMan
ACTOR_ENEMY := Anenome BabyOctopus Ballblob Caterpillar clam Dustdevil \ ACTOR_ENEMY := Anenome BabyOctopus Ballblob Caterpillar clam Dustdevil \
Flamingskull FlyingDutchman Ghost HermitCrab IronDogFish Lrgjellyfish \ Flamingskull FlyingDutchman Ghost HermitCrab IronDogFish \
PuffaFish Sharkman Skeletalfish SpiderCrab SpikeyAnenome Stomper \ PuffaFish Sharkman Skeletalfish SpiderCrab SpikeyAnenome Stomper \
SharkSub Motherjellyfish SeaSnake SharkSub Motherjellyfish SeaSnake

View file

@ -128,18 +128,11 @@ static const char * s_sceneNames[] =
"System", "System",
"UNKNOWN", "UNKNOWN",
}; };
#endif /* __DEBUG_MEM__ */
static const int s_nbSceneNames = sizeof(s_sceneNames) / sizeof(char *); static const int s_nbSceneNames = sizeof(s_sceneNames) / sizeof(char *);
static FontBank s_debugFont; static FontBank s_debugFont;
#ifdef __DEBUG_MEM__
void dumpDebugMem() void dumpDebugMem()
{ {
if (s_dumpMem) if (s_dumpMem)
@ -371,6 +364,13 @@ void freeDebugMem( void * addr )
ASSERT( !"Can't find debug mem node ( memory already freed? )" ); ASSERT( !"Can't find debug mem node ( memory already freed? )" );
} }
// hmm.. have to alloc this memory before the first scene, but have to wait until all the
// systems are active so can't do it in the standard MemInit() thing
void DebugMemFontInit()
{
s_debugFont.initialise( &standardFont );
s_debugFont.setOt( 0 );
}
#endif #endif
@ -402,21 +402,10 @@ void MemInit()
} }
// hmm.. have to alloc this memory before the first scene, but have to wait until all the
// systems are active so can't do it in the standard MemInit() thing
void DebugMemFontInit()
{
#ifdef __DEBUG_MEM__
s_debugFont.initialise( &standardFont );
s_debugFont.setOt( 0 );
#endif
}
/*****************************************************************************/ /*****************************************************************************/
// 030700 Dave - Implemented smart allocation // 030700 Dave - Implemented smart allocation
// It now looks thru the whole node list, and takes from the smallest VALID node // It now looks thru the whole node list, and takes from the smallest VALID node
// I now understand how this memory stuff works, it aint all bad! // I now understand how this memory stuff works, it aint all bad!
char * MemAllocate( u32 TLen, char const *Name, char const * File, int LineNumber ) char * MemAllocate( u32 TLen, char const *Name, char const * File, int LineNumber )
{ {
sLList *mem = &MainRam; sLList *mem = &MainRam;

View file

@ -12,14 +12,13 @@
/*****************************************************************************/ /*****************************************************************************/
// Define if you want to debug memory
#ifdef __VERSION_DEBUG__ #ifdef __USER_paul__
#define __DEBUG_MEM__ // Define if you want to debug memory - TS #ifdef __VERSION_DEBUG__
#define __DEBUG_MEM__
#endif
#endif #endif
/*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
#define LListLen 50 #define LListLen 50
@ -51,7 +50,6 @@ typedef struct
char * MemAllocate( u32 Size, char const *Name, char const * File, int LineNumber); char * MemAllocate( u32 Size, char const *Name, char const * File, int LineNumber);
void MemInit(); void MemInit();
void DebugMemFontInit();
void MemFree(void *Addr); void MemFree(void *Addr);
void * operator new(size_t Size, const char * name = NULL); void * operator new(size_t Size, const char * name = NULL);
@ -60,11 +58,15 @@ void operator delete(void *Ptr);
void operator delete[](void *Ptr); void operator delete[](void *Ptr);
#ifdef __VERSION_DEBUG__ #ifdef __DEBUG_MEM__
void dumpDebugMem(); void dumpDebugMem();
void DebugMemFontInit();
#define MemAlloc( Size, Name ) MemAllocate( (Size), (Name), __FILE__, __LINE__ ) #define MemAlloc( Size, Name ) MemAllocate( (Size), (Name), __FILE__, __LINE__ )
#else #else
#define MemAlloc(Size,Name) MemAllocate( (Size), NULL, NULL, 0 ) #define MemAlloc(Size,Name) MemAllocate( (Size), NULL, NULL, 0 )
#define dumpDebugMem ;
#define DebugMemFontInit ;
#endif #endif