Replaced all occurences of DBMB, DBPRINTF and DBERROR with their former define.

( DBPRINTF(("Message")); becomes debug( LOG_NEVER, "Message" ); )



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@608 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2006-08-22 14:28:49 +00:00
parent 3e6428377c
commit 62ae49b0ce
102 changed files with 1713 additions and 1270 deletions

View File

@ -62,7 +62,7 @@ void blkShutDown(void)
if (psBlockList)
{
DBPRINTF(("blkShutDown: blocks still allocated:\n"));
debug( LOG_NEVER, "blkShutDown: blocks still allocated:\n" );
while (psBlockList)
{
psNext = psBlockList->psNext;
@ -83,24 +83,27 @@ void blkCallPos(STRING *pFileName, SDWORD line)
BOOL blkCreate(BLOCK_HEAP **ppsHeap, SDWORD init, SDWORD ext)
{
DBPRINTF(("BLKCREATE CALLED !!!!!!!!!!!!!!!!!!!!!!\n"));
debug( LOG_NEVER, "BLKCREATE CALLED !!!!!!!!!!!!!!!!!!!!!!\n" );
*ppsHeap = (BLOCK_HEAP*)RMALLOC(sizeof(BLOCK_HEAP));
if (!*ppsHeap)
{
DBERROR(("blkCreate: Out of memory"));
debug( LOG_ERROR, "blkCreate: Out of memory" );
abort();
return FALSE;
}
(*ppsHeap)->psBlocks = (BLOCK_HEAP_MEM*)RMALLOC(sizeof(BLOCK_HEAP_MEM));
if (!(*ppsHeap)->psBlocks)
{
DBERROR(("blkCreate: Out of memory"));
debug( LOG_ERROR, "blkCreate: Out of memory" );
abort();
return FALSE;
}
(*ppsHeap)->psBlocks->pMem = (UBYTE*)RMALLOC(init);
if (!(*ppsHeap)->psBlocks->pMem)
{
DBERROR(("blkCreate: Out of memory"));
debug( LOG_ERROR, "blkCreate: Out of memory" );
abort();
return FALSE;
}
@ -131,8 +134,7 @@ void blkDestroy(BLOCK_HEAP *psHeap)
#ifdef DEBUG_BLOCK
if (psHeap->psMemTreap != NULL)
{
DBPRINTF(("blkDestroy: %s at %d: memory allocated :\n",
psHeap->pFileName, psHeap->line));
debug( LOG_NEVER, "blkDestroy: %s at %d: memory allocated :\n", psHeap->pFileName, psHeap->line );
memRecReport(psHeap->psMemTreap);
}
#endif
@ -157,17 +159,17 @@ void blkPrintDetails(BLOCK_HEAP *psHeap)
{
#ifdef DEBUG_BLOCK
UDWORD Left=(UDWORD)((psHeap->psBlocks->pMem)+(psHeap->psBlocks->size)-(psHeap->psBlocks->pFree));
DBPRINTF(("ptr=%p init=%d ext=%d used=%d (Start=$%p Free=$%p Left=%d)\n",psHeap,psHeap->init,psHeap->ext,psHeap->TotalAllocated,psHeap->psBlocks->pMem,psHeap->psBlocks->pFree,Left));
UDWORD Left = (UDWORD)((psHeap->psBlocks->pMem)+(psHeap->psBlocks->size)-(psHeap->psBlocks->pFree));
debug( LOG_NEVER, "ptr=%p init=%d ext=%d used=%d (Start=$%p Free=$%p Left=%d)\n", psHeap,psHeap->init, psHeap->ext,psHeap->TotalAllocated, psHeap->psBlocks->pMem, psHeap->psBlocks->pFree, Left );
memMemoryDump(psHeap->psMemTreap);
#else
DBPRINTF(("ptr=%p init=%d ext=%d\n",psHeap,psHeap->init,psHeap->ext));
debug( LOG_NEVER, "ptr=%p init=%d ext=%d\n", psHeap, psHeap->init, psHeap->ext );
#endif
}
else
{
DBPRINTF(("NULL POINTER IN BLOCK LIST\n"));
debug( LOG_NEVER, "NULL POINTER IN BLOCK LIST\n" );
}
}
@ -182,18 +184,18 @@ void blkReport(void)
UDWORD BlockNumber=0;
BLOCK_HEAP *psCurHeap;
DBPRINTF(("\n\nBlock Report. Current Block=%p:\n",memGetBlockHeap() ));
debug( LOG_NEVER, "\n\nBlock Report. Current Block=%p:\n", memGetBlockHeap() );
psCurHeap=psBlockList;
while (psCurHeap)
{
DBPRINTF(("Block %d) ",BlockNumber++));
debug( LOG_NEVER, "Block %d)",BlockNumber++ );
blkPrintDetails(psCurHeap);
psCurHeap = psCurHeap->psNext;
}
DBPRINTF(("\n\n"));
debug( LOG_NEVER, "\n\n" );
#endif
}
@ -223,7 +225,7 @@ BOOL blkSpecialFree(BLOCK_HEAP *psHeap, void *Ptr)
#ifdef DEBUG_BLOCK
UDWORD BlockSize=((UDWORD)psCurr->pFree)-RequestedFreeMem;
DBPRINTF(("FREED %d block bytes\n",BlockSize)); // /// del me now !
debug( LOG_NEVER, "FREED %d block bytes\n", BlockSize ); // del me now !
psHeap->TotalAllocated-=BlockSize;
#endif
@ -267,9 +269,7 @@ void *blkAlloc(BLOCK_HEAP *psHeap, SDWORD size)
// see if free has been called for this block
if (psHeap->free)
{
DBPRINTF(("Block Heap: %s at %d: Alloc after free:\n free %s at %d\n alloc %s at %d\n",
psHeap->pFileName, psHeap->line, psHeap->pFreeFile, psHeap->freeLine,
pCallFileName, callLine));
debug( LOG_NEVER, "Block Heap: %s at %d: Alloc after free:\n free %s at %d\n alloc %s at %d\n", psHeap->pFileName, psHeap->line, psHeap->pFreeFile, psHeap->freeLine, pCallFileName, callLine );
psHeap->free = FALSE;
}
@ -462,11 +462,11 @@ void blkFree(BLOCK_HEAP *psHeap, void *pMemToFree)
#ifdef DEBUG
if (bRes==TRUE)
{
DBPRINTF(("blkFree called - memory successfully released\n"));
debug( LOG_NEVER, "blkFree called - memory successfully released\n" );
}
else
{
// DBPRINTF(("blkFree called - memory NOT released\n"));
// debug( LOG_NEVER, "blkFree called - memory NOT released\n" );
}
#endif
#endif
@ -490,8 +490,7 @@ void blkReset(BLOCK_HEAP *psHeap)
#ifdef DEBUG_BLOCK
if (psHeap->psMemTreap != NULL)
{
DBPRINTF(("blkReset: %s at %d: memory allocated :\n",
psHeap->pFileName, psHeap->line));
debug( LOG_NEVER, "blkReset: %s at %d: memory allocated :\n", psHeap->pFileName, psHeap->line );
memRecReport(psHeap->psMemTreap);
}
psHeap->psMemTreap = NULL;
@ -499,10 +498,9 @@ void blkReset(BLOCK_HEAP *psHeap)
psHeap->TotalAllocated=0;
DBP0(("blkReset: %s at %d: memory usage:\n",
psHeap->pFileName, psHeap->line));
debug( LOG_NEVER, "blkReset: %s at %d: memory usage:\n", psHeap->pFileName, psHeap->line );
#else
DBP0(("blkReset: memory usage:\n"));
debug( LOG_NEVER, "blkReset: memory usage:\n" );
#endif
psCurr = psHeap->psBlocks;
@ -519,8 +517,7 @@ void blkReset(BLOCK_HEAP *psHeap)
psCurr = psCurr->psNext;
}
DBP0((" Blocks allocated %dk, Memory allocated %dk\n",
block/1024, alloc/1024));
debug( LOG_NEVER, " Blocks allocated %dk, Memory allocated %dk\n", block/1024, alloc/1024 );
}
@ -640,13 +637,13 @@ void blockCurrentBlockInfo(void)
psCurHeap=memGetBlockHeap();
if (psCurHeap==NULL)
{
DBPRINTF(("*** No current block defined\n"));
debug( LOG_NEVER, "*** No current block defined\n" );
}
else
{
UDWORD Left=(UDWORD)((psCurHeap->psBlocks->pMem)+(psCurHeap->psBlocks->size)-(psCurHeap->psBlocks->pFree));
DBPRINTF(("ptr=%p init=%d ext=%d used=%d (Start=$%p Free=$%p Left=%d)\n",psCurHeap,psCurHeap->init,psCurHeap->ext,psCurHeap->TotalAllocated,psCurHeap->psBlocks->pMem,psCurHeap->psBlocks->pFree,Left));
debug( LOG_NEVER, "ptr=%p init=%d ext=%d used=%d (Start=$%p Free=$%p Left=%d)\n", psCurHeap, psCurHeap->init, psCurHeap->ext, psCurHeap->TotalAllocated, psCurHeap->psBlocks->pMem, psCurHeap->psBlocks->pFree, Left );
}
#endif
}

View File

@ -299,6 +299,3 @@ void debug( code_part part, const char *str, ... )
}
useInputBuffer1 = !useInputBuffer1; // Swap buffers
}

View File

@ -29,6 +29,7 @@
#endif
/* DBMB used to be 'show message box' */
/*
#ifndef _MSC_VER
#define DBMB(x) _db_debug x
#define DBPRINTF(x) _db_debug x
@ -37,6 +38,7 @@
#define DBMB(x)
#define DBPRINTF(x)
#endif
*/
/*
*
@ -79,7 +81,7 @@ do { \
*
* Arguments as for printf
*/
/*
#ifndef _MSC_VER
#define DBERROR(x) _debug_error x
#define _debug_error(...) \
@ -90,6 +92,7 @@ do { \
#else
#define DBERROR(x)
#endif
*/
/****************************************************************************************

View File

@ -162,7 +162,8 @@ static BOOL resAlloc(STRING *pType, RES_TYPE **ppsFunc)
psT = (RES_TYPE *)MALLOC(sizeof(RES_TYPE));
if (!psT)
{
DBERROR(("resAlloc: Out of memory"));
debug( LOG_ERROR, "resAlloc: Out of memory" );
abort();
return FALSE;
}

View File

@ -136,7 +136,8 @@ BOOL heapCreate(OBJ_HEAP **ppsHeap, UDWORD size, UDWORD init, UDWORD ext)
*ppsHeap = (OBJ_HEAP *)MALLOC(sizeof(OBJ_HEAP));
if (*ppsHeap == NULL)
{
DBERROR(("heapCreate: Out of memory"));
debug( LOG_ERROR, "heapCreate: Out of memory" );
abort();
return FALSE;
}
// memset(*ppsHeap,0,sizeof(OBJ_HEAP)); //setting everything to 0 first (debug test)-Q
@ -155,7 +156,8 @@ BOOL heapCreate(OBJ_HEAP **ppsHeap, UDWORD size, UDWORD init, UDWORD ext)
if ((*ppsHeap)->pMemory == NULL)
{
DBERROR(("heapCreate: Out of memory"));
debug( LOG_ERROR, "heapCreate: Out of memory" );
abort();
return FALSE;
}
@ -183,7 +185,8 @@ BOOL heapCreate(OBJ_HEAP **ppsHeap, UDWORD size, UDWORD init, UDWORD ext)
}
if (HeapDebugList[Heap]!=*ppsHeap)
{
DBERROR(("heapCreate: MAXDEBUGHEAPS too small"));
debug( LOG_ERROR, "heapCreate: MAXDEBUGHEAPS too small" );
abort();
}
#endif
@ -440,8 +443,7 @@ void heapDestroy(OBJ_HEAP *psHeap)
/* Warn about any unfreed objects */
if (psHeap->currUsage > 0)
{
DBPRINTF(("heapDestroy: %s, line %d : %d objects in use\n",
psHeap->pFile, psHeap->line, psHeap->currUsage));
debug( LOG_NEVER, "heapDestroy: %s, line %d : %d objects in use\n", psHeap->pFile, psHeap->line, psHeap->currUsage );
}
/* Print out where the unfreed objects were allocated */
@ -473,9 +475,7 @@ void heapDestroy(OBJ_HEAP *psHeap)
ASSERT((clean, "heapDestroy: unallocated memory has been overwritten"));
#if HEAP_USAGE_REPORT
DBPRINTF(("heapDestory: %s, line %d : Max usage %d (Init %d Ext %d)\n",
psHeap->pFile, psHeap->line, psHeap->maxUsage,
psHeap->initAlloc, psHeap->extAlloc));
debug( LOG_NEVER, "heapDestory: %s, line %d : Max usage %d (Init %d Ext %d)\n", psHeap->pFile, psHeap->line, psHeap->maxUsage, psHeap->initAlloc, psHeap->extAlloc );
#endif
#if COPY_FILE_STRING
@ -551,21 +551,17 @@ void heapReport(void)
OBJ_HEAP *psHeap;
DBPRINTF(("\nheapReport\n==========\n"));
debug( LOG_NEVER, "\nheapReport\n==========\n" );
for (Heap=0;Heap<MAXDEBUGHEAPS;Heap++)
{
if (HeapDebugList[Heap] != NULL)
{
psHeap=HeapDebugList[Heap];
DBPRINTF(("Heap: %s, line %d size=%d mem taken=%d\n",
psHeap->pFile, psHeap->line, psHeap->objSize, psHeap->objSize*psHeap->initAlloc));
debug( LOG_NEVER, "Heap: %s, line %d size=%d mem taken=%d\n", psHeap->pFile, psHeap->line, psHeap->objSize, psHeap->objSize*psHeap->initAlloc );
DBPRINTF((" Current Usage=%d ",psHeap->currUsage));
DBPRINTF((" Max usage %d (Init %d Ext %d)\n",
psHeap->maxUsage,
psHeap->initAlloc, psHeap->extAlloc));
debug( LOG_NEVER, " Current Usage=%d ", psHeap->currUsage );
debug( LOG_NEVER, " Max usage %d (Init %d Ext %d)\n", psHeap->maxUsage, psHeap->initAlloc, psHeap->extAlloc );
}
}

View File

@ -166,7 +166,7 @@ void *memMalloc(STRING *pFileName, SDWORD LineNumber, size_t Size)
ASSERT((FALSE, "Warning: malloc returning NULL - [%s - %d]",pFileName,LineNumber));
DBPRINTF(("[%s - %d] %d bytes\n",pFileName,LineNumber,Size));
debug( LOG_NEVER, "[%s - %d] %d bytes\n", pFileName, LineNumber, Size );
return NULL;
}
@ -176,7 +176,7 @@ void *memMalloc(STRING *pFileName, SDWORD LineNumber, size_t Size)
if (!psNode->pFile)
{
RFREE(pMemBase);
DBMB(("Warning: malloc returning NULL"));
debug( LOG_NEVER, "Warning: malloc returning NULL" );
return NULL;
}
strcpy(psNode->pFile, pFileName);

View File

@ -124,7 +124,8 @@ int res_wrap(void)
{
if (inComment)
{
DBERROR(("Warning: reached end of file in a comment"));
debug( LOG_ERROR, "Warning: reached end of file in a comment" );
abort();
}
return 1;
}

View File

@ -31,8 +31,8 @@ void res_error(const char *pMessage,...)
char *pText;
resGetErrorData(&line, &pText);
DBERROR(("RES file parse error:\n%s at line %d\nText: '%s'\n",
pMessage, line, pText));
debug( LOG_ERROR, "RES file parse error:\n%s at line %d\nText: '%s'\n", pMessage, line, pText );
abort();
}
%}
@ -65,7 +65,7 @@ dir_line: DIRECTORY QTEXT_T {
UDWORD len;
// set a new input directory
DBP0(("directory: %s\n", $2));
debug( LOG_NEVER, "directory: %s\n", $2 );
if ($2[1] == ':' ||
$2[0] == '\\')
{

View File

@ -32,14 +32,16 @@ static BOOL strresAllocBlock(STR_BLOCK **ppsBlock, UDWORD size)
*ppsBlock = (STR_BLOCK*)MALLOC(sizeof(STR_BLOCK));
if (!*ppsBlock)
{
DBERROR(("strresAllocBlock: Out of memory - 1"));
debug( LOG_ERROR, "strresAllocBlock: Out of memory - 1" );
abort();
return FALSE;
}
(*ppsBlock)->apStrings = (STRING**)MALLOC(sizeof(STRING *) * size);
if (!(*ppsBlock)->apStrings)
{
DBERROR(("strresAllocBlock: Out of memory - 2"));
debug( LOG_ERROR, "strresAllocBlock: Out of memory - 2" );
abort();
FREE(*ppsBlock);
return FALSE;
}
@ -62,7 +64,8 @@ BOOL strresCreate(STR_RES **ppsRes, UDWORD init, UDWORD ext)
psRes = (STR_RES*)MALLOC(sizeof(STR_RES));
if (!psRes)
{
DBERROR(("strresCreate: Out of memory"));
debug( LOG_ERROR, "strresCreate: Out of memory" );
abort();
return FALSE;
}
psRes->init = init;
@ -71,7 +74,8 @@ BOOL strresCreate(STR_RES **ppsRes, UDWORD init, UDWORD ext)
if (!TREAP_CREATE(&psRes->psIDTreap, treapStringCmp, init, ext))
{
DBERROR(("strresCreate: Out of memory"));
debug( LOG_ERROR, "strresCreate: Out of memory" );
abort();
FREE(psRes);
return FALSE;
}
@ -148,7 +152,7 @@ void strresDestroy(STR_RES *psRes)
#ifdef DEBUG
else if (i < psRes->nextID)
{
DBPRINTF(("strresDestroy: No string loaded for id %d\n", i));
debug( LOG_NEVER, "strresDestroy: No string loaded for id %d\n", i );
}
#endif
}
@ -182,7 +186,8 @@ BOOL strresLoadFixedID(STR_RES *psRes, STR_ID *psID, UDWORD numID)
// Store the ID string
if (!TREAP_ADD(psRes->psIDTreap, (UDWORD)psID->pIDStr, psID))
{
DBERROR(("strresLoadFixedID: Out of memory"));
debug( LOG_ERROR, "strresLoadFixedID: Out of memory" );
abort();
return FALSE;
}
@ -261,13 +266,15 @@ BOOL strresStoreString(STR_RES *psRes, STRING *pID, STRING *pString)
psID = (STR_ID*)MALLOC(sizeof(STR_ID));
if (!psID)
{
DBERROR(("strresStoreString: Out of memory"));
debug( LOG_ERROR, "strresStoreString: Out of memory" );
abort();
return FALSE;
}
psID->pIDStr = (STRING*)MALLOC(sizeof(STRING) * (stringLen(pID) + 1));
if (!psID->pIDStr)
{
DBERROR(("strresStoreString: Out of memory"));
debug( LOG_ERROR, "strresStoreString: Out of memory" );
abort();
FREE(psID);
return FALSE;
}
@ -298,7 +305,8 @@ BOOL strresStoreString(STR_RES *psRes, STRING *pID, STRING *pString)
// Put the new string in the string block
if (psBlock->apStrings[psID->id - psBlock->idStart] != NULL)
{
DBERROR(("strresStoreString: Duplicate string for id: %s", psID->pIDStr));
debug( LOG_ERROR, "strresStoreString: Duplicate string for id: %s", psID->pIDStr );
abort();
return FALSE;
}
@ -306,7 +314,8 @@ BOOL strresStoreString(STR_RES *psRes, STRING *pID, STRING *pString)
pNew = (STRING*)MALLOC(sizeof(STRING) * (stringLen(pString) + 1));
if (!pNew)
{
DBERROR(("strresStoreString: Out of memory"));
debug( LOG_ERROR, "strresStoreString: Out of memory" );
abort();
return FALSE;
}
stringCpy(pNew, pString);

View File

@ -116,7 +116,8 @@ int strres_wrap(void)
{
if (inComment)
{
DBERROR(("Warning: reched end of file in a comment"));
debug( LOG_ERROR, "Warning: reched end of file in a comment" );
abort();
}
return 1;

View File

@ -28,8 +28,8 @@ void strres_error(const char *pMessage,...)
char *pText;
strresGetErrorData(&line, &pText);
DBERROR(("STRRES file parse error:\n%s at line %d\nText: '%s'\n",
pMessage, line, pText));
debug( LOG_ERROR, "STRRES file parse error:\n%s at line %d\nText: '%s'\n", pMessage, line, pText );
abort();
}
%}

View File

@ -77,13 +77,15 @@ BOOL treapCreate(TREAP **ppsTreap, TREAP_CMP cmp, UDWORD init, UDWORD ext)
*ppsTreap = (TREAP*)MALLOC(sizeof(TREAP));
if (!(*ppsTreap))
{
DBERROR(("treapCreate: Out of memory"));
debug( LOG_ERROR, "treapCreate: Out of memory" );
abort();
return FALSE;
}
if (!HEAP_CREATE(&((*ppsTreap)->psNodes), sizeof(TREAP_NODE), init, ext))
{
DBERROR(("treapCreate: Out of memory"));
debug( LOG_ERROR, "treapCreate: Out of memory" );
abort();
FREE(*ppsTreap);
return FALSE;
}
@ -330,7 +332,7 @@ static void treapReportRec(TREAP_NODE *psRoot)
{
if (psRoot)
{
DBPRINTF((" %s, line %d\n", psRoot->pFile, psRoot->line));
debug( LOG_NEVER, ((" %s, line %d\n", psRoot->pFile, psRoot->line );
treapReportRec(psRoot->psLeft);
treapReportRec(psRoot->psRight);
}
@ -369,8 +371,7 @@ void treapDestroy(TREAP *psTreap)
#if DEBUG_TREAP
if (psTreap->psRoot)
{
DBPRINTF(("treapDestroy: %s, line %d : nodes still in the tree\n",
psTreap->pFile, psTreap->line));
debug( LOG_NEVER, "treapDestroy: %s, line %d : nodes still in the tree\n", psTreap->pFile, psTreap->line );
treapReportRec(psTreap->psRoot);
}
FREE(psTreap->pFile);
@ -388,11 +389,9 @@ void treapDisplayRec(TREAP_NODE *psRoot, UDWORD indent)
// Display the root
#if DEBUG_TREAP
DBPRINTF(("%s, line %d : %d,%d\n",
psRoot->pFile, psRoot->line,
psRoot->key, psRoot->priority));
debug( LOG_NEVER, "%s, line %d : %d,%d\n", psRoot->pFile, psRoot->line, psRoot->key, psRoot->priority );
#else
DBPRINTF(("%d,%d\n", psRoot->key, psRoot->priority));
debug( LOG_NEVER, "%d,%d\n", psRoot->key, psRoot->priority );
#endif
// Display the left of the tree
@ -400,9 +399,9 @@ void treapDisplayRec(TREAP_NODE *psRoot, UDWORD indent)
{
for(i=0; i<indent; i++)
{
DBPRINTF((" "));
debug( LOG_NEVER, "" );
}
DBPRINTF(("L "));
debug( LOG_NEVER, "L" );
treapDisplayRec(psRoot->psLeft, indent+1);
}
@ -411,9 +410,9 @@ void treapDisplayRec(TREAP_NODE *psRoot, UDWORD indent)
{
for(i=0; i<indent; i++)
{
DBPRINTF((" "));
debug( LOG_NEVER, "" );
}
DBPRINTF(("R "));
debug( LOG_NEVER, "R" );
treapDisplayRec(psRoot->psRight, indent+1);
}
}

View File

@ -46,7 +46,8 @@ anim_Init( GETSHAPEFUNC pGetShapeFunc )
/* ensure ANIM2D and ANIM3D structs same size */
if ( iSizeAnim2D != iSizeAnim3D )
{
DBERROR( ("anim_Init: ANIM2D and ANIM3D structs not same size in anim.h!") );
debug( LOG_ERROR, "anim_Init: ANIM2D and ANIM3D structs not same size in anim.h!" );
abort();
}
/* init globals */
@ -91,7 +92,7 @@ anim_Shutdown( void )
if (g_animGlobals.psAnimList != NULL)
{
DBPRINTF(("anim_Shutdown: warning anims still allocated"));
debug( LOG_NEVER, "anim_Shutdown: warning: anims still allocated" );
}
/* empty anim list */
@ -161,8 +162,9 @@ anim_Create3D( char szPieFileName[], UWORD uwStates,
/* check frame count matches script */
if ( ubType == ANIM_3D_TRANS && uwObj != uwFrames )
{
DBERROR( ("anim_Create3D: frames in pie %s != script objects %i\n",
szPieFileName, uwObj ) );
debug( LOG_ERROR, "anim_Create3D: frames in pie %s != script objects %i\n",
szPieFileName, uwObj );
abort();
return FALSE;
}
@ -211,7 +213,8 @@ anim_EndScript( void )
if ( g_animGlobals.uwCurState != psAnim->uwStates )
{
DBERROR( ("anim_End3D: states in current anim not consistent with header\n") );
debug( LOG_ERROR, "anim_End3D: states in current anim not consistent with header\n" );
abort();
return FALSE;
}
@ -296,7 +299,8 @@ anim_SetVals( char szFileName[], UWORD uwAnimID )
if ( psAnim == NULL )
{
DBERROR( ("anim_SetVals: can't find anim %s\n", szFileName) );
debug( LOG_ERROR, "anim_SetVals: can't find anim %s\n", szFileName );
abort();
return ;
}
@ -312,7 +316,8 @@ BASEANIM *anim_LoadFromBuffer(char *pBuffer, UDWORD size)
{
if ( ParseResourceFile( pBuffer, size ) == FALSE )
{
DBERROR( ("anim_LoadFromBuffer: couldn't parse file\n") );
debug( LOG_ERROR, "anim_LoadFromBuffer: couldn't parse file\n" );
abort();
return NULL;
}
@ -330,7 +335,8 @@ anim_GetAnimID( char *szName )
if ( cPos == NULL )
{
DBERROR( ("anim_GetAnimID: %s isn't .ani file\n", szName));
debug( LOG_ERROR, "anim_GetAnimID: %s isn't .ani file\n", szName );
abort();
return NO_ANIM;
}

View File

@ -161,7 +161,8 @@ animObj_Update( void )
if ( hashTable_RemoveElement( g_pAnimObjTable, psObj,
(int) psObj->psParent, psObj->psAnim->uwID ) == FALSE )
{
DBERROR( ("animObj_Update: couldn't remove anim obj\n") );
debug( LOG_ERROR, "animObj_Update: couldn't remove anim obj\n" );
abort();
}
}
@ -195,7 +196,8 @@ animObj_Add( void *pParentObj, int iAnimID,
if (psObj==NULL)
{
DBERROR( ("animObj_Add: No room in hash table\n") );
debug( LOG_ERROR, "animObj_Add: No room in hash table\n" );
abort();
return(NULL);
}
@ -221,7 +223,8 @@ animObj_Add( void *pParentObj, int iAnimID,
if ( uwObj > ANIM_MAX_COMPONENTS )
{
DBERROR( ("animObj_Add: number of components too small\n") );
debug( LOG_ERROR, "animObj_Add: number of components too small\n" );
abort();
}
/* set parent pointer and shape pointer */

View File

@ -195,13 +195,12 @@ void audp_error(char *pMessage,...)
va_list args;
va_start(args, pMessage);
vsprintf(aTxtBuf, pMessage, args);
parseGetErrorData( &line, &pText );
DBERROR(("RES file parse error:\n%s at line %d\nToken: %d, Text: '%s'\n",
aTxtBuf, line, audp_char, pText));
va_end(args);
parseGetErrorData( &line, &pText );
debug( LOG_ERROR, "RES file parse error:\n%s at line %d\nToken: %d, Text: '%s'\n", aTxtBuf, line, audp_char, pText );
abort();
}
/***************************************************************************/

View File

@ -29,7 +29,8 @@ queue_Init( QUEUE ** ppQueue, int iMaxElements, int iElementSize,
if ( (*ppQueue) == NULL )
{
DBERROR( ("queue_Init: couldn't allocate memory for queue") );
debug( LOG_ERROR, "queue_Init: couldn't allocate memory for queue" );
abort();
return FALSE;
}
@ -42,7 +43,8 @@ queue_Init( QUEUE ** ppQueue, int iMaxElements, int iElementSize,
if ( (*ppQueue) == NULL )
{
DBERROR( ("queue_Init: couldn't allocate memory for queue node") );
debug( LOG_ERROR, "queue_Init: couldn't allocate memory for queue node" );
abort();
return FALSE;
}
@ -154,7 +156,7 @@ queue_Enqueue( QUEUE * pQueue, void * psElement, int iPriority )
/* check list not empty */
if ( pQueue->psFreeNodeList == NULL )
{
DBPRINTF( ("queue_GetFreeElement: all nodes allocated: flushing queue.\n") );
debug( LOG_NEVER, "queue_GetFreeElement: all nodes allocated: flushing queue.\n" );
queue_Clear( pQueue );
}

View File

@ -161,7 +161,7 @@ ptrList_FreeElement( PTRLIST *ptrList, void *psElement )
if ( HEAP_FREE( ptrList->psElementHeap, psElement ) == FALSE )
{
DBPRINTF( ("ptrList_FreeElement: couldn't free element\n") );
debug( LOG_NEVER, "ptrList_FreeElement: couldn't free element\n" );
}
}

View File

@ -41,7 +41,7 @@ void iV_DisplayLogFile(void)
if (fp) {
while ((c = getc(fp)) != EOF)
DBPRINTF(("%c",c));
debug( LOG_NEVER, "%c", c );
fclose(fp);
}
}

View File

@ -77,7 +77,7 @@ void OutputTriangleList(FILE *fp, PSBSPPTRLIST TriList)
if (Triangle->flags & iV_IMD_TEXANIM) {
if (Triangle->pTexAnim == NULL) {
DBPRINTF(("No TexAnim pointer!\n"));
debug( LOG_NEVER, "No TexAnim pointer!\n" );
} else {
fprintf(fp," %d %d %d %d",
Triangle->pTexAnim->nFrames,

View File

@ -153,11 +153,11 @@ static UDWORD IMDConnectors = 0;
void DumpIMDInfo(void)
{
DBPRINTF(("imds loaded =%d - using %d bytes\n",IMDcount,IMDcount*sizeof(iIMDShape)));
DBPRINTF(("polys loaded =%d - using %d bytes\n",IMDPolycount,IMDPolycount*sizeof(iIMDPoly)));
DBPRINTF(("vertices loaded=%d - using %d bytes\n",IMDVertexcount,IMDVertexcount*(sizeof(VERTEXID)+sizeof(iVertex))));
DBPRINTF(("points loaded =%d - using %d bytes\n",IMDPoints,IMDPoints*sizeof(iVector)));
DBPRINTF(("connectors =%d - using %d bytes\n",IMDConnectors,IMDConnectors*sizeof(iVector) ));
debug( LOG_NEVER, "imds loaded =%d - using %d bytes\n", IMDcount, IMDcount*sizeof(iIMDShape) );
debug( LOG_NEVER, "polys loaded =%d - using %d bytes\n", IMDPolycount, IMDPolycount*sizeof(iIMDPoly) );
debug( LOG_NEVER, "vertices loaded=%d - using %d bytes\n", IMDVertexcount, IMDVertexcount*(sizeof(VERTEXID)+sizeof(iVertex)) );
debug( LOG_NEVER, "points loaded =%d - using %d bytes\n", IMDPoints, IMDPoints*sizeof(iVector) );
debug( LOG_NEVER, "connectors =%d - using %d bytes\n", IMDConnectors, IMDConnectors*sizeof(iVector) );
}
static STRING texfile[64]; //Last loaded texture page filename
@ -415,7 +415,7 @@ static iBool _imd_load_polys(STRING **ppFileData, STRING *FileDataEnd, iIMDShape
int NewID;
if (sscanf(pFileData, "%d%n", &NewID,&cnt) != 1) {
DBPRINTF(("failed poly %d. point %d [%s]\n",i,j,_IMD_NAME));
debug( LOG_NEVER, "failed poly %d. point %d [%s]\n", i, j, _IMD_NAME );
iV_Error(0xff,"(_load_polys) [poly %d] error reading poly indices",i);
return FALSE;
}

View File

@ -56,7 +56,8 @@ int pal_AddNewPalette(iColour *pal)
psGamePal = (iColour*) MALLOC(PALETTE_SIZE * sizeof(iColour));
if (psGamePal == NULL)
{
DBERROR(("pal_AddNewPalette - Out of memory"));
debug( LOG_ERROR, "pal_AddNewPalette - Out of memory" );
abort();
return FALSE;
}
}
@ -65,7 +66,8 @@ int pal_AddNewPalette(iColour *pal)
psWinPal = (PALETTEENTRY*) MALLOC(PALETTE_SIZE * sizeof(PALETTEENTRY));
if (psGamePal == NULL)
{
DBERROR(("pal_AddNewPalette - Out of memory"));
debug( LOG_ERROR, "pal_AddNewPalette - Out of memory" );
abort();
return FALSE;
}
}

View File

@ -231,7 +231,7 @@ void pie_TexShutDown(void) {
i++;
}
DBPRINTF(("pie_TexShutDown successful - freed %d texture pages\n",j));
debug( LOG_NEVER, "pie_TexShutDown successful - freed %d texture pages\n", j );
}
void pie_TexInit(void) {

View File

@ -195,7 +195,8 @@ NETMSG *NETmanglePacket(NETMSG *msg)
if(msg->size > MaxMsgSize-NIBBLELENGTH)
{
DBERROR(("NETmanglePacket: can't encrypt huge packets. returning unencrypted packet"));
debug( LOG_ERROR, "NETmanglePacket: can't encrypt huge packets. returning unencrypted packet" );
abort();
return msg;
}
@ -234,7 +235,8 @@ VOID NETunmanglePacket(NETMSG *msg)
if(msg->size%NIBBLELENGTH !=0)
{
DBERROR(("NETunmanglePacket: Incoming msg wrong length"));
debug( LOG_ERROR, "NETunmanglePacket: Incoming msg wrong length" );
abort();
NETlogEntry("NETunmanglePacket failure",msg->type,msg->size);
return;
}
@ -266,7 +268,8 @@ BOOL NETmangleData(long *input,long *result, UDWORD dataSize)
if(dataSize%8 != 0) //if message not multiple of 8 bytes,
{
DBERROR(("NETmangleData: msg not a multiple of 8 bytes"));
debug( LOG_ERROR, "NETmangleData: msg not a multiple of 8 bytes" );
abort();
return FALSE;
}
@ -290,7 +293,8 @@ BOOL NETunmangleData(long *input, long *result, UDWORD dataSize)
if(dataSize%8 != 0) //if message not multiple of 8 bytes,
{
DBERROR(("NETunmangleData: msg not a multiple of 8 bytes"));
debug( LOG_ERROR, "NETunmangleData: msg not a multiple of 8 bytes" );
abort();
return FALSE;
}

View File

@ -23,7 +23,8 @@ DWORD NETgetGameFlagsUnjoined(UDWORD gameid, UDWORD flag)
return NetPlay.games[gameid].desc.dwUser4;
break;
default:
DBERROR(("Invalid flag for getgameflagsunjoined in netplay lib"));
debug( LOG_ERROR, "Invalid flag for NETgetGameFlagsUnjoined in netplay lib" );
abort();
break;
}
return 0;

View File

@ -463,7 +463,7 @@ BOOL NETinit(BOOL bFirstCall)
if(bFirstCall)
{
DBPRINTF(("NETPLAY: Init called, MORNIN' \n "));
debug( LOG_NEVER, "NETPLAY: Init called, MORNIN'\n" );
NetPlay.bLobbyLaunched = FALSE; // clean up
NetPlay.dpidPlayer = 0;

View File

@ -25,25 +25,25 @@ void cpPrintType(INTERP_TYPE type)
switch(type)
{
case VAL_BOOL:
DBPRINTF(("BOOL"));
debug( LOG_NEVER, "BOOL" );
break;
case VAL_INT:
DBPRINTF(("INT"));
debug( LOG_NEVER, "INT" );
break;
/* case VAL_FLOAT:
DBPRINTF(("FLOAT"));
debug( LOG_NEVER, "FLOAT" );
break;*/
case VAL_STRING:
DBPRINTF(("STRING"));
debug( LOG_NEVER, "STRING" );
break;
case VAL_TRIGGER:
DBPRINTF(("TRIGGER"));
debug( LOG_NEVER, "TRIGGER" );
break;
case VAL_EVENT:
DBPRINTF(("EVENT"));
debug( LOG_NEVER, "EVENT" );
break;
case VAL_VOID:
DBPRINTF(("VOID"));
debug( LOG_NEVER, "VOID" );
break;
default:
// See if it is a user defined type
@ -53,7 +53,7 @@ void cpPrintType(INTERP_TYPE type)
{
if (asScrTypeTab[i].typeID == type)
{
DBPRINTF(("%s", asScrTypeTab[i].pIdent ));
debug( LOG_NEVER, "%s", asScrTypeTab[i].pIdent );
return;
}
}
@ -64,7 +64,7 @@ void cpPrintType(INTERP_TYPE type)
if (ref)
{
DBPRINTF((" REF"));
debug( LOG_NEVER, " REF" );
}
}
@ -76,32 +76,31 @@ void cpPrintVal(INTERP_VAL *psVal)
if (psVal->type & VAL_REF)
{
DBPRINTF(("type: "));
debug( LOG_NEVER, "type: " );
cpPrintType(psVal->type);
DBPRINTF((" value: %x", psVal->v.ival));
debug( LOG_NEVER, " value: %x", psVal->v.ival );
return;
}
switch(psVal->type)
{
case VAL_BOOL:
DBPRINTF(("type: BOOL value: %s",
psVal->v.bval ? "true" : "false"));
debug( LOG_NEVER, "type: BOOL value: %s", psVal->v.bval ? "true" : "false" );
break;
case VAL_INT:
DBPRINTF(("type: INT value: %d", psVal->v.ival ));
debug( LOG_NEVER, "type: INT value: %d", psVal->v.ival );
break;
/* case VAL_FLOAT:
DBPRINTF(("type: FLOAT value: %f", psVal->v.fval ));
debug( LOG_NEVER, "type: FLOAT value: %f", psVal->v.fval );
break;*/
case VAL_STRING:
DBPRINTF(("type: STRING value: %s", psVal->v.sval ));
debug( LOG_NEVER, "type: STRING value: %s", psVal->v.sval );
break;
case VAL_TRIGGER:
DBPRINTF(("type: TRIGGER value: %d", psVal->v.ival ));
debug( LOG_NEVER, "type: TRIGGER value: %d", psVal->v.ival );
break;
case VAL_EVENT:
DBPRINTF(("type: EVENT value: %d", psVal->v.ival ));
debug( LOG_NEVER, "type: EVENT value: %d", psVal->v.ival );
break;
default:
// See if it is a user defined type
@ -111,8 +110,7 @@ void cpPrintVal(INTERP_VAL *psVal)
{
if (asScrTypeTab[i].typeID == psVal->type)
{
DBPRINTF(("type: %s value: %x",
asScrTypeTab[i].pIdent, psVal->v.ival ));
debug( LOG_NEVER, "type: %s value: %x", asScrTypeTab[i].pIdent, psVal->v.ival );
return;
}
}
@ -132,32 +130,31 @@ void cpPrintPackedVal(UDWORD *ip)
if (type & VAL_REF)
{
DBPRINTF(("type: "));
debug( LOG_NEVER, "type: " );
cpPrintType(type);
DBPRINTF((" value: %x", data));
debug( LOG_NEVER, " value: %x", data );
return;
}
switch(type)
{
case VAL_BOOL:
DBPRINTF(("BOOL : %s",
((BOOL)data) ? "true" : "false"));
debug( LOG_NEVER, "BOOL : %s", ((BOOL)data) ? "true" : "false" );
break;
case VAL_INT:
DBPRINTF(("INT : %d", (SDWORD)data ));
debug( LOG_NEVER, "INT : %d", (SDWORD)data );
break;
/* case VAL_FLOAT:
DBPRINTF(("FLOAT : %f", (float)data ));
debug( LOG_NEVER, "FLOAT : %f", (float)data );
break;*/
case VAL_STRING:
DBPRINTF(("STRING : %s", (STRING *)data ));
debug( LOG_NEVER, "STRING : %s", (STRING *)data );
break;
case VAL_TRIGGER:
DBPRINTF(("TRIGGER : %d", (SDWORD)data ));
debug( LOG_NEVER, "TRIGGER : %d", (SDWORD)data );
break;
case VAL_EVENT:
DBPRINTF(("EVENT : %d", (SDWORD)data ));
debug( LOG_NEVER, "EVENT : %d", (SDWORD)data );
break;
default:
// See if it is a user defined type
@ -167,8 +164,7 @@ void cpPrintPackedVal(UDWORD *ip)
{
if (asScrTypeTab[i].typeID == type)
{
DBPRINTF(("type: %s value: %x",
asScrTypeTab[i].pIdent, data ));
debug( LOG_NEVER, "type: %s value: %x", asScrTypeTab[i].pIdent, data );
return;
}
}
@ -185,46 +181,46 @@ void cpPrintMathsOp(UDWORD opcode)
switch (opcode)
{
case OP_ADD:
DBPRINTF(("ADD "));
debug( LOG_NEVER, "ADD" );
break;
case OP_SUB:
DBPRINTF(("SUB "));
debug( LOG_NEVER, "SUB" );
break;
case OP_MUL:
DBPRINTF(("MUL "));
debug( LOG_NEVER, "MUL" );
break;
case OP_DIV:
DBPRINTF(("DIV "));
debug( LOG_NEVER, "DIV" );
break;
case OP_NEG:
DBPRINTF(("NEG "));
debug( LOG_NEVER, "NEG" );
break;
case OP_AND:
DBPRINTF(("AND "));
debug( LOG_NEVER, "AND" );
break;
case OP_OR:
DBPRINTF(("OR "));
debug( LOG_NEVER, "OR" );
break;
case OP_NOT:
DBPRINTF(("NOT "));
debug( LOG_NEVER, "NOT" );
break;
case OP_EQUAL:
DBPRINTF(("EQUAL "));
debug( LOG_NEVER, "EQUAL" );
break;
case OP_NOTEQUAL:
DBPRINTF(("NOT_EQUAL "));
debug( LOG_NEVER, "NOT_EQUAL" );
break;
case OP_GREATEREQUAL:
DBPRINTF(("GRT_EQUAL "));
debug( LOG_NEVER, "GRT_EQUAL" );
break;
case OP_LESSEQUAL:
DBPRINTF(("LESS_EQUAL "));
debug( LOG_NEVER, "LESS_EQUAL" );
break;
case OP_GREATER:
DBPRINTF(("GREATER "));
debug( LOG_NEVER, "GREATER" );
break;
case OP_LESS:
DBPRINTF(("LESS "));
debug( LOG_NEVER, "LESS" );
break;
default:
ASSERT((FALSE, "cpPrintMathsOp: unknown operator"));
@ -244,7 +240,7 @@ void cpPrintFunc(SCRIPT_FUNC pFunc)
{
if (asScrInstinctTab[i].pFunc == pFunc)
{
DBPRINTF(("%s", asScrInstinctTab[i].pIdent));
debug( LOG_NEVER, "%s", asScrInstinctTab[i].pIdent );
return;
}
}
@ -257,7 +253,7 @@ void cpPrintFunc(SCRIPT_FUNC pFunc)
{
if (asScrCallbackTab[i].pFunc == pFunc)
{
DBPRINTF(("%s", asScrCallbackTab[i].pIdent));
debug( LOG_NEVER, "%s", asScrCallbackTab[i].pIdent );
return;
}
}
@ -278,13 +274,13 @@ void cpPrintVarFunc(SCRIPT_VARFUNC pFunc, UDWORD index)
if (asScrExternalTab[i].set == pFunc &&
asScrExternalTab[i].index == index)
{
DBPRINTF(("%s (set)", asScrExternalTab[i].pIdent));
debug( LOG_NEVER, "%s (set)", asScrExternalTab[i].pIdent );
return;
}
else if (asScrExternalTab[i].get == pFunc &&
asScrExternalTab[i].index == index)
{
DBPRINTF(("%s (get)", asScrExternalTab[i].pIdent));
debug( LOG_NEVER, "%s (get)", asScrExternalTab[i].pIdent );
return;
}
}
@ -298,13 +294,13 @@ void cpPrintVarFunc(SCRIPT_VARFUNC pFunc, UDWORD index)
if (asScrObjectVarTab[i].set == pFunc &&
asScrObjectVarTab[i].index == index)
{
DBPRINTF(("%s (set)", asScrObjectVarTab[i].pIdent));
debug( LOG_NEVER, "%s (set)", asScrObjectVarTab[i].pIdent );
return;
}
else if (asScrObjectVarTab[i].get == pFunc &&
asScrObjectVarTab[i].index == index)
{
DBPRINTF(("%s (get)", asScrObjectVarTab[i].pIdent));
debug( LOG_NEVER, "%s (get)", asScrObjectVarTab[i].pIdent );
return;
}
}
@ -336,10 +332,10 @@ void cpPrintArrayInfo(UDWORD **pip, SCRIPT_CODE *psProg)
pElem += 1;
}*/
DBPRINTF(("%d->", base));
debug( LOG_NEVER, "%d->", base );
for(i=0; i<psProg->psArrayInfo[base].dimensions; i+= 1)
{
DBPRINTF(("[%d]", psProg->psArrayInfo[base].elements[i]));
debug( LOG_NEVER, "[%d]", psProg->psArrayInfo[base].elements[i] );
}
// calculate the number of DWORDs needed to store the number of elements for each dimension of the array
// elementDWords = (dimensions - 1)/4 + 1;
@ -372,43 +368,39 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
// Print out the global variables
if (psProg->numGlobals > 0)
{
DBPRINTF(("index storage type variable name\n"));
debug( LOG_NEVER, "index storage type variable name\n" );
psCurrVar = psProg->psVarDebug;
for(i=0; i<psProg->numGlobals; i++)
{
DBPRINTF(("%-6d %s %-4d %s\n", psCurrVar - psProg->psVarDebug,
psCurrVar->storage == ST_PUBLIC ? "Public " : "Private",
psProg->pGlobals[i], psCurrVar->pIdent));
debug( LOG_NEVER, "%-6d %s %-4d %s\n", psCurrVar - psProg->psVarDebug, psCurrVar->storage == ST_PUBLIC ? "Public " : "Private", psProg->pGlobals[i], psCurrVar->pIdent );
psCurrVar++;
}
}
if (psProg->numArrays > 0)
{
DBPRINTF(("\narrays\n"));
debug( LOG_NEVER, "\narrays\n" );
psCurrArray = psProg->psArrayInfo;
psCurrArrayDebug = psProg->psArrayDebug;
for(i=0; i<psProg->numArrays; i++)
{
DBPRINTF(("%-6d %s %-4d %s", i,
psCurrArrayDebug->storage == ST_PUBLIC ? "Public " : "Private",
psCurrArray->type, psCurrArrayDebug->pIdent));
debug( LOG_NEVER, "%-6d %s %-4d %s", i, psCurrArrayDebug->storage == ST_PUBLIC ? "Public " : "Private", psCurrArray->type, psCurrArrayDebug->pIdent );
for(dim=0; dim < psCurrArray->dimensions; dim += 1)
{
DBPRINTF(("[%d]", psCurrArray->elements[dim]));
debug( LOG_NEVER, "[%d]", psCurrArray->elements[dim] );
}
DBPRINTF(("\n"));
debug( LOG_NEVER, "\n" );
psCurrArray++;
psCurrArrayDebug++;
}
}
DBPRINTF(("\nindex line offset\n"));
debug( LOG_NEVER, "\nindex line offset\n" );
psCurrDebug = psProg->psDebug;
}
else
{
DBPRINTF(("index offset\n"));
debug( LOG_NEVER, "index offset\n" );
}
// Find the first trigger with code
@ -433,7 +425,7 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
if ((UDWORD)(ip - psProg->pCode) == psCurrDebug->offset &&
psCurrDebug->pLabel != NULL)
{
DBPRINTF(("%s\n", psCurrDebug->pLabel));
debug( LOG_NEVER, "%s\n", psCurrDebug->pLabel );
}
}
@ -442,7 +434,7 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
{
if (ip - psProg->pCode == psProg->pTriggerTab[jumpOffset])
{
DBPRINTF(("%-6d ", jumpOffset));
debug( LOG_NEVER, "%-6d", jumpOffset );
jumpOffset+= 1;
// Find the next trigger with code
while(jumpOffset < psProg->numTriggers)
@ -462,19 +454,19 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
}
else
{
DBPRINTF((" "));
debug( LOG_NEVER, "" );
}
}
else
{
if (ip - psProg->pCode == psProg->pEventTab[jumpOffset])
{
DBPRINTF(("%-6d ", jumpOffset));
debug( LOG_NEVER, "%-6d", jumpOffset );
jumpOffset+= 1;
}
else
{
DBPRINTF((" "));
debug( LOG_NEVER, "" );
}
}
@ -483,92 +475,89 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
{
if ((UDWORD)(ip - psProg->pCode) == psCurrDebug->offset)
{
DBPRINTF(("%-6d ", psCurrDebug->line));
debug( LOG_NEVER, "%-6d", psCurrDebug->line );
psCurrDebug++;
}
else
{
DBPRINTF((" "));
debug( LOG_NEVER, "" );
}
}
// Display the code offset
DBPRINTF(("%-6d ", ip - psProg->pCode));
debug( LOG_NEVER, "%-6d", ip - psProg->pCode );
switch (opcode)
{
case OP_PUSH:
DBPRINTF(("PUSH "));
debug( LOG_NEVER, "PUSH" );
cpPrintPackedVal(ip);
DBPRINTF(("\n"));
debug( LOG_NEVER, "\n" );
ip += aOpSize[opcode];
break;
case OP_PUSHREF:
DBPRINTF(("PUSHREF "));
debug( LOG_NEVER, "PUSHREF" );
cpPrintPackedVal(ip);
DBPRINTF(("\n"));
debug( LOG_NEVER, "\n" );
ip += aOpSize[opcode];
break;
case OP_POP:
DBPRINTF(("POP\n"));
debug( LOG_NEVER, "POP\n" );
ip += aOpSize[opcode];
break;
case OP_PUSHGLOBAL:
DBPRINTF(("PUSHGLOBAL %d\n", data));
debug( LOG_NEVER, "PUSHGLOBAL %d\n", data );
ip += aOpSize[opcode];
break;
case OP_POPGLOBAL:
DBPRINTF(("POPGLOBAL %d\n", data));
debug( LOG_NEVER, "POPGLOBAL %d\n", data );
ip += aOpSize[opcode];
break;
case OP_PUSHARRAYGLOBAL:
DBPRINTF(("PUSHARRAYGLOBAL "));
debug( LOG_NEVER, "PUSHARRAYGLOBAL" );
cpPrintArrayInfo(&ip, psProg);
DBPRINTF(("\n"));
debug( LOG_NEVER, "\n" );
break;
case OP_POPARRAYGLOBAL:
DBPRINTF(("POPARRAYGLOBAL "));
debug( LOG_NEVER, "POPARRAYGLOBAL" );
cpPrintArrayInfo(&ip, psProg);
DBPRINTF(("\n"));
debug( LOG_NEVER, "\n" );
break;
case OP_CALL:
DBPRINTF(("CALL "));
debug( LOG_NEVER, "CALL" );
cpPrintFunc( (SCRIPT_FUNC)(*(ip+1)) );
DBPRINTF(("\n"));
debug( LOG_NEVER, "\n" );
ip += aOpSize[opcode];
break;
case OP_VARCALL:
DBPRINTF(("VARCALL "));
debug( LOG_NEVER, "VARCALL" );
cpPrintVarFunc( (SCRIPT_VARFUNC)(*(ip+1)), data);
DBPRINTF(("(%d)\n", data));
debug( LOG_NEVER, "(%d)\n", data );
ip += aOpSize[opcode];
break;
case OP_JUMP:
DBPRINTF(("JUMP %d (%d)\n",
(SWORD)data, ip - psProg->pCode + (SWORD)data));
debug( LOG_NEVER, "JUMP %d (%d)\n", (SWORD)data, ip - psProg->pCode + (SWORD)data );
ip += aOpSize[opcode];
break;
case OP_JUMPTRUE:
DBPRINTF(("JUMPTRUE %d (%d)\n",
(SWORD)data, ip - psProg->pCode + (SWORD)data));
debug( LOG_NEVER, "JUMPTRUE %d (%d)\n", (SWORD)data, ip - psProg->pCode + (SWORD)data );
ip += aOpSize[opcode];
break;
case OP_JUMPFALSE:
DBPRINTF(("JUMPFALSE %d (%d)\n",
(SWORD)data, ip - psProg->pCode + (SWORD)data));
debug( LOG_NEVER, "JUMPFALSE %d (%d)\n", (SWORD)data, ip - psProg->pCode + (SWORD)data );
ip += aOpSize[opcode];
break;
case OP_BINARYOP:
case OP_UNARYOP:
cpPrintMathsOp(data);
DBPRINTF(("\n"));
debug( LOG_NEVER, "\n" );
ip += aOpSize[opcode];
break;
case OP_EXIT:
DBPRINTF(("EXIT\n"));
debug( LOG_NEVER, "EXIT\n" );
ip += aOpSize[opcode];
break;
case OP_PAUSE:
DBPRINTF(("PAUSE %d\n", data));
debug( LOG_NEVER, "PAUSE %d\n", data );
ip += aOpSize[opcode];
break;
default:

View File

@ -60,7 +60,7 @@ static SDWORD eventTraceLevel=3;
#ifdef DEBUG
#define DB_TRACE(x, level) \
if (eventTraceLevel >= (level)) \
DBPRINTF(x)
debug( LOG_NEVER, x)
#else
#define DB_TRACE(x,level)
#endif
@ -166,7 +166,7 @@ void eventReset(void)
#ifdef DEBUG
if (count>0)
{
DBPRINTF(("eventReset: %d contexts still allocated at shutdown\n", count));
debug( LOG_NEVER, "eventReset: %d contexts still allocated at shutdown\n", count );
}
#endif
}
@ -295,11 +295,10 @@ void eventPrintTriggerInfo(ACTIVE_TRIGGER *psTrigger)
// find the debug info for the event
pEventLab = eventGetEventID(psCode, psTrigger->event);
DBPRINTF(("trigger %s at %d -> %s",
pTrigLab, psTrigger->testTime, pEventLab));
debug( LOG_NEVER, "trigger %s at %d -> %s", pTrigLab, psTrigger->testTime, pEventLab );
if (psTrigger->offset != 0)
{
DBPRINTF((" %d", psTrigger->offset));
debug( LOG_NEVER, " %d", psTrigger->offset );
}
}
@ -337,7 +336,8 @@ BOOL eventAddValueCreate(INTERP_TYPE type, VAL_CREATE_FUNC create)
{
if (type >= numFuncs)
{
debug(LOG_ERROR, "eventAddValueCreate: type out of range");
debug( LOG_ERROR, "eventAddValueCreate: type out of range" );
abort();
return FALSE;
}
@ -351,8 +351,8 @@ BOOL eventAddValueRelease(INTERP_TYPE type, VAL_RELEASE_FUNC release)
{
if (type >= numFuncs)
{
debug(LOG_ERROR, "eventAddValueRelease: type out of range");
DBERROR(("eventAddValueRelease: type out of range"));
debug( LOG_ERROR, "eventAddValueRelease: type out of range" );
abort();
return FALSE;
}
@ -878,7 +878,8 @@ BOOL eventLoadTrigger(UDWORD time, SCRIPT_CONTEXT *psContext,
// Get a trigger object
if (!HEAP_ALLOC(psTrigHeap, (void*) &psNewTrig))
{
DBERROR(("eventLoadTrigger: out of memory"));
debug( LOG_ERROR, "eventLoadTrigger: out of memory" );
abort();
return FALSE;
}

View File

@ -53,7 +53,8 @@ static BOOL eventSaveContext(char *pBuffer, UDWORD *pSize)
//nothashed if (!resGetIDfromData("SCRIPT", psCCont->psCode, &hashedName))
if (!resGetHashfromData("SCRIPT", psCCont->psCode, &hashedName))
{
DBERROR(("eventSaveContext: couldn't find script resource id"));
debug( LOG_ERROR, "eventSaveContext: couldn't find script resource id" );
abort();
return FALSE;
}
numVars = psCCont->psCode->numGlobals + psCCont->psCode->arraySize;
@ -122,7 +123,8 @@ static BOOL eventSaveContext(char *pBuffer, UDWORD *pSize)
if (!saveFunc(psVal->type, (UDWORD)psVal->v.ival, pPos, &valSize))
{
DBERROR(("eventSaveContext: couldn't get variable value size"));
debug( LOG_ERROR, "eventSaveContext: couldn't get variable value size" );
abort();
return FALSE;
}
@ -192,7 +194,8 @@ static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize)
numVars = psCode->numGlobals + psCode->arraySize;
if (numVars != *((SWORD*)pPos))
{
DBERROR(("eventLoadContext: number of context variables does not match the script code"));
debug( LOG_ERROR, "eventLoadContext: number of context variables does not match the script code" );
abort();
return FALSE;
}
pPos += sizeof(SWORD);
@ -230,7 +233,8 @@ static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize)
// set the value in the context
if (!eventSetContextVar(psCCont, (UDWORD)i, type, data))
{
DBERROR(("eventLoadContext: couldn't set variable value"));
debug( LOG_ERROR, "eventLoadContext: couldn't set variable value" );
abort();
return FALSE;
}
}
@ -250,13 +254,15 @@ static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize)
// into the variables data space.
if (!eventGetContextVal(psCCont, (UDWORD)i, &psVal))
{
DBERROR(("eventLoadContext: couldn't find variable in context"));
debug( LOG_ERROR, "eventLoadContext: couldn't find variable in context" );
abort();
return FALSE;
}
if (!loadFunc(version, type, pPos, valSize, (UDWORD *)&(psVal->v.ival)))
{
DBERROR(("eventLoadContext: couldn't get variable value"));
debug( LOG_ERROR, "eventLoadContext: couldn't get variable value" );
abort();
return FALSE;
}
@ -310,7 +316,8 @@ static BOOL eventLoadContextHashed(SDWORD version, char *pBuffer, UDWORD *pSize)
numVars = psCode->numGlobals + psCode->arraySize;
if (numVars != *((SWORD*)pPos))
{
DBERROR(("eventLoadContext: number of context variables does not match the script code"));
debug( LOG_ERROR, "eventLoadContext: number of context variables does not match the script code" );
abort();
return FALSE;
}
pPos += sizeof(SWORD);
@ -348,7 +355,8 @@ static BOOL eventLoadContextHashed(SDWORD version, char *pBuffer, UDWORD *pSize)
// set the value in the context
if (!eventSetContextVar(psCCont, (UDWORD)i, type, data))
{
DBERROR(("eventLoadContext: couldn't set variable value"));
debug( LOG_ERROR, "eventLoadContext: couldn't set variable value" );
abort();
return FALSE;
}
}
@ -368,13 +376,15 @@ static BOOL eventLoadContextHashed(SDWORD version, char *pBuffer, UDWORD *pSize)
// into the variables data space.
if (!eventGetContextVal(psCCont, (UDWORD)i, &psVal))
{
DBERROR(("eventLoadContext: couldn't find variable in context"));
debug( LOG_ERROR, "eventLoadContext: couldn't find variable in context" );
abort();
return FALSE;
}
if (!loadFunc(version, type, pPos, valSize, (UDWORD *)&(psVal->v.ival)))
{
DBERROR(("eventLoadContext: couldn't get variable value"));
debug( LOG_ERROR, "eventLoadContext: couldn't get variable value" );
abort();
return FALSE;
}
@ -455,7 +465,8 @@ BOOL eventSaveTriggerList(ACTIVE_TRIGGER *psList, char *pBuffer, UDWORD *pSize)
pPos += sizeof(UDWORD);
if (!eventGetContextIndex(psCurr->psContext, &context))
{
DBERROR(("eventSaveTriggerList: couldn't find context"));
debug( LOG_ERROR, "eventSaveTriggerList: couldn't find context" );
abort();
return FALSE;
}
*((SWORD*)pPos) = (SWORD)context;
@ -509,7 +520,8 @@ static BOOL eventLoadTriggerList(SDWORD version, char *pBuffer, UDWORD *pSize)
pPos += sizeof(SWORD);
if (!eventFindContext(context, &psContext))
{
DBERROR(("eventLoadTriggerList: couldn't find context"));
debug( LOG_ERROR, "eventLoadTriggerList: couldn't find context" );
abort();
return FALSE;
}
@ -575,7 +587,8 @@ BOOL eventSaveState(SDWORD version, char **ppBuffer, UDWORD *pFileSize)
pBuffer = MALLOC(totalSize);
if (pBuffer == NULL)
{
DBERROR(("eventSaveState: out of memory"));
debug( LOG_ERROR, "eventSaveState: out of memory" );
abort();
return FALSE;
}
pPos = pBuffer;
@ -635,7 +648,8 @@ BOOL eventLoadState(char *pBuffer, UDWORD fileSize, BOOL bHashed)
psHdr = (EVENT_SAVE_HDR *)pPos;
if (strncmp(psHdr->aFileType, "evnt", 4) != 0)
{
DBERROR(("eventLoadState: invalid file header"));
debug( LOG_ERROR, "eventLoadState: invalid file header" );
abort();
return FALSE;
}
/* if ((psHdr->version != 1) &&
@ -686,7 +700,8 @@ BOOL eventLoadState(char *pBuffer, UDWORD fileSize, BOOL bHashed)
if (totalSize != fileSize)
{
DBERROR(("eventLoadState: corrupt save file"));
debug( LOG_ERROR, "eventLoadState: corrupt save file" );
abort();
return FALSE;
}

View File

@ -60,7 +60,7 @@ BOOL interpTrace;
/* Print out trace info if tracing is turned on */
#define TRCPRINTF(x) \
if (interpTrace) \
DBPRINTF(x)
debug( LOG_NEVER, x)
#define TRCPRINTVAL(x) \
if (interpTrace) \
@ -169,12 +169,12 @@ BOOL interpGetArrayVarData(UDWORD **pip, VAL_CHUNK *psGlobals, SCRIPT_CODE *psPr
// print out the debug trace
if (interpTrace)
{
DBPRINTF(("%d->", base));
debug( LOG_NEVER, "%d->", base );
for(i=0; i<dimensions; i+= 1)
{
DBPRINTF(("[%d/%d]", vals[i], elements[i]));
debug( LOG_NEVER, "[%d/%d]", vals[i], elements[i] );
}
DBPRINTF(("(%d) ", index));
debug( LOG_NEVER, "(%d) ", index );
}
// check the index is valid

View File

@ -436,7 +436,8 @@ int scr_wrap(void)
{
if (inComment)
{
DBERROR(("Warning: reached end of file in a comment"));
debug( LOG_ERROR, "Warning: reached end of file in a comment" );
abort();
}
return 1;
}

View File

@ -4849,18 +4849,16 @@ void scr_error(char *pMessage, ...)
va_end(args);
scriptGetErrorData(&line, &text);
#ifdef DEBUG
debug(LOG_ERROR, "script parse error:\n%s at %s:%d\nToken: %d, Text: '%s'\n",
aBuff, GetLastResourceFilename(), line, scr_char, text);
debug( LOG_ERROR, "script parse error:\n%s at %s:%d\nToken: %d, Text: '%s'\n",
aBuff, GetLastResourceFilename(), line, scr_char, text );
ASSERT((FALSE, "script parse error:\n%s at %s:%d\nToken: %d, Text: '%s'\n",
aBuff, GetLastResourceFilename(), line, scr_char, text));
#else
//DBERROR(("script parse error:\n%s at line %d\nToken: %d, Text: '%s'\n",
// pMessage, line, scr_char, text));
debug(LOG_ERROR, "script parse error:\n'%s' at %s:%d\nToken: %d, Text: '%s'\n",
aBuff, GetLastResourceFilename(), line, scr_char, text);
DBERROR(("script parse error:\n%s at %s:%d\nToken: %d, Text: '%s'\n",
aBuff, GetLastResourceFilename(), line, scr_char, text));
debug( LOG_ERROR, "script parse error:\n'%s' at %s:%d\nToken: %d, Text: '%s'\n",
aBuff, GetLastResourceFilename(), line, scr_char, text );
abort();
#endif
}

View File

@ -424,7 +424,7 @@ void stackPrintTop(void)
}
else
{
DBPRINTF(("STACK EMPTY"));
debug( LOG_NEVER, "STACK EMPTY" );
}
}
@ -647,15 +647,15 @@ BOOL stackInitialise(void)
psStackBase = (STACK_CHUNK *)MALLOC(sizeof(STACK_CHUNK));
if (psStackBase == NULL)
{
debug(LOG_ERROR, "Out of memory");
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
psStackBase->aVals = MALLOC(sizeof(INTERP_VAL) * INIT_SIZE);
if (!psStackBase->aVals)
{
debug(LOG_ERROR, "Out of memory");
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
@ -679,7 +679,7 @@ void stackShutDown(void)
if ((psCurrChunk != psStackBase) && (currEntry != 0))
{
DBPRINTF(("stackShutDown: stack is not empty on shutdown"));
debug( LOG_NEVER, "stackShutDown: stack is not empty on shutdown" );
}
for(psCurr = psStackBase; psCurr != NULL; psCurr = psNext)

View File

@ -98,12 +98,12 @@ rpl_open(char* filename) {
rpl->f = f;
if (strcmp(readline(f, buf, len), "ARMovie") != 0)
DBPRINTF(("%s missing RPL magic number\n", filename));
debug( LOG_NEVER, "%s missing RPL magic number\n", filename );
readline(f, buf, len); /* discard filename */
readline(f, buf, len); /* discard copyright */
if (strcmp(readline(f, buf, len), "ESCAPE 2.0") != 0)
/* This field is really "author", but.. */
DBPRINTF(("%s not in \"ESCAPE 2.0\" format?\n", filename));
debug( LOG_NEVER, "%s not in \"ESCAPE 2.0\" format?\n", filename );
tmp = readint(f, buf, len);
@ -113,7 +113,7 @@ rpl_open(char* filename) {
break;
default:
rpl->video_decoder = rpl_decode_video_unknown;
printf("Unknown video format %i\n", tmp);
debug( LOG_NEVER, "Unknown video format %i\n", tmp);
break;
}

View File

@ -80,7 +80,8 @@ BOOL audio_Init( AUDIO_CALLBACK pStopTrackCallback )
// allocate sample heap
if ( !HEAP_CREATE(&g_psSampleHeap, AUDIO_SAMPLE_HEAP_INIT, AUDIO_SAMPLE_HEAP_EXT, sizeof(AUDIO_SAMPLE)) )
{
DBERROR( ("audio_Init: couldn't create sample queue\n") );
debug( LOG_ERROR, "audio_Init: couldn't create sample queue\n" );
abort();
return FALSE;
}
@ -546,7 +547,7 @@ void audio_UpdateQueue( void )
}
else
{
DBPRINTF( ("audio_UpdateQueue: couldn't play sample\n") );
debug( LOG_NEVER, "audio_UpdateQueue: couldn't play sample\n" );
HEAP_FREE( g_psSampleHeap, psSample );
}
}
@ -705,7 +706,7 @@ BOOL audio_SetTrackVals
psTrack = resGetData( "WAV", szFileName ); //at this point we have 4 valid entries, and 8 invalid -Q
if ( psTrack == NULL )
{
DBPRINTF( ("audio_SetTrackVals: track %s resource not found\n", szFileName) );
debug( LOG_NEVER, "audio_SetTrackVals: track %s resource not found\n", szFileName );
return FALSE;
}
else
@ -718,7 +719,7 @@ BOOL audio_SetTrackVals
if ( *piID == SAMPLE_NOT_ALLOCATED )
{
DBPRINTF( ("audio_SetTrackVals: couldn't get spare track ID\n") );
debug( LOG_NEVER, "audio_SetTrackVals: couldn't get spare track ID\n" );
return FALSE;
}
else
@ -883,7 +884,7 @@ static BOOL audio_Play3DTrack( SDWORD iX, SDWORD iY, SDWORD iZ, int iTrack, void
}
else
{
DBPRINTF( ("audio_Play3DTrack: couldn't play sample\n") );
debug( LOG_NEVER, "audio_Play3DTrack: couldn't play sample\n" );
HEAP_FREE( g_psSampleHeap, psSample );
return FALSE;
}
@ -1072,7 +1073,7 @@ void audio_PlayTrack( int iTrack )
}
else
{
DBPRINTF( ("audio_PlayTrack: couldn't play sample\n") );
debug( LOG_NEVER, "audio_PlayTrack: couldn't play sample\n" );
HEAP_FREE( g_psSampleHeap, psSample );
}
}
@ -1203,7 +1204,7 @@ void audio_StopAll( void )
return;
}
DBPRINTF( ("audio_StopAll called\n") );
debug( LOG_NEVER, "audio_StopAll called\n" );
g_bStopAll = TRUE;
//
@ -1228,7 +1229,7 @@ void audio_StopAll( void )
g_psSampleQueue = NULL;
g_bStopAll = FALSE;
DBPRINTF( ("audio_StopAll done\n") );
debug( LOG_NEVER, "audio_StopAll done\n" );
}
//*

View File

@ -91,7 +91,7 @@ BOOL sound_Init( SDWORD iMaxSameSamples )
0,
NULL
);
DBPRINTF( ("sound_Init: couldn't load compression manager MSACM32.DLL\n") );
debug( LOG_NEVER, "sound_Init: couldn't load compression manager MSACM32.DLL\n" );
}
if ( !LoadLibrary("MSADP32.ACM") )
@ -106,12 +106,12 @@ BOOL sound_Init( SDWORD iMaxSameSamples )
0,
NULL
);
DBPRINTF( ("sound_Init: couldn't load ADPCM codec MSADP32.ACM\n") );
debug( LOG_NEVER, "sound_Init: couldn't load ADPCM codec MSADP32.ACM\n" );
}
#endif
if ( sound_InitLibrary() == FALSE )
{
DBPRINTF( ("Cannot init sound library\n") );
debug( LOG_NEVER, "Cannot init sound library\n" );
return FALSE;
}
@ -182,7 +182,8 @@ BOOL sound_SetTrackVals
{
if ( g_apTrack[iTrack] != NULL )
{
DBERROR( ("sound_SetTrackVals: track %i already set\n", iTrack) );
debug( LOG_ERROR, "sound_SetTrackVals: track %i already set\n", iTrack );
abort();
return FALSE;
}
@ -229,7 +230,8 @@ BOOL sound_AddTrack( TRACK *pTrack )
}
else
{
DBERROR( ("sound_AddTrack: all tracks used: increase MAX_TRACKS\n") );
debug( LOG_ERROR, "sound_AddTrack: all tracks used: increase MAX_TRACKS\n" );
abort();
return FALSE;
}
}
@ -249,7 +251,8 @@ void *sound_LoadTrackFromBuffer(char *pBuffer, UDWORD udwSize)
memset(pTrack, 0, sizeof(TRACK));
if ( pTrack == NULL )
{
DBERROR( ("sound_LoadTrackFromBuffer: couldn't allocate memory\n") );
debug( LOG_ERROR, "sound_LoadTrackFromBuffer: couldn't allocate memory\n" );
abort();
return NULL;
}
else
@ -258,7 +261,8 @@ void *sound_LoadTrackFromBuffer(char *pBuffer, UDWORD udwSize)
pTrack->pName = MALLOC( strlen(GetLastResourceFilename()) + 1 );
if ( pTrack->pName == NULL )
{
DBERROR( ("sound_LoadTrackFromBuffer: couldn't allocate memory\n") );
debug( LOG_ERROR, "sound_LoadTrackFromBuffer: couldn't allocate memory\n" );
abort();
FREE( pTrack );
return NULL;
}
@ -275,7 +279,7 @@ void *sound_LoadTrackFromBuffer(char *pBuffer, UDWORD udwSize)
// flag compressed audio load
if ( pTrack->bCompressed == TRUE )
{
DBPRINTF( ("sound_LoadTrackFromBuffer: %s is compressed!\n", pTrack->pName) );
debug( LOG_NEVER, "sound_LoadTrackFromBuffer: %s is compressed!\n", pTrack->pName );
}
#endif
return pTrack;
@ -301,7 +305,8 @@ BOOL sound_LoadTrackFromFile(char szFileName[])
pTrack->pName = MALLOC( strlen((char*) szFileName) + 1 );
if ( pTrack->pName == NULL )
{
DBERROR( ("sound_LoadTrackFromFile: Out of memory") );
debug( LOG_ERROR, "sound_LoadTrackFromFile: Out of memory" );
abort();
return FALSE;
}
@ -420,13 +425,13 @@ BOOL sound_CheckTrack( SDWORD iTrack )
{
if ( iTrack < 0 || iTrack > g_iCurTracks - 1 )
{
DBPRINTF( ("sound_CheckTrack: track number %i outside max %i\n", iTrack, g_iCurTracks) );
debug( LOG_NEVER, "sound_CheckTrack: track number %i outside max %i\n", iTrack, g_iCurTracks );
return FALSE;
}
if ( g_apTrack[iTrack] == NULL )
{
DBPRINTF( ("sound_CheckTrack: track %i NULL\n", iTrack) );
debug( LOG_NEVER, "sound_CheckTrack: track %i NULL\n", iTrack );
return FALSE;
}

View File

@ -762,7 +762,7 @@ void actionAddVtolAttackRun( DROID *psDroid )
iX>(SDWORD)(GetWidthOfMap()<<TILE_SHIFT) ||
iY>(SDWORD)(GetHeightOfMap()<<TILE_SHIFT) )
{
DBPRINTF( ("*** actionAddVtolAttackRun: run off map! ***\n") );
debug( LOG_NEVER, "*** actionAddVtolAttackRun: run off map! ***\n" );
}
else
{
@ -2447,7 +2447,7 @@ void actionUpdateDroid(DROID *psDroid)
if (!actionVTOLLandingPos(psDroid, &droidX, &droidY))
{
// totally bunged up - give up
DBPRINTF(("DACTION_MOVETOREARM: couldn't find a clear tile near rearm pad - RTB\n"));
debug( LOG_NEVER, "DACTION_MOVETOREARM: couldn't find a clear tile near rearm pad - RTB\n" );
orderDroid(psDroid, DORDER_RTB);
break;
}

View File

@ -44,7 +44,7 @@ audio_ObjectDead( void * psObj )
/* check is valid simple object pointer */
if ( !PTRVALID(psSimpleObj, sizeof(SIMPLE_OBJECT)) )
{
DBPRINTF( ("audio_ObjectDead: simple object pointer invalid\n") );
debug( LOG_NEVER, "audio_ObjectDead: simple object pointer invalid\n" );
return TRUE;
}
@ -54,7 +54,7 @@ audio_ObjectDead( void * psObj )
psProj = (PROJ_OBJECT *) psSimpleObj;
if ( !PTRVALID(psProj, sizeof(PROJ_OBJECT)) )
{
DBPRINTF( ("audio_ObjectDead: projectile object pointer invalid\n") );
debug( LOG_NEVER, "audio_ObjectDead: projectile object pointer invalid\n" );
return TRUE;
}
else
@ -77,7 +77,7 @@ audio_ObjectDead( void * psObj )
/* check is valid pointer */
if ( !PTRVALID(psBaseObj, sizeof(BASE_OBJECT)) )
{
DBPRINTF( ("audio_ObjectDead: base object pointer invalid\n") );
debug( LOG_NEVER, "audio_ObjectDead: base object pointer invalid\n" );
return TRUE;
}
else
@ -214,7 +214,7 @@ audio_GetClusterCentre( void *psClusterObj, SDWORD *piX, SDWORD *piY, SDWORD *pi
iClusterID = clustGetClusterID( psClusterObj );
if ( iClusterID == 0 )
{
DBPRINTF( ("audio_GetClusterCentre: empty cluster!\n") );
debug( LOG_NEVER, "audio_GetClusterCentre: empty cluster!\n" );
return FALSE;
}
else
@ -274,7 +274,7 @@ audio_GetNewClusterObject( void **psClusterObj, SDWORD iClusterID )
if ( iClusterID == 0 )
{
DBPRINTF( ("audio_GetNewClusterObject: empty cluster!\n") );
debug( LOG_NEVER, "audio_GetNewClusterObject: empty cluster!\n" );
return FALSE;;
}
else

View File

@ -216,7 +216,8 @@ BOOL startHigher;
}
else
{
DBERROR(("Weirdy Bridge requested - no axes allignment"));
debug( LOG_ERROR, "Weirdy Bridge requested - no axes allignment" );
abort();
}
}

View File

@ -91,7 +91,8 @@ BOOL ParseCommandLineEarly(int argc, char** argv)
// find the file name
token = argv[++i];
if (token == NULL) {
DBERROR( ("Missing filename?\n") );
debug( LOG_ERROR, "Missing filename?\n" );
abort();
return FALSE;
}
debug_register_callback( debug_callback_file, debug_callback_file_init, debug_callback_file_exit, (void*)token );
@ -203,7 +204,8 @@ BOOL ParseCommandLine(int argc, char** argv)
token = argv[++i];
if (token == NULL)
{
DBERROR( ("Unrecognised -game name\n") );
debug( LOG_ERROR, "Unrecognised -game name\n" );
abort();
return FALSE;
}
strncpy(pLevelName, token, 254);
@ -215,7 +217,8 @@ BOOL ParseCommandLine(int argc, char** argv)
token = argv[++i];
if (token == NULL)
{
DBERROR( ("Unrecognised -savegame name\n") );
debug( LOG_ERROR, "Unrecognised -savegame name\n" );
abort();
return FALSE;
}
strcpy(saveGameName, SaveGamePath);

View File

@ -78,7 +78,8 @@ BOOL setPlayerColour(UDWORD player, UDWORD col)
{
if(player >MAX_PLAYERS || col >MAX_PLAYERS)
{
DBERROR(("setplayercolour: wrong values"));
debug( LOG_ERROR, "setplayercolour: wrong values" );
abort();
return FALSE;
}
PlayerColour[(UBYTE)player] = (UBYTE)col;
@ -203,7 +204,7 @@ UDWORD getComponentRadius(BASE_STATS *psComponent)
if ( (StatIsComponent(psComponent) != COMP_WEAPON) ||
((WEAPON_STATS *)psComponent)->weaponSubClass != WSC_BOMB )
{
DBPRINTF(("ComponentPIE == NULL : File : %s Line : %d\n",__FILE__,__LINE__));
debug( LOG_NEVER, "ComponentPIE == NULL : File : %s Line : %d\n", __FILE__, __LINE__ );
}
return COMPONENT_RADIUS;
@ -219,7 +220,7 @@ UDWORD getResearchRadius(BASE_STATS *Stat)
}
// DBERROR(("Null IMD in getResearchRadius()"));
DBPRINTF(("ResearchPIE == NULL : File : %s Line : %d\n",__FILE__,__LINE__));
debug( LOG_NEVER, "ResearchPIE == NULL : File : %s Line : %d\n", __FILE__, __LINE__ );
return 100;
}
@ -521,7 +522,7 @@ void displayComponentButton(BASE_STATS *Stat, iVector *Rotation,iVector *Positio
((StatIsComponent(Stat) != COMP_WEAPON) ||
((WEAPON_STATS *)Stat)->weaponSubClass != WSC_BOMB) )
{
DBPRINTF(("ComponentPIE == NULL : File : %s Line : %d\n",__FILE__,__LINE__));
debug( LOG_NEVER, "ComponentPIE == NULL : File : %s Line : %d\n", __FILE__, __LINE__ );
// DBERROR(("ComponentIMD == NULL"));
}

View File

@ -545,7 +545,7 @@ BOOL saveConfig()
}
else
{
DBPRINTF(("Writing multiplay prefs to registry\n"));
debug( LOG_NEVER, "Writing multiplay prefs to registry\n" );
if(NetPlay.bHost && ingame.localJoiningInProgress)
{
setWarzoneKeyString("gameName", game.name); // last hosted game

View File

@ -230,7 +230,8 @@ CONSOLE_MESSAGE *psMessage;
break;
/* Gone tits up by the looks of it */
default:
DBERROR(("Weirdy type of text justification for console print"));
debug( LOG_ERROR, "Weirdy type of text justification for console print" );
abort();
break;
}
@ -647,7 +648,8 @@ void setDefaultConsoleJust(CONSOLE_TEXT_JUSTIFICATION defJ)
defJustification = defJ;
break;
default:
DBERROR(("Weird default text justification for console"));
debug( LOG_ERROR, "Weird default text justification for console" );
abort();
break;
}
}

View File

@ -710,7 +710,8 @@ BOOL dataIMDBufferLoad(char *pBuffer, UDWORD size, void **ppData)
psIMD = iV_ProcessIMD(&pBufferPosition, pBufferPosition + size, "", "", FALSE);
if (psIMD == NULL) {
DBERROR(("IMD load failed - %s", GetLastResourceFilename()));
debug( LOG_ERROR, "IMD load failed - %s", GetLastResourceFilename() );
abort();
return FALSE;
}

View File

@ -1364,7 +1364,8 @@ intChooseSystemStats( DROID_TEMPLATE *psTemplate )
psTemplate->asWeaps[0]);
break;
default:
DBERROR( ("intSetDesignStats: unrecognised droid type") );
debug( LOG_ERROR, "intSetDesignStats: unrecognised droid type" );
abort();
return NULL;
}
@ -1455,7 +1456,7 @@ STRING *GetDefaultTemplateName(DROID_TEMPLATE *psTemplate)
if ( strlen( aCurrName ) + strlen( pStr ) > WIDG_MAXSTR )
{
DBPRINTF( ("GetDefaultTemplateName: name string too long %s+%s\n",aCurrName,pStr) );
debug( LOG_NEVER, "GetDefaultTemplateName: name string too long %s+%s\n", aCurrName, pStr );
return NULL;
}
@ -1471,7 +1472,7 @@ STRING *GetDefaultTemplateName(DROID_TEMPLATE *psTemplate)
if ( strlen( aCurrName ) + strlen( pStr ) > WIDG_MAXSTR )
{
DBPRINTF( ("GetDefaultTemplateName: name string too long %s+%s\n",aCurrName,pStr) );
debug( LOG_NEVER, "GetDefaultTemplateName: name string too long %s+%s\n", aCurrName, pStr );
return NULL;
}
@ -2695,7 +2696,7 @@ static BOOL intAddComponentButtons(COMP_BASE_STATS *psStats, UDWORD size,
sButInit.majorID += 1;
if (sButInit.majorID >= WFORM_MAXMAJOR)
{
DBPRINTF(("Too many buttons for component form"));
debug( LOG_NEVER, "Too many buttons for component form" );
return FALSE;
}
}
@ -2714,7 +2715,7 @@ static BOOL intAddComponentButtons(COMP_BASE_STATS *psStats, UDWORD size,
sButInit.minorID += 1;
if (sButInit.minorID >= WFORM_MAXMINOR)
{
DBPRINTF(("Too many buttons for component form"));
debug( LOG_NEVER, "Too many buttons for component form" );
return FALSE;
}
}
@ -5106,7 +5107,7 @@ BOOL saveTemplate(void)
/* The design needs a new template in the list */
if (!HEAP_ALLOC(psTemplateHeap, (void**) &psTempl))
{
DBPRINTF( ("saveTemplate: heap alloc failed\n") );
debug( LOG_NEVER, "saveTemplate: heap alloc failed\n" );
return FALSE;
}

View File

@ -60,7 +60,8 @@ void setDifficultyLevel(DIFFICULTY_LEVEL lev)
fDifEnemyModifier = FRACTCONST(50,100); // they do less damage!
break;
default:
DBERROR(("Invalid difficulty level selected - forcing NORMAL"));
debug( LOG_ERROR, "Invalid difficulty level selected - forcing NORMAL" );
abort();
break;
}

View File

@ -960,8 +960,8 @@ void blitTile(RECT *psDestRect, RECT *psSrcRect, UDWORD texture)
NULL, &sDDSDSrc, DDLOCK_WAIT, NULL);
if (ddrval != DD_OK)
{
DBERROR(("Lock failed for tile blit:\n%s",
DDErrorToString(ddrval)));
debug( LOG_ERROR, "Lock failed for tile blit:\n%s", DDErrorToString(ddrval) );
abort();
return;
}
@ -972,8 +972,8 @@ void blitTile(RECT *psDestRect, RECT *psSrcRect, UDWORD texture)
NULL, &sDDSDDest, DDLOCK_WAIT, NULL);
if (ddrval != DD_OK)
{
DBERROR(("Lock failed for tile blit:\n%s",
DDErrorToString(ddrval)));
debug( LOG_ERROR, "Lock failed for tile blit:\n%s", DDErrorToString(ddrval) );
abort();
return;
}
@ -1130,21 +1130,22 @@ void blitTile(RECT *psDestRect, RECT *psSrcRect, UDWORD texture)
case 32:
break;
default:
DBERROR(("blitTile: Unknown pixel format"));
debug( LOG_ERROR, "blitTile: Unknown pixel format" );
abort();
}
ddrval = psBack->lpVtbl->Unlock(psBack, NULL);
if (ddrval != DD_OK)
{
DBERROR(("Unlock failed for tileBlit:\n%s",
DDErrorToString(ddrval)));
debug( LOG_ERROR, "Unlock failed for tileBlit:\n%s", DDErrorToString(ddrval) );
abort();
}
ddrval = psVidTiles->lpVtbl->Unlock(psTiles, NULL);
if (ddrval != DD_OK)
{
DBERROR(("Unlock failed for tileBlit:\n%s",
DDErrorToString(ddrval)));
debug( LOG_ERROR, "Unlock failed for tileBlit:\n%s", DDErrorToString(ddrval) );
abort();
}
}

View File

@ -790,7 +790,7 @@ void CheckStartWallDrag(void)
wallDrag.x1 = wallDrag.x2 = mouseTileX;
wallDrag.y1 = wallDrag.y2 = mouseTileY;
wallDrag.status = DRAG_PLACING;
DBPRINTF(("Start Wall Drag\n"));
debug( LOG_NEVER, "Start Wall Drag\n" );
}
}
else if (intBuildSelectMode())//if we were in build select mode
@ -837,7 +837,7 @@ BOOL CheckFinishedFindPosition(void)
wallDrag.status = DRAG_RELEASED;
}
DBPRINTF(("BUILD3D_FINISHED\n"));
debug( LOG_NEVER, "BUILD3D_FINISHED\n" );
buildState = BUILD3D_FINISHED;
return TRUE;
} else {

View File

@ -4733,7 +4733,8 @@ SDWORD shift;
break;
default:
DBERROR(("Weirdy direction for a structure in renderWall"));
debug( LOG_ERROR, "Weirdy direction for a structure in renderWall" );
abort();
break;
}
/*

View File

@ -114,7 +114,7 @@ void driveInitVars(BOOL Restart)
{
if(WasDriving && !Restart)
{
DBPRINTF(("driveInitVars: WasDriving\n"));
debug( LOG_NEVER, "driveInitVars: WasDriving\n" );
DrivingAudioTrack=-1;
psDrivenDroid = NULL;
DoFollowRangeCheck = TRUE;
@ -127,7 +127,7 @@ void driveInitVars(BOOL Restart)
TargetFeatures = FALSE;
} else {
DBPRINTF(("driveInitVars: Driving\n"));
debug( LOG_NEVER, "driveInitVars: Driving\n" );
DrivingAudioTrack=-1;
psDrivenDroid = NULL;
DoFollowRangeCheck = TRUE;
@ -193,7 +193,7 @@ BOOL StartDriverMode(DROID *psOldDroid)
// psDroid->sMove.Status = MOVEDRIVE;
}
psDrivenDroid = psDroid;
DBPRINTF(("New driven droid\n"));
debug( LOG_NEVER, "New driven droid\n" );
} else if(psDroid != psDrivenDroid) {
// All the others become followers of the driven droid.
// psDroid->sMove.Status = MOVEDRIVEFOLLOW;
@ -232,14 +232,14 @@ BOOL StartDriverMode(DROID *psOldDroid)
setDrivingStatus(TRUE);
if(DriveInterfaceEnabled) {
DBPRINTF(("Interface enabled1 ! Disabling drive control\n"));
debug( LOG_NEVER, "Interface enabled1 ! Disabling drive control\n" );
DriveControlEnabled = FALSE;
} else {
DriveControlEnabled = TRUE;
}
if(psLastDriven != psDrivenDroid) {
DBPRINTF(("camAllignWithTarget\n"));
debug( LOG_NEVER, "camAllignWithTarget\n" );
camAllignWithTarget((BASE_OBJECT*)psDrivenDroid);
}
@ -264,7 +264,7 @@ void ChangeDriver(void)
DROID *psDroid;
if(psDrivenDroid != NULL) {
DBPRINTF(("Driver Changed\n"));
debug( LOG_NEVER, "Driver Changed\n" );
// audio_StopObjTrack(psDrivenDroid,ID_SOUND_SMALL_DROID_RUN);
@ -294,7 +294,7 @@ void StopDriverMode(void)
DROID *psDroid;
if(psDrivenDroid != NULL) {
DBPRINTF(("Drive mode canceled\n"));
debug( LOG_NEVER, "Drive mode canceled\n" );
// audio_StopObjTrack(psDrivenDroid,ID_SOUND_SMALL_DROID_RUN);
@ -882,7 +882,7 @@ void driveEnableTactical(void)
StartTacticalScroll(TRUE);
TacticalActive = TRUE;
DBPRINTF(("Tactical Mode Activated\n"));
debug( LOG_NEVER, "Tactical Mode Activated\n" );
}
@ -897,7 +897,7 @@ void driveDisableTactical(void)
// SetMouseRange(0,16,16,639-16,479-16);
// SetMousePos(0,320,160);
TacticalActive = FALSE;
DBPRINTF(("Tactical Mode Canceled\n"));
debug( LOG_NEVER, "Tactical Mode Canceled\n" );
}
}
@ -915,7 +915,7 @@ void driveTacticalSelectionChanged(void)
{
if(TacticalActive && psDrivenDroid) {
StartTacticalScrollObj(TRUE,(BASE_OBJECT *)psDrivenDroid);
DBPRINTF(("driveTacticalSelectionChanged\n"));
debug( LOG_NEVER, "driveTacticalSelectionChanged\n" );
}
}

View File

@ -702,7 +702,7 @@ void removeDroidFX(DROID *psDel)
#if defined(PSX) && defined(LIBPAD)
if(EnableVibration) {
DBPRINTF(("SetVibro1\n"));
debug( LOG_NEVER, "SetVibro1\n" );
SetVibro1(0,100,512);
}
#endif
@ -831,7 +831,7 @@ void destroyDroid(DROID *psDel)
#if defined(PSX) && defined(LIBPAD)
if(EnableVibration) {
DBPRINTF(("SetVibro1\n"));
debug( LOG_NEVER, "SetVibro1\n" );
SetVibro1(0,100,512);
}
#endif
@ -1044,7 +1044,8 @@ void droidBurntCallback( ANIM_OBJECT * psObj )
ID_ANIM_DROIDFLAMEFALL, 0, 1 );
if ( psDroid->psCurAnim == NULL )
{
DBERROR( ("unitBurntCallback: couldn't add fall over anim\n") );
debug( LOG_ERROR, "unitBurntCallback: couldn't add fall over anim\n" );
abort();
return;
}
@ -1060,7 +1061,8 @@ void droidBurn( DROID * psDroid )
if ( psDroid->droidType != DROID_PERSON )
{
DBERROR( ("unitBurn: can't burn anything except babarians currently!\n") );
debug( LOG_ERROR, "unitBurn: can't burn anything except babarians currently!\n" );
abort();
return;
}
@ -1085,7 +1087,8 @@ void droidBurn( DROID * psDroid )
ID_ANIM_DROIDBURN, 0, 3 );
if ( psDroid->psCurAnim == NULL )
{
DBERROR( ("unitBurn: couldn't add burn anim\n") );
debug( LOG_ERROR, "unitBurn: couldn't add burn anim\n" );
abort();
return;
}
@ -1093,7 +1096,7 @@ void droidBurn( DROID * psDroid )
animObj_SetDoneFunc( psDroid->psCurAnim, droidBurntCallback );
/* add scream */
DBPRINTF(("baba burn\n"));
debug( LOG_NEVER, "baba burn\n" );
audio_PlayObjDynamicTrack( psDroid, ID_SOUND_BARB_SCREAM+(rand()%3), NULL );
@ -1795,7 +1798,7 @@ BOOL droidStartBuild(DROID *psDroid)
if (!droidNextToStruct(psDroid, (BASE_OBJECT *)psStruct))
{
/* Nope - stop building */
DBPRINTF(("unitStartBuild: not next to structure\n"));
debug( LOG_NEVER, "unitStartBuild: not next to structure\n" );
}
}
@ -2854,7 +2857,8 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
{
if (!HEAP_ALLOC(psTemplateHeap, (void*) &pDroidDesign))
{
DBERROR(("Out of memory - Droid Templates"));
debug( LOG_ERROR, "Out of memory - Droid Templates" );
abort();
return FALSE;
}
memset(pDroidDesign, 0, sizeof(DROID_TEMPLATE));
@ -2912,7 +2916,8 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
of STORE_RESOURCE_ID or RESOURCE_NAMES! - 25/06/98 AB*/
if (!strresGetIDNum(psStringRes, componentName, &id))
{
DBERROR(("Unable to find string resource for %s", componentName));
debug( LOG_ERROR, "Unable to find string resource for %s", componentName );
abort();
return FALSE;
}
@ -2966,7 +2971,8 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
}
if (!found)
{
DBERROR(("Body component not found for droid %s", getTemplateName(pDroidDesign)));
debug( LOG_ERROR, "Body component not found for droid %s", getTemplateName(pDroidDesign) );
abort();
return FALSE;
}
}
@ -3010,7 +3016,8 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
}
if (!found)
{
DBERROR(("Brain component not found for droid %s", getTemplateName(pDroidDesign)));
debug( LOG_ERROR, "Brain component not found for droid %s", getTemplateName(pDroidDesign) );
abort();
// DBERROR(("Brain component not found for droid %s", pDroidDesign->pName));
return FALSE;
}
@ -3055,7 +3062,8 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
}
if (!found)
{
DBERROR(("Construct component not found for droid %s", getTemplateName(pDroidDesign)));
debug( LOG_ERROR, "Construct component not found for droid %s", getTemplateName(pDroidDesign) );
abort();
return FALSE;
}
}
@ -3099,7 +3107,8 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
}
if (!found)
{
DBERROR(("ECM component not found for droid %s", getTemplateName(pDroidDesign)));
debug( LOG_ERROR, "ECM component not found for droid %s", getTemplateName(pDroidDesign) );
abort();
return FALSE;
}
}
@ -3150,7 +3159,8 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
}
if (!found)
{
DBERROR(("Propulsion component not found for droid %s", getTemplateName(pDroidDesign)));
debug( LOG_ERROR, "Propulsion component not found for droid %s", getTemplateName(pDroidDesign) );
abort();
return FALSE;
}
}
@ -3194,7 +3204,8 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
}
if (!found)
{
DBERROR(("Repair component not found for droid %s", getTemplateName(pDroidDesign)));
debug( LOG_ERROR, "Repair component not found for droid %s", getTemplateName(pDroidDesign) );
abort();
return FALSE;
}
}
@ -3276,10 +3287,11 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
if (!found)
{
#ifdef HASH_NAMES
DBERROR(("Sensor not found for droid Template: %s",strresGetString(NULL,pDroidDesign->NameHash)));
debug( LOG_ERROR, "Sensor not found for droid Template: %s", strresGetString( NULL, pDroidDesign->NameHash ) );
#else
DBERROR(("Sensor not found for droid Template: %s",pDroidDesign->aName));
debug( LOG_ERROR, "Sensor not found for droid Template: %s", pDroidDesign->aName );
#endif
abort();
return FALSE;
}
}
@ -3294,10 +3306,11 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
pDroidDesign->numWeaps > DROID_MAXWEAPS)
{
#ifdef HASH_NAMES
DBERROR(("Too many weapons have been allocated for droid Template: %s (%x)",strresGetString(NULL,pDroidDesign->NameHash),pDroidDesign->NameHash));
debug( LOG_ERROR, "Too many weapons have been allocated for droid Template: %s (%x)", strresGetString( NULL, pDroidDesign->NameHash ), pDroidDesign->NameHash );
#else
DBERROR(("Too many weapons have been allocated for droid Template: %s",pDroidDesign->aName));
debug( LOG_ERROR, "Too many weapons have been allocated for droid Template: %s", pDroidDesign->aName );
#endif
abort();
return FALSE;
}
@ -3345,7 +3358,8 @@ BOOL loadDroidTemplates(char *pDroidData, UDWORD bufferSize)
if ( bDefaultTemplateFound == FALSE )
{
DBERROR( ("loadUnitTemplates: default template not found\n") );
debug( LOG_ERROR, "loadUnitTemplates: default template not found\n" );
abort();
return FALSE;
}
@ -3588,7 +3602,8 @@ BOOL loadDroidWeapons(char *pWeaponData, UDWORD bufferSize)
if ( strcmp(TemplateName, pTemplate->aName) )
#endif
{
DBERROR(("Unable to find Template - %s", TemplateName));
debug( LOG_ERROR, "Unable to find Template - %s", TemplateName );
abort();
return FALSE;
}
}
@ -3597,8 +3612,8 @@ BOOL loadDroidWeapons(char *pWeaponData, UDWORD bufferSize)
//if weapon not found - error
if (incW == -1)
{
DBERROR(("Unable to find Weapon %s for template %s",
WeaponName, TemplateName));
debug( LOG_ERROR, "Unable to find Weapon %s for template %s", WeaponName, TemplateName );
abort();
return FALSE;
}
else
@ -3609,15 +3624,16 @@ BOOL loadDroidWeapons(char *pWeaponData, UDWORD bufferSize)
if (pTemplate->storeCount >
(SDWORD)pTemplate->numWeaps)
{
DBERROR(("Trying to allocate more weapons than allowed for Template - %s",
TemplateName));
debug( LOG_ERROR, "Trying to allocate more weapons than allowed for Template - %s", TemplateName );
abort();
return FALSE;
}
//check valid weapon/propulsion
if (!checkValidWeaponForProp(pTemplate))
{
// ffs
DBERROR(("Weapon is invalid for air propulsion for template %s",pTemplate->aName));
debug( LOG_ERROR, "Weapon is invalid for air propulsion for template %s", pTemplate->aName );
abort();
return FALSE;
}
@ -3637,7 +3653,8 @@ BOOL loadDroidWeapons(char *pWeaponData, UDWORD bufferSize)
if (SkippedWeaponCount > 0)
{
DBERROR(("Illegal player number in %d droid weapons",SkippedWeaponCount));
debug( LOG_ERROR, "Illegal player number in %d droid weapons", SkippedWeaponCount );
abort();
}
@ -4151,7 +4168,7 @@ DROID* buildDroid(DROID_TEMPLATE *pTemplate, UDWORD x, UDWORD y, UDWORD player,
//allocate memory
if (!createDroid(player, &psDroid))
{
DBPRINTF(("unit build: unable to create\n"));
debug( LOG_NEVER, "unit build: unable to create\n" );
ASSERT((FALSE,"Cannot get the memory for the unit"));
return NULL;
}
@ -4213,7 +4230,7 @@ DROID* buildDroid(DROID_TEMPLATE *pTemplate, UDWORD x, UDWORD y, UDWORD player,
{
if (!grpCreate(&psGrp))
{
DBPRINTF(("unit build: unable to create group\n"));
debug( LOG_NEVER, "unit build: unable to create group\n" );
ASSERT((FALSE,"Can't create unit because can't create group"));
HEAP_FREE(psDroidHeap, psDroid);
return NULL;
@ -6370,7 +6387,8 @@ BOOL getDroidResourceName(STRING *pName)
//see if the name has a resource associated with it by trying to get the ID for the string
if (!strresGetIDNum(psStringRes, pName, &id))
{
DBERROR(("Unable to find string resource for %s", pName));
debug( LOG_ERROR, "Unable to find string resource for %s", pName );
abort();
return FALSE;
}
//get the string from the id

View File

@ -439,7 +439,8 @@ BOOL ed2dProcessInput(void)
/* Get the new undo data */
if (!getBox(&sUndoBox, selSX, selSY, sPasteBox.width,sPasteBox.height))
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
break;
}
@ -770,7 +771,8 @@ static BOOL getBox(PASTE_BOX *psBox, UDWORD x, UDWORD y, UDWORD width, UDWORD he
psBox->width * psBox->height);
if (psBox->psTiles == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
@ -821,7 +823,8 @@ static void flipBoxX(PASTE_BOX *psBox)
psNew = (MAPTILE *)MALLOC(sizeof(MAPTILE) * psBox->width * psBox->height);
if (psNew == NULL)
{
DBERROR(("Out of memory, couldn't do flip\n"));
debug( LOG_ERROR, "Out of memory, couldn't do flip\n" );
abort();
return;
}
@ -870,7 +873,8 @@ static void flipBoxY(PASTE_BOX *psBox)
psNew = (MAPTILE *)MALLOC(sizeof(MAPTILE) * psBox->width * psBox->height);
if (psNew == NULL)
{
DBERROR(("Out of memory, couldn't do flip\n"));
debug( LOG_ERROR, "Out of memory, couldn't do flip\n" );
abort();
return;
}
@ -921,7 +925,8 @@ static void rotBox(PASTE_BOX *psBox)
psNew = (MAPTILE *)MALLOC(sizeof(MAPTILE) * psBox->width * psBox->height);
if (psNew == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return;
}

View File

@ -666,7 +666,8 @@ void updateEffect(EFFECT *psEffect)
if(!gamePaused()) updateFirework(psEffect);
break;
default:
DBERROR(("Weirdy class of effect passed to updateEffect"));
debug( LOG_ERROR, "Weirdy class of effect passed to updateEffect" );
abort();
break;
}
}
@ -1626,7 +1627,8 @@ void renderEffect(EFFECT *psEffect)
renderFirework(psEffect);
break;
default:
DBERROR(("Weirdy class of effect passed to renderEffect"));
debug( LOG_ERROR, "Weirdy class of effect passed to renderEffect" );
abort();
break;
}
}
@ -2929,7 +2931,8 @@ iIMDShape *psOrig;
if(!pFileData)
{
/* Nope, so do one */
DBERROR(("Saving FX data : Cannot get the memory! (%d)",fileSize));
debug( LOG_ERROR, "Saving FX data : Cannot get the memory! (%d)", fileSize );
abort();
return(FALSE);
}
@ -3021,7 +3024,8 @@ EFFECT *pFXData;
if(fileSize!=expectedFileSize)
{
/* No, so bomb out */
DBERROR(("Read FX data : Weird file size!"));
debug( LOG_ERROR, "Read FX data : Weird file size!" );
abort();
return(FALSE);
}

View File

@ -70,7 +70,8 @@ BOOL environInit( void )
pEnvironData = MALLOC(sizeof(struct environ_data) * MAP_MAXWIDTH * MAP_MAXHEIGHT);
if(!pEnvironData)
{
DBERROR(("Can't get memory for the environment data"));
debug( LOG_ERROR, "Can't get memory for the environment data" );
abort();
return FALSE;
}
return TRUE;
@ -192,7 +193,8 @@ FRACT fraction;
increment = ((MAKEFRACT(ENVIRON_LAND_SPEED)*pEnvironData[index].vec) * fraction);
break;
default:
DBERROR(("Weird environment type found"));
debug( LOG_ERROR, "Weird environment type found" );
abort();
break;
}

View File

@ -155,7 +155,8 @@ BOOL loadFeatureStats(char *pFeatureData, UDWORD bufferSize)
if (asFeatureStats == NULL)
{
DBERROR(("Feature Stats - Out of memory"));
debug( LOG_ERROR, "Feature Stats - Out of memory" );
abort();
return FALSE;
}
@ -220,10 +221,11 @@ BOOL loadFeatureStats(char *pFeatureData, UDWORD bufferSize)
if (psFeature->psImd == NULL)
{
#ifdef HASH_NAMES
DBERROR(("Cannot find the feature PIE for record %s", strresGetString(NULL,psFeature->NameHash)));
debug( LOG_ERROR, "Cannot find the feature PIE for record %s", strresGetString( NULL, psFeature->NameHash ) );
#else
DBERROR(("Cannot find the feature PIE for record %s", getName(psFeature->pName)));
debug( LOG_ERROR, "Cannot find the feature PIE for record %s", getName( psFeature->pName ) );
#endif
abort();
return FALSE;
}
@ -749,7 +751,7 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,BOOL FromSave)
if ((psStats->subType == FEAT_OIL_RESOURCE) &&
!gwZoneReachable(gwGetZone(startX,startY)))
{
DBPRINTF(("Oil resource at (%d,%d) is unreachable", startX,startY));
debug( LOG_NEVER, "Oil resource at (%d,%d) is unreachable", startX, startY );
}
if(FromSave == TRUE) {

View File

@ -73,7 +73,7 @@ void formationShutDown(void)
while (psFormationList)
{
DBPRINTF(("formation with %d units still attached\n",psFormationList->refCount));
debug( LOG_NEVER, "formation with %d units still attached\n", psFormationList->refCount );
psNext = psFormationList->psNext;
HEAP_FREE(psFHeap, psFormationList);
psFormationList = psNext;

View File

@ -18,7 +18,7 @@ BOOL fpathDoMessage;
#undef DBP2
#define DBP2( x ) \
if (fpathDoMessage) \
DBPRINTF( x )
debug( LOG_NEVER, x )
#include "objects.h"
#include "map.h"

View File

@ -334,7 +334,8 @@ VOID changeTitleMode(tMode mode)
break;
default:
DBERROR(("Unknown title mode requested"));
debug( LOG_ERROR, "Unknown title mode requested" );
abort();
break;
}
@ -1573,7 +1574,7 @@ VOID addText(int FontID,UDWORD FormID,UDWORD id, UDWORD PosX, UDWORD PosY, STRI
{
W_LABINIT sLabInit;
DBPRINTF(("addText : %s\n",txt));
debug( LOG_NEVER, "addText : %s\n", txt );
memset(&sLabInit, 0, sizeof(W_LABINIT));
sLabInit.formID = FormID;

View File

@ -98,7 +98,8 @@ BOOL loadFunctionStats(char *pFunctionData, UDWORD bufferSize)
asFunctions = (FUNCTION**) MALLOC(totalFunctions*sizeof(FUNCTION*));
if (!asFunctions)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
pStartList = asFunctions;
@ -284,7 +285,8 @@ BOOL storeName(FUNCTION* pFunction, STRING* pNameToStore)
pFunction->pName = (STRING *)MALLOC(strlen(pNameToStore)+1);
if (pFunction->pName == NULL)
{
DBERROR(("Function Name - Out of memory"));
debug( LOG_ERROR, "Function Name - Out of memory" );
abort();
return FALSE;
}
strcpy(pFunction->pName,pNameToStore);
@ -351,7 +353,8 @@ BOOL loadProduction(char *pData)
psFunction = (PRODUCTION_FUNCTION *)MALLOC(sizeof(PRODUCTION_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Production Function - Out of memory"));
debug( LOG_ERROR, "Production Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(PRODUCTION_FUNCTION));
@ -446,7 +449,8 @@ BOOL loadProductionUpgradeFunction(char *pData)
(PRODUCTION_UPGRADE_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Production Upgrade Function - Out of memory"));
debug( LOG_ERROR, "Production Upgrade Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(PRODUCTION_UPGRADE_FUNCTION));
@ -510,7 +514,8 @@ BOOL loadResearchFunction(char *pData)
psFunction = (RESEARCH_FUNCTION *)MALLOC(sizeof(RESEARCH_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Research Function - Out of memory"));
debug( LOG_ERROR, "Research Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(RESEARCH_FUNCTION));
@ -543,7 +548,8 @@ BOOL loadReArmFunction(char *pData)
psFunction = (REARM_FUNCTION *)MALLOC(sizeof(REARM_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("ReArm Function - Out of memory"));
debug( LOG_ERROR, "ReArm Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(REARM_FUNCTION));
@ -649,7 +655,8 @@ BOOL loadUpgradeFunction(char *pData, UBYTE type)
psFunction = (UPGRADE_FUNCTION *)MALLOC(sizeof(UPGRADE_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Upgrade Function - Out of memory"));
debug( LOG_ERROR, "Upgrade Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(UPGRADE_FUNCTION));
@ -694,7 +701,8 @@ BOOL loadDroidBodyUpgradeFunction(char *pData)
sizeof(DROIDBODY_UPGRADE_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("UnitBody Upgrade Function - Out of memory"));
debug( LOG_ERROR, "UnitBody Upgrade Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(DROIDBODY_UPGRADE_FUNCTION));
@ -760,7 +768,8 @@ BOOL loadDroidSensorUpgradeFunction(char *pData)
sizeof(DROIDSENSOR_UPGRADE_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("UnitSensor Upgrade Function - Out of memory"));
debug( LOG_ERROR, "UnitSensor Upgrade Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(DROIDSENSOR_UPGRADE_FUNCTION));
@ -808,7 +817,8 @@ BOOL loadWeaponUpgradeFunction(char *pData)
(WEAPON_UPGRADE_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Weapon Upgrade Function - Out of memory"));
debug( LOG_ERROR, "Weapon Upgrade Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(WEAPON_UPGRADE_FUNCTION));
@ -847,7 +857,8 @@ BOOL loadWeaponUpgradeFunction(char *pData)
incenDamage > UWORD_MAX OR
radiusHit > UWORD_MAX)
{
DBERROR(("A percentage increase for Weapon Upgrade function is too large"));
debug( LOG_ERROR, "A percentage increase for Weapon Upgrade function is too large" );
abort();
return FALSE;
}
@ -877,7 +888,8 @@ BOOL loadStructureUpgradeFunction(char *pData)
(STRUCTURE_UPGRADE_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Structure Upgrade Function - Out of memory"));
debug( LOG_ERROR, "Structure Upgrade Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(STRUCTURE_UPGRADE_FUNCTION));
@ -903,7 +915,8 @@ BOOL loadStructureUpgradeFunction(char *pData)
body > UWORD_MAX OR
resistance > UWORD_MAX)
{
DBERROR(("A percentage increase for Structure Upgrade function is too large"));
debug( LOG_ERROR, "A percentage increase for Structure Upgrade function is too large" );
abort();
return FALSE;
}
@ -926,7 +939,8 @@ BOOL loadWallDefenceUpgradeFunction(char *pData)
(WALLDEFENCE_UPGRADE_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("WallDefence Upgrade Function - Out of memory"));
debug( LOG_ERROR, "WallDefence Upgrade Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(WALLDEFENCE_UPGRADE_FUNCTION));
@ -951,7 +965,8 @@ BOOL loadWallDefenceUpgradeFunction(char *pData)
if (armour > UWORD_MAX OR
body > UWORD_MAX)
{
DBERROR(("A percentage increase for WallDefence Upgrade function is too large"));
debug( LOG_ERROR, "A percentage increase for WallDefence Upgrade function is too large" );
abort();
return FALSE;
}
@ -1042,7 +1057,8 @@ BOOL loadPowerGenFunction(char *pData)
(POWER_GEN_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Power Gen Function - Out of memory"));
debug( LOG_ERROR, "Power Gen Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(POWER_GEN_FUNCTION));
@ -1086,7 +1102,8 @@ BOOL loadResourceFunction(char *pData)
(RESOURCE_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Resource Function - Out of memory"));
debug( LOG_ERROR, "Resource Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(RESOURCE_FUNCTION));
@ -1188,7 +1205,8 @@ BOOL loadRepairDroidFunction(char *pData)
(REPAIR_DROID_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Repair Droid Function - Out of memory"));
debug( LOG_ERROR, "Repair Droid Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(REPAIR_DROID_FUNCTION));
@ -1514,7 +1532,8 @@ BOOL loadWallFunction(char *pData)
psFunction = (WALL_FUNCTION *)MALLOC(sizeof(WALL_FUNCTION));
if (psFunction == NULL)
{
DBERROR(("Wall Function - Out of memory"));
debug( LOG_ERROR, "Wall Function - Out of memory" );
abort();
return FALSE;
}
memset(psFunction, 0, sizeof(WALL_FUNCTION));
@ -1550,7 +1569,8 @@ BOOL loadWallFunction(char *pData)
#else
if (!allocateName(&psFunction->pStructName, structureName))
{
DBERROR(("Structure Stats Invalid for function - %s", functionName));
debug( LOG_ERROR, "Structure Stats Invalid for function - %s", functionName );
abort();
return FALSE;
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -163,7 +163,8 @@ BOOL gwNewGateway(SDWORD x1, SDWORD y1, SDWORD x2, SDWORD y2)
psNew = MALLOC(sizeof(GATEWAY));
if (!psNew)
{
DBERROR(("gwNewGateway: out of memory"));
debug( LOG_ERROR, "gwNewGateway: out of memory" );
abort();
return FALSE;
}
@ -234,7 +235,8 @@ BOOL gwNewLinkGateway(SDWORD x, SDWORD y)
psNew = MALLOC(sizeof(GATEWAY));
if (!psNew)
{
DBERROR(("gwNewGateway: out of memory"));
debug( LOG_ERROR, "gwNewGateway: out of memory" );
abort();
return FALSE;
}
@ -421,8 +423,7 @@ void gwCheckZoneSizes(void)
if (inzone > FPATH_NODEINIT)
{
DBPRINTF(("gwCheckZoneSizes: warning zone %d at (%d,%d) is too large %d tiles (max %d)\n",
zone, cx,cy, inzone, FPATH_NODEINIT));
debug( LOG_ERROR, "gwCheckZoneSizes: warning zone %d at (%d,%d) is too large %d tiles (max %d)\n", zone, cx, cy, inzone, FPATH_NODEINIT );
}
}
}
@ -437,7 +438,7 @@ BOOL gwGenerateLinkGates(void)
ASSERT((apEquivZones != NULL,
"gwGenerateLinkGates: no zone equivalence table"));
DBPRINTF(("Generating water link Gateways...."));
debug( LOG_ERROR, "Generating water link Gateways...." );
for(zone=1; zone<gwNumZones; zone += 1)
{
@ -458,7 +459,7 @@ BOOL gwGenerateLinkGates(void)
}
}
DBPRINTF(("Done\n"));
debug( LOG_ERROR, "Done\n" );
return TRUE;
}
@ -621,10 +622,7 @@ SDWORD gwRouteLength(GATEWAY *psStart, GATEWAY *psEnd)
if (ret == ASR_NEAREST)
{
zone = (psStart->zone1 == psEnd->zone1) || (psStart->zone1 == psEnd->zone2) ? psStart->zone1 : psStart->zone2;
DBPRINTF(("gwRouteLength: warning only partial route between gateways at %s(%d,%d) and %s(%d,%d) zone %d\n",
psStart->flags & GWR_WATERLINK ? "W" : "", sx,sy,
psStart->flags & GWR_WATERLINK ? "W" : "", ex,ey,
zone));
debug( LOG_ERROR, "gwRouteLength: warning only partial route between gateways at %s(%d,%d) and %s(%d,%d) zone %d\n", psStart->flags & GWR_WATERLINK ? "W" : "", sx,sy, psStart->flags & GWR_WATERLINK ? "W" : "", ex, ey, zone );
}
#endif
@ -710,7 +708,8 @@ BOOL gwLinkGateways(void)
aZoneReachable = MALLOC( sizeof(UBYTE) * gwNumZones );
if (aZoneReachable == NULL)
{
DBERROR(("gwLinkGateways: out of memory"));
debug( LOG_ERROR, "gwLinkGateways: out of memory" );
abort();
return FALSE;
}
memset(aZoneReachable, 0, sizeof(UBYTE) * gwNumZones);
@ -799,7 +798,8 @@ BOOL gwLinkGateways(void)
psCurr->psLinks = MALLOC(sizeof(GATEWAY_LINK) * (zone1Links+zone2Links));
if (psCurr->psLinks == NULL)
{
DBERROR(("gwLinkGateways: out of memory"));
debug( LOG_ERROR, "gwLinkGateways: out of memory" );
abort();
return FALSE;
}
}
@ -917,7 +917,8 @@ BOOL gwNewZoneMap(void)
apRLEZones = MALLOC(sizeof(UBYTE *) * gwMapHeight());
if (apRLEZones == NULL)
{
DBERROR(("gwNewZoneMap: Out of memory"));
debug( LOG_ERROR, "gwNewZoneMap: Out of memory" );
abort();
return FALSE;
}
@ -943,7 +944,8 @@ UBYTE * gwNewZoneLine(UDWORD Line,UDWORD Size)
apRLEZones[Line] = MALLOC(Size);
if (apRLEZones[Line] == NULL)
{
DBERROR(("gwNewZoneLine: Out of memory"));
debug( LOG_ERROR, "gwNewZoneLine: Out of memory" );
abort();
return NULL;
}
@ -1037,7 +1039,8 @@ BOOL gwNewEquivTable(SDWORD numZones)
aNumEquiv = MALLOC(sizeof(UBYTE) * numZones);
if (aNumEquiv == NULL)
{
DBERROR(("gwNewEquivTable: out of memory"));
debug( LOG_ERROR, "gwNewEquivTable: out of memory" );
abort();
return FALSE;
}
for(i=0; i<numZones; i+=1)
@ -1048,7 +1051,8 @@ BOOL gwNewEquivTable(SDWORD numZones)
apEquivZones = MALLOC(sizeof(UBYTE *) * numZones);
if (apEquivZones == NULL)
{
DBERROR(("gwNewEquivTable: out of memory"));
debug( LOG_ERROR, "gwNewEquivTable: out of memory" );
abort();
return FALSE;
}
for(i=0; i<numZones; i+=1)
@ -1098,7 +1102,8 @@ BOOL gwSetZoneEquiv(SDWORD zone, SDWORD numEquiv, UBYTE *pEquiv)
apEquivZones[zone] = MALLOC(sizeof(UBYTE) * numEquiv);
if (apEquivZones[zone] == NULL)
{
DBERROR(("gwSetZoneEquiv: out of memory"));
debug( LOG_ERROR, "gwSetZoneEquiv: out of memory" );
abort();
return FALSE;
}

View File

@ -14,7 +14,7 @@ BOOL gwrDoMessage;
#undef DBP0
#define DBP0( x ) \
if (gwrDoMessage) \
DBPRINTF( x )
debug( LOG_ERROR, x )
#include "map.h"

View File

@ -279,7 +279,8 @@ BOOL gwProcessMap(void)
// check the zones havn't overflowed
if (currZone > UBYTE_MAX)
{
DBERROR(("gwProcessMap: too many zones\n"));
debug( LOG_ERROR, "gwProcessMap: too many zones\n" );
abort();
return FALSE;
}
@ -328,7 +329,8 @@ BOOL gwProcessMap(void)
// check the zones havn't overflowed
if (currZone > UBYTE_MAX)
{
DBERROR(("gwProcessMap: too many zones\n"));
debug( LOG_ERROR, "gwProcessMap: too many zones\n" );
abort();
return FALSE;
}
@ -343,7 +345,8 @@ BOOL gwProcessMap(void)
// check the zones havn't overflowed
if (currZone > UBYTE_MAX)
{
DBERROR(("gwProcessMap: too many zones\n"));
debug( LOG_ERROR, "gwProcessMap: too many zones\n" );
abort();
return FALSE;
}
@ -505,7 +508,8 @@ BOOL gwCreateBlankZoneMap(void)
apRLEZones = MALLOC(sizeof(UBYTE *) * gwMapHeight());
if (apRLEZones == NULL)
{
DBERROR(("gwCreateBlankZoneMap: Out of memory"));
debug( LOG_ERROR, "gwCreateBlankZoneMap: Out of memory" );
abort();
return FALSE;
}
for(i=0; i< gwMapHeight(); i++)
@ -515,7 +519,8 @@ BOOL gwCreateBlankZoneMap(void)
if (apRLEZones[i] == NULL)
{
DBERROR(("gwCreateBlankZoneMap: Out of memory"));
debug( LOG_ERROR, "gwCreateBlankZoneMap: Out of memory" );
abort();
return FALSE;
}
}

View File

@ -452,7 +452,8 @@ UDWORD retVal;
/* Check it has a structure - cannot have owner otherwise */
if(!TILE_HAS_STRUCTURE(mapTile(x,y)))
{
DBERROR(("Asking for the owner of a tile with no structure on it!!!"));
debug( LOG_ERROR, "Asking for the owner of a tile with no structure on it!!!" );
abort();
}
else
{

View File

@ -666,7 +666,8 @@ BOOL intInitialise(void)
MAXSTRUCTURES);
if (!apsStructStatsList)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
@ -674,7 +675,8 @@ BOOL intInitialise(void)
ppResearchList = (RESEARCH **) MALLOC(sizeof(RESEARCH *) * MAXRESEARCH);
if (ppResearchList == NULL)
{
DBERROR(("Unable to allocate memory for research list"));
debug( LOG_ERROR, "Unable to allocate memory for research list" );
abort();
return FALSE;
}
@ -687,12 +689,14 @@ BOOL intInitialise(void)
if (pList == NULL)
{
DBERROR(("Unable to allocate memory for research list"));
debug( LOG_ERROR, "Unable to allocate memory for research list" );
abort();
return FALSE;
}
if (pSList == NULL)
{
DBERROR(("Unable to allocate memory for sorted research list"));
debug( LOG_ERROR, "Unable to allocate memory for sorted research list" );
abort();
return FALSE;
}
@ -701,7 +705,8 @@ BOOL intInitialise(void)
MAXTEMPLATES);
if (apsTemplateList == NULL)
{
DBERROR(("Unable to allocate memory for template list"));
debug( LOG_ERROR, "Unable to allocate memory for template list" );
abort();
return FALSE;
}
@ -723,7 +728,8 @@ BOOL intInitialise(void)
MAXFEATURES);
if (apsFeatureList == NULL)
{
DBERROR(("Unable to allocate memory for feature list"));
debug( LOG_ERROR, "Unable to allocate memory for feature list" );
abort();
return FALSE;
}
@ -732,7 +738,8 @@ BOOL intInitialise(void)
MAXCOMPONENT);
if (apsComponentList == NULL)
{
DBERROR(("Unable to allocate memory for component list"));
debug( LOG_ERROR, "Unable to allocate memory for component list" );
abort();
return FALSE;
}
@ -741,7 +748,8 @@ BOOL intInitialise(void)
MAXEXTRASYS);
if (apsExtraSysList == NULL)
{
DBERROR(("Unable to allocate memory for extra systems list"));
debug( LOG_ERROR, "Unable to allocate memory for extra systems list" );
abort();
return FALSE;
}
@ -749,7 +757,8 @@ BOOL intInitialise(void)
apsObjectList = (BASE_OBJECT **)MALLOC(sizeof(BASE_OBJECT *) * MAX_OBJECTS);
if (!apsObjectList)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
@ -757,7 +766,8 @@ BOOL intInitialise(void)
apsListToOrder = (BASE_OBJECT **)MALLOC(sizeof(BASE_OBJECT *) * ORDERED_LIST_SIZE);
if (!apsListToOrder)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
@ -796,7 +806,8 @@ BOOL intInitialise(void)
if (!widgCreateScreen(&psWScreen))
{
DBERROR(("intInitialise: Couldn't create widget screen (Out of memory ?)"));
debug( LOG_ERROR, "intInitialise: Couldn't create widget screen (Out of memory ?)" );
abort();
return FALSE;
}
@ -806,13 +817,15 @@ BOOL intInitialise(void)
if (!intAddReticule())
{
DBERROR(("intInitialise: Couldn't create reticule widgets (Out of memory ?)"));
debug( LOG_ERROR, "intInitialise: Couldn't create reticule widgets (Out of memory ?)" );
abort();
return FALSE;
}
if (!intAddPower())
{
DBERROR(("intInitialise: Couldn't create power Bar widget(Out of memory ?)"));
debug( LOG_ERROR, "intInitialise: Couldn't create power Bar widget(Out of memory ?)" );
abort();
return FALSE;
}
}
@ -843,7 +856,8 @@ BOOL intInitialise(void)
/*Initialise the video playback buffer*/
if (!seq_SetupVideoBuffers())
{
DBERROR(("intInitialise: Unable to initialise video playback buffer"));
debug( LOG_ERROR, "intInitialise: Unable to initialise video playback buffer" );
abort();
return FALSE;
}
@ -1448,7 +1462,7 @@ INT_RETVAL intRunWidgets(void)
{
if(strlen(sRequestResult))
{
DBPRINTF(("Returned %s",sRequestResult));
debug( LOG_ERROR, "Returned %s", sRequestResult );
if(bRequestLoad)
{
// loadGame(sRequestResult,TRUE,FALSE,TRUE);
@ -1951,7 +1965,7 @@ INT_RETVAL intRunWidgets(void)
(intMode != INT_MISSIONRES) AND !getDebugMappingStatus())
{
DBPRINTF(("PlayerHasLost Or Won\n"));
debug( LOG_ERROR, "PlayerHasLost Or Won\n" );
intResetScreen(TRUE);
retCode = INT_QUIT;
quitting = TRUE;
@ -5134,7 +5148,7 @@ static BOOL _intAddObjectWindow(BASE_OBJECT *psObjects, BASE_OBJECT *psSelected,
if (sBFormInit.id > IDOBJ_OBJEND)
{
//can't fit any more on the screen!
DBMB(("This is just a Warning!\n Max buttons have been allocated"));
debug( LOG_NEVER, "This is just a Warning!\n Max buttons have been allocated" );
break;
}
} else {
@ -5204,7 +5218,7 @@ static BOOL _intAddObjectWindow(BASE_OBJECT *psObjects, BASE_OBJECT *psSelected,
// if ((objMode==IOBJ_RESEARCH) && bInTutorial)
if (bInTutorial)
{
DBPRINTF(("Go with object open callback!\n"));
debug( LOG_NEVER, "Go with object open callback!\n" );
eventFireCallbackTrigger((TRIGGER_TYPE)CALL_OBJECTOPEN);
}
@ -5270,7 +5284,7 @@ void intRemoveObject(void)
if (bInTutorial)
{
DBPRINTF(("Go with object close callback!\n"));
debug( LOG_NEVER, "Go with object close callback!\n" );
eventFireCallbackTrigger((TRIGGER_TYPE)CALL_OBJECTCLOSE);
}
@ -6071,7 +6085,7 @@ static BOOL _intAddStats(BASE_STATS **ppsStatsList, UDWORD numStats,
if (sBFormInit.id > IDSTAT_END)
{
//can't fit any more on the screen!
DBMB(("This is just a Warning!\n Max buttons have been allocated"));
debug( LOG_NEVER, "This is just a Warning!\n Max buttons have been allocated" );
break;
}
@ -7914,7 +7928,7 @@ BOOL intSelectDroidsInDroidCluster(DROID *psCurDroid)
}
// intRefreshScreen();
DBPRINTF(("Selected %d droids\n",NumSelected));
debug( LOG_NEVER, "Selected %d droids\n", NumSelected );
return TRUE;
}
@ -8284,7 +8298,7 @@ void orderDroids(void)
SDWORD i,j;
BASE_OBJECT *psTemp;
DBPRINTF(("orderUnit\n"));
debug( LOG_NEVER, "orderUnit\n" );
// bubble sort on the ID - first built will always be first in the list
for(i=0; i<MAX_OBJECTS; i++)

View File

@ -1017,7 +1017,8 @@ BOOL systemInitialise(void)
DisplayBuffer = MALLOC(displayBufferSize);
if (DisplayBuffer == NULL)
{
DBERROR(("Unable to allocate memory for display buffer"));
debug( LOG_ERROR, "Unable to allocate memory for display buffer" );
abort();
return FALSE;
}
@ -1172,7 +1173,8 @@ init_ObjectDead( void * psObj )
break;
default:
DBERROR( ("init_ObjectAnimRemoved: unrecognised object type") );
debug( LOG_ERROR, "init_ObjectAnimRemoved: unrecognised object type" );
abort();
}
}
@ -1616,7 +1618,8 @@ BOOL stageTwoInitialise(void)
if(!initMiscImds()) /* Set up the explosions */
{
iV_ShutDown();
DBERROR(("Can't find all the explosions PCX's"));
debug( LOG_ERROR, "Can't find all the explosions PCX's" );
abort();
return FALSE;
}

View File

@ -1018,7 +1018,7 @@ void StartMessageSequences(MESSAGE *psMessage, BOOL Start)
// sprintf(String,"seqadded %d of %d [%s]\n",Sequence,psViewReplay->numSeq,psViewReplay->pSeqList[Sequence].sequenceName);
// prnt(1,String,0,0);
// }
DBPRINTF(("sequence=%d\n",Sequence));
debug( LOG_NEVER, "sequence=%d\n", Sequence );
addVideoText(&psViewReplay->pSeqList[Sequence],Sequence);
}
//play first full screen video
@ -1667,7 +1667,7 @@ void addVideoText(SEQ_DISPLAY *psSeqDisplay, UDWORD sequence)
if (psSeqDisplay->numText > 0)
{
DBPRINTF(("avt seq=%d [%s]\n",sequence,psSeqDisplay->ppTextMsg[0]));
debug( LOG_NEVER, "avt seq=%d [%s]\n", sequence, psSeqDisplay->ppTextMsg[0] );
//add each message, first at the top
x = VIDEO_TEXT_TOP_X;
y = VIDEO_TEXT_TOP_Y;

View File

@ -539,7 +539,8 @@ BOOL saveKeyMap(void)
count++);
if(keyMapSaveTable[count] == NULL)
{
DBERROR(("can't find keymapped function in the keymap save table!!"));
debug( LOG_ERROR, "can't find keymapped function in the keymap save table!!" );
abort();
}
WRITE(&count, sizeof(count));
}

View File

@ -749,7 +749,8 @@ BOOL bKeyProcessed;
break;
default:
DBERROR(("Weirdy action on keymap processing"));
debug( LOG_ERROR, "Weirdy action on keymap processing" );
abort();
break;
}
}

View File

@ -128,7 +128,8 @@ int lev_wrap(void)
{
if (inComment)
{
DBERROR(("Warning: reched end of file in a comment"));
debug( LOG_ERROR, "Warning: reched end of file in a comment" );
abort();
}
return 1;
}

View File

@ -577,7 +577,8 @@ BOOL levLoadBaseData(STRING *pName)
// find the level dataset
if (!levFindDataSet(pName, &psNewLevel))
{
DBERROR(("levLoadBaseData: couldn't find level data"));
debug( LOG_ERROR, "levLoadBaseData: couldn't find level data" );
abort();
return FALSE;
}
@ -589,7 +590,8 @@ BOOL levLoadBaseData(STRING *pName)
psNewLevel->type != LDS_MKEEP_LIMBO
)
{
DBERROR(("levLoadBaseData: incorect level type"));
debug( LOG_ERROR, "levLoadBaseData: incorect level type" );
abort();
return FALSE;
}
@ -652,7 +654,7 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
// find the level dataset
if (!levFindDataSet(pName, &psNewLevel))
{
DBMB(("levLoadData: dataset %s not found - trying to load as WRF", pName));
debug( LOG_NEVER, "levLoadData: dataset %s not found - trying to load as WRF", pName );
return levLoadSingleWRF(pName);
}
@ -704,14 +706,14 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
#ifdef DEBUG_GROUP0
if (psNewLevel->psBaseData != NULL)
{
DBP0(("levLoadData: Setting base dataset to load: %s\n", psNewLevel->psBaseData->pName));
debug( LOG_NEVER, "levLoadData: Setting base dataset to load: %s\n", psNewLevel->psBaseData->pName );
}
#endif
psBaseData = psNewLevel->psBaseData;
}
else
{
DBP0(("levLoadData: No base dataset to load\n"));
debug( LOG_NEVER, "levLoadData: No base dataset to load\n" );
psBaseData = NULL;
}
}
@ -721,7 +723,7 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
// reset the old mission data if necessary
if (psCurrLevel != NULL)
{
DBP0(("levLoadData: reseting old mission data\n"));
debug( LOG_NEVER, "levLoadData: reseting old mission data\n" );
if (!gameReset())
{
return FALSE;
@ -744,14 +746,14 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
// basic game data is loaded in the game heap
DBP0(("levLoadData: Setting game heap\n"));
debug( LOG_NEVER, "levLoadData: Setting game heap\n" );
memSetBlockHeap(psGameHeap);
// initialise if necessary
if (psNewLevel->type == LDS_COMPLETE || //psNewLevel->type >= MULTI_TYPE_START ||
psBaseData != NULL)
{
DBP0(("levLoadData: reset game heap\n"));
debug( LOG_NEVER, "levLoadData: reset game heap\n" );
BLOCK_RESET(psGameHeap);
if (!stageOneInitialise())
{
@ -762,7 +764,7 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
// load up a base dataset if necessary
if (psBaseData != NULL)
{
DBP0(("levLoadData: loading base dataset %s\n", psBaseData->pName));
debug( LOG_NEVER, "levLoadData: loading base dataset %s\n", psBaseData->pName );
for(i=0; i<LEVEL_MAXFILES; i++)
{
if (psBaseData->apDataFiles[i])
@ -789,7 +791,7 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
{
ASSERT((psNewLevel->type == LDS_BETWEEN,
"levLoadData: only BETWEEN missions do not need a .gam file"));
DBP0(("levLoadData: no .gam file for level: BETWEEN mission\n"));
debug( LOG_NEVER, "levLoadData: no .gam file for level: BETWEEN mission\n" );
if (pSaveName != NULL)
{
if (psBaseData != NULL)
@ -800,24 +802,24 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
}
}
DBP0(("levLoadData: setting map heap\n"));
debug( LOG_NEVER, "levLoadData: setting map heap\n" );
BLOCK_RESET(psMapHeap);
memSetBlockHeap(psMapHeap);
//set the mission type before the saveGame data is loaded
if (saveType == GTYPE_SAVE_MIDMISSION)
{
DBP0(("levLoadData: init mission stuff\n"));
debug( LOG_NEVER, "levLoadData: init mission stuff\n" );
if (!startMissionSave(psNewLevel->type))
{
return FALSE;
}
DBP0(("levLoadData: dataSetSaveFlag\n"));
debug( LOG_NEVER, "levLoadData: dataSetSaveFlag\n" );
dataSetSaveFlag();
}
DBP0(("levLoadData: loading savegame: %s\n", pSaveName));
debug( LOG_NEVER, "levLoadData: loading savegame: %s\n", pSaveName );
if (!loadGame(pSaveName, FALSE, TRUE,TRUE))
{
return FALSE;
@ -832,14 +834,14 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
if ((pSaveName == NULL) ||
(saveType == GTYPE_SAVE_START))
{
DBP0(("levLoadData: start mission - no .gam\n"));
debug( LOG_NEVER, "levLoadData: start mission - no .gam\n" );
if (!startMission(psNewLevel->type, NULL))
{
return FALSE;
}
}
DBP0(("levLoadData: setting mission heap\n"));
debug( LOG_NEVER, "levLoadData: setting mission heap\n" );
BLOCK_RESET(psMissionHeap);
memSetBlockHeap(psMissionHeap);
}
@ -847,7 +849,7 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
//we need to load up the save game data here for a camchange
if (bCamChangeSaveGame)
{
DBP0(("levLoadData: no .gam file for level: BETWEEN mission\n"));
debug( LOG_NEVER, "levLoadData: no .gam file for level: BETWEEN mission\n" );
if (pSaveName != NULL)
{
if (psBaseData != NULL)
@ -858,11 +860,11 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
}
}
DBP0(("levLoadData: setting map heap\n"));
debug( LOG_NEVER, "levLoadData: setting map heap\n" );
BLOCK_RESET(psMapHeap);
memSetBlockHeap(psMapHeap);
DBP0(("levLoadData: loading savegame: %s\n", pSaveName));
debug( LOG_NEVER, "levLoadData: loading savegame: %s\n", pSaveName );
if (!loadGame(pSaveName, FALSE, TRUE,TRUE))
{
return FALSE;
@ -884,7 +886,7 @@ BOOL levLoadData(STRING *pName, STRING *pSaveName, SDWORD saveType)
// load the new data
DBP0(("levLoadData: loading mission dataset: %s\n", psNewLevel->pName));
debug( LOG_NEVER, "levLoadData: loading mission dataset: %s\n", psNewLevel->pName );
psCurrHeap = memGetBlockHeap();
for(i=0; i<LEVEL_MAXFILES; i++)
{
@ -900,7 +902,7 @@ iV_Reset(FALSE);//unload font, to avoid crash on 8th load... ajl 15/sep/99
return FALSE;
}
DBP0(("levLoadData: setting map heap\n"));
debug( LOG_NEVER, "levLoadData: setting map heap\n" );
BLOCK_RESET(psMapHeap);
memSetBlockHeap(psMapHeap);
psCurrHeap = psMapHeap;
@ -913,7 +915,7 @@ iV_Reset(FALSE);//unload font, to avoid crash on 8th load... ajl 15/sep/99
) &&
pSaveName == NULL)
{
DBP0(("levLoadData: setting mission heap\n"));
debug( LOG_NEVER, "levLoadData: setting mission heap\n" );
BLOCK_RESET(psMissionHeap);
memSetBlockHeap(psMissionHeap);
psCurrHeap = psMissionHeap;
@ -923,7 +925,7 @@ iV_Reset(FALSE);//unload font, to avoid crash on 8th load... ajl 15/sep/99
if (pSaveName != NULL AND !bCamChangeSaveGame)
{
// make sure the map gets loaded into the right heap
DBP0(("levLoadData: setting map heap\n"));
debug( LOG_NEVER, "levLoadData: setting map heap\n" );
BLOCK_RESET(psMapHeap);
memSetBlockHeap(psMapHeap);
psCurrHeap = psMapHeap;
@ -931,17 +933,17 @@ iV_Reset(FALSE);//unload font, to avoid crash on 8th load... ajl 15/sep/99
//set the mission type before the saveGame data is loaded
if (saveType == GTYPE_SAVE_MIDMISSION)
{
DBP0(("levLoadData: init mission stuff\n"));
debug( LOG_NEVER, "levLoadData: init mission stuff\n" );
if (!startMissionSave(psNewLevel->type))
{
return FALSE;
}
DBP0(("levLoadData: dataSetSaveFlag\n"));
debug( LOG_NEVER, "levLoadData: dataSetSaveFlag\n" );
dataSetSaveFlag();
}
DBP0(("levLoadData: loading save game %s\n", pSaveName));
debug( LOG_NEVER, "levLoadData: loading save game %s\n", pSaveName );
if (!loadGame(pSaveName, FALSE, TRUE,TRUE))
{
return FALSE;
@ -1022,7 +1024,7 @@ iV_Reset(FALSE);//unload font, to avoid crash on 8th load... ajl 15/sep/99
break;
case LDS_MKEEP_LIMBO:
debug(LOG_WZ, "levLoadData: LDS_MKEEP_LIMBO");
DBPRINTF(("MKEEP_LIMBO\n"));
debug( LOG_NEVER, "MKEEP_LIMBO\n" );
//if (!startMission(MISSION_OFFKEEP, psNewLevel->apDataFiles[i]))
if (!startMission(LDS_MKEEP_LIMBO, psNewLevel->apDataFiles[i]))
{
@ -1058,7 +1060,7 @@ iV_Reset(FALSE);//unload font, to avoid crash on 8th load... ajl 15/sep/99
// set the mission heap now if it isn't already being used
if (memGetBlockHeap() != psMissionHeap)
{
DBP0(("levLoadData: setting mission heap\n"));
debug( LOG_NEVER, "levLoadData: setting mission heap\n" );
BLOCK_RESET(psMissionHeap);
memSetBlockHeap(psMissionHeap);
}
@ -1082,7 +1084,7 @@ iV_Reset(FALSE);//unload font, to avoid crash on 8th load... ajl 15/sep/99
// set the mission heap now if it isn't already being used
if (memGetBlockHeap() != psMissionHeap)
{
DBP0(("levLoadData: setting mission heap\n"));
debug( LOG_NEVER, "levLoadData: setting mission heap\n" );
BLOCK_RESET(psMissionHeap);
memSetBlockHeap(psMissionHeap);
psCurrHeap = psMissionHeap;
@ -1103,7 +1105,7 @@ iV_Reset(FALSE);//unload font, to avoid crash on 8th load... ajl 15/sep/99
{
//load script stuff
// load the event system state here for a save game
DBP0(("levLoadData: loading script system state\n"));
debug( LOG_NEVER, "levLoadData: loading script system state\n" );
if (!loadScriptState(pSaveName))
{
return FALSE;

View File

@ -560,7 +560,7 @@ GAMECODE gameLoop(void)
{
if(strlen(sRequestResult))
{
DBPRINTF(("Returned %s",sRequestResult));
debug( LOG_NEVER, "Returned %s", sRequestResult );
if(bRequestLoad)
{
loopMissionState = LMS_LOADGAME;

View File

@ -467,12 +467,14 @@ init://jump here from the end if re_initialising
psPaletteBuffer = (iColour*)MALLOC(256 * sizeof(iColour)+1);
if (psPaletteBuffer == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return -1;
}
if (!loadFileToBuffer("palette.bin", (char *)psPaletteBuffer, (256 * sizeof(iColour)+1),&pSize))
{
DBERROR(("Couldn't load palette data"));
debug( LOG_ERROR, "Couldn't load palette data" );
abort();
return -1;
}
pal_AddNewPalette(psPaletteBuffer);
@ -543,13 +545,13 @@ init://jump here from the end if re_initialising
//after data is loaded check the research stats are valid
if (!checkResearchStats())
{
DBERROR(("Invalid Research Stats"));
debug( LOG_ERROR, "Invalid Research Stats" );
goto exit;
}
//and check the structure stats are valid
if (!checkStructureStats())
{
DBERROR(("Invalid Structure Stats"));
debug( LOG_ERROR, "Invalid Structure Stats" );
goto exit;
}
@ -558,7 +560,8 @@ init://jump here from the end if re_initialising
screen_StopBackDrop();
break;
case GS_VIDEO_MODE:
DBERROR(("Video_mode no longer valid"));
debug( LOG_ERROR, "Video_mode no longer valid" );
abort();
if (introVideoControl == 0)
{
videoInitialised = TRUE;
@ -566,7 +569,7 @@ init://jump here from the end if re_initialising
break;
default:
debug(LOG_ERROR, "Unknown game status on shutdown!");
debug( LOG_ERROR, "Unknown game status on shutdown!" );
}
@ -850,6 +853,7 @@ exit:
pal_ShutDown();
frameShutDown();
debug_exit();
return 1;
}

View File

@ -223,7 +223,8 @@ BOOL mapNew(UDWORD width, UDWORD height)
// if (width > MAP_MAXWIDTH || height > MAP_MAXHEIGHT)
if (width*height > MAP_MAXAREA)
{
DBERROR(("mapNew: map too large : %d %d\n",width,height));
debug( LOG_ERROR, "mapNew: map too large : %d %d\n", width, height );
abort();
return FALSE;
}
@ -252,7 +253,8 @@ BOOL mapNew(UDWORD width, UDWORD height)
psMapTiles = (MAPTILE *)MALLOC(sizeof(MAPTILE) * width*height);
if (psMapTiles == NULL)
{
DBERROR(("mapNew: Out of memory"));
debug( LOG_ERROR, "mapNew: Out of memory" );
abort();
return FALSE;
}
memset(psMapTiles, 0, sizeof(MAPTILE) * width*height);
@ -347,7 +349,8 @@ BOOL mapLoadV1(char *pFileData, UDWORD fileSize)
}
if ((char *)psTileData - pFileData > fileSize)
{
DBERROR(("mapLoad: unexpected end of file"));
debug( LOG_ERROR, "mapLoad: unexpected end of file" );
abort();
return FALSE;
}
@ -393,7 +396,8 @@ BOOL mapLoadV2(char *pFileData, UDWORD fileSize)
if ((char *)psTileData - pFileData > fileSize)
{
DBERROR(("mapLoad: unexpected end of file"));
debug( LOG_ERROR, "mapLoad: unexpected end of file" );
abort();
return FALSE;
}
@ -456,7 +460,8 @@ BOOL mapLoadV3(char *pFileData, UDWORD fileSize)
for(i=0; i<psGateHeader->numGateways; i++) {
if (!gwNewGateway(psGate->x0,psGate->y0, psGate->x1,psGate->y1)) {
DBERROR(("mapLoadV3: Unable to add gateway"));
debug( LOG_ERROR, "mapLoadV3: Unable to add gateway" );
abort();
return FALSE;
}
psGate++;
@ -521,14 +526,16 @@ BOOL mapLoadV3(char *pFileData, UDWORD fileSize)
if(psZoneHeader->numEquivZones > 0) {
// Load in the zone equivelance lists.
if(!gwNewEquivTable(psZoneHeader->numEquivZones)) {
DBERROR(("gwNewEquivTable failed"));
debug( LOG_ERROR, "gwNewEquivTable failed" );
abort();
return FALSE;
}
for(i=0; i<psZoneHeader->numEquivZones; i++) {
if(*pZone != 0) {
if(!gwSetZoneEquiv(i, (SDWORD)*pZone, pZone+1)) {
DBERROR(("gwSetZoneEquiv failed"));
debug( LOG_ERROR, "gwSetZoneEquiv failed" );
abort();
return FALSE;
}
}
@ -539,7 +546,8 @@ BOOL mapLoadV3(char *pFileData, UDWORD fileSize)
if ((char *)pZone - pFileData > fileSize)
{
DBERROR(("mapLoadV3: unexpected end of file"));
debug( LOG_ERROR, "mapLoadV3: unexpected end of file" );
abort();
return FALSE;
}
//#endif
@ -587,7 +595,8 @@ BOOL mapLoad(char *pFileData, UDWORD fileSize)
if (psHeader->aFileType[0] != 'm' || psHeader->aFileType[1] != 'a' ||
psHeader->aFileType[2] != 'p' || psHeader->aFileType[3] != ' ')
{
DBERROR(("mapLoad: Incorrect file type"));
debug( LOG_ERROR, "mapLoad: Incorrect file type" );
abort();
FREE(pFileData);
return FALSE;
}
@ -601,7 +610,8 @@ BOOL mapLoad(char *pFileData, UDWORD fileSize)
/* Check the file version */
if (psHeader->version < VERSION_7)
{
DBERROR(("MapLoad: unsupported save format version %d",psHeader->version));
debug( LOG_ERROR, "MapLoad: unsupported save format version %d", psHeader->version );
abort();
FREE(pFileData);
return FALSE;
}
@ -615,7 +625,8 @@ BOOL mapLoad(char *pFileData, UDWORD fileSize)
}
else
{
DBERROR(("MapLoad: undefined save format version %d",psHeader->version));
debug( LOG_ERROR, "MapLoad: undefined save format version %d", psHeader->version );
abort();
FREE(pFileData);
return FALSE;
}
@ -627,7 +638,8 @@ BOOL mapLoad(char *pFileData, UDWORD fileSize)
// if (width > MAP_MAXWIDTH || height > MAP_MAXHEIGHT)
if (width*height > MAP_MAXAREA)
{
DBERROR(("mapLoad: map too large : %d %d\n",width,height));
debug( LOG_ERROR, "mapLoad: map too large : %d %d\n", width, height );
abort();
return FALSE;
}
@ -683,7 +695,8 @@ BOOL mapLoad(char *pFileData, UDWORD fileSize)
psMapTiles = (MAPTILE *)MALLOC(sizeof(MAPTILE) * width*height);
if (psMapTiles == NULL)
{
DBERROR(("mapLoad: Out of memory"));
debug( LOG_ERROR, "mapLoad: Out of memory" );
abort();
return FALSE;
}
memset(psMapTiles, 0, sizeof(MAPTILE) * width*height);
@ -783,7 +796,8 @@ BOOL mapSave(char **ppFileData, UDWORD *pFileSize)
*ppFileData = MALLOC(*pFileSize);
if (*ppFileData == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
@ -921,7 +935,8 @@ BOOL mapSaveMission(char **ppFileData, UDWORD *pFileSize)
*ppFileData = MALLOC(*pFileSize);
if (*ppFileData == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
@ -1607,7 +1622,8 @@ BOOL writeVisibilityData( STRING *pFileName )
if(!pFileData)
{
/* Nope, so do one */
DBERROR(("Saving visibility data : Cannot get the memory! (%d)",fileSize));
debug( LOG_ERROR, "Saving visibility data : Cannot get the memory! (%d)", fileSize );
abort();
return(FALSE);
}
@ -1677,8 +1693,8 @@ UBYTE *pVisData;
if(fileSize!=expectedFileSize)
{
/* No, so bomb out */
DBERROR(("Read visibility data : Weird file size for %d by %d sized map?",
mapWidth,mapHeight));
debug( LOG_ERROR, "Read visibility data : Weird file size for %d by %d sized map?", mapWidth, mapHeight );
abort();
return(FALSE);
}

View File

@ -80,7 +80,7 @@ void gridClear(void)
GRID_ARRAY *psCurr, *psNext;
SDWORD x,y;
DBPRINTF(("gridClear %d %d\n",gridWidth,gridHeight));
debug( LOG_NEVER, "gridClear %d %d\n", gridWidth, gridHeight );
// for(x=0; x<GRID_WIDTH; x+=1)
for(x=0; x<gridWidth; x+=1)
{
@ -409,7 +409,7 @@ void gridAddArrayObject(SDWORD x, SDWORD y, BASE_OBJECT *psObj)
// allocate a new array chunk
if (!HEAP_ALLOC(psGridHeap, (void*) &psNew))
{
DBPRINTF(("help - %d\n", psObj->id));
debug( LOG_NEVER, "help - %d\n", psObj->id );
return;
}
@ -522,8 +522,7 @@ void gridDisplayCoverage(BASE_OBJECT *psObj)
SDWORD x,y, i;
GRID_ARRAY *psCurr;
DBPRINTF(("Grid coverage for object %d (%d,%d) - range %d\n",
psObj->id, psObj->x,psObj->y, gridObjRange(psObj)));
debug( LOG_NEVER, "Grid coverage for object %d (%d,%d) - range %d\n", psObj->id, psObj->x, psObj->y, gridObjRange(psObj) );
// for (x=0; x<GRID_WIDTH; x++)
for (x=0; x<gridWidth; x++)
{
@ -536,9 +535,7 @@ void gridDisplayCoverage(BASE_OBJECT *psObj)
{
if (psCurr->apsObjects[i] == psObj)
{
DBPRINTF((" %d,%d [ %d,%d -> %d,%d ]\n",
x,y, x*GRID_UNITS,y*GRID_UNITS,
(x+1)*GRID_UNITS,(y+1)*GRID_UNITS));
debug( LOG_NEVER, " %d,%d [ %d,%d -> %d,%d ]\n", x, y, x*GRID_UNITS, y*GRID_UNITS, (x+1)*GRID_UNITS, (y+1)*GRID_UNITS );
}
i += 1;

View File

@ -168,7 +168,8 @@ BOOL allocComponentList(COMPONENT_TYPE type, SDWORD number)
apCompLists[inc][type] = (UBYTE *) MALLOC(sizeof(UBYTE) * number);
if (apCompLists[inc][type] == NULL)
{
DBERROR(("Out of memory assigning Player Component Lists"));
debug( LOG_ERROR, "Out of memory assigning Player Component Lists" );
abort();
return FALSE;
}
@ -215,7 +216,8 @@ BOOL allocStructLists(void)
numStructureStats);
if (apStructTypeLists[inc] == NULL)
{
DBERROR(("Out of memory assigning Player Structure Lists"));
debug( LOG_ERROR, "Out of memory assigning Player Structure Lists" );
abort();
return FALSE;
}
for (stat = 0; stat < (SDWORD)numStructureStats; stat++)

View File

@ -463,7 +463,8 @@ BOOL initMessage(void)
pProximityMsgIMD = (iIMDShape *)resGetData("IMD", "arrow.pie");
if (pProximityMsgIMD == NULL)
{
DBERROR(("Unable to load Proximity Message PIE"));
debug( LOG_ERROR, "Unable to load Proximity Message PIE" );
abort();
return FALSE;
}
@ -540,7 +541,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
numData = numCR(pViewMsgData, bufferSize);
if (numData > UBYTE_MAX)
{
DBERROR(("loadViewData: Didn't expect 256 viewData messages!"));
debug( LOG_ERROR, "loadViewData: Didn't expect 256 viewData messages!" );
abort();
return NULL;
}
@ -548,7 +550,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
psViewData = (VIEWDATA *)MALLOC(numData * sizeof(VIEWDATA));
if (psViewData == NULL)
{
DBERROR(("Unable to allocate memory for viewdata"));
debug( LOG_ERROR, "Unable to allocate memory for viewdata" );
abort();
return NULL;
}
@ -574,7 +577,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
//check not loading up too many text strings
if (numText > MAX_DATA)
{
DBERROR(("loadViewData: too many text strings for %s", psViewData->pName));
debug( LOG_ERROR, "loadViewData: too many text strings for %s", psViewData->pName );
abort();
return NULL;
}
psViewData->numText=(UBYTE)numText;
@ -583,7 +587,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
psViewData->pName = (STRING *)MALLOC((strlen(name))+1);
if (psViewData->pName == NULL)
{
DBERROR(("ViewData Name - Out of memory"));
debug( LOG_ERROR, "ViewData Name - Out of memory" );
abort();
return NULL;
}
strcpy(psViewData->pName,name);
@ -607,7 +612,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
//get the ID for the string
if (!strresGetIDNum(psStringRes, name, &id))
{
DBERROR(("Cannot find the view data string id %s ", name));
debug( LOG_ERROR, "Cannot find the view data string id %s ", name );
abort();
return NULL;
}
//get the string from the id
@ -626,7 +632,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
psViewData->pData = (VIEW_RESEARCH *) MALLOC(sizeof(VIEW_RESEARCH));
if (psViewData->pData == NULL)
{
DBERROR(("Unable to allocate memory"));
debug( LOG_ERROR, "Unable to allocate memory" );
abort();
return NULL;
}
imdName[0] = '\0';
@ -642,7 +649,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
psViewRes->pIMD = (iIMDShape *) resGetData("IMD", imdName);
if (psViewRes->pIMD == NULL)
{
DBERROR(("Cannot find the PIE for message %s", name));
debug( LOG_ERROR, "Cannot find the PIE for message %s", name );
abort();
return NULL;
}
if (strcmp(imdName2, "0"))
@ -650,7 +658,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
psViewRes->pIMD2 = (iIMDShape *) resGetData("IMD", imdName2);
if (psViewRes->pIMD2 == NULL)
{
DBERROR(("Cannot find the 2nd PIE for message %s", name));
debug( LOG_ERROR, "Cannot find the 2nd PIE for message %s", name );
abort();
return NULL;
}
}
@ -666,7 +675,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
psViewRes->pAudio = (STRING *) MALLOC(strlen(audioName) + 1);
if (psViewRes->pAudio == NULL)
{
DBERROR(("loadViewData - Out of memory"));
debug( LOG_ERROR, "loadViewData - Out of memory" );
abort();
return NULL;
}
strcpy(psViewRes->pAudio, audioName);
@ -685,7 +695,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
psViewData->pData = (VIEW_REPLAY *) MALLOC(sizeof(VIEW_REPLAY));
if (psViewData->pData == NULL)
{
DBERROR(("Unable to allocate memory"));
debug( LOG_ERROR, "Unable to allocate memory" );
abort();
return NULL;
}
psViewReplay = (VIEW_REPLAY *)psViewData->pData;
@ -697,7 +708,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
if (count > MAX_DATA)
{
DBERROR(("loadViewData: too many sequence for %s", psViewData->pName));
debug( LOG_ERROR, "loadViewData: too many sequence for %s", psViewData->pName );
abort();
return NULL;
}
@ -718,7 +730,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
pViewMsgData += cnt;
if (count > MAX_DATA)
{
DBERROR(("loadViewData: too many strings for %s", psViewData->pName));
debug( LOG_ERROR, "loadViewData: too many strings for %s", psViewData->pName );
abort();
return NULL;
}
psViewReplay->pSeqList[dataInc].numText = (UBYTE)count;
@ -731,16 +744,16 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
pViewMsgData += cnt;
if (count > MAX_DATA)
{
DBERROR(("loadViewData: invalid video playback flag %s",
psViewData->pName));
debug( LOG_ERROR, "loadViewData: invalid video playback flag %s", psViewData->pName );
abort();
return NULL;
}
psViewReplay->pSeqList[dataInc].flag = (UBYTE)count;
//check not loading up too many text strings
if (count2 > MAX_DATA)
{
DBERROR(("loadViewData: too many text strings for seq for %s",
psViewData->pName));
debug( LOG_ERROR, "loadViewData: too many text strings for seq for %s", psViewData->pName );
abort();
return NULL;
}
psViewReplay->pSeqList[dataInc].numText = (UBYTE)count2;
@ -764,7 +777,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
//get the ID for the string
if (!strresGetIDNum(psStringRes, name, &id))
{
DBERROR(("Cannot find the view data string id %s ", name));
debug( LOG_ERROR, "Cannot find the view data string id %s ", name );
abort();
return NULL;
}
@ -790,7 +804,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
strlen(audioName) + 1);
if (psViewReplay->pSeqList[dataInc].pAudio == NULL)
{
DBERROR(("loadViewData - Out of memory"));
debug( LOG_ERROR, "loadViewData - Out of memory" );
abort();
return NULL;
}
strcpy(psViewReplay->pSeqList[dataInc].pAudio, audioName);
@ -807,7 +822,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
psViewData->pData = (VIEW_PROXIMITY *) MALLOC(sizeof(VIEW_PROXIMITY));
if (psViewData->pData == NULL)
{
DBERROR(("Unable to allocate memory"));
debug( LOG_ERROR, "Unable to allocate memory" );
abort();
return NULL;
}
@ -826,16 +842,16 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
{
if ( audioID_GetIDFromStr( audioName, &audioID ) == FALSE )
{
DBERROR(("loadViewData: couldn't get ID %d for weapon sound %s",
audioID, audioName));
debug( LOG_ERROR, "loadViewData: couldn't get ID %d for weapon sound %s", audioID, audioName );
abort();
return FALSE;
}
if ( ((audioID < 0) || (audioID >= ID_MAX_SOUND)) &&
(audioID != NO_SOUND) )
{
DBERROR(("Invalid Weapon Sound ID - %d for weapon %s",
audioID, audioName));
debug( LOG_ERROR, "Invalid Weapon Sound ID - %d for weapon %s", audioID, audioName );
abort();
return FALSE;
}
}
@ -874,7 +890,8 @@ VIEWDATA *loadViewData(char *pViewMsgData, UDWORD bufferSize)
((VIEW_PROXIMITY *)psViewData->pData)->proxType = proxType;
break;
default:
DBERROR(("Unknown ViewData type"));
debug( LOG_ERROR, "Unknown ViewData type" );
abort();
return NULL;
}
//increment the pointer to the start of the next record
@ -911,7 +928,8 @@ VIEWDATA * getViewData(STRING *pName)
}
}
DBERROR(("Unable to find viewdata for message %s", pName));
debug( LOG_ERROR, "Unable to find viewdata for message %s", pName );
abort();
return NULL;
}

View File

@ -83,8 +83,8 @@ char name[15]; // hopefully!
if(!miscImds[i].pImd)
{
/* Say which one and return FALSE */
DBERROR(("Can't find misselaneous PIE file : %s",miscImds[i].pName));
ASSERT((0,"NULL PIE"));
debug( LOG_ERROR, "Can't find misselaneous PIE file : %s", miscImds[i].pName );
ASSERT((FALSE,"NULL PIE"));
return(FALSE);
}
/* If the next one's the end one, then get out now.
@ -157,7 +157,8 @@ BOOL initMiscImds( void )
pAssemblyPointIMDs[FACTORY_FLAG][i] = resGetData("IMD", facName);
if (!pAssemblyPointIMDs[FACTORY_FLAG][i])
{
DBERROR(("Can't find assembly point graphic for factory"));
debug( LOG_ERROR, "Can't find assembly point graphic for factory" );
abort();
return(FALSE);
}
//#ifndef PSX
@ -165,20 +166,23 @@ BOOL initMiscImds( void )
pAssemblyPointIMDs[CYBORG_FLAG][i] = resGetData("IMD", cybName);
if (!pAssemblyPointIMDs[CYBORG_FLAG][i])
{
DBERROR(("Can't find assembly point graphic for cyborg factory"));
debug( LOG_ERROR, "Can't find assembly point graphic for cyborg factory" );
abort();
return(FALSE);
}
vtolName[6] = *pieNum;
pAssemblyPointIMDs[VTOL_FLAG][i] = resGetData("IMD", vtolName);
if (!pAssemblyPointIMDs[VTOL_FLAG][i])
{
DBERROR(("Can't find assembly point graphic for vtol factory"));
debug( LOG_ERROR, "Can't find assembly point graphic for vtol factory" );
abort();
return(FALSE);
}
pAssemblyPointIMDs[REPAIR_FLAG][i] = resGetData("IMD", "mirnum1.pie");
if (!pAssemblyPointIMDs[REPAIR_FLAG][i])
{
DBERROR(("Can't find assembly point graphic for repair facility"));
debug( LOG_ERROR, "Can't find assembly point graphic for repair facility" );
abort();
return(FALSE);
}
//#else

View File

@ -309,7 +309,7 @@ void initMission(void)
{
UDWORD inc;
DBPRINTF(("***Init Mission ***\n"));
debug( LOG_NEVER, "***Init Mission ***\n" );
//mission.type = MISSION_NONE;
mission.type = LDS_NONE;
for (inc = 0; inc < MAX_PLAYERS; inc++)
@ -518,7 +518,7 @@ BOOL startMission(LEVEL_TYPE missionType, STRING *pGame)
{
/*mission type gets set to none when you have returned from a mission
so don't want to go another mission when already on one! - so ignore*/
DBMB(("Already on a mission"));
debug( LOG_NEVER, "Already on a mission" );
return TRUE;
}
@ -624,14 +624,16 @@ BOOL startMission(LEVEL_TYPE missionType, STRING *pGame)
default:
{
//error!
DBERROR(("Unknown Mission Type"));
debug( LOG_ERROR, "Unknown Mission Type" );
abort();
loaded = FALSE;
}
}
if (!loaded)
{
DBERROR(("Unable to load mission file"));
debug( LOG_ERROR, "Unable to load mission file" );
abort();
return FALSE;
}
@ -1870,7 +1872,7 @@ void endMission(void)
if (mission.type == LDS_NONE)
{
//can't go back any further!!
DBMB(("Already returned from mission"));
debug( LOG_NEVER, "Already returned from mission" );
return;
}
@ -1936,7 +1938,8 @@ void endMission(void)
default:
{
//error!
DBERROR(("Unknown Mission Type"));
debug( LOG_ERROR, "Unknown Mission Type" );
abort();
}
}
@ -2558,7 +2561,7 @@ void missionResetDroids()
TILE_UNITS) - TILE_UNITS || psDroid->y <= TILE_UNITS ||
psDroid->y >= (mapHeight * TILE_UNITS) - TILE_UNITS)
{
DBMB(("missionResetUnits: unit too close to edge of map - removing"));
debug( LOG_NEVER, "missionResetUnits: unit too close to edge of map - removing" );
vanishDroid(psDroid);
continue;
}
@ -2798,7 +2801,7 @@ void missionMoveTransporterOffWorld( DROID *psTransporter )
}
else
{
DBPRINTF( ("missionMoveTransporterOffWorld: droid type not transporter!\n") );
debug( LOG_NEVER, "missionMoveTransporterOffWorld: droid type not transporter!\n" );
}
}
@ -3545,15 +3548,13 @@ void intRunMissionResult()
pie_SetMouse(IntImages,IMAGE_CURSOR_DEFAULT);
frameSetCursorFromRes(IDC_DEFAULT);
if(bLoadSaveUp)
{
if(runLoadSave(FALSE))// check for file name.
{
if(strlen(sRequestResult))
{
DBPRINTF(("Returned %s",sRequestResult));
debug( LOG_NEVER, "Returned %s", sRequestResult );
if(bRequestLoad)
{
@ -3711,7 +3712,7 @@ void launchMission(void)
}
else
{
DBMB(("Start Mission has not been called"));
debug( LOG_NEVER, "Start Mission has not been called" );
}
}
@ -4092,8 +4093,7 @@ void missionSetTransporterEntry( SDWORD iPlayer, SDWORD iEntryTileX, SDWORD iEnt
}
else
{
DBPRINTF( ("missionSetTransporterEntry: entry point x %i outside scroll limits %i->%i\n",
iEntryTileX, scrollMinX, scrollMaxX ) );
debug( LOG_NEVER, "missionSetTransporterEntry: entry point x %i outside scroll limits %i->%i\n", iEntryTileX, scrollMinX, scrollMaxX );
mission.iTranspEntryTileX[iPlayer] = (UWORD) (scrollMinX + EDGE_SIZE);
}
@ -4103,8 +4103,7 @@ void missionSetTransporterEntry( SDWORD iPlayer, SDWORD iEntryTileX, SDWORD iEnt
}
else
{
DBPRINTF( ("missionSetTransporterEntry: entry point y %i outside scroll limits %i->%i\n",
iEntryTileY, scrollMinY, scrollMaxY ) );
debug( LOG_NEVER, "missionSetTransporterEntry: entry point y %i outside scroll limits %i->%i\n", iEntryTileY, scrollMinY, scrollMaxY );
mission.iTranspEntryTileY[iPlayer] = (UWORD) (scrollMinY + EDGE_SIZE);
}
}
@ -4119,8 +4118,7 @@ void missionSetTransporterExit( SDWORD iPlayer, SDWORD iExitTileX, SDWORD iExitT
}
else
{
DBPRINTF( ("missionSetTransporterExit: entry point x %i outside scroll limits %i->%i\n",
iExitTileX, scrollMinX, scrollMaxX ) );
debug( LOG_NEVER, "missionSetTransporterExit: entry point x %i outside scroll limits %i->%i\n", iExitTileX, scrollMinX, scrollMaxX );
mission.iTranspExitTileX[iPlayer] = (UWORD) (scrollMinX + EDGE_SIZE);
}
@ -4130,8 +4128,7 @@ void missionSetTransporterExit( SDWORD iPlayer, SDWORD iExitTileX, SDWORD iExitT
}
else
{
DBPRINTF( ("missionSetTransporterExit: entry point y %i outside scroll limits %i->%i\n",
iExitTileY, scrollMinY, scrollMaxY ) );
debug( LOG_NEVER, "missionSetTransporterExit: entry point y %i outside scroll limits %i->%i\n", iExitTileY, scrollMinY, scrollMaxY );
mission.iTranspExitTileY[iPlayer] = (UWORD) (scrollMinY + EDGE_SIZE);
}
}
@ -4183,7 +4180,7 @@ void missionDestroyObjects(void)
STRUCTURE *psStruct;
UBYTE Player;
DBPRINTF(("missionDestroyObjects\n"));
debug( LOG_NEVER, "missionDestroyObjects\n" );
for(Player = 0; Player < MAX_PLAYERS; Player++) {
if(Player != selectedPlayer) {

View File

@ -28,7 +28,7 @@ BOOL moveDoMessage;
#undef DBP6
#define DBP6( x ) \
if (moveDoMessage) \
DBPRINTF( x )
debug( LOG_NEVER, x )
#endif
@ -3514,7 +3514,7 @@ void moveUpdateDroidPos( DROID *psDroid, FRACT dx, FRACT dy )
else
{
/* dreadful last-ditch crash-avoiding hack - sort this! - GJ */
DBPRINTF( ("**** droid about to go off map - fixed ****\n") );
debug( LOG_NEVER, "**** droid about to go off map - fixed ****\n" );
destroyDroid( psDroid );
}
}
@ -3754,7 +3754,7 @@ void moveUpdatePersonModel(DROID *psDroid, SDWORD speed, SDWORD direction)
{
// Only add the animation if the droid is on screen, saves memory and time.
if(clipXY(psDroid->x,psDroid->y)) {
DBPRINTF(("Added person run anim\n"));
debug( LOG_NEVER, "Added person run anim\n" );
psDroid->psCurAnim = animObj_Add( (BASE_OBJECT *) psDroid,
ID_ANIM_DROIDRUN, 0, 0 );
}
@ -3764,7 +3764,7 @@ DBPRINTF(("Added person run anim\n"));
bRet = animObj_Remove( &psDroid->psCurAnim, psDroid->psCurAnim->psAnim->uwID );
ASSERT( (bRet == TRUE, "moveUpdatePersonModel : animObj_Remove failed") );
psDroid->psCurAnim = NULL;
DBPRINTF(("Removed person run anim\n"));
debug( LOG_NEVER, "Removed person run anim\n" );
}
}
}
@ -4029,7 +4029,7 @@ moveUpdateCyborgModel( DROID *psDroid, SDWORD moveSpeed, SDWORD moveDir, UBYTE o
{
if ( animObj_Remove( &psDroid->psCurAnim, psDroid->psCurAnim->uwID ) == FALSE )
{
DBPRINTF( ("moveUpdateCyborgModel: couldn't remove walk anim\n") );
debug( LOG_NEVER, "moveUpdateCyborgModel: couldn't remove walk anim\n" );
}
psDroid->psCurAnim = NULL;
}
@ -4126,7 +4126,7 @@ moveUpdateCyborgModel( DROID *psDroid, SDWORD moveSpeed, SDWORD moveDir, UBYTE o
psDroid->psCurAnim->uwID == ID_ANIM_CYBORG_PACK_RUN) &&
(animObj_Remove( &psDroid->psCurAnim, psDroid->psCurAnim->uwID ) == FALSE) )
{
DBPRINTF( ("moveUpdateCyborgModel: couldn't remove walk anim\n") );
debug( LOG_NEVER, "moveUpdateCyborgModel: couldn't remove walk anim\n" );
}
}
@ -4376,7 +4376,7 @@ if ( oldStatus != newStatus )
char szOldStatus[100], szNewStatus[100];
moveGetStatusStr( oldStatus, szOldStatus );
moveGetStatusStr( newStatus, szNewStatus );
DBPRINTF( ("oldStatus = %s newStatus = %s\n", szOldStatus, szNewStatus) );
debug( LOG_NEVER, "oldStatus = %s newStatus = %s\n", szOldStatus, szNewStatus );
}
#endif
@ -4595,7 +4595,7 @@ void moveUpdateDroid(DROID *psDroid)
if ( psDroid->droidType == DROID_TRANSPORTER )
{
DBPRINTF(("a) dir %g,%g (%g)\n",tx,ty,tangle));
debug( LOG_NEVER, "a) dir %g,%g (%g)\n", tx, ty, tangle );
}
moveSpeed = moveCalcDroidSpeed(psDroid);

View File

@ -621,7 +621,7 @@ BOOL recvDroid(NETMSG * m)
if(!pT)
{
NETlogEntry("Couldn't find template to build recvd droid. val = player",0,player );
DBPRINTF(("Couldn't find template to build recvd droid" ));
debug( LOG_NEVER, "Couldn't find template to build recvd droid" );
sendRequestDroid(id); // request the droid instead.
return FALSE;
}
@ -1011,11 +1011,13 @@ static VOID ProcessDroidOrder(DROID *psDroid, DROID_ORDER order,UDWORD x, UDWO
break;
case OBJ_BULLET: // shouldn't be getting this!
DBERROR(("multibot: order specified destination as a bullet. what am i to do??"));
debug( LOG_ERROR, "multibot: order specified destination as a bullet. what am i to do??" );
abort();
break;
default:
DBERROR(("unknown object type"));
debug( LOG_ERROR, "unknown object type" );
abort();
}
if(!psObj) // failed to find it;
@ -1283,7 +1285,7 @@ BOOL sendRequestDroid(UDWORD droidId)
NetAdd(msg,0,droidId);
NetAdd(msg,4,player2dpid[selectedPlayer] );
DBPRINTF(("multibot: unknown droid %d, requesting info\n", droidId));
debug( LOG_NEVER, "multibot: unknown droid %d, requesting info\n", droidId );
msg.type = NET_REQUESTDROID;
msg.size = sizeof(DPID)+sizeof(UDWORD);

View File

@ -101,7 +101,8 @@ BOOL recvGift(NETMSG *pMsg)
giftPower(from,to,FALSE);
break;
default:
DBERROR(("Unknown Gift recvd"));
debug( LOG_ERROR, "Unknown Gift recvd" );
abort();
return FALSE;
break;
}
@ -154,7 +155,8 @@ BOOL sendGift(UDWORD type,UDWORD to)
audio_QueueTrack(ID_POWER_TRANSMIT);
break;
default:
DBERROR(("Unknown Gift sent"));
debug( LOG_ERROR, "Unknown Gift sent" );
abort();
return FALSE;
break;
}
@ -566,7 +568,8 @@ BOOL recvAlliance(NETMSG *pMsg,BOOL allowAudio)
breakAlliance(from,to,FALSE,allowAudio);
break;
default:
DBERROR(("Unknown alliance state recvd."));
debug( LOG_ERROR, "Unknown alliance state recvd." );
abort();
break;
}

View File

@ -219,11 +219,11 @@ void loadMapPreview(void)
pFileData = DisplayBuffer;
if (!loadFileToBuffer(aFileName, pFileData, displayBufferSize, &fileSize))
{
DBPRINTF(("loadgame: Fail5\n"));
debug( LOG_NEVER, "loadgame: Fail5\n" );
}
if (!mapLoad(pFileData, fileSize))
{
DBPRINTF(("loadgame: Fail7\n"));
debug( LOG_NEVER, "loadgame: Fail7\n" );
return;
}
gwShutDown();
@ -3031,7 +3031,7 @@ VOID runForceSelect(VOID)
{
if(strlen(sRequestResult))
{
DBPRINTF(("Returned %s",sRequestResult));
debug( LOG_NEVER, "Returned %s", sRequestResult );
if(bRequestLoad)
{
loadForce(sRequestResult);
@ -3181,7 +3181,7 @@ BOOL startForceSelect(VOID)
strcpy(dir,"multiplay/forces/default.for"); // start with default force.
if(!loadForce(dir))
{
DBPRINTF(("Error Loading Force"));
debug( LOG_NEVER, "Error Loading Force" );
}
addBackdrop();

View File

@ -163,7 +163,8 @@ void recvOptions(NETMSG *pMsg)
{
#ifndef DEBUG
DBERROR(("Host is running a different version of Warzone2100."));
debug( LOG_ERROR, "Host is running a different version of Warzone2100." );
abort();
#endif
}
if(ingame.numStructureLimits) // free old limits.
@ -859,7 +860,8 @@ BOOL cleanMap(UDWORD player)
case CAMP_WALLS: //everything.
break;
default:
DBERROR(("Unknown Campaign Style"));
debug( LOG_ERROR, "Unknown Campaign Style" );
abort();
break;
}

View File

@ -143,7 +143,7 @@ BOOL turnOffMultiMsg(BOOL bDoit)
{
if(bTemp == TRUE)
{
DBPRINTF(("\nturnoffmultimsg: multiple calls to turn off msging. \n"));
debug( LOG_NEVER, "\nturnoffmultimsg: multiple calls to turn off msging.\n" );
}
if(bMultiPlayer)
{
@ -400,7 +400,7 @@ DROID_TEMPLATE *IdToTemplate(UDWORD tempId,UDWORD player)
else
{
// REALLY DANGEROUS!!! ID's are NOT assumed to be unique for TEMPLATES.
DBPRINTF(("Really Dodgy Check performed for a template"));
debug( LOG_NEVER, "Really Dodgy Check performed for a template" );
for(i=0;i<MAX_PLAYERS;i++)
{
for (psTempl = apsDroidTemplates[i]; // follow templates
@ -558,7 +558,7 @@ UDWORD whosResponsible(UDWORD player)
}
if(c == ANYPLAYER)
{
DBPRINTF(("failed to find a player for %d \n",player));
debug( LOG_NEVER, "failed to find a player for %d \n", player );
}
return c;
}
@ -1346,7 +1346,9 @@ BOOL sendTemplate(DROID_TEMPLATE *pTempl)
if(pTempl == NULL)
{
#ifdef DEBUG
DBERROR(("sendTemplate: TELL ALEXL NOW!!!THIS IS THE BUG THAT ISNT FIXED!!!"));
// FIXME sendTemplate: TELL ALEXL NOW!!!THIS IS THE BUG THAT ISNT FIXED!!!
debug( LOG_ERROR, "sendTemplate: TELL ALEXL NOW!!!THIS IS THE BUG THAT ISNT FIXED!!!" );
abort();
#endif
return TRUE;
}
@ -1372,7 +1374,9 @@ BOOL recvTemplate(NETMSG * m)
if(m->size < sizeof(DROID_TEMPLATE))
{
#ifdef DEBUG
DBERROR(("recvTemplate: invalid template recvd. THIS IS THE BUG THAT ISNT FIXED!!!"));
// FIXME recvTemplate: invalid template recvd. THIS IS THE BUG THAT ISNT FIXED!!!
debug( LOG_ERROR, "recvTemplate: invalid template recvd. THIS IS THE BUG THAT ISNT FIXED!!!" );
abort();
#endif
return TRUE;
}

View File

@ -275,7 +275,7 @@ VOID useTheForce(BOOL bAddTempl)//Luke
{
ASSERT((FALSE, "UseTheForce: Unable to find a free location"));
}
DBPRINTF(("force droid dropping at :%d,%d\n",x,y));
debug( LOG_NEVER, "force droid dropping at :%d,%d\n", x, y );
// copy template
psTempl = NameToTemplate(Force.pMembers->pTempl->aName,selectedPlayer);
@ -382,7 +382,8 @@ BOOL saveForce(char *name,FORCE *pfForce)
{
if (fwrite(pT, sizeof(DROID_TEMPLATE), 1, pFileHandle) != 1) // template
{
DBERROR(("Write failed for %s", fileName));
debug( LOG_ERROR, "Write failed for %s", fileName );
abort();
return FALSE;
}
fputc(10,pFileHandle); //seperator.
@ -393,7 +394,8 @@ BOOL saveForce(char *name,FORCE *pfForce)
{
if (fwrite(&(pMember->pTempl->ref) ,sizeof(pMember->pTempl->ref), 1, pFileHandle) != 1)
{
DBERROR(("Write failed for %s", fileName)); // force type
debug( LOG_ERROR, "Write failed for %s", fileName ); // force type
abort();
return FALSE;
}
}
@ -466,14 +468,16 @@ BOOL loadForce(char *name)
for(tcount;tcount!=0;tcount--) // get templates
{
psTempl = MALLOC(sizeof(DROID_TEMPLATE));
if (psTempl == NULL) //!HEAP_ALLOC(psTemplateHeap, &psTempl))
if (psTempl == NULL) // !HEAP_ALLOC(psTemplateHeap, &psTempl))
{
DBERROR(("Couldn't allocate template for %s", fileName));
debug( LOG_ERROR, "Couldn't allocate template for %s", fileName );
abort();
return FALSE;
}
if (fread(psTempl, sizeof(DROID_TEMPLATE), 1, pFileHandle) != 1) // read in a template.
{
DBERROR(("read failed for %s", fileName));
debug( LOG_ERROR, "read failed for %s", fileName );
abort();
fclose(pFileHandle);
return FALSE;
}
@ -486,7 +490,8 @@ BOOL loadForce(char *name)
{
if (fread(&ref, sizeof(ref), 1, pFileHandle) != 1) // read in a template ref code.
{
DBERROR(("read failed for %s", fileName));
debug( LOG_ERROR, "read failed for %s", fileName );
abort();
fclose(pFileHandle);
return FALSE;
}
@ -497,7 +502,8 @@ BOOL loadForce(char *name)
if(!psTempl)
{
DBERROR(("failed to load. invalid file."));
debug( LOG_ERROR, "failed to load. invalid file." );
abort();
fclose(pFileHandle);
return FALSE;
}

View File

@ -354,7 +354,7 @@ BOOL recvDroidCheck(NETMSG *m)
if ( !(IdToDroid(ref,player,&pD)) ) // find the droid in question
{
NETlogEntry("Recvd Unknown droid info. val=player",0,player);
DBPRINTF(("Received Checking Info for an unknown (As yet) droid player:%d ref:%d\n",player,ref));
debug( LOG_NEVER, "Received Checking Info for an unknown (As yet) droid player:%d ref:%d\n", player, ref );
return TRUE; //Recvd checking info for an unknown droid
}

View File

@ -116,7 +116,8 @@ BOOL playerInitialise(void)
asPlayerAI = (PLAYER_AI *)MALLOC(sizeof(PLAYER_AI) * MAX_PLAYERS);
if (!asPlayerAI)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
memset(asPlayerAI, 0, sizeof(PLAYER_AI) * MAX_PLAYERS);

View File

@ -67,7 +67,8 @@ BOOL allocPlayerPower(void)
asPower[player] = (PLAYER_POWER *) MALLOC (sizeof(PLAYER_POWER));
if (asPower[player] == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
}

View File

@ -648,7 +648,7 @@ proj_InFlightDirectFunc( PROJ_OBJECT *psObj )
if ( worldOnMap( iX, iY ) == FALSE )
{
psObj->state = PROJ_IMPACT;
DBPRINTF( ("**** projectile off map - removed ****\n") );
debug( LOG_NEVER, "**** projectile off map - removed ****\n" );
return;
}
else
@ -793,7 +793,7 @@ proj_InFlightIndirectFunc( PROJ_OBJECT *psObj )
if ( worldOnMap( iX, iY ) == FALSE )
{
psObj->state = PROJ_IMPACT;
DBPRINTF( ("**** projectile off map - removed ****\n") );
debug( LOG_NEVER, "**** projectile off map - removed ****\n" );
return;
}
else
@ -1301,7 +1301,7 @@ proj_ImpactFunc( PROJ_OBJECT *psObj )
if ( hashTable_RemoveElement( g_pProjObjTable, psObj,
(int) psObj, UNUSED_KEY ) == FALSE )
{
DBPRINTF( ("proj_ImpactFunc: couldn't remove projectile from table\n") );
debug( LOG_NEVER, "proj_ImpactFunc: couldn't remove projectile from table\n" );
}
return;
}
@ -1543,7 +1543,7 @@ proj_PostImpactFunc( PROJ_OBJECT *psObj )
if ( hashTable_RemoveElement( g_pProjObjTable, psObj,
(int) psObj, UNUSED_KEY ) == FALSE )
{
DBPRINTF( ("proj_PostImpactFunc: couldn't remove projectile from table\n") );
debug( LOG_NEVER, "proj_PostImpactFunc: couldn't remove projectile from table\n" );
}
return;
}
@ -1868,7 +1868,7 @@ UDWORD calcDamage(UDWORD baseDamage, WEAPON_EFFECT weaponEffect, BASE_OBJECT *ps
damage1 = baseDamage * Mod / 100;
DBPRINTF(("damage1=%d damage=%d baseDamage=%d mod=%d (weaponEffect=%d proptype=%d) \n",damage1,damage,baseDamage,Mod,weaponEffect,PropType);
debug( LOG_NEVER, "damage1=%d damage=%d baseDamage=%d mod=%d (weaponEffect=%d proptype=%d) \n", damage1, damage, baseDamage, Mod, weaponEffect, PropType );
}
#endif
@ -1935,7 +1935,8 @@ STRUCTURE *psStructure;
return(TRUE);
break;
default:
DBERROR(("Weird object type in justBeenHitByEW"));
debug( LOG_ERROR, "Weird object type in justBeenHitByEW" );
abort();
break;
}

View File

@ -152,7 +152,8 @@ BOOL researchInitVars(void)
asResearch = (RESEARCH *)MALLOC(sizeof(RESEARCH)* MAX_RESEARCH);
if (asResearch == NULL)
{
DBERROR(("Research Stats - Out of memory"));
debug( LOG_ERROR, "Research Stats - Out of memory" );
abort();
return FALSE;
}
memset(asResearch, 0, (MAX_RESEARCH * sizeof(RESEARCH)));
@ -164,7 +165,8 @@ BOOL researchInitVars(void)
sizeof(PLAYER_RESEARCH));
if (asPlayerResList[i] == NULL)
{
DBERROR(("Out of memory assigning Player_Research"));
debug( LOG_ERROR, "Out of memory assigning Player_Research" );
abort();
return FALSE;
}
memset(asPlayerResList[i], 0, (MAX_RESEARCH * sizeof(PLAYER_RESEARCH)));
@ -178,7 +180,8 @@ BOOL researchInitVars(void)
//pResearchPR = (UBYTE *) MALLOC(sizeof(UBYTE) * MAX_RESEARCH_PR);
if (pResearchPR == NULL)
{
DBERROR(("Research Stats - Out of memory"));
debug( LOG_ERROR, "Research Stats - Out of memory" );
abort();
return FALSE;
}
//needs to be UWORD sized for the Patches
@ -188,7 +191,8 @@ BOOL researchInitVars(void)
pResearchStructPR = (UWORD *) MALLOC(sizeof(UWORD) * MAX_RESEARCH_STRUCT_PR);
if (pResearchStructPR == NULL)
{
DBERROR(("Research Stats - Out of memory"));
debug( LOG_ERROR, "Research Stats - Out of memory" );
abort();
return FALSE;
}
memset(pResearchStructPR, 0, (MAX_RESEARCH_STRUCT_PR * sizeof(UWORD)));
@ -196,7 +200,8 @@ BOOL researchInitVars(void)
pResearchFunc = (FUNCTION **) MALLOC(sizeof(FUNCTION *) * MAX_RESEARCH_FUNC);
if (pResearchFunc == NULL)
{
DBERROR(("Research Stats - Out of memory"));
debug( LOG_ERROR, "Research Stats - Out of memory" );
abort();
return FALSE;
}
memset(pResearchFunc, 0, (MAX_RESEARCH_FUNC * sizeof(FUNCTION *)));
@ -204,7 +209,8 @@ BOOL researchInitVars(void)
pResearchStructRed = (UWORD *) MALLOC(sizeof(UWORD) * MAX_RESEARCH_STRUCT_RED);
if (pResearchStructRed == NULL)
{
DBERROR(("Research Stats - Out of memory"));
debug( LOG_ERROR, "Research Stats - Out of memory" );
abort();
return FALSE;
}
memset(pResearchStructRed, 0, (MAX_RESEARCH_STRUCT_RED * sizeof(UWORD)));
@ -212,7 +218,8 @@ BOOL researchInitVars(void)
pResearchArteRed = (COMP_BASE_STATS **) MALLOC(sizeof(COMP_BASE_STATS *) * MAX_RESEARCH_ARTE_RED);
if (pResearchArteRed == NULL)
{
DBERROR(("Research Stats - Out of memory"));
debug( LOG_ERROR, "Research Stats - Out of memory" );
abort();
return FALSE;
}
memset(pResearchArteRed, 0, (MAX_RESEARCH_ARTE_RED * sizeof(COMP_BASE_STATS *)));
@ -220,7 +227,8 @@ BOOL researchInitVars(void)
pResearchStructRes = (UWORD *) MALLOC(sizeof(UWORD) * MAX_RESEARCH_STRUCT_RES);
if (pResearchStructRes == NULL)
{
DBERROR(("Research Stats - Out of memory"));
debug( LOG_ERROR, "Research Stats - Out of memory" );
abort();
return FALSE;
}
memset(pResearchStructRes, 0, (MAX_RESEARCH_STRUCT_RES * sizeof(UWORD)));
@ -228,7 +236,8 @@ BOOL researchInitVars(void)
pResearchArteRes = (COMP_BASE_STATS **) MALLOC(sizeof(COMP_BASE_STATS *) * MAX_RESEARCH_ARTE_RES);
if (pResearchArteRes == NULL)
{
DBERROR(("Research Stats - Out of memory"));
debug( LOG_ERROR, "Research Stats - Out of memory" );
abort();
return FALSE;
}
memset(pResearchArteRes, 0, (MAX_RESEARCH_ARTE_RES * sizeof(COMP_BASE_STATS *)));
@ -236,7 +245,8 @@ BOOL researchInitVars(void)
pResearchArteRep = (COMP_BASE_STATS **) MALLOC(sizeof(COMP_BASE_STATS *) * MAX_RESEARCH_ARTE_RES);
if (pResearchArteRep == NULL)
{
DBERROR(("Research Stats - Out of memory"));
debug( LOG_ERROR, "Research Stats - Out of memory" );
abort();
return FALSE;
}
memset(pResearchArteRep, 0, (MAX_RESEARCH_ARTE_RES * sizeof(COMP_BASE_STATS *)));
@ -440,7 +450,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
if (techCode > 1)
//if (pResearch->techCode != TC_MAJOR AND pResearch->techCode != TC_MINOR)
{
DBERROR(("Invalid tech code for research topic - %s ", getResearchName(pResearch)));
debug( LOG_ERROR, "Invalid tech code for research topic - %s ", getResearchName(pResearch) );
abort();
return FALSE;
}
if (techCode == 0)
@ -478,8 +489,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}
else
{
DBERROR(("Cannot find the structure Stat for Research %s",
getResearchName(pResearch)));
debug( LOG_ERROR, "Cannot find the structure Stat for Research %s", getResearchName(pResearch) );
abort();
return FALSE;
}
}
@ -493,8 +504,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}
else
{
DBERROR(("Cannot find the component Stat for Research %s",
getResearchName(pResearch)));
debug( LOG_ERROR, "Cannot find the component Stat for Research %s", getResearchName(pResearch) );
abort();
return FALSE;
}
}
@ -507,7 +518,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
pResearch->pIMD = (iIMDShape *) resGetData("IMD", imdName);
if (pResearch->pIMD == NULL)
{
DBERROR(("Cannot find the research PIE for record %s", getResearchName(pResearch)));
debug( LOG_ERROR, "Cannot find the research PIE for record %s", getResearchName(pResearch) );
abort();
return FALSE;
}
}
@ -521,7 +533,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
pResearch->pIMD2 = (iIMDShape *) resGetData("IMD", imdName2);
if (pResearch->pIMD2 == NULL)
{
DBERROR(("Cannot find the 2nd research PIE for record %s", getResearchName(pResearch)));
debug( LOG_ERROR, "Cannot find the 2nd research PIE for record %s", getResearchName(pResearch) );
abort();
return FALSE;
}
}
@ -536,7 +549,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
//check its a major tech code
if (pResearch->techCode != TC_MAJOR)
{
DBERROR(("This research should not have a message associated with it, %s the message will be ignored!", getResearchName(pResearch)));
debug( LOG_ERROR, "This research should not have a message associated with it, %s the message will be ignored!", getResearchName(pResearch) );
abort();
}
else
{
@ -556,7 +570,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}*/
if (numResearchArteRed >= MAX_RESEARCH_ARTE_RED)
{
DBERROR(("Out of memory assigning research artefacts - redundancies"));
debug( LOG_ERROR, "Out of memory assigning research artefacts - redundancies" );
abort();
return FALSE;
}
//don't MALLOC - get them from the pre-defined arrays
@ -577,7 +592,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}*/
if (numResearchArteRed >= MAX_RESEARCH_ARTE_RES)
{
DBERROR(("Out of memory assigning research artefacts - results"));
debug( LOG_ERROR, "Out of memory assigning research artefacts - results" );
abort();
return FALSE;
}
//don't MALLOC - get them from the pre-defined arrays
@ -599,7 +615,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}*/
if (numResearchArteRep >= MAX_RESEARCH_ARTE_RES)
{
DBERROR(("Out of memory assigning research artefacts - replacements"));
debug( LOG_ERROR, "Out of memory assigning research artefacts - replacements" );
abort();
return FALSE;
}
//don't MALLOC - get them from the pre-defined arrays
@ -621,7 +638,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}*/
if (numResearchFunc >= MAX_RESEARCH_FUNC)
{
DBERROR(("Out of memory assigning research functions"));
debug( LOG_ERROR, "Out of memory assigning research functions" );
abort();
return FALSE;
}
//don't MALLOC - get them from the pre-defined arrays
@ -643,7 +661,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}*/
if (numResearchPR >= MAX_RESEARCH_PR)
{
DBERROR(("Out of memory assigning research pre-requisities"));
debug( LOG_ERROR, "Out of memory assigning research pre-requisities" );
abort();
return FALSE;
}
//don't MALLOC - get them from the pre-defined arrays
@ -668,7 +687,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}*/
if (numResearchStructPR >= MAX_RESEARCH_STRUCT_PR)
{
DBERROR(("Out of memory assigning research structures - requirements"));
debug( LOG_ERROR, "Out of memory assigning research structures - requirements" );
abort();
return FALSE;
}
//don't MALLOC - get them from the pre-defined arrays
@ -690,7 +710,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}*/
if (numResearchStructRed >= MAX_RESEARCH_STRUCT_RED)
{
DBERROR(("Out of memory assigning research structures - redundancies"));
debug( LOG_ERROR, "Out of memory assigning research structures - redundancies" );
abort();
return FALSE;
}
//don't MALLOC - get them from the pre-defined arrays
@ -711,7 +732,8 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
}*/
if (numResearchStructRes >= MAX_RESEARCH_STRUCT_RES)
{
DBERROR(("Out of memory assigning research structures - results"));
debug( LOG_ERROR, "Out of memory assigning research structures - results" );
abort();
return FALSE;
}
//don't MALLOC - get them from the pre-defined arrays
@ -724,8 +746,9 @@ BOOL loadResearch(char *pResearchData, UDWORD bufferSize)
//set the researchPoints
if (resPoints > UWORD_MAX)
{
DBERROR(("Research Points too high for research topic - %s ",
getResearchName(pResearch)));
debug( LOG_ERROR, "Research Points too high for research topic - %s ",
getResearchName(pResearch) );
abort();
return FALSE;
}
pResearch->researchPoints = (UWORD)resPoints;
@ -832,8 +855,8 @@ BOOL loadResearchPR(char *pPRData, UDWORD bufferSize)
if ((pResearch[incR].storeCount + 1) >
(SDWORD)pResearch[incR].numPRRequired)
{
DBERROR(("Trying to allocate more pre-requisites than allowed for research %s",
getResearchName(pResearch)));
debug( LOG_ERROR, "Trying to allocate more pre-requisites than allowed for research %s", getResearchName(pResearch) );
abort();
return FALSE;
}
//PRresearch found alloc this to the current Research
@ -849,7 +872,8 @@ BOOL loadResearchPR(char *pPRData, UDWORD bufferSize)
//if pre-requisite not found - error
if (!recFound)
{
DBERROR(("Unable to find Pre-requisite %s for research %s", PRName, ResearchName ));
debug( LOG_ERROR, "Unable to find Pre-requisite %s for research %s", PRName, ResearchName );
abort();
return FALSE;
}
else
@ -861,7 +885,8 @@ BOOL loadResearchPR(char *pPRData, UDWORD bufferSize)
//if Research not found - error
if (!recFound)
{
DBERROR(("Unable to find Research %s", ResearchName));
debug( LOG_ERROR, "Unable to find Research %s", ResearchName );
abort();
return FALSE;
}
//quick check that haven't reached maxPR
@ -967,7 +992,8 @@ BOOL loadResearchArtefacts(char *pArteData, UDWORD bufferSize, UDWORD listNumber
maxArtefacts = pResearch->numArteResults;
break;
default:
DBERROR(("Unknown research list"));
debug( LOG_ERROR, "Unknown research list" );
abort();
return FALSE;
}
//deal with extra data
@ -999,8 +1025,8 @@ BOOL loadResearchArtefacts(char *pArteData, UDWORD bufferSize, UDWORD listNumber
//check the old and new types are the same
if (statType(pArtefact->ref) != newType)
{
DBERROR(("You are trying to replace one type of component with \
a different type for research %s in ResultComponents.txt", ResearchName));
debug( LOG_ERROR, "You are trying to replace one type of component with a different type for research %s in ResultComponents.txt", ResearchName );
abort();
return FALSE;
}
//ArtefactResearch found - alloc the artefact to the current Research topic
@ -1009,15 +1035,16 @@ BOOL loadResearchArtefacts(char *pArteData, UDWORD bufferSize, UDWORD listNumber
}
break;
default:
DBERROR(("Unknown research list"));
debug( LOG_ERROR, "Unknown research list" );
abort();
return FALSE;
}
//check not allocating more than allowed
if (pResearch->storeCount > maxArtefacts)
{
DBERROR(("Trying to allocate more artefacts than allowed for research %s",
getResearchName(pResearch)));
debug( LOG_ERROR, "Trying to allocate more artefacts than allowed for research %s", getResearchName(pResearch) );
abort();
return FALSE;
}
pResearch->storeCount++;
@ -1152,7 +1179,8 @@ BOOL loadResearchStructures(char *pStructData, UDWORD bufferSize,UDWORD listNumb
break;
default:
/* NO DEFAULT CASE? Alex.... Here ya go - just for you...*/
DBERROR(("Unknown research list"));
debug( LOG_ERROR, "Unknown research list" );
abort();
return FALSE;
}
recFound = TRUE;
@ -1160,7 +1188,8 @@ BOOL loadResearchStructures(char *pStructData, UDWORD bufferSize,UDWORD listNumb
if (pResearch[incR].storeCount >
(SDWORD)numToFind)
{
DBERROR(("Trying to allocate more Structures than allowed for research %s",getResearchName(pResearch)));
debug( LOG_ERROR, "Trying to allocate more Structures than allowed for research %s", getResearchName(pResearch) );
abort();
return FALSE;
}
pResearch[incR].storeCount++;
@ -1170,8 +1199,8 @@ BOOL loadResearchStructures(char *pStructData, UDWORD bufferSize,UDWORD listNumb
//if Structure not found - error
if (!recFound)
{
DBERROR(("Unable to find Structure %s for research %s",
StructureName, ResearchName));
debug( LOG_ERROR, "Unable to find Structure %s for research %s", StructureName, ResearchName );
abort();
return FALSE;
}
else
@ -1183,7 +1212,8 @@ BOOL loadResearchStructures(char *pStructData, UDWORD bufferSize,UDWORD listNumb
//if Research not found - error
if (!recFound)
{
DBERROR(("Unable to allocate all Research Structures for %s", ResearchName));
debug( LOG_ERROR, "Unable to allocate all Research Structures for %s", ResearchName );
abort();
return FALSE;
}
@ -1278,8 +1308,8 @@ BOOL loadResearchFunctions(char *pFunctionData, UDWORD bufferSize)
if (pResearch[incR].storeCount >
(SDWORD)pResearch[incR].numFunctions)
{
DBERROR(("Trying to allocate more Functions than allowed \
for research %s", ResearchName));
debug( LOG_ERROR, "Trying to allocate more Functions than allowed for research %s", ResearchName );
abort();
return FALSE;
}
pResearch[incR].storeCount++;
@ -1289,8 +1319,8 @@ BOOL loadResearchFunctions(char *pFunctionData, UDWORD bufferSize)
//if Function not found - error
if (!recFound)
{
DBERROR(("Unable to find Function %s for research %s",
FunctionName, ResearchName));
debug( LOG_ERROR, "Unable to find Function %s for research %s", FunctionName, ResearchName );
abort();
return FALSE;
}
else
@ -1302,7 +1332,8 @@ BOOL loadResearchFunctions(char *pFunctionData, UDWORD bufferSize)
//if Research not found - error
if (!recFound)
{
DBERROR(("Unable to allocate all research Functions for %s", ResearchName));
debug( LOG_ERROR, "Unable to allocate all research Functions for %s", ResearchName );
abort();
return FALSE;
}
//quick check that haven't reached maxPR
@ -2279,7 +2310,7 @@ void CancelAllResearch(UDWORD pl)
&& ( ((RESEARCH_FACILITY *)psCurr->pFunctionality)->psSubject !=NULL )
)
{
DBPRINTF(("canceling research for %p\n",psCurr));
debug( LOG_NEVER, "canceling research for %p\n", psCurr );
cancelResearch(psCurr);
}
}
@ -2380,7 +2411,7 @@ static UWORD setIconIDFromHashedName(STRING *pIconName, UDWORD NameHash)
//add more names as images are created
// ASSERT((FALSE, "Invalid icon graphic %s for topic %s", pIconName, pName));
DBPRINTF(("Failed to matched research icon %s #%d\n",pIconName,IconHash));
debug( LOG_NEVER, "Failed to matched research icon %s #%d\n", pIconName, IconHash );
return 0; // Should never get here.
}
@ -2717,7 +2748,8 @@ COMP_BASE_STATS * getComponentDetails(STRING *pName, STRING *pCompName)
default:
{
//COMP_UNKNOWN should be an error
DBERROR(("Unknown artefact type - %s",pName));
debug( LOG_ERROR, "Unknown artefact type - %s", pName );
abort();
return FALSE;
}
}
@ -2741,7 +2773,8 @@ COMP_BASE_STATS * getComponentDetails(STRING *pName, STRING *pCompName)
pArtefact = (COMP_BASE_STATS*)address;
}
DBERROR(("Cannot find component %s",pCompName));
debug( LOG_ERROR, "Cannot find component %s", pCompName );
abort();
return NULL;
}
@ -2895,7 +2928,8 @@ void replaceComponent(COMP_BASE_STATS *pNewComponent, COMP_BASE_STATS *pOldCompo
break;
default:
//unknown comp type
DBERROR(("Unknown component type - invalid Template"));
debug( LOG_ERROR, "Unknown component type - invalid Template" );
abort();
return;
}
}
@ -3440,7 +3474,8 @@ void switchComponent(DROID *psDroid, UDWORD oldType, UDWORD oldCompInc,
break;
default:
//unknown comp type
DBERROR(("Unknown component type - invalid droid"));
debug( LOG_ERROR, "Unknown component type - invalid droid" );
abort();
return;
}
}

View File

@ -148,7 +148,8 @@ void scoreUpdateVar( DATA_INDEX var )
missionData.babasMowedDown++; // Ran over a barbarian
break;
default:
DBERROR(("Weirdy variable request from scoreUpdateVar"));
debug( LOG_ERROR, "Weirdy variable request from scoreUpdateVar" );
abort();
break;
}
}
@ -472,7 +473,8 @@ SCORE_SAVEHEADER *psHeader; // Pointer to the header part of the file
if(!pFileData)
{
/* Nope, so do one */
DBERROR(("Saving Score data : Cannot get the memory! (%d)",fileSize));
debug( LOG_ERROR, "Saving Score data : Cannot get the memory! (%d)", fileSize );
abort();
return(FALSE);
}
@ -516,9 +518,8 @@ MISSION_DATA *pScoreData;
psHeader = (SCORE_SAVEHEADER *)pFileData;
if (psHeader->aFileType[0] != 's' || psHeader->aFileType[1] != 'c' ||
psHeader->aFileType[2] != 'd' || psHeader->aFileType[3] != 'a') {
DBERROR(("Read Score data : Weird file type found? Has header letters \
- %c %c %c %c", psHeader->aFileType[0],psHeader->aFileType[1],
psHeader->aFileType[2],psHeader->aFileType[3]));
debug( LOG_ERROR, "Read Score data : Weird file type found? Has header letters - %c %c %c %c", psHeader->aFileType[0],psHeader->aFileType[1], psHeader->aFileType[2],psHeader->aFileType[3] );
abort();
return FALSE;
}
@ -529,7 +530,8 @@ MISSION_DATA *pScoreData;
if(fileSize!=expectedFileSize)
{
/* No, so bomb out */
DBERROR(("Read Score data : Weird file size!"));
debug( LOG_ERROR, "Read Score data : Weird file size!" );
abort();
return(FALSE);
}

View File

@ -1417,7 +1417,8 @@ BOOL scrSkCanBuildTemplate(void)
case DROID_DEFAULT: // Default droid
case DROID_ANY:
default:
DBERROR(("scrSkCanBuildTemplate: Unhandled template type"));
debug( LOG_ERROR, "scrSkCanBuildTemplate: Unhandled template type" );
abort();
break;
}

View File

@ -882,7 +882,7 @@ BOOL scrAddDroidToMissionList(void)
#ifdef SCRIPT_CHECK_MAX_UNITS
// Don't build a new droid if player limit reached, unless it's a transporter.
if( IsPlayerDroidLimitReached(player) && (psTemplate->droidType != DROID_TRANSPORTER) ) {
DBPRINTF(("scrAddUnit : Max units reached ,player %d\n",player));
debug( LOG_NEVER, "scrAddUnit : Max units reached ,player %d\n", player );
psDroid = NULL;
} else
#endif
@ -934,7 +934,7 @@ BOOL scrAddDroid(void)
#ifdef SCRIPT_CHECK_MAX_UNITS
// Don't build a new droid if player limit reached, unless it's a transporter.
if( IsPlayerDroidLimitReached(player) && (psTemplate->droidType != DROID_TRANSPORTER) ) {
DBPRINTF(("scrAddUnit : Max units reached ,player %d\n",player));
debug( LOG_NEVER, "scrAddUnit : Max units reached ,player %d\n", player );
psDroid = NULL;
} else
#endif
@ -1175,7 +1175,7 @@ BOOL scrNumMB(void)
/* gameTimeStop();
DBERROR(("scrNumMB: called by script with value: %d", val));
gameTimeStart();*/
DBPRINTF(("scrNumMB: called by script with value: %d\n", val));
debug( LOG_NEVER, "scrNumMB: called by script with value: %d\n", val );
return TRUE;
}
@ -1687,7 +1687,7 @@ BOOL scrGetFeature(void)
// check to see if badly called
if(psFeatureStatToFind[bucket] == NULL)
{
DBPRINTF(("invalid feature to find. possibly due to save game\n"));
debug( LOG_NEVER, "invalid feature to find. possibly due to save game\n" );
if(!stackPushResult((INTERP_TYPE)ST_FEATURE,(SDWORD)NULL))
{
ASSERT((FALSE, "scrGetFeature: Failed to push result"));
@ -3527,7 +3527,8 @@ BOOL scrStartMission(void)
// find the level dataset
if (!levFindDataSet(pGame, &psNewLevel))
{
DBERROR(("scrStartMission: couldn't find level data"));
debug( LOG_ERROR, "scrStartMission: couldn't find level data" );
abort();
return FALSE;
}
@ -3784,7 +3785,7 @@ BOOL scrRefTest(void)
return FALSE;
}
DBPRINTF(("scrRefTest: num: %d \n", Num));
debug( LOG_NEVER, "scrRefTest: num: %d \n", Num );
return TRUE;
}
@ -5640,11 +5641,11 @@ BOOL scrGetGameStatus(void)
if (result==TRUE)
{
DBPRINTF(("battle map active"));
debug( LOG_NEVER, "battle map active" );
}
else
{
DBPRINTF(("battle map notactive"));
debug( LOG_NEVER, "battle map notactive" );
}
@ -5929,7 +5930,7 @@ BOOL scrTakeOverSingleStructure(void)
if (playerToGain == (SDWORD)selectedPlayer AND StructIsFactory(psStructToTake) AND
asStructLimits[playerToGain][structureInc].currentQuantity >= MAX_FACTORY)
{
DBPRINTF(("scrTakeOverSingleStructure - factory ignored for selectedPlayer\n"));
debug( LOG_NEVER, "scrTakeOverSingleStructure - factory ignored for selectedPlayer\n" );
psNewStruct = NULL;
}
else
@ -6017,7 +6018,7 @@ BOOL scrTakeOverStructsInArea(void)
if (toPlayer == (SDWORD)selectedPlayer AND StructIsFactory(psStruct) AND
asStructLimits[toPlayer][structureInc].currentQuantity >= MAX_FACTORY)
{
DBPRINTF(("scrTakeOverStructsInArea - factory ignored for selectedPlayer\n"));
debug( LOG_NEVER, "scrTakeOverStructsInArea - factory ignored for selectedPlayer\n" );
}
else
{
@ -6302,7 +6303,8 @@ BOOL scrTutorialTemplates(void)
strcpy(pName,"ViperLtMGWheels");
if (!getResourceName(pName))
{
DBERROR(("tutorial template setup failed"));
debug( LOG_ERROR, "tutorial template setup failed" );
abort();
return FALSE;
}
@ -6336,7 +6338,8 @@ BOOL scrTutorialTemplates(void)
}
else
{
DBERROR(("tutorial template setup failed"));
debug( LOG_ERROR, "tutorial template setup failed" );
abort();
return FALSE;
}
return TRUE;

View File

@ -546,7 +546,8 @@ STRING *scrGetStatName(INTERP_TYPE type, UDWORD data)
if (pName == NULL)
{
DBERROR(("scrGetStatName: cannot get name for a base stat"));
debug( LOG_ERROR, "scrGetStatName: cannot get name for a base stat" );
abort();
}
return pName;
@ -811,7 +812,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
{
if (!scrvGetBaseObj(*((UDWORD*)pBuffer), (BASE_OBJECT **)pData))
{
DBERROR(("scrValDefLoad: couldn't find object id %d", *((UDWORD*)pBuffer)));
debug( LOG_ERROR, "scrValDefLoad: couldn't find object id %d", *((UDWORD*)pBuffer) );
abort();
}
}
break;
@ -822,7 +824,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getStructStatFromName((char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find structure stat %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find structure stat %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -831,7 +834,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getFeatureStatFromName((char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find feature stat %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find feature stat %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -840,7 +844,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getCompFromResName(COMP_BODY, (char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find body component %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find body component %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -849,7 +854,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getCompFromResName(COMP_PROPULSION, (char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find propulsion component %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find propulsion component %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -858,7 +864,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getCompFromResName(COMP_ECM, (char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find ECM component %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find ECM component %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -867,7 +874,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getCompFromResName(COMP_SENSOR, (char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find sensor component %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find sensor component %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -876,7 +884,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getCompFromResName(COMP_CONSTRUCT, (char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find constructor component %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find constructor component %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -885,7 +894,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getCompFromResName(COMP_WEAPON, (char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find weapon %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find weapon %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -894,7 +904,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getCompFromResName(COMP_REPAIRUNIT, (char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find repair component %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find repair component %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -903,7 +914,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = getCompFromResName(COMP_BRAIN, (char *)pBuffer);
if (index == -1)
{
DBERROR(("scrValDefLoad: couldn't find repair brain %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find repair brain %s", pBuffer );
abort();
index = 0;
}
*pData = (UDWORD)index;
@ -919,7 +931,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
*((DROID_TEMPLATE **)pData) = IdToTemplate(id, ANYPLAYER);
if (*pData == 0)
{
DBERROR(("scrValDefLoad: couldn't find template id %d", *((UDWORD *)pBuffer)));
debug( LOG_ERROR, "scrValDefLoad: couldn't find template id %d", *((UDWORD *)pBuffer) );
abort();
}
}
break;
@ -943,7 +956,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
{
if (!levFindDataSet((char *)pBuffer, &psLevel))
{
DBERROR(("scrValDefLoad: couldn't find level dataset %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find level dataset %s", pBuffer );
abort();
}
*((STRING **)pData) = psLevel->pName;
}
@ -959,7 +973,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
*pData = (UDWORD)getResearch((char *)pBuffer, TRUE);
if (*pData == 0)
{
DBERROR(("scrValDefLoad: couldn't find research %s", pBuffer));
debug( LOG_ERROR, "scrValDefLoad: couldn't find research %s", pBuffer );
abort();
}
}
break;
@ -968,7 +983,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
{
if (!grpCreate((DROID_GROUP **)pData))
{
DBERROR(("scrValDefLoad: out of memory"));
debug( LOG_ERROR, "scrValDefLoad: out of memory" );
abort();
break;
}
grpJoin(*((DROID_GROUP **)pData), NULL);
@ -1019,7 +1035,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
{
if (!scrvGetBaseObj(*((UDWORD*)pPos), (BASE_OBJECT **)&psCDroid))
{
DBERROR(("scrValDefLoad: couldn't find object id %d", *((UDWORD*)pBuffer)));
debug( LOG_ERROR, "scrValDefLoad: couldn't find object id %d", *((UDWORD*)pBuffer) );
abort();
}
else
{
@ -1039,7 +1056,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size,
index = audio_GetAvailableID();
if (index == SAMPLE_NOT_ALLOCATED)
{
DBERROR(("Sound ID not available %s not found", pBuffer));
debug( LOG_ERROR, "Sound ID not available %s not found", pBuffer );
abort();
break;
}
// set track vals

View File

@ -83,13 +83,15 @@ BOOL scrvAddContext(STRING *pID, SCRIPT_CONTEXT *psContext, SCRV_TYPE type)
psNew = MALLOC(sizeof(SCRV_STORE));
if (!psNew)
{
DBERROR(("scrvAddContext: Out of memory"));
debug( LOG_ERROR, "scrvAddContext: Out of memory" );
abort();
return FALSE;
}
psNew->pIDString = MALLOC(strlen(pID) + 1);
if (!psNew->pIDString)
{
DBERROR(("scrvAddContext: Out of memory"));
debug( LOG_ERROR, "scrvAddContext: Out of memory" );
abort();
return FALSE;
}
strcpy(psNew->pIDString, pID);
@ -209,7 +211,8 @@ BOOL scrvGetContext(STRING *pID, SCRIPT_CONTEXT **ppsContext)
}
}
DBERROR(("scrvGetContext: couldn't find context for id: %s", pID));
debug( LOG_ERROR, "scrvGetContext: couldn't find context for id: %s", pID );
abort();
return FALSE;
}
@ -240,7 +243,8 @@ BOOL scrvGetString(STRING *pStringID, STRING **ppString)
//get the ID for the string
if (!strresGetIDNum(psStringRes, pStringID, &id))
{
DBERROR(("Cannot find the string id %s ", pStringID));
debug( LOG_ERROR, "Cannot find the string id %s ", pStringID );
abort();
return FALSE;
}
//get the string from the id

View File

@ -152,7 +152,8 @@ int scrv_wrap(void)
{
if (inComment)
{
DBERROR(("Warning: reached end of file in a comment"));
debug( LOG_ERROR, "Warning: reached end of file in a comment" );
abort();
}
return 1;
}

View File

@ -684,7 +684,7 @@ BOOL seq_UpdateFullScreenVideo(CLEAR_MODE *pbClear)
}
else if (frame < 0) //an ERROR
{
DBPRINTF(("VIDEO FRAME ERROR %d\n",frame));
debug( LOG_NEVER, "VIDEO FRAME ERROR %d\n", frame );
return FALSE;
}

View File

@ -144,7 +144,8 @@ static char NotUsedString[50]; // Dummy area for scanf
(list) = (type *)MALLOC(sizeof(type) * (numEntries)); \
if ((list) == NULL) \
{ \
DBERROR(("Out of memory")); \
debug( LOG_ERROR, "Out of memory" ); \
abort(); \
return FALSE; \
} \
(listSize) = (numEntries); \
@ -564,7 +565,7 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
#define DEFAULT_FLIGHTSPEED (500)
if (psStats->flightSpeed==0)
{
DBPRINTF(("STATS: Zero Flightspeed for %s - using default of %d\n",WeaponName,DEFAULT_FLIGHTSPEED));
debug( LOG_NEVER, "STATS: Zero Flightspeed for %s - using default of %d\n", WeaponName, DEFAULT_FLIGHTSPEED );
psStats->flightSpeed=DEFAULT_FLIGHTSPEED;
}
@ -596,7 +597,8 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
if (psStats->pIMD == NULL)
{
DBERROR(("Cannot find the weapon PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the weapon PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -610,7 +612,8 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
psStats->pMountGraphic = (iIMDShape *) resGetData("IMD", mountGfx);
if (psStats->pMountGraphic == NULL)
{
DBERROR(("Cannot find the mount PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the mount PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -625,7 +628,8 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
psStats->pMuzzleGraphic = (iIMDShape *) resGetData("IMD", muzzleGfx);
if (psStats->pMuzzleGraphic == NULL)
{
DBERROR(("Cannot find the muzzle PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the muzzle PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
@ -633,28 +637,32 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
psStats->pInFlightGraphic = (iIMDShape *) resGetData("IMD", flightGfx);
if (psStats->pInFlightGraphic == NULL)
{
DBERROR(("Cannot find the flight PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the flight PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
psStats->pTargetHitGraphic = (iIMDShape *) resGetData("IMD", hitGfx);
if (psStats->pTargetHitGraphic == NULL)
{
DBERROR(("Cannot find the target hit PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the target hit PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
psStats->pTargetMissGraphic = (iIMDShape *) resGetData("IMD", missGfx);
if (psStats->pTargetMissGraphic == NULL)
{
DBERROR(("Cannot find the target miss PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the target miss PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
psStats->pWaterHitGraphic = (iIMDShape *) resGetData("IMD", waterGfx);
if (psStats->pWaterHitGraphic == NULL)
{
DBERROR(("Cannot find the water hit PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the water hit PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
//trail graphic can be null
@ -663,7 +671,8 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
psStats->pTrailGraphic = (iIMDShape *) resGetData("IMD", trailGfx);
if (psStats->pTrailGraphic == NULL)
{
DBERROR(("Cannot find the trail PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the trail PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -688,7 +697,8 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
}
else
{
DBERROR(("Invalid fire on move flag for weapon %s", getStatName(psStats)));
debug( LOG_ERROR, "Invalid fire on move flag for weapon %s", getStatName(psStats) );
abort();
return FALSE;
}
@ -713,7 +723,8 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
}
else
{
DBERROR(("Invalid weapon class for weapon %s", getStatName(psStats)));
debug( LOG_ERROR, "Invalid weapon class for weapon %s", getStatName(psStats) );
abort();
return FALSE;
}
@ -735,8 +746,8 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
psStats->weaponEffect = getWeaponEffect(weaponEffect);
if (psStats->weaponEffect == INVALID_WEAPON_EFFECT)
{
DBERROR(("loadWepaonStats: Invalid weapon effect for weapon %s",
getStatName(psStats)));
debug( LOG_ERROR, "loadWepaonStats: Invalid weapon effect for weapon %s", getStatName(psStats) );
abort();
return FALSE;
}
@ -873,13 +884,11 @@ BOOL loadWeaponStats(char *pWeaponData, UDWORD bufferSize)
}
if (psStats->shortRange > longRange)
{
DBPRINTF(("%s, flight speed is too low to reach short range (max range %d)\n",
WeaponName, longRange));
debug( LOG_NEVER, "%s, flight speed is too low to reach short range (max range %d)\n", WeaponName, longRange );
}
else if (psStats->longRange > longRange)
{
DBPRINTF(("%s, flight speed is too low to reach long range (max range %d)\n",
WeaponName, longRange));
debug( LOG_NEVER, "%s, flight speed is too low to reach long range (max range %d)\n", WeaponName, longRange );
}
//set the weapon sounds to default value
@ -1088,7 +1097,8 @@ BOOL loadBodyStats(char *pBodyData, UDWORD bufferSize)
psStats->pIMD = (iIMDShape *) resGetData("IMD", GfxFile);
if (psStats->pIMD == NULL)
{
DBERROR(("Cannot find the body PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the body PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -1103,7 +1113,8 @@ BOOL loadBodyStats(char *pBodyData, UDWORD bufferSize)
psStats->pFlameIMD = (iIMDShape *) resGetData("IMD", flameIMD);
if (psStats->pFlameIMD == NULL)
{
DBERROR(("Cannot find the flame PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the flame PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -1205,8 +1216,8 @@ BOOL loadBrainStats(char *pBrainData, UDWORD bufferSize)
//if weapon not found - error
if (incW == -1)
{
DBERROR(("Unable to find Weapon %s for brain %s",
weaponName, BrainName));
debug( LOG_ERROR, "Unable to find Weapon %s for brain %s", weaponName, BrainName );
abort();
return FALSE;
}
else
@ -1440,7 +1451,8 @@ BOOL loadPropulsionStats(char *pPropulsionData, UDWORD bufferSize)
psStats->pIMD = (iIMDShape *) resGetData("IMD", imdName);
if (psStats->pIMD == NULL)
{
DBERROR(("Cannot find the propulsion PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the propulsion PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -1453,8 +1465,8 @@ BOOL loadPropulsionStats(char *pPropulsionData, UDWORD bufferSize)
psStats->propulsionType = getPropulsionType(type);
if (psStats->propulsionType == INVALID_PROP_TYPE)
{
DBERROR(("loadPropulsionStats: Invalid Propulsion type for %s",
getStatName(psStats)));
debug( LOG_ERROR, "loadPropulsionStats: Invalid Propulsion type for %s", getStatName(psStats) );
abort();
return FALSE;
}
@ -1625,7 +1637,8 @@ BOOL loadSensorStats(char *pSensorData, UDWORD bufferSize)
psStats->pIMD = (iIMDShape *) resGetData("IMD", GfxFile);
if (psStats->pIMD == NULL)
{
DBERROR(("Cannot find the sensor PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the sensor PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -1639,7 +1652,8 @@ BOOL loadSensorStats(char *pSensorData, UDWORD bufferSize)
psStats->pMountGraphic = (iIMDShape *) resGetData("IMD", mountGfx);
if (psStats->pMountGraphic == NULL)
{
DBERROR(("Cannot find the mount PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the mount PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -1765,7 +1779,8 @@ BOOL loadECMStats(char *pECMData, UDWORD bufferSize)
psStats->pIMD = (iIMDShape *) resGetData("IMD", GfxFile);
if (psStats->pIMD == NULL)
{
DBERROR(("Cannot find the ECM PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the ECM PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -1779,7 +1794,8 @@ BOOL loadECMStats(char *pECMData, UDWORD bufferSize)
psStats->pMountGraphic = (iIMDShape *) resGetData("IMD", mountGfx);
if (psStats->pMountGraphic == NULL)
{
DBERROR(("Cannot find the mount PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the mount PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -1910,7 +1926,8 @@ BOOL loadRepairStats(char *pRepairData, UDWORD bufferSize)
psStats->pIMD = (iIMDShape *) resGetData("IMD", GfxFile);
if (psStats->pIMD == NULL)
{
DBERROR(("Cannot find the Repair PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the Repair PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -1924,7 +1941,8 @@ BOOL loadRepairStats(char *pRepairData, UDWORD bufferSize)
psStats->pMountGraphic = (iIMDShape *) resGetData("IMD", mountGfx);
if (psStats->pMountGraphic == NULL)
{
DBERROR(("Cannot find the Repair mount PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the Repair mount PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -2093,7 +2111,8 @@ BOOL loadConstructStats(char *pConstructData, UDWORD bufferSize)
psStats->pIMD = (iIMDShape *) resGetData("IMD", GfxFile);
if (psStats->pIMD == NULL)
{
DBERROR(("Cannot find the constructor PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the constructor PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -2107,7 +2126,8 @@ BOOL loadConstructStats(char *pConstructData, UDWORD bufferSize)
psStats->pMountGraphic = (iIMDShape *) resGetData("IMD", mountGfx);
if (psStats->pMountGraphic == NULL)
{
DBERROR(("Cannot find the mount PIE for record %s", getStatName(psStats)));
debug( LOG_ERROR, "Cannot find the mount PIE for record %s", getStatName(psStats) );
abort();
return FALSE;
}
}
@ -2155,7 +2175,8 @@ BOOL loadPropulsionTypes(char *pPropTypeData, UDWORD bufferSize)
asPropulsionTypes = (PROPULSION_TYPES *)MALLOC(sizeof(PROPULSION_TYPES)*NumTypes);
if (asPropulsionTypes == NULL)
{
DBERROR(("PropulsionTypes - Out of memory"));
debug( LOG_ERROR, "PropulsionTypes - Out of memory" );
abort();
return FALSE;
}
@ -2186,8 +2207,8 @@ BOOL loadPropulsionTypes(char *pPropTypeData, UDWORD bufferSize)
type = getPropulsionType(PropulsionName);
if (type == INVALID_PROP_TYPE)
{
DBERROR(("loadPropulsionTypes: Invalid Propulsion type - %s",
PropulsionName));
debug( LOG_ERROR, "loadPropulsionTypes: Invalid Propulsion type - %s", PropulsionName );
abort();
return FALSE;
}
@ -2253,7 +2274,8 @@ BOOL loadTerrainTable(char *pTerrainTableData, UDWORD bufferSize)
if (asTerrainTable == NULL)
{
DBERROR(("Terrain Types - Out of memory"));
debug( LOG_ERROR, "Terrain Types - Out of memory" );
abort();
return FALSE;
}
@ -2293,7 +2315,8 @@ BOOL loadTerrainTable(char *pTerrainTableData, UDWORD bufferSize)
pTerrainTable = asTerrainTable + (i * NUM_PROP_TYPES + j);
if (pTerrainTable->speedFactor == 0)
{
DBERROR(("loadTerrainTable: Invalid propulsion/terrain table entry"));
debug( LOG_ERROR, "loadTerrainTable: Invalid propulsion/terrain table entry" );
abort();
return FALSE;
}
}
@ -2320,7 +2343,8 @@ BOOL loadSpecialAbility(char *pSAbilityData, UDWORD bufferSize)
if (asSpecialAbility == NULL)
{
DBERROR(("SpecialAbility - Out of memory"));
debug( LOG_ERROR, "SpecialAbility - Out of memory" );
abort();
return FALSE;
}
@ -2338,14 +2362,16 @@ BOOL loadSpecialAbility(char *pSAbilityData, UDWORD bufferSize)
//check that the data is ordered in the way it will be stored
if (accessID != i)
{
DBERROR(("The Special Ability sequence is invalid"));
debug( LOG_ERROR, "The Special Ability sequence is invalid" );
abort();
return FALSE;
}
//allocate storage for the name
asSpecialAbility->pName = (STRING *)MALLOC((strlen(SAbilityName))+1);
if (asSpecialAbility->pName == NULL)
{
DBERROR(("Special Ability Name - Out of memory"));
debug( LOG_ERROR, "Special Ability Name - Out of memory" );
abort();
return FALSE;
}
strcpy(asSpecialAbility->pName,SAbilityName);
@ -2391,7 +2417,8 @@ BOOL loadBodyPropulsionIMDs(char *pData, UDWORD bufferSize)
NUM_PROP_SIDES * sizeof(iIMDShape *));
if (psBodyStat->ppIMDList == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
}
//initialise the pointer space
memset(psBodyStat->ppIMDList, 0, (numPropulsionStats *
@ -2443,7 +2470,8 @@ BOOL loadBodyPropulsionIMDs(char *pData, UDWORD bufferSize)
}
if (!found)
{
DBERROR(("loadBodyPropulsionPIEs: Invalid body name %s", bodyName));
debug( LOG_ERROR, "loadBodyPropulsionPIEs: Invalid body name %s", bodyName );
abort();
return FALSE;
}
@ -2473,7 +2501,8 @@ BOOL loadBodyPropulsionIMDs(char *pData, UDWORD bufferSize)
}
if (!found)
{
DBERROR(("Invalid propulsion name %s", propulsionName));
debug( LOG_ERROR, "Invalid propulsion name %s", propulsionName );
abort();
return FALSE;
}
@ -2485,7 +2514,8 @@ BOOL loadBodyPropulsionIMDs(char *pData, UDWORD bufferSize)
*psBodyStat->ppIMDList = (iIMDShape *) resGetData("IMD", leftIMD);
if (*psBodyStat->ppIMDList == NULL)
{
DBERROR(("Cannot find the left propulsion PIE for body %s", bodyName));
debug( LOG_ERROR, "Cannot find the left propulsion PIE for body %s", bodyName );
abort();
return FALSE;
}
}
@ -2501,7 +2531,8 @@ BOOL loadBodyPropulsionIMDs(char *pData, UDWORD bufferSize)
*psBodyStat->ppIMDList = (iIMDShape *) resGetData("IMD", rightIMD);
if (*psBodyStat->ppIMDList == NULL)
{
DBERROR(("Cannot find the right propulsion PIE for body %s", bodyName));
debug( LOG_ERROR, "Cannot find the right propulsion PIE for body %s", bodyName );
abort();
return FALSE;
}
}
@ -2534,16 +2565,16 @@ statsGetAudioIDFromString( STRING *szStatName, STRING *szWavName, SDWORD *piWavI
{
if ( audioID_GetIDFromStr( szWavName, piWavID ) == FALSE )
{
DBERROR(("statsGetAudioIDFromString: couldn't get ID %d for sound %s",
*piWavID, szWavName));
debug( LOG_ERROR, "statsGetAudioIDFromString: couldn't get ID %d for sound %s", *piWavID, szWavName );
abort();
return FALSE;
}
}
if ( ((*piWavID < 0) || (*piWavID >= ID_MAX_SOUND)) &&
(*piWavID != NO_SOUND) )
{
DBERROR(("statsGetAudioIDFromString: Invalid ID - %d for sound %s",
*piWavID, szStatName));
debug( LOG_ERROR, "statsGetAudioIDFromString: Invalid ID - %d for sound %s", *piWavID, szStatName );
abort();
return FALSE;
}
@ -2621,7 +2652,8 @@ BOOL loadWeaponSounds(char *pSoundData, UDWORD bufferSize)
}
if (inc == (SDWORD)numWeaponStats)
{
DBERROR(("loadWeaponSounds: Weapon stat not found - %s", WeaponName));
debug( LOG_ERROR, "loadWeaponSounds: Weapon stat not found - %s", WeaponName );
abort();
Ok = FALSE;
// return FALSE;
}
@ -2664,23 +2696,23 @@ BOOL loadWeaponModifiers(char *pWeapModData, UDWORD bufferSize)
effectInc = getWeaponEffect(weaponEffectName);
if (effectInc == INVALID_WEAPON_EFFECT)
{
DBERROR(("loadWeaponModifiers: Invalid Weapon Effect - %s",
weaponEffectName));
debug( LOG_ERROR, "loadWeaponModifiers: Invalid Weapon Effect - %s", weaponEffectName );
abort();
return FALSE;
}
//get the propulsion inc
propInc = getPropulsionType(propulsionName);
if (propInc == INVALID_PROP_TYPE)
{
DBERROR(("loadWeaponModifiers: Invalid Propulsion type - %s",
propulsionName));
debug( LOG_ERROR, "loadWeaponModifiers: Invalid Propulsion type - %s", propulsionName );
abort();
return FALSE;
}
if (modifier > UWORD_MAX)
{
DBERROR(("loadWeaponModifiers: modifier for effect %s, prop type %s is too large",
weaponEffectName, propulsionName));
debug( LOG_ERROR, "loadWeaponModifiers: modifier for effect %s, prop type %s is too large", weaponEffectName, propulsionName );
abort();
return FALSE;
}
//store in the appropriate index
@ -2751,8 +2783,8 @@ BOOL loadPropulsionSounds(char *pPropSoundData, UDWORD bufferSize)
type = getPropulsionType(propulsionName);
if (type == INVALID_PROP_TYPE)
{
DBERROR(("loadPropulsionSounds: Invalid Propulsion type - %s",
propulsionName));
debug( LOG_ERROR, "loadPropulsionSounds: Invalid Propulsion type - %s", propulsionName );
abort();
return FALSE;
}
pPropType = asPropulsionTypes + type;
@ -3244,7 +3276,8 @@ UDWORD statRefStart(UDWORD stat)
default:
{
//COMP_UNKNOWN should be an error
DBERROR(("Invalid stat type"));
debug( LOG_ERROR, "Invalid stat type" );
abort();
start = 0;
}
}
@ -3311,7 +3344,8 @@ BOOL compareYes(STRING *strToCompare, STRING *strOwner)
{
//set default to FALSE but continue
//DBERROR(("Invalid yes/no for record %s", strOwner));
DBERROR(("Invalid yes/no for record %s", getName(strOwner)));
debug( LOG_ERROR, "Invalid yes/no for record %s", getName(strOwner) );
abort();
return FALSE;
}
}
@ -3383,17 +3417,12 @@ void getStatsDetails(UDWORD compType, BASE_STATS **ppsStats, UDWORD *pnumStats,
break;
default:
//COMP_UNKNOWN should be an error
DBERROR(("Invalid component type - game.c"));
debug( LOG_ERROR, "Invalid component type - game.c" );
abort();
}
}
//get the component Inc for a stat based on the name and type
//returns -1 if record not found
SDWORD getCompFromName(UDWORD compType, STRING *pName)
@ -3468,7 +3497,8 @@ BOOL getResourceName(STRING *pName)
//see if the name has a resource associated with it by trying to get the ID for the string
if (!strresGetIDNum(psStringRes, pName, &id))
{
DBERROR(("Unable to find string resource for %s", pName));
debug( LOG_ERROR, "Unable to find string resource for %s", pName );
abort();
return FALSE;
}
//get the string from the id
@ -3500,7 +3530,8 @@ STRING* getName(STRING *pNameID)
the ID for the string*/
if (!strresGetIDNum(psStringRes, pNameID, &id))
{
DBERROR(("Unable to find string resource for %s", pNameID));
debug( LOG_ERROR, "Unable to find string resource for %s", pNameID );
abort();
return Unknown;
}
//get the string from the id
@ -3782,7 +3813,8 @@ BOOL allocateName(STRING **ppStore, STRING *pName)
//see if the name has a resource associated with it by trying to get the ID for the string
if (!strresGetIDNum(psStringRes, pName, &id))
{
DBERROR(("Unable to find string resource for %s", pName));
debug( LOG_ERROR, "Unable to find string resource for %s", pName );
abort();
return FALSE;
}
@ -3794,7 +3826,8 @@ BOOL allocateName(STRING **ppStore, STRING *pName)
//checks the name has been loaded as a resource and gets the storage pointer
if (!strresGetIDString(psStringRes, pName, ppStore))
{
DBERROR(("Unable to find string resource for %s", pName));
debug( LOG_ERROR, "Unable to find string resource for %s", pName );
abort();
return FALSE;
}
return TRUE;
@ -3804,7 +3837,8 @@ BOOL allocateName(STRING **ppStore, STRING *pName)
*ppStore = (STRING *)MALLOC((strlen(pName))+1);
if (ppStore == NULL)
{
DBERROR(("Name - Out of memory"));
debug( LOG_ERROR, "Name - Out of memory" );
abort();
return FALSE;
}
strcpy(*ppStore,pName);

View File

@ -550,8 +550,9 @@ void initModulePIEs(char *PIEName,UDWORD i,STRUCTURE_STATS *psStructure)
GfxFile);
if (factoryModuleIMDs[module-1][0] == NULL)
{
DBERROR(("Cannot find the PIE for factory module %d - %s",
module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for factory module %d - %s",
module, GfxFile );
abort();
return;// FALSE;
}
}
@ -569,8 +570,8 @@ void initModulePIEs(char *PIEName,UDWORD i,STRUCTURE_STATS *psStructure)
GfxFile);
if (factoryModuleIMDs[module-1][1] == NULL)
{
DBERROR(("Cannot find the PIE for vtol factory module %d - %s",
module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for vtol factory module %d - %s", module, GfxFile );
abort();
return;// FALSE;
}
}
@ -589,8 +590,8 @@ void initModulePIEs(char *PIEName,UDWORD i,STRUCTURE_STATS *psStructure)
"IMD", GfxFile);
if (researchModuleIMDs[module-1] == NULL)
{
DBERROR(("Cannot find the PIE for research module %d - %s",
module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for research module %d - %s", module, GfxFile );
abort();
return FALSE;
}
}
@ -605,7 +606,8 @@ void initModulePIEs(char *PIEName,UDWORD i,STRUCTURE_STATS *psStructure)
researchModuleIMDs[0] = (iIMDShape*) resGetData("IMD", GfxFile);
if (researchModuleIMDs[0] == NULL)
{
DBERROR(("Cannot find the PIE for research module %d - %s", module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for research module %d - %s", module, GfxFile );
abort();
return;// FALSE;
}
@ -631,8 +633,8 @@ void initModulePIEs(char *PIEName,UDWORD i,STRUCTURE_STATS *psStructure)
"IMD", GfxFile);
if (powerModuleIMDs[module-1] == NULL)
{
DBERROR(("Cannot find the PIE for power module %d - %s",
module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for power module %d - %s", module, GfxFile );
abort();
return FALSE;
}
}
@ -646,7 +648,8 @@ void initModulePIEs(char *PIEName,UDWORD i,STRUCTURE_STATS *psStructure)
powerModuleIMDs[0] = (iIMDShape*) resGetData("IMD", GfxFile);
if (powerModuleIMDs[0] == NULL)
{
DBERROR(("Cannot find the PIE for power module %d - %s", module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for power module %d - %s", module, GfxFile );
abort();
return;// FALSE;
}
@ -672,7 +675,8 @@ void initModulePIEsNoMods(char *GfxFile,UDWORD i,STRUCTURE_STATS *psStructure)
factoryModuleIMDs[0][0] = (iIMDShape*) resGetData("IMD", GfxFile);
if (factoryModuleIMDs[0][0] == NULL)
{
DBERROR(("Cannot find the PIE for factory module %d - %s",module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for factory module %d - %s",module, GfxFile );
abort();
return FALSE;
}
for (module = 1; module < NUM_FACTORY_MODULES; module++)
@ -687,7 +691,8 @@ void initModulePIEsNoMods(char *GfxFile,UDWORD i,STRUCTURE_STATS *psStructure)
factoryModuleIMDs[0][1] = (iIMDShape*) resGetData("IMD", GfxFile);
if (factoryModuleIMDs[0][1] == NULL)
{
DBERROR(("Cannot find the PIE for vtol factory module %d - %s", module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for vtol factory module %d - %s", module, GfxFile );
abort();
return FALSE;
}
for (module = 1; module < NUM_FACTORY_MODULES; module++)
@ -704,7 +709,8 @@ void initModulePIEsNoMods(char *GfxFile,UDWORD i,STRUCTURE_STATS *psStructure)
researchModuleIMDs[0] = (iIMDShape*) resGetData("IMD", GfxFile);
if (researchModuleIMDs[0] == NULL)
{
DBERROR(("Cannot find the PIE for research module %d - %s", module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for research module %d - %s", module, GfxFile );
abort();
return FALSE;
}
@ -724,7 +730,8 @@ void initModulePIEsNoMods(char *GfxFile,UDWORD i,STRUCTURE_STATS *psStructure)
powerModuleIMDs[0] = (iIMDShape*) resGetData("IMD", GfxFile);
if (powerModuleIMDs[0] == NULL)
{
DBERROR(("Cannot find the PIE for power module %d - %s", module, GfxFile));
debug( LOG_ERROR, "Cannot find the PIE for power module %d - %s", module, GfxFile );
abort();
return FALSE;
}
@ -799,7 +806,8 @@ BOOL loadStructureStats(char *pStructData, UDWORD bufferSize)
if (asStructureStats == NULL)
{
DBERROR(("Structure Stats - Out of memory"));
debug( LOG_ERROR, "Structure Stats - Out of memory" );
abort();
return FALSE;
}
@ -890,8 +898,8 @@ BOOL loadStructureStats(char *pStructData, UDWORD bufferSize)
psStructure->strength = getStructStrength(strength);
if (psStructure->strength == INVALID_STRENGTH)
{
DBERROR(("loadStructureStats: Unknown structure strength for %s",
getStatName(psStructure))); //->pName));
debug( LOG_ERROR, "loadStructureStats: Unknown structure strength for %s", getStatName(psStructure) ); //->pName));
abort();
return FALSE;
}
@ -961,8 +969,9 @@ BOOL loadStructureStats(char *pStructData, UDWORD bufferSize)
//if (psStructure->pSensor->location == LOC_TURRET AND psStructure->numWeaps)
if (psStructure->pSensor->location == LOC_TURRET AND numWeaps)
{
DBERROR(("loadStructureStats: a Turret Sensor and weapon \
have been assigned to %s", StructureName));
debug( LOG_ERROR, "loadStructureStats: a Turret Sensor and weapon \
have been assigned to %s", StructureName );
abort();
}
}
@ -970,7 +979,8 @@ BOOL loadStructureStats(char *pStructData, UDWORD bufferSize)
psStructure->pIMD = (iIMDShape *) resGetData("IMD", GfxFile);
if (psStructure->pIMD == NULL)
{
DBERROR(("Cannot find the structure PIE for record %s", getStructName(psStructure) ));
debug( LOG_ERROR, "Cannot find the structure PIE for record %s", getStructName(psStructure) );
abort();
return FALSE;
}
@ -979,7 +989,8 @@ BOOL loadStructureStats(char *pStructData, UDWORD bufferSize)
psStructure->pBaseIMD = (iIMDShape *) resGetData("IMD", baseIMD);
if (psStructure->pIMD == NULL)
{
DBERROR(("Cannot find the structure base PIE for record %s", getStructName(psStructure) ));
debug( LOG_ERROR, "Cannot find the structure base PIE for record %s", getStructName(psStructure) );
abort();
return FALSE;
}
}
@ -1002,7 +1013,8 @@ BOOL loadStructureStats(char *pStructData, UDWORD bufferSize)
if (weapSlots > STRUCT_MAXWEAPS OR numWeaps > weapSlots)
{
//DBERROR(("Allocated more weapons than allowed in Access DB for Structure"));
DBERROR(("Allocated more weapons than allowed for Structure"));
debug( LOG_ERROR, "Allocated more weapons than allowed for Structure" );
abort();
return FALSE;
}
//Don't need to allocate space since thereis only one possible pointer now! AB 24/01/99
@ -1027,7 +1039,8 @@ BOOL loadStructureStats(char *pStructData, UDWORD bufferSize)
sizeof(FUNCTION*));
if (psStructure->asFuncList == NULL)
{
DBERROR(("Out of memory assigning structure Functions"));
debug( LOG_ERROR, "Out of memory assigning structure Functions" );
abort();
return FALSE;
}
}
@ -1054,7 +1067,8 @@ BOOL loadStructureStats(char *pStructData, UDWORD bufferSize)
//if ( iID == -1 )
if (iID > numStructureStats)
{
DBERROR( ("intAddObjectStats: destroy structure stat not found\n") );
debug( LOG_ERROR, "intAddObjectStats: destroy structure stat not found\n" );
abort();
}
g_psStatDestroyStruct = asStructureStats + iID;
@ -1073,7 +1087,8 @@ BOOL loadStructureStats(char *pStructData, UDWORD bufferSize)
numStructureStats);
if (asStructLimits[player] == NULL)
{
DBERROR(("Unable to allocate structure limits"));
debug( LOG_ERROR, "Unable to allocate structure limits" );
abort();
return FALSE;
}
}
@ -1237,7 +1252,8 @@ BOOL loadStructureWeapons(char *pWeaponData, UDWORD bufferSize)
//see if we have already allocated one
if (pStructure[incS].psWeapStat != NULL)
{
DBERROR(("Trying to allocate more weapons than allowed for Structure"));
debug( LOG_ERROR, "Trying to allocate more weapons than allowed for Structure" );
abort();
return FALSE;
}
pStructure[incS].psWeapStat = &pWeapon[incW];
@ -1247,8 +1263,8 @@ BOOL loadStructureWeapons(char *pWeaponData, UDWORD bufferSize)
//if weapon not found - error
if (!weaponFound)
{
DBERROR(("Unable to find stats for weapon %s for structure %s",
WeaponName, StructureName));
debug( LOG_ERROR, "Unable to find stats for weapon %s for structure %s", WeaponName, StructureName );
abort();
return FALSE;
}
}
@ -1256,7 +1272,8 @@ BOOL loadStructureWeapons(char *pWeaponData, UDWORD bufferSize)
//if structure not found - error
if (!structureFound)
{
DBERROR(("Unable to find stats for structure %s", StructureName));
debug( LOG_ERROR, "Unable to find stats for structure %s", StructureName );
abort();
return FALSE;
}
//increment the pointer to the start of the next record
@ -1333,7 +1350,8 @@ BOOL loadStructureFunctions(char *pFunctionData, UDWORD bufferSize)
if (pStructure[incS].defaultFunc >
(SDWORD)pStructure[incS].numFuncs)
{
DBERROR(("Trying to allocate more functions than allowed for Structure"));
debug( LOG_ERROR, "Trying to allocate more functions than allowed for Structure" );
abort();
return FALSE;
}
pStructure[incS].asFuncList[pStructure[incS].defaultFunc] =
@ -1345,8 +1363,8 @@ BOOL loadStructureFunctions(char *pFunctionData, UDWORD bufferSize)
//if function not found - error
if (!functionFound)
{
DBERROR(("Unable to find stats for function %s for structure %s",
FunctionName, StructureName));
debug( LOG_ERROR, "Unable to find stats for function %s for structure %s", FunctionName, StructureName );
abort();
return FALSE;
}
}
@ -1354,7 +1372,8 @@ BOOL loadStructureFunctions(char *pFunctionData, UDWORD bufferSize)
//if structure not found - error
if (!structureFound)
{
DBERROR(("Unable to find stats for structure %s", StructureName));
debug( LOG_ERROR, "Unable to find stats for structure %s", StructureName );
abort();
return FALSE;
}
//increment the pointer to the start of the next record
@ -1392,10 +1411,11 @@ BOOL loadStructureFunctions(char *pFunctionData, UDWORD bufferSize)
if (!((WALL_FUNCTION *)pFunction)->pCornerStat)
{
#ifdef HASH_NAMES
DBERROR(("Unknown Corner Wall stat for function %x", pFunction->NameHash));
debug( LOG_ERROR, "Unknown Corner Wall stat for function %x", pFunction->NameHash );
#else
DBERROR(("Unknown Corner Wall stat for function %s", pFunction->pName));
debug( LOG_ERROR, "Unknown Corner Wall stat for function %s", pFunction->pName );
#endif
abort();
return FALSE;
}
}
@ -1436,23 +1456,23 @@ BOOL loadStructureStrengthModifiers(char *pStrengthModData, UDWORD bufferSize)
effectInc = getWeaponEffect(weaponEffectName);
if (effectInc == INVALID_WEAPON_EFFECT)
{
DBERROR(("loadStructureStrengthModifiers: Invalid Weapon Effect - %s",
weaponEffectName));
debug( LOG_ERROR, "loadStructureStrengthModifiers: Invalid Weapon Effect - %s", weaponEffectName );
abort();
return FALSE;
}
//get the propulsion inc
strengthInc = getStructStrength(strengthName);
if (strengthInc == INVALID_STRENGTH)
{
DBERROR(("loadStructureStrengthModifiers: Invalid Strength type - %s",
strengthName));
debug( LOG_ERROR, "loadStructureStrengthModifiers: Invalid Strength type - %s", strengthName );
abort();
return FALSE;
}
if (modifier > UWORD_MAX)
{
DBERROR(("loadStructureStrengthModifiers: modifier for effect %s, strength %s is too large",
weaponEffectName, strengthName));
debug( LOG_ERROR, "loadStructureStrengthModifiers: modifier for effect %s, strength %s is too large", weaponEffectName, strengthName );
abort();
return FALSE;
}
//store in the appropriate index
@ -2470,8 +2490,9 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y,
psBuilding = getTileStructure(x>>TILE_SHIFT, y>>TILE_SHIFT);
if (psBuilding == NULL)
{
//DBERROR(("No owning structure for this module - %s", pStructureType->pName));
DBERROR(("No owning structure for this module - %s", getStructName(pStructureType)));
//debug( LOG_ERROR, "No owning structure for this module - %s", pStructureType->pName );
debug( LOG_ERROR, "No owning structure for this module - %s", getStructName(pStructureType) );
abort();
return FALSE;
}
if (pStructureType->type == REF_FACTORY_MODULE)
@ -2749,23 +2770,26 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
if (psBuilding->pStructureType->numFuncs == 0)
{
#ifdef HASH_NAMES
DBERROR(("There must be a function assigned to this building - %x", psBuilding));
debug( LOG_ERROR, "There must be a function assigned to this building - %x", psBuilding );
#else
DBERROR(("There must be a function assigned to this building - %s", getName(psBuilding->pStructureType->pName)));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", getName( psBuilding->pStructureType->pName ) );
#endif
abort();
return FALSE;
}
//allocate the necessary space
/*psBuilding->pFunctionality = (FUNCTIONALITY *) MALLOC(sizeof(FACTORY));
if (psBuilding->pFunctionality == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}*/
//allocate the necessary space
if (!createStructFunc(&psBuilding->pFunctionality))
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
@ -2868,23 +2892,26 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
if (psBuilding->pStructureType->numFuncs == 0)
{
#ifdef HASH_NAMES
DBERROR(("There must be a function assigned to this building - %s", strresGetString(NULL,psBuilding->pStructureType->NameHash) ));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", strresGetString( NULL, psBuilding->pStructureType->NameHash ) );
#else
DBERROR(("There must be a function assigned to this building - %s", getName(psBuilding->pStructureType->pName)));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", getName( psBuilding->pStructureType->pName ) );
#endif
abort();
return FALSE;
}
//allocate the necessary space
/*psBuilding->pFunctionality = (FUNCTIONALITY *) MALLOC(sizeof(RESEARCH_FACILITY));
if (psBuilding->pFunctionality == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}*/
//try and create the Structure
if (!createStructFunc(&psBuilding->pFunctionality))
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
//initialise the memory
@ -2935,10 +2962,11 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
if (psBuilding->pStructureType->numFuncs == 0)
{
#ifdef HASH_NAMES
DBERROR(("There must be a function assigned to this building - %s", strresGetString(NULL,psBuilding->pStructureType->NameHash) ));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", strresGetString( NULL, psBuilding->pStructureType->NameHash ) );
#else
DBERROR(("There must be a function assigned to this building - %s", getName(psBuilding->pStructureType->pName)));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", getName( psBuilding->pStructureType->pName ) );
#endif
abort();
return FALSE;
}
//allocate the necessary space
@ -2951,7 +2979,8 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
//try and create the Structure
if (!createStructFunc(&psBuilding->pFunctionality))
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
@ -2974,10 +3003,11 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
if (psBuilding->pStructureType->numFuncs == 0)
{
#ifdef HASH_NAMES
DBERROR(("There must be a function assigned to this building - %s", strresGetString(NULL,psBuilding->pStructureType->NameHash) ));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", strresGetString( NULL, psBuilding->pStructureType->NameHash ) );
#else
DBERROR(("There must be a function assigned to this building - %s", getName(psBuilding->pStructureType->pName)));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", getName( psBuilding->pStructureType->pName ) );
#endif
abort();
return FALSE;
}
//allocate the necessary space
@ -2990,7 +3020,8 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
//try and create the Structure
if (!createStructFunc(&psBuilding->pFunctionality))
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
//initialise the memory
@ -3015,10 +3046,11 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
if (psBuilding->pStructureType->numFuncs == 0)
{
#ifdef HASH_NAMES
DBERROR(("There must be a function assigned to this building - %s", strresGetString(NULL,psBuilding->pStructureType->NameHash) ));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", strresGetString( NULL, psBuilding->pStructureType->NameHash ) );
#else
DBERROR(("There must be a function assigned to this building - %s", getName(psBuilding->pStructureType->pName)));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", getName( psBuilding->pStructureType->pName ) );
#endif
abort();
return FALSE;
}
//this function is called once the structure has been built
@ -3031,10 +3063,11 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
if (psBuilding->pStructureType->numFuncs == 0)
{
#ifdef HASH_NAMES
DBERROR(("There must be a function assigned to this building - %s", strresGetString(NULL,psBuilding->pStructureType->NameHash) ));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", strresGetString( NULL, psBuilding->pStructureType->NameHash ) );
#else
DBERROR(("There must be a function assigned to this building - %s", getName(psBuilding->pStructureType->pName)));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", getName( psBuilding->pStructureType->pName ) );
#endif
abort();
return FALSE;
}
break;
@ -3045,10 +3078,11 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
if (psBuilding->pStructureType->numFuncs == 0)
{
#ifdef HASH_NAMES
DBERROR(("There must be a function assigned to this building - %s", strresGetString(NULL,psBuilding->pStructureType->NameHash) ));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", strresGetString( NULL, psBuilding->pStructureType->NameHash ) );
#else
DBERROR(("There must be a function assigned to this building - %s", getName(psBuilding->pStructureType->pName)));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", getName( psBuilding->pStructureType->pName ) );
#endif
abort();
return FALSE;
}
@ -3056,13 +3090,15 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
/*psBuilding->pFunctionality = (FUNCTIONALITY *) MALLOC(sizeof(REPAIR_FACILITY));
if (psBuilding->pFunctionality == NULL)
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}*/
//try and create the Structure
if (!createStructFunc(&psBuilding->pFunctionality))
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
//initialise the memory
@ -3075,7 +3111,7 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
if ( !grpCreate(&((REPAIR_FACILITY *) psBuilding->pFunctionality)->psGroup) )
{
DBPRINTF( ("setFunctionality: couldn't create repair facility group") );
debug( LOG_NEVER, "setFunctionality: couldn't create repair facility group" );
}
else
{
@ -3108,18 +3144,18 @@ BOOL setFunctionality(STRUCTURE *psBuilding, UDWORD functionType)
if (psBuilding->pStructureType->numFuncs == 0)
{
#ifdef HASH_NAMES
DBERROR(("There must be a function assigned to this building - %s",
strresGetString(NULL,psBuilding->pStructureType->NameHash) ));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", strresGetString( NULL, psBuilding->pStructureType->NameHash ) );
#else
DBERROR(("There must be a function assigned to this building - %s",
getName(psBuilding->pStructureType->pName)));
debug( LOG_ERROR, "There must be a function assigned to this building - %s", getName( psBuilding->pStructureType->pName ) );
#endif
abort();
return FALSE;
}
//try and create the Structure
if (!createStructFunc(&psBuilding->pFunctionality))
{
DBERROR(("Out of memory"));
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
}
//initialise the memory
@ -4636,7 +4672,7 @@ void aiUpdateStructure(STRUCTURE *psStructure)
if ( psDroid->body >= psDroid->originalBody )
{
DBPRINTF( ("aiUpdateStructure: repair completed\n") );
debug( LOG_NEVER, "aiUpdateStructure: repair completed\n" );
psRepairFac->psObj = NULL;
@ -7180,7 +7216,8 @@ STRUCTURE_STATS * structGetDemolishStat( void )
{
if ( g_psStatDestroyStruct == NULL )
{
DBERROR( ("structGetDemolishStat: stat not initialised1\n") );
debug( LOG_ERROR, "structGetDemolishStat: stat not initialised1\n" );
abort();
}
return g_psStatDestroyStruct;

View File

@ -186,7 +186,7 @@ static BOOL rayTerrainCallback(SDWORD x, SDWORD y, SDWORD dist)
if(dist == 0) { //Complete hack PD.. John what should happen if dist is 0 ???
DBPRINTF(("rayTerrainCallback: dist == 0, will divide by zero\n"));
debug( LOG_NEVER, "rayTerrainCallback: dist == 0, will divide by zero\n" );
dist = 1;
}

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