TRUE->true, FALSE->false (except in scripts)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4311 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2008-03-24 16:51:17 +00:00
parent 9b94b011bb
commit 10f2ccfd56
178 changed files with 8572 additions and 8580 deletions

View File

@ -182,17 +182,17 @@ static BOOL registry_load( const char *filename )
debug(LOG_WZ, "Loading the registry from %s", filename);
if (PHYSFS_exists(filename)) {
if (!loadFile(filename, &bptr, &filesize)) {
return FALSE; // happens only in NDEBUG case
return false; // happens only in NDEBUG case
}
} else {
// Registry does not exist. Caller will write a new one.
return FALSE;
return false;
}
debug(LOG_WZ, "Parsing the registry from %s", filename);
if (filesize == 0 || strlen(bptr) == 0) {
debug(LOG_WARNING, "Registry file %s is empty!", filename);
return FALSE;
return false;
}
bufstart = bptr;
bptr[filesize - 1] = '\0'; // make sure it is terminated
@ -224,7 +224,7 @@ static BOOL registry_load( const char *filename )
}
}
free(bufstart);
return TRUE;
return true;
}
//
@ -253,9 +253,9 @@ static BOOL registry_save( const char *filename )
}
if (!saveFile(filename, buffer, count)) {
return FALSE; // only in NDEBUG case
return false; // only in NDEBUG case
}
return TRUE;
return true;
}
void setRegistryFilePath(const char* fileName)
@ -270,16 +270,16 @@ void setRegistryFilePath(const char* fileName)
BOOL openWarzoneKey( void )
{
//~~~~~~~~~~~~~~~~~~~~~
static BOOL done = FALSE;
static BOOL done = false;
//~~~~~~~~~~~~~~~~~~~~~
if ( done == FALSE )
if ( done == false )
{
registry_load( RegFilePath );
done = TRUE;
done = true;
}
return TRUE;
return true;
}
///
@ -289,7 +289,7 @@ BOOL openWarzoneKey( void )
BOOL closeWarzoneKey( void )
{
registry_save( RegFilePath );
return TRUE;
return true;
}
/**
@ -306,11 +306,11 @@ BOOL getWarzoneKeyNumeric( const char *pName, SDWORD *val )
if ( value == NULL || sscanf(value, "%i", val) != 1 )
{
return FALSE;
return false;
}
else
{
return TRUE;
return true;
}
}
@ -326,14 +326,14 @@ BOOL getWarzoneKeyString( const char *pName, char *pString )
if ( value == NULL )
{
return FALSE;
return false;
}
else
{
strcpy( pString, value );
}
return TRUE;
return true;
}
///
@ -351,7 +351,7 @@ BOOL setWarzoneKeyNumeric( const char *pName, SDWORD val )
buf[sizeof(buf) - 1] = '\0';
registry_set_key( pName, buf );
return TRUE;
return true;
}
///
@ -361,5 +361,5 @@ BOOL setWarzoneKeyNumeric( const char *pName, SDWORD val )
BOOL setWarzoneKeyString( const char *pName, const char *pString )
{
registry_set_key( pName, pString );
return TRUE;
return true;
}

View File

@ -72,7 +72,7 @@ static const char *code_part_names[] = {
};
static char inputBuffer[2][MAX_LEN_LOG_LINE];
static BOOL useInputBuffer1 = FALSE;
static BOOL useInputBuffer1 = false;
/**
* Convert code_part names to enum. Case insensitive.
@ -205,12 +205,12 @@ void debug_init(void)
STATIC_ASSERT(ARRAY_SIZE(code_part_names) - 1 == LOG_LAST); // enums start at 0
memset( enabled_debug, FALSE, sizeof(enabled_debug) );
enabled_debug[LOG_ERROR] = TRUE;
memset( enabled_debug, false, sizeof(enabled_debug) );
enabled_debug[LOG_ERROR] = true;
inputBuffer[0][0] = '\0';
inputBuffer[1][0] = '\0';
#ifdef DEBUG
enabled_debug[LOG_WARNING] = TRUE;
enabled_debug[LOG_WARNING] = true;
#endif
}
@ -268,7 +268,7 @@ BOOL debug_enable_switch(const char *str)
enabled_debug[part] = !enabled_debug[part];
}
if (part == LOG_ALL) {
memset(enabled_debug, TRUE, sizeof(enabled_debug));
memset(enabled_debug, true, sizeof(enabled_debug));
}
return (part != LOG_LAST);
}

View File

@ -63,7 +63,7 @@ static LONG WINAPI windowsExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo)
{
MINIDUMP_USER_STREAM uStream = { LastReservedStream+1, strlen(PACKAGE_VERSION), PACKAGE_VERSION };
MINIDUMP_USER_STREAM_INFORMATION uInfo = { 1, &uStream };
MINIDUMP_EXCEPTION_INFORMATION eInfo = { GetCurrentThreadId(), pExceptionInfo, FALSE };
MINIDUMP_EXCEPTION_INFORMATION eInfo = { GetCurrentThreadId(), pExceptionInfo, false };
if ( MiniDumpWriteDump(
GetCurrentProcess(),
@ -135,7 +135,7 @@ static struct sigaction oldAction[NSIG];
static struct utsname sysInfo;
static BOOL gdbIsAvailable = FALSE, programIsAvailable = FALSE, sysInfoValid = FALSE;
static BOOL gdbIsAvailable = false, programIsAvailable = false, sysInfoValid = false;
static char
executionDate[MAX_DATE_STRING] = {'\0'},
programPID[MAX_PID_STRING] = {'\0'},
@ -596,7 +596,7 @@ void setupExceptionHandler(const char * programCommand)
// Were we able to find ourselves?
if (strlen(programPath) > 0)
{
programIsAvailable = TRUE;
programIsAvailable = true;
*(strrchr(programPath, '\n')) = '\0'; // `which' adds a \n which confuses exec()
debug(LOG_WZ, "Found us at %s", programPath);
}
@ -613,7 +613,7 @@ void setupExceptionHandler(const char * programCommand)
// Did we find GDB?
if (strlen(gdbPath) > 0)
{
gdbIsAvailable = TRUE;
gdbIsAvailable = true;
*(strrchr(gdbPath, '\n')) = '\0'; // `which' adds a \n which confuses exec()
debug(LOG_WZ, "Found gdb at %s", gdbPath);
}

View File

@ -76,7 +76,7 @@ static Uint64 lastFrames = 0;
static Uint32 curTicks = 0; // Number of ticks since execution started
static Uint32 lastTicks = 0;
static FPSmanager wzFPSmanager;
static BOOL initFPSmanager = FALSE;
static BOOL initFPSmanager = false;
void setFramerateLimit(int fpsLimit)
{
@ -84,7 +84,7 @@ void setFramerateLimit(int fpsLimit)
{
/* Initialize framerate handler */
SDL_initFramerate(&wzFPSmanager);
initFPSmanager = TRUE;
initFPSmanager = true;
}
SDL_setFramerate(&wzFPSmanager, fpsLimit);
}
@ -222,7 +222,7 @@ BOOL frameInitialise(
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0)
{
debug( LOG_ERROR, "Error: Could not initialise SDL (%s).\n", SDL_GetError() );
return FALSE;
return false;
}
SDL_WM_SetCaption(pWindowName, NULL);
@ -230,7 +230,7 @@ BOOL frameInitialise(
/* Initialise the trig stuff */
if (!trigInitialise())
{
return FALSE;
return false;
}
/* initialise all cursors */
@ -238,7 +238,7 @@ BOOL frameInitialise(
if (!screenInitialise(width, height, bitDepth, fullScreen))
{
return FALSE;
return false;
}
/* Initialise the input system */
@ -250,10 +250,10 @@ BOOL frameInitialise(
// Initialise the resource stuff
if (!resInitialise())
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -328,7 +328,7 @@ static BOOL loadFile2(const char *pFileName, char **ppFileData, UDWORD *pFileSiz
pfile = openLoadFile(pFileName, hard_fail);
if (!pfile)
{
return FALSE;
return false;
}
filesize = PHYSFS_fileLength(pfile);
@ -342,8 +342,8 @@ static BOOL loadFile2(const char *pFileName, char **ppFileData, UDWORD *pFileSiz
if (*ppFileData == NULL)
{
debug(LOG_ERROR, "loadFile2: Out of memory loading %s", pFileName);
assert(FALSE);
return FALSE;
assert(false);
return false;
}
}
else
@ -351,8 +351,8 @@ static BOOL loadFile2(const char *pFileName, char **ppFileData, UDWORD *pFileSiz
if (filesize > *pFileSize)
{
debug(LOG_ERROR, "loadFile2: No room for file %s, buffer is too small! Got: %d Need: %ld", pFileName, *pFileSize, (long)filesize);
assert(FALSE);
return FALSE;
assert(false);
return false;
}
assert(*ppFileData != NULL);
}
@ -369,8 +369,8 @@ static BOOL loadFile2(const char *pFileName, char **ppFileData, UDWORD *pFileSiz
debug(LOG_ERROR, "loadFile2: Reading %s short: %s",
pFileName, PHYSFS_getLastError());
assert(FALSE);
return FALSE;
assert(false);
return false;
}
if (!PHYSFS_close(pfile))
@ -383,8 +383,8 @@ static BOOL loadFile2(const char *pFileName, char **ppFileData, UDWORD *pFileSiz
debug(LOG_ERROR, "loadFile2: Error closing %s: %s", pFileName,
PHYSFS_getLastError());
assert(FALSE);
return FALSE;
assert(false);
return false;
}
// Add the terminating zero
@ -393,7 +393,7 @@ static BOOL loadFile2(const char *pFileName, char **ppFileData, UDWORD *pFileSiz
// always set to correct size
*pFileSize = filesize;
return TRUE;
return true;
}
PHYSFS_file* openSaveFile(const char* fileName)
@ -427,20 +427,20 @@ BOOL saveFile(const char *pFileName, const char *pFileData, UDWORD fileSize)
pfile = openSaveFile(pFileName);
if (!pfile)
{
return FALSE;
return false;
}
if (PHYSFS_write(pfile, pFileData, 1, size) != size) {
debug(LOG_ERROR, "saveFile: %s could not write: %s", pFileName,
PHYSFS_getLastError());
assert(FALSE);
return FALSE;
assert(false);
return false;
}
if (!PHYSFS_close(pfile)) {
debug(LOG_ERROR, "saveFile: Error closing %s: %s", pFileName,
PHYSFS_getLastError());
assert(FALSE);
return FALSE;
assert(false);
return false;
}
if (PHYSFS_getRealDir(pFileName) == NULL) {
@ -452,26 +452,26 @@ BOOL saveFile(const char *pFileName, const char *pFileData, UDWORD fileSize)
PHYSFS_getRealDir(pFileName), PHYSFS_getDirSeparator(),
pFileName, size);
}
return TRUE;
return true;
}
BOOL loadFile(const char *pFileName, char **ppFileData, UDWORD *pFileSize)
{
return loadFile2(pFileName, ppFileData, pFileSize, TRUE, TRUE);
return loadFile2(pFileName, ppFileData, pFileSize, true, true);
}
// load a file from disk into a fixed memory buffer
BOOL loadFileToBuffer(const char *pFileName, char *pFileBuffer, UDWORD bufferSize, UDWORD *pSize)
{
*pSize = bufferSize;
return loadFile2(pFileName, &pFileBuffer, pSize, FALSE, TRUE);
return loadFile2(pFileName, &pFileBuffer, pSize, false, true);
}
// as above but returns quietly if no file found
BOOL loadFileToBufferNoError(const char *pFileName, char *pFileBuffer, UDWORD bufferSize, UDWORD *pSize)
{
*pSize = bufferSize;
return loadFile2(pFileName, &pFileBuffer, pSize, FALSE, FALSE);
return loadFile2(pFileName, &pFileBuffer, pSize, false, false);
}

View File

@ -72,7 +72,7 @@ BOOL resInitialise(void)
ResetResourceFile();
return TRUE;
return true;
}
@ -109,7 +109,7 @@ BOOL resLoad(const char *pResFile, SDWORD blockID)
if (!loadFile(pResFile, &pBuffer, &size))
{
debug(LOG_ERROR, "resLoad: failed to load %s", pResFile);
return FALSE;
return false;
}
// and parse it
@ -118,12 +118,12 @@ BOOL resLoad(const char *pResFile, SDWORD blockID)
{
debug(LOG_ERROR, "resLoad: failed to parse %s", pResFile);
free(pBuffer);
return FALSE;
return false;
}
free(pBuffer);
return TRUE;
return true;
}
@ -170,7 +170,7 @@ BOOL resAddBufferLoad(const char *pType, RES_BUFFERLOAD buffLoad,
if (!psT)
{
return FALSE;
return false;
}
psT->buffLoad = buffLoad;
@ -180,7 +180,7 @@ BOOL resAddBufferLoad(const char *pType, RES_BUFFERLOAD buffLoad,
psT->psNext = psResTypes;
psResTypes = psT;
return TRUE;
return true;
}
@ -192,7 +192,7 @@ BOOL resAddFileLoad(const char *pType, RES_FILELOAD fileLoad,
if (!psT)
{
return FALSE;
return false;
}
psT->buffLoad = NULL;
@ -202,7 +202,7 @@ BOOL resAddFileLoad(const char *pType, RES_FILELOAD fileLoad,
psT->psNext = psResTypes;
psResTypes = psT;
return TRUE;
return true;
}
// Make a string lower case
@ -292,7 +292,7 @@ static BOOL RetreiveResourceFile(char *ResourceName, RESOURCEFILE **NewResource)
char *pBuffer;
ResID=FindEmptyResourceFile();
if (ResID==-1) return(FALSE); // all resource files are full
if (ResID==-1) return(false); // all resource files are full
ResData= &LoadedResourceFiles[ResID];
*NewResource=ResData;
@ -300,13 +300,13 @@ static BOOL RetreiveResourceFile(char *ResourceName, RESOURCEFILE **NewResource)
// This is needed for files that do not fit in the WDG cache ... (VAB file for example)
if (!loadFile(ResourceName, &pBuffer, &size))
{
return FALSE;
return false;
}
ResData->type=RESFILETYPE_LOADED;
ResData->size=size;
ResData->pBuffer=pBuffer;
return(TRUE);
return(true);
}
@ -411,7 +411,7 @@ BOOL resLoadFile(const char *pType, const char *pFile)
if (psT == NULL)
{
debug(LOG_WZ, "resLoadFile: Unknown type: %s", pType);
return FALSE;
return false;
}
// Check for duplicates
@ -424,7 +424,7 @@ BOOL resLoadFile(const char *pType, const char *pFile)
pFile, HashedName, psT->aType);
// assume that they are actually both the same and silently fail
// lovely little hack to allow some files to be loaded from disk (believe it or not!).
return TRUE;
return true;
}
}
@ -432,7 +432,7 @@ BOOL resLoadFile(const char *pType, const char *pFile)
if (strlen(aCurrResDir) + strlen(pFile) + 1 >= PATH_MAX)
{
debug(LOG_ERROR, "resLoadFile: Filename too long!! %s%s", aCurrResDir, pFile);
return FALSE;
return false;
}
strlcpy(aFileName, aCurrResDir, sizeof(aFileName));
strlcat(aFileName, pFile, sizeof(aFileName));
@ -450,7 +450,7 @@ BOOL resLoadFile(const char *pType, const char *pFile)
if (!RetreiveResourceFile(aFileName, &Resource))
{
debug(LOG_ERROR, "resLoadFile: Unable to retreive resource - %s", aFileName);
return FALSE;
return false;
}
// Now process the buffer data
@ -459,7 +459,7 @@ BOOL resLoadFile(const char *pType, const char *pFile)
debug(LOG_ERROR, "resLoadFile: The load function for resource type \"%s\" failed for file \"%s\"", pType, pFile);
FreeResourceFile(Resource);
psT->release(pData);
return FALSE;
return false;
}
FreeResourceFile(Resource);
@ -471,13 +471,13 @@ BOOL resLoadFile(const char *pType, const char *pFile)
{
debug(LOG_ERROR, "resLoadFile: The load function for resource type \"%s\" failed for file \"%s\"", pType, pFile);
psT->release(pData);
return FALSE;
return false;
}
}
else
{
debug(LOG_ERROR, "resLoadFile: No load functions for this type (%s)", pType);
return FALSE;
return false;
}
resDoResLoadCallback(); // do callback.
@ -490,14 +490,14 @@ BOOL resLoadFile(const char *pType, const char *pFile)
if (!psRes)
{
psT->release(pData);
return FALSE;
return false;
}
// Add the resource to the list
psRes->psNext = psT->psRes;
psT->psRes = psRes;
}
return TRUE;
return true;
}
@ -572,8 +572,8 @@ BOOL resGetHashfromData(const char *pType, const void *pData, UDWORD *pHash)
if (psT == NULL)
{
ASSERT( FALSE, "resGetHashfromData: Unknown type: %x", HashedType );
return FALSE;
ASSERT( false, "resGetHashfromData: Unknown type: %x", HashedType );
return false;
}
// Find the resource
@ -588,13 +588,13 @@ BOOL resGetHashfromData(const char *pType, const void *pData, UDWORD *pHash)
if (psRes == NULL)
{
ASSERT( FALSE, "resGetHashfromData:: couldn't find data for type %x\n", HashedType );
return FALSE;
ASSERT( false, "resGetHashfromData:: couldn't find data for type %x\n", HashedType );
return false;
}
*pHash = psRes->HashedID;
return TRUE;
return true;
}
const char* resGetNamefromData(const char* type, const void *data)
@ -622,7 +622,7 @@ const char* resGetNamefromData(const char* type, const void *data)
if (psT == NULL)
{
ASSERT( FALSE, "resGetHashfromData: Unknown type: %x", HashedType );
ASSERT( false, "resGetHashfromData: Unknown type: %x", HashedType );
return "";
}
@ -637,7 +637,7 @@ const char* resGetNamefromData(const char* type, const void *data)
if (psRes == NULL)
{
ASSERT( FALSE, "resGetHashfromData:: couldn't find data for type %x\n", HashedType );
ASSERT( false, "resGetHashfromData:: couldn't find data for type %x\n", HashedType );
return "";
}
@ -665,7 +665,7 @@ BOOL resPresent(const char *pType, const char *pID)
ASSERT(psT != NULL, "resPresent: Unknown type");
if (psT == NULL)
{
return FALSE;
return false;
}
{
@ -684,10 +684,10 @@ BOOL resPresent(const char *pType, const char *pID)
/* Did we find it? */
if (psRes != NULL)
{
return (TRUE);
return (true);
}
return (FALSE);
return (false);
}
@ -763,7 +763,7 @@ void resReleaseBlockData(SDWORD blockID)
}
else
{
ASSERT( FALSE,"resReleaseAllData: NULL release function" );
ASSERT( false,"resReleaseAllData: NULL release function" );
}
psNRes = psRes->psNext;

View File

@ -153,7 +153,7 @@ const char* getLanguageName(void)
}
}
ASSERT(FALSE, "getLanguageName: Unknown language");
ASSERT(false, "getLanguageName: Unknown language");
return NULL;
}
@ -199,7 +199,7 @@ static BOOL setLocaleUnix(const char* locale)
BOOL setLanguage(const char *language)
{
#if !defined(ENABLE_NLS)
return TRUE;
return true;
#else
unsigned int i;
@ -220,7 +220,7 @@ BOOL setLanguage(const char *language)
debug(LOG_ERROR, "Requested language \"%s\" not supported.", language);
return FALSE;
return false;
#endif
}

View File

@ -515,10 +515,10 @@ BOOL mouseDrag(MOUSE_KEY_CODE code, UDWORD *px, UDWORD *py)
{
*px = dragX;
*py = dragY;
return TRUE;
return true;
}
return FALSE;
return false;
}
void SetMousePos(Uint16 x, Uint16 y)

View File

@ -44,7 +44,7 @@ char aText[TEXT_BUFFERS][YYLMAX]; // No longer static ... lets use this area gl
static UDWORD currText=0;
// Note if we are in a comment
static BOOL inComment = FALSE;
static BOOL inComment = false;
/* Pointer to the input buffer */
static const char *pInputBuffer = NULL;
@ -102,9 +102,9 @@ file { return FILETOKEN; }
[ \t\n\x0d\x0a] ;
/* Strip comments */
"/*" { inComment=TRUE; BEGIN COMMENT; }
"/*" { inComment=true; BEGIN COMMENT; }
<COMMENT>"*/" |
<COMMENT>"*/"\n { inComment=FALSE; BEGIN 0; }
<COMMENT>"*/"\n { inComment=false; BEGIN 0; }
<COMMENT>. |
<COMMENT>\n ;
@ -126,7 +126,7 @@ void resSetInputBuffer(char *pBuffer, UDWORD size)
/* Reset the lexer incase it's been used before */
res__flush_buffer(YY_CURRENT_BUFFER);
inComment = FALSE;
inComment = false;
}
void resGetErrorData(int *pLine, char **ppText)

View File

@ -55,7 +55,7 @@ static BOOL strresAllocBlock(STR_BLOCK **ppsBlock, UDWORD size)
{
debug( LOG_ERROR, "strresAllocBlock: Out of memory - 1" );
abort();
return FALSE;
return false;
}
(*ppsBlock)->apStrings = (char**)malloc(sizeof(char *) * size);
@ -64,7 +64,7 @@ static BOOL strresAllocBlock(STR_BLOCK **ppsBlock, UDWORD size)
debug( LOG_ERROR, "strresAllocBlock: Out of memory - 2" );
abort();
free(*ppsBlock);
return FALSE;
return false;
}
memset((*ppsBlock)->apStrings, 0, sizeof(char *) * size);
@ -73,7 +73,7 @@ static BOOL strresAllocBlock(STR_BLOCK **ppsBlock, UDWORD size)
memset((*ppsBlock)->aUsage, 0, sizeof(UDWORD) * size);
#endif
return TRUE;
return true;
}
@ -87,7 +87,7 @@ BOOL strresCreate(STR_RES **ppsRes, UDWORD init, UDWORD ext)
{
debug( LOG_ERROR, "strresCreate: Out of memory" );
abort();
return FALSE;
return false;
}
psRes->init = init;
psRes->ext = ext;
@ -98,14 +98,14 @@ BOOL strresCreate(STR_RES **ppsRes, UDWORD init, UDWORD ext)
debug( LOG_ERROR, "strresCreate: Out of memory" );
abort();
free(psRes);
return FALSE;
return false;
}
if (!strresAllocBlock(&psRes->psStrings, init))
{
TREAP_DESTROY(psRes->psIDTreap);
free(psRes);
return FALSE;
return false;
}
psRes->psStrings->psNext = NULL;
psRes->psStrings->idStart = 0;
@ -113,7 +113,7 @@ BOOL strresCreate(STR_RES **ppsRes, UDWORD init, UDWORD ext)
*ppsRes = psRes;
return TRUE;
return true;
}
@ -201,7 +201,7 @@ BOOL strresGetIDNum(STR_RES *psRes, const char *pIDStr, UDWORD *pIDNum)
if (!psID)
{
*pIDNum = 0;
return FALSE;
return false;
}
if (psID->id & ID_ALLOC)
@ -212,7 +212,7 @@ BOOL strresGetIDNum(STR_RES *psRes, const char *pIDStr, UDWORD *pIDNum)
{
*pIDNum = psID->id;
}
return TRUE;
return true;
}
@ -227,11 +227,11 @@ BOOL strresGetIDString(STR_RES *psRes, const char *pIDStr, char **ppStoredID)
if (!psID)
{
*ppStoredID = NULL;
return FALSE;
return false;
}
*ppStoredID = psID->pIDStr;
return TRUE;
return true;
}
@ -256,7 +256,7 @@ BOOL strresStoreString(STR_RES *psRes, char *pID, const char *pString)
{
debug( LOG_ERROR, "strresStoreString: Out of memory" );
abort();
return FALSE;
return false;
}
psID->pIDStr = (char*)malloc(sizeof(char) * (strlen(pID) + 1));
if (!psID->pIDStr)
@ -264,7 +264,7 @@ BOOL strresStoreString(STR_RES *psRes, char *pID, const char *pString)
debug( LOG_ERROR, "strresStoreString: Out of memory" );
abort();
free(psID);
return FALSE;
return false;
}
stringCpy(psID->pIDStr, pID);
psID->id = psRes->nextID | ID_ALLOC;
@ -289,7 +289,7 @@ BOOL strresStoreString(STR_RES *psRes, char *pID, const char *pString)
// Need to allocate a new string block
if (!strresAllocBlock(&psBlock->psNext, psRes->ext))
{
return FALSE;
return false;
}
psBlock->psNext->idStart = psBlock->idEnd+1;
psBlock->psNext->idEnd = psBlock->idEnd + psRes->ext;
@ -302,7 +302,7 @@ BOOL strresStoreString(STR_RES *psRes, char *pID, const char *pString)
{
debug( LOG_ERROR, "strresStoreString: Duplicate string for id: %s", psID->pIDStr );
abort();
return FALSE;
return false;
}
// Allocate a copy of the string
@ -311,12 +311,12 @@ BOOL strresStoreString(STR_RES *psRes, char *pID, const char *pString)
{
debug( LOG_ERROR, "strresStoreString: Out of memory" );
abort();
return FALSE;
return false;
}
stringCpy(pNew, pString);
psBlock->apStrings[id - psBlock->idStart] = pNew;
return TRUE;
return true;
}
@ -335,7 +335,7 @@ char *strresGetString(STR_RES *psRes, UDWORD id)
if (!psBlock)
{
ASSERT( FALSE, "strresGetString: String not found" );
ASSERT( false, "strresGetString: String not found" );
// Return the default string
return psRes->psStrings->apStrings[0];
}
@ -364,7 +364,7 @@ BOOL strresLoad(STR_RES* psRes, const char* fileName)
if (!fileHandle)
{
debug(LOG_ERROR, "strresLoadFile: PHYSFS_openRead(\"%s\") failed with error: %s\n", fileName, PHYSFS_getLastError());
return FALSE;
return false;
}
// Set string resource to operate on
@ -374,11 +374,11 @@ BOOL strresLoad(STR_RES* psRes, const char* fileName)
if (strres_parse() != 0)
{
PHYSFS_close(fileHandle);
return FALSE;
return false;
}
PHYSFS_close(fileHandle);
return TRUE;
return true;
}
/* Copy a char */

View File

@ -99,9 +99,9 @@ static PHYSFS_file* pReadFile = NULL;
[ \t\n\x0d\x0a] ;
/* Strip comments */
"/*" { inComment=TRUE; BEGIN COMMENT; }
"/*" { inComment=true; BEGIN COMMENT; }
<COMMENT>"*/" |
<COMMENT>"*/"\n { inComment=FALSE; BEGIN 0; }
<COMMENT>"*/"\n { inComment=false; BEGIN 0; }
<COMMENT>. |
<COMMENT>\n ;

View File

@ -90,7 +90,7 @@ BOOL treapCreate(TREAP **ppsTreap, TREAP_CMP cmp)
{
debug( LOG_ERROR, "treapCreate: Out of memory" );
abort();
return FALSE;
return false;
}
// Store the comparison function if there is one, use the default otherwise
@ -111,7 +111,7 @@ BOOL treapCreate(TREAP **ppsTreap, TREAP_CMP cmp)
(*ppsTreap)->pFile = pCFile;
(*ppsTreap)->line = cLine;
#endif
return TRUE;
return true;
}
/* Rotate a tree to the right
@ -184,7 +184,7 @@ BOOL treapAdd(TREAP *psTreap, void *key, void *pObj)
if (psNew == NULL)
{
debug(LOG_ERROR, "treapAdd: Out of memory");
return FALSE;
return false;
}
psNew->priority = (UDWORD)rand();
psNew->key = key;
@ -199,7 +199,7 @@ BOOL treapAdd(TREAP *psTreap, void *key, void *pObj)
treapAddNode(&psTreap->psRoot, psNew, psTreap->cmp);
return TRUE;
return true;
}
@ -265,7 +265,7 @@ TREAP_NODE *treapDelRec(TREAP_NODE **ppsRoot, void *key, TREAP_CMP cmp)
}
break;
default:
ASSERT( FALSE, "treapDelRec: invalid return from comparison" );
ASSERT( false, "treapDelRec: invalid return from comparison" );
break;
}
return NULL;
@ -281,7 +281,7 @@ BOOL treapDel(TREAP *psTreap, void *key)
psDel = treapDelRec(&psTreap->psRoot, key, psTreap->cmp);
if (!psDel)
{
return FALSE;
return false;
}
// Release the node
@ -290,7 +290,7 @@ BOOL treapDel(TREAP *psTreap, void *key)
#endif
free(psDel);
return TRUE;
return true;
}
@ -315,7 +315,7 @@ void *treapFindRec(TREAP_NODE *psRoot, void *key, TREAP_CMP cmp)
return treapFindRec(psRoot->psRight, key, cmp);
break;
default:
ASSERT( FALSE, "treapFindRec: invalid return from comparison" );
ASSERT( false, "treapFindRec: invalid return from comparison" );
break;
}
return NULL;

View File

@ -34,7 +34,7 @@
/* Turn on and off the treap debugging */
#ifdef DEBUG
// #define DEBUG_TREAP TRUE
// #define DEBUG_TREAP true
#else
#undef DEBUG_TREAP
#endif

View File

@ -81,7 +81,7 @@ BOOL trigInitialise(void)
aSqrt[i]= sqrtf(val);
}
return TRUE;
return true;
}

View File

@ -101,13 +101,5 @@ typedef int BOOL;
# define NULL ((void*)(0))
#endif
#ifndef TRUE
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#endif

View File

@ -71,7 +71,7 @@ BOOL anim_Init()
g_animGlobals.uwCurObj = 0;
g_animGlobals.uwCurState = 0;
return TRUE;
return true;
}
/***************************************************************************/
@ -119,7 +119,7 @@ BOOL anim_Shutdown()
psAnim = psAnimTmp;
}
return TRUE;
return true;
}
static void anim_InitBaseMembers(BASEANIM * psAnim, UWORD uwStates, UWORD uwFrameRate,
@ -149,7 +149,7 @@ BOOL anim_Create3D(char szPieFileName[], UWORD uwStates, UWORD uwFrameRate, UWOR
/* allocate anim */
if ( (psAnim3D = (ANIM3D*)malloc(sizeof(ANIM3D))) == NULL )
{
return FALSE;
return false;
}
/* get local pointer to shape */
@ -170,7 +170,7 @@ BOOL anim_Create3D(char szPieFileName[], UWORD uwStates, UWORD uwFrameRate, UWOR
debug( LOG_ERROR, "anim_Create3D: frames in pie %s != script objects %i\n",
szPieFileName, uwObj );
abort();
return FALSE;
return false;
}
/* get pointers to individual frames */
@ -194,7 +194,7 @@ BOOL anim_Create3D(char szPieFileName[], UWORD uwStates, UWORD uwFrameRate, UWOR
/* update globals */
g_animGlobals.uwCurObj = 0;
return TRUE;
return true;
}
/***************************************************************************/
@ -218,13 +218,13 @@ BOOL anim_EndScript()
{
debug( LOG_ERROR, "anim_End3D: states in current anim not consistent with header\n" );
abort();
return FALSE;
return false;
}
/* update globals */
g_animGlobals.uwCurObj++;
return TRUE;
return true;
}
/***************************************************************************/
@ -270,7 +270,7 @@ BOOL anim_AddFrameToAnim(int iFrame, Vector3i vecPos, Vector3i vecRot, Vector3i
/* update globals */
g_animGlobals.uwCurState++;
return TRUE;
return true;
}
/***************************************************************************/
@ -312,7 +312,7 @@ void anim_SetVals(char szFileName[], UWORD uwAnimID)
BASEANIM *anim_LoadFromFile(PHYSFS_file* fileHandle)
{
if ( ParseResourceFile( fileHandle ) == FALSE )
if ( ParseResourceFile( fileHandle ) == false )
{
debug( LOG_ERROR, "anim_LoadFromFile: couldn't parse file\n" );
abort();

View File

@ -86,7 +86,7 @@ animObj_Init( ANIMOBJDIEDTESTFUNC pDiedFunc )
/* set global died test function */
g_pDiedFunc = pDiedFunc;
return TRUE;
return true;
}
/***************************************************************************/
@ -99,7 +99,7 @@ animObj_Shutdown( void )
g_pAnimObjTable = NULL;
g_pDiedFunc = NULL;
return TRUE;
return true;
}
/***************************************************************************/
@ -150,7 +150,7 @@ animObj_Update( void )
while ( psObj != NULL )
{
bRemove = FALSE;
bRemove = false;
/* test whether parent object has died */
if ( g_pDiedFunc != NULL )
@ -159,7 +159,7 @@ animObj_Update( void )
}
/* remove any expired (non-looping) animations */
if ( (bRemove == FALSE) && (psObj->uwCycles != 0) )
if ( (bRemove == false) && (psObj->uwCycles != 0) )
{
dwTime = gameTime - psObj->udwStartTime - psObj->udwStartDelay;
@ -171,15 +171,15 @@ animObj_Update( void )
(psObj->pDoneFunc) (psObj);
}
bRemove = TRUE;
bRemove = true;
}
}
/* remove object if flagged */
if ( bRemove == TRUE )
if ( bRemove == true )
{
if ( hashTable_RemoveElement( g_pAnimObjTable, psObj,
(intptr_t) psObj->psParent, psObj->psAnim->uwID ) == FALSE )
(intptr_t) psObj->psParent, psObj->psAnim->uwID ) == false )
{
debug( LOG_ERROR, "animObj_Update: couldn't remove anim obj\n" );
abort();
@ -224,7 +224,7 @@ animObj_Add( void *pParentObj, int iAnimID,
psObj->udwStartTime = gameTime;
psObj->udwStartDelay = udwStartDelay;
psObj->uwCycles = uwCycles;
psObj->bVisible = TRUE;
psObj->bVisible = true;
psObj->psParent = pParentObj;
psObj->pDoneFunc = NULL;

View File

@ -127,13 +127,13 @@ ANIMOBJECT { return ANIMOBJECT; }
int
audp_wrap( void )
{
if ( g_bParsingSubFile == TRUE )
if ( g_bParsingSubFile == true )
{
/* close current file and restore old file pointer */
fclose( audp_in );
audp_in = g_fpOld;
g_bParsingSubFile = FALSE;
g_bParsingSubFile = false;
return 0;
}

View File

@ -87,11 +87,11 @@ audio_list: audio_list audio_track |
audio_track: AUDIO QTEXT LOOP INTEGER INTEGER
{
audio_SetTrackVals( $2, TRUE, $4, $5 );
audio_SetTrackVals( $2, true, $4, $5 );
}
| AUDIO QTEXT ONESHOT INTEGER INTEGER
{
audio_SetTrackVals( $2, FALSE, $4, $5 );
audio_SetTrackVals( $2, false, $4, $5 );
}
;
@ -220,7 +220,7 @@ BOOL ParseResourceFile(PHYSFS_file* fileHandle)
audp_parse();
return TRUE;
return true;
}
/***************************************************************************/

View File

@ -77,7 +77,7 @@ BOOL gameTimeInit(void)
stopCount = 0;
return TRUE;
return true;
}
UDWORD getTimeValueRange(UDWORD tickFrequency, UDWORD requiredRange)

View File

@ -59,7 +59,7 @@ extern BOOL gameTimeInit(void);
/** Call this each loop to update the game timer. */
extern void gameTimeUpdate(void);
/* Returns TRUE if gameTime is stopped. */
/* Returns true if gameTime is stopped. */
extern BOOL gameTimeIsStopped(void);
/** Call this to stop the game timer. */

View File

@ -61,7 +61,7 @@ hashTable_Create( HASHTABLE **ppsTable, UDWORD udwTableSize,
/* set hash function to internal */
hashTable_SetHashFunction( (*ppsTable), HashTest );
return TRUE;
return true;
}
/***************************************************************************/
@ -248,7 +248,7 @@ void *hashTable_FindElement(HASHTABLE *psTable, intptr_t iKey1, intptr_t iKey2)
/* remove node from hash table and return to heap */
if ( psNode == NULL )
{
return FALSE;
return false;
}
else
{
@ -261,7 +261,7 @@ void *hashTable_FindElement(HASHTABLE *psTable, intptr_t iKey1, intptr_t iKey2)
static void
hashTable_SetNextNode( HASHTABLE *psTable, BOOL bMoveToNextNode )
{
if ( (bMoveToNextNode == TRUE) && (psTable->psNextNode != NULL) )
if ( (bMoveToNextNode == true) && (psTable->psNextNode != NULL) )
{
/* get next node */
psTable->psNextNode = psTable->psNextNode->psNext;
@ -322,7 +322,7 @@ hashTable_RemoveElement(HASHTABLE *psTable, void *psElement, intptr_t iKey1, int
/* remove node from hash table and return to heap */
if ( psNode == NULL )
{
return FALSE;
return false;
}
else
{
@ -343,7 +343,7 @@ hashTable_RemoveElement(HASHTABLE *psTable, void *psElement, intptr_t iKey1, int
}
/* setup next node pointer */
hashTable_SetNextNode( psTable, TRUE );
hashTable_SetNextNode( psTable, true );
/* return element to heap */
ASSERT( psNode->psElement != NULL,
@ -355,7 +355,7 @@ hashTable_RemoveElement(HASHTABLE *psTable, void *psElement, intptr_t iKey1, int
"hashTable_RemoveElement: node pointer invalid\n" );
free(psNode);
return TRUE;
return true;
}
}
@ -378,7 +378,7 @@ hashTable_GetNext( HASHTABLE *psTable )
psElement = psTable->psNextNode->psElement;
/* setup next node pointer */
hashTable_SetNextNode( psTable, TRUE );
hashTable_SetNextNode( psTable, true );
return psElement;
}
@ -397,7 +397,7 @@ hashTable_GetFirst( HASHTABLE *psTable )
psTable->psNextNode = psTable->ppsNode[0];
/* search through table for first allocated node */
hashTable_SetNextNode( psTable, FALSE );
hashTable_SetNextNode( psTable, false );
/* return it */
return hashTable_GetNext( psTable );

View File

@ -55,15 +55,15 @@ static BOOL AtEndOfFile(const char *CurPos, const char *EndOfFile)
CurPos++;
if (CurPos >= EndOfFile)
{
return TRUE;
return true;
}
}
if (CurPos >= EndOfFile)
{
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -71,7 +71,7 @@ static BOOL AtEndOfFile(const char *CurPos, const char *EndOfFile)
* Load shape level polygons
* \param ppFileData Pointer to the data (usualy read from a file)
* \param s Pointer to shape level
* \return FALSE on error (memory allocation failure/bad file format), TRUE otherwise
* \return false on error (memory allocation failure/bad file format), true otherwise
* \pre ppFileData loaded
* \pre s allocated
* \pre s->npolys set
@ -91,7 +91,7 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
if (s->polys == NULL)
{
debug(LOG_ERROR, "(_load_polys) Out of memory (polys)");
return FALSE;
return false;
}
for (i = 0, poly = s->polys; i < s->npolys; i++, poly++)
@ -112,7 +112,7 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
if (poly->pindex == NULL)
{
debug(LOG_ERROR, "(_load_polys) [poly %u] memory alloc fail (poly indices)", i);
return FALSE;
return false;
}
for (j = 0; j < poly->npnts; j++)
@ -122,7 +122,7 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
if (sscanf(pFileData, "%d%n", &newID, &cnt) != 1)
{
debug(LOG_ERROR, "failed poly %u. point %d", i, j);
return FALSE;
return false;
}
pFileData += cnt;
poly->pindex[j] = vertexTable[newID];
@ -158,7 +158,7 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
if (sscanf(pFileData, "%d %d %d %d%n", &nFrames, &pbRate, &tWidth, &tHeight, &cnt) != 4)
{
debug(LOG_ERROR, "(_load_polys) [poly %u] error reading texanim data", i);
return FALSE;
return false;
}
pFileData += cnt;
@ -187,7 +187,7 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
if (poly->texCoord == NULL)
{
debug(LOG_ERROR, "(_load_polys) [poly %u] memory alloc fail (vertex struct)", i);
return FALSE;
return false;
}
for (j = 0; j < poly->npnts; j++)
@ -196,7 +196,7 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
if (sscanf(pFileData, "%f %f%n", &VertexU, &VertexV, &cnt) != 2)
{
debug(LOG_ERROR, "(_load_polys) [poly %u] error reading tex outline", i);
return FALSE;
return false;
}
pFileData += cnt;
@ -212,7 +212,7 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
*ppFileData = pFileData;
return TRUE;
return true;
}
@ -228,7 +228,7 @@ static BOOL ReadPoints( const char **ppFileData, iIMDShape *s )
if (sscanf(pFileData, "%f %f %f%n", &newVector.x, &newVector.y, &newVector.z, &cnt) != 3)
{
debug(LOG_ERROR, "(_load_points) file corrupt -K");
return FALSE;
return false;
}
pFileData += cnt;
@ -271,7 +271,7 @@ static BOOL ReadPoints( const char **ppFileData, iIMDShape *s )
*ppFileData = pFileData;
return TRUE;
return true;
}
@ -290,15 +290,15 @@ static BOOL _imd_load_points( const char **ppFileData, iIMDShape *s )
s->points = (Vector3f*)malloc(sizeof(Vector3f) * s->npoints);
if (s->points == NULL)
{
return FALSE;
return false;
}
// Read in points and remove duplicates (!)
if ( ReadPoints( ppFileData, s ) == FALSE )
if ( ReadPoints( ppFileData, s ) == false )
{
free(s->points);
s->points = NULL;
return FALSE;
return false;
}
s->max.x = s->max.y = s->max.z = tempXMax = tempZMax = -FP12_MULTIPLIER;
@ -495,7 +495,7 @@ static BOOL _imd_load_points( const char **ppFileData, iIMDShape *s )
// END: tight bounding sphere
return TRUE;
return true;
}
@ -503,7 +503,7 @@ static BOOL _imd_load_points( const char **ppFileData, iIMDShape *s )
* Load shape level connectors
* \param ppFileData Pointer to the data (usualy read from a file)
* \param s Pointer to shape level
* \return FALSE on error (memory allocation failure/bad file format), TRUE otherwise
* \return false on error (memory allocation failure/bad file format), true otherwise
* \pre ppFileData loaded
* \pre s allocated
* \pre s->nconnectors set
@ -519,7 +519,7 @@ static BOOL _imd_load_connectors(const char **ppFileData, iIMDShape *s)
if (s->connectors == NULL)
{
debug(LOG_ERROR, "(_load_connectors) MALLOC fail");
return FALSE;
return false;
}
for (p = s->connectors; p < s->connectors + s->nconnectors; p++)
@ -527,7 +527,7 @@ static BOOL _imd_load_connectors(const char **ppFileData, iIMDShape *s)
if (sscanf(pFileData, "%f %f %f%n", &newVector.x, &newVector.y, &newVector.z, &cnt) != 3)
{
debug(LOG_ERROR, "(_load_connectors) file corrupt -M");
return FALSE;
return false;
}
pFileData += cnt;
*p = newVector;
@ -535,7 +535,7 @@ static BOOL _imd_load_connectors(const char **ppFileData, iIMDShape *s)
*ppFileData = pFileData;
return TRUE;
return true;
}
@ -672,12 +672,12 @@ iIMDShape *iV_ProcessIMD( const char **ppFileData, const char *FileDataEnd )
UDWORD level;
Sint32 imd_version;
Uint32 imd_flags; // FIXME UNUSED
BOOL bTextured = FALSE;
BOOL bTextured = false;
if (sscanf(pFileData, "%s %d%n", buffer, &imd_version, &cnt) != 2)
{
debug(LOG_ERROR, "iV_ProcessIMD %s bad version: (%s)", pFileName, buffer);
assert(FALSE);
assert(false);
return NULL;
}
pFileData += cnt;
@ -759,7 +759,7 @@ iIMDShape *iV_ProcessIMD( const char **ppFileData, const char *FileDataEnd )
}
pFileData += cnt;
bTextured = TRUE;
bTextured = true;
}
if (strncmp(buffer, "LEVELS", 6) != 0)

View File

@ -25,19 +25,19 @@ static UDWORD videoBufferDepth = 32, videoBufferWidth = 640, videoBufferHeight =
BOOL pie_SetVideoBufferDepth(UDWORD depth)
{
videoBufferDepth = depth;
return(TRUE);
return(true);
}
BOOL pie_SetVideoBufferWidth(UDWORD width)
{
videoBufferWidth = width;
return(TRUE);
return(true);
}
BOOL pie_SetVideoBufferHeight(UDWORD height)
{
videoBufferHeight = height;
return(TRUE);
return(true);
}
UDWORD pie_GetVideoBufferDepth(void)

View File

@ -29,9 +29,9 @@ void pie_SetDefaultStates(void)//Sets all states
PIELIGHT black;
//fog off
rendStates.fogEnabled = FALSE;// enable fog before renderer
rendStates.fog = FALSE;//to force reset to false
pie_SetFogStatus(FALSE);
rendStates.fogEnabled = false;// enable fog before renderer
rendStates.fog = false;//to force reset to false
pie_SetFogStatus(false);
black.argb = 0;
black.byte.a = 255;
pie_SetFogColour(black);//nicks colour
@ -43,8 +43,8 @@ void pie_SetDefaultStates(void)//Sets all states
pie_SetTranslucencyMode(TRANS_DECAL);
//chroma keying on black
rendStates.keyingOn = FALSE;//to force reset to true
pie_SetAlphaTest(TRUE);
rendStates.keyingOn = false;//to force reset to true
pie_SetAlphaTest(true);
}
@ -62,7 +62,7 @@ void pie_EnableFog(BOOL val)
{
debug(LOG_FOG, "pie_EnableFog: Setting fog to %s", val ? "ON" : "OFF");
rendStates.fogEnabled = val;
if (val == TRUE)
if (val == true)
{
PIELIGHT nickscolour;

View File

@ -85,7 +85,7 @@ BOOL iV_loadImage_PNG(const char *fileName, iV_Image *image)
{
debug(LOG_ERROR, "pie_PNGLoadFile: PHYSFS_openRead(%s) failed with error: %s\n", fileName, PHYSFS_getLastError());
PNGReadCleanup(&info_ptr, &png_ptr, fileHandle);
return FALSE;
return false;
}
// Read PNG header from file
@ -94,7 +94,7 @@ BOOL iV_loadImage_PNG(const char *fileName, iV_Image *image)
{
debug(LOG_ERROR, "pie_PNGLoadFile: PHYSFS_read(%s) failed with error: %s\n", fileName, PHYSFS_getLastError());
PNGReadCleanup(&info_ptr, &png_ptr, fileHandle);
return FALSE;
return false;
}
// Verify the PNG header to be correct
@ -102,21 +102,21 @@ BOOL iV_loadImage_PNG(const char *fileName, iV_Image *image)
{
debug(LOG_3D, "pie_PNGLoadMem: Did not recognize PNG header in %s", fileName);
PNGReadCleanup(&info_ptr, &png_ptr, fileHandle);
return FALSE;
return false;
}
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) {
debug(LOG_3D, "pie_PNGLoadMem: Unable to create png struct");
PNGReadCleanup(&info_ptr, &png_ptr, fileHandle);
return FALSE;
return false;
}
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
debug(LOG_3D, "pie_PNGLoadMem: Unable to create png info struct");
PNGReadCleanup(&info_ptr, &png_ptr, fileHandle);
return FALSE;
return false;
}
// Set libpng's failure jump position to the if branch,
@ -124,7 +124,7 @@ BOOL iV_loadImage_PNG(const char *fileName, iV_Image *image)
if (setjmp(png_jmpbuf(png_ptr))) {
debug(LOG_3D, "pie_PNGLoadMem: Error decoding PNG data in %s", fileName);
PNGReadCleanup(&info_ptr, &png_ptr, fileHandle);
return FALSE;
return false;
}
// Tell libpng how many byte we already read
@ -166,7 +166,7 @@ BOOL iV_loadImage_PNG(const char *fileName, iV_Image *image)
}
PNGReadCleanup(&info_ptr, &png_ptr, fileHandle);
return TRUE;
return true;
}
void iV_saveImage_PNG(const char *fileName, const iV_Image *image)

View File

@ -28,7 +28,7 @@
*
* \param fileName input file to load from
* \param image Sprite to read into
* \return TRUE on success, FALSE otherwise
* \return true on success, false otherwise
*/
BOOL iV_loadImage_PNG(const char *fileName, iV_Image *image);
@ -37,7 +37,7 @@ BOOL iV_loadImage_PNG(const char *fileName, iV_Image *image);
*
* \param fileName output file to save to
* \param image Texture to read from
* \return TRUE on success, FALSE otherwise
* \return true on success, false otherwise
*/
void iV_saveImage_PNG(const char *fileName, const iV_Image *image);

View File

@ -64,7 +64,7 @@ static UDWORD radarTexture;
void pie_Line(int x0, int y0, int x1, int y1, PIELIGHT colour)
{
pie_SetTexturePage(TEXPAGE_NONE);
pie_SetAlphaTest(FALSE);
pie_SetAlphaTest(false);
glColor4ubv(colour.vector);
glBegin(GL_LINE_STRIP);
@ -101,7 +101,7 @@ static void pie_DrawRect(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1, PIELIGHT co
y1 = psRendSurface->clip.bottom;
}
pie_SetAlphaTest(FALSE);
pie_SetAlphaTest(false);
glColor4ubv(colour.vector);
glBegin(GL_TRIANGLE_STRIP);
@ -118,7 +118,7 @@ static void pie_DrawRect(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1, PIELIGHT co
void pie_Box(int x0,int y0, int x1, int y1, PIELIGHT colour)
{
pie_SetTexturePage(TEXPAGE_NONE);
pie_SetAlphaTest(FALSE);
pie_SetAlphaTest(false);
if (x0>psRendSurface->clip.right || x1<psRendSurface->clip.left ||
y0>psRendSurface->clip.bottom || y1<psRendSurface->clip.top)
@ -188,7 +188,7 @@ void pie_ImageFileID(IMAGEFILE *ImageFile, UWORD ID, int x, int y)
Image = &ImageFile->ImageDefs[ID];
pie_SetRendMode(REND_GOURAUD_TEX);
pie_SetAlphaTest(TRUE);
pie_SetAlphaTest(true);
pieImage.texPage = ImageFile->TPageIDs[Image->TPageID];
pieImage.tu = Image->Tu;
@ -214,7 +214,7 @@ void pie_ImageFileIDTile(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Width
Image = &ImageFile->ImageDefs[ID];
pie_SetRendMode(REND_GOURAUD_TEX);
pie_SetAlphaTest(TRUE);
pie_SetAlphaTest(true);
pieImage.texPage = ImageFile->TPageIDs[Image->TPageID];
pieImage.tu = Image->Tu;
@ -290,13 +290,13 @@ void pie_UploadDisplayBuffer()
BOOL pie_InitRadar(void)
{
glGenTextures(1, &radarTexture);
return TRUE;
return true;
}
BOOL pie_ShutdownRadar(void)
{
glDeleteTextures(1, &radarTexture);
return TRUE;
return true;
}
void pie_DownLoadRadar(UDWORD *buffer, int width, int height)

View File

@ -68,11 +68,11 @@ BOOL check_extension(const char *extName)
int n = strcspn(p, " ");
if ((extNameLen == n) && (strncmp(extName, p, n) == 0))
{
return TRUE;
return true;
}
p += (n + 1);
}
return FALSE;
return false;
}
// EXT_stencil_two_side
@ -91,7 +91,7 @@ PFNGLACTIVESTENCILFACEEXTPROC glActiveStencilFaceEXT;
/** Check if we can use one-pass stencil in the shadow draw code. */
static BOOL stencil_one_pass(void)
{
// tribool, -1: uninitialized, 0: FALSE, 1: TRUE
// tribool, -1: uninitialized, 0: false, 1: true
static int can_do_stencil_one_pass = -1;
if (can_do_stencil_one_pass < 0) {
@ -125,8 +125,8 @@ static BOOL stencil_one_pass(void)
static unsigned int pieCount = 0;
static unsigned int tileCount = 0;
static unsigned int polyCount = 0;
static BOOL lighting = FALSE;
static BOOL shadows = FALSE;
static BOOL lighting = false;
static BOOL shadows = false;
/*
* Source
@ -148,14 +148,14 @@ void pie_BeginLighting(const Vector3f * light)
glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
glEnable(GL_LIGHT0);
// lighting = TRUE;
shadows = TRUE;
// lighting = true;
shadows = true;
}
void pie_EndLighting(void)
{
shadows = FALSE;
lighting = FALSE;
shadows = false;
lighting = false;
}
/***************************************************************************
@ -197,33 +197,33 @@ static void pie_Draw3DShape2(iIMDShape *shape, int frame, PIELIGHT colour, PIELI
iIMDPoly *pPolys;
BOOL light = lighting;
pie_SetAlphaTest(TRUE);
pie_SetAlphaTest(true);
/* Set tranlucency */
if (pieFlag & pie_ADDITIVE)
{ //Assume also translucent
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
pie_SetRendMode(REND_ADDITIVE_TEX);
colour.byte.a = (UBYTE)pieFlagData;
light = FALSE;
light = false;
}
else if (pieFlag & pie_TRANSLUCENT)
{
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
pie_SetRendMode(REND_ALPHA_TEX);
colour.byte.a = (UBYTE)pieFlagData;
light = FALSE;
light = false;
}
else
{
if (pieFlag & pie_BUTTON)
{
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON);
}
else
{
pie_SetFogStatus(TRUE);
pie_SetFogStatus(true);
}
pie_SetRendMode(REND_GOURAUD_TEX);
}
@ -361,19 +361,19 @@ static int compare_edge (EDGE *A, EDGE *B, const Vector3f *pVertices )
{
if(A->to == B->from)
{
return TRUE;
return true;
}
return Vector3f_Compare(pVertices[A->to], pVertices[B->from]);
}
if(!Vector3f_Compare(pVertices[A->from], pVertices[B->to]))
{
return FALSE;
return false;
}
if(A->to == B->from)
{
return TRUE;
return true;
}
return Vector3f_Compare(pVertices[A->to], pVertices[B->from]);
}
@ -384,7 +384,7 @@ static void addToEdgeList(int a, int b, EDGE *edgelist, unsigned int* edge_count
{
EDGE newEdge = {a, b};
unsigned int i;
BOOL foundMatching = FALSE;
BOOL foundMatching = false;
for(i = 0; i < *edge_count; i++)
{
@ -396,7 +396,7 @@ static void addToEdgeList(int a, int b, EDGE *edgelist, unsigned int* edge_count
if(compare_edge(&newEdge, &edgelist[i], pVertices)) {
// remove the other too
edgelist[i].from = -1;
foundMatching = TRUE;
foundMatching = true;
break;
}
}
@ -698,7 +698,7 @@ static void pie_DrawShadows(void)
glPushMatrix();
pie_SetAlphaTest(FALSE);
pie_SetAlphaTest(false);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthFunc(GL_LESS);
glDepthMask(GL_FALSE);

View File

@ -43,7 +43,7 @@ typedef struct { SDWORD a, b, c, d, e, f, g, h, i, j, k, l; } SDMATRIX;
static SDMATRIX aMatrixStack[MATRIX_MAX];
static SDMATRIX *psMatrix = &aMatrixStack[0];
BOOL drawing_interface = TRUE;
BOOL drawing_interface = true;
//*************************************************************************
@ -323,13 +323,13 @@ void pie_TranslateTextureEnd(void)
void pie_Begin3DScene(void)
{
glDepthRange(0.1, 1);
drawing_interface = FALSE;
drawing_interface = false;
}
void pie_BeginInterface(void)
{
glDepthRange(0, 0.1);
drawing_interface = TRUE;
drawing_interface = true;
}
void pie_SetGeometricOffset(int x, int y)

View File

@ -92,7 +92,7 @@ BOOL pie_Initialise(void)
pie_SetDefaultStates();
iV_RenderAssign(&rendSurface);
return TRUE;
return true;
}

View File

@ -128,9 +128,9 @@ void pie_SetFogStatus(BOOL val)
else
{
//fog disabled so turn it off if not off already
if (rendStates.fog != FALSE)
if (rendStates.fog != false)
{
rendStates.fog = FALSE;
rendStates.fog = false;
}
}
}
@ -168,7 +168,7 @@ void pie_SetAlphaTest(BOOL keyingOn)
rendStates.keyingOn = keyingOn;
pieStateCount++;
if (keyingOn == TRUE) {
if (keyingOn == true) {
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.1f);
} else {

View File

@ -47,9 +47,9 @@ UDWORD screenDepth = 0;
int wz_texture_compression;
static SDL_Surface *screen = NULL;
static BOOL bBackDrop = FALSE;
static BOOL bBackDrop = false;
static char screendump_filename[PATH_MAX];
static BOOL screendump_required = FALSE;
static BOOL screendump_required = false;
static GLuint backDropTexture = ~0;
/* Initialise the double buffered display */
@ -75,7 +75,7 @@ BOOL screenInitialise(
const SDL_VideoInfo* video_info = SDL_GetVideoInfo();
if (!video_info) {
return FALSE;
return false;
}
// The flags to pass to SDL_SetVideoMode.
@ -105,7 +105,7 @@ BOOL screenInitialise(
bpp = SDL_VideoModeOK(width, height, bitDepth, video_flags);
if (!bpp) {
debug( LOG_ERROR, "Error: Video mode %dx%d@%dbpp is not supported!\n", width, height, bitDepth );
return FALSE;
return false;
}
switch ( bpp )
{
@ -141,7 +141,7 @@ BOOL screenInitialise(
screen = SDL_SetVideoMode(width, height, bpp, video_flags);
if ( !screen ) {
debug( LOG_ERROR, "Error: SDL_SetVideoMode failed (%s).", SDL_GetError() );
return FALSE;
return false;
}
if ( SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &value) == -1)
{
@ -181,7 +181,7 @@ BOOL screenInitialise(
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
return TRUE;
return true;
}
@ -240,12 +240,12 @@ void screen_SetBackDropFromFile(const char* filename)
void screen_StopBackDrop(void)
{
bBackDrop = FALSE; //checking [movie]
bBackDrop = false; //checking [movie]
}
void screen_RestartBackDrop(void)
{
bBackDrop = TRUE;
bBackDrop = true;
}
BOOL screen_GetBackDrop(void)
@ -342,7 +342,7 @@ void screenDoDumpToDiskIfRequired(void)
// Write the screen to a PNG
iV_saveImage_PNG(fileName, &image);
screendump_required = FALSE;
screendump_required = false;
}
void screenDumpToDisk(const char* path) {
@ -361,5 +361,5 @@ void screenDumpToDisk(const char* path) {
// If we have an integer overflow, we don't want to go about and overwrite files
if (screendump_num != 0)
screendump_required = TRUE;
screendump_required = true;
}

View File

@ -121,13 +121,13 @@ BOOL NETstartLogging(void)
{
debug(LOG_ERROR, "Could not create net log %s: %s", filename,
PHYSFS_getLastError());
return FALSE;
return false;
}
snprintf(buf, sizeof(buf), "NETPLAY log: %s\n", asctime(newtime));
// Guarantee to nul-terminate
buf[sizeof(buf) - 1] = '\0';
PHYSFS_write( pFileHandle, buf, strlen( buf ), 1 );
return TRUE;
return true;
}
BOOL NETstopLogging(void)
@ -148,10 +148,10 @@ BOOL NETstopLogging(void)
if (!PHYSFS_close(pFileHandle))
{
debug(LOG_ERROR, "Could not close net log: %s", PHYSFS_getLastError());
return FALSE;
return false;
}
return TRUE;
return true;
}
void NETlogPacket(NETMSG *msg, BOOL received)
@ -176,7 +176,7 @@ BOOL NETlogEntry(const char *str,UDWORD a,UDWORD b)
#ifndef MASSIVELOGS
if(a ==9 || a==10)
{
return TRUE;
return true;
}
#endif
@ -213,5 +213,5 @@ BOOL NETlogEntry(const char *str,UDWORD a,UDWORD b)
PHYSFS_write(pFileHandle, star_line, strlen(star_line), 1);
PHYSFS_flush(pFileHandle);
return TRUE;
return true;
}

View File

@ -107,13 +107,13 @@ typedef struct
NETPLAY NetPlay;
static BOOL allow_joining = FALSE;
static BOOL allow_joining = false;
static GAMESTRUCT game;
static TCPsocket tcp_socket = NULL;
static NETBUFSOCKET* bsocket = NULL;
static NETBUFSOCKET* connected_bsocket[MAX_CONNECTED_PLAYERS] = { NULL };
static SDLNet_SocketSet socket_set = NULL;
static BOOL is_server = FALSE;
static BOOL is_server = false;
static TCPsocket tmp_socket[MAX_TMP_SOCKETS] = { NULL };
static SDLNet_SocketSet tmp_socket_set = NULL;
static char* hostname;
@ -160,12 +160,12 @@ static BOOL NET_fillBuffer(NETBUFSOCKET* bs, SDLNet_SocketSet socket_set)
if (bs->buffer_start != 0)
{
return FALSE;
return false;
}
if (SDLNet_SocketReady(bs->socket) <= 0)
{
return FALSE;
return false;
}
size = SDLNet_TCP_Recv(bs->socket, bufstart, bufsize);
@ -173,7 +173,7 @@ static BOOL NET_fillBuffer(NETBUFSOCKET* bs, SDLNet_SocketSet socket_set)
if (size > 0)
{
bs->bytes += size;
return TRUE;
return true;
} else {
if (socket_set != NULL)
{
@ -183,10 +183,10 @@ static BOOL NET_fillBuffer(NETBUFSOCKET* bs, SDLNet_SocketSet socket_set)
bs->socket = NULL;
}
return FALSE;
return false;
}
// Check if we have a full message waiting for us. If not, return FALSE and wait for more data.
// Check if we have a full message waiting for us. If not, return false and wait for more data.
// If there is a data remnant somewhere in the buffer except at its beginning, move it to the
// beginning.
static BOOL NET_recvMessage(NETBUFSOCKET* bs)
@ -215,7 +215,7 @@ static BOOL NET_recvMessage(NETBUFSOCKET* bs)
bs->buffer_start += size;
bs->bytes -= size;
return TRUE;
return true;
error:
if (bs->buffer_start != 0)
@ -242,7 +242,7 @@ error:
bs->buffer_start = 0;
}
return FALSE;
return false;
}
static void NET_InitPlayers(void)
@ -251,7 +251,7 @@ static void NET_InitPlayers(void)
for (i = 0; i < MAX_CONNECTED_PLAYERS; ++i)
{
players[i].allocated = FALSE;
players[i].allocated = false;
players[i].id = i;
}
}
@ -272,9 +272,9 @@ static unsigned int NET_CreatePlayer(const char* name, unsigned int flags)
for (i = 1; i < MAX_CONNECTED_PLAYERS; ++i)
{
if (players[i].allocated == FALSE)
if (players[i].allocated == false)
{
players[i].allocated = TRUE;
players[i].allocated = true;
strlcpy(players[i].name, name, sizeof(players[i].name));
players[i].flags = flags;
NETBroadcastPlayerInfo(i);
@ -287,7 +287,7 @@ static unsigned int NET_CreatePlayer(const char* name, unsigned int flags)
static void NET_DestroyPlayer(unsigned int id)
{
players[id].allocated = FALSE;
players[id].allocated = false;
}
// ////////////////////////////////////////////////////////////////////////
@ -301,7 +301,7 @@ UDWORD NETplayerInfo(void)
if(!NetPlay.bComms)
{
NetPlay.playercount = 1;
NetPlay.players[0].bHost = TRUE;
NetPlay.players[0].bHost = true;
NetPlay.players[0].dpid = HOST_DPID;
return 1;
}
@ -310,18 +310,18 @@ UDWORD NETplayerInfo(void)
for (i = 0; i < MAX_CONNECTED_PLAYERS; ++i)
{
if (players[i].allocated == TRUE)
if (players[i].allocated == true)
{
NetPlay.players[NetPlay.playercount].dpid = i;
strlcpy(NetPlay.players[NetPlay.playercount].name, players[i].name, sizeof(NetPlay.players[NetPlay.playercount].name));
if (players[i].flags & PLAYER_HOST)
{
NetPlay.players[NetPlay.playercount].bHost = TRUE;
NetPlay.players[NetPlay.playercount].bHost = true;
}
else
{
NetPlay.players[NetPlay.playercount].bHost = FALSE;
NetPlay.players[NetPlay.playercount].bHost = false;
}
NetPlay.playercount++;
@ -338,7 +338,7 @@ BOOL NETchangePlayerName(UDWORD dpid, char *newName)
if(!NetPlay.bComms)
{
strlcpy(NetPlay.players[0].name, newName, sizeof(NetPlay.players[0].name));
return TRUE;
return true;
}
debug(LOG_NET, "Requesting a change of player name for pid=%d to %s", dpid, newName);
@ -346,7 +346,7 @@ BOOL NETchangePlayerName(UDWORD dpid, char *newName)
NETBroadcastPlayerInfo(dpid);
return TRUE;
return true;
}
// ////////////////////////////////////////////////////////////////////////
@ -386,7 +386,7 @@ BOOL NETsetGameFlags(UDWORD flag, SDWORD value)
{
if(!NetPlay.bComms)
{
return TRUE;
return true;
}
if (flag > 0 && flag < 5)
@ -396,7 +396,7 @@ BOOL NETsetGameFlags(UDWORD flag, SDWORD value)
NETsendGameFlags();
return TRUE;
return true;
}
static void NETsendGAMESTRUCT(TCPsocket socket, const GAMESTRUCT* game)
@ -501,24 +501,24 @@ BOOL NETinit(BOOL bFirstCall)
NetPlay.dpidPlayer = 0;
NetPlay.bHost = 0;
NetPlay.bComms = TRUE;
NetPlay.bComms = true;
for(i = 0; i < MAX_PLAYERS; i++)
{
memset(&NetPlay.players[i], 0, sizeof(PLAYER));
memset(&NetPlay.games[i], 0, sizeof(GAMESTRUCT));
}
NetPlay.bComms = TRUE;
NetPlay.bComms = true;
NETstartLogging();
}
if (SDLNet_Init() == -1)
{
debug(LOG_ERROR, "SDLNet_Init: %s", SDLNet_GetError());
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -542,7 +542,7 @@ BOOL NETclose(void)
debug(LOG_NET, "NETclose");
NEThaltJoining();
is_server=FALSE;
is_server=false;
if(bsocket)
{
@ -584,7 +584,7 @@ BOOL NETclose(void)
SDLNet_TCP_Close(tcp_socket);
tcp_socket=NULL;
}
return FALSE;
return false;
}
@ -679,16 +679,16 @@ BOOL NETsend(NETMSG *msg, UDWORD player)
if(!NetPlay.bComms)
{
return TRUE;
return true;
}
if (player >= MAX_CONNECTED_PLAYERS) return FALSE;
if (player >= MAX_CONNECTED_PLAYERS) return false;
msg->destination = player;
msg->source = selectedPlayer;
size = msg->size + sizeof(msg->size) + sizeof(msg->type) + sizeof(msg->destination) + sizeof(msg->source);
NETlogPacket(msg, FALSE);
NETlogPacket(msg, false);
if (is_server)
{
@ -700,17 +700,17 @@ BOOL NETsend(NETMSG *msg, UDWORD player)
{
nStats.bytesSent += size;
nStats.packetsSent += 1;
return TRUE;
return true;
}
} else {
if ( tcp_socket
&& SDLNet_TCP_Send(tcp_socket, msg, size) == size)
{
return TRUE;
return true;
}
}
return FALSE;
return false;
}
// ////////////////////////////////////////////////////////////////////////
@ -721,7 +721,7 @@ BOOL NETbcast(NETMSG *msg)
if(!NetPlay.bComms)
{
return TRUE;
return true;
}
msg->destination = NET_ALL_PLAYERS;
@ -729,7 +729,7 @@ BOOL NETbcast(NETMSG *msg)
size = msg->size + sizeof(msg->size) + sizeof(msg->type) + sizeof(msg->destination) + sizeof(msg->source);
NETlogPacket(msg, FALSE);
NETlogPacket(msg, false);
if (is_server)
{
@ -748,14 +748,14 @@ BOOL NETbcast(NETMSG *msg)
if ( tcp_socket == NULL
|| SDLNet_TCP_Send(tcp_socket, msg, size) < size)
{
return FALSE;
return false;
}
}
nStats.bytesSent += size;
nStats.packetsSent += 1;
return TRUE;
return true;
}
///////////////////////////////////////////////////////////////////////////
@ -866,15 +866,15 @@ static BOOL NETprocessSystemMessage(void)
break;
}
default:
return FALSE;
return false;
}
return TRUE;
return true;
}
// ////////////////////////////////////////////////////////////////////////
// Receive a message over the current connection. We return TRUE if there
// is a message for the higher level code to process, and FALSE otherwise.
// Receive a message over the current connection. We return true if there
// is a message for the higher level code to process, and false otherwise.
// We should not block here.
BOOL NETrecv(uint8_t *type)
{
@ -885,7 +885,7 @@ BOOL NETrecv(uint8_t *type)
if (!NetPlay.bComms)
{
return FALSE;
return false;
}
if (is_server)
@ -895,25 +895,25 @@ BOOL NETrecv(uint8_t *type)
do {
receive_message:
received = FALSE;
received = false;
if (is_server)
{
if (connected_bsocket[current] == NULL)
{
return FALSE;
return false;
}
received = NET_recvMessage(connected_bsocket[current]);
if (received == FALSE)
if (received == false)
{
uint32_t i = current + 1;
if (socket_set == NULL
|| SDLNet_CheckSockets(socket_set, NET_READ_TIMEOUT) <= 0)
{
return FALSE;
return false;
}
for (;;)
{
@ -951,7 +951,7 @@ receive_message:
if (i == current+1)
{
return FALSE;
return false;
}
}
}
@ -959,11 +959,11 @@ receive_message:
// we are a client
if (bsocket == NULL)
{
return FALSE;
return false;
} else {
received = NET_recvMessage(bsocket);
if (received == FALSE)
if (received == false)
{
if ( socket_set != NULL
&& SDLNet_CheckSockets(socket_set, NET_READ_TIMEOUT) > 0
@ -975,15 +975,15 @@ receive_message:
}
}
if (received == FALSE)
if (received == false)
{
return FALSE;
return false;
}
else
{
size = pMsg->size + sizeof(pMsg->size) + sizeof(pMsg->type)
+ sizeof(pMsg->destination) + sizeof(pMsg->source);
if (is_server == FALSE)
if (is_server == false)
{
// do nothing
}
@ -1024,12 +1024,12 @@ receive_message:
nStats.packetsRecvd += 1;
}
} while (NETprocessSystemMessage() == TRUE);
} while (NETprocessSystemMessage() == true);
NETlogPacket(pMsg, TRUE);
NETlogPacket(pMsg, true);
*type = pMsg->type;
return TRUE;
return true;
}
// ////////////////////////////////////////////////////////////////////////
@ -1053,7 +1053,7 @@ BOOL NETsetupTCPIP(const char *machine)
hostname = masterserver_name;
}
return TRUE;
return true;
}
// ////////////////////////////////////////////////////////////////////////
@ -1095,7 +1095,7 @@ UBYTE NETsendFile(BOOL newFile, char *fileName, UDWORD player)
if (player == 0)
{ // FIXME: why would you send (map) file to everyone ??
// even if they already have it? multiplay.c 1529 & 1550 are both
// NETsendFile(TRUE,mapStr,0); & NETsendFile(FALSE,game.map,0);
// NETsendFile(true,mapStr,0); & NETsendFile(false,game.map,0);
// so we ALWAYS send it, it seems?
NETbeginEncode(FILEMSG, NET_ALL_PLAYERS); // send it.
}
@ -1221,7 +1221,7 @@ static void NETallowJoining(void)
UDWORD numgames = SDL_SwapBE32(1); // always 1 on normal server
char buffer[5];
if (allow_joining == FALSE) return;
if (allow_joining == false) return;
NETregisterServer(1);
@ -1355,36 +1355,36 @@ BOOL NEThostGame(const char* SessionName, const char* PlayerName,
if(!NetPlay.bComms)
{
NetPlay.dpidPlayer = HOST_DPID;
NetPlay.bHost = TRUE;
NetPlay.bHost = true;
return TRUE;
return true;
}
if(SDLNet_ResolveHost(&ip, NULL, gameserver_port) == -1)
{
debug(LOG_ERROR, "NEThostGame: Cannot resolve master self: %s", SDLNet_GetError());
return FALSE;
return false;
}
if(!tcp_socket) tcp_socket = SDLNet_TCP_Open(&ip);
if(tcp_socket == NULL)
{
printf("NEThostGame: Cannot connect to master self: %s", SDLNet_GetError());
return FALSE;
return false;
}
if(!socket_set) socket_set = SDLNet_AllocSocketSet(MAX_CONNECTED_PLAYERS);
if (socket_set == NULL)
{
debug(LOG_ERROR, "NEThostGame: Cannot create socket set: %s", SDLNet_GetError());
return FALSE;
return false;
}
for (i = 0; i < MAX_CONNECTED_PLAYERS; ++i)
{
connected_bsocket[i] = NET_createBufferedSocket();
}
is_server = TRUE;
is_server = true;
strlcpy(game.name, SessionName, sizeof(game.name));
memset(&game.desc, 0, sizeof(SESSIONDESC));
@ -1401,17 +1401,17 @@ BOOL NEThostGame(const char* SessionName, const char* PlayerName,
NET_InitPlayers();
NetPlay.dpidPlayer = NET_CreatePlayer(PlayerName, PLAYER_HOST);
NetPlay.bHost = TRUE;
NetPlay.bHost = true;
MultiPlayerJoin(NetPlay.dpidPlayer);
allow_joining = TRUE;
allow_joining = true;
NETregisterServer(0);
debug(LOG_NET, "Hosting a server. We are player %d.", NetPlay.dpidPlayer);
return TRUE;
return true;
}
// ////////////////////////////////////////////////////////////////////////
@ -1420,10 +1420,10 @@ BOOL NEThaltJoining(void)
{
debug(LOG_NET, "NEThaltJoining");
allow_joining = FALSE;
allow_joining = false;
// disconnect from the master server
NETregisterServer(0);
return TRUE;
return true;
}
// ////////////////////////////////////////////////////////////////////////
@ -1444,14 +1444,14 @@ BOOL NETfindGame(void)
if(!NetPlay.bComms)
{
NetPlay.dpidPlayer = HOST_DPID;
NetPlay.bHost = TRUE;
return TRUE;
NetPlay.bHost = true;
return true;
}
if (SDLNet_ResolveHost(&ip, hostname, port) == -1)
{
debug(LOG_ERROR, "NETfindGame: Cannot resolve hostname \"%s\": %s", hostname, SDLNet_GetError());
return FALSE;
return false;
}
if (tcp_socket != NULL)
@ -1463,14 +1463,14 @@ BOOL NETfindGame(void)
if (tcp_socket == NULL)
{
debug(LOG_ERROR, "NETfindGame: Cannot connect to \"%s:%d\": %s", hostname, port, SDLNet_GetError());
return FALSE;
return false;
}
socket_set = SDLNet_AllocSocketSet(1);
if (socket_set == NULL)
{
debug(LOG_ERROR, "NETfindGame: Cannot create socket set: %s", SDLNet_GetError());
return FALSE;
return false;
}
SDLNet_TCP_AddSocket(socket_set, tcp_socket);
@ -1485,7 +1485,7 @@ BOOL NETfindGame(void)
else
{
// when we fail to receive a game count, bail out
return FALSE;
return false;
}
debug(LOG_NET, "receiving info of %u game(s)", (unsigned int)gamesavailable);
@ -1515,7 +1515,7 @@ BOOL NETfindGame(void)
++gamecount;
} while (gamecount < gamesavailable);
return TRUE;
return true;
}
// ////////////////////////////////////////////////////////////////////////
@ -1538,7 +1538,7 @@ BOOL NETjoinGame(UDWORD gameNumber, const char* playername)
if(SDLNet_ResolveHost(&ip, hostname, gameserver_port) == -1)
{
debug(LOG_ERROR, "NETjoinGame: Cannot resolve hostname \"%s\": %s", hostname, SDLNet_GetError());
return FALSE;
return false;
}
if (tcp_socket != NULL)
@ -1550,14 +1550,14 @@ BOOL NETjoinGame(UDWORD gameNumber, const char* playername)
if (tcp_socket == NULL)
{
debug(LOG_ERROR, "NETjoinGame: Cannot connect to \"%s:%d\": %s", hostname, gameserver_port, SDLNet_GetError());
return FALSE;
return false;
}
socket_set = SDLNet_AllocSocketSet(1);
if (socket_set == NULL)
{
debug(LOG_ERROR, "NETjoinGame: Cannot create socket set: %s", SDLNet_GetError());
return FALSE;
return false;
}
SDLNet_TCP_AddSocket(socket_set, tcp_socket);
@ -1604,24 +1604,24 @@ BOOL NETjoinGame(UDWORD gameNumber, const char* playername)
NetPlay.dpidPlayer = dpid;
debug(LOG_NET, "NETjoinGame: NET_ACCEPTED received. Accepted into the game - I'm player %u",
(unsigned int)NetPlay.dpidPlayer);
NetPlay.bHost = FALSE;
NetPlay.bHost = false;
if (NetPlay.dpidPlayer >= MAX_CONNECTED_PLAYERS)
{
debug(LOG_ERROR, "Bad player number (%u) received from host!", NetPlay.dpidPlayer);
return FALSE;
return false;
}
players[NetPlay.dpidPlayer].allocated = TRUE;
players[NetPlay.dpidPlayer].allocated = true;
players[NetPlay.dpidPlayer].id = NetPlay.dpidPlayer;
strlcpy(players[NetPlay.dpidPlayer].name, playername, sizeof(players[NetPlay.dpidPlayer].name));
players[NetPlay.dpidPlayer].flags = 0;
return TRUE;
return true;
}
}
return FALSE;
return false;
}
/*!

View File

@ -154,7 +154,7 @@ typedef struct {
// booleans
uint32_t bComms; // actually do the comms?
uint32_t bHost; // TRUE if we are hosting the session
uint32_t bHost; // true if we are hosting the session
} NETPLAY;
// ////////////////////////////////////////////////////////////////////////

View File

@ -54,7 +54,7 @@ void NETbeginEncode(uint8_t type, uint8_t player)
NETsetPacketDir(PACKET_ENCODE);
NetMsg.type = type;
NetMsg.size = 0;
NetMsg.status = TRUE;
NetMsg.status = true;
NetMsg.destination = player;
memset(&NetMsg.body, '\0', MaxMsgSize);
}
@ -64,23 +64,23 @@ void NETbeginDecode(uint8_t type)
NETsetPacketDir(PACKET_DECODE);
assert(type == NetMsg.type);
NetMsg.size = 0;
NetMsg.status = TRUE;
NetMsg.status = true;
}
BOOL NETend(void)
{
assert(NETgetPacketDir() != PACKET_INVALID);
// If we are decoding just return TRUE
// If we are decoding just return true
if (NETgetPacketDir() == PACKET_DECODE)
{
return TRUE;
return true;
}
// If the packet is invalid or failed to compile
if (NETgetPacketDir() != PACKET_ENCODE || !NetMsg.status)
{
return FALSE;
return false;
}
// We have sent the packet, so make it invalid (to prevent re-sending)
@ -109,7 +109,7 @@ BOOL NETint8_t(int8_t *ip)
// Make sure there is enough data/space left in the packet
if (sizeof(int8_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
{
return NetMsg.status = FALSE;
return NetMsg.status = false;
}
// 8-bit (1 byte) integers need no endian-swapping!
@ -125,7 +125,7 @@ BOOL NETint8_t(int8_t *ip)
// Increment the size of the message
NetMsg.size += sizeof(int8_t);
return TRUE;
return true;
}
BOOL NETuint8_t(uint8_t *ip)
@ -135,7 +135,7 @@ BOOL NETuint8_t(uint8_t *ip)
// Make sure there is enough data/space left in the packet
if (sizeof(uint8_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
{
return NetMsg.status = FALSE;
return NetMsg.status = false;
}
// 8-bit (1 byte) integers need no endian-swapping!
@ -151,7 +151,7 @@ BOOL NETuint8_t(uint8_t *ip)
// Increment the size of the message
NetMsg.size += sizeof(uint8_t);
return TRUE;
return true;
}
BOOL NETint16_t(int16_t *ip)
@ -161,7 +161,7 @@ BOOL NETint16_t(int16_t *ip)
// Make sure there is enough data/space left in the packet
if (sizeof(int16_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
{
return NetMsg.status = FALSE;
return NetMsg.status = false;
}
// Convert the integer into the network byte order (big endian)
@ -177,7 +177,7 @@ BOOL NETint16_t(int16_t *ip)
// Increment the size of the message
NetMsg.size += sizeof(int16_t);
return TRUE;
return true;
}
BOOL NETuint16_t(uint16_t *ip)
@ -187,7 +187,7 @@ BOOL NETuint16_t(uint16_t *ip)
// Make sure there is enough data/space left in the packet
if (sizeof(uint16_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
{
return NetMsg.status = FALSE;
return NetMsg.status = false;
}
// Convert the integer into the network byte order (big endian)
@ -203,7 +203,7 @@ BOOL NETuint16_t(uint16_t *ip)
// Increment the size of the message
NetMsg.size += sizeof(uint16_t);
return TRUE;
return true;
}
BOOL NETint32_t(int32_t *ip)
@ -213,7 +213,7 @@ BOOL NETint32_t(int32_t *ip)
// Make sure there is enough data/space left in the packet
if (sizeof(int32_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
{
return NetMsg.status = FALSE;
return NetMsg.status = false;
}
// Convert the integer into the network byte order (big endian)
@ -229,7 +229,7 @@ BOOL NETint32_t(int32_t *ip)
// Increment the size of the message
NetMsg.size += sizeof(int32_t);
return TRUE;
return true;
}
BOOL NETuint32_t(uint32_t *ip)
@ -239,7 +239,7 @@ BOOL NETuint32_t(uint32_t *ip)
// Make sure there is enough data/space left in the packet
if (sizeof(uint32_t) + NetMsg.size > MaxMsgSize || !NetMsg.status)
{
return NetMsg.status = FALSE;
return NetMsg.status = false;
}
// Convert the integer into the network byte order (big endian)
@ -255,7 +255,7 @@ BOOL NETuint32_t(uint32_t *ip)
// Increment the size of the message
NetMsg.size += sizeof(uint32_t);
return TRUE;
return true;
}
BOOL NETfloat(float *fp)
@ -341,7 +341,7 @@ BOOL NETstring(char *str, uint16_t maxlen)
// Make sure there is enough data/space left in the packet
if (len + NetMsg.size > MaxMsgSize || !NetMsg.status)
{
return NetMsg.status = FALSE;
return NetMsg.status = false;
}
if (NETgetPacketDir() == PACKET_ENCODE)
@ -365,7 +365,7 @@ BOOL NETstring(char *str, uint16_t maxlen)
// Increment the size of the message
NetMsg.size += sizeof(len) + len;
return TRUE;
return true;
}
BOOL NETbin(char *str, uint16_t maxlen)
@ -388,7 +388,7 @@ BOOL NETbin(char *str, uint16_t maxlen)
// Make sure there is enough data/space left in the packet
if (len + NetMsg.size > MaxMsgSize || !NetMsg.status)
{
return NetMsg.status = FALSE;
return NetMsg.status = false;
}
if (NETgetPacketDir() == PACKET_ENCODE)
@ -410,7 +410,7 @@ BOOL NETbin(char *str, uint16_t maxlen)
// Increment the size of the message
NetMsg.size += sizeof(len) + len;
return TRUE;
return true;
}
BOOL NETVector3uw(Vector3uw* vp)
@ -430,7 +430,7 @@ static void NETcoder(PACKETDIR dir)
{
static const char original[] = "THIS IS A TEST STRING";
char str[sizeof(original)];
BOOL b = TRUE;
BOOL b = true;
uint32_t u32 = 32;
uint16_t u16 = 16;
uint8_t u8 = 8;
@ -445,7 +445,7 @@ static void NETcoder(PACKETDIR dir)
NETbeginEncode(0, 0);
else
NETbeginDecode(0);
NETbool(&b); assert(b == TRUE);
NETbool(&b); assert(b == true);
NETuint32_t(&u32); assert(u32 == 32);
NETuint16_t(&u16); assert(u16 == 16);
NETuint8_t(&u8); assert(u8 == 8);

View File

@ -66,8 +66,8 @@ static BOOL chat_store_parameter(INTERP_VAL *cmdParam)
//if(numMsgParams >= MAX_CHAT_ARGUMENTS)
if(chat_msg.numCommands >= MAX_CHAT_COMMANDS)
{
ASSERT(FALSE, "chat_store_parameter: too many commands in a message");
return FALSE;
ASSERT(false, "chat_store_parameter: too many commands in a message");
return false;
}
numCommands = chat_msg.numCommands;
@ -76,8 +76,8 @@ static BOOL chat_store_parameter(INTERP_VAL *cmdParam)
/* Make sure we still have room for more parameters */
if(numCmdParams >= MAX_CHAT_CMD_PARAMS)
{
ASSERT(FALSE, "chat_store_parameter: out of parameters for command %d", numCommands);
return FALSE;
ASSERT(false, "chat_store_parameter: out of parameters for command %d", numCommands);
return false;
}
/* Store parameter for command we are currently processing */
@ -86,7 +86,7 @@ static BOOL chat_store_parameter(INTERP_VAL *cmdParam)
chat_msg.cmdData[numCommands].numCmdParams++;
return TRUE;
return true;
}
// Store extracted command for use in scripts
@ -99,7 +99,7 @@ static void chat_store_command(const char *command)
/* Make sure we have no overflow */
if(chat_msg.numCommands >= MAX_CHAT_COMMANDS)
{
ASSERT(FALSE, "chat_store_command: too many commands in a message");
ASSERT(false, "chat_store_command: too many commands in a message");
return;
}
@ -109,7 +109,7 @@ static void chat_store_command(const char *command)
/* Make sure we still have room for more parameters */
if(numCmdParams >= MAX_CHAT_CMD_PARAMS)
{
ASSERT(FALSE, "chat_store_command: out of parameters for command %d", numCommands);
ASSERT(false, "chat_store_command: out of parameters for command %d", numCommands);
return;
}
@ -129,7 +129,7 @@ static void chat_store_player(SDWORD cmdIndex, SDWORD playerIndex)
/* Make sure we have no overflow */
if(cmdIndex < 0 || cmdIndex >= MAX_CHAT_COMMANDS)
{
ASSERT(FALSE, "chat_store_player: command message out of bounds: %d", cmdIndex);
ASSERT(false, "chat_store_player: command message out of bounds: %d", cmdIndex);
return;
}
@ -138,16 +138,16 @@ static void chat_store_player(SDWORD cmdIndex, SDWORD playerIndex)
/* Ally players addressed */
for(i=0; i<MAX_PLAYERS; i++)
{
chat_msg.cmdData[cmdIndex].bPlayerAddressed[i] = TRUE;
chat_msg.cmdData[cmdIndex].bPlayerAddressed[i] = true;
}
}
else if(playerIndex >= 0 && playerIndex < MAX_PLAYERS)
{
chat_msg.cmdData[cmdIndex].bPlayerAddressed[playerIndex] = TRUE;
chat_msg.cmdData[cmdIndex].bPlayerAddressed[playerIndex] = true;
}
else /* Wrong player index */
{
ASSERT(FALSE, "chat_store_player: wrong player index: %d", playerIndex);
ASSERT(false, "chat_store_player: wrong player index: %d", playerIndex);
return;
}
}
@ -163,7 +163,7 @@ static void chat_reset_command(SDWORD cmdIndex)
for(i=0; i<MAX_PLAYERS; i++)
{
chat_msg.cmdData[cmdIndex].bPlayerAddressed[i] = FALSE;
chat_msg.cmdData[cmdIndex].bPlayerAddressed[i] = false;
}
}
@ -712,7 +712,7 @@ BOOL chatLoad(char *pData, UDWORD size)
/* Don't parse the same message again for a different player */
if(strcmp(pData, &(chat_msg.lastMessage[0])) == 0) //just parsed this message for some other player
{
return TRUE; //keep all the parsed data unmodified
return true; //keep all the parsed data unmodified
}
/* Tell bison what to parse */
@ -736,10 +736,10 @@ BOOL chatLoad(char *pData, UDWORD size)
/* See if we were successfull parsing */
if (parseResult != 0)
{
return FALSE;
return false;
}
return TRUE;
return true;
}
/* A simple error reporting routine */

View File

@ -33,11 +33,11 @@
void cpPrintType(INTERP_TYPE type)
{
UDWORD i;
BOOL ref = FALSE;
BOOL ref = false;
if (type & VAL_REF)
{
ref = TRUE;
ref = true;
type = (INTERP_TYPE)(type & ~VAL_REF);
}
@ -77,7 +77,7 @@ void cpPrintType(INTERP_TYPE type)
}
}
}
ASSERT( FALSE, "cpPrintType: Unknown type" );
ASSERT( false, "cpPrintType: Unknown type" );
break;
}
@ -134,7 +134,7 @@ void cpPrintVal(INTERP_VAL *psVal)
}
}
}
ASSERT( FALSE, "cpPrintVal: Unknown value type" );
ASSERT( false, "cpPrintVal: Unknown value type" );
break;
}
}
@ -191,7 +191,7 @@ void cpPrintPackedVal(INTERP_VAL *ip)
}
}
}
ASSERT( FALSE, "cpPrintVal: Unknown value type" );
ASSERT( false, "cpPrintVal: Unknown value type" );
break;
}
}
@ -251,7 +251,7 @@ void cpPrintMathsOp(UDWORD opcode)
debug( LOG_NEVER, "LESS" );
break;
default:
ASSERT( FALSE, "cpPrintMathsOp: unknown operator" );
ASSERT( false, "cpPrintMathsOp: unknown operator" );
break;
}
}
@ -441,7 +441,7 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
}
ip = psProg->pCode;
triggerCode = psProg->numTriggers > 0 ? TRUE : FALSE;
triggerCode = psProg->numTriggers > 0 ? true : false;
end = (INTERP_VAL *)(((UBYTE *)ip) + psProg->size);
opcode = (OPCODE)(ip->v.ival >> OPCODE_SHIFT);
data = (ip->v.ival & OPCODE_DATAMASK);
@ -476,7 +476,7 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
if (jumpOffset >= psProg->numTriggers)
{
// Got to the end of the triggers
triggerCode = FALSE;
triggerCode = false;
jumpOffset = 0;
}
}
@ -577,7 +577,7 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
ip += aOpSize[opcode];
break;
default:
ASSERT( FALSE,"cpPrintProgram: Unknown opcode: %x", ip->type );
ASSERT( false,"cpPrintProgram: Unknown opcode: %x", ip->type );
break;
}

View File

@ -97,7 +97,7 @@ BOOL eventInitialise()
asReleaseFuncs = NULL;
numFuncs = 0;
strcpy(last_called_script_event, "<none>");
return TRUE;
return true;
}
@ -299,20 +299,20 @@ BOOL eventInitValueFuncs(SDWORD maxType)
if (!asCreateFuncs)
{
debug(LOG_ERROR, "eventInitValueFuncs: Out of memory");
return FALSE;
return false;
}
asReleaseFuncs = (VAL_RELEASE_FUNC *)malloc(sizeof(VAL_RELEASE_FUNC) * maxType);
if (!asReleaseFuncs)
{
debug(LOG_ERROR, "eventInitValueFuncs: Out of memory");
return FALSE;
return false;
}
memset(asCreateFuncs, 0, sizeof(VAL_CREATE_FUNC) * maxType);
memset(asReleaseFuncs, 0, sizeof(VAL_RELEASE_FUNC) * maxType);
numFuncs = maxType;
return TRUE;
return true;
}
// Add a new value create function
@ -320,13 +320,13 @@ BOOL eventAddValueCreate(INTERP_TYPE type, VAL_CREATE_FUNC create)
{
if (type >= numFuncs)
{
ASSERT(FALSE, "eventAddValueCreate: type out of range");
return FALSE;
ASSERT(false, "eventAddValueCreate: type out of range");
return false;
}
asCreateFuncs[type] = create;
return TRUE;
return true;
}
// Add a new value release function
@ -334,13 +334,13 @@ BOOL eventAddValueRelease(INTERP_TYPE type, VAL_RELEASE_FUNC release)
{
if (type >= numFuncs)
{
ASSERT(FALSE, "eventAddValueRelease: type out of range");
return FALSE;
ASSERT(false, "eventAddValueRelease: type out of range");
return false;
}
asReleaseFuncs[type] = release;
return TRUE;
return true;
}
// Create a new context for a script
@ -359,8 +359,8 @@ BOOL eventNewContext(SCRIPT_CODE *psCode, CONTEXT_RELEASE release,
psContext = malloc(sizeof(SCRIPT_CONTEXT));
if (psContext == NULL)
{
ASSERT(FALSE, "eventNewContext: Out of memory");
return FALSE;
ASSERT(false, "eventNewContext: Out of memory");
return false;
}
// Initialise the context
@ -415,7 +415,7 @@ BOOL eventNewContext(SCRIPT_CODE *psCode, CONTEXT_RELEASE release,
if (!asCreateFuncs[type](&(psCode->ppsLocalVarVal[i][j]) ))
{
debug(LOG_ERROR,"eventNewContext: asCreateFuncs failed for local var");
return FALSE;
return false;
}
}
@ -445,7 +445,7 @@ BOOL eventNewContext(SCRIPT_CODE *psCode, CONTEXT_RELEASE release,
free(psNewChunk);
}
free(psContext);
return FALSE;
return false;
}
// Set the value types
@ -484,7 +484,7 @@ BOOL eventNewContext(SCRIPT_CODE *psCode, CONTEXT_RELEASE release,
free(psNewChunk);
}
free(psContext);
return FALSE;
return false;
}
}
storeIndex -= 1;
@ -513,7 +513,7 @@ BOOL eventNewContext(SCRIPT_CODE *psCode, CONTEXT_RELEASE release,
*ppsContext = psContext;
return TRUE;
return true;
}
@ -530,7 +530,7 @@ BOOL eventCopyContext(SCRIPT_CONTEXT *psContext, SCRIPT_CONTEXT **ppsNew)
// Get a new context
if (!eventNewContext(psContext->psCode, psContext->release, &psNew))
{
return FALSE;
return false;
}
// Now copy the values over
@ -548,7 +548,7 @@ BOOL eventCopyContext(SCRIPT_CONTEXT *psContext, SCRIPT_CONTEXT **ppsNew)
*ppsNew = psNew;
return TRUE;
return true;
}
@ -577,7 +577,7 @@ BOOL eventRunContext(SCRIPT_CONTEXT *psContext, UDWORD time)
{
if (!interpRunScript(psContext, IRT_EVENT, event, 0))
{
return FALSE;
return false;
}
}
else
@ -585,7 +585,7 @@ BOOL eventRunContext(SCRIPT_CONTEXT *psContext, UDWORD time)
if (!eventInitTrigger(&psTrigger, psContext, event,
psCode->pEventLinks[event], time))
{
return FALSE;
return false;
}
eventAddTrigger(psTrigger);
DB_TRACE(("added "),2);
@ -594,7 +594,7 @@ BOOL eventRunContext(SCRIPT_CONTEXT *psContext, UDWORD time)
}
}
return TRUE;
return true;
}
// Remove an object from the event system
@ -697,7 +697,7 @@ void eventRemoveContext(SCRIPT_CONTEXT *psContext)
}
else
{
ASSERT( FALSE, "eventRemoveContext: context not found" );
ASSERT( false, "eventRemoveContext: context not found" );
}
}
}
@ -716,13 +716,13 @@ BOOL eventGetContextVal(SCRIPT_CONTEXT *psContext, UDWORD index, INTERP_VAL **pp
}
if (!psChunk)
{
ASSERT( FALSE, "eventGetContextVal: Variable not found" );
return FALSE;
ASSERT( false, "eventGetContextVal: Variable not found" );
return false;
}
*ppsVal = psChunk->asVals + index;
return TRUE;
return true;
}
// Set a global variable value for a context
@ -732,13 +732,13 @@ BOOL eventSetContextVar(SCRIPT_CONTEXT *psContext, UDWORD index, INTERP_VAL *dat
if (!eventGetContextVal(psContext, index, &psVal))
{
return FALSE;
return false;
}
if(!interpCheckEquiv(psVal->type, data->type))
{
ASSERT( FALSE, "eventSetContextVar: Variable type mismatch (var type: %d, data type: %d)", psVal->type, data->type);
return FALSE;
ASSERT( false, "eventSetContextVar: Variable type mismatch (var type: %d, data type: %d)", psVal->type, data->type);
return false;
}
// Store the data
@ -757,7 +757,7 @@ BOOL eventSetContextVar(SCRIPT_CONTEXT *psContext, UDWORD index, INTERP_VAL *dat
memcpy(psVal, data, sizeof(INTERP_VAL));
}
return TRUE;
return true;
}
// Add a trigger to the list in order
@ -827,7 +827,7 @@ static BOOL eventInitTrigger(ACTIVE_TRIGGER **ppsTrigger, SCRIPT_CONTEXT *psCont
"eventAddTrigger: Trigger out of range" );
if (trigger == -1)
{
return FALSE;
return false;
}
// Get a trigger object
@ -835,7 +835,7 @@ static BOOL eventInitTrigger(ACTIVE_TRIGGER **ppsTrigger, SCRIPT_CONTEXT *psCont
if (psNewTrig == NULL)
{
debug(LOG_ERROR, "eventInitTrigger: Out of memory");
return FALSE;
return false;
}
// Initialise the trigger
@ -851,7 +851,7 @@ static BOOL eventInitTrigger(ACTIVE_TRIGGER **ppsTrigger, SCRIPT_CONTEXT *psCont
*ppsTrigger = psNewTrig;
return TRUE;
return true;
}
// Load a trigger into the system from a save game
@ -872,7 +872,7 @@ BOOL eventLoadTrigger(UDWORD time, SCRIPT_CONTEXT *psContext,
{
debug( LOG_ERROR, "eventLoadTrigger: out of memory" );
abort();
return FALSE;
return false;
}
// Initialise the trigger
@ -887,7 +887,7 @@ BOOL eventLoadTrigger(UDWORD time, SCRIPT_CONTEXT *psContext,
eventAddTrigger(psNewTrig);
return TRUE;
return true;
}
// add a TR_PAUSE trigger to the event system.
@ -905,7 +905,7 @@ BOOL eventAddPauseTrigger(SCRIPT_CONTEXT *psContext, UDWORD event, UDWORD offset
if (psNewTrig == NULL)
{
debug(LOG_ERROR, "eventAddPauseTrigger: Out of memory");
return FALSE;
return false;
}
// figure out what type of trigger will go into the system when the pause
@ -940,9 +940,9 @@ BOOL eventAddPauseTrigger(SCRIPT_CONTEXT *psContext, UDWORD event, UDWORD offset
psAddedTriggers = psNewTrig;
// tell the event system the trigger has been changed
triggerChanged = TRUE;
triggerChanged = true;
return TRUE;
return true;
}
@ -967,7 +967,7 @@ void eventFireCallbackTrigger(TRIGGER_TYPE callback)
if (interpProcessorActive())
{
ASSERT(FALSE, "eventFireCallbackTrigger: script interpreter is already running");
ASSERT(false, "eventFireCallbackTrigger: script interpreter is already running");
return;
}
@ -979,7 +979,7 @@ void eventFireCallbackTrigger(TRIGGER_TYPE callback)
if (psCurr->type == (int)callback)
{
// see if the callback should be fired
fired = FALSE;
fired = false;
if (psCurr->type != TR_PAUSE)
{
ASSERT(psCurr->trigger >= 0 && psCurr->trigger < psCurr->psContext->psCode->numTriggers,
@ -994,14 +994,14 @@ void eventFireCallbackTrigger(TRIGGER_TYPE callback)
{
if (!interpRunScript(psCurr->psContext, IRT_TRIGGER, psCurr->trigger, 0))
{
ASSERT(FALSE, "eventFireCallbackTrigger: trigger %s: code failed",
ASSERT(false, "eventFireCallbackTrigger: trigger %s: code failed",
eventGetTriggerID(psCurr->psContext->psCode, psCurr->trigger));
psPrev = psCurr;
continue;
}
if (!stackPopParams(1, VAL_BOOL, &fired))
{
ASSERT(FALSE, "eventFireCallbackTrigger: trigger %s: code failed",
ASSERT(false, "eventFireCallbackTrigger: trigger %s: code failed",
eventGetTriggerID(psCurr->psContext->psCode, psCurr->trigger));
psPrev = psCurr;
continue;
@ -1009,7 +1009,7 @@ void eventFireCallbackTrigger(TRIGGER_TYPE callback)
}
else
{
fired = TRUE;
fired = true;
}
// run the event
@ -1028,11 +1028,11 @@ void eventFireCallbackTrigger(TRIGGER_TYPE callback)
psPrev->psNext = psNext;
}
triggerChanged = FALSE;
triggerChanged = false;
psFiringTrigger = psCurr;
if (!interpRunScript(psCurr->psContext, IRT_EVENT, psCurr->event, psCurr->offset)) // this could set triggerChanged
{
ASSERT(FALSE, "eventFireCallbackTrigger: event %s: code failed",
ASSERT(false, "eventFireCallbackTrigger: event %s: code failed",
eventGetEventID(psCurr->psContext->psCode, psCurr->event));
}
if (triggerChanged)
@ -1075,7 +1075,7 @@ static BOOL eventFireTrigger(ACTIVE_TRIGGER *psTrigger)
BOOL fired;
INTERP_VAL sResult;
fired = FALSE;
fired = false;
// If this is a code trigger see if it fires
@ -1085,21 +1085,21 @@ static BOOL eventFireTrigger(ACTIVE_TRIGGER *psTrigger)
if (!interpRunScript(psTrigger->psContext,
IRT_TRIGGER, psTrigger->trigger, 0))
{
ASSERT( FALSE, "eventFireTrigger: trigger %s: code failed",
ASSERT( false, "eventFireTrigger: trigger %s: code failed",
eventGetTriggerID(psTrigger->psContext->psCode, psTrigger->trigger) );
return FALSE;
return false;
}
// Get the result
sResult.type = VAL_BOOL;
if (!stackPopType(&sResult))
{
return FALSE;
return false;
}
fired = sResult.v.bval;
}
else
{
fired = TRUE;
fired = true;
}
// If it fired run the event
@ -1111,9 +1111,9 @@ static BOOL eventFireTrigger(ACTIVE_TRIGGER *psTrigger)
{
DB_TRACE(("******** script failed *********"), 0);
DB_TRIGINF(psTrigger,0);
ASSERT(FALSE, "eventFireTrigger: event %s: code failed",
ASSERT(false, "eventFireTrigger: event %s: code failed",
eventGetEventID(psTrigger->psContext->psCode, psTrigger->event));
return FALSE;
return false;
}
}
#ifdef DEBUG
@ -1123,7 +1123,7 @@ static BOOL eventFireTrigger(ACTIVE_TRIGGER *psTrigger)
}
#endif
return TRUE;
return true;
}
@ -1144,7 +1144,7 @@ void eventProcessTriggers(UDWORD currTime)
// Store the trigger so that I can tell if the event changes
// the trigger assigned to it
psFiringTrigger = psCurr;
triggerChanged = FALSE;
triggerChanged = false;
// Run the trigger
if (eventFireTrigger(psCurr)) // This might set triggerChanged
@ -1255,7 +1255,7 @@ BOOL eventSetTrigger(void)
if (!stackPopParams(2, VAL_EVENT, &event, VAL_TRIGGER, &trigger))
{
return FALSE;
return false;
}
#ifdef REALLY_DEBUG_THIS
@ -1268,7 +1268,7 @@ BOOL eventSetTrigger(void)
psContext = psFiringTrigger->psContext;
if (psFiringTrigger->event == event)
{
triggerChanged = TRUE;
triggerChanged = true;
}
else
{
@ -1284,13 +1284,13 @@ BOOL eventSetTrigger(void)
if (!eventInitTrigger(&psTrigger, psFiringTrigger->psContext,
event, trigger, updateTime))
{
return FALSE;
return false;
}
psTrigger->psNext = psAddedTriggers;
psAddedTriggers = psTrigger;
}
return TRUE;
return true;
}
@ -1301,7 +1301,7 @@ BOOL eventSetTraceLevel(void)
if (!stackPopParams(1, VAL_INT, &level))
{
return FALSE;
return false;
}
if (level < 0)
@ -1315,5 +1315,5 @@ BOOL eventSetTraceLevel(void)
eventTraceLevel = level;
return TRUE;
return true;
}

View File

@ -76,7 +76,7 @@ static BOOL eventSaveContext(char *pBuffer, UDWORD *pSize)
{
debug( LOG_ERROR, "eventSaveContext: couldn't find script resource id" );
abort();
return FALSE;
return false;
}
numVars = psCCont->psCode->numGlobals + psCCont->psCode->arraySize;
@ -178,7 +178,7 @@ static BOOL eventSaveContext(char *pBuffer, UDWORD *pSize)
{
debug( LOG_ERROR, "eventSaveContext: couldn't get variable value size" );
abort();
return FALSE;
return false;
}
if (pBuffer != NULL)
@ -213,7 +213,7 @@ static BOOL eventSaveContext(char *pBuffer, UDWORD *pSize)
}
*pSize = size;
return TRUE;
return true;
}
// load the context information for the script system
@ -262,7 +262,7 @@ static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize, BOOL
{
debug( LOG_ERROR, "eventLoadContext: number of context variables does not match the script code" );
abort();
return FALSE;
return false;
}
pPos += sizeof(SWORD);
@ -272,7 +272,7 @@ static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize, BOOL
// create the context
if (!eventNewContext(psCode, release, &psCCont))
{
return FALSE;
return false;
}
// bit of a hack this - note the id of the context to link it to the triggers
@ -351,7 +351,7 @@ static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize, BOOL
size += sizeof(SCRIPT_FUNC);
break;
default:
ASSERT( FALSE, "eventLoadContext: invalid internal type" );
ASSERT( false, "eventLoadContext: invalid internal type" );
}
// set the value in the context
@ -359,7 +359,7 @@ static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize, BOOL
{
debug( LOG_ERROR, "eventLoadContext: couldn't set variable value" );
abort();
return FALSE;
return false;
}
}
else
@ -382,14 +382,14 @@ static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize, BOOL
{
debug( LOG_ERROR, "eventLoadContext: couldn't find variable in context" );
abort();
return FALSE;
return false;
}
if (!loadFunc(version, psVal, pPos, valSize))
{
debug( LOG_ERROR, "eventLoadContext: couldn't get variable value" );
abort();
return FALSE;
return false;
}
pPos += valSize;
@ -400,7 +400,7 @@ static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize, BOOL
*pSize = size;
return TRUE;
return true;
}
// return the index of a context
@ -415,12 +415,12 @@ static BOOL eventGetContextIndex(SCRIPT_CONTEXT *psContext, SDWORD *pIndex)
if (psCurr == psContext)
{
*pIndex = index;
return TRUE;
return true;
}
index += 1;
}
return FALSE;
return false;
}
// find a context from it's id number
@ -433,11 +433,11 @@ static BOOL eventFindContext(SDWORD id, SCRIPT_CONTEXT **ppsContext)
if (psCurr->id == id)
{
*ppsContext = psCurr;
return TRUE;
return true;
}
}
return FALSE;
return false;
}
// save a list of triggers
@ -473,7 +473,7 @@ static BOOL eventSaveTriggerList(ACTIVE_TRIGGER *psList, char *pBuffer, UDWORD *
{
debug( LOG_ERROR, "eventSaveTriggerList: couldn't find context" );
abort();
return FALSE;
return false;
}
*((SWORD*)pPos) = (SWORD)context;
endian_sword((SWORD*)pPos);
@ -501,7 +501,7 @@ static BOOL eventSaveTriggerList(ACTIVE_TRIGGER *psList, char *pBuffer, UDWORD *
*pSize = size;
return TRUE;
return true;
}
@ -537,7 +537,7 @@ static BOOL eventLoadTriggerList(SDWORD version, char *pBuffer, UDWORD *pSize)
{
debug( LOG_ERROR, "eventLoadTriggerList: couldn't find context" );
abort();
return FALSE;
return false;
}
endian_sword((SWORD*)pPos);
@ -560,13 +560,13 @@ static BOOL eventLoadTriggerList(SDWORD version, char *pBuffer, UDWORD *pSize)
if (!eventLoadTrigger(time, psContext, type, trigger, event, offset))
{
return FALSE;
return false;
}
}
*pSize = size;
return TRUE;
return true;
}
@ -582,21 +582,21 @@ BOOL eventSaveState(SDWORD version, char **ppBuffer, UDWORD *pFileSize)
// find the size of the context save
if (!eventSaveContext(NULL, &size))
{
return FALSE;
return false;
}
totalSize += size;
// find the size of the trigger save
if (!eventSaveTriggerList(psTrigList, NULL, &size))
{
return FALSE;
return false;
}
totalSize += size;
// find the size of the callback trigger save
if (!eventSaveTriggerList(psCallbackList, NULL, &size))
{
return FALSE;
return false;
}
totalSize += size;
@ -608,7 +608,7 @@ BOOL eventSaveState(SDWORD version, char **ppBuffer, UDWORD *pFileSize)
{
debug( LOG_ERROR, "eventSaveState: out of memory" );
abort();
return FALSE;
return false;
}
pPos = pBuffer;
@ -628,28 +628,28 @@ BOOL eventSaveState(SDWORD version, char **ppBuffer, UDWORD *pFileSize)
// save the contexts
if (!eventSaveContext(pPos, &size))
{
return FALSE;
return false;
}
pPos += size;
// save the triggers
if (!eventSaveTriggerList(psTrigList, pPos, &size))
{
return FALSE;
return false;
}
pPos += size;
// save the callback triggers
if (!eventSaveTriggerList(psCallbackList, pPos, &size))
{
return FALSE;
return false;
}
pPos += size;
*ppBuffer = pBuffer;
*pFileSize = totalSize;
return TRUE;
return true;
}
@ -671,13 +671,13 @@ BOOL eventLoadState(char *pBuffer, UDWORD fileSize, BOOL bHashed)
{
debug( LOG_ERROR, "eventLoadState: invalid file header" );
abort();
return FALSE;
return false;
}
/* if ((psHdr->version != 1) &&
(psHdr->version != 2))
{
DBERROR(("eventLoadState: invalid file version"));
return FALSE;
return false;
}*/
version = psHdr->version;
pPos += sizeof(EVENT_SAVE_HDR);
@ -687,7 +687,7 @@ BOOL eventLoadState(char *pBuffer, UDWORD fileSize, BOOL bHashed)
// load the event contexts
if (!eventLoadContext(version, pPos, &size, bHashed))
{
return FALSE;
return false;
}
pPos += size;
@ -696,7 +696,7 @@ BOOL eventLoadState(char *pBuffer, UDWORD fileSize, BOOL bHashed)
// load the normal triggers
if (!eventLoadTriggerList(version, pPos, &size))
{
return FALSE;
return false;
}
pPos += size;
totalSize += size;
@ -704,7 +704,7 @@ BOOL eventLoadState(char *pBuffer, UDWORD fileSize, BOOL bHashed)
// load the callback triggers
if (!eventLoadTriggerList(version, pPos, &size))
{
return FALSE;
return false;
}
pPos += size;
totalSize += size;
@ -713,8 +713,8 @@ BOOL eventLoadState(char *pBuffer, UDWORD fileSize, BOOL bHashed)
{
debug( LOG_ERROR, "eventLoadState: corrupt save file" );
abort();
return FALSE;
return false;
}
return TRUE;
return true;
}

View File

@ -152,16 +152,16 @@ SDWORD aOpSize[] =
static TYPE_EQUIV *asInterpTypeEquiv;
// whether the interpreter is running
static BOOL bInterpRunning = FALSE;
static BOOL bInterpRunning = false;
/* Whether to output trace information */
static BOOL interpTrace;
static SCRIPT_CODE *psCurProg = NULL;
static BOOL bCurCallerIsEvent = FALSE;
static BOOL bCurCallerIsEvent = false;
/* Print out trace info if tracing is turned on */
#define TRCPRINTF(...) do { if (interpTrace) { fprintf( stderr, __VA_ARGS__ ); } } while (FALSE)
#define TRCPRINTF(...) do { if (interpTrace) { fprintf( stderr, __VA_ARGS__ ); } } while (false)
#define TRCPRINTVAL(x) \
if (interpTrace) \
@ -185,7 +185,7 @@ static BOOL bCurCallerIsEvent = FALSE;
cpPrintVarFunc(x, data)
// TRUE if the interpreter is currently running
// true if the interpreter is currently running
BOOL interpProcessorActive(void)
{
return bInterpRunning;
@ -227,13 +227,13 @@ static BOOL interpGetArrayVarData(INTERP_VAL **pip, VAL_CHUNK *psGlobals, SCRIPT
{
debug( LOG_ERROR,
"interpGetArrayVarData: array base index out of range" );
return FALSE;
return false;
}
if (dimensions != psProg->psArrayInfo[base].dimensions)
{
debug( LOG_ERROR,
"interpGetArrayVarData: dimensions do not match" );
return FALSE;
return false;
}
// get the number of elements for each dimension
@ -246,13 +246,13 @@ static BOOL interpGetArrayVarData(INTERP_VAL **pip, VAL_CHUNK *psGlobals, SCRIPT
{
if (!stackPopParams(1, VAL_INT, &val))
{
return FALSE;
return false;
}
if ( (val < 0) || (val >= elements[i]) )
{
debug( LOG_ERROR, "interpGetArrayVarData: Array index for dimension %d out of range (passed index = %d, max index = %d)", i , val, elements[i]);
return FALSE;
return false;
}
index += val * size;
@ -275,7 +275,7 @@ static BOOL interpGetArrayVarData(INTERP_VAL **pip, VAL_CHUNK *psGlobals, SCRIPT
if (index > psProg->arraySize)
{
debug( LOG_ERROR, "interpGetArrayVarData: Array indexes out of variable space" );
return FALSE;
return false;
}
// get the variable data
@ -284,7 +284,7 @@ static BOOL interpGetArrayVarData(INTERP_VAL **pip, VAL_CHUNK *psGlobals, SCRIPT
// update the instruction pointer
*pip += 1;// + elementDWords;
return TRUE;
return true;
}
@ -293,7 +293,7 @@ BOOL interpInitialise(void)
{
asInterpTypeEquiv = NULL;
return TRUE;
return true;
}
/* Run a compiled script */
@ -311,9 +311,9 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
SDWORD instructionCount = 0;
UDWORD CurEvent = 0;
BOOL bStop = FALSE, bEvent = FALSE;
BOOL bStop = false, bEvent = false;
UDWORD callDepth = 0;
BOOL bTraceOn=FALSE; //enable to debug function/event calls
BOOL bTraceOn=false; //enable to debug function/event calls
ASSERT( psContext != NULL,
"interpRunScript: invalid context pointer" );
@ -332,7 +332,7 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
}
// note that the interpreter is running to stop recursive script calls
bInterpRunning = TRUE;
bInterpRunning = true;
// Reset the stack in case another script messed up
stackReset();
@ -341,13 +341,13 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
retStackReset();
// Turn off tracing initially
interpTrace = FALSE;
interpTrace = false;
/* Get the global variables */
numGlobals = psProg->numGlobals;
psGlobals = psContext->psGlobals;
bEvent = FALSE;
bEvent = false;
// Find the code range
switch (runType)
@ -356,14 +356,14 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
if (index > psProg->numTriggers)
{
debug(LOG_ERROR,"interpRunScript: trigger index out of range");
ASSERT( FALSE, "interpRunScript: trigger index out of range" );
return FALSE;
ASSERT( false, "interpRunScript: trigger index out of range" );
return false;
}
pCodeBase = psProg->pCode + psProg->pTriggerTab[index];
pCodeStart = pCodeBase;
pCodeEnd = psProg->pCode + psProg->pTriggerTab[index+1];
bCurCallerIsEvent = FALSE;
bCurCallerIsEvent = false;
// find the debug info for the trigger
strcpy(last_called_script_event, eventGetTriggerID(psProg, index));
@ -376,15 +376,15 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
if (index > psProg->numEvents)
{
debug(LOG_ERROR,"interpRunScript: trigger index out of range");
ASSERT( FALSE, "interpRunScript: trigger index out of range" );
return FALSE;
ASSERT( false, "interpRunScript: trigger index out of range" );
return false;
}
pCodeBase = psProg->pCode + psProg->pEventTab[index];
pCodeStart = pCodeBase + offset; //offset only used for pause() script function
pCodeEnd = psProg->pCode + psProg->pEventTab[index+1];
bEvent = TRUE; //remember it's an event
bCurCallerIsEvent = TRUE;
bEvent = true; //remember it's an event
bCurCallerIsEvent = true;
// remember last called event/function
strcpy(last_called_script_event, eventGetEventID(psProg, index));
@ -395,8 +395,8 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
break;
default:
debug(LOG_ERROR,"interpRunScript: unknown run type");
ASSERT( FALSE, "interpRunScript: unknown run type" );
return FALSE;
ASSERT( false, "interpRunScript: unknown run type" );
return false;
}
// Get the first opcode
@ -411,7 +411,7 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
instructionCount = 0;
CurEvent = index;
bStop = FALSE;
bStop = false;
// create new variable environment for this call
if (bEvent)
@ -444,7 +444,7 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
if(!retStackPush(CurEvent, (InstrPointer + aOpSize[opcode]))) //Remember where to jump back later
{
debug( LOG_ERROR, "interpRunScript() - retStackPush() failed.");
return FALSE;
return false;
}
ASSERT(((INTERP_VAL *)(InstrPointer+1))->type == VAL_EVENT, "wrong value type passed for OP_FUNC: %d", ((INTERP_VAL *)(InstrPointer+1))->type);
@ -861,7 +861,7 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
if (!retStackPop(&CurEvent, &InstrPointer))
{
debug( LOG_ERROR, "interpRunScript() - retStackPop() failed.");
return FALSE;
return false;
}
//remember last called event/index
@ -907,7 +907,7 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
destroyVarEnvironment(psContext, retStackCallDepth(), CurEvent);
}
bStop = TRUE; //Stop execution of this event here, no more calling functions stored
bStop = true; //Stop execution of this event here, no more calling functions stored
}
}
@ -916,8 +916,8 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
psCurProg = NULL;
TRCPRINTF( "%-6d EXIT\n", (int)(InstrPointer - psProg->pCode) );
bInterpRunning = FALSE;
return TRUE;
bInterpRunning = false;
return true;
exit_with_error:
// Deal with the script crashing or running out of memory
@ -947,8 +947,8 @@ exit_with_error:
ASSERT(!"error while executing a script", "interpRunScript: error while executing a script");
bInterpRunning = FALSE;
return FALSE;
bInterpRunning = false;
return false;
}
@ -973,36 +973,36 @@ void scriptSetTypeEquiv(TYPE_EQUIV *psTypeTab)
BOOL interpCheckEquiv(INTERP_TYPE to, INTERP_TYPE from)
{
SDWORD i,j;
BOOL toRef = FALSE, fromRef = FALSE;
BOOL toRef = false, fromRef = false;
// check for the VAL_REF flag
if (to & VAL_REF)
{
toRef = TRUE;
toRef = true;
to = (INTERP_TYPE)(to & ~VAL_REF);
}
if (from & VAL_REF)
{
fromRef = TRUE;
fromRef = true;
from = (INTERP_TYPE)(from & ~VAL_REF);
}
if (toRef != fromRef)
{
return FALSE;
return false;
}
/* Void pointer is compatible with any other type */
if(toRef == TRUE && fromRef == TRUE)
if(toRef == true && fromRef == true)
{
if(to == VAL_VOID)
{
return TRUE;
return true;
}
}
if (to == from)
{
return TRUE;
return true;
}
else if (asInterpTypeEquiv)
{
@ -1014,31 +1014,31 @@ BOOL interpCheckEquiv(INTERP_TYPE to, INTERP_TYPE from)
{
if (asInterpTypeEquiv[i].aEquivTypes[j] == from)
{
return TRUE;
return true;
}
}
}
}
}
return FALSE;
return false;
}
/* Instinct function to turn on tracing */
BOOL interpTraceOn(void)
{
interpTrace = TRUE;
interpTrace = true;
return TRUE;
return true;
}
/* Instinct function to turn off tracing */
BOOL interpTraceOff(void)
{
interpTrace = FALSE;
interpTrace = false;
return TRUE;
return true;
}
@ -1064,15 +1064,15 @@ static inline void retStackReset(void)
static inline BOOL retStackIsEmpty(void)
{
if(retStackPos < 0) return TRUE;
return FALSE;
if(retStackPos < 0) return true;
return false;
}
static inline BOOL retStackIsFull(void)
{
if(retStackPos >= MAX_FUNC_CALLS) return TRUE;
return FALSE;
if(retStackPos >= MAX_FUNC_CALLS) return true;
return false;
}
@ -1081,7 +1081,7 @@ static BOOL retStackPush(UDWORD CallerIndex, INTERP_VAL *ReturnAddress)
if (retStackIsFull())
{
debug( LOG_ERROR, "retStackPush(): return address stack is full");
return FALSE; // Stack full
return false; // Stack full
}
retStackPos++;
@ -1090,7 +1090,7 @@ static BOOL retStackPush(UDWORD CallerIndex, INTERP_VAL *ReturnAddress)
//debug( LOG_SCRIPT, "retStackPush: Event=%i Address=%p, ", CallerIndex, ReturnAddress);
return TRUE;
return true;
}
@ -1099,7 +1099,7 @@ static BOOL retStackPop(UDWORD *CallerIndex, INTERP_VAL **ReturnAddress)
if (retStackIsEmpty())
{
debug( LOG_ERROR, "retStackPop(): return address stack is empty");
return FALSE;
return false;
}
*CallerIndex = retStack[retStackPos].CallerIndex;
@ -1108,7 +1108,7 @@ static BOOL retStackPop(UDWORD *CallerIndex, INTERP_VAL **ReturnAddress)
//debug( LOG_SCRIPT, "retStackPop: Event=%i Address=%p", *EventTrigIndex, *ReturnAddress);
return TRUE;
return true;
}

View File

@ -278,7 +278,7 @@ extern BOOL interpCheckEquiv(INTERP_TYPE to, INTERP_TYPE from);
// Initialise the interpreter
extern BOOL interpInitialise(void);
// TRUE if the interpreter is currently running
// true if the interpreter is currently running
extern BOOL interpProcessorActive(void);
/* Output script call stack trace */

View File

@ -43,18 +43,18 @@ BOOL scriptInitialise()
{
if (!stackInitialise())
{
return FALSE;
return false;
}
if (!interpInitialise())
{
return FALSE;
return false;
}
if (!eventInitialise())
{
return FALSE;
return false;
}
return TRUE;
return true;
}
// Shutdown the script library
@ -176,7 +176,7 @@ BOOL scriptGetVarIndex(SCRIPT_CODE *psCode, char *pID, UDWORD *pIndex)
if (!psCode->psVarDebug)
{
return FALSE;
return false;
}
for(index=0; index<psCode->numGlobals; index++)
@ -184,11 +184,11 @@ BOOL scriptGetVarIndex(SCRIPT_CODE *psCode, char *pID, UDWORD *pIndex)
if (strcmp(psCode->psVarDebug[index].pIdent, pID)==0)
{
*pIndex = index;
return TRUE;
return true;
}
}
return FALSE;
return false;
}
/* returns true if passed INTERP_TYPE is used as a pointer in INTERP_VAL, false otherwise.
@ -199,7 +199,7 @@ BOOL scriptTypeIsPointer(INTERP_TYPE type)
{
ASSERT( ((type < ST_MAXTYPE) || (type >= VAL_REF)), "scriptTypeIsPointer: invalid type: %d", type );
// any value or'ed with VAL_REF is a pointer
if (type >= VAL_REF) return TRUE;
if (type >= VAL_REF) return true;
switch (type) {
case VAL_STRING:
case VAL_OBJ_GETSET:
@ -218,7 +218,7 @@ BOOL scriptTypeIsPointer(INTERP_TYPE type)
case ST_POINTER_T:
case ST_POINTER_S:
case ST_POINTER_STRUCTSTAT:
return TRUE;
return true;
case VAL_BOOL:
case VAL_INT:
case VAL_FLOAT:
@ -242,9 +242,9 @@ BOOL scriptTypeIsPointer(INTERP_TYPE type)
case ST_FEATURESTAT:
case ST_DROIDID:
case ST_SOUND:
return FALSE;
return false;
default:
ASSERT(FALSE, "scriptTypeIsPointer: unhandled type: %d", type );
return FALSE;
ASSERT(false, "scriptTypeIsPointer: unhandled type: %d", type );
return false;
}
}

View File

@ -42,7 +42,7 @@ static char aText[TEXT_BUFFERS][YYLMAX];
static UDWORD currText=0;
// Note if we are in a comment
static BOOL inComment = FALSE;
static BOOL inComment = false;
/* FLEX include buffer stack */
static YY_BUFFER_STATE include_stack[MAX_SCR_INCLUDE_DEPTH];
@ -91,7 +91,7 @@ SDWORD scriptGetVarToken(VAR_SYMBOL *psVar)
// See if this is an object pointer
if (!asScrTypeTab || psVar->type < VAL_USERTYPESTART)
{
object = FALSE;
object = false;
}
else
{
@ -205,7 +205,7 @@ SDWORD scriptGetConstToken(CONST_SYMBOL *psConst)
// See if this is an object constant
if (!asScrTypeTab || psConst->type < VAL_USERTYPESTART)
{
object = FALSE;
object = false;
}
else
{
@ -284,7 +284,7 @@ SDWORD scriptGetCustomFuncToken(EVENT_SYMBOL *psFunc)
// See if this is an object pointer
if (!asScrTypeTab || psFunc->retType < VAL_USERTYPESTART)
{
object = FALSE;
object = false;
}
else
{
@ -339,11 +339,11 @@ BOOL scriptLoopUpMacro(const char *pMacro, char **ppMacroBody)
*ppMacroBody = (char *)malloc(MAXSTRLEN);
strcpy( *ppMacroBody, &(scr_macro[i].scr_define_body[0]) ); //copy macro body into buffer so we can process it
//*pMacroBody = &(scr_macro[i].scr_define_body[0]); //return macro body
return TRUE;
return true;
}
}
return FALSE;
return false;
}
/* Return to the previous macto buffer */
@ -490,10 +490,10 @@ float { scr_lval.tval = VAL_FLOAT; return TYPE; }
FLOAT { scr_lval.tval = VAL_FLOAT; return TYPE; }
/* Match boolean values */
TRUE { scr_lval.bval = TRUE; return BOOLEAN_T; }
true { scr_lval.bval = TRUE; return BOOLEAN_T; }
FALSE { scr_lval.bval = FALSE; return BOOLEAN_T; }
false { scr_lval.bval = FALSE; return BOOLEAN_T; }
true { scr_lval.bval = true; return BOOLEAN_T; }
TRUE { scr_lval.bval = true; return BOOLEAN_T; }
false { scr_lval.bval = false; return BOOLEAN_T; }
FALSE { scr_lval.bval = false; return BOOLEAN_T; }
/* Match increment/decrement operators */
"++" {RULE("++"); return _INC; }
@ -773,9 +773,9 @@ NOT return _NOT;
[ \t\n\x0d\x0a] ;
/* Strip comments */
"/*" { inComment=TRUE; BEGIN (COMMENT); }
"/*" { inComment=true; BEGIN (COMMENT); }
<COMMENT>"*/" |
<COMMENT>"*/"\n { inComment=FALSE; BEGIN (INITIAL); }
<COMMENT>"*/"\n { inComment=false; BEGIN (INITIAL); }
<COMMENT>. |
<COMMENT>\n ;

View File

@ -33,7 +33,7 @@
#include <physfs.h>
/* this will give us a more detailed error output */
#define YYERROR_VERBOSE TRUE
#define YYERROR_VERBOSE true
/* Script defines stack */
@ -65,7 +65,7 @@ static OBJVAR_BLOCK *psObjVarBlock=NULL;
static PARAM_BLOCK *psCurrPBlock=NULL;
/* Any errors occured? */
static BOOL bError=FALSE;
static BOOL bError=false;
//String support
//-----------------------------
@ -116,7 +116,7 @@ static FUNC_SYMBOL *psFunctions=NULL;
static INTERP_TYPE objVarContext = (INTERP_TYPE)0;
/* Control whether debug info is generated */
static BOOL genDebugInfo = TRUE;
static BOOL genDebugInfo = true;
/* Currently defined triggers */
static TRIGGER_SYMBOL *psTriggers;
@ -129,7 +129,7 @@ static UDWORD numEvents;
/* This is true when local variables are being defined.
* (So local variables can have the same name as global ones)
*/
static BOOL localVariableDef=FALSE;
static BOOL localVariableDef=false;
/* The identifier for the current script function being defined */
//static char *pCurrFuncIdent=NULL;
@ -724,7 +724,7 @@ static CODE_ERROR scriptCodeFunction(FUNC_SYMBOL *psFSymbol, // The function be
{
UDWORD size, i;
INTERP_VAL *ip;
BOOL typeError = FALSE;
BOOL typeError = false;
char aErrorString[255];
INTERP_TYPE type1,type2;
@ -753,7 +753,7 @@ static CODE_ERROR scriptCodeFunction(FUNC_SYMBOL *psFSymbol, // The function be
// Guarantee to nul-terminate
aErrorString[sizeof(aErrorString) - 1] = '\0';
scr_error(aErrorString);
typeError = TRUE;
typeError = true;
}
}
//else
@ -804,7 +804,7 @@ static CODE_ERROR scriptCodeFunction(FUNC_SYMBOL *psFSymbol, // The function be
/* function defined in this script */
// PUT_OPCODE(ip, OP_FUNC);
// PUT_SCRIPTFUNC(ip, psFSymbol);
ASSERT(FALSE, "wrong function type call");
ASSERT(false, "wrong function type call");
}
else
{
@ -904,7 +904,7 @@ static CODE_ERROR scriptCodeCallbackParams(
{
UDWORD size, i;
INTERP_VAL *ip;
BOOL typeError = FALSE;
BOOL typeError = false;
char aErrorString[255];
ASSERT( psPBlock != NULL,
@ -925,7 +925,7 @@ static CODE_ERROR scriptCodeCallbackParams(
// Guarantee to nul-terminate
aErrorString[sizeof(aErrorString) - 1] = '\0';
scr_error(aErrorString);
typeError = TRUE;
typeError = true;
}
}
@ -1352,7 +1352,7 @@ static BOOL checkFuncParamType(UDWORD argIndex, UDWORD argType)
if(psCurEvent == NULL)
{
debug(LOG_ERROR, "checkFuncParamType() - psCurEvent == NULL");
return FALSE;
return false;
}
if(argIndex < psCurEvent->numParams)
@ -1367,12 +1367,12 @@ static BOOL checkFuncParamType(UDWORD argIndex, UDWORD argType)
if(argType != psCurr->type)
{
debug(LOG_ERROR, "Argument type with index %d in event '%s' doesn't match function declaration (%d/%d)",argIndex,psCurEvent->pIdent,argType,psCurr->type);
return FALSE;
return false;
}
else
{
//debug(LOG_SCRIPT, "arg matched ");
return TRUE;
return true;
}
}
j++;
@ -1381,10 +1381,10 @@ static BOOL checkFuncParamType(UDWORD argIndex, UDWORD argType)
else
{
debug(LOG_ERROR, "checkFuncParamType() - argument %d has wrong argument index, event: '%s'", argIndex, psCurEvent->pIdent);
return FALSE;
return false;
}
return FALSE;
return false;
}
@ -2057,11 +2057,11 @@ script: header var_list
APPEND_DEBUG(psFinalProg, ip - psFinalProg->pCode, psTrig);
// Store the code
PUT_BLOCK(ip, psTrig);
psFinalProg->psTriggerData[i].code = TRUE;
psFinalProg->psTriggerData[i].code = true;
}
else
{
psFinalProg->psTriggerData[i].code = FALSE;
psFinalProg->psTriggerData[i].code = false;
}
// Store the data
psFinalProg->psTriggerData[i].type = (UWORD)psTrig->type;
@ -2243,8 +2243,8 @@ var_list: /* NULL token */
var_line: variable_decl ';'
{
/* remember that local var declaration is over */
localVariableDef = FALSE;
//debug(LOG_SCRIPT, "localVariableDef = FALSE 0");
localVariableDef = false;
//debug(LOG_SCRIPT, "localVariableDef = false 0");
$$ = $1;
}
;
@ -2261,8 +2261,8 @@ variable_decl_head: STORAGE TYPE
/* allow local vars to have the same names as global vars (don't check global vars) */
if($1 == ST_LOCAL)
{
localVariableDef = TRUE;
//debug(LOG_SCRIPT, "localVariableDef = TRUE 0");
localVariableDef = true;
//debug(LOG_SCRIPT, "localVariableDef = true 0");
}
$$ = psCurrVDecl;
@ -2524,8 +2524,8 @@ func_subdecl: FUNCTION TYPE IDENT
RULE("func_subdecl: FUNCTION TYPE IDENT");
/* allow local vars to have the same names as global vars (don't check global vars) */
localVariableDef = TRUE;
//debug(LOG_SCRIPT, "localVariableDef = TRUE 1");
localVariableDef = true;
//debug(LOG_SCRIPT, "localVariableDef = true 1");
if (!scriptDeclareEvent($3, &psEvent,0))
{
@ -2534,7 +2534,7 @@ func_subdecl: FUNCTION TYPE IDENT
psEvent->retType = $2;
psCurEvent = psEvent;
psCurEvent->bFunction = TRUE;
psCurEvent->bFunction = true;
$$ = psEvent;
@ -2551,8 +2551,8 @@ void_func_subdecl: FUNCTION _VOID IDENT /* declaration of a function */
RULE("void_func_subdecl: FUNCTION _VOID IDENT");
/* allow local vars to have the same names as global vars (don't check global vars) */
localVariableDef = TRUE;
//debug(LOG_SCRIPT, "localVariableDef = TRUE 1");
localVariableDef = true;
//debug(LOG_SCRIPT, "localVariableDef = true 1");
if (!scriptDeclareEvent($3, &psEvent,0))
{
@ -2561,7 +2561,7 @@ void_func_subdecl: FUNCTION _VOID IDENT /* declaration of a function */
psEvent->retType = VAL_VOID;
psCurEvent = psEvent;
psCurEvent->bFunction = TRUE;
psCurEvent->bFunction = true;
$$ = psEvent;
@ -2583,7 +2583,7 @@ void_function_def: FUNCTION _VOID function_type /* definition of a function tha
YYABORT;
}
/* psCurEvent->bFunction = TRUE; */
/* psCurEvent->bFunction = true; */
/* psEvent->retType = $2; */
$$ = $3;
//debug(LOG_SCRIPT, "func_subdecl:FUNCTION EVENT_SYM. ");
@ -2658,7 +2658,7 @@ funcbody_var_def: function_def '(' funcbody_var_def_body ')'
RULE("funcbody_var_def: '(' funcvar_decl_types ')'");
/* remember that local var declaration is over */
localVariableDef = FALSE;
localVariableDef = false;
if(psCurEvent == NULL)
{
@ -2688,7 +2688,7 @@ funcbody_var_def: function_def '(' funcbody_var_def_body ')'
RULE( "funcbody_var_def: funcbody_var_def_body '(' ')'");
/* remember that local var declaration is over */
localVariableDef = FALSE;
localVariableDef = false;
if(psCurEvent == NULL)
{
@ -2723,7 +2723,7 @@ void_funcbody_var_def: void_function_def '(' funcbody_var_def_body ')'
RULE( "funcbody_var_def: '(' funcvar_decl_types ')'");
/* remember that local var declaration is over */
localVariableDef = FALSE;
localVariableDef = false;
if(psCurEvent == NULL)
{
@ -2753,7 +2753,7 @@ void_funcbody_var_def: void_function_def '(' funcbody_var_def_body ')'
RULE( "funcbody_var_def: funcbody_var_def_body '(' ')'");
/* remember that local var declaration is over */
localVariableDef = FALSE;
localVariableDef = false;
if(psCurEvent == NULL)
{
@ -2852,8 +2852,8 @@ argument_decl: '(' ')'
| '(' argument_decl_head ')'
{
/* remember that local var declaration is over */
localVariableDef = FALSE;
//debug(LOG_SCRIPT, "localVariableDef = FALSE 1");
localVariableDef = false;
//debug(LOG_SCRIPT, "localVariableDef = false 1");
}
;
@ -2862,8 +2862,8 @@ function_declaration: func_subdecl '(' argument_decl_head ')' /* function was n
RULE( "function_declaration: func_subdecl '(' argument_decl_head ')'");
/* remember that local var declaration is over */
localVariableDef = FALSE;
//debug(LOG_SCRIPT, "localVariableDef = FALSE 2");
localVariableDef = false;
//debug(LOG_SCRIPT, "localVariableDef = false 2");
if(psCurEvent->bDeclared) /* can only occur if different (new) var names are used in the event definition that don't match with declaration*/
{
@ -2878,8 +2878,8 @@ function_declaration: func_subdecl '(' argument_decl_head ')' /* function was n
RULE( "function_declaration: func_subdecl '(' ')'");
/* remember that local var declaration is over */
localVariableDef = FALSE;
//debug(LOG_SCRIPT, "localVariableDef = FALSE 3");
localVariableDef = false;
//debug(LOG_SCRIPT, "localVariableDef = false 3");
if($1->numParams > 0 && psCurEvent->bDeclared) /* can only occur if no parameters or different (new) var names are used in the event definition that don't match with declaration */
{
@ -2897,8 +2897,8 @@ function_declaration: func_subdecl '(' argument_decl_head ')' /* function was n
void_function_declaration: void_func_subdecl '(' argument_decl_head ')' /* function was not declared before */
{
/* remember that local var declaration is over */
localVariableDef = FALSE;
//debug(LOG_SCRIPT, "localVariableDef = FALSE 2");
localVariableDef = false;
//debug(LOG_SCRIPT, "localVariableDef = false 2");
if(psCurEvent->bDeclared) /* can only occur if different (new) var names are used in the event definition that don't match with declaration*/
{
@ -2914,8 +2914,8 @@ void_function_declaration: void_func_subdecl '(' argument_decl_head ')' /* func
RULE( "void_function_declaration: void_func_subdecl '(' ')'");
/* remember that local var declaration is over */
localVariableDef = FALSE;
//debug(LOG_SCRIPT, "localVariableDef = FALSE 3");
localVariableDef = false;
//debug(LOG_SCRIPT, "localVariableDef = false 3");
if($1->numParams > 0 && psCurEvent->bDeclared) /* can only occur if no parameters or different (new) var names are used in the event definition that don't match with declaration */
{
@ -3059,21 +3059,21 @@ event_decl: event_subdecl ';'
{
RULE( "event_decl: event_subdecl ';'");
psCurEvent->bDeclared = TRUE;
psCurEvent->bDeclared = true;
}
| func_subdecl argument_decl ';' /* event (function) declaration can now include parameter declaration (optional) */
{
//debug(LOG_SCRIPT, "localVariableDef = FALSE new ");
localVariableDef = FALSE;
psCurEvent->bDeclared = TRUE;
//debug(LOG_SCRIPT, "localVariableDef = false new ");
localVariableDef = false;
psCurEvent->bDeclared = true;
}
| void_func_subdecl argument_decl ';' /* event (function) declaration can now include parameter declaration (optional) */
{
RULE( "event_decl: void_func_subdecl argument_decl ';'");
//debug(LOG_SCRIPT, "localVariableDef = FALSE new ");
localVariableDef = FALSE;
psCurEvent->bDeclared = TRUE;
//debug(LOG_SCRIPT, "localVariableDef = false new ");
localVariableDef = false;
psCurEvent->bDeclared = true;
}
| event_subdecl '(' TRIG_SYM ')' '{' var_list statement_list '}' /* 16.08.05 - local vars support */
{
@ -3887,7 +3887,7 @@ func_call: NUM_FUNC '(' param_list ')'
RULE( "func_call: NUM_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, FALSE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, false, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -3898,7 +3898,7 @@ func_call: NUM_FUNC '(' param_list ')'
RULE( "func_call: BOOL_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, FALSE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, false, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -3909,7 +3909,7 @@ func_call: NUM_FUNC '(' param_list ')'
RULE( "func_call: USER_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, FALSE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, false, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -3920,7 +3920,7 @@ func_call: NUM_FUNC '(' param_list ')'
RULE( "func_call: OBJ_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, FALSE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, false, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -3931,7 +3931,7 @@ func_call: NUM_FUNC '(' param_list ')'
RULE("func_call: FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, FALSE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, false, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
@ -3943,7 +3943,7 @@ func_call: NUM_FUNC '(' param_list ')'
RULE( "func_call: STRING_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, FALSE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, false, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -3954,7 +3954,7 @@ func_call: NUM_FUNC '(' param_list ')'
RULE( "func_call: FLOAT_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, FALSE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, false, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -4523,7 +4523,7 @@ expression: expression '+' expression
RULE( "expression: NUM_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, TRUE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, true, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -4730,7 +4730,7 @@ floatexp: floatexp '+' floatexp
RULE("floatexp: FLOAT_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, TRUE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, true, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -4918,7 +4918,7 @@ stringexp:
RULE("stringexp: STRING_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, TRUE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, true, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -5096,7 +5096,7 @@ boolexp: boolexp _AND boolexp
RULE("boolexp: BOOL_FUNC '(' param_list ')'");
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, TRUE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, true, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -5425,7 +5425,7 @@ userexp: VAR
| USER_FUNC '(' param_list ')'
{
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, TRUE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, true, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -5507,7 +5507,7 @@ objexp: OBJ_VAR
| OBJ_FUNC '(' param_list ')'
{
/* Generate the code for the function call */
codeRet = scriptCodeFunction($1, $3, TRUE, &psCurrBlock);
codeRet = scriptCodeFunction($1, $3, true, &psCurrBlock);
CHECK_CODE_ERROR(codeRet);
/* Return the code block */
@ -5763,8 +5763,8 @@ static void scriptResetTables(void)
SDWORD i;
/* start with global vars definition */
localVariableDef = FALSE;
//debug(LOG_SCRIPT, "localVariableDef = FALSE 4");
localVariableDef = false;
//debug(LOG_SCRIPT, "localVariableDef = false 4");
/* Reset the global variable symbol table */
for(psCurr = psGlobalVars; psCurr != NULL; psCurr = psNext)
@ -5864,11 +5864,11 @@ SCRIPT_CODE* scriptCompile(PHYSFS_file* fileHandle, SCR_DEBUGTYPE debugType)
psFinalProg = NULL;
if (debugType == SCR_DEBUGINFO)
{
genDebugInfo = TRUE;
genDebugInfo = true;
}
else
{
genDebugInfo = FALSE;
genDebugInfo = false;
}
if (scr_parse() != 0 || bError)
@ -5898,12 +5898,12 @@ void scr_error(const char *pMessage, ...)
scriptGetErrorData(&line, &text);
bError = TRUE;
bError = true;
#ifdef DEBUG
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",
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",
@ -5929,14 +5929,14 @@ BOOL scriptLookUpType(const char *pIdent, INTERP_TYPE *pType)
if (strcmp(asScrTypeTab[i].pIdent, pIdent) == 0)
{
*pType = asScrTypeTab[i].typeID;
return TRUE;
return true;
}
}
}
//debug(LOG_SCRIPT, "END scriptLookUpType");
return FALSE;
return false;
}
@ -5964,7 +5964,7 @@ BOOL popArguments(INTERP_VAL **ip_temp, SDWORD numParams)
PUT_PKOPCODE(*ip_temp, OP_POPLOCAL, i); //pop parameters into first i local params
}
return TRUE;
return true;
}
@ -5982,14 +5982,14 @@ BOOL scriptAddVariable(VAR_DECL *psStorage, VAR_IDENT_DECL *psVarIdent)
if (psNew == NULL)
{
scr_error("Out of memory");
return FALSE;
return false;
}
psNew->pIdent = psVarIdent->pIdent; //(char *)malloc(strlen(pIdent) + 1);
/* if (psNew->pIdent == NULL)
{
scr_error("Out of memory");
return FALSE;
return false;
}*/
/* Intialise the symbol structure */
@ -6062,7 +6062,7 @@ BOOL scriptAddVariable(VAR_DECL *psStorage, VAR_IDENT_DECL *psVarIdent)
}
return TRUE;
return true;
}
/* Look up a variable symbol */
@ -6082,7 +6082,7 @@ BOOL scriptLookUpVariable(const char *pIdent, VAR_SYMBOL **ppsSym)
strcmp(psCurr->pIdent, pIdent) == 0)
{
*ppsSym = psCurr;
return TRUE;
return true;
}
}
}
@ -6096,7 +6096,7 @@ BOOL scriptLookUpVariable(const char *pIdent, VAR_SYMBOL **ppsSym)
{
//debug(LOG_SCRIPT, "scriptLookUpVariable: extern");
*ppsSym = psCurr;
return TRUE;
return true;
}
}
}
@ -6108,7 +6108,7 @@ BOOL scriptLookUpVariable(const char *pIdent, VAR_SYMBOL **ppsSym)
{
//debug(LOG_SCRIPT, "scriptLookUpVariable: local");
*ppsSym = psCurr;
return TRUE;
return true;
}
}
@ -6145,7 +6145,7 @@ BOOL scriptLookUpVariable(const char *pIdent, VAR_SYMBOL **ppsSym)
{
//debug(LOG_SCRIPT, "scriptLookUpVariable - local var found, type=%d\n", psCurr->type);
*ppsSym = psCurr;
return TRUE;
return true;
}
}
}
@ -6162,7 +6162,7 @@ BOOL scriptLookUpVariable(const char *pIdent, VAR_SYMBOL **ppsSym)
if (strcmp(psCurr->pIdent, pIdent) == 0)
{
*ppsSym = psCurr;
return TRUE;
return true;
}
}
for(psCurr = psGlobalArrays; psCurr != NULL; psCurr = psCurr->psNext)
@ -6170,7 +6170,7 @@ BOOL scriptLookUpVariable(const char *pIdent, VAR_SYMBOL **ppsSym)
if (strcmp(psCurr->pIdent, pIdent) == 0)
{
*ppsSym = psCurr;
return TRUE;
return true;
}
}
}
@ -6179,7 +6179,7 @@ BOOL scriptLookUpVariable(const char *pIdent, VAR_SYMBOL **ppsSym)
*ppsSym = NULL;
//debug(LOG_SCRIPT, "END scriptLookUpVariable");
return FALSE;
return false;
}
@ -6193,13 +6193,13 @@ BOOL scriptAddTrigger(const char *pIdent, TRIGGER_DECL *psDecl, UDWORD line)
if (!psTrigger)
{
scr_error("Out of memory");
return FALSE;
return false;
}
psTrigger->pIdent = malloc(strlen(pIdent) + 1);
if (!psTrigger->pIdent)
{
scr_error("Out of memory");
return FALSE;
return false;
}
strcpy(psTrigger->pIdent, pIdent);
if (psDecl->size > 0)
@ -6208,7 +6208,7 @@ BOOL scriptAddTrigger(const char *pIdent, TRIGGER_DECL *psDecl, UDWORD line)
if (!psTrigger->pCode)
{
scr_error("Out of memory");
return FALSE;
return false;
}
memcpy(psTrigger->pCode, psDecl->pCode, psDecl->size * sizeof(INTERP_VAL));
}
@ -6252,7 +6252,7 @@ BOOL scriptAddTrigger(const char *pIdent, TRIGGER_DECL *psDecl, UDWORD line)
psTriggers = psTrigger;
}
return TRUE;
return true;
}
@ -6269,13 +6269,13 @@ BOOL scriptLookUpTrigger(const char *pIdent, TRIGGER_SYMBOL **ppsTrigger)
{
//debug(LOG_SCRIPT, "scriptLookUpTrigger: found");
*ppsTrigger = psCurr;
return TRUE;
return true;
}
}
//debug(LOG_SCRIPT, "END scriptLookUpTrigger");
return FALSE;
return false;
}
@ -6288,7 +6288,7 @@ BOOL scriptLookUpCallback(const char *pIdent, CALLBACK_SYMBOL **ppsCallback)
if (!asScrCallbackTab)
{
return FALSE;
return false;
}
for(psCurr = asScrCallbackTab; psCurr->type != 0; psCurr += 1)
@ -6297,12 +6297,12 @@ BOOL scriptLookUpCallback(const char *pIdent, CALLBACK_SYMBOL **ppsCallback)
{
//debug(LOG_SCRIPT, "scriptLookUpCallback: found");
*ppsCallback = psCurr;
return TRUE;
return true;
}
}
//debug(LOG_SCRIPT, "END scriptLookUpCallback: found");
return FALSE;
return false;
}
/* Add a new event symbol */
@ -6315,13 +6315,13 @@ BOOL scriptDeclareEvent(const char *pIdent, EVENT_SYMBOL **ppsEvent, SDWORD numA
if (!psEvent)
{
scr_error("Out of memory");
return FALSE;
return false;
}
psEvent->pIdent = malloc(strlen(pIdent) + 1);
if (!psEvent->pIdent)
{
scr_error("Out of memory");
return FALSE;
return false;
}
strcpy(psEvent->pIdent, pIdent);
psEvent->pCode = NULL;
@ -6333,8 +6333,8 @@ BOOL scriptDeclareEvent(const char *pIdent, EVENT_SYMBOL **ppsEvent, SDWORD numA
/* remember how many params this event has */
psEvent->numParams = numArgs;
psEvent->bFunction = FALSE;
psEvent->bDeclared = FALSE;
psEvent->bFunction = false;
psEvent->bDeclared = false;
psEvent->retType = VAL_VOID; /* functions can return a value */
// Add the event to the list
@ -6354,7 +6354,7 @@ BOOL scriptDeclareEvent(const char *pIdent, EVENT_SYMBOL **ppsEvent, SDWORD numA
*ppsEvent = psEvent;
return TRUE;
return true;
}
// Add the code to a defined event
@ -6373,7 +6373,7 @@ BOOL scriptDefineEvent(EVENT_SYMBOL *psEvent, CODE_BLOCK *psCode, SDWORD trigger
if (!psEvent->pCode)
{
scr_error("Out of memory");
return FALSE;
return false;
}
memcpy(psEvent->pCode, psCode->pCode, psCode->size * sizeof(INTERP_VAL));
@ -6388,7 +6388,7 @@ BOOL scriptDefineEvent(EVENT_SYMBOL *psEvent, CODE_BLOCK *psCode, SDWORD trigger
if (!psEvent->psDebug)
{
scr_error("Out of memory");
return FALSE;
return false;
}
memcpy(psEvent->psDebug, psCode->psDebug,
@ -6407,7 +6407,7 @@ BOOL scriptDefineEvent(EVENT_SYMBOL *psEvent, CODE_BLOCK *psCode, SDWORD trigger
if(psEvent->index >= maxEventsLocalVars)
debug(LOG_ERROR, "scriptDefineEvent - psEvent->index >= maxEventsLocalVars");
return TRUE;
return true;
}
/* Lookup an event symbol */
@ -6422,11 +6422,11 @@ BOOL scriptLookUpEvent(const char *pIdent, EVENT_SYMBOL **ppsEvent)
{
//debug(LOG_SCRIPT, "scriptLookUpEvent:found");
*ppsEvent = psCurr;
return TRUE;
return true;
}
}
//debug(LOG_SCRIPT, "END scriptLookUpEvent");
return FALSE;
return false;
}
@ -6445,14 +6445,14 @@ BOOL scriptLookUpConstant(const char *pIdent, CONST_SYMBOL **ppsSym)
if (strcmp(psCurr->pIdent, pIdent) == 0)
{
*ppsSym = psCurr;
return TRUE;
return true;
}
}
}
//debug(LOG_SCRIPT, "END scriptLookUpConstant");
return FALSE;
return false;
}
@ -6472,7 +6472,7 @@ BOOL scriptLookUpFunction(const char *pIdent, FUNC_SYMBOL **ppsSym)
if (strcmp(asScrInstinctTab[i].pIdent, pIdent) == 0)
{
*ppsSym = asScrInstinctTab + i;
return TRUE;
return true;
}
}
}
@ -6483,7 +6483,7 @@ BOOL scriptLookUpFunction(const char *pIdent, FUNC_SYMBOL **ppsSym)
if (strcmp(psCurr->pIdent, pIdent) == 0)
{
*ppsSym = psCurr;
return TRUE;
return true;
}
}
@ -6491,7 +6491,7 @@ BOOL scriptLookUpFunction(const char *pIdent, FUNC_SYMBOL **ppsSym)
*ppsSym = NULL;
//debug(LOG_SCRIPT, "END scriptLookUpFunction");
return FALSE;
return false;
}
/* Look up a function symbol defined in script */
@ -6510,7 +6510,7 @@ BOOL scriptLookUpCustomFunction(const char *pIdent, EVENT_SYMBOL **ppsSym)
{
//debug(LOG_SCRIPT, "scriptLookUpCustomFunction: %s is a custom function", pIdent);
*ppsSym = psCurr;
return TRUE;
return true;
}
}
}
@ -6519,7 +6519,7 @@ BOOL scriptLookUpCustomFunction(const char *pIdent, EVENT_SYMBOL **ppsSym)
*ppsSym = NULL;
//debug(LOG_SCRIPT, "END scriptLookUpCustomFunction");
return FALSE;
return false;
}

View File

@ -86,14 +86,14 @@ static BOOL stackNewChunk(UDWORD size)
psCurrChunk->psNext = (STACK_CHUNK *)malloc(sizeof(STACK_CHUNK));
if (!psCurrChunk->psNext)
{
return FALSE;
return false;
}
psCurrChunk->psNext->aVals = (INTERP_VAL*)malloc(sizeof(INTERP_VAL) * size);
if (!psCurrChunk->psNext->aVals)
{
free(psCurrChunk->psNext);
psCurrChunk->psNext = NULL;
return FALSE;
return false;
}
psCurrChunk->psNext->size = size;
@ -107,7 +107,7 @@ static BOOL stackNewChunk(UDWORD size)
memset(psCurrChunk->psNext->aVals, 0, sizeof(INTERP_VAL) * size);
}
return TRUE;
return true;
}
/* Push a value onto the stack */
@ -150,11 +150,11 @@ BOOL stackPush(INTERP_VAL *psVal)
{
/* Out of memory */
debug(LOG_ERROR, "stackPush: Out of memory");
return FALSE;
return false;
}
}
return TRUE;
return true;
}
@ -165,8 +165,8 @@ BOOL stackPop(INTERP_VAL *psVal)
if ((psCurrChunk->psPrev == NULL) && (currEntry == 0))
{
debug(LOG_ERROR, "stackPop: stack empty");
ASSERT( FALSE, "stackPop: stack empty" );
return FALSE;
ASSERT( false, "stackPop: stack empty" );
return false;
}
/* move the stack pointer down one */
@ -184,7 +184,7 @@ BOOL stackPop(INTERP_VAL *psVal)
/* copy the entire value off the stack */
memcpy(psVal, &(psCurrChunk->aVals[currEntry]), sizeof(INTERP_VAL));
return TRUE;
return true;
}
/* Return pointer to the top value without poping it */
@ -193,8 +193,8 @@ BOOL stackPeekTop(INTERP_VAL **ppsVal)
if ((psCurrChunk->psPrev == NULL) && (currEntry == 0))
{
debug(LOG_ERROR, "stackPeekTop: stack empty");
ASSERT( FALSE, "stackPeekTop: stack empty" );
return FALSE;
ASSERT( false, "stackPeekTop: stack empty" );
return false;
}
if (currEntry == 0)
@ -213,7 +213,7 @@ BOOL stackPeekTop(INTERP_VAL **ppsVal)
*ppsVal = &(psCurrChunk->aVals[currEntry - 1]);
}
return TRUE;
return true;
}
@ -225,8 +225,8 @@ BOOL stackPopType(INTERP_VAL *psVal)
if ((psCurrChunk->psPrev == NULL) && (currEntry == 0))
{
debug(LOG_ERROR, "stackPopType: stack empty");
ASSERT( FALSE, "stackPopType: stack empty" );
return FALSE;
ASSERT( false, "stackPopType: stack empty" );
return false;
}
/* move the stack pointer down one */
@ -262,7 +262,7 @@ BOOL stackPopType(INTERP_VAL *psVal)
break;
default:
debug(LOG_ERROR, "stackPopType: trying to assign an incompatible data type to a string variable (type: %d)", psTop->type);
return FALSE;
return false;
break;
}
}
@ -277,14 +277,14 @@ BOOL stackPopType(INTERP_VAL *psVal)
{
debug(LOG_ERROR, "stackPopType: type mismatch: %d/%d", psVal->type, psTop->type);
ASSERT( !"type mismatch", "stackPopType: type mismatch: %d/%d", psVal->type, psTop->type);
return FALSE;
return false;
}
/* copy the entire union off the stack */
memcpy(&(psVal->v), &(psTop->v), sizeof(psTop->v));
}
return TRUE;
return true;
}
@ -337,8 +337,8 @@ BOOL stackPopParams(SDWORD numParams, ...)
if (!psCurr)
{
debug(LOG_ERROR,"stackPopParams: not enough parameters on stack");
ASSERT( FALSE, "stackPopParams: not enough parameters on stack" );
return FALSE;
ASSERT( false, "stackPopParams: not enough parameters on stack" );
return false;
}
// Get the values, checking their types
@ -354,9 +354,9 @@ BOOL stackPopParams(SDWORD numParams, ...)
{
/* if (!interpCheckEquiv(type,psVal->type))
{
ASSERT( FALSE, "stackPopParams: type mismatch (%d/%d)" , type, psVal->type);
ASSERT( false, "stackPopParams: type mismatch (%d/%d)" , type, psVal->type);
va_end(args);
return FALSE;
return false;
} */
*((float*)pData) = psVal->v.fval;
}
@ -364,9 +364,9 @@ BOOL stackPopParams(SDWORD numParams, ...)
{
if (!interpCheckEquiv(type,psVal->type))
{
ASSERT( FALSE, "stackPopParams: type mismatch" );
ASSERT( false, "stackPopParams: type mismatch" );
va_end(args);
return FALSE;
return false;
}
if (scriptTypeIsPointer(psVal->type))
{
@ -413,7 +413,7 @@ BOOL stackPopParams(SDWORD numParams, ...)
sprintf(((char *)pData), "%d", psVal->v.bval);
break;
default:
ASSERT(FALSE, "StackPopParam - wrong data type being converted to string (type: %d)", psVal->type);
ASSERT(false, "StackPopParam - wrong data type being converted to string (type: %d)", psVal->type);
break;
}
//*((char **)pData) = psVal->v.sval;
@ -429,7 +429,7 @@ BOOL stackPopParams(SDWORD numParams, ...)
}
va_end(args);
return TRUE;
return true;
}
@ -474,11 +474,11 @@ BOOL stackPushResult(INTERP_TYPE type, INTERP_VAL *result)
if (!stackNewChunk(EXT_SIZE))
{
// Out of memory
return FALSE;
return false;
}
}
return TRUE;
return true;
}
@ -494,7 +494,7 @@ BOOL stackPeek(INTERP_VAL *psVal, UDWORD index)
{
/* Looking at entry on current chunk */
memcpy(psVal, &(psCurrChunk->aVals[currEntry - index - 1]), sizeof(INTERP_VAL));
return TRUE;
return true;
}
else
{
@ -507,7 +507,7 @@ BOOL stackPeek(INTERP_VAL *psVal, UDWORD index)
{
/* found the entry */
memcpy(psVal, &(psCurr->aVals[psCurr->size - 1 - index]), sizeof(INTERP_VAL));
return TRUE;
return true;
}
else
{
@ -517,8 +517,8 @@ BOOL stackPeek(INTERP_VAL *psVal, UDWORD index)
}
/* If we got here the index is off the bottom of the stack */
ASSERT( FALSE, "stackPeek: index too large" );
return FALSE;
ASSERT( false, "stackPeek: index too large" );
return false;
}
@ -549,8 +549,8 @@ BOOL stackBinaryOp(OPCODE opcode)
if (psCurrChunk->psPrev == NULL && currEntry < 2)
{
debug(LOG_ERROR, "stackBinaryOp: not enough entries on stack");
ASSERT( FALSE, "stackBinaryOp: not enough entries on stack" );
return FALSE;
ASSERT( false, "stackBinaryOp: not enough entries on stack" );
return false;
}
if (currEntry > 1)
@ -581,8 +581,8 @@ BOOL stackBinaryOp(OPCODE opcode)
if (!interpCheckEquiv(psV1->type, psV2->type))
{
debug(LOG_ERROR, "stackBinaryOp: type mismatch");
ASSERT( FALSE, "stackBinaryOp: type mismatch" );
return FALSE;
ASSERT( false, "stackBinaryOp: type mismatch" );
return false;
}
/* find out if the result will be a float. Both or neither arguments are floats - should be taken care of by bison*/
@ -638,7 +638,7 @@ BOOL stackBinaryOp(OPCODE opcode)
}
else
{
ASSERT(FALSE, "stackBinaryOp: division by zero (float)");
ASSERT(false, "stackBinaryOp: division by zero (float)");
}
}
else
@ -649,7 +649,7 @@ BOOL stackBinaryOp(OPCODE opcode)
}
else
{
ASSERT(FALSE, "stackBinaryOp: division by zero (integer)");
ASSERT(false, "stackBinaryOp: division by zero (integer)");
}
}
break;
@ -750,7 +750,7 @@ BOOL stackBinaryOp(OPCODE opcode)
default:
debug(LOG_ERROR, "stackBinaryOp: OP_CONC: first parameter is not compatible with Strings");
return FALSE;
return false;
break;
}
@ -781,7 +781,7 @@ BOOL stackBinaryOp(OPCODE opcode)
default:
debug(LOG_ERROR, "stackBinaryOp: OP_CONC: first parameter is not compatible with Strings");
return FALSE;
return false;
break;
}
@ -793,12 +793,12 @@ BOOL stackBinaryOp(OPCODE opcode)
default:
debug(LOG_ERROR, "stackBinaryOp: unknown opcode");
ASSERT( FALSE, "stackBinaryOp: unknown opcode" );
return FALSE;
ASSERT( false, "stackBinaryOp: unknown opcode" );
return false;
break;
}
return TRUE;
return true;
}
@ -813,8 +813,8 @@ BOOL stackUnaryOp(OPCODE opcode)
// Get the value
if (psCurrChunk->psPrev == NULL && currEntry == 0)
{
ASSERT( FALSE, "stackUnaryOp: not enough entries on stack" );
return FALSE;
ASSERT( false, "stackUnaryOp: not enough entries on stack" );
return false;
}
if (currEntry > 0)
@ -846,13 +846,13 @@ BOOL stackUnaryOp(OPCODE opcode)
if (!stackRemoveTop())
{
debug( LOG_ERROR, "stackUnaryOpcode: OP_INC: could not pop" );
return FALSE;
return false;
}
break;
default:
ASSERT( FALSE, "stackUnaryOp: invalid type for OP_INC (type: %d)", psVal->type );
return FALSE;
ASSERT( false, "stackUnaryOp: invalid type for OP_INC (type: %d)", psVal->type );
return false;
break;
}
break;
@ -871,12 +871,12 @@ BOOL stackUnaryOp(OPCODE opcode)
if (!stackRemoveTop())
{
debug( LOG_ERROR, "stackUnaryOpcode: OP_DEC: could not pop" );
return FALSE;
return false;
}
break;
default:
ASSERT( FALSE, "stackUnaryOp: invalid type for OP_DEC (type: %d)", psVal->type );
return FALSE;
ASSERT( false, "stackUnaryOp: invalid type for OP_DEC (type: %d)", psVal->type );
return false;
break;
}
break;
@ -891,8 +891,8 @@ BOOL stackUnaryOp(OPCODE opcode)
psVal->v.fval = - psVal->v.fval;
break;
default:
ASSERT( FALSE, "stackUnaryOp: invalid type for negation (type: %d)", psVal->type );
return FALSE;
ASSERT( false, "stackUnaryOp: invalid type for negation (type: %d)", psVal->type );
return false;
break;
}
break;
@ -903,18 +903,18 @@ BOOL stackUnaryOp(OPCODE opcode)
psVal->v.bval = !psVal->v.bval;
break;
default:
ASSERT( FALSE, "stackUnaryOp: invalid type for NOT (type: %d)", psVal->type );
return FALSE;
ASSERT( false, "stackUnaryOp: invalid type for NOT (type: %d)", psVal->type );
return false;
break;
}
break;
default:
ASSERT( FALSE, "stackUnaryOp: unknown opcode (opcode: %d)", opcode );
return FALSE;
ASSERT( false, "stackUnaryOp: unknown opcode (opcode: %d)", opcode );
return false;
break;
}
return TRUE;
return true;
}
BOOL castTop(INTERP_TYPE neededType)
@ -927,8 +927,8 @@ BOOL castTop(INTERP_TYPE neededType)
if (!stackPeekTop(&pTop) || pTop==NULL)
{
ASSERT(FALSE, "castTop: failed to peek stack");
return FALSE;
ASSERT(false, "castTop: failed to peek stack");
return false;
}
//debug(LOG_WZ, "castTop: stack type %d", pTop->type);
@ -944,7 +944,7 @@ BOOL castTop(INTERP_TYPE neededType)
pTop->v.fval = (float)pTop->v.bval;
pTop->type = VAL_FLOAT;
return TRUE;
return true;
break;
default:
@ -959,7 +959,7 @@ BOOL castTop(INTERP_TYPE neededType)
case VAL_FLOAT: /* casting from int to float */
pTop->v.fval = (float)pTop->v.ival;
pTop->type = VAL_FLOAT;
return TRUE;
return true;
break;
default:
debug(LOG_ERROR, "cast error %d->%d", pTop->type, neededType);
@ -973,7 +973,7 @@ BOOL castTop(INTERP_TYPE neededType)
case VAL_INT: /* casting from float to int */
pTop->v.ival = (SDWORD)pTop->v.fval;
pTop->type = VAL_INT;
return TRUE;
return true;
break;
default:
debug(LOG_ERROR, "cast error %d->%d", pTop->type, neededType);
@ -986,7 +986,7 @@ BOOL castTop(INTERP_TYPE neededType)
break;
}
return FALSE;
return false;
}
@ -998,14 +998,14 @@ BOOL stackInitialise(void)
{
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
return false;
}
psStackBase->aVals = (INTERP_VAL*)malloc(sizeof(INTERP_VAL) * INIT_SIZE);
if (!psStackBase->aVals)
{
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
return false;
}
psStackBase->size = INIT_SIZE;
@ -1020,7 +1020,7 @@ BOOL stackInitialise(void)
//string support
CURSTACKSTR = 0; //initialize string 'stack'
return TRUE;
return true;
}
@ -1069,8 +1069,8 @@ static inline BOOL stackRemoveTop(void)
if ((psCurrChunk->psPrev == NULL) && (currEntry == 0))
{
debug(LOG_ERROR, "stackRemoveTop: stack empty");
ASSERT( FALSE, "stackRemoveTop: stack empty" );
return FALSE;
ASSERT( false, "stackRemoveTop: stack empty" );
return false;
}
/* move the stack pointer down one */
@ -1085,7 +1085,7 @@ static inline BOOL stackRemoveTop(void)
currEntry--;
}
return TRUE;
return true;
}
@ -1111,8 +1111,8 @@ void stackReset(void)
if (psCurrChunk->psPrev == NULL && currEntry == 0)
{
ASSERT( FALSE, "stackGetTop: not enough entries on stack" );
return FALSE;
ASSERT( false, "stackGetTop: not enough entries on stack" );
return false;
}
if (currEntry == 0)
@ -1130,7 +1130,7 @@ void stackReset(void)
*pType = (UDWORD)psVal->type;
*pData = (UDWORD)psVal->v.ival;
return TRUE;
return true;
}*/
@ -1142,8 +1142,8 @@ void stackReset(void)
if (psCurrChunk->psPrev == NULL && currEntry == 0)
{
ASSERT( FALSE, "stackSetTop: not enough entries on stack" );
return FALSE;
ASSERT( false, "stackSetTop: not enough entries on stack" );
return false;
}
if (currEntry == 0)
@ -1161,7 +1161,7 @@ void stackReset(void)
psVal->type = type;
psVal->v.ival = (SDWORD)data;
return TRUE;
return true;
}*/
@ -1175,8 +1175,8 @@ void stackReset(void)
if (psCurrChunk->psPrev == NULL && currEntry < 2)
{
ASSERT( FALSE, "stackGetSecond: not enough entries on stack" );
return FALSE;
ASSERT( false, "stackGetSecond: not enough entries on stack" );
return false;
}
if (currEntry < 2)
@ -1194,7 +1194,7 @@ void stackReset(void)
*pType = (UDWORD)psVal->type;
*pData = (UDWORD)psVal->v.ival;
return TRUE;
return true;
}*/
@ -1205,8 +1205,8 @@ void stackReset(void)
if (psCurrChunk->psPrev == NULL && currEntry < 2)
{
ASSERT( FALSE, "stackGetSecond: not enough entries on stack" );
return FALSE;
ASSERT( false, "stackGetSecond: not enough entries on stack" );
return false;
}
if (currEntry > 1)
@ -1229,7 +1229,7 @@ void stackReset(void)
*ppsV2 = psChunk->aVals + psChunk->size - 1;
}
return TRUE;
return true;
}*/
@ -1243,8 +1243,8 @@ void stackReset(void)
if (psCurrChunk->psPrev == NULL && currEntry < 2)
{
ASSERT( FALSE, "stackGetSecond: not enough entries on stack" );
return FALSE;
ASSERT( false, "stackGetSecond: not enough entries on stack" );
return false;
}
if (currEntry > 1)
@ -1271,7 +1271,7 @@ void stackReset(void)
psVal->type = type;
psVal->v.ival = (SDWORD)data;
return TRUE;
return true;
}*/

View File

@ -24,17 +24,17 @@
BOOL seq_Play(char *filename)
{
debug( LOG_WARNING, "Sequence display is currently disabled (%s)", filename);
return FALSE;
return false;
}
BOOL seq_Playing()
{
return FALSE;
return false;
}
BOOL seq_Update()
{
return FALSE;
return false;
}
void seq_Shutdown()

View File

@ -33,8 +33,8 @@
// global variables
static AUDIO_SAMPLE *g_psSampleList = NULL;
static AUDIO_SAMPLE *g_psSampleQueue = NULL;
static BOOL g_bAudioEnabled = FALSE;
static BOOL g_bAudioPaused = FALSE;
static BOOL g_bAudioEnabled = false;
static BOOL g_bAudioPaused = false;
static AUDIO_SAMPLE g_sPreviousSample;
/** Counts the number of samples in the SampleQueue
@ -117,10 +117,10 @@ BOOL audio_Shutdown( void )
BOOL bOK;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// if audio not enabled return TRUE to carry on game without audio
if ( g_bAudioEnabled == FALSE )
// if audio not enabled return true to carry on game without audio
if ( g_bAudioEnabled == false )
{
return TRUE;
return true;
}
sound_StopAll();
@ -161,14 +161,14 @@ BOOL audio_GetPreviousQueueTrackPos( SDWORD *iX, SDWORD *iY, SDWORD *iZ )
|| g_sPreviousSample.y == SAMPLE_COORD_INVALID
|| g_sPreviousSample.z == SAMPLE_COORD_INVALID)
{
return FALSE;
return false;
}
*iX = g_sPreviousSample.x;
*iY = g_sPreviousSample.y;
*iZ = g_sPreviousSample.z;
return TRUE;
return true;
}
//*
@ -258,13 +258,13 @@ static BOOL audio_CheckSameQueueTracksPlaying( SDWORD iTrack )
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SDWORD iCount;
AUDIO_SAMPLE *psSample = NULL;
BOOL bOK = TRUE;
BOOL bOK = true;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE )
if ( g_bAudioEnabled == false || g_bAudioPaused == true )
{
return TRUE;
return true;
}
iCount = 0;
@ -280,7 +280,7 @@ static BOOL audio_CheckSameQueueTracksPlaying( SDWORD iTrack )
if ( iCount > MAX_SAME_SAMPLES )
{
bOK = FALSE;
bOK = false;
break;
}
@ -301,15 +301,15 @@ static AUDIO_SAMPLE *audio_QueueSample( SDWORD iTrack )
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE)
if ( g_bAudioEnabled == false || g_bAudioPaused == true)
{
return NULL;
}
ASSERT( sound_CheckTrack(iTrack) == TRUE, "audio_QueueSample: track %i outside limits\n", iTrack );
ASSERT( sound_CheckTrack(iTrack) == true, "audio_QueueSample: track %i outside limits\n", iTrack );
// reject track if too many of same ID already in queue
if ( audio_CheckSameQueueTracksPlaying(iTrack) == FALSE )
if ( audio_CheckSameQueueTracksPlaying(iTrack) == false )
{
return NULL;
}
@ -325,7 +325,7 @@ static AUDIO_SAMPLE *audio_QueueSample( SDWORD iTrack )
psSample->x = SAMPLE_COORD_INVALID;
psSample->y = SAMPLE_COORD_INVALID;
psSample->z = SAMPLE_COORD_INVALID;
psSample->bFinishedPlaying = FALSE;
psSample->bFinishedPlaying = false;
// add to queue
audio_AddSampleToTail( &g_psSampleQueue, psSample );
@ -344,7 +344,7 @@ void audio_QueueTrack( SDWORD iTrack )
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE)
if ( g_bAudioEnabled == false || g_bAudioPaused == true)
{
return;
}
@ -371,7 +371,7 @@ void audio_QueueTrackMinDelay( SDWORD iTrack, UDWORD iMinDelay )
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE )
if ( g_bAudioEnabled == false || g_bAudioPaused == true )
{
return;
}
@ -406,7 +406,7 @@ void audio_QueueTrackMinDelayPos( SDWORD iTrack, UDWORD iMinDelay, SDWORD iX, SD
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE )
if ( g_bAudioEnabled == false || g_bAudioPaused == true )
{
return;
}
@ -444,7 +444,7 @@ void audio_QueueTrackPos( SDWORD iTrack, SDWORD iX, SDWORD iY, SDWORD iZ )
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE )
if ( g_bAudioEnabled == false || g_bAudioPaused == true )
{
return;
}
@ -472,12 +472,12 @@ static void audio_UpdateQueue( void )
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE )
if ( g_bAudioEnabled == false || g_bAudioPaused == true )
{
return;
}
if (sound_QueueSamplePlaying() == TRUE)
if (sound_QueueSamplePlaying() == true)
{
return;
}
@ -493,7 +493,7 @@ static void audio_UpdateQueue( void )
audio_RemoveSample( &g_psSampleQueue, psSample );
// add sample to list if able to play
if ( !sound_Play2DTrack(psSample, TRUE) )
if ( !sound_Play2DTrack(psSample, true) )
{
debug( LOG_NEVER, "audio_UpdateQueue: couldn't play sample\n" );
free(psSample);
@ -524,8 +524,8 @@ void audio_Update( void )
AUDIO_SAMPLE *psSample, *psSampleTemp;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// if audio not enabled return TRUE to carry on game without audio
if ( g_bAudioEnabled == FALSE )
// if audio not enabled return true to carry on game without audio
if ( g_bAudioEnabled == false )
{
return;
}
@ -544,7 +544,7 @@ void audio_Update( void )
while ( psSample != NULL )
{
// remove finished samples from list
if ( psSample->bFinishedPlaying == TRUE )
if ( psSample->bFinishedPlaying == true )
{
audio_RemoveSample( &g_psSampleList, psSample );
psSampleTemp = psSample->psNext;
@ -558,7 +558,7 @@ void audio_Update( void )
if ( psSample->psObj != NULL )
{
if ( audio_ObjectDead(psSample->psObj)
|| (psSample->pCallback != NULL && psSample->pCallback(psSample->psObj) == FALSE) )
|| (psSample->pCallback != NULL && psSample->pCallback(psSample->psObj) == false) )
{
sound_StopTrack( psSample );
psSample->psObj = NULL;
@ -594,7 +594,7 @@ void audio_Update( void )
unsigned int audio_SetTrackVals(const char* fileName, BOOL loop, unsigned int volume, unsigned int audibleRadius)
{
// if audio not enabled return a random non-zero value to carry on game without audio
if ( g_bAudioEnabled == FALSE )
if ( g_bAudioEnabled == false )
{
return 1;
}
@ -618,13 +618,13 @@ static BOOL audio_CheckSame3DTracksPlaying( SDWORD iTrack, SDWORD iX, SDWORD iY,
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SDWORD iCount, iDx, iDy, iDz, iDistSq, iMaxDistSq, iRad;
AUDIO_SAMPLE *psSample = NULL;
BOOL bOK = TRUE;
BOOL bOK = true;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE )
if ( g_bAudioEnabled == false || g_bAudioPaused == true )
{
return TRUE;
return true;
}
iCount = 0;
@ -648,7 +648,7 @@ static BOOL audio_CheckSame3DTracksPlaying( SDWORD iTrack, SDWORD iX, SDWORD iY,
if ( iCount > MAX_SAME_SAMPLES )
{
bOK = FALSE;
bOK = false;
break;
}
}
@ -669,22 +669,22 @@ static BOOL audio_Play3DTrack( SDWORD iX, SDWORD iY, SDWORD iZ, int iTrack, void
AUDIO_SAMPLE *psSample;
//~~~~~~~~~~~~~~~~~~~~~~
// if audio not enabled return TRUE to carry on game without audio
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE)
// if audio not enabled return true to carry on game without audio
if ( g_bAudioEnabled == false || g_bAudioPaused == true)
{
return FALSE;
return false;
}
if ( audio_CheckSame3DTracksPlaying(iTrack, iX, iY, iZ) == FALSE )
if ( audio_CheckSame3DTracksPlaying(iTrack, iX, iY, iZ) == false )
{
return FALSE;
return false;
}
psSample = malloc(sizeof(AUDIO_SAMPLE));
if ( psSample == NULL )
{
debug(LOG_ERROR, "audio_Play3DTrack: Out of memory");
return FALSE;
return false;
}
// setup sample
@ -693,7 +693,7 @@ static BOOL audio_Play3DTrack( SDWORD iX, SDWORD iY, SDWORD iZ, int iTrack, void
psSample->x = iX;
psSample->y = iY;
psSample->z = iZ;
psSample->bFinishedPlaying = FALSE;
psSample->bFinishedPlaying = false;
psSample->psObj = psObj;
psSample->pCallback = pUserCallback;
@ -702,11 +702,11 @@ static BOOL audio_Play3DTrack( SDWORD iX, SDWORD iY, SDWORD iZ, int iTrack, void
{
debug( LOG_NEVER, "audio_Play3DTrack: couldn't play sample\n" );
free(psSample);
return FALSE;
return false;
}
audio_AddSampleToHead( &g_psSampleList, psSample );
return TRUE;
return true;
}
//*
@ -719,10 +719,10 @@ BOOL audio_PlayStaticTrack( SDWORD iMapX, SDWORD iMapY, int iTrack )
SDWORD iX, iY, iZ;
//~~~~~~~~~~~~~~~
// if audio not enabled return TRUE to carry on game without audio
if ( g_bAudioEnabled == FALSE )
// if audio not enabled return true to carry on game without audio
if ( g_bAudioEnabled == false )
{
return FALSE;
return false;
}
audio_GetStaticPos( iMapX, iMapY, &iX, &iY, &iZ );
@ -739,10 +739,10 @@ BOOL audio_PlayObjStaticTrack( void *psObj, int iTrack )
SDWORD iX, iY, iZ;
//~~~~~~~~~~~~~~~
// if audio not enabled return TRUE to carry on game without audio
if ( g_bAudioEnabled == FALSE )
// if audio not enabled return true to carry on game without audio
if ( g_bAudioEnabled == false )
{
return FALSE;
return false;
}
audio_GetObjectPos( psObj, &iX, &iY, &iZ );
@ -759,10 +759,10 @@ BOOL audio_PlayObjStaticTrackCallback( void *psObj, int iTrack, AUDIO_CALLBACK p
SDWORD iX, iY, iZ;
//~~~~~~~~~~~~~~~
// if audio not enabled return TRUE to carry on game without audio
if ( g_bAudioEnabled == FALSE )
// if audio not enabled return true to carry on game without audio
if ( g_bAudioEnabled == false )
{
return FALSE;
return false;
}
audio_GetObjectPos( psObj, &iX, &iY, &iZ );
@ -779,10 +779,10 @@ BOOL audio_PlayObjDynamicTrack( void *psObj, int iTrack, AUDIO_CALLBACK pUserCal
SDWORD iX, iY, iZ;
//~~~~~~~~~~~~~~~
// if audio not enabled return TRUE to carry on game without audio
if ( g_bAudioEnabled == FALSE )
// if audio not enabled return true to carry on game without audio
if ( g_bAudioEnabled == false )
{
return FALSE;
return false;
}
audio_GetObjectPos( psObj, &iX, &iY, &iZ );
@ -814,7 +814,7 @@ AUDIO_STREAM* audio_PlayStream(const char* fileName, float volume, void (*onFini
// If audio is not enabled return false to indicate that the given callback
// will not be invoked.
if (g_bAudioEnabled == FALSE)
if (g_bAudioEnabled == false)
{
return NULL;
}
@ -848,7 +848,7 @@ void audio_StopObjTrack( void *psObj, int iTrack )
//~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE)
if ( g_bAudioEnabled == false)
{
return;
}
@ -884,7 +884,7 @@ void audio_PlayTrack( int iTrack )
//~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE || g_bAudioPaused == TRUE)
if ( g_bAudioEnabled == false || g_bAudioPaused == true)
{
return;
}
@ -899,7 +899,7 @@ void audio_PlayTrack( int iTrack )
// setup/initialize sample
psSample->iTrack = iTrack;
psSample->bFinishedPlaying = FALSE;
psSample->bFinishedPlaying = false;
// Zero callback stuff since we don't need/want it
psSample->pCallback = NULL;
@ -911,7 +911,7 @@ void audio_PlayTrack( int iTrack )
*/
// add sample to list if able to play
if ( !sound_Play2DTrack(psSample, FALSE) )
if ( !sound_Play2DTrack(psSample, false) )
{
debug( LOG_NEVER, "audio_PlayTrack: couldn't play sample\n" );
free(psSample);
@ -928,12 +928,12 @@ void audio_PlayTrack( int iTrack )
void audio_PauseAll( void )
{
// return if audio not enabled
if ( g_bAudioEnabled == FALSE )
if ( g_bAudioEnabled == false )
{
return;
}
g_bAudioPaused = TRUE;
g_bAudioPaused = true;
sound_PauseAll();
}
@ -944,12 +944,12 @@ void audio_PauseAll( void )
void audio_ResumeAll( void )
{
// return if audio not enabled
if ( g_bAudioEnabled == FALSE )
if ( g_bAudioEnabled == false )
{
return;
}
g_bAudioPaused = FALSE;
g_bAudioPaused = false;
sound_ResumeAll();
}
@ -964,7 +964,7 @@ void audio_StopAll( void )
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE )
if ( g_bAudioEnabled == false )
{
return;
}
@ -1020,7 +1020,7 @@ SDWORD audio_GetTrackID( const char *fileName )
//~~~~~~~~~~~~~
// return if audio not enabled
if ( g_bAudioEnabled == FALSE )
if ( g_bAudioEnabled == false )
{
return SAMPLE_NOT_FOUND;
}

View File

@ -45,12 +45,12 @@ BOOL cdAudio_Open(const char* user_musicdir)
|| !PlayList_Read(user_musicdir))
&& !PlayList_Read("music"))
{
return FALSE;
return false;
}
music_initialized = true;
return TRUE;
return true;
}
static void cdAudio_CloseTrack(void)
@ -148,7 +148,7 @@ BOOL cdAudio_PlayTrack(SDWORD iTrack)
if (filename == NULL)
{
music_track = 0;
return FALSE;
return false;
}
if (cdAudio_OpenTrack(filename))
{
@ -157,14 +157,14 @@ BOOL cdAudio_PlayTrack(SDWORD iTrack)
}
else
{
return FALSE; // break out to avoid infinite loops
return false; // break out to avoid infinite loops
}
filename = PlayList_NextSong();
}
}
return TRUE;
return true;
}
void cdAudio_Stop()

View File

@ -89,7 +89,7 @@ static ALCdevice* device = 0;
static ALCcontext* context = 0;
#endif
BOOL openal_initialized = FALSE;
BOOL openal_initialized = false;
/** Removes the given sample from the "active_samples" linked list
* \param previous either NULL (if \c to_remove is the first item in the
@ -142,7 +142,7 @@ BOOL sound_InitLibrary( void )
{
PrintOpenALVersion(LOG_ERROR);
debug(LOG_ERROR, "Couldn't open audio device.");
return FALSE;
return false;
}
context = alcCreateContext(device, NULL); //NULL was contextAttributes
@ -153,11 +153,11 @@ BOOL sound_InitLibrary( void )
{
PrintOpenALVersion(LOG_ERROR);
debug(LOG_ERROR, "Couldn't initialize audio context: %s", alcGetString(device, err));
return FALSE;
return false;
}
#endif
openal_initialized = TRUE;
openal_initialized = true;
#ifndef WZ_NOSOUND
// Clear Error Codes
@ -173,7 +173,7 @@ BOOL sound_InitLibrary( void )
alListenerfv( AL_ORIENTATION, listenerOri );
alDistanceModel( AL_NONE );
#endif
return TRUE;
return true;
}
//*
@ -333,7 +333,7 @@ BOOL sound_QueueSamplePlaying( void )
if ( current_queue_sample == (ALuint)AL_INVALID )
{
return FALSE;
return false;
}
alGetSourcei(current_queue_sample, AL_SOURCE_STATE, &state);
@ -342,11 +342,11 @@ BOOL sound_QueueSamplePlaying( void )
// If one did, the state returned is useless. So instead of
// using it return false.
if (sound_GetError() != AL_NO_ERROR)
return FALSE;
return false;
if (state == AL_PLAYING)
{
return TRUE;
return true;
}
if (current_queue_sample != (ALuint)AL_INVALID)
@ -356,7 +356,7 @@ BOOL sound_QueueSamplePlaying( void )
current_queue_sample = AL_INVALID;
}
#endif
return FALSE;
return false;
}
/** Decodes an opened OggVorbis file into an OpenAL buffer
@ -370,7 +370,7 @@ static inline TRACK* sound_DecodeOggVorbisTrack(TRACK *psTrack, PHYSFS_file* PHY
ALenum format;
ALuint buffer;
struct OggVorbisDecoderState* decoder = sound_CreateOggVorbisDecoder(PHYSFS_fileHandle, TRUE);
struct OggVorbisDecoderState* decoder = sound_CreateOggVorbisDecoder(PHYSFS_fileHandle, true);
soundDataBuffer* soundBuffer;
soundBuffer = sound_DecodeOggVorbis(decoder, 0);
@ -543,7 +543,7 @@ BOOL sound_Play2DSample( TRACK *psTrack, AUDIO_SAMPLE *psSample, BOOL bQueued )
if (sfx_volume == 0.0)
{
return FALSE;
return false;
}
volume = ((float)psTrack->iVol / 100.0f); // each object can have OWN volume!
psSample->fVol = volume; // save computed volume
@ -570,7 +570,7 @@ BOOL sound_Play2DSample( TRACK *psTrack, AUDIO_SAMPLE *psSample, BOOL bQueued )
}
#endif
return TRUE;
return true;
}
//*
@ -585,7 +585,7 @@ BOOL sound_Play3DSample( TRACK *psTrack, AUDIO_SAMPLE *psSample )
if (sfx3d_volume == 0.0)
{
return FALSE;
return false;
}
volume = ((float)psTrack->iVol / 100.f); // max range is 0-100
@ -604,7 +604,7 @@ BOOL sound_Play3DSample( TRACK *psTrack, AUDIO_SAMPLE *psSample )
alSourcePlay( psSample->iSample );
sound_GetError();
#endif
return TRUE;
return true;
}
/** Plays the audio data from the given file
@ -656,7 +656,7 @@ AUDIO_STREAM* sound_PlayStreamWithBuf(PHYSFS_file* fileHandle, float volume, voi
stream->fileHandle = fileHandle;
stream->decoder = sound_CreateOggVorbisDecoder(stream->fileHandle, FALSE);
stream->decoder = sound_CreateOggVorbisDecoder(stream->fileHandle, false);
if (stream->decoder == NULL)
{
debug(LOG_ERROR, "sound_PlayStream: Failed to open audio file for decoding");
@ -1118,7 +1118,7 @@ BOOL sound_SampleIsFinished( AUDIO_SAMPLE *psSample )
sound_GetError(); // check for an error and clear the error state for later on in this function
if (state == AL_PLAYING || state == AL_PAUSED)
{
return FALSE;
return false;
}
if (psSample->iSample != (ALuint)AL_INVALID)
@ -1128,7 +1128,7 @@ BOOL sound_SampleIsFinished( AUDIO_SAMPLE *psSample )
psSample->iSample = AL_INVALID;
}
#endif
return TRUE;
return true;
}
//*

View File

@ -38,7 +38,7 @@ static TRACK *g_apTrack[MAX_TRACKS];
static SDWORD g_iCurTracks = 0;
// flag set when system is active (for callbacks etc)
static BOOL g_bSystemActive = FALSE;
static BOOL g_bSystemActive = false;
static AUDIO_CALLBACK g_pStopTrackCallback = NULL;
//*
@ -51,15 +51,15 @@ BOOL sound_Init()
if (!sound_InitLibrary())
{
debug(LOG_ERROR, "Cannot init sound library");
return FALSE;
return false;
}
// init audio array (with NULL pointers; which calloc ensures by setting all allocated memory to zero)
memset(g_apTrack, 0, sizeof(g_apTrack));
// set system active flag for callbacks
g_bSystemActive = TRUE;
return TRUE;
g_bSystemActive = true;
return true;
}
//*
@ -69,9 +69,9 @@ BOOL sound_Init()
BOOL sound_Shutdown( void )
{
// set inactive flag to prevent callbacks coming after shutdown
g_bSystemActive = FALSE;
g_bSystemActive = false;
sound_ShutdownLibrary();
return TRUE;
return true;
}
//*
@ -213,16 +213,16 @@ BOOL sound_CheckTrack( SDWORD iTrack )
if ( iTrack < 0 || iTrack > g_iCurTracks - 1 )
{
debug( LOG_SOUND, "sound_CheckTrack: track number %i outside max %i\n", iTrack, g_iCurTracks );
return FALSE;
return false;
}
if ( g_apTrack[iTrack] == NULL )
{
debug( LOG_SOUND, "sound_CheckTrack: track %i NULL\n", iTrack );
return FALSE;
return false;
}
return TRUE;
return true;
}
//*
@ -286,7 +286,7 @@ BOOL sound_Play2DTrack( AUDIO_SAMPLE *psSample, BOOL bQueued )
// Check to make sure the requested track is loaded
if (!sound_CheckTrack(psSample->iTrack))
{
return FALSE;
return false;
}
psTrack = g_apTrack[psSample->iTrack];
@ -304,7 +304,7 @@ BOOL sound_Play3DTrack( AUDIO_SAMPLE *psSample )
// Check to make sure the requested track is loaded
if (!sound_CheckTrack(psSample->iTrack))
{
return FALSE;
return false;
}
psTrack = g_apTrack[psSample->iTrack];
@ -361,7 +361,7 @@ void sound_FinishedCallback( AUDIO_SAMPLE *psSample )
}
// set finished flag
psSample->bFinishedPlaying = TRUE;
psSample->bFinishedPlaying = true;
}
//*

View File

@ -37,26 +37,26 @@ W_BARGRAPH* barGraphCreate(const W_BARINIT* psInit)
if (psInit->style & ~(WBAR_PLAIN | WBAR_TROUGH | WBAR_DOUBLE | WIDG_HIDDEN))
{
ASSERT(FALSE, "Unknown bar graph style");
ASSERT(false, "Unknown bar graph style");
return NULL;
}
if (psInit->orientation < WBAR_LEFT
|| psInit->orientation > WBAR_BOTTOM)
{
ASSERT(FALSE, "barGraphCreate: Unknown orientation");
ASSERT(false, "barGraphCreate: Unknown orientation");
return NULL;
}
if (psInit->size > WBAR_SCALE)
{
ASSERT(FALSE, "barGraphCreate: Bar size out of range");
ASSERT(false, "barGraphCreate: Bar size out of range");
return NULL;
}
if ((psInit->style & WBAR_DOUBLE)
&& (psInit->minorSize > WBAR_SCALE))
{
ASSERT(FALSE, "barGraphCreate: Minor bar size out of range");
ASSERT(false, "barGraphCreate: Minor bar size out of range");
return NULL;
}
@ -156,7 +156,7 @@ void widgSetBarSize(W_SCREEN *psScreen, UDWORD id, UDWORD iValue)
psBGraph = (W_BARGRAPH *)widgGetFromID(psScreen, id);
if (psBGraph == NULL || psBGraph->type != WIDG_BARGRAPH)
{
ASSERT( FALSE, "widgSetBarSize: Couldn't find widget from id" );
ASSERT( false, "widgSetBarSize: Couldn't find widget from id" );
return;
}
@ -187,7 +187,7 @@ void widgSetMinorBarSize(W_SCREEN *psScreen, UDWORD id, UDWORD iValue )
psBGraph = (W_BARGRAPH *)widgGetFromID(psScreen, id);
if (psBGraph == NULL || psBGraph->type != WIDG_BARGRAPH)
{
ASSERT( FALSE, "widgSetBarSize: Couldn't find widget from id" );
ASSERT( false, "widgSetBarSize: Couldn't find widget from id" );
return;
}
@ -377,7 +377,7 @@ void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE
SDWORD x0 = 0, y0 = 0, x1 = 0, y1 = 0; // Position of the bar
SDWORD tx0 = 0, ty0 = 0, tx1 = 0, ty1 = 0; // Position of the trough
W_BARGRAPH *psBGraph;
BOOL showBar=TRUE, showTrough=TRUE;
BOOL showBar=true, showTrough=true;
psBGraph = (W_BARGRAPH *)psWidget;
@ -391,7 +391,7 @@ void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE
y1 = y0 + psWidget->height;
if (x0 == x1)
{
showBar = FALSE;
showBar = false;
}
tx0 = x1+1;
ty0 = y0;
@ -399,7 +399,7 @@ void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE
ty1 = y1;
if (tx0 >= tx1)
{
showTrough = FALSE;
showTrough = false;
}
break;
case WBAR_RIGHT:
@ -409,7 +409,7 @@ void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE
y1 = y0 + psWidget->height;
if (x0 == x1)
{
showBar = FALSE;
showBar = false;
}
tx0 = xOffset + psWidget->x;
ty0 = y0;
@ -417,7 +417,7 @@ void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE
ty1 = y1;
if (tx0 >= tx1)
{
showTrough = FALSE;
showTrough = false;
}
break;
case WBAR_TOP:
@ -427,7 +427,7 @@ void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE
y1 = y0 + psWidget->height * psBGraph->majorSize / WBAR_SCALE;
if (y0 == y1)
{
showBar = FALSE;
showBar = false;
}
tx0 = x0;
ty0 = y1+1;
@ -435,7 +435,7 @@ void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE
ty1 = y0 + psWidget->height;
if (ty0 >= ty1)
{
showTrough = FALSE;
showTrough = false;
}
break;
case WBAR_BOTTOM:
@ -445,7 +445,7 @@ void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE
y0 = y1 - psWidget->height * psBGraph->majorSize / WBAR_SCALE;
if (y0 == y1)
{
showBar = FALSE;
showBar = false;
}
tx0 = x0;
ty0 = yOffset + psWidget->y;
@ -453,7 +453,7 @@ void barGraphDisplayTrough(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIE
ty1 = y0-1;
if (ty0 >= ty1)
{
showTrough = FALSE;
showTrough = false;
}
break;
}

View File

@ -34,7 +34,7 @@
/* Initialise the button module */
BOOL buttonStartUp(void)
{
return TRUE;
return true;
}

View File

@ -60,7 +60,7 @@ W_EDITBOX* editBoxCreate(const W_EDBINIT* psInit)
if (psInit->style & ~(WEDB_PLAIN | WIDG_HIDDEN | WEDB_DISABLED))
{
ASSERT( FALSE, "Unknown edit box style" );
ASSERT( false, "Unknown edit box style" );
return NULL;
}
@ -391,7 +391,7 @@ void editBoxRun(W_EDITBOX *psWidget, W_CONTEXT *psContext)
iV_SetFont(psWidget->FontID);
/* Loop through the characters in the input buffer */
done = FALSE;
done = false;
for (key = inputGetKey(); key != 0 && !done; key = inputGetKey())
{
/* Deal with all the control keys, assume anything else is a printable character */

View File

@ -49,7 +49,7 @@ typedef struct _tab_pos
/* Set default colours for a form */
static void formSetDefaultColours(W_FORM *psForm)
{
static BOOL bDefaultsSet = FALSE;
static BOOL bDefaultsSet = false;
static PIELIGHT wcol_bkgrnd;
static PIELIGHT wcol_text;
static PIELIGHT wcol_light;
@ -81,7 +81,7 @@ static void formSetDefaultColours(W_FORM *psForm)
wcol_tipbkgrnd = pal_Colour(0x30, 0x30, 0x60);
wcol_disable = pal_Colour(0xbf, 0xbf, 0xbf);
bDefaultsSet = TRUE;
bDefaultsSet = true;
psForm->aColours[WCOL_BKGRND] = wcol_bkgrnd;
psForm->aColours[WCOL_TEXT] = wcol_text;
@ -223,30 +223,30 @@ static W_TABFORM* formCreateTabbed(const W_FORMINIT* psInit)
if (psInit->numMajor == 0)
{
ASSERT(FALSE, "formCreateTabbed: Must have at least one major tab on a tabbed form");
ASSERT(false, "formCreateTabbed: Must have at least one major tab on a tabbed form");
return NULL;
}
if (psInit->majorPos != 0
&& psInit->majorPos == psInit->minorPos)
{
ASSERT(FALSE, "formCreateTabbed: Cannot have major and minor tabs on same side");
ASSERT(false, "formCreateTabbed: Cannot have major and minor tabs on same side");
return NULL;
}
if (psInit->numMajor >= WFORM_MAXMAJOR)
{
ASSERT(FALSE, "formCreateTabbed: Too many Major tabs" );
ASSERT(false, "formCreateTabbed: Too many Major tabs" );
return NULL;
}
for(major=0; major<psInit->numMajor; major++)
{
if (psInit->aNumMinors[major] >= WFORM_MAXMINOR)
{
ASSERT(FALSE, "formCreateTabbed: Too many Minor tabs for Major %u", major);
ASSERT(false, "formCreateTabbed: Too many Minor tabs for Major %u", major);
return NULL;
}
if (psInit->aNumMinors[major] == 0)
{
ASSERT(FALSE, "formCreateTabbed: Must have at least one Minor tab for each major");
ASSERT(false, "formCreateTabbed: Must have at least one Minor tab for each major");
return NULL;
}
}
@ -370,26 +370,26 @@ W_FORM* formCreate(const W_FORMINIT* psInit)
| WFORM_NOCLICKMOVE | WFORM_NOPRIMARY | WFORM_SECONDARY
| WIDG_HIDDEN))
{
ASSERT(FALSE, "formCreate: Unknown style bit");
ASSERT(false, "formCreate: Unknown style bit");
return NULL;
}
if ((psInit->style & WFORM_TABBED)
&& (psInit->style & (WFORM_INVISIBLE | WFORM_CLICKABLE)))
{
ASSERT(FALSE, "formCreate: Tabbed form cannot be invisible or clickable");
ASSERT(false, "formCreate: Tabbed form cannot be invisible or clickable");
return NULL;
}
if ((psInit->style & WFORM_INVISIBLE)
&& (psInit->style & WFORM_CLICKABLE))
{
ASSERT(FALSE, "formCreate: Cannot have an invisible clickable form");
ASSERT(false, "formCreate: Cannot have an invisible clickable form");
return NULL;
}
if (!(psInit->style & WFORM_CLICKABLE)
&& ((psInit->style & WFORM_NOPRIMARY)
|| (psInit->style & WFORM_SECONDARY)))
{
ASSERT(FALSE, "formCreate: Cannot set keys if the form isn't clickable");
ASSERT(false, "formCreate: Cannot set keys if the form isn't clickable");
return NULL;
}
@ -446,14 +446,14 @@ BOOL formAddWidget(W_FORM *psForm, WIDGET *psWidget, W_INIT *psInit)
psTabForm = (W_TABFORM *)psForm;
if (psInit->majorID >= psTabForm->numMajor)
{
ASSERT( FALSE, "formAddWidget: Major tab does not exist" );
return FALSE;
ASSERT( false, "formAddWidget: Major tab does not exist" );
return false;
}
psMajor = psTabForm->asMajor + psInit->majorID;
if (psInit->minorID >= psMajor->numMinor)
{
ASSERT( FALSE, "formAddWidget: Minor tab does not exist" );
return FALSE;
ASSERT( false, "formAddWidget: Minor tab does not exist" );
return false;
}
ppsList = &(psMajor->asMinor[psInit->minorID].psWidgets);
psWidget->psNext = *ppsList;
@ -467,7 +467,7 @@ BOOL formAddWidget(W_FORM *psForm, WIDGET *psWidget, W_INIT *psInit)
psForm->psWidgets = psWidget;
}
return TRUE;
return true;
}
@ -640,7 +640,7 @@ void widgGetTabs(W_SCREEN *psScreen, UDWORD id, UWORD *pMajor, UWORD *pMinor)
if (psForm == NULL || psForm->type != WIDG_FORM ||
!(psForm->style & WFORM_TABBED))
{
ASSERT( FALSE,"widgGetTabs: couldn't find tabbed form from id" );
ASSERT( false,"widgGetTabs: couldn't find tabbed form from id" );
return;
}
ASSERT(psForm != NULL, "widgGetTabs: Invalid tab form pointer");
@ -662,7 +662,7 @@ void widgSetColour(W_SCREEN *psScreen, UDWORD id, UDWORD colour,
psForm = (W_TABFORM *)widgGetFromID(psScreen, id);
if (psForm == NULL || psForm->type != WIDG_FORM)
{
ASSERT( FALSE,"widgSetColour: couldn't find form from id" );
ASSERT( false,"widgSetColour: couldn't find form from id" );
return;
}
ASSERT( psForm != NULL,
@ -670,7 +670,7 @@ void widgSetColour(W_SCREEN *psScreen, UDWORD id, UDWORD colour,
if (colour >= WCOL_MAX)
{
ASSERT( FALSE, "widgSetColour: Colour id out of range" );
ASSERT( false, "widgSetColour: Colour id out of range" );
return;
}
psForm->aColours[colour] = pal_Colour(red,green,blue);
@ -782,7 +782,7 @@ static BOOL formPickHTab(TAB_POS *psTabPos,
if (number == 1)
{
// Don't have single tabs
return FALSE;
return false;
}
#endif
@ -831,14 +831,14 @@ static BOOL formPickHTab(TAB_POS *psTabPos,
psTabPos->y = y0;
psTabPos->width = width;
psTabPos->height = height;
return TRUE;
return true;
}
x += width + gap;
}
/* Didn't find any */
return FALSE;
return false;
}
// NOTE: This routine is NOT modified to use the tab scroll buttons.
@ -855,7 +855,7 @@ static BOOL formPickVTab(TAB_POS *psTabPos,
if (number == 1)
{
/* Don't have single tabs */
return FALSE;
return false;
}
#endif
@ -873,14 +873,14 @@ static BOOL formPickVTab(TAB_POS *psTabPos,
psTabPos->y = y;
psTabPos->width = width;
psTabPos->height = height;
return TRUE;
return true;
}
y += height + gap;
}
/* Didn't find any */
return FALSE;
return false;
}
@ -970,7 +970,7 @@ static BOOL formPickTab(W_TABFORM *psForm, UDWORD fx, UDWORD fy,
psForm->majorSize, psForm->tabMajorThickness, psForm->tabMajorGap,
psForm->numMajor, fx, fy))
{
return TRUE;
return true;
}
yOffset2 = -psForm->tabVertOffset;
break;
@ -979,7 +979,7 @@ static BOOL formPickTab(W_TABFORM *psForm, UDWORD fx, UDWORD fy,
psForm->majorSize, psForm->tabMajorThickness, psForm->tabMajorGap,
psForm->numMajor, fx, fy))
{
return TRUE;
return true;
}
break;
case WFORM_TABLEFT:
@ -987,7 +987,7 @@ static BOOL formPickTab(W_TABFORM *psForm, UDWORD fx, UDWORD fy,
psForm->tabMajorThickness, psForm->majorSize, psForm->tabMajorGap,
psForm->numMajor, fx, fy))
{
return TRUE;
return true;
}
xOffset2 = psForm->tabHorzOffset;
break;
@ -996,11 +996,11 @@ static BOOL formPickTab(W_TABFORM *psForm, UDWORD fx, UDWORD fy,
psForm->tabMajorThickness, psForm->majorSize, psForm->tabMajorGap,
psForm->numMajor, fx, fy))
{
return TRUE;
return true;
}
break;
case WFORM_TABNONE:
ASSERT( FALSE, "formDisplayTabbed: Cannot have a tabbed form with no major tabs" );
ASSERT( false, "formDisplayTabbed: Cannot have a tabbed form with no major tabs" );
break;
}
@ -1014,7 +1014,7 @@ static BOOL formPickTab(W_TABFORM *psForm, UDWORD fx, UDWORD fy,
psMajor->numMinor, fx, fy))
{
psTabPos->index += psForm->numMajor;
return TRUE;
return true;
}
break;
case WFORM_TABBOTTOM:
@ -1023,7 +1023,7 @@ static BOOL formPickTab(W_TABFORM *psForm, UDWORD fx, UDWORD fy,
psMajor->numMinor, fx, fy))
{
psTabPos->index += psForm->numMajor;
return TRUE;
return true;
}
break;
case WFORM_TABLEFT:
@ -1032,7 +1032,7 @@ static BOOL formPickTab(W_TABFORM *psForm, UDWORD fx, UDWORD fy,
psMajor->numMinor, fx, fy))
{
psTabPos->index += psForm->numMajor;
return TRUE;
return true;
}
break;
case WFORM_TABRIGHT:
@ -1041,13 +1041,13 @@ static BOOL formPickTab(W_TABFORM *psForm, UDWORD fx, UDWORD fy,
psMajor->numMinor, fx, fy))
{
psTabPos->index += psForm->numMajor;
return TRUE;
return true;
}
break;
/* case WFORM_TABNONE - no minor tabs so nothing to display */
}
return FALSE;
return false;
}
extern UDWORD gameTime2;
@ -1632,7 +1632,7 @@ void formDisplayTabbed(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGH
pColours,TAB_MAJOR,psForm->tabMajorGap);
break;
case WFORM_TABNONE:
ASSERT( FALSE, "formDisplayTabbed: Cannot have a tabbed form with no major tabs" );
ASSERT( false, "formDisplayTabbed: Cannot have a tabbed form with no major tabs" );
break;
}

View File

@ -28,7 +28,7 @@
#define FORM_BASE \
WIDGET_BASE; /* The common widget data */ \
\
BOOL disableChildren; /* Disable all child widgets if TRUE */ \
BOOL disableChildren; /* Disable all child widgets if true */ \
UWORD Ax0,Ay0,Ax1,Ay1; /* Working coords for animations. */ \
UDWORD animCount; /* Animation counter. */ \
UDWORD startTime; /* Animation start time */ \

View File

@ -40,7 +40,7 @@ W_LABEL* labelCreate(const W_LABINIT* psInit)
if (psInit->style & ~(WLAB_PLAIN | WLAB_ALIGNLEFT |
WLAB_ALIGNRIGHT | WLAB_ALIGNCENTRE | WIDG_HIDDEN))
{
ASSERT( FALSE, "Unknown button style" );
ASSERT( false, "Unknown button style" );
return NULL;
}

View File

@ -27,7 +27,7 @@
// FIXME Direct iVis implementation include!
#include "lib/ivis_common/rendmode.h"
BOOL DragEnabled = TRUE;
BOOL DragEnabled = true;
void sliderEnableDrag(BOOL Enable)
{
@ -41,14 +41,14 @@ W_SLIDER* sliderCreate(const W_SLDINIT* psInit)
if (psInit->style & ~(WBAR_PLAIN | WIDG_HIDDEN))
{
ASSERT(FALSE, "sliderCreate: Unknown style");
ASSERT(false, "sliderCreate: Unknown style");
return NULL;
}
if (psInit->orientation < WSLD_LEFT
|| psInit->orientation > WSLD_BOTTOM)
{
ASSERT(FALSE, "sliderCreate: Unknown orientation");
ASSERT(false, "sliderCreate: Unknown orientation");
return NULL;
}
@ -59,13 +59,13 @@ W_SLIDER* sliderCreate(const W_SLDINIT* psInit)
|| psInit->orientation == WSLD_BOTTOM)
&& psInit->numStops > (psInit->height - psInit->barSize)))
{
ASSERT(FALSE, "sliderCreate: Too many stops for slider length");
ASSERT(false, "sliderCreate: Too many stops for slider length");
return NULL;
}
if (psInit->pos > psInit->numStops)
{
ASSERT(FALSE, "sliderCreate: slider position greater than stops (%d/%d)", psInit->pos, psInit->numStops);
ASSERT(false, "sliderCreate: slider position greater than stops (%d/%d)", psInit->pos, psInit->numStops);
return NULL;
}
@ -76,7 +76,7 @@ W_SLIDER* sliderCreate(const W_SLDINIT* psInit)
|| psInit->orientation == WSLD_BOTTOM)
&& psInit->barSize > psInit->height))
{
ASSERT(FALSE, "sliderCreate: slider bar is larger than slider width");
ASSERT(false, "sliderCreate: slider bar is larger than slider width");
return NULL;
}

View File

@ -36,7 +36,7 @@
#include "slider.h"
#include "tip.h"
static BOOL bWidgetsActive = TRUE;
static BOOL bWidgetsActive = true;
/* The widget the mouse is over this update */
static WIDGET *psMouseOverWidget = NULL;
@ -152,7 +152,7 @@ void widgReleaseWidgetList(WIDGET *psWidgets)
sliderFree((W_SLIDER *)psCurr);
break;
default:
ASSERT( FALSE,"widgReleaseWidgetList: Unknown widget type" );
ASSERT( false,"widgReleaseWidgetList: Unknown widget type" );
break;
}
}
@ -194,7 +194,7 @@ void widgRelease(WIDGET *psWidget)
sliderFree((W_SLIDER *)psWidget);
break;
default:
ASSERT( FALSE,"widgRelease: Unknown widget type" );
ASSERT( false,"widgRelease: Unknown widget type" );
break;
}
}
@ -212,7 +212,7 @@ static BOOL widgCheckIDForm(W_FORM *psForm, UDWORD id)
{
if (psCurr->id == id)
{
return TRUE;
return true;
}
if (psCurr->type == WIDG_FORM)
@ -220,7 +220,7 @@ static BOOL widgCheckIDForm(W_FORM *psForm, UDWORD id)
/* Another form so recurse */
if (widgCheckIDForm((W_FORM *)psCurr, id))
{
return TRUE;
return true;
}
}
@ -232,7 +232,7 @@ static BOOL widgCheckIDForm(W_FORM *psForm, UDWORD id)
}
}
return FALSE;
return false;
}
#if 0
@ -265,8 +265,8 @@ BOOL widgAddForm(W_SCREEN *psScreen, const W_FORMINIT* psInit)
if (widgCheckIDForm((W_FORM *)psScreen->psForm,psInit->id))
{
ASSERT( FALSE, "widgAddForm: ID number has already been used (%d)", psInit->id );
return FALSE;
ASSERT( false, "widgAddForm: ID number has already been used (%d)", psInit->id );
return false;
}
/* Find the form to add the widget to */
@ -280,9 +280,9 @@ BOOL widgAddForm(W_SCREEN *psScreen, const W_FORMINIT* psInit)
psParent = (W_FORM *)widgGetFromID(psScreen, psInit->formID);
if (!psParent || psParent->type != WIDG_FORM)
{
ASSERT( FALSE,
ASSERT( false,
"widgAddForm: Could not find parent form from formID" );
return FALSE;
return false;
}
}
@ -292,10 +292,10 @@ BOOL widgAddForm(W_SCREEN *psScreen, const W_FORMINIT* psInit)
/* Add it to the screen */
|| !formAddWidget(psParent, (WIDGET *)psForm, (W_INIT *)psInit))
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -310,8 +310,8 @@ BOOL widgAddLabel(W_SCREEN *psScreen, const W_LABINIT* psInit)
if (widgCheckIDForm((W_FORM *)psScreen->psForm,psInit->id))
{
ASSERT( FALSE, "widgAddLabel: ID number has already been used (%d)", psInit->id );
return FALSE;
ASSERT( false, "widgAddLabel: ID number has already been used (%d)", psInit->id );
return false;
}
/* Find the form to put the button on */
@ -324,9 +324,9 @@ BOOL widgAddLabel(W_SCREEN *psScreen, const W_LABINIT* psInit)
psForm = (W_FORM *)widgGetFromID(psScreen, psInit->formID);
if (psForm == NULL || psForm->type != WIDG_FORM)
{
ASSERT( FALSE,
ASSERT( false,
"widgAddLabel: Could not find parent form from formID" );
return FALSE;
return false;
}
}
@ -336,10 +336,10 @@ BOOL widgAddLabel(W_SCREEN *psScreen, const W_LABINIT* psInit)
/* Add it to the form */
|| !formAddWidget(psForm, (WIDGET *)psLabel, (W_INIT *)psInit))
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -354,8 +354,8 @@ BOOL widgAddButton(W_SCREEN *psScreen, const W_BUTINIT* psInit)
if (widgCheckIDForm((W_FORM *)psScreen->psForm,psInit->id))
{
ASSERT( FALSE, "widgAddButton: ID number has already been used(%d)", psInit->id );
return FALSE;
ASSERT( false, "widgAddButton: ID number has already been used(%d)", psInit->id );
return false;
}
/* Find the form to put the button on */
@ -368,9 +368,9 @@ BOOL widgAddButton(W_SCREEN *psScreen, const W_BUTINIT* psInit)
psForm = (W_FORM *)widgGetFromID(psScreen, psInit->formID);
if (psForm == NULL || psForm->type != WIDG_FORM)
{
ASSERT( FALSE,
ASSERT( false,
"widgAddButton: Could not find parent form from formID" );
return FALSE;
return false;
}
}
@ -380,10 +380,10 @@ BOOL widgAddButton(W_SCREEN *psScreen, const W_BUTINIT* psInit)
/* Add it to the form */
|| !formAddWidget(psForm, (WIDGET *)psButton, (W_INIT *)psInit))
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -398,8 +398,8 @@ BOOL widgAddEditBox(W_SCREEN *psScreen, const W_EDBINIT* psInit)
if (widgCheckIDForm((W_FORM *)psScreen->psForm,psInit->id))
{
ASSERT( FALSE, "widgAddEditBox: ID number has already been used (%d)", psInit->id );
return FALSE;
ASSERT( false, "widgAddEditBox: ID number has already been used (%d)", psInit->id );
return false;
}
/* Find the form to put the edit box on */
@ -412,9 +412,9 @@ BOOL widgAddEditBox(W_SCREEN *psScreen, const W_EDBINIT* psInit)
psForm = (W_FORM *)widgGetFromID(psScreen, psInit->formID);
if (!psForm || psForm->type != WIDG_FORM)
{
ASSERT( FALSE,
ASSERT( false,
"widgAddEditBox: Could not find parent form from formID" );
return FALSE;
return false;
}
}
@ -424,10 +424,10 @@ BOOL widgAddEditBox(W_SCREEN *psScreen, const W_EDBINIT* psInit)
/* Add it to the form */
|| !formAddWidget(psForm, (WIDGET *)psEdBox, (W_INIT *)psInit))
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -442,8 +442,8 @@ BOOL widgAddBarGraph(W_SCREEN *psScreen, const W_BARINIT* psInit)
if (widgCheckIDForm((W_FORM *)psScreen->psForm,psInit->id))
{
ASSERT( FALSE, "widgAddBarGraph: ID number has already been used (%d)", psInit->id );
return FALSE;
ASSERT( false, "widgAddBarGraph: ID number has already been used (%d)", psInit->id );
return false;
}
/* Find the form to put the bar graph on */
@ -456,9 +456,9 @@ BOOL widgAddBarGraph(W_SCREEN *psScreen, const W_BARINIT* psInit)
psForm = (W_FORM *)widgGetFromID(psScreen, psInit->formID);
if (!psForm || psForm->type != WIDG_FORM)
{
ASSERT( FALSE,
ASSERT( false,
"widgAddBarGraph: Could not find parent form from formID" );
return FALSE;
return false;
}
}
@ -468,10 +468,10 @@ BOOL widgAddBarGraph(W_SCREEN *psScreen, const W_BARINIT* psInit)
/* Add it to the form */
|| !formAddWidget(psForm, (WIDGET *)psBarGraph, (W_INIT *)psInit))
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -486,8 +486,8 @@ BOOL widgAddSlider(W_SCREEN *psScreen, const W_SLDINIT* psInit)
if (widgCheckIDForm((W_FORM *)psScreen->psForm, psInit->id))
{
ASSERT(FALSE, "widgSlider: ID number has already been used (%d)", psInit->id);
return FALSE;
ASSERT(false, "widgSlider: ID number has already been used (%d)", psInit->id);
return false;
}
/* Find the form to put the slider on */
@ -501,8 +501,8 @@ BOOL widgAddSlider(W_SCREEN *psScreen, const W_SLDINIT* psInit)
if (!psForm
|| psForm->type != WIDG_FORM)
{
ASSERT(FALSE, "widgAddSlider: Could not find parent form from formID");
return FALSE;
ASSERT(false, "widgAddSlider: Could not find parent form from formID");
return false;
}
}
@ -512,10 +512,10 @@ BOOL widgAddSlider(W_SCREEN *psScreen, const W_SLDINIT* psInit)
/* Add it to the form */
|| !formAddWidget(psForm, (WIDGET *)psSlider, (W_INIT *)psInit))
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -556,7 +556,7 @@ static BOOL widgDeleteFromForm(W_FORM *psForm, UDWORD id, W_CONTEXT *psContext)
widgRelease(psMinor->psWidgets);
psMinor->psWidgets = psNext;
return TRUE;
return true;
}
else
{
@ -567,7 +567,7 @@ static BOOL widgDeleteFromForm(W_FORM *psForm, UDWORD id, W_CONTEXT *psContext)
psPrev->psNext = psCurr->psNext;
widgRelease(psCurr);
return TRUE;
return true;
}
if (psCurr->type == WIDG_FORM)
{
@ -580,7 +580,7 @@ static BOOL widgDeleteFromForm(W_FORM *psForm, UDWORD id, W_CONTEXT *psContext)
sNewContext.my = psContext->my - psCurr->y;
if (widgDeleteFromForm((W_FORM *)psCurr, id, &sNewContext))
{
return TRUE;
return true;
}
}
psPrev = psCurr;
@ -604,7 +604,7 @@ static BOOL widgDeleteFromForm(W_FORM *psForm, UDWORD id, W_CONTEXT *psContext)
widgRelease(psForm->psWidgets);
psForm->psWidgets = psNext;
return TRUE;
return true;
}
else
{
@ -616,7 +616,7 @@ static BOOL widgDeleteFromForm(W_FORM *psForm, UDWORD id, W_CONTEXT *psContext)
psPrev->psNext = psCurr->psNext;
widgRelease(psCurr);
return TRUE;
return true;
}
if (psCurr->type == WIDG_FORM)
{
@ -629,7 +629,7 @@ static BOOL widgDeleteFromForm(W_FORM *psForm, UDWORD id, W_CONTEXT *psContext)
sNewContext.my = psContext->my - psCurr->y;
if (widgDeleteFromForm((W_FORM *)psCurr, id, &sNewContext))
{
return TRUE;
return true;
}
}
psPrev = psCurr;
@ -637,7 +637,7 @@ static BOOL widgDeleteFromForm(W_FORM *psForm, UDWORD id, W_CONTEXT *psContext)
}
}
return FALSE;
return false;
}
@ -704,7 +704,7 @@ static void widgStartForm(W_FORM *psForm)
sliderInitialise((W_SLIDER *)psCurr);
break;
default:
ASSERT( FALSE,"widgStartScreen: Unknown widget type" );
ASSERT( false,"widgStartScreen: Unknown widget type" );
break;
}
@ -822,7 +822,7 @@ void widgGetPos(W_SCREEN *psScreen, UDWORD id, SWORD *pX, SWORD *pY)
}
else
{
ASSERT( FALSE, "widgGetPos: Couldn't find widget from ID" );
ASSERT( false, "widgGetPos: Couldn't find widget from ID" );
*pX = 0;
*pY = 0;
}
@ -993,7 +993,7 @@ UDWORD widgGetButtonState(W_SCREEN *psScreen, UDWORD id)
psWidget = widgGetFromID(psScreen, id);
if (psWidget == NULL)
{
ASSERT( FALSE, "widgGetButtonState: Couldn't find button/click form from ID" );
ASSERT( false, "widgGetButtonState: Couldn't find button/click form from ID" );
}
else if (psWidget->type == WIDG_BUTTON)
{
@ -1005,7 +1005,7 @@ UDWORD widgGetButtonState(W_SCREEN *psScreen, UDWORD id)
}
else
{
ASSERT( FALSE, "widgGetButtonState: Couldn't find button/click form from ID" );
ASSERT( false, "widgGetButtonState: Couldn't find button/click form from ID" );
}
return 0;
}
@ -1019,7 +1019,7 @@ void widgSetButtonFlash(W_SCREEN *psScreen, UDWORD id)
psWidget = widgGetFromID(psScreen, id);
if (psWidget == NULL)
{
ASSERT( FALSE, "widgSetButtonFlash: Couldn't find button/click form from ID" );
ASSERT( false, "widgSetButtonFlash: Couldn't find button/click form from ID" );
}
else if (psWidget->type == WIDG_BUTTON)
{
@ -1035,7 +1035,7 @@ void widgSetButtonFlash(W_SCREEN *psScreen, UDWORD id)
}
else
{
ASSERT( FALSE, "widgSetButtonFlash: Couldn't find button/click form from ID" );
ASSERT( false, "widgSetButtonFlash: Couldn't find button/click form from ID" );
}
}
@ -1048,7 +1048,7 @@ void widgClearButtonFlash(W_SCREEN *psScreen, UDWORD id)
psWidget = widgGetFromID(psScreen, id);
if (psWidget == NULL)
{
ASSERT( FALSE, "widgSetButtonFlash: Couldn't find button/click form from ID" );
ASSERT( false, "widgSetButtonFlash: Couldn't find button/click form from ID" );
}
else if (psWidget->type == WIDG_BUTTON)
{
@ -1063,7 +1063,7 @@ void widgClearButtonFlash(W_SCREEN *psScreen, UDWORD id)
}
else
{
ASSERT( FALSE, "widgClearButtonFlash: Couldn't find button/click form from ID" );
ASSERT( false, "widgClearButtonFlash: Couldn't find button/click form from ID" );
}
}
@ -1077,7 +1077,7 @@ void widgSetButtonState(W_SCREEN *psScreen, UDWORD id, UDWORD state)
psWidget = widgGetFromID(psScreen, id);
if (psWidget == NULL)
{
ASSERT( FALSE, "widgSetButtonState: Couldn't find button/click form from ID" );
ASSERT( false, "widgSetButtonState: Couldn't find button/click form from ID" );
}
else if (psWidget->type == WIDG_BUTTON)
{
@ -1093,7 +1093,7 @@ void widgSetButtonState(W_SCREEN *psScreen, UDWORD id, UDWORD state)
}
else
{
ASSERT( FALSE, "widgSetButtonState: Couldn't find button/click form from ID" );
ASSERT( false, "widgSetButtonState: Couldn't find button/click form from ID" );
}
}
@ -1113,7 +1113,7 @@ const char *widgGetString(W_SCREEN *psScreen, UDWORD id)
switch (psWidget->type)
{
case WIDG_FORM:
ASSERT( FALSE, "widgGetString: Forms do not have a string" );
ASSERT( false, "widgGetString: Forms do not have a string" );
aStringRetBuffer[0] = '\0';
break;
case WIDG_LABEL:
@ -1133,22 +1133,22 @@ const char *widgGetString(W_SCREEN *psScreen, UDWORD id)
strlcpy(aStringRetBuffer, ((W_EDITBOX *)psWidget)->aText, sizeof(aStringRetBuffer));
break;
case WIDG_BARGRAPH:
ASSERT( FALSE, "widgGetString: Bar Graphs do not have a string" );
ASSERT( false, "widgGetString: Bar Graphs do not have a string" );
aStringRetBuffer[0] = '\0';
break;
case WIDG_SLIDER:
ASSERT( FALSE, "widgGetString: Sliders do not have a string" );
ASSERT( false, "widgGetString: Sliders do not have a string" );
aStringRetBuffer[0] = '\0';
break;
default:
ASSERT( FALSE,"widgGetString: Unknown widget type" );
ASSERT( false,"widgGetString: Unknown widget type" );
aStringRetBuffer[0] = '\0';
break;
}
}
else
{
ASSERT( FALSE, "widgGetString: couldn't get widget from id" );
ASSERT( false, "widgGetString: couldn't get widget from id" );
aStringRetBuffer[0] = '\0';
}
@ -1175,7 +1175,7 @@ void widgSetString(W_SCREEN *psScreen, UDWORD id, const char *pText)
switch (psWidget->type)
{
case WIDG_FORM:
ASSERT( FALSE, "widgSetString: forms do not have a string" );
ASSERT( false, "widgSetString: forms do not have a string" );
break;
case WIDG_LABEL:
@ -1281,7 +1281,7 @@ static void widgProcessForm(W_CONTEXT *psContext)
/* Note current form */
psForm = psContext->psForm;
// if(psForm->disableChildren == TRUE) {
// if(psForm->disableChildren == true) {
// return;
// }
@ -1488,7 +1488,7 @@ static void widgDisplayForm(W_FORM *psForm, UDWORD xOffset, UDWORD yOffset)
/* Display the form */
psForm->display( (WIDGET *)psForm, xOffset, yOffset, psForm->aColours );
if(psForm->disableChildren == TRUE) {
if(psForm->disableChildren == true) {
return;
}
@ -1562,7 +1562,7 @@ static void widgFocusLost(W_SCREEN* psScreen, WIDGET *psWidget)
case WIDG_SLIDER:
break;
default:
ASSERT( FALSE,"widgFocusLost: Unknown widget type" );
ASSERT( false,"widgFocusLost: Unknown widget type" );
break;
}
}
@ -1613,7 +1613,7 @@ void widgHiLite(WIDGET *psWidget, W_CONTEXT *psContext)
sliderHiLite((W_SLIDER *)psWidget);
break;
default:
ASSERT( FALSE,"widgHiLite: Unknown widget type" );
ASSERT( false,"widgHiLite: Unknown widget type" );
break;
}
}
@ -1644,7 +1644,7 @@ void widgHiLiteLost(WIDGET *psWidget, W_CONTEXT *psContext)
sliderHiLiteLost((W_SLIDER *)psWidget);
break;
default:
ASSERT( FALSE,"widgHiLiteLost: Unknown widget type" );
ASSERT( false,"widgHiLiteLost: Unknown widget type" );
break;
}
}
@ -1671,7 +1671,7 @@ static void widgClicked(WIDGET *psWidget, UDWORD key, W_CONTEXT *psContext)
sliderClicked((W_SLIDER *)psWidget, psContext);
break;
default:
ASSERT( FALSE,"widgClicked: Unknown widget type" );
ASSERT( false,"widgClicked: Unknown widget type" );
break;
}
}
@ -1699,7 +1699,7 @@ static void widgReleased(WIDGET *psWidget, UDWORD key, W_CONTEXT *psContext)
sliderReleased((W_SLIDER *)psWidget);
break;
default:
ASSERT( FALSE,"widgReleased: Unknown widget type" );
ASSERT( false,"widgReleased: Unknown widget type" );
break;
}
}
@ -1727,7 +1727,7 @@ static void widgRun(WIDGET *psWidget, W_CONTEXT *psContext)
sliderRun((W_SLIDER *)psWidget, psContext);
break;
default:
ASSERT( FALSE,"widgRun: Unknown widget type" );
ASSERT( false,"widgRun: Unknown widget type" );
break;
}
}

View File

@ -153,7 +153,7 @@ BOOL actionInAttackRange(DROID *psDroid, BASE_OBJECT *psObj, int weapon_slot)
CHECK_DROID(psDroid);
if (psDroid->asWeaps[0].nStat == 0)
{
return FALSE;
return false;
}
dx = (SDWORD)psDroid->pos.x - (SDWORD)psObj->pos.x;
@ -209,11 +209,11 @@ BOOL actionInAttackRange(DROID *psDroid, BASE_OBJECT *psObj, int weapon_slot)
rangeSq = psStats->minRange * psStats->minRange;
if ( radSq >= rangeSq || !proj_Direct( psStats ) )
{
return TRUE;
return true;
}
}
return FALSE;
return false;
}
@ -227,7 +227,7 @@ BOOL actionInRange(DROID *psDroid, BASE_OBJECT *psObj, int weapon_slot)
if (psDroid->asWeaps[0].nStat == 0)
{
return FALSE;
return false;
}
psStats = asWeaponStats + psDroid->asWeaps[weapon_slot].nStat;
@ -248,11 +248,11 @@ BOOL actionInRange(DROID *psDroid, BASE_OBJECT *psObj, int weapon_slot)
rangeSq = psStats->minRange * psStats->minRange;
if ( radSq >= rangeSq || !proj_Direct( psStats ) )
{
return TRUE;
return true;
}
}
return FALSE;
return false;
}
@ -268,7 +268,7 @@ BOOL actionInsideMinRange(DROID *psDroid, BASE_OBJECT *psObj, int weapon_slot)
/* Watermelon:if I am a multi-turret droid */
if (psDroid->asWeaps[0].nStat == 0)
{
return FALSE;
return false;
}
psStats = asWeaponStats + psDroid->asWeaps[weapon_slot].nStat;
@ -285,10 +285,10 @@ BOOL actionInsideMinRange(DROID *psDroid, BASE_OBJECT *psObj, int weapon_slot)
// check min range
if ( radSq <= rangeSq )
{
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -304,7 +304,7 @@ void actionAlignTurret(BASE_OBJECT *psObj, int weapon_slot)
tRot = 0;
//get the maximum rotation this frame
rotation = timeAdjustedIncrement(ACTION_TURRET_ROTATION_RATE, TRUE);
rotation = timeAdjustedIncrement(ACTION_TURRET_ROTATION_RATE, true);
if (rotation == 0)
{
rotation = 1;
@ -411,7 +411,7 @@ BOOL actionTargetTurret(BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, UWORD *p
SDWORD targetRotation,targetPitch;
SDWORD pitchError;
SDWORD rotationError, dx, dy, dz;
BOOL onTarget = FALSE;
BOOL onTarget = false;
float fR;
SDWORD pitchLowerLimit, pitchUpperLimit;
DROID *psDroid = NULL;
@ -466,7 +466,7 @@ BOOL actionTargetTurret(BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, UWORD *p
}
//get the maximum rotation this frame
rotRate = timeAdjustedIncrement(rotRate, TRUE);
rotRate = timeAdjustedIncrement(rotRate, true);
if (rotRate > 180)//crop to 180 degrees, no point in turning more than all the way round
{
rotRate = 180;
@ -475,7 +475,7 @@ BOOL actionTargetTurret(BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, UWORD *p
{
rotRate = 1;
}
pitchRate = timeAdjustedIncrement(pitchRate, TRUE);
pitchRate = timeAdjustedIncrement(pitchRate, true);
if (pitchRate > 180)//crop to 180 degrees, no point in turning more than all the way round
{
pitchRate = 180;
@ -538,7 +538,7 @@ BOOL actionTargetTurret(BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, UWORD *p
tRotation = (SWORD)(targetRotation - psAttacker->direction);
}
// debug( LOG_NEVER, "locked on target...\n");
onTarget = TRUE;
onTarget = true;
}
tRotation %= 360;
@ -557,7 +557,7 @@ BOOL actionTargetTurret(BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, UWORD *p
}
/* set muzzle pitch if direct fire */
// if ( asWeaponStats[psAttacker->asWeaps->nStat].direct == TRUE )
// if ( asWeaponStats[psAttacker->asWeaps->nStat].direct == true )
if ( psWeapStats != NULL &&
( proj_Direct( psWeapStats ) ||
( (psAttacker->type == OBJ_DROID) &&
@ -595,13 +595,13 @@ BOOL actionTargetTurret(BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, UWORD *p
{
// move down
tPitch = (SWORD)(tPitch - pitchRate);
onTarget = FALSE;
onTarget = false;
}
else if (pitchError > pitchRate)
{
// add rotation
tPitch = (SWORD)(tPitch + pitchRate);
onTarget = FALSE;
onTarget = false;
}
else //roughly there so lock on and fire
{
@ -618,13 +618,13 @@ BOOL actionTargetTurret(BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, UWORD *p
{
// move down
tPitch = (SWORD)pitchLowerLimit;
onTarget = FALSE;
onTarget = false;
}
else if (tPitch > pitchUpperLimit)
{
// add rotation
tPitch = (SWORD)pitchUpperLimit;
onTarget = FALSE;
onTarget = false;
}
if (tPitch < 0)
@ -653,7 +653,7 @@ BOOL actionVisibleTarget(DROID *psDroid, BASE_OBJECT *psTarget, int weapon_slot)
{
if ( visibleObject((BASE_OBJECT*)psDroid, psTarget) )
{
return TRUE;
return true;
}
}
@ -662,9 +662,9 @@ BOOL actionVisibleTarget(DROID *psDroid, BASE_OBJECT *psTarget, int weapon_slot)
{
if ( visibleObject((BASE_OBJECT*)psDroid, psTarget) )
{
return TRUE;
return true;
}
return FALSE;
return false;
}
psStats = asWeaponStats + psDroid->asWeaps[weapon_slot].nStat;
@ -672,7 +672,7 @@ BOOL actionVisibleTarget(DROID *psDroid, BASE_OBJECT *psTarget, int weapon_slot)
{
if (visibleObjWallBlock((BASE_OBJECT*)psDroid, psTarget))
{
return TRUE;
return true;
}
}
else
@ -683,19 +683,19 @@ BOOL actionVisibleTarget(DROID *psDroid, BASE_OBJECT *psTarget, int weapon_slot)
{
if (psTarget->visible[psDroid->player])
{
return TRUE;
return true;
}
}
else
{
if (visibleObject((BASE_OBJECT*)psDroid, psTarget))
{
return TRUE;
return true;
}
}
}
return FALSE;
return false;
}
static void actionAddVtolAttackRun( DROID *psDroid )
@ -910,7 +910,7 @@ BOOL actionReachedBuildPos(DROID *psDroid, SDWORD x, SDWORD y, BASE_STATS *psSta
// droid could be at either the left or the right
if ( (dy >= (ty -1)) && (dy <= (ty + breadth)) )
{
return TRUE;
return true;
}
}
else if ( (dy == (ty -1)) || (dy == (ty + breadth)) )
@ -918,11 +918,11 @@ BOOL actionReachedBuildPos(DROID *psDroid, SDWORD x, SDWORD y, BASE_STATS *psSta
// droid could be at either the top or the bottom
if ( (dx >= (tx -1)) && (dx <= (tx + width)) )
{
return TRUE;
return true;
}
}
return FALSE;
return false;
}
@ -954,10 +954,10 @@ BOOL actionDroidOnBuildPos(DROID *psDroid, SDWORD x, SDWORD y, BASE_STATS *psSta
&& dy >= ty
&& dy < ty + breadth)
{
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -997,7 +997,7 @@ BOOL actionRouteBlockingPos(DROID *psDroid, SDWORD tx, SDWORD ty)
((psDroid->order != DORDER_MOVE) &&
(psDroid->order != DORDER_SCOUT)))
{
return FALSE;
return false;
}
// see if there is a wall to attack around the location
@ -1039,10 +1039,10 @@ done:
psDroid->order = DORDER_SCOUT_ATTACKWALL;
}
setDroidTarget(psDroid, (BASE_OBJECT *)psWall);
return TRUE;
return true;
}
return FALSE;
return false;
}
#define VTOL_ATTACK_AUDIO_DELAY (3*GAME_TICKS_PER_SEC)
@ -1085,11 +1085,11 @@ void actionUpdateDroid(DROID *psDroid)
if ( !cyborgDroid(psDroid) &&
psPropStats->propulsionType == LIFT )
{
bInvert = TRUE;
bInvert = true;
}
else
{
bInvert = FALSE;
bInvert = false;
}
// clear the target if it has died
@ -1226,7 +1226,7 @@ void actionUpdateDroid(DROID *psDroid)
{
if (!droidRemove(psDroid, mission.apsDroidLists))
{
ASSERT( FALSE, "actionUpdate: Unable to remove transporter from mission list" );
ASSERT( false, "actionUpdate: Unable to remove transporter from mission list" );
}
addDroid(psDroid, apsDroidLists);
//set the x/y up since they were set to INVALID_XY when moved offWorld
@ -1321,7 +1321,7 @@ void actionUpdateDroid(DROID *psDroid)
moveToRearm(psDroid);
}
bHasTarget = FALSE;
bHasTarget = false;
//loop through weapons and look for target for each weapon
for (i = 0;i < psDroid->numWeaps;i++)
{
@ -1331,7 +1331,7 @@ void actionUpdateDroid(DROID *psDroid)
if (aiBestNearestTarget(psDroid, &psTemp, i) >= 0)
{
bHasTarget = TRUE;
bHasTarget = true;
setDroidActionTarget(psDroid, psTemp, i);
}
}
@ -1396,7 +1396,7 @@ void actionUpdateDroid(DROID *psDroid)
if (iVisible & (1 << (j+1)))
{
bHasTarget = TRUE;
bHasTarget = true;
//Watermelon:I moved psWeapStats flag update there
psWeapStats = asWeaponStats + psDroid->asWeaps[j].nStat;
//Watermelon:to fix a AA-weapon attack ground unit exploit
@ -1475,13 +1475,13 @@ void actionUpdateDroid(DROID *psDroid)
psDroid->action = DACTION_NONE;
}
bHasTarget = FALSE;
bHasTarget = false;
for(i = 0;i < psDroid->numWeaps;i++)
{
//Skip main turret target changes
if (i > 0 &&
psDroid->psActionTarget[i] == NULL &&
aiChooseTarget((BASE_OBJECT*)psDroid, &psTargets[i], i, FALSE))
aiChooseTarget((BASE_OBJECT*)psDroid, &psTargets[i], i, false))
{
setDroidActionTarget(psDroid, psTargets[i], i);
}
@ -1499,7 +1499,7 @@ void actionUpdateDroid(DROID *psDroid)
actionVisibleTarget(psDroid, psActionTarget, i) &&
actionInRange(psDroid, psActionTarget, i))
{
bHasTarget = TRUE;
bHasTarget = true;
psWeapStats = asWeaponStats + psDroid->asWeaps[i].nStat;
if (validTarget((BASE_OBJECT *)psDroid, psActionTarget, i))
{
@ -1706,13 +1706,13 @@ void actionUpdateDroid(DROID *psDroid)
bInvert,i);
}
bChaseBloke = FALSE;
bChaseBloke = false;
if (!vtolDroid(psDroid) &&
psDroid->psActionTarget[0]->type == OBJ_DROID &&
((DROID *)psDroid->psActionTarget[0])->droidType == DROID_PERSON &&
psWeapStats->fireOnMove != FOM_NO)
{
bChaseBloke = TRUE;
bChaseBloke = true;
}
@ -1840,7 +1840,7 @@ void actionUpdateDroid(DROID *psDroid)
(SDWORD)psDroid->orderX,(SDWORD)psDroid->orderY, psDroid->psTarStats))
{
moveStopDroid(psDroid);
bDoHelpBuild = FALSE;
bDoHelpBuild = false;
// Got to destination - start building
psStructStats = (STRUCTURE_STATS*)psDroid->psTarStats;
@ -1866,7 +1866,7 @@ void actionUpdateDroid(DROID *psDroid)
{
// same type - do a help build
setDroidTarget(psDroid, (BASE_OBJECT *)psStruct);
bDoHelpBuild = TRUE;
bDoHelpBuild = true;
}
else if ((psStruct->pStructureType->type == REF_WALL ||
psStruct->pStructureType->type == REF_WALLCORNER) &&
@ -1892,7 +1892,7 @@ void actionUpdateDroid(DROID *psDroid)
map_coord(tlx),
map_coord(tly),
psDroid->player,
FALSE))
false))
{
debug( LOG_NEVER, "DACTION_MOVETOBUILD: !validLocation\n");
psDroid->action = DACTION_NONE;
@ -1922,7 +1922,7 @@ void actionUpdateDroid(DROID *psDroid)
{
// same type - do a help build
setDroidTarget(psDroid, (BASE_OBJECT *)psStruct);
bDoHelpBuild = TRUE;
bDoHelpBuild = true;
}
else if ((psStruct->pStructureType->type == REF_WALL || psStruct->pStructureType->type == REF_WALLCORNER) &&
((STRUCTURE_STATS *)psDroid->psTarStats)->type == REF_DEFENSE)
@ -1960,7 +1960,7 @@ void actionUpdateDroid(DROID *psDroid)
}
else
{
bDoHelpBuild = TRUE;
bDoHelpBuild = true;
}
if (bDoHelpBuild)
@ -2026,7 +2026,7 @@ void actionUpdateDroid(DROID *psDroid)
// Watermelon:make construct droid to use turretRotation[0]
actionTargetTurret((BASE_OBJECT*)psDroid, psDroid->psActionTarget[0],
&(psDroid->turretRotation[0]), &(psDroid->turretPitch[0]),
NULL,FALSE,0);
NULL,false,0);
}
break;
case DACTION_MOVETODEMOLISH:
@ -2130,7 +2130,7 @@ void actionUpdateDroid(DROID *psDroid)
//Watermelon:use 0 for non-combat(only 1 'weapon')
actionTargetTurret((BASE_OBJECT*)psDroid, psDroid->psActionTarget[0],
&(psDroid->turretRotation[0]), &(psDroid->turretPitch[0]),
NULL,FALSE,0);
NULL,false,0);
}
else if (psDroid->action == DACTION_CLEARWRECK)
{
@ -2207,7 +2207,7 @@ void actionUpdateDroid(DROID *psDroid)
map_coord(tlx),
map_coord(tly),
psDroid->player,
FALSE))
false))
{
psDroid->action = DACTION_NONE;
}
@ -2231,7 +2231,7 @@ void actionUpdateDroid(DROID *psDroid)
// align the turret
actionTargetTurret((BASE_OBJECT*)psDroid, psDroid->psActionTarget[0],
&(psDroid->turretRotation[0]), &(psDroid->turretPitch[0]),
NULL,FALSE,0);
NULL,false,0);
if (cbSensorDroid(psDroid))
{
@ -2259,7 +2259,7 @@ void actionUpdateDroid(DROID *psDroid)
// align the turret
actionTargetTurret((BASE_OBJECT*)psDroid, psDroid->psActionTarget[0],
&(psDroid->turretRotation[0]), &(psDroid->turretPitch[0]),
NULL,FALSE,0);
NULL,false,0);
if (visibleObject((BASE_OBJECT *)psDroid, psDroid->psActionTarget[0]))
{
@ -2355,7 +2355,7 @@ void actionUpdateDroid(DROID *psDroid)
//Watermelon:use 0 for repair droid
if (actionTargetTurret((BASE_OBJECT*)psDroid,
psDroid->psActionTarget[0], &(psDroid->turretRotation[0]),
&(psDroid->turretPitch[0]), NULL, FALSE, 0))
&(psDroid->turretPitch[0]), NULL, false, 0))
{
if (droidStartDroidRepair(psDroid))
{
@ -2382,7 +2382,7 @@ void actionUpdateDroid(DROID *psDroid)
{
actionTargetTurret((BASE_OBJECT*)psDroid,
psDroid->psActionTarget[0], &(psDroid->turretRotation[0]),
&(psDroid->turretPitch[0]), NULL, FALSE, 0);
&(psDroid->turretPitch[0]), NULL, false, 0);
}
//check still next to the damaged droid
@ -2463,7 +2463,7 @@ void actionUpdateDroid(DROID *psDroid)
{
// got close to the rearm pad - now find a clear one
debug( LOG_NEVER, "Unit %d: seen rearm pad\n", psDroid->id );
psStruct = findNearestReArmPad(psDroid, (STRUCTURE *)psDroid->psActionTarget[0], TRUE);
psStruct = findNearestReArmPad(psDroid, (STRUCTURE *)psDroid->psActionTarget[0], true);
if (psStruct != NULL)
{
// found a clear landing pad - go for it
@ -2642,17 +2642,17 @@ static void actionDroidBase(DROID *psDroid, DROID_ACTION_DATA *psAction)
psDroid->action = DACTION_MOVETOATTACK;
actionCalcPullBackPoint((BASE_OBJECT *)psDroid, psAction->psObj, &pbx,&pby);
turnOffMultiMsg(TRUE);
turnOffMultiMsg(true);
moveDroidTo(psDroid, (UDWORD)pbx, (UDWORD)pby);
turnOffMultiMsg(FALSE);
turnOffMultiMsg(false);
}
}
else
{
psDroid->action = DACTION_MOVETOATTACK;
turnOffMultiMsg(TRUE);
turnOffMultiMsg(true);
moveDroidTo(psDroid, psAction->psObj->pos.x, psAction->psObj->pos.y);
turnOffMultiMsg(FALSE);
turnOffMultiMsg(false);
}
break;
@ -2923,7 +2923,7 @@ void moveToRearm(DROID *psDroid)
//get the droid to fly back to a ReArming Pad
// don't worry about finding a clear one for the minute
psStruct = findNearestReArmPad(psDroid, psDroid->psBaseStruct, FALSE);
psStruct = findNearestReArmPad(psDroid, psDroid->psBaseStruct, false);
if (psStruct)
{
// note a base rearm pad if the vtol doesn't have one
@ -2963,7 +2963,7 @@ static BOOL vtolLandingTile(SDWORD x, SDWORD y)
if (x < 0 || x >= (SDWORD)mapWidth ||
y < 0 || y >= (SDWORD)mapHeight)
{
return FALSE;
return false;
}
psTile = mapTile(x,y);
@ -2973,9 +2973,9 @@ static BOOL vtolLandingTile(SDWORD x, SDWORD y)
(terrainType(psTile) == TER_CLIFFFACE) ||
(terrainType(psTile) == TER_WATER))
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -3018,7 +3018,7 @@ BOOL actionVTOLLandingPos(DROID *psDroid, UDWORD *px, UDWORD *py)
}
/* Keep going until we get a tile or we exceed distance */
result = FALSE;
result = false;
while(passes<20)
{
/* Process whole box */
@ -3036,7 +3036,7 @@ BOOL actionVTOLLandingPos(DROID *psDroid, UDWORD *px, UDWORD *py)
debug( LOG_NEVER, "Unit %d landing pos (%d,%d)\n",psDroid->id, i,j);
*px = world_coord(i) + TILE_UNITS / 2;
*py = world_coord(j) + TILE_UNITS / 2;
result = TRUE;
result = true;
goto exit;
}
}

View File

@ -38,7 +38,7 @@
static UDWORD avConsidered;
static UDWORD avCalculated;
static UDWORD avIgnored;
static BOOL bRevealActive = FALSE;
static BOOL bRevealActive = false;
// ------------------------------------------------------------------------------------
@ -71,7 +71,7 @@ SDWORD lowerX,upperX,lowerY,upperY;
{
/* tile is off the grid, so force to maximum and finish */
psTile->level = psTile->illumination;
psTile->bMaxed = TRUE;
psTile->bMaxed = true;
}
}
else
@ -94,11 +94,11 @@ static void processAVTile(UDWORD x, UDWORD y)
return;
}
newLevel = psTile->level + timeAdjustedIncrement(FADE_IN_TIME, TRUE);
newLevel = psTile->level + timeAdjustedIncrement(FADE_IN_TIME, true);
if (newLevel >= psTile->illumination)
{
psTile->level = psTile->illumination;
psTile->bMaxed = TRUE;
psTile->bMaxed = true;
}
else
{
@ -209,13 +209,13 @@ MAPTILE *psTile;
psTile = mapTile(i,j);
if(TEST_TILE_VISIBLE(selectedPlayer,psTile))
{
psTile->bMaxed = TRUE;
psTile->bMaxed = true;
psTile->level = psTile->illumination;
}
else
{
psTile->level = -1;
psTile->bMaxed = FALSE;
psTile->bMaxed = false;
}
}
}

142
src/ai.c
View File

@ -49,15 +49,15 @@ BOOL aiCheckAlliances(UDWORD s1,UDWORD s2)
//features have their player number set to (MAX_PLAYERS + 1)
if ( s1 == (MAX_PLAYERS + 1) || s2 == (MAX_PLAYERS + 1))
{
return FALSE;
return false;
}
if ((s1 == s2) ||
(alliances[s1][s2] == ALLIANCE_FORMED))
{
return TRUE;
return true;
}
return FALSE;
return false;
}
/* Initialise the AI system */
@ -73,13 +73,13 @@ BOOL aiInitialise(void)
}
}
return TRUE;
return true;
}
/* Shutdown the AI system */
BOOL aiShutdown(void)
{
return TRUE;
return true;
}
// Find the best nearest target for a droid
@ -89,7 +89,7 @@ SDWORD aiBestNearestTarget(DROID *psDroid, BASE_OBJECT **ppsObj, int weapon_slot
UDWORD i;
SDWORD bestMod,newMod,failure=-1;
BASE_OBJECT *psTarget,*friendlyObj,*bestTarget,*targetInQuestion,*tempTarget;
BOOL electronic = FALSE;
BOOL electronic = false;
STRUCTURE *targetStructure;
WEAPON_EFFECT weaponEffect;
@ -271,7 +271,7 @@ static SDWORD targetAttackWeight(BASE_OBJECT *psTarget, BASE_OBJECT *psAttacker,
STRUCTURE *targetStructure=NULL;
WEAPON_EFFECT weaponEffect;
WEAPON_STATS *attackerWeapon;
BOOL bEmpWeap=FALSE,bCmdAttached=FALSE,bTargetingCmd=FALSE;
BOOL bEmpWeap=false,bCmdAttached=false,bTargetingCmd=false;
if (psTarget == NULL || psAttacker == NULL)
{
@ -309,7 +309,7 @@ static SDWORD targetAttackWeight(BASE_OBJECT *psTarget, BASE_OBJECT *psAttacker,
//see if this weapon is targeting our commander
if (psDroid->psActionTarget[weaponSlot] == (BASE_OBJECT *)psAttackerDroid->psGroup->psCommander)
{
bTargetingCmd = TRUE;
bTargetingCmd = true;
}
}
}
@ -324,7 +324,7 @@ static SDWORD targetAttackWeight(BASE_OBJECT *psTarget, BASE_OBJECT *psAttacker,
if( ((STRUCTURE *)psTarget)->psTarget[weaponSlot] ==
(BASE_OBJECT *)psAttackerDroid->psGroup->psCommander)
{
bTargetingCmd = TRUE;
bTargetingCmd = true;
}
}
}
@ -514,7 +514,7 @@ static BOOL aiStructHasRange(STRUCTURE *psStruct, BASE_OBJECT *psTarget, int wea
if (psStruct->numWeaps == 0 || psStruct->asWeaps[0].nStat == 0)
{
// Can't attack without a weapon
return FALSE;
return false;
}
psWStats = psStruct->asWeaps[weapon_slot].nStat + asWeaponStats;
@ -525,11 +525,11 @@ static BOOL aiStructHasRange(STRUCTURE *psStruct, BASE_OBJECT *psTarget, int wea
if (xdiff*xdiff + ydiff*ydiff < longRange*longRange)
{
// in range
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -538,16 +538,16 @@ static BOOL aiObjIsWall(BASE_OBJECT *psObj)
{
if (psObj->type != OBJ_STRUCTURE)
{
return FALSE;
return false;
}
if ( ((STRUCTURE *)psObj)->pStructureType->type != REF_WALL &&
((STRUCTURE *)psObj)->pStructureType->type != REF_WALLCORNER )
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -571,14 +571,14 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
case OBJ_DROID:
if (((DROID *)psObj)->asWeaps[weapon_slot].nStat == 0)
{
return FALSE;
return false;
}
if (((DROID *)psObj)->asWeaps[0].nStat == 0 &&
((DROID *)psObj)->droidType != DROID_SENSOR)
{
// Can't attack without a weapon
return FALSE;
return false;
}
radSquared = sensorRange * sensorRange;
break;
@ -586,7 +586,7 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
if (((STRUCTURE *)psObj)->numWeaps == 0 || ((STRUCTURE *)psObj)->asWeaps[0].nStat == 0)
{
// Can't attack without a weapon
return FALSE;
return false;
}
// increase the sensor range for AA sites
@ -637,7 +637,7 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
{
ASSERT(!isDead(psTarget), "aiChooseTarget: Droid found a dead target!");
*ppsTarget = psTarget;
return TRUE;
return true;
}
}
}
@ -654,14 +654,14 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
// see if there is a target from the command droids
psTarget = NULL;
psCommander = cmdDroidGetDesignator(psObj->player);
bCommanderBlock = FALSE;
bCommanderBlock = false;
if (!proj_Direct(psWStats) && (psCommander != NULL) &&
aiStructHasRange((STRUCTURE *)psObj, (BASE_OBJECT *)psCommander, weapon_slot))
{
// there is a commander that can fire designate for this structure
// set bCommanderBlock so that the structure does not fire until the commander
// has a target - (slow firing weapons will not be ready to fire otherwise).
bCommanderBlock = TRUE;
bCommanderBlock = true;
if (psCommander->action == DACTION_ATTACK
&& psCommander->psActionTarget[0] != NULL
&& !psCommander->psActionTarget[0]->died)
@ -675,7 +675,7 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
else
{
// target out of range - release the commander block
bCommanderBlock = FALSE;
bCommanderBlock = false;
}
}
}
@ -683,7 +683,7 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
// indirect fire structures use sensor towers first
tarDist = SDWORD_MAX;
minDist = psWStats->minRange * psWStats->minRange;
bCBTower = FALSE;
bCBTower = false;
if (psTarget == NULL &&
!bCommanderBlock &&
!proj_Direct(psWStats))
@ -733,7 +733,7 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
{
tarDist = distSq;
psTarget = psCStruct->psTarget[0];
bCBTower = TRUE;
bCBTower = true;
}
}
}
@ -782,11 +782,11 @@ BOOL aiChooseTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget, int weapon_slot
{
ASSERT(!psTarget->died, "aiChooseTarget: Structure found a dead target!");
*ppsTarget = psTarget;
return TRUE;
return true;
}
}
return FALSE;
return false;
}
@ -807,7 +807,7 @@ BOOL aiChooseSensorTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget)
location != LOC_TURRET)
{
// to be used for Turret Sensors only
return FALSE;
return false;
}
radSquared = sensorRange * sensorRange;
break;
@ -816,7 +816,7 @@ BOOL aiChooseSensorTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget)
structVTOLSensor((STRUCTURE *)psObj)))
{
// to be used for Standard and VTOL intercept Turret Sensors only
return FALSE;
return false;
}
radSquared = sensorRange * sensorRange;
break;
@ -836,7 +836,7 @@ BOOL aiChooseSensorTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget)
if (xdiff*xdiff + ydiff*ydiff < (SDWORD)radSquared)
{
*ppsTarget = psTarget;
return TRUE;
return true;
}
}
}
@ -874,11 +874,11 @@ BOOL aiChooseSensorTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget)
{
ASSERT(!psTemp->died, "aiChooseSensorTarget gave us a dead target");
*ppsTarget = psTemp;
return TRUE;
return true;
}
}
return FALSE;
return false;
}
/* Do the AI for a droid */
@ -891,20 +891,20 @@ void aiUpdateDroid(DROID *psDroid)
ASSERT( psDroid != NULL,
"updateUnitAI: invalid Unit pointer" );
lookForTarget = TRUE;
updateTarget = TRUE;
lookForTarget = true;
updateTarget = true;
// don't look for a target if sulking
if (psDroid->action == DACTION_SULK)
{
lookForTarget = FALSE;
updateTarget = FALSE;
lookForTarget = false;
updateTarget = false;
}
// don't look for a target if doing something else
if (!orderState(psDroid, DORDER_NONE) &&
!orderState(psDroid, DORDER_GUARD))
{
lookForTarget = FALSE;
lookForTarget = false;
}
/* Only try to update target if already have some target */
@ -913,21 +913,21 @@ void aiUpdateDroid(DROID *psDroid)
psDroid->action != DACTION_MOVETOATTACK &&
psDroid->action != DACTION_ROTATETOATTACK)
{
updateTarget = FALSE;
updateTarget = false;
}
/* Don't update target if we are sent to attack and reached
attack destination (attacking our target) */
if (orderState(psDroid, DORDER_ATTACK) && psDroid->psActionTarget[0] == psDroid->psTarget)
{
updateTarget = FALSE;
updateTarget = false;
}
// don't look for a target if there are any queued orders
if (psDroid->listSize > 0)
{
lookForTarget = FALSE;
updateTarget = FALSE;
lookForTarget = false;
updateTarget = false;
}
// horrible check to stop droids looking for a target if
@ -938,43 +938,43 @@ void aiUpdateDroid(DROID *psDroid)
secondaryGetState(psDroid, DSO_HALTTYPE, &state) &&
(state == DSS_HALT_GUARD))
{
lookForTarget = FALSE;
updateTarget = FALSE;
lookForTarget = false;
updateTarget = false;
}
// don't allow units to start attacking if they will switch to guarding the commander
if (psDroid->droidType != DROID_COMMAND && psDroid->psGroup != NULL &&
psDroid->psGroup->type == GT_COMMAND)
{
lookForTarget = FALSE;
updateTarget = FALSE;
lookForTarget = false;
updateTarget = false;
}
if(bMultiPlayer && vtolDroid(psDroid) && isHumanPlayer(psDroid->player))
{
lookForTarget = FALSE;
updateTarget = FALSE;
lookForTarget = false;
updateTarget = false;
}
// do not choose another target if doing anything while guarding
if (orderState(psDroid, DORDER_GUARD) &&
(psDroid->action != DACTION_NONE))
{
lookForTarget = FALSE;
lookForTarget = false;
}
// do not look for a target if droid is currently under direct control.
if(driveModeActive() && (psDroid == driveGetDriven())) {
lookForTarget = FALSE;
updateTarget = FALSE;
lookForTarget = false;
updateTarget = false;
}
// only computer sensor droids in the single player game aquire targets
if ((psDroid->droidType == DROID_SENSOR && psDroid->player == selectedPlayer)
&& !bMultiPlayer)
{
lookForTarget = FALSE;
updateTarget = FALSE;
lookForTarget = false;
updateTarget = false;
}
// do not attack if the attack level is wrong
@ -982,14 +982,14 @@ void aiUpdateDroid(DROID *psDroid)
{
if (state != DSS_ALEV_ALWAYS)
{
lookForTarget = FALSE;
lookForTarget = false;
}
}
/* Don't rebuild 'Naybor' list too often */
if(!CAN_UPDATE_NAYBORS(psDroid))
{
lookForTarget = FALSE;
lookForTarget = false;
}
/* For commanders and non-assigned non-commanders:
@ -1019,23 +1019,23 @@ void aiUpdateDroid(DROID *psDroid)
if (lookForTarget && !updateTarget)
{
turnOffMultiMsg(TRUE);
turnOffMultiMsg(true);
if (psDroid->droidType == DROID_SENSOR)
{
//Watermelon:only 1 target for sensor droid
if ( aiChooseTarget((BASE_OBJECT *)psDroid, &psTarget, 0, TRUE) )
if ( aiChooseTarget((BASE_OBJECT *)psDroid, &psTarget, 0, true) )
{
orderDroidObj(psDroid, DORDER_OBSERVE, psTarget);
}
}
else
{
if (aiChooseTarget((BASE_OBJECT *)psDroid, &psTarget, 0, TRUE))
if (aiChooseTarget((BASE_OBJECT *)psDroid, &psTarget, 0, true))
{
orderDroidObj(psDroid, DORDER_ATTACKTARGET, psTarget);
}
}
turnOffMultiMsg(FALSE);
turnOffMultiMsg(false);
}
}
@ -1044,12 +1044,12 @@ can fire on the propulsion type of the target*/
//Watermelon:added weapon_slot
BOOL validTarget(BASE_OBJECT *psObject, BASE_OBJECT *psTarget, int weapon_slot)
{
BOOL bTargetInAir, bValidTarget = FALSE;
BOOL bTargetInAir, bValidTarget = false;
UBYTE surfaceToAir;
if (!psTarget)
{
return FALSE;
return false;
}
//need to check propulsion type of target
@ -1061,22 +1061,22 @@ BOOL validTarget(BASE_OBJECT *psObject, BASE_OBJECT *psTarget, int weapon_slot)
{
if (((DROID *)psTarget)->sMove.Status != MOVEINACTIVE)
{
bTargetInAir = TRUE;
bTargetInAir = true;
}
else
{
bTargetInAir = FALSE;
bTargetInAir = false;
}
}
else
{
bTargetInAir = FALSE;
bTargetInAir = false;
}
break;
case OBJ_STRUCTURE:
default:
//lets hope so!
bTargetInAir = FALSE;
bTargetInAir = false;
break;
}
@ -1092,12 +1092,12 @@ BOOL validTarget(BASE_OBJECT *psObject, BASE_OBJECT *psTarget, int weapon_slot)
surfaceToAir = asWeaponStats[((DROID *)psObject)->asWeaps[weapon_slot].nStat].surfaceToAir;
if ( ((surfaceToAir & SHOOT_IN_AIR) && bTargetInAir) || ((surfaceToAir & SHOOT_ON_GROUND) && !bTargetInAir) )
{
return TRUE;
return true;
}
}
else
{
return FALSE;
return false;
}
/*
if (((DROID *)psObject)->asWeaps[0].nStat != 0 && ((DROID *)psObject)->numWeaps > 0)
@ -1125,7 +1125,7 @@ BOOL validTarget(BASE_OBJECT *psObject, BASE_OBJECT *psTarget, int weapon_slot)
if ( ((surfaceToAir & SHOOT_IN_AIR) && bTargetInAir) || ((surfaceToAir & SHOOT_ON_GROUND) && !bTargetInAir) )
{
return TRUE;
return true;
}
break;
default:
@ -1136,13 +1136,13 @@ BOOL validTarget(BASE_OBJECT *psObject, BASE_OBJECT *psTarget, int weapon_slot)
//if target is in the air and you can shoot in the air - OK
if (bTargetInAir && (surfaceToAir & SHOOT_IN_AIR))
{
bValidTarget = TRUE;
bValidTarget = true;
}
//if target is on the ground and can shoot at it - OK
if (!bTargetInAir && (surfaceToAir & SHOOT_ON_GROUND))
{
bValidTarget = TRUE;
bValidTarget = true;
}
return bValidTarget;
@ -1153,7 +1153,7 @@ BOOL updateAttackTarget(BASE_OBJECT * psAttacker, SDWORD weapon_slot)
{
BASE_OBJECT *psBetterTarget=NULL;
if(aiChooseTarget(psAttacker, &psBetterTarget, weapon_slot, TRUE)) //update target
if(aiChooseTarget(psAttacker, &psBetterTarget, weapon_slot, true)) //update target
{
if(psAttacker->type == OBJ_DROID)
{
@ -1178,8 +1178,8 @@ BOOL updateAttackTarget(BASE_OBJECT * psAttacker, SDWORD weapon_slot)
setStructureTarget(psBuilding, psBetterTarget, weapon_slot);
}
return TRUE;
return true;
}
return FALSE;
return false;
}

View File

@ -120,7 +120,7 @@ BOOL SaveAIExperience(BOOL bNotify)
(void)SavePlayerAIExperience(i, bNotify);
}
return TRUE;
return true;
}
SDWORD LoadPlayerAIExperience(SDWORD nPlayer)
@ -143,7 +143,7 @@ BOOL SavePlayerAIExperience(SDWORD nPlayer, BOOL bNotify)
//addConsoleMessage("Failed to save experience.",RIGHT_JUSTIFY,CONSOLE_SYSTEM);
console("Failed to save experience for player %d.", nPlayer);
return FALSE;
return false;
}
}
@ -152,7 +152,7 @@ BOOL SavePlayerAIExperience(SDWORD nPlayer, BOOL bNotify)
console("Experience for player %d saved successfully.", nPlayer);
}
return TRUE;
return true;
}
BOOL SetUpOutputFile(SDWORD nPlayer)
@ -174,7 +174,7 @@ BOOL SetUpOutputFile(SDWORD nPlayer)
if ( !PHYSFS_mkdir(SaveDir))
{
debug( LOG_ERROR, "SetUpOutputFile: Error creating directory \"%s\": %s", SaveDir, PHYSFS_getLastError() );
return FALSE;
return false;
}
strlcat(SaveDir, "/", sizeof(SaveDir));
@ -191,10 +191,10 @@ BOOL SetUpOutputFile(SDWORD nPlayer)
if (!aiSaveFile[nPlayer])
{
debug(LOG_ERROR,"SetUpOutputFile(): Couldn't open debugging output file: '%s' for player %d", FileName,nPlayer);
return FALSE;
return false;
}
return TRUE;
return true;
}
BOOL SetUpInputFile(SDWORD nPlayer)
@ -225,17 +225,17 @@ BOOL SetUpInputFile(SDWORD nPlayer)
if (!aiSaveFile[nPlayer])
{
debug(LOG_ERROR,"SetUpInputFile(): Couldn't open input file: '%s' for player %d: %s", FileName, nPlayer, PHYSFS_getLastError());
return FALSE;
return false;
}
return TRUE;
return true;
}
BOOL ExperienceRecallOil(SDWORD nPlayer)
{
FEATURE *psFeature;
return TRUE;
return true;
/* Make visible all oil derricks */
for(psFeature = apsFeatureLists[0]; psFeature != NULL; psFeature = psFeature->psNext)
@ -244,7 +244,7 @@ return TRUE;
{
printf_console("Enabling feature at x: %d y: %d",psFeature->pos.x/128,psFeature->pos.y/128);
psFeature->visible[nPlayer] = TRUE;
psFeature->visible[nPlayer] = true;
}
}
}
@ -264,7 +264,7 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(!SetUpOutputFile(nPlayer))
{
debug(LOG_ERROR,"Failed to prepare experience file for player %d",nPlayer);
return FALSE;
return false;
}
if (aiSaveFile[nPlayer])
@ -277,7 +277,7 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(PHYSFS_write(aiSaveFile[nPlayer], &NumEntries, sizeof(NumEntries), 1) != 1)
{
debug(LOG_ERROR,"WriteAISaveData: failed to write version for player %d",nPlayer);
return FALSE;
return false;
}
//fwrite(&NumEntries,sizeof(NumEntries),1,aiSaveFile[nPlayer]); //Version
@ -293,7 +293,7 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(PHYSFS_write(aiSaveFile[nPlayer], &NumEntries, sizeof(NumEntries), 1) != 1) //num of players to store
{
debug(LOG_ERROR,"WriteAISaveData: failed to write MAX_PLAYERS for player %d",nPlayer);
return FALSE;
return false;
}
//debug(LOG_ERROR,"WriteAISaveData - MAX_PLAYERS ok");
@ -302,7 +302,7 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(PHYSFS_write(aiSaveFile[nPlayer], baseLocation[nPlayer], sizeof(SDWORD), MAX_PLAYERS * 2) != (MAX_PLAYERS * 2)) //num of players to store
{
debug(LOG_ERROR,"WriteAISaveData: failed to write base locations for player %d",nPlayer);
return FALSE;
return false;
}
//debug(LOG_ERROR,"WriteAISaveData - Enemy bases ok");
@ -316,21 +316,21 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(PHYSFS_write(aiSaveFile[nPlayer], &NumEntries, sizeof(SDWORD), 1) < 1)
{
debug(LOG_ERROR,"WriteAISaveData: failed to write defence locations count for player %d",nPlayer);
return FALSE;
return false;
}
/* base defence locations */
if(PHYSFS_write(aiSaveFile[nPlayer], baseDefendLocation[nPlayer], sizeof(SDWORD), MAX_BASE_DEFEND_LOCATIONS * 2) < (MAX_BASE_DEFEND_LOCATIONS * 2))
{
debug(LOG_ERROR,"WriteAISaveData: failed to write defence locations for player %d",nPlayer);
return FALSE;
return false;
}
/* base defend priorities */
if(PHYSFS_write(aiSaveFile[nPlayer], baseDefendLocPrior[nPlayer], sizeof(SDWORD), MAX_BASE_DEFEND_LOCATIONS * 2) < (MAX_BASE_DEFEND_LOCATIONS * 2))
{
debug(LOG_ERROR,"WriteAISaveData: failed to write defence locations priority for player %d",nPlayer);
return FALSE;
return false;
}
//debug(LOG_ERROR,"WriteAISaveData - Base attack locations ok");
@ -344,21 +344,21 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(PHYSFS_write(aiSaveFile[nPlayer], &NumEntries, sizeof(SDWORD), 1) < 1)
{
debug(LOG_ERROR,"WriteAISaveData: failed to write oil defence locations count for player %d",nPlayer);
return FALSE;
return false;
}
/* oil locations */
if(PHYSFS_write(aiSaveFile[nPlayer], oilDefendLocation[nPlayer], sizeof(SDWORD), MAX_OIL_DEFEND_LOCATIONS * 2) < (MAX_OIL_DEFEND_LOCATIONS * 2))
{
debug(LOG_ERROR,"WriteAISaveData: failed to write oil defence locations for player %d",nPlayer);
return FALSE;
return false;
}
/* oil location priority */
if(PHYSFS_write(aiSaveFile[nPlayer], oilDefendLocPrior[nPlayer], sizeof(SDWORD), MAX_OIL_DEFEND_LOCATIONS * 2) < (MAX_OIL_DEFEND_LOCATIONS * 2))
{
debug(LOG_ERROR,"WriteAISaveData: failed to write oil defence locations priority for player %d",nPlayer);
return FALSE;
return false;
}
//debug(LOG_ERROR,"WriteAISaveData - Oil attack locations ok");
@ -373,7 +373,7 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(PHYSFS_write(aiSaveFile[nPlayer], &NumEntries, sizeof(NumEntries), 1) < 1)
{
debug(LOG_ERROR,"WriteAISaveData: failed to write oil locations count for player %d",nPlayer);
return FALSE;
return false;
}
NumEntries = 0; //Num of oil resources
@ -451,7 +451,7 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(PHYSFS_write(aiSaveFile[nPlayer], &NumEntries, sizeof(NumEntries), 1) < 1)
{
debug(LOG_ERROR,"WriteAISaveData: failed to write stored oil locations count for player %d",nPlayer);
return FALSE;
return false;
}
//printf_console("Num Oil Resources: %d ****",NumEntries);
@ -462,7 +462,7 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(PHYSFS_write(aiSaveFile[nPlayer], PosXY, sizeof(UDWORD), NumEntries * 2) < (NumEntries * 2))
{
debug(LOG_ERROR,"WriteAISaveData: failed to write oil locations fir player %d",nPlayer);
return FALSE;
return false;
}
}
@ -480,7 +480,7 @@ BOOL WriteAISaveData(SDWORD nPlayer)
if(PHYSFS_write(aiSaveFile[nPlayer], &bTileVisible, sizeof(BOOL), 1) < 1)
{
debug(LOG_ERROR,"WriteAISaveData: failed to write fog of war at tile %d-%d for player %d", i, j, nPlayer);
return FALSE;
return false;
}
}
}
@ -488,7 +488,7 @@ BOOL WriteAISaveData(SDWORD nPlayer)
else
{
debug(LOG_ERROR,"WriteAISaveData(): no output file for player %d",nPlayer);
return FALSE;
return false;
}
//printf_console("AI settings file written for player %d",nPlayer);
@ -509,10 +509,10 @@ BOOL canRecallOilAt(SDWORD nPlayer, SDWORD x, SDWORD y)
if(oilLocation[nPlayer][i][1] != y)
continue;
return TRUE; //yep, both matched
return true; //yep, both matched
}
return FALSE; //no
return false; //no
}
SDWORD ReadAISaveData(SDWORD nPlayer)
@ -669,7 +669,7 @@ SDWORD ReadAISaveData(SDWORD nPlayer)
for(i=0; i<NumEntries; i++)
{
Found = FALSE;
Found = false;
//re-read into remory
if(i < MAX_OIL_LOCATIONS) //didn't max out?
@ -689,8 +689,8 @@ SDWORD ReadAISaveData(SDWORD nPlayer)
{
//printf_console("Matched oil resource at x: %d y: %d", PosXY[i * 2]/128,PosXY[i * 2 + 1]/128);
psFeature->visible[nPlayer] = TRUE; //Make visible for AI
Found = TRUE;
psFeature->visible[nPlayer] = true; //Make visible for AI
Found = true;
break;
}
}
@ -748,8 +748,8 @@ BOOL OilResourceAt(UDWORD OilX,UDWORD OilY, SDWORD VisibleToPlayer)
{
printf_console("Matched oil resource at x: %d y: %d", OilX/128,OilY/128);
psFeature->visible[VisibleToPlayer] = TRUE; //Make visible for AI
Found = TRUE;
psFeature->visible[VisibleToPlayer] = true; //Make visible for AI
Found = true;
break;
}
}
@ -757,7 +757,7 @@ BOOL OilResourceAt(UDWORD OilX,UDWORD OilY, SDWORD VisibleToPlayer)
}
}
return TRUE;
return true;
}
@ -772,7 +772,7 @@ BOOL StoreBaseDefendLoc(SDWORD x, SDWORD y, SDWORD nPlayer)
if(index < 0) //this one is new
{
//find an empty element
found = FALSE;
found = false;
for(i=0; i < MAX_BASE_DEFEND_LOCATIONS; i++)
{
if(baseDefendLocation[nPlayer][i][0] < 0) //not initialized yet
@ -784,14 +784,14 @@ BOOL StoreBaseDefendLoc(SDWORD x, SDWORD y, SDWORD nPlayer)
baseDefendLocPrior[nPlayer][i] = 1;
found = TRUE;
found = true;
return TRUE;
return true;
}
}
addConsoleMessage("Base defense location - NO SPACE LEFT.",RIGHT_JUSTIFY,CONSOLE_SYSTEM);
return FALSE; //not enough space to store
return false; //not enough space to store
}
else //this one already stored
{
@ -805,7 +805,7 @@ BOOL StoreBaseDefendLoc(SDWORD x, SDWORD y, SDWORD nPlayer)
SortBaseDefendLoc(nPlayer); //now sort everything
}
return TRUE;
return true;
}
SDWORD GetBaseDefendLocIndex(SDWORD x, SDWORD y, SDWORD nPlayer)
@ -859,7 +859,7 @@ BOOL SortBaseDefendLoc(SDWORD nPlayer)
if(LowestIndex < 0)
{
//debug(LOG_ERROR,"sortBaseDefendLoc() - No lowest elem found");
return TRUE;
return true;
}
//swap
@ -884,7 +884,7 @@ BOOL SortBaseDefendLoc(SDWORD nPlayer)
SortBound--; //in any case lower the boundry, even if didn't swap
}
return TRUE;
return true;
}
void BaseExperienceDebug(SDWORD nPlayer)
@ -923,7 +923,7 @@ BOOL StoreOilDefendLoc(SDWORD x, SDWORD y, SDWORD nPlayer)
if(index < 0) //this one is new
{
//find an empty element
found = FALSE;
found = false;
for(i=0; i < MAX_OIL_DEFEND_LOCATIONS; i++)
{
if(oilDefendLocation[nPlayer][i][0] < 0) //not initialized yet
@ -935,14 +935,14 @@ BOOL StoreOilDefendLoc(SDWORD x, SDWORD y, SDWORD nPlayer)
oilDefendLocPrior[nPlayer][i] = 1;
found = TRUE;
found = true;
return TRUE;
return true;
}
}
addConsoleMessage("Oil defense location - NO SPACE LEFT.",RIGHT_JUSTIFY,CONSOLE_SYSTEM);
return FALSE; //not enough space to store
return false; //not enough space to store
}
else //this one already stored
{
@ -956,7 +956,7 @@ BOOL StoreOilDefendLoc(SDWORD x, SDWORD y, SDWORD nPlayer)
SortOilDefendLoc(nPlayer); //now sort everything
}
return TRUE;
return true;
}
SDWORD GetOilDefendLocIndex(SDWORD x, SDWORD y, SDWORD nPlayer)
@ -1008,7 +1008,7 @@ BOOL SortOilDefendLoc(SDWORD nPlayer)
if(LowestIndex < 0)
{
//debug(LOG_ERROR,"sortBaseDefendLoc() - No lowest elem found");
return TRUE;
return true;
}
//swap
@ -1033,53 +1033,53 @@ BOOL SortOilDefendLoc(SDWORD nPlayer)
SortBound--; //in any case lower the boundry, even if didn't swap
}
return TRUE;
return true;
}
BOOL CanRememberPlayerBaseLoc(SDWORD lookingPlayer, SDWORD enemyPlayer)
{
if(lookingPlayer < 0 || enemyPlayer < 0)
return FALSE;
return false;
if(lookingPlayer >= MAX_PLAYERS || enemyPlayer >= MAX_PLAYERS)
return FALSE;
return false;
if(baseLocation[lookingPlayer][enemyPlayer][0] <= 0)
return FALSE;
return false;
if(baseLocation[lookingPlayer][enemyPlayer][1] <= 0)
return FALSE;
return false;
return TRUE;
return true;
}
BOOL CanRememberPlayerBaseDefenseLoc(SDWORD player, SDWORD index)
{
if(player < 0)
return FALSE;
return false;
if(player >= MAX_PLAYERS)
return FALSE;
return false;
if(index < 0 || index >= MAX_BASE_DEFEND_LOCATIONS)
return FALSE;
return false;
if(baseDefendLocation[player][index][0] <= 0)
return FALSE;
return false;
if(baseDefendLocation[player][index][1] <= 0)
return FALSE;
return false;
return TRUE;
return true;
}
BOOL CanRememberPlayerOilDefenseLoc(SDWORD player, SDWORD index)
{
if(player < 0)
return FALSE;
return false;
if(player >= MAX_PLAYERS)
return FALSE;
return false;
if(index < 0 || index >= MAX_BASE_DEFEND_LOCATIONS)
return FALSE;
return false;
if(oilDefendLocation[player][index][0] <= 0)
return FALSE;
return false;
if(oilDefendLocation[player][index][1] <= 0)
return FALSE;
return false;
return TRUE;
return true;
}

View File

@ -96,11 +96,11 @@ BOOL astarInitialise(void)
apsNodes = (FP_NODE**)malloc(sizeof(FP_NODE *) * FPATH_TABLESIZE);
if (!apsNodes)
{
return FALSE;
return false;
}
ClearAstarNodes();
return TRUE;
return true;
}
// Shutdown the findpath routine
@ -343,17 +343,17 @@ static BOOL fpathVisCallback(SDWORD x, SDWORD y, SDWORD dist)
vy = y - finalY;
if (vx*vectorX + vy*vectorY <=0)
{
return FALSE;
return false;
}
if (fpathBlockingTile(map_coord(x), map_coord(y)))
{
// found an obstruction
obstruction = TRUE;
return FALSE;
obstruction = true;
return false;
}
return TRUE;
return true;
}
// Check los between two tiles
@ -370,7 +370,7 @@ BOOL fpathTileLOS(SDWORD x1,SDWORD y1, SDWORD x2,SDWORD y2)
finalY = y2;
vectorX = x1 - x2;
vectorY = y1 - y2;
obstruction = FALSE;
obstruction = false;
rayCast(x1,y1, rayPointsToAngle(x1,y1,x2,y2),
RAY_MAXLEN, fpathVisCallback);
@ -391,7 +391,7 @@ static void fpathOptimise(FP_NODE *psRoute)
do
{
// work down the route looking for a failed LOS
los = TRUE;
los = true;
psSearch = psCurr->psRoute;
while (psSearch)
{

View File

@ -162,9 +162,9 @@ void processParticle( ATPART *psPart )
if(!gamePaused())
{
/* Move the particle - frame rate controlled */
psPart->position.x += timeAdjustedIncrement(psPart->velocity.x, TRUE);
psPart->position.y += timeAdjustedIncrement(psPart->velocity.y, TRUE);
psPart->position.z += timeAdjustedIncrement(psPart->velocity.z, TRUE);
psPart->position.x += timeAdjustedIncrement(psPart->velocity.x, true);
psPart->position.y += timeAdjustedIncrement(psPart->velocity.y, true);
psPart->position.z += timeAdjustedIncrement(psPart->velocity.z, true);
/* Wrap it around if it's gone off grid... */
testParticleWrap(psPart);
@ -202,7 +202,7 @@ void processParticle( ATPART *psPart )
pos.z = psPart->position.z;
pos.y = groundHeight;
effectSetSize(60);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SPECIFIED,TRUE,getImdFromIndex(MI_SPLASH),0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SPECIFIED,true,getImdFromIndex(MI_SPLASH),0);
}
}
return;

View File

@ -58,7 +58,7 @@ audio_ObjectDead( void * psObj )
if ( psSimpleObj == NULL )
{
debug( LOG_NEVER, "audio_ObjectDead: simple object pointer invalid\n" );
return TRUE;
return true;
}
/* check projectiles */
@ -68,17 +68,17 @@ audio_ObjectDead( void * psObj )
if ( psProj == NULL )
{
debug( LOG_NEVER, "audio_ObjectDead: projectile object pointer invalid\n" );
return TRUE;
return true;
}
else
{
if ( psProj->state == PROJ_POSTIMPACT )
{
return TRUE;
return true;
}
else
{
return FALSE;
return false;
}
}
}
@ -91,7 +91,7 @@ audio_ObjectDead( void * psObj )
if ( psBaseObj == NULL )
{
debug( LOG_NEVER, "audio_ObjectDead: base object pointer invalid\n" );
return TRUE;
return true;
}
else
{

View File

@ -60,7 +60,7 @@ typedef enum _object_type
UDWORD lastHitWeapon; /**< The weapon that last hit it */ \
UDWORD timeLastHit; /**< The time the structure was last attacked */ \
UDWORD body; /**< Hit points with lame name */ \
BOOL inFire; /**< TRUE if the object is in a fire */ \
BOOL inFire; /**< true if the object is in a fire */ \
UDWORD burnStart; /**< When the object entered the fire */ \
UDWORD burnDamage; /**< How much damage has been done since the object entered the fire */ \
SDWORD sensorPower; /**< Active sensor power */ \

View File

@ -44,8 +44,8 @@
*/
/*
Returns TRUE or FALSE as to whether a bridge is valid.
For it to be TRUE - all intervening points must be lower than the start
Returns true or false as to whether a bridge is valid.
For it to be true - all intervening points must be lower than the start
and end points. We can also check other stuff here like what it's going
over. Also, it has to be between a minimum and maximum length and
one of the axes must share the same values.
@ -58,15 +58,15 @@ UDWORD startHeight,endHeight,sectionHeight;
UDWORD i;
/* Establish axes allignment */
xBridge = ( (startX == endX) ? TRUE : FALSE );
yBridge = ( (startY == endY) ? TRUE : FALSE );
xBridge = ( (startX == endX) ? true : false );
yBridge = ( (startY == endY) ? true : false );
/* At least one axis must be constant */
if (!xBridge && !yBridge)
{
/* Bridge isn't straight - this shouldn't have been passed
in, but better safe than sorry! */
return(FALSE);
return(false);
}
/* Get the bridge length */
@ -76,7 +76,7 @@ UDWORD i;
if(bridgeLength<MINIMUM_BRIDGE_SPAN || bridgeLength>MAXIMUM_BRIDGE_SPAN)
{
/* Cry out */
return(FALSE);
return(false);
}
/* Check intervening tiles to see if they're lower
@ -97,11 +97,11 @@ UDWORD i;
if( sectionHeight > MAX(startHeight,endHeight) )
{
/* Cry out */
return(FALSE);
return(false);
}
}
/* Everything's just fine */
return(TRUE);
return(true);
}
@ -122,7 +122,7 @@ BOOL renderBridgeSection(STRUCTURE *psStructure)
/* Bomb out if it's not visible and there's no active god mode */
if(!psStructure->visible[selectedPlayer] && !godMode)
{
return(FALSE);
return(false);
}
/* Get it's x and y coordinates so we don't have to deref. struct later */
@ -151,7 +151,7 @@ BOOL renderBridgeSection(STRUCTURE *psStructure)
pie_Draw3DShape(psStructure->sDisplay.imd, 0, 0, WZCOL_WHITE, WZCOL_BLACK, 0, 0);
pie_MatEnd();
return(TRUE);
return(true);
}
/*
@ -177,13 +177,13 @@ BOOL startHigher;
endHeight = map_TileHeight(endX,endY);
/* Find out which is higher */
startHigher = (startHeight>=endHeight ? TRUE : FALSE);
startHigher = (startHeight>=endHeight ? true : false);
/* If the start position is higher */
if(startHigher)
{
/* Inform structure */
info->startHighest = TRUE;
info->startHighest = true;
/* And the end position needs raising */
info->heightChange = startHeight - endHeight;
@ -192,7 +192,7 @@ BOOL startHigher;
else
{
/* Inform structure */
info->startHighest = FALSE;
info->startHighest = false;
/* So we need to raise the start position */
info->heightChange = endHeight - startHeight;
}
@ -200,8 +200,8 @@ BOOL startHigher;
/* Establish axes allignment */
/* Only one of these can occur otherwise
bridge is one square big */
xBridge = ( (startX == endX) ? TRUE : FALSE );
yBridge = ( (startY == endY) ? TRUE : FALSE );
xBridge = ( (startX == endX) ? true : false );
yBridge = ( (startY == endY) ? true : false );
/*
Set the bridge's height.
@ -222,13 +222,13 @@ BOOL startHigher;
/* We've got a bridge of constant X */
if(xBridge)
{
info->bConstantX = TRUE;
info->bConstantX = true;
info->bridgeLength = abs(startY-endY);
}
/* We've got a bridge of constant Y */
else if(yBridge)
{
info->bConstantX = FALSE;
info->bConstantX = false;
info->bridgeLength = abs(startX-endX);
}
else
@ -255,7 +255,7 @@ void testBuildBridge(UDWORD startX, UDWORD startY, UDWORD endX, UDWORD endY)
dv.x = ((bridge.startX*128)+64);
dv.z = ((i*128)+64);
dv.y = bridge.bridgeHeight;
addEffect(&dv,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING,FALSE,NULL,0);
addEffect(&dv,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING,false,NULL,0);
// addExplosion(&dv,TYPE_EXPLOSION_SMOKE_CLOUD,NULL);
}
}
@ -266,7 +266,7 @@ void testBuildBridge(UDWORD startX, UDWORD startY, UDWORD endX, UDWORD endY)
dv.x = ((i*128)+64);
dv.z = ((bridge.startY*128)+64);
dv.y = bridge.bridgeHeight;
addEffect(&dv,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING,FALSE,NULL,0);
addEffect(&dv,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING,false,NULL,0);
// addExplosion(&dv,TYPE_EXPLOSION_SMOKE_CLOUD,NULL);
}
}
@ -292,7 +292,7 @@ void testBuildBridge(UDWORD startX, UDWORD startY, UDWORD endX, UDWORD endY)
dv.x = ((bridge.startX*128)+64);
dv.z = ((i*128)+64);
dv.y = bridge.bridgeHeight;
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
// addExplosion(&dv,TYPE_EXPLOSION_MED,NULL);
}
}
@ -303,7 +303,7 @@ void testBuildBridge(UDWORD startX, UDWORD startY, UDWORD endX, UDWORD endY)
dv.x = ((i*128)+64);
dv.z = ((bridge.startY*128)+64);
dv.y = bridge.bridgeHeight;
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
// addExplosion(&dv,TYPE_EXPLOSION_MED,NULL);
}
}

View File

@ -98,7 +98,7 @@ BOOL bucketSetupList(void)
{
bucketArray[i] = NULL;
}
return TRUE;
return true;
}
/* add an object to the current render list */
@ -113,7 +113,7 @@ extern BOOL bucketAddTypeToList(RENDER_TYPE objectType, void* pObject)
{
debug(LOG_NEVER, "bucket sort too many objects");
/* Just get out if there's too much to render already...! */
return(TRUE);
return(true);
}
resourceCounter++;
ASSERT( resourceCounter <= NUM_OBJECTS, "bucketAddTypeToList: too many objects" );
@ -166,7 +166,7 @@ extern BOOL bucketAddTypeToList(RENDER_TYPE objectType, void* pObject)
psStructure->sDisplay.frameNumber = 0;
}
return TRUE;
return true;
}
/* Maintain biggest*/
@ -201,7 +201,7 @@ extern BOOL bucketAddTypeToList(RENDER_TYPE objectType, void* pObject)
newTag->actualZ = z;
bucketArray[z] = newTag;
return TRUE;
return true;
}
@ -261,7 +261,7 @@ extern BOOL bucketRenderCurrentList(void)
zMin = SDWORD_MAX;
worldMax = SDWORD_MIN;
worldMin = SDWORD_MAX;
return TRUE;
return true;
}
static SDWORD bucketCalculateZ(RENDER_TYPE objectType, void* pObject)

View File

@ -88,7 +88,7 @@ BOOL attemptCheatCode(const char* cheat_name)
/* We've got our man... */
cheatCodes[index].function(); // run it
/* And get out of here */
return(TRUE);
return(true);
}
index++;
}
@ -102,5 +102,5 @@ BOOL attemptCheatCode(const char* cheat_name)
addConsoleMessage(errorString, LEFT_JUSTIFY,CONSOLE_SYSTEM);
}
return(FALSE);
return(false);
}

View File

@ -53,7 +53,7 @@ extern char * campaign_mods[MAX_MODS];
extern char * multiplay_mods[MAX_MODS];
//! Let the end user into debug mode....
BOOL bAllowDebugMode = FALSE;
BOOL bAllowDebugMode = false;
typedef enum
{
@ -144,7 +144,7 @@ static const struct poptOption* getOptionsTable()
* set up first.
* \param argc number of arguments given
* \param argv string array of the arguments
* \return Returns TRUE on success, FALSE on error */
* \return Returns true on success, false on error */
bool ParseCommandLineEarly(int argc, const char** argv)
{
poptContext poptCon = poptGetContext(NULL, argc, argv, getOptionsTable(), 0);
@ -237,7 +237,7 @@ bool ParseCommandLineEarly(int argc, const char** argv)
* the first half. Note that render mode must come before resolution flag.
* \param argc number of arguments given
* \param argv string array of the arguments
* \return Returns TRUE on success, FALSE on error */
* \return Returns true on success, false on error */
bool ParseCommandLine(int argc, const char** argv)
{
poptContext poptCon = poptGetContext(NULL, argc, argv, getOptionsTable(), 0);
@ -262,7 +262,7 @@ bool ParseCommandLine(int argc, const char** argv)
case CLI_CHEAT:
printf(" ** DEBUG MODE UNLOCKED! **\n");
bAllowDebugMode = TRUE;
bAllowDebugMode = true;
break;
case CLI_DATADIR:
@ -278,7 +278,7 @@ bool ParseCommandLine(int argc, const char** argv)
break;
case CLI_FULLSCREEN:
war_setFullscreen(TRUE);
war_setFullscreen(true);
break;
case CLI_GAME:
@ -381,7 +381,7 @@ bool ParseCommandLine(int argc, const char** argv)
{
debug(LOG_ERROR, "Invalid resolution");
abort();
return FALSE;
return false;
}
// tell the display system of the desired resolution
pie_SetVideoBufferWidth(width);
@ -406,23 +406,23 @@ bool ParseCommandLine(int argc, const char** argv)
break;
case CLI_WINDOW:
war_setFullscreen(FALSE);
war_setFullscreen(false);
break;
case CLI_SHADOWS:
setDrawShadows(TRUE);
setDrawShadows(true);
break;
case CLI_NOSHADOWS:
setDrawShadows(FALSE);
setDrawShadows(false);
break;
case CLI_SOUND:
war_setSoundEnabled(TRUE);
war_setSoundEnabled(true);
break;
case CLI_NOSOUND:
war_setSoundEnabled(FALSE);
war_setSoundEnabled(false);
break;
};
}

View File

@ -115,7 +115,7 @@ void clusterUpdate(void)
{
scrCBEmptyClusterID = i;
eventFireCallbackTrigger((TRIGGER_TYPE)CALL_CLUSTER_EMPTY);
aClusterEmpty[i] = FALSE;
aClusterEmpty[i] = false;
}
}
}
@ -168,7 +168,7 @@ void clustRemoveObject(BASE_OBJECT *psObj)
// debug( LOG_NEVER, "Cluster %d empty: ", i );
// debug( LOG_NEVER, "%s ", (psObj->type == OBJ_DROID) ? "Unit" : ( (psObj->type == OBJ_STRUCTURE) ? "Struct" : "Feat") );
// debug( LOG_NEVER, "id %d player %d\n", psObj->id, psObj->player );
aClusterEmpty[i] = TRUE;
aClusterEmpty[i] = true;
}
}
}
@ -358,7 +358,7 @@ void clustDisplay(void)
cluster = aClusterMap[map];
if (cluster != 0)
{
found = FALSE;
found = false;
for(player = 0; player < MAX_PLAYERS; player++)
{
// if (player == (SDWORD)selectedPlayer)
@ -377,7 +377,7 @@ void clustDisplay(void)
// found a cluster print it out
sprintf(aBuff, "Unit cluster %d (%d), ", map, cluster);
sprintf(aBuff + strlen(aBuff), "player %d:", psDroid->player);
found = TRUE;
found = true;
}
if (strlen(aBuff) < 250)
@ -398,7 +398,7 @@ void clustDisplay(void)
// found a cluster print it out
sprintf(aBuff, "struct cluster %d (%d), ", map, cluster);
sprintf(aBuff + strlen(aBuff), "player %d:", psStruct->player);
found = TRUE;
found = true;
}
if (strlen(aBuff) < 250)
@ -428,7 +428,7 @@ void clustUpdateObject(BASE_OBJECT * psObj)
oldCluster = psObj->cluster;
// update the cluster map
found = FALSE;
found = false;
if (oldCluster != 0)
{
for(i=0; i<CLUSTER_MAX; i++)
@ -451,7 +451,7 @@ void clustUpdateObject(BASE_OBJECT * psObj)
aClusterVisibility[newCluster] |= 1 << player;
}
}
found = TRUE;
found = true;
break;
}
}

View File

@ -40,7 +40,7 @@ extern UDWORD selectedPlayer;
DROID *apsCmdDesignator[MAX_PLAYERS];
// whether experience should be boosted due to a multi game
static BOOL bMultiExpBoost = FALSE;
static BOOL bMultiExpBoost = false;
// Initialise the command droids
@ -48,7 +48,7 @@ BOOL cmdDroidInit(void)
{
memset(apsCmdDesignator, 0, sizeof(DROID *)*MAX_PLAYERS);
return TRUE;
return true;
}
@ -223,7 +223,7 @@ DROID *psCurr;
{
if(psCurr->psGroup->psCommander == psDroid)
{
// psCurr->selected = TRUE;
// psCurr->selected = true;
SelectDroid(psCurr);
}
}

View File

@ -80,14 +80,14 @@ static BUL_DIR aScatterDir[BUL_MAXSCATTERDIR] =
/* Initialise the combat system */
BOOL combInitialise(void)
{
return TRUE;
return true;
}
/* Shutdown the combat system */
BOOL combShutdown(void)
{
return TRUE;
return true;
}
// Watermelon:real projectile
@ -372,7 +372,7 @@ void combFire(WEAPON *psWeap, BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, in
}
debug(LOG_SENSOR, "combFire: Accurate prediction range (%d)", dice);
if (!proj_SendProjectile(psWeap, psAttacker, psAttacker->player,
predictX, predictY, psTarget->pos.z, psTarget, FALSE, FALSE, weapon_slot))
predictX, predictY, psTarget->pos.z, psTarget, false, false, weapon_slot))
{
/* Out of memory - we can safely ignore this */
debug(LOG_ERROR, "Out of memory");
@ -402,7 +402,7 @@ missed:
/* Fire off the bullet to the miss location. The miss is only visible if the player owns
* the target. (Why? - Per) */
proj_SendProjectile(psWeap, psAttacker, psAttacker->player, missX,missY, psTarget->pos.z, NULL,
psTarget->player == selectedPlayer, FALSE, weapon_slot);
psTarget->player == selectedPlayer, false, weapon_slot);
return;
}
@ -507,12 +507,12 @@ float objDamage(BASE_OBJECT *psObj, UDWORD damage, UDWORD originalhp, UDWORD wea
if (psObj->player != selectedPlayer)
{
// Player inflicting damage on enemy.
damage = (UDWORD) modifyForDifficultyLevel(damage,TRUE);
damage = (UDWORD) modifyForDifficultyLevel(damage,true);
}
else
{
// Enemy inflicting damage on player.
damage = (UDWORD) modifyForDifficultyLevel(damage,FALSE);
damage = (UDWORD) modifyForDifficultyLevel(damage,false);
}
armour = psObj->armour[impactSide][weaponClass];

View File

@ -86,10 +86,10 @@ BOOL setPlayerColour(UDWORD player, UDWORD col)
{
debug( LOG_ERROR, "setplayercolour: wrong values" );
abort();
return FALSE;
return false;
}
PlayerColour[(UBYTE)player] = (UBYTE)col;
return TRUE;
return true;
}
UBYTE getPlayerColour(UDWORD pl)
@ -256,7 +256,7 @@ void displayIMDButton(iIMDShape *IMDShape, Vector3i *Rotation, Vector3i *Positio
setMatrix(Position,Rotation,&TmpCamPos,RotXYZ);
pie_MatScale(scale);
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
pie_Draw3DShape(IMDShape, 0, getPlayerColour(selectedPlayer), WZCOL_WHITE, WZCOL_BLACK, pie_BUTTON, 0);
unsetMatrix();
}
@ -668,11 +668,11 @@ void displayComponentButtonTemplate(DROID_TEMPLATE *psTemplate, Vector3i *Rotati
if((difference>0 && difference <180) || difference<-180)
{
leftFirst = FALSE;
leftFirst = false;
}
else
{
leftFirst = TRUE;
leftFirst = true;
}
droidSetBits(psTemplate,&Droid);
@ -681,7 +681,7 @@ void displayComponentButtonTemplate(DROID_TEMPLATE *psTemplate, Vector3i *Rotati
Droid.pos.x = Droid.pos.y = Droid.pos.z = 0;
//draw multi component object as a button object
displayCompObj((BASE_OBJECT*)&Droid, TRUE);
displayCompObj((BASE_OBJECT*)&Droid, true);
unsetMatrix();
@ -703,16 +703,16 @@ void displayComponentButtonObject(DROID *psDroid, Vector3i *Rotation, Vector3i *
if((difference>0 && difference <180) || difference<-180)
{
leftFirst = FALSE;
leftFirst = false;
}
else
{
leftFirst = TRUE;
leftFirst = true;
}
// And render the composite object.
//draw multi component object as a button object
displayCompObj((BASE_OBJECT*)psDroid, TRUE);
displayCompObj((BASE_OBJECT*)psDroid, true);
unsetMatrix();
}
@ -739,11 +739,11 @@ void displayComponentObject(BASE_OBJECT *psObj)
if((difference>0 && difference <180) || difference<-180)
{
leftFirst = FALSE;
leftFirst = false;
}
else
{
leftFirst = TRUE;
leftFirst = true;
}
/* Push the matrix */
@ -794,14 +794,14 @@ void displayComponentObject(BASE_OBJECT *psObj)
position.y = psDroid->pos.z + rand()%8;;
position.z = psDroid->pos.y + DROID_EMP_SPREAD;
effectGiveAuxVar(90+rand()%20);
addEffect(&position,EFFECT_EXPLOSION,EXPLOSION_TYPE_PLASMA,FALSE,NULL,0);
addEffect(&position,EFFECT_EXPLOSION,EXPLOSION_TYPE_PLASMA,false,NULL,0);
}
if (godMode || (psDroid->visible[selectedPlayer] == UBYTE_MAX) || demoGetStatus())
{
//ingame not button object
//Watermelon:should render 3 mounted weapons now
displayCompObj(psObj,FALSE);
displayCompObj(psObj,false);
}
else
{
@ -841,7 +841,7 @@ void displayCompObj(BASE_OBJECT *psObj, BOOL bButton)
PIELIGHT brightness;
const PIELIGHT specular = WZCOL_BLACK;
UDWORD colour;
UDWORD bDarkSide = FALSE;
UDWORD bDarkSide = false;
UBYTE i;
/* Cast the droid pointer */
@ -849,7 +849,7 @@ void displayCompObj(BASE_OBJECT *psObj, BOOL bButton)
if( (gameTime-psDroid->timeLastHit < GAME_TICKS_PER_SEC/4 ) && psDroid->lastHitWeapon == WSC_ELECTRONIC && !gamePaused())
{
colour = getPlayerColour(rand()%MAX_PLAYERS);
bDarkSide = TRUE;
bDarkSide = true;
}
else
{
@ -918,7 +918,7 @@ void displayCompObj(BASE_OBJECT *psObj, BOOL bButton)
if ( psDroid->droidType == DROID_PERSON)
{
/* draw body if not animating */
if ( psDroid->psCurAnim == NULL || psDroid->psCurAnim->bVisible == FALSE )
if ( psDroid->psCurAnim == NULL || psDroid->psCurAnim->bVisible == false )
{
// FIXME - hideous....!!!!
pie_MatScale(75);
@ -929,7 +929,7 @@ void displayCompObj(BASE_OBJECT *psObj, BOOL bButton)
else if (cyborgDroid(psDroid))
{
/* draw body if cyborg not animating */
if ( psDroid->psCurAnim == NULL || psDroid->psCurAnim->bVisible == FALSE )
if ( psDroid->psCurAnim == NULL || psDroid->psCurAnim->bVisible == false )
{
pie_Draw3DShape(psShapeTemp, 0, colour, brightness, specular, pieFlag, iPieData);
}
@ -1453,11 +1453,11 @@ void destroyFXDroid(DROID *psDroid)
}
if(psImd)
{
addEffect(&pos,EFFECT_GRAVITON,GRAVITON_TYPE_EMITTING_DR,TRUE,psImd,getPlayerColour(psDroid->player));
addEffect(&pos,EFFECT_GRAVITON,GRAVITON_TYPE_EMITTING_DR,true,psImd,getPlayerColour(psDroid->player));
}
else
{
addEffect(&pos,EFFECT_GRAVITON,GRAVITON_TYPE_EMITTING_DR,TRUE,getRandomDebrisImd(),0);
addEffect(&pos,EFFECT_GRAVITON,GRAVITON_TYPE_EMITTING_DR,true,getRandomDebrisImd(),0);
}
}
}
@ -1501,10 +1501,10 @@ void compPersonToBits(DROID *psDroid)
/* Tell about player colour */
col = getPlayerColour(psDroid->player);
addEffect(&position,EFFECT_GRAVITON,GRAVITON_TYPE_GIBLET,TRUE,headImd,col);
addEffect(&position,EFFECT_GRAVITON,GRAVITON_TYPE_GIBLET,TRUE,legsImd,col);
addEffect(&position,EFFECT_GRAVITON,GRAVITON_TYPE_GIBLET,TRUE,armImd,col);
addEffect(&position,EFFECT_GRAVITON,GRAVITON_TYPE_GIBLET,TRUE,bodyImd,col);
addEffect(&position,EFFECT_GRAVITON,GRAVITON_TYPE_GIBLET,true,headImd,col);
addEffect(&position,EFFECT_GRAVITON,GRAVITON_TYPE_GIBLET,true,legsImd,col);
addEffect(&position,EFFECT_GRAVITON,GRAVITON_TYPE_GIBLET,true,armImd,col);
addEffect(&position,EFFECT_GRAVITON,GRAVITON_TYPE_GIBLET,true,bodyImd,col);
}

View File

@ -113,9 +113,9 @@ BOOL loadConfig(void)
else
{
#ifdef DEBUG
bAllowDebugMode = TRUE;
bAllowDebugMode = true;
#else
bAllowDebugMode = FALSE;
bAllowDebugMode = false;
#endif
setWarzoneKeyNumeric("debugmode", bAllowDebugMode);
}
@ -141,8 +141,8 @@ BOOL loadConfig(void)
}
else
{
showFPS = FALSE;
setWarzoneKeyNumeric("showFPS", FALSE);
showFPS = false;
setWarzoneKeyNumeric("showFPS", false);
}
// //////////////////////////
@ -183,8 +183,8 @@ BOOL loadConfig(void)
}
else
{
setShakeStatus(FALSE);
setWarzoneKeyNumeric("shake", FALSE);
setShakeStatus(false);
setWarzoneKeyNumeric("shake", false);
}
// //////////////////////////
@ -195,8 +195,8 @@ BOOL loadConfig(void)
}
else
{
setDrawShadows(TRUE);
setWarzoneKeyNumeric("shadows", TRUE);
setDrawShadows(true);
setWarzoneKeyNumeric("shadows", true);
}
// //////////////////////////
@ -207,8 +207,8 @@ BOOL loadConfig(void)
}
else
{
war_setSoundEnabled( TRUE );
setWarzoneKeyNumeric( "sound", TRUE );
war_setSoundEnabled( true );
setWarzoneKeyNumeric( "sound", true );
}
// //////////////////////////
@ -219,8 +219,8 @@ BOOL loadConfig(void)
}
else
{
setInvertMouseStatus(TRUE);
setWarzoneKeyNumeric("mouseflip", TRUE);
setInvertMouseStatus(true);
setWarzoneKeyNumeric("mouseflip", true);
}
if (getWarzoneKeyString("masterserver_name", sBuf))
@ -272,7 +272,7 @@ BOOL loadConfig(void)
}
else
{
seq_SetSubtitles(TRUE);
seq_SetSubtitles(true);
}
// //////////////////////////
@ -294,19 +294,19 @@ BOOL loadConfig(void)
{
if(val)
{
war_SetFog(FALSE);
avSetStatus(TRUE);
war_SetFog(false);
avSetStatus(true);
}
else
{
avSetStatus(FALSE);
war_SetFog(TRUE);
avSetStatus(false);
war_SetFog(true);
}
}
else
{
avSetStatus(FALSE);
war_SetFog(TRUE);
avSetStatus(false);
war_SetFog(true);
setWarzoneKeyNumeric("visfog", 0);
}
@ -334,8 +334,8 @@ BOOL loadConfig(void)
}
else
{
intReopenBuild(TRUE);
setWarzoneKeyNumeric("reopenBuild", TRUE);
intReopenBuild(true);
setWarzoneKeyNumeric("reopenBuild", true);
}
// /////////////////////////
@ -394,7 +394,7 @@ BOOL loadConfig(void)
}
else
{
game.fog= TRUE;
game.fog= true;
setWarzoneKeyNumeric("fog", game.fog);
}
@ -466,7 +466,7 @@ BOOL loadConfig(void)
{
bEnemyAllyRadarColor =(BOOL)val;
} else {
bEnemyAllyRadarColor = FALSE;
bEnemyAllyRadarColor = false;
setWarzoneKeyNumeric("radarObjectMode", (SDWORD)bEnemyAllyRadarColor);
}
@ -502,15 +502,15 @@ BOOL loadRenderMode(void)
bool bad_resolution = false;
if( !openWarzoneKey() ) {
return FALSE;
return false;
}
if( getWarzoneKeyNumeric("fullscreen", &val) ) {
war_setFullscreen(val);
} else {
// If no setting is found go to fullscreen by default
setWarzoneKeyNumeric("fullscreen", TRUE);
war_setFullscreen(TRUE);
setWarzoneKeyNumeric("fullscreen", true);
war_setFullscreen(true);
}
if (getWarzoneKeyNumeric("trapCursor", &val))
@ -519,7 +519,7 @@ BOOL loadRenderMode(void)
}
else
{
war_SetTrapCursor(FALSE);
war_SetTrapCursor(false);
}
// now load the desired res..
@ -569,7 +569,7 @@ BOOL saveConfig(void)
if(!openWarzoneKey())
{
return FALSE;
return false;
}
// //////////////////////////

View File

@ -43,7 +43,7 @@
/* Alex McLean, Pumpkin Studios, EIDOS Interactive */
/** Is the console history on or off? */
static BOOL bConsoleDropped = FALSE;
static BOOL bConsoleDropped = false;
/** Stores the console dimensions and states */
static CONSOLE mainConsole;
@ -145,7 +145,7 @@ void initConsoleMessages( void )
lastDropChange = 0;
bConsoleDropped = FALSE;
bConsoleDropped = false;
/* Linked list is empty */
consoleMessages = NULL;
@ -154,10 +154,10 @@ void initConsoleMessages( void )
setConsoleMessageDuration(DEFAULT_MESSAGE_DURATION);
/* No box under the text */
setConsoleBackdropStatus(TRUE);
setConsoleBackdropStatus(true);
/* Turn on the console display */
enableConsoleDisplay(TRUE);
enableConsoleDisplay(true);
/* Set left justification as default */
setDefaultConsoleJust(LEFT_JUSTIFY);
@ -169,21 +169,21 @@ void initConsoleMessages( void )
setConsoleLineInfo(MAX_CONSOLE_MESSAGES/4 + 4);
/* We're not initially having permanent messages */
setConsolePermanence(FALSE,TRUE);
setConsolePermanence(false,true);
/* Allow new messages */
permitNewConsoleMessages(TRUE);
permitNewConsoleMessages(true);
}
/** Open the console when it's closed and close it when it's open. */
void toggleConsoleDrop( void )
{
/* If it's closed ... */
if(bConsoleDropped == FALSE)
if(bConsoleDropped == false)
{
dropState = DROP_DROPPING;
consoleDrop = 0;
bConsoleDropped = TRUE;
bConsoleDropped = true;
audio_PlayTrack(ID_SOUND_WINDOWOPEN);
}
@ -205,13 +205,13 @@ static BOOL _addConsoleMessage(const char *messageText, CONSOLE_TEXT_JUSTIFICATI
/* Just don't add it if there's too many already */
if(numActiveMessages>=MAX_CONSOLE_MESSAGES-1)
{
return FALSE;
return false;
}
/* Don't allow it to be added if we've disabled adding of new messages */
if(!allowNewMessages)
{
return FALSE ;
return false ;
}
/* Is the string too long? */
@ -290,7 +290,7 @@ static BOOL _addConsoleMessage(const char *messageText, CONSOLE_TEXT_JUSTIFICATI
/* There's one more active console message */
numActiveMessages++;
return TRUE;
return true;
}
/// Wrapper for _addConsoleMessage
@ -335,7 +335,7 @@ void updateConsoleMessages( void )
else
{
dropState = DROP_CLOSED;
bConsoleDropped = FALSE;
bConsoleDropped = false;
}
}
}
@ -494,7 +494,7 @@ void displayConsoleMessages( void )
linePitch = iV_GetTextLineSize();
pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_ON);
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
drop = 0;
if(bConsoleDropped)
@ -575,14 +575,14 @@ int displayOldMessages()
if(thisIndex)
{
bQuit = FALSE;
bQuit = false;
while(!bQuit)
{
for(i=0,bGotIt = FALSE; i<MAX_CONSOLE_MESSAGES && !bGotIt; i++)
for(i=0,bGotIt = false; i<MAX_CONSOLE_MESSAGES && !bGotIt; i++)
{
if(consoleStorage[i].id == thisIndex-1)
{
bGotIt = TRUE;
bGotIt = true;
marker = i;
}
}
@ -593,7 +593,7 @@ int displayOldMessages()
}
else
{
bQuit = TRUE; // count holds how many we got
bQuit = true; // count holds how many we got
}
if(thisIndex)
{
@ -602,12 +602,12 @@ int displayOldMessages()
}
else
{
bQuit = TRUE; // We've reached the big bang - there is nothing older...
bQuit = true; // We've reached the big bang - there is nothing older...
}
/* History can only hold so many */
if(count>=consoleDrop)
{
bQuit = TRUE;
bQuit = true;
}
}
}
@ -725,13 +725,13 @@ void setConsoleSizePos(UDWORD x, UDWORD y, UDWORD width)
/** Establishes whether the console messages stay there */
void setConsolePermanence(BOOL state, BOOL bClearOld)
{
if(mainConsole.permanent == TRUE && state == FALSE)
if(mainConsole.permanent == true && state == false)
{
if(bClearOld)
{
flushConsoleMessages();
}
mainConsole.permanent = FALSE;
mainConsole.permanent = false;
}
else
{
@ -743,7 +743,7 @@ void setConsolePermanence(BOOL state, BOOL bClearOld)
}
}
/** TRUE or FALSE as to whether the mouse is presently over the console window */
/** true or false as to whether the mouse is presently over the console window */
BOOL mouseOverConsoleBox( void )
{
if (
@ -753,11 +753,11 @@ BOOL mouseOverConsoleBox( void )
&& ((UDWORD)mouseY() < (mainConsole.topY + iV_GetTextLineSize()*numActiveMessages)) //condition 4
)
{
return(TRUE);
return(true);
}
else
{
return(FALSE);
return(false);
}
}

View File

@ -75,7 +75,7 @@
*********************************************************/
// whether a save game is currently being loaded
static BOOL saveFlag = FALSE;
static BOOL saveFlag = false;
extern int scr_lineno;
@ -84,11 +84,11 @@ extern int scr_lineno;
void dataSetSaveFlag(void)
{
saveFlag = TRUE;
saveFlag = true;
}
void dataClearSaveFlag(void)
{
saveFlag = FALSE;
saveFlag = false;
}
@ -98,12 +98,12 @@ static BOOL bufferSBODYLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadBodyStats(pBuffer, size)
|| !allocComponentList(COMP_BODY, numBodyStats))
{
return FALSE;
return false;
}
// set a dummy value so the release function gets called
*ppData = (void *)1;
return TRUE;
return true;
}
static BOOL dataDBBODYLoad(const char* filename, void **ppData)
@ -111,12 +111,12 @@ static BOOL dataDBBODYLoad(const char* filename, void **ppData)
if (!loadBodyStatsFromDB(filename)
|| !allocComponentList(COMP_BODY, numBodyStats))
{
return FALSE;
return false;
}
// set a dummy value so the release function gets called
*ppData = (void *)1;
return TRUE;
return true;
}
static void dataReleaseStats(void *pData)
@ -132,12 +132,12 @@ static BOOL bufferSWEAPONLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadWeaponStats(pBuffer, size)
|| !allocComponentList(COMP_WEAPON, numWeaponStats))
{
return FALSE;
return false;
}
// not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
static BOOL dataDBWEAPONLoad(const char* filename, void **ppData)
@ -145,12 +145,12 @@ static BOOL dataDBWEAPONLoad(const char* filename, void **ppData)
if (!loadWeaponStatsFromDB(filename)
|| !allocComponentList(COMP_WEAPON, numWeaponStats))
{
return FALSE;
return false;
}
// not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the constructor stats */
@ -159,12 +159,12 @@ static BOOL bufferSCONSTRLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadConstructStats(pBuffer, size)
|| !allocComponentList(COMP_CONSTRUCT, numConstructStats))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the ECM stats */
@ -173,12 +173,12 @@ static BOOL bufferSECMLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadECMStats(pBuffer, size)
|| !allocComponentList(COMP_ECM, numECMStats))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the Propulsion stats */
@ -187,12 +187,12 @@ static BOOL bufferSPROPLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadPropulsionStats(pBuffer, size)
|| !allocComponentList(COMP_PROPULSION, numPropulsionStats))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the Sensor stats */
@ -201,12 +201,12 @@ static BOOL bufferSSENSORLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadSensorStats(pBuffer, size)
|| !allocComponentList(COMP_SENSOR, numSensorStats))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the Repair stats */
@ -215,12 +215,12 @@ static BOOL bufferSREPAIRLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadRepairStats(pBuffer, size)
|| !allocComponentList(COMP_REPAIRUNIT, numRepairStats))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the Brain stats */
@ -229,12 +229,12 @@ static BOOL bufferSBRAINLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadBrainStats(pBuffer, size)
|| !allocComponentList(COMP_BRAIN, numBrainStats))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
static BOOL dataDBBRAINLoad(const char* filename, void** ppData)
@ -242,12 +242,12 @@ static BOOL dataDBBRAINLoad(const char* filename, void** ppData)
if (!loadBrainStatsFromDB(filename)
|| !allocComponentList(COMP_BRAIN, numBrainStats))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the PropulsionType stats */
@ -255,13 +255,13 @@ static BOOL bufferSPROPTYPESLoad(const char *pBuffer, UDWORD size, void **ppData
{
if (!loadPropulsionTypes(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the propulsion type sound stats */
@ -269,12 +269,12 @@ static BOOL bufferSPROPSNDLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadPropulsionSounds(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the SSPECABIL stats */
@ -282,12 +282,12 @@ static BOOL bufferSSPECABILLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadSpecialAbility(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the STERRTABLE stats */
@ -295,12 +295,12 @@ static BOOL bufferSTERRTABLELoad(const char *pBuffer, UDWORD size, void **ppData
{
if (!loadTerrainTable(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the body/propulsion IMDs stats */
@ -308,12 +308,12 @@ static BOOL bufferSBPIMDLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadBodyPropulsionIMDs(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the weapon sound stats */
@ -321,12 +321,12 @@ static BOOL bufferSWEAPSNDLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadWeaponSounds(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the Weapon Effect modifier stats */
@ -334,12 +334,12 @@ static BOOL bufferSWEAPMODLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadWeaponModifiers(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
@ -348,12 +348,12 @@ static BOOL bufferSTEMPLLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadDroidTemplates(pBuffer, size))
{
return FALSE;
return false;
}
// set a dummy value so the release function gets called
*ppData = (void *)1;
return TRUE;
return true;
}
// release the templates
@ -368,12 +368,12 @@ static BOOL bufferSTEMPWEAPLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadDroidWeapons(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the Structure stats */
@ -382,12 +382,12 @@ static BOOL bufferSSTRUCTLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadStructureStats(pBuffer, size)
|| !allocStructLists())
{
return FALSE;
return false;
}
// set a dummy value so the release function gets called
*ppData = (void *)1;
return TRUE;
return true;
}
// release the structure stats
@ -402,12 +402,12 @@ static BOOL bufferSSTRWEAPLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadStructureWeapons(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the Structure Functions stats */
@ -415,12 +415,12 @@ static BOOL bufferSSTRFUNCLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadStructureFunctions(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the Structure strength modifier stats */
@ -428,12 +428,12 @@ static BOOL bufferSSTRMODLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadStructureStrengthModifiers(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the Feature stats */
@ -441,12 +441,12 @@ static BOOL bufferSFEATLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadFeatureStats(pBuffer, size))
{
return FALSE;
return false;
}
// set a dummy value so the release function gets called
*ppData = (void *)1;
return TRUE;
return true;
}
// free the feature stats
@ -460,7 +460,7 @@ static BOOL bufferSFUNCLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadFunctionStats(pBuffer, size))
{
return FALSE;
return false;
}
//adjust max values of stats used in the design screen due to any possible upgrades
@ -468,7 +468,7 @@ static BOOL bufferSFUNCLoad(const char *pBuffer, UDWORD size, void **ppData)
// set a dummy value so the release function gets called
*ppData = (void *)1;
return TRUE;
return true;
}
// release the function stats
@ -496,7 +496,7 @@ static BOOL bufferRESCHLoad(const char *pBuffer, UDWORD size, void **ppData)
if (!loadResearch(pBuffer, size))
{
return FALSE;
return false;
}
@ -505,7 +505,7 @@ static BOOL bufferRESCHLoad(const char *pBuffer, UDWORD size, void **ppData)
// *ppData = (void *)1;
* pass back NULL so that can load the same name file for the next campaign*/
*ppData = NULL;
return TRUE;
return true;
}
/* Load the research pre-requisites */
@ -513,12 +513,12 @@ static BOOL bufferRPREREQLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadResearchPR(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the research components made redundant */
@ -526,12 +526,12 @@ static BOOL bufferRCOMPREDLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadResearchArtefacts(pBuffer, size, RED_LIST))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the research component results */
@ -539,12 +539,12 @@ static BOOL bufferRCOMPRESLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadResearchArtefacts(pBuffer, size, RES_LIST))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the research structures required */
@ -552,12 +552,12 @@ static BOOL bufferRSTRREQLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadResearchStructures(pBuffer, size, REQ_LIST))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the research structures made redundant */
@ -565,12 +565,12 @@ static BOOL bufferRSTRREDLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadResearchStructures(pBuffer, size, RED_LIST))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the research structure results */
@ -578,12 +578,12 @@ static BOOL bufferRSTRRESLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadResearchStructures(pBuffer, size, RES_LIST))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the research functions */
@ -591,12 +591,12 @@ static BOOL bufferRFUNCLoad(const char *pBuffer, UDWORD size, void **ppData)
{
if (!loadResearchFunctions(pBuffer, size))
{
return FALSE;
return false;
}
//not interested in this value
*ppData = NULL;
return TRUE;
return true;
}
/* Load the message viewdata */
@ -607,12 +607,12 @@ static BOOL bufferSMSGLoad(const char *pBuffer, UDWORD size, void **ppData)
pViewData = loadViewData(pBuffer, size);
if (!pViewData)
{
return FALSE;
return false;
}
// set the pointer so the release function gets called with it
*ppData = (void *)pViewData;
return TRUE;
return true;
}
@ -632,11 +632,11 @@ static BOOL dataIMDBufferLoad(const char *pBuffer, UDWORD size, void **ppData)
if (psIMD == NULL) {
debug( LOG_ERROR, "IMD load failed - %s", GetLastResourceFilename() );
abort();
return FALSE;
return false;
}
*ppData = psIMD;
return TRUE;
return true;
}
@ -648,18 +648,18 @@ static BOOL dataImageLoad(const char *fileName, void **ppData)
iV_Image *psSprite = malloc(sizeof(iV_Image));
if (!psSprite)
{
return FALSE;
return false;
}
if (!iV_loadImage_PNG(fileName, psSprite))
{
debug( LOG_ERROR, "IMGPAGE load failed" );
return FALSE;
return false;
}
*ppData = psSprite;
return TRUE;
return true;
}
@ -672,7 +672,7 @@ static BOOL dataTERTILESLoad(const char *fileName, void **ppData)
// set a dummy value so the release function gets called
*ppData = (void *)1;
return TRUE;
return true;
}
static void dataTERTILESRelease(void *pData)
@ -687,10 +687,10 @@ static BOOL dataIMGLoad(const char *fileName, void **ppData)
*ppData = iV_LoadImageFile(fileName);
if(*ppData == NULL)
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -711,7 +711,7 @@ static BOOL dataTexPageLoad(const char *fileName, void **ppData)
pie_MakeTexPageName(texpage);
if (!dataImageLoad(fileName, ppData))
{
return FALSE;
return false;
}
// see if this texture page has already been loaded
@ -728,7 +728,7 @@ static BOOL dataTexPageLoad(const char *fileName, void **ppData)
(void) pie_AddTexPage(*ppData, texpage, 0);
}
return TRUE;
return true;
}
/*!
@ -748,11 +748,11 @@ static void dataImageRelease(void *pData)
/* Load an audio file */
static BOOL dataAudioLoad(const char* fileName, void **ppData)
{
if ( audio_Disabled() == TRUE )
if ( audio_Disabled() == true )
{
*ppData = NULL;
// No error occurred (sound is just disabled), so we return TRUE
return TRUE;
// No error occurred (sound is just disabled), so we return true
return true;
}
// Load the track from a file
@ -771,14 +771,14 @@ static BOOL dataAudioCfgLoad(const char* fileName, void **ppData)
if (audio_Disabled())
{
return TRUE;
return true;
}
fileHandle = PHYSFS_openRead(fileName);
if (fileHandle == NULL)
{
return FALSE;
return false;
}
success = ParseResourceFile(fileHandle);
@ -795,7 +795,7 @@ static BOOL dataAnimLoad(const char *fileName, void **ppData)
if (fileHandle == NULL)
{
*ppData = NULL;
return FALSE;
return false;
}
*ppData = anim_LoadFromFile(fileHandle);
@ -814,7 +814,7 @@ static BOOL dataAnimCfgLoad(const char *fileName, void **ppData)
if (fileHandle == NULL)
{
return FALSE;
return false;
}
success = ParseResourceFile(fileHandle);
@ -838,17 +838,17 @@ static BOOL dataStrResLoad(const char* fileName, void** ppData)
{
if (!stringsInitialise())
{
return FALSE;
return false;
}
}
if (!strresLoad(psStringRes, fileName))
{
return FALSE;
return false;
}
*ppData = psStringRes;
return TRUE;
return true;
}
static void dataStrResRelease(void *pData)
@ -876,7 +876,7 @@ static BOOL dataScriptLoad(const char* fileName, void **ppData)
if (fileHandle == NULL)
{
return FALSE;
return false;
}
*psProg = scriptCompile(fileHandle, SCRIPTTYPE);
@ -886,7 +886,7 @@ static BOOL dataScriptLoad(const char* fileName, void **ppData)
if (!*psProg) // see script.h
{
debug(LOG_ERROR, "Script %s did not compile", GetLastResourceFilename());
return FALSE;
return false;
}
if (printHack)
@ -894,7 +894,7 @@ static BOOL dataScriptLoad(const char* fileName, void **ppData)
cpPrintProgram(*psProg);
}
return TRUE;
return true;
}
// Load a script variable values file
@ -908,7 +908,7 @@ static BOOL dataScriptLoadVals(const char* fileName, void **ppData)
// don't load anything if a saved game is being loaded
if (saveFlag)
{
return TRUE;
return true;
}
debug(LOG_WZ, "Loading script data %s", GetLastResourceFilename());
@ -917,7 +917,7 @@ static BOOL dataScriptLoadVals(const char* fileName, void **ppData)
if (fileHandle == NULL)
{
return FALSE;
return false;
}
success = scrvLoad(fileHandle);
@ -1019,7 +1019,7 @@ BOOL dataInitLoadFuncs(void)
{
if(!resAddBufferLoad(CurrentType->aType, CurrentType->buffLoad, CurrentType->release))
{
return FALSE; // error whilst adding a buffer load
return false; // error whilst adding a buffer load
}
}
}
@ -1034,10 +1034,10 @@ BOOL dataInitLoadFuncs(void)
{
if(!resAddFileLoad(CurrentType->aType, CurrentType->fileLoad, CurrentType->release))
{
return FALSE; // error whilst adding a buffer load
return false; // error whilst adding a buffer load
}
}
}
return TRUE;
return true;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -143,13 +143,13 @@ static void drawTerrainWaterTile(UDWORD i, UDWORD j);
// Should be cleaned up properly and be put in structures.
BOOL bRender3DOnly;
static BOOL bRangeDisplay = FALSE;
static BOOL bRangeDisplay = false;
static SDWORD rangeCenterX,rangeCenterY,rangeRadius;
static BOOL bDrawBlips=TRUE;
static BOOL bDrawProximitys=TRUE;
static BOOL bDrawBlips=true;
static BOOL bDrawProximitys=true;
BOOL godMode;
BOOL showGateways = FALSE;
BOOL showPath = FALSE;
BOOL showGateways = false;
BOOL showPath = false;
static char skyboxPageName[PATH_MAX] = "page-25";
@ -160,7 +160,7 @@ static float waterRealValue = 0.0f;
UWORD barMode;
/* Have we made a selection by clicking the mouse - used for dragging etc */
BOOL selectAttempt = FALSE;
BOOL selectAttempt = false;
/* Vectors that hold the player and camera directions and positions */
iView player;
@ -178,7 +178,7 @@ static TERRAIN_VERTEX tileScreenInfo[VISIBLE_YTILES+1][VISIBLE_XTILES+1];
SDWORD mouseTileX, mouseTileY;
/* Do we want the radar to be rendered */
BOOL radarOnScreen=FALSE;
BOOL radarOnScreen=false;
/* Show unit/building gun/sensor range*/
bool rangeOnScreen = false; // For now, most likely will change later! -Q 5-10-05 A very nice effect - Per
@ -187,7 +187,7 @@ bool rangeOnScreen = false; // For now, most likely will change later! -Q 5-10
static int playerXTile, playerZTile;
/* Have we located the mouse? */
static BOOL mouseLocated = TRUE;
static BOOL mouseLocated = true;
/* The box used for multiple selection - present screen coordinates */
UDWORD currentGameFrame;
@ -216,8 +216,8 @@ static int averageCentreTerrainHeight;
static UDWORD lastTargetAssignation = 0;
static UDWORD lastDestAssignation = 0;
static BOOL bSensorTargetting = FALSE;
static BOOL bDestTargetting = FALSE;
static BOOL bSensorTargetting = false;
static BOOL bDestTargetting = false;
static BASE_OBJECT *psSensorObj = NULL;
static UDWORD destTargetX,destTargetY;
static UDWORD destTileX=0,destTileY=0;
@ -292,7 +292,7 @@ static void showDroidPaths(void)
ASSERT(worldOnMap(pos.x, pos.y), "Effect off map!");
effectGiveAuxVar(80);
addEffect(&pos, EFFECT_EXPLOSION, EXPLOSION_TYPE_LASER, FALSE, NULL, 0);
addEffect(&pos, EFFECT_EXPLOSION, EXPLOSION_TYPE_LASER, false, NULL, 0);
}
}
}
@ -301,7 +301,7 @@ static void showDroidPaths(void)
/* Render the 3D world */
void draw3DScene( void )
{
BOOL bPlayerHasHQ = FALSE;
BOOL bPlayerHasHQ = false;
// the world centre - used for decaying lighting etc
gridCentreX = player.p.x + world_coord(visibleTiles.x / 2);
@ -350,7 +350,7 @@ void draw3DScene( void )
if(radarOnScreen && bPlayerHasHQ)
{
pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_ON);
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
drawRadar();
if(doWeDrawRadarBlips())
{
@ -359,17 +359,17 @@ void draw3DScene( void )
#endif
}
pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON);
pie_SetFogStatus(TRUE);
pie_SetFogStatus(true);
}
if(!bRender3DOnly)
{
/* Ensure that any text messages are displayed at bottom of screen */
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
displayConsoleMessages();
}
pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_OFF);
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
iV_SetTextColour(WZCOL_TEXT_BRIGHT);
/* Dont remove this folks!!!! */
@ -439,10 +439,10 @@ void draw3DScene( void )
if(demoGetStatus())
{
flushConsoleMessages();
setConsolePermanence(TRUE, TRUE);
permitNewConsoleMessages(TRUE);
setConsolePermanence(true, true);
permitNewConsoleMessages(true);
addConsoleMessage("Warzone 2100 : Pumpkin Studios ", RIGHT_JUSTIFY,CONSOLE_SYSTEM);
permitNewConsoleMessages(FALSE);
permitNewConsoleMessages(false);
}
#ifdef ALEXM
@ -478,7 +478,7 @@ static void displayTerrain(void)
tileZ = 8000;
/* We haven't yet located which tile mouse is over */
mouseLocated = FALSE;
mouseLocated = false;
numTiles = 0;
@ -589,7 +589,7 @@ static void drawTiles(iView *player)
// Animate the water texture, just cycles the V coordinate through half the tiles height.
if(!gamePaused())
{
waterRealValue += timeAdjustedIncrement(WAVE_SPEED, FALSE);
waterRealValue += timeAdjustedIncrement(WAVE_SPEED, false);
if (waterRealValue >= (1.0f / TILES_IN_PAGE_ROW) / 2)
{
waterRealValue = 0.0f;
@ -664,9 +664,9 @@ static void drawTiles(iView *player)
}
else
{
BOOL bEdgeTile = FALSE;
BOOL bEdgeTile = false;
MAPTILE *psTile = mapTile(playerXTile + j, playerZTile + i);
BOOL pushedDown = FALSE;
BOOL pushedDown = false;
tileScreenInfo[i][j].pos.y = map_TileHeight(playerXTile + j, playerZTile + i);
@ -692,7 +692,7 @@ static void drawTiles(iView *player)
playerXTile+j >= mapWidth-2 ||
playerZTile+i >= mapHeight-2 )
{
bEdgeTile = TRUE;
bEdgeTile = true;
}
// If it's the main water tile (has water texture) then..
@ -705,7 +705,7 @@ static void drawTiles(iView *player)
TileIllum.byte.r = (TileIllum.byte.r * 2) / 3;
TileIllum.byte.g = (TileIllum.byte.g * 2) / 3;
TileIllum.byte.b = (TileIllum.byte.b * 2) / 3;
pushedDown = TRUE;
pushedDown = true;
}
// to prevent a sharp edge to the map, make sure the border is black
@ -762,8 +762,8 @@ static void drawTiles(iView *player)
}
// Draw all the normal tiles
pie_SetAlphaTest(FALSE);
pie_SetFogStatus(TRUE);
pie_SetAlphaTest(false);
pie_SetFogStatus(true);
pie_SetTexturePage(terrainPage);
for (i = 0; i < visibleTiles.y; i++)
{
@ -780,7 +780,7 @@ static void drawTiles(iView *player)
continue;
}
drawTerrainTile(i, j, FALSE);
drawTerrainTile(i, j, false);
}
}
pie_DrawTerrain(visibleTiles.x, visibleTiles.y);
@ -805,7 +805,7 @@ static void drawTiles(iView *player)
// Draw water edges
pie_SetDepthOffset(-2.0);
pie_SetAlphaTest(TRUE);
pie_SetAlphaTest(true);
for (i = 0; i < MIN(visibleTiles.y, mapHeight); i++)
{
for (j = 0; j < MIN(visibleTiles.x, mapWidth); j++)
@ -833,7 +833,7 @@ static void drawTiles(iView *player)
}
// the edge is in front of the water (which is drawn at z-index -1)
drawTerrainTile(i, j, TRUE);
drawTerrainTile(i, j, true);
}
}
}
@ -841,7 +841,7 @@ static void drawTiles(iView *player)
// Now draw the water tiles in a second pass to get alpha sort order correct
pie_TranslateTextureBegin(Vector2f_New(0.0f, waterRealValue));
pie_SetRendMode(REND_ALPHA_TEX);
pie_SetAlphaTest(FALSE);
pie_SetAlphaTest(false);
pie_SetDepthOffset(-1.0f);
for (i = 0; i < MIN(visibleTiles.y, mapHeight ); i++)
{
@ -874,7 +874,7 @@ static void drawTiles(iView *player)
}
pie_SetDepthOffset(0.0f);
pie_SetRendMode(REND_GOURAUD_TEX);
pie_SetAlphaTest(TRUE);
pie_SetAlphaTest(true);
pie_TranslateTextureEnd();
targetOpenList((BASE_OBJECT*)driveGetDriven());
@ -965,7 +965,7 @@ BOOL init3DView(void)
imdRot.y = 0;
imdRot2.z = 0;
bRender3DOnly = FALSE;
bRender3DOnly = false;
targetInitialise();
@ -974,7 +974,7 @@ BOOL init3DView(void)
// distance is not saved, so initialise it now
distance = START_DISTANCE; // distance
return TRUE;
return true;
}
@ -1090,9 +1090,9 @@ BOOL clipXY(SDWORD x, SDWORD y)
{
if (x > (SDWORD)player.p.x && x < (SDWORD)(player.p.x+(visibleTiles.x * TILE_UNITS)) &&
y > (SDWORD)player.p.z && y < (SDWORD)(player.p.z+(visibleTiles.y*TILE_UNITS)))
return(TRUE);
return(true);
else
return(FALSE);
return(false);
}
@ -1385,7 +1385,7 @@ void displayStaticObjects( void )
}
if ( psStructure->psCurAnim == NULL ||
psStructure->psCurAnim->bVisible == FALSE ||
psStructure->psCurAnim->bVisible == false ||
(psAnimObj = animObj_Find( psStructure,
psStructure->psCurAnim->uwID )) == NULL )
{
@ -1399,14 +1399,14 @@ void displayStaticObjects( void )
if (psStructure->pStructureType->type !=
REF_RESOURCE_EXTRACTOR)
{
displayAnimation( psAnimObj, FALSE );
displayAnimation( psAnimObj, false );
}
//check that a power gen exists before animationg res extrac
//else if (getPowerGenExists(psStructure->player))
/*check the building is active*/
else if (psStructure->pFunctionality->resourceExtractor.active)
{
displayAnimation( psAnimObj, FALSE );
displayAnimation( psAnimObj, false );
if(selectedPlayer == psStructure->player)
{
audio_PlayObjStaticTrack( (void *) psStructure, ID_SOUND_OIL_PUMP_2 );
@ -1415,7 +1415,7 @@ void displayStaticObjects( void )
else
{
/* hold anim on first frame */
displayAnimation( psAnimObj, TRUE );
displayAnimation( psAnimObj, true );
audio_StopObjTrack( (void *) psStructure, ID_SOUND_OIL_PUMP_2 );
}
@ -1507,7 +1507,7 @@ static void displayAnimation( ANIM_OBJECT * psAnimObj, BOOL bHoldOnFirstFrame )
for ( i = 0; i < psAnimObj->psAnim->uwObj; i++ )
{
if ( bHoldOnFirstFrame == TRUE )
if ( bHoldOnFirstFrame == true )
{
uwFrame = 0;
vecPos.x = vecPos.y = vecPos.z = 0;
@ -1566,11 +1566,11 @@ void displayDynamicObjects( void )
renderDroid( (DROID *) psDroid);
/* draw anim if visible */
if ( psDroid->psCurAnim != NULL &&
psDroid->psCurAnim->bVisible == TRUE &&
psDroid->psCurAnim->bVisible == true &&
(psAnimObj = animObj_Find( psDroid,
psDroid->psCurAnim->uwID )) != NULL )
{
displayAnimation( psAnimObj, FALSE );
displayAnimation( psAnimObj, false );
}
}
} // end clipDroid
@ -1865,8 +1865,8 @@ void renderStructure(STRUCTURE *psStructure)
Vector3i dv;
SDWORD i;
Vector3f *temp = NULL;
BOOL bHitByElectronic = FALSE;
BOOL defensive = FALSE;
BOOL bHitByElectronic = false;
BOOL defensive = false;
iIMDShape *strImd = psStructure->sDisplay.imd;
if (psStructure->pStructureType->type == REF_WALL || psStructure->pStructureType->type == REF_WALLCORNER)
@ -1880,7 +1880,7 @@ void renderStructure(STRUCTURE *psStructure)
}
else if (psStructure->pStructureType->type == REF_DEFENSE)
{
defensive = TRUE;
defensive = true;
}
playerFrame = getPlayerColour(psStructure->player);
@ -1974,7 +1974,7 @@ void renderStructure(STRUCTURE *psStructure)
&& gameTime2-psStructure->timeLastHit < ELEC_DAMAGE_DURATION
&& psStructure->lastHitWeapon == WSC_ELECTRONIC )
{
bHitByElectronic = TRUE;
bHitByElectronic = true;
}
buildingBrightness = pal_SetBrightness(200 - (100 - PERCENT(psStructure->body, structureBody(psStructure))));
@ -2467,9 +2467,9 @@ static BOOL renderWallSection(STRUCTURE *psStructure)
iV_MatrixEnd();
return(TRUE);
return(true);
}
return FALSE;
return false;
}
/* renderShadow: draws shadow under droid */
@ -2619,10 +2619,10 @@ static void drawWeaponReloadBar(BASE_OBJECT *psObj, WEAPON *psWeap, int weapon_s
psStats = asWeaponStats + psWeap->nStat;
/* Justifiable only when greater than a one second reload or intra salvo time */
bSalvo = FALSE;
bSalvo = false;
if(psStats->numRounds > 1)
{
bSalvo = TRUE;
bSalvo = true;
}
if( (bSalvo && (psStats->reloadTime > GAME_TICKS_PER_SEC)) ||
(psStats->firePause > GAME_TICKS_PER_SEC) ||
@ -2705,21 +2705,21 @@ static void drawStructureSelections( void )
UDWORD scale;
UDWORD i;
BASE_OBJECT *psClickedOn;
BOOL bMouseOverStructure = FALSE;
BOOL bMouseOverOwnStructure = FALSE;
BOOL bMouseOverStructure = false;
BOOL bMouseOverOwnStructure = false;
float mulH;
psClickedOn = mouseTarget();
if(psClickedOn!=NULL && psClickedOn->type == OBJ_STRUCTURE)
{
bMouseOverStructure = TRUE;
bMouseOverStructure = true;
if(psClickedOn->player == selectedPlayer)
{
bMouseOverOwnStructure = TRUE;
bMouseOverOwnStructure = true;
}
}
pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_ON);
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
/* Go thru' all the buildings */
for(psStruct = apsStructLists[selectedPlayer]; psStruct; psStruct = psStruct->psNext)
@ -2939,10 +2939,10 @@ BOOL eitherSelected(DROID *psDroid)
BOOL retVal;
BASE_OBJECT *psObj;
retVal = FALSE;
retVal = false;
if(psDroid->selected)
{
retVal = TRUE;
retVal = true;
}
if(psDroid->psGroup)
@ -2951,7 +2951,7 @@ BASE_OBJECT *psObj;
{
if(psDroid->psGroup->psCommander->selected)
{
retVal = TRUE;
retVal = true;
}
}
}
@ -2960,7 +2960,7 @@ BASE_OBJECT *psObj;
if (psObj
&& psObj->selected)
{
retVal = TRUE;
retVal = true;
}
return retVal;
@ -2974,8 +2974,8 @@ static void drawDroidSelections( void )
PIELIGHT powerCol = WZCOL_BLACK;
PIELIGHT boxCol;
BASE_OBJECT *psClickedOn;
BOOL bMouseOverDroid = FALSE;
BOOL bMouseOverOwnDroid = FALSE;
BOOL bMouseOverDroid = false;
BOOL bMouseOverOwnDroid = false;
BOOL bBeingTracked;
UDWORD i,index;
FEATURE *psFeature;
@ -2984,18 +2984,18 @@ static void drawDroidSelections( void )
psClickedOn = mouseTarget();
if(psClickedOn!=NULL && psClickedOn->type == OBJ_DROID)
{
bMouseOverDroid = TRUE;
bMouseOverDroid = true;
if(psClickedOn->player == selectedPlayer && !psClickedOn->selected)
{
bMouseOverOwnDroid = TRUE;
bMouseOverOwnDroid = true;
}
}
pie_SetDepthBufferStatus(DEPTH_CMP_ALWAYS_WRT_ON);
pie_SetFogStatus(FALSE);
pie_SetFogStatus(false);
for(psDroid = apsDroidLists[selectedPlayer]; psDroid; psDroid = psDroid->psNext)
{
bBeingTracked = FALSE;
bBeingTracked = false;
/* If it's selected and on screen or it's the one the mouse is over ||*/
// ABSOLUTELY MAD LOGICAL EXPRESSION!!! :-)
if ((eitherSelected(psDroid) && psDroid->sDisplay.frameNumber == currentGameFrame)
@ -3169,7 +3169,7 @@ static void drawDroidSelections( void )
/* If it's selected */
if(psDroid->bTargetted && (psDroid->visible[selectedPlayer] == UBYTE_MAX))
{
psDroid->bTargetted = FALSE;
psDroid->bTargetted = false;
scrX = psDroid->sDisplay.screenX;
scrY = psDroid->sDisplay.screenY - 8;
index = IMAGE_BLUE1+getTimeValueRange(1020,5);
@ -3185,7 +3185,7 @@ static void drawDroidSelections( void )
{
if(psFeature->bTargetted)
{
psFeature->bTargetted = FALSE;
psFeature->bTargetted = false;
scrX = psFeature->sDisplay.screenX;
scrY = psFeature->sDisplay.screenY - (psFeature->sDisplay.imd->max.y / 4);
iV_DrawImage(IntImages,getTargettingGfx(),scrX,scrY);
@ -3207,7 +3207,7 @@ UDWORD id2;
BOOL bDraw;
SDWORD xShift,yShift;
bDraw = TRUE;
bDraw = true;
id = id2 = UDWORD_MAX;
@ -3252,7 +3252,7 @@ SDWORD xShift,yShift;
id = IMAGE_GN_9;
break;
default:
bDraw = FALSE;
bDraw = false;
break;
}
}
@ -3278,7 +3278,7 @@ UDWORD id2;
BOOL bDraw;
SDWORD xShift,yShift, index;
bDraw = TRUE;
bDraw = true;
id = id2 = UDWORD_MAX;
@ -3322,7 +3322,7 @@ SDWORD xShift,yShift, index;
id = IMAGE_GN_9;
break;
default:
bDraw = FALSE;
bDraw = false;
break;
}
@ -3377,7 +3377,7 @@ void calcScreenCoords(DROID *psDroid)
//unless we're in multiPlayer mode!!!!
if (psDroid->droidType != DROID_TRANSPORTER || bMultiPlayer)
{
dealWithDroidSelect(psDroid, TRUE);
dealWithDroidSelect(psDroid, true);
}
}
}
@ -3648,7 +3648,7 @@ static void renderSurroundings(void)
if(!gamePaused())
{
wind = wrapf(wind + timeAdjustedIncrement(0.5f, FALSE), 360.0f);
wind = wrapf(wind + timeAdjustedIncrement(0.5f, false), 360.0f);
}
pie_DrawSkybox(skybox_scale, 0, 128, 256, 128);
@ -3749,7 +3749,7 @@ static void drawTerrainTile(UDWORD i, UDWORD j, BOOL onWaterEdge)
/* Get the correct tile index for the x/y coordinates */
SDWORD actualX = playerXTile + j, actualY = playerZTile + i;
MAPTILE *psTile = NULL;
BOOL bOutlined = FALSE;
BOOL bOutlined = false;
UDWORD tileNumber = 0;
TERRAIN_VERTEX vertices[3];
PIELIGHT colour[2][2];
@ -3810,7 +3810,7 @@ static void drawTerrainTile(UDWORD i, UDWORD j, BOOL onWaterEdge)
{
/* Clear it for next time round */
CLEAR_TILE_HIGHLIGHT(psTile);
bOutlined = TRUE;
bOutlined = true;
if ( i < visibleTiles.x && j < visibleTiles.y ) // FIXME
{
if (outlineTile)
@ -3998,10 +3998,10 @@ static void trackHeight( float desiredHeight )
float acceleration = ACCEL_CONSTANT * separation - VELOCITY_CONSTANT * heightSpeed; // Work out accelertion
/* ...and now speed */
heightSpeed += timeAdjustedIncrement(acceleration, FALSE);
heightSpeed += timeAdjustedIncrement(acceleration, false);
/* Adjust the height accordingly */
player.p.y += timeAdjustedIncrement(heightSpeed, FALSE);
player.p.y += timeAdjustedIncrement(heightSpeed, false);
}
@ -4017,7 +4017,7 @@ void toggleEnergyBars(void)
// -------------------------------------------------------------------------------------
void assignSensorTarget( BASE_OBJECT *psObj )
{
bSensorTargetting = TRUE;
bSensorTargetting = true;
lastTargetAssignation = gameTime2;
psSensorObj = psObj;
}
@ -4025,7 +4025,7 @@ void assignSensorTarget( BASE_OBJECT *psObj )
// -------------------------------------------------------------------------------------
void assignDestTarget( void )
{
bDestTargetting = TRUE;
bDestTargetting = true;
lastDestAssignation = gameTime2;
destTargetX = mouseX();
destTargetY = mouseY();
@ -4082,12 +4082,12 @@ static void processSensorTarget( void )
}
else
{
bSensorTargetting = FALSE;
bSensorTargetting = false;
}
}
else
{
bSensorTargetting = FALSE;
bSensorTargetting = false;
}
}
@ -4122,7 +4122,7 @@ static void processDestinationTarget( void )
}
else
{
bDestTargetting = FALSE;
bDestTargetting = false;
}
}
}
@ -4220,14 +4220,14 @@ static void structureEffectsPlayer( UDWORD player )
pos.z = psStructure->pos.y + yDif;
pos.y = map_Height(pos.x,pos.z) + 64 + (i*20); // 64 up to get to base of spire
effectGiveAuxVar(50); // half normal plasma size...
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LASER,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LASER,false,NULL,0);
pos.x = psStructure->pos.x - xDif;
pos.z = psStructure->pos.y - yDif;
// pos.y = map_Height(pos.x,pos.z) + 64 + (i*20); // 64 up to get to base of spire
effectGiveAuxVar(50); // half normal plasma size...
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LASER,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LASER,false,NULL,0);
}
}
/* Might be a re-arm pad! */
@ -4265,12 +4265,12 @@ static void structureEffectsPlayer( UDWORD player )
pos.z = psStructure->pos.y + yDif;
pos.y = map_Height(pos.x,pos.z) + psStructure->sDisplay.imd->max.y;
effectGiveAuxVar(30+bFXSize); // half normal plasma size...
addEffect(&pos,EFFECT_EXPLOSION, EXPLOSION_TYPE_LASER,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION, EXPLOSION_TYPE_LASER,false,NULL,0);
pos.x = psStructure->pos.x - xDif;
pos.z = psStructure->pos.y - yDif; // buildings are level!
// pos.y = map_Height(pos.x,pos.z) + psStructure->sDisplay->pos.max.y;
effectGiveAuxVar(30+bFXSize); // half normal plasma size...
addEffect(&pos,EFFECT_EXPLOSION, EXPLOSION_TYPE_LASER,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION, EXPLOSION_TYPE_LASER,false,NULL,0);
}
}
}
@ -4336,7 +4336,7 @@ static void showSensorRange2(BASE_OBJECT *psObj)
UDWORD i;
DROID *psDroid;
STRUCTURE *psStruct;
BOOL bBuilding=FALSE;
BOOL bBuilding=false;
for(i=0; i<360; i++)
{
@ -4349,7 +4349,7 @@ static void showSensorRange2(BASE_OBJECT *psObj)
{
psStruct = (STRUCTURE*)psObj;
sensorRange = structSensorRange(psStruct);
bBuilding = TRUE;
bBuilding = true;
}
radius = sensorRange;
xDif = radius * (SIN(DEG(i)));
@ -4363,11 +4363,11 @@ static void showSensorRange2(BASE_OBJECT *psObj)
effectGiveAuxVar(80); // half normal plasma size...
if(bBuilding)
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
}
else
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LASER,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LASER,false,NULL,0);
}
}
}
@ -4390,7 +4390,7 @@ static void drawRangeAtPos(SDWORD centerX, SDWORD centerY, SDWORD radius)
pos.y = map_Height(pos.x,pos.z) + 16;
effectGiveAuxVar(80); // half normal plasma size...
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
}
}
@ -4403,10 +4403,10 @@ void showRangeAtPos(SDWORD centerX, SDWORD centerY, SDWORD radius)
rangeCenterY = centerY;
rangeRadius = radius;
bRangeDisplay = TRUE;
bRangeDisplay = true;
if(radius <= 0)
bRangeDisplay = FALSE;
bRangeDisplay = false;
}
/*returns the graphic ID for a droid rank*/
@ -4567,7 +4567,7 @@ static void addConstructionLine(DROID *psDroid, STRUCTURE *psStructure)
if(ONEINEIGHT)
{
effectSetSize(30);
addEffect(&each,EFFECT_EXPLOSION,EXPLOSION_TYPE_SPECIFIED,TRUE,getImdFromIndex(MI_PLASMA),0);
addEffect(&each,EFFECT_EXPLOSION,EXPLOSION_TYPE_SPECIFIED,true,getImdFromIndex(MI_PLASMA),0);
}
vec.x = (each.x - player.p.x) - terrainMidX*TILE_UNITS;

View File

@ -89,18 +89,18 @@ extern BOOL DirectControl;
#define MAX_IDLE (GAME_TICKS_PER_SEC*60) // Start to orbit if idle for 60 seconds.
DROID *psDrivenDroid = NULL; // The droid that's being driven.
static BOOL bDriveMode = FALSE;
static BOOL bDriveMode = false;
static SDWORD driveDir; // Driven droid's direction.
static SDWORD driveSpeed; // Driven droid's speed.
static UDWORD driveBumpTime; // Time that followers get a kick up the ass.
static BOOL DoFollowRangeCheck = TRUE;
static BOOL AllInRange = TRUE;
static BOOL ClearFollowRangeCheck = FALSE;
static BOOL DriveControlEnabled = FALSE;
static BOOL DriveInterfaceEnabled = FALSE;
static BOOL DoFollowRangeCheck = true;
static BOOL AllInRange = true;
static BOOL ClearFollowRangeCheck = false;
static BOOL DriveControlEnabled = false;
static BOOL DriveInterfaceEnabled = false;
static UDWORD IdleTime;
static BOOL TacticalActive = FALSE;
static BOOL WasDriving = FALSE;
static BOOL TacticalActive = false;
static BOOL WasDriving = false;
enum {
CONTROLMODE_POINTNCLICK,
@ -108,9 +108,9 @@ enum {
};
static UWORD ControlMode = CONTROLMODE_DRIVE;
static BOOL TargetFeatures = FALSE;
static BOOL TargetFeatures = false;
// Intialise drive statics, call with TRUE if coming from frontend, FALSE if
// Intialise drive statics, call with true if coming from frontend, false if
// coming from a mission.
//
void driveInitVars(BOOL Restart)
@ -120,14 +120,14 @@ void driveInitVars(BOOL Restart)
debug( LOG_NEVER, "driveInitVars: WasDriving\n" );
DrivingAudioTrack=-1;
psDrivenDroid = NULL;
DoFollowRangeCheck = TRUE;
ClearFollowRangeCheck = FALSE;
bDriveMode = FALSE;
DriveControlEnabled = TRUE; //FALSE;
DriveInterfaceEnabled = FALSE; //TRUE;
TacticalActive = FALSE;
DoFollowRangeCheck = true;
ClearFollowRangeCheck = false;
bDriveMode = false;
DriveControlEnabled = true; //false;
DriveInterfaceEnabled = false; //true;
TacticalActive = false;
ControlMode = CONTROLMODE_DRIVE;
TargetFeatures = FALSE;
TargetFeatures = false;
}
else
@ -135,15 +135,15 @@ void driveInitVars(BOOL Restart)
debug( LOG_NEVER, "driveInitVars: Driving\n" );
DrivingAudioTrack=-1;
psDrivenDroid = NULL;
DoFollowRangeCheck = TRUE;
ClearFollowRangeCheck = FALSE;
bDriveMode = FALSE;
DriveControlEnabled = TRUE; //FALSE;
DriveInterfaceEnabled = FALSE;
TacticalActive = FALSE;
DoFollowRangeCheck = true;
ClearFollowRangeCheck = false;
bDriveMode = false;
DriveControlEnabled = true; //false;
DriveInterfaceEnabled = false;
TacticalActive = false;
ControlMode = CONTROLMODE_DRIVE;
TargetFeatures = FALSE;
WasDriving = FALSE;
TargetFeatures = false;
WasDriving = false;
}
}
@ -190,11 +190,11 @@ BOOL StartDriverMode(DROID *psOldDroid)
// If that failed then find any droid and make it the driven one.
if(psDrivenDroid == NULL) {
psLastDriven = NULL;
psDrivenDroid = intGotoNextDroidType(NULL,DROID_ANY,TRUE);
psDrivenDroid = intGotoNextDroidType(NULL,DROID_ANY,true);
// If it's the same droid then try again
if(psDrivenDroid == psOldDroid) {
psDrivenDroid = intGotoNextDroidType(NULL,DROID_ANY,TRUE);
psDrivenDroid = intGotoNextDroidType(NULL,DROID_ANY,true);
}
if(psDrivenDroid == psOldDroid) {
@ -203,7 +203,7 @@ BOOL StartDriverMode(DROID *psOldDroid)
// If it failed then try for a transporter.
if(psDrivenDroid == NULL) {
psDrivenDroid = intGotoNextDroidType(NULL,DROID_TRANSPORTER,TRUE);
psDrivenDroid = intGotoNextDroidType(NULL,DROID_TRANSPORTER,true);
}
// DBPRINTF(("Selected a new driven droid : %p\n",psDrivenDroid));
@ -215,18 +215,18 @@ BOOL StartDriverMode(DROID *psOldDroid)
driveSpeed = 0;
driveBumpTime = gameTime;
setDrivingStatus(TRUE);
setDrivingStatus(true);
if(DriveInterfaceEnabled)
{
debug( LOG_NEVER, "Interface enabled1 ! Disabling drive control\n" );
DriveControlEnabled = FALSE;
DirectControl = FALSE;
DriveControlEnabled = false;
DirectControl = false;
}
else
{
DriveControlEnabled = TRUE;
DirectControl = TRUE; // we are taking over the unit.
DriveControlEnabled = true;
DirectControl = true; // we are taking over the unit.
}
if(psLastDriven != psDrivenDroid) {
@ -235,12 +235,12 @@ BOOL StartDriverMode(DROID *psOldDroid)
}
return TRUE;
return true;
} else {
}
return FALSE;
return false;
}
@ -264,8 +264,8 @@ static void ChangeDriver(void)
}
}
// setDrivingStatus(FALSE);
// DriveControlEnabled = FALSE;
// setDrivingStatus(false);
// DriveControlEnabled = false;
}
@ -292,15 +292,15 @@ void StopDriverMode(void)
}
}
setDrivingStatus(FALSE);
driveInitVars(FALSE); // reset everything again
DriveControlEnabled = FALSE;
DirectControl = FALSE;
setDrivingStatus(false);
driveInitVars(false); // reset everything again
DriveControlEnabled = false;
DirectControl = false;
}
// Call this whenever a droid gets killed or removed.
// returns TRUE if ok, returns FALSE if resulted in driving mode being stopped, ie could'nt find
// returns true if ok, returns false if resulted in driving mode being stopped, ie could'nt find
// a selected droid to drive.
//
BOOL driveDroidKilled(DROID *psDroid)
@ -315,12 +315,12 @@ BOOL driveDroidKilled(DROID *psDroid)
if(!StartDriverMode(psDroid))
{
return FALSE;
return false;
}
}
}
return TRUE;
return true;
}
@ -379,11 +379,11 @@ static void driveNextDriver(void)
static BOOL driveControl(DROID *psDroid)
{
BOOL Input = FALSE;
BOOL Input = false;
SDWORD MaxSpeed = moveCalcDroidSpeed(psDroid);
if(!DriveControlEnabled) {
return FALSE;
return false;
}
if(keyPressed(KEY_N)) {
@ -392,13 +392,13 @@ static BOOL driveControl(DROID *psDroid)
if(keyDown(KEY_LEFTARROW)) {
driveDir += DRIVE_TURNSPEED;
Input = TRUE;
Input = true;
} else if(keyDown(KEY_RIGHTARROW)) {
driveDir -= DRIVE_TURNSPEED;
if(driveDir < 0) {
driveDir += 360;
}
Input = TRUE;
Input = true;
}
driveDir = driveDir % 360;
@ -415,7 +415,7 @@ static BOOL driveControl(DROID *psDroid)
driveSpeed = 0;
}
}
Input = TRUE;
Input = true;
} else if(keyDown(KEY_DOWNARROW)) {
if(driveSpeed <= 0) {
driveSpeed -= DRIVE_ACCELERATE;
@ -428,7 +428,7 @@ static BOOL driveControl(DROID *psDroid)
driveSpeed = 0;
}
}
Input = TRUE;
Input = true;
} else {
if(driveSpeed > 0) {
driveSpeed -= DRIVE_DECELERATE;
@ -451,10 +451,10 @@ static BOOL driveInDriverRange(DROID *psDroid)
{
if( (abs(psDroid->pos.x-psDrivenDroid->pos.x) < FOLLOW_STOP_RANGE) &&
(abs(psDroid->pos.y-psDrivenDroid->pos.y) < FOLLOW_STOP_RANGE) ) {
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -485,7 +485,7 @@ static void driveMoveFollower(DROID *psDroid)
if(driveInDriverRange(psDroid)) {
psDroid->sMove.Status = MOVEINACTIVE;
} else {
AllInRange = FALSE;
AllInRange = false;
}
}
}
@ -510,7 +510,7 @@ void driveUpdate(void)
DROID *psDroid;
PROPULSION_STATS *psPropStats;
AllInRange = TRUE;
AllInRange = true;
if(DirectControl) {
if(psDrivenDroid != NULL) {
@ -525,7 +525,7 @@ void driveUpdate(void)
// Check the driven droid is still selected
if(psDrivenDroid->selected == FALSE) {
if(psDrivenDroid->selected == false) {
// if it's not then reset the driving system.
driveSelectionChanged();
return;
@ -540,7 +540,7 @@ void driveUpdate(void)
driveDir = (int)psDrivenDroid->direction % 360;
}
DoFollowRangeCheck = TRUE;
DoFollowRangeCheck = true;
}
// Is the driven droid under user control?
@ -568,7 +568,7 @@ void driveUpdate(void)
}
if(AllInRange) {
DoFollowRangeCheck = FALSE;
DoFollowRangeCheck = false;
}
if(driveBumpTime < gameTime) {
@ -576,7 +576,7 @@ void driveUpdate(void)
driveBumpTime = gameTime+GAME_TICKS_PER_SEC;
}
} else {
if(StartDriverMode(NULL) == FALSE) {
if(StartDriverMode(NULL) == false) {
// nothing
}
}
@ -608,9 +608,9 @@ void driveSetDroidMove(DROID *psDroid)
void driveDisableControl(void)
{
DriveControlEnabled = FALSE;
DirectControl = FALSE;
DriveInterfaceEnabled = TRUE;
DriveControlEnabled = false;
DirectControl = false;
DriveInterfaceEnabled = true;
}
@ -618,14 +618,14 @@ void driveDisableControl(void)
//
void driveEnableControl(void)
{
DriveControlEnabled = TRUE;
DirectControl = TRUE;
DriveInterfaceEnabled = FALSE;
DriveControlEnabled = true;
DirectControl = true;
DriveInterfaceEnabled = false;
}
// Return TRUE if drive control is enabled.
// Return true if drive control is enabled.
//
BOOL driveControlEnabled(void)
{
@ -641,7 +641,7 @@ void driveEnableInterface(BOOL AddReticule)
intAddReticule();
}
DriveInterfaceEnabled = TRUE;
DriveInterfaceEnabled = true;
}
@ -649,14 +649,14 @@ void driveEnableInterface(BOOL AddReticule)
//
void driveDisableInterface(void)
{
intResetScreen(FALSE);
intResetScreen(false);
intRemoveReticule();
DriveInterfaceEnabled = FALSE;
DriveInterfaceEnabled = false;
}
// Return TRUE if the reticule is up.
// Return true if the reticule is up.
//
BOOL driveInterfaceEnabled(void)
{
@ -684,22 +684,22 @@ void driveStartBuild(void)
{
intRemoveReticule();
DriveInterfaceEnabled = FALSE;
DriveInterfaceEnabled = false;
// driveDisableInterface();
driveEnableControl();
}
// Return TRUE if all the conditions for allowing user control of the droid are met.
// Return true if all the conditions for allowing user control of the droid are met.
//
BOOL driveAllowControl(void)
{
if (TacticalActive || DriveInterfaceEnabled || !DriveControlEnabled)
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -710,12 +710,12 @@ void driveDisableTactical(void)
if(driveModeActive() && TacticalActive)
{
CancelTacticalScroll();
TacticalActive = FALSE;
TacticalActive = false;
}
}
// Return TRUE if Tactical order mode is active.
// Return true if Tactical order mode is active.
//
BOOL driveTacticalActive(void)
{
@ -726,7 +726,7 @@ BOOL driveTacticalActive(void)
void driveTacticalSelectionChanged(void)
{
if(TacticalActive && psDrivenDroid) {
StartTacticalScrollObj(TRUE,(BASE_OBJECT *)psDrivenDroid);
StartTacticalScrollObj(true,(BASE_OBJECT *)psDrivenDroid);
debug( LOG_NEVER, "driveTacticalSelectionChanged\n" );
}
}
@ -752,7 +752,7 @@ void driveMarkTarget(void)
{
if(driveAllowControl())
{
// MouseMovement(FALSE);
// MouseMovement(false);
targetMarkCurrent();
SetMousePos(0,psObj->sDisplay.screenX,psObj->sDisplay.screenY);
// pie_DrawMouse(psObj->sDisplay.screenX,psObj->sDisplay.screenY);

View File

@ -28,11 +28,11 @@ extern DROID *psDrivenDroid;
static inline BOOL driveHasDriven(void)
{
return (DirectControl) && (psDrivenDroid != NULL) ? TRUE : FALSE;
return (DirectControl) && (psDrivenDroid != NULL) ? true : false;
}
// Returns TRUE if drive mode is active.
// Returns true if drive mode is active.
//
static inline BOOL driveModeActive(void)
{
@ -40,17 +40,17 @@ static inline BOOL driveModeActive(void)
}
// Return TRUE if the specified droid is the driven droid.
// Return true if the specified droid is the driven droid.
//
static inline BOOL driveIsDriven(DROID *psDroid)
{
return (DirectControl) && (psDrivenDroid != NULL) && (psDroid == psDrivenDroid) ? TRUE : FALSE;
return (DirectControl) && (psDrivenDroid != NULL) && (psDroid == psDrivenDroid) ? true : false;
}
static inline BOOL driveIsFollower(DROID *psDroid)
{
return (DirectControl) && (psDrivenDroid != NULL) && (psDroid != psDrivenDroid) && psDroid->selected ? TRUE : FALSE;
return (DirectControl) && (psDrivenDroid != NULL) && (psDroid != psDrivenDroid) && psDroid->selected ? true : false;
}

File diff suppressed because it is too large Load Diff

View File

@ -164,27 +164,27 @@ extern BOOL droidStartBuild(DROID *psDroid);
extern BOOL droidStartDemolishing( DROID *psDroid );
/* Update a construction droid while it is demolishing
returns TRUE while demolishing */
returns true while demolishing */
extern BOOL droidUpdateDemolishing( DROID *psDroid );
/* Sets a droid to start repairing - returns true if successful */
extern BOOL droidStartRepair( DROID *psDroid );
/* Update a construction droid while it is repairing
returns TRUE while repairing */
returns true while repairing */
extern BOOL droidUpdateRepair( DROID *psDroid );
/*Start a Repair Droid working on a damaged droid - returns TRUE if successful*/
/*Start a Repair Droid working on a damaged droid - returns true if successful*/
extern BOOL droidStartDroidRepair( DROID *psDroid );
/*Updates a Repair Droid working on a damaged droid - returns TRUE whilst repairing*/
/*Updates a Repair Droid working on a damaged droid - returns true whilst repairing*/
extern BOOL droidUpdateDroidRepair(DROID *psRepairDroid);
/*checks a droids current body points to see if need to self repair*/
extern void droidSelfRepair(DROID *psDroid);
/* Update a construction droid while it is building
returns TRUE while building continues */
returns true while building continues */
extern BOOL droidUpdateBuild(DROID *psDroid);
/*Start a EW weapon droid working on a low resistance structure*/
@ -209,7 +209,7 @@ extern void vanishDroid(DROID *psDel);
extern void droidBurn( DROID * psDroid );
/* Remove a droid from the apsDroidLists so doesn't update or get drawn etc*/
//returns TRUE if successfully removed from the list
//returns true if successfully removed from the list
extern BOOL droidRemove(DROID *psDroid, DROID *pList[MAX_PLAYERS]);
//free the storage for the droid templates
@ -280,15 +280,15 @@ extern BOOL pickATileGenThreat(UDWORD *x, UDWORD *y, UBYTE numIterations, SDWORD
extern void initDroidMovement(DROID *psDroid);
/* Looks through the players list of droids to see if any of them are
building the specified structure - returns TRUE if finds one*/
building the specified structure - returns true if finds one*/
extern BOOL checkDroidsBuilding(STRUCTURE *psStructure);
/* Looks through the players list of droids to see if any of them are
demolishing the specified structure - returns TRUE if finds one*/
demolishing the specified structure - returns true if finds one*/
extern BOOL checkDroidsDemolishing(STRUCTURE *psStructure);
/* checks the structure for type and capacity and orders the droid to build
a module if it can - returns TRUE if order is set */
a module if it can - returns true if order is set */
extern BOOL buildModule(STRUCTURE *psStruct);
/*Deals with building a module - checking if any droid is currently doing this
@ -327,7 +327,7 @@ extern UBYTE checkCommandExist(UBYTE player);
/* Set up a droid to clear a wrecked building feature - returns true if successful */
extern BOOL droidStartClearing( DROID *psDroid );
/* Update a construction droid while it is clearing
returns TRUE while continues */
returns true while continues */
extern BOOL droidUpdateClearing( DROID *psDroid );
/*For a given repair droid, check if there are any damaged droids within
@ -336,7 +336,7 @@ extern BASE_OBJECT * checkForRepairRange(DROID *psDroid,DROID *psTarget);
//access function
extern BOOL vtolDroid(DROID *psDroid);
/*returns TRUE if a VTOL Weapon Droid which has completed all runs*/
/*returns true if a VTOL Weapon Droid which has completed all runs*/
extern BOOL vtolEmpty(DROID *psDroid);
/*Checks a vtol for being fully armed and fully repaired to see if ready to
leave reArm pad */
@ -374,7 +374,7 @@ extern SWORD droidResistance(DROID *psDroid);
/*this is called to check the weapon is 'allowed'. Check if VTOL, the weapon is
direct fire. Also check numVTOLattackRuns for the weapon is not zero - return
TRUE if valid weapon*/
true if valid weapon*/
extern BOOL checkValidWeaponForProp(DROID_TEMPLATE *psTemplate);
extern const char *getDroidNameForRank(UDWORD rank);
@ -397,7 +397,7 @@ extern UWORD repairPowerPoint(DROID *psDroid);
/* audio finished callback */
extern BOOL droidAudioTrackStopped( void *psObj );
/*returns TRUE if droid type is one of the Cyborg types*/
/*returns true if droid type is one of the Cyborg types*/
extern BOOL cyborgDroid(DROID *psDroid);
// check for illegal references to droid we want to release

View File

@ -97,7 +97,7 @@ void processDemoCam( void )
{
UDWORD firstPlayer,otherPlayer;
DROID *psDroid;
BOOL bSkipOrder = FALSE;
BOOL bSkipOrder = false;
UDWORD i,numWith;
/* Is the demo camera actually active? */
@ -133,7 +133,7 @@ UDWORD i,numWith;
/* We need two sides for this to work! */
if(numWith<2)
{
bSkipOrder = TRUE;
bSkipOrder = true;
}
if(!bSkipOrder)
@ -164,8 +164,8 @@ UDWORD i,numWith;
/* Only do this if we've got a droid and an enemy building to attack! */
if(psDroid && apsStructLists[otherPlayer])
{
if( (orderState(psDroid,DORDER_NONE) == TRUE) ||
((orderState(psDroid,DORDER_GUARD) == TRUE) && (psDroid->action == DACTION_NONE)))
if( (orderState(psDroid,DORDER_NONE) == true) ||
((orderState(psDroid,DORDER_GUARD) == true) && (psDroid->action == DACTION_NONE)))
{
/* Make the droid attack the building - it'll indirectly route there too */
orderDroidLoc(psDroid,DORDER_SCOUT,
@ -203,11 +203,11 @@ BOOL demoGetStatus( void )
{
if(presentStatus == DC_ISACTIVE)
{
return(TRUE);
return(true);
}
else
{
return(FALSE);
return(false);
}
}
@ -230,7 +230,7 @@ DROID *psDroid;
UDWORD numWith;
BOOL bSeekOnlyLocations;
UDWORD i;
BOOL bHaveHuman = FALSE;
BOOL bHaveHuman = false;
PROPULSION_STATS *psPropStats;
//---
@ -239,7 +239,7 @@ PROPULSION_STATS *psPropStats;
//----
/* There may be droids, so don't rule it out */
bSeekOnlyLocations = FALSE;
bSeekOnlyLocations = false;
/* Check all the droid lists, looking for empty ones */
for(i = 0,numWith = 0; i<MAX_PLAYERS; i++)
{
@ -250,7 +250,7 @@ PROPULSION_STATS *psPropStats;
numWith++;
if(i<MAX_PLAYERS-2)
{
bHaveHuman = TRUE;
bHaveHuman = true;
}
}
}
@ -258,11 +258,11 @@ PROPULSION_STATS *psPropStats;
/* We need two sides for this to work! */
if(numWith<2 || !bHaveHuman)
{
bSeekOnlyLocations = TRUE;
bSeekOnlyLocations = true;
}
/* We haven't yet got a droid if we're looking for one...*/
gotNewTarget = FALSE;
gotNewTarget = false;
/* Keep going until we get one */
// while(!gotNewTarget)
@ -307,7 +307,7 @@ PROPULSION_STATS *psPropStats;
/* If there was a droid last time, deselect it */
if(psLastDroid && !psLastDroid->died)
{
psLastDroid->selected = FALSE;
psLastDroid->selected = false;
}
/* Jump to droid and track */
@ -315,10 +315,10 @@ PROPULSION_STATS *psPropStats;
/* Only do if we've got a droid and an enemy building to attack */
if(psDroid && apsStructLists[otherPlayer])
{
psDroid->selected = TRUE;
psDroid->selected = true;
selectedPlayer = player;
psLastDroid = psDroid;
// if(orderState(psDroid,DORDER_ATTACK) == FALSE)
// if(orderState(psDroid,DORDER_ATTACK) == false)
// {
orderDroidLoc(psDroid,DORDER_MOVE,
apsStructLists[otherPlayer]->pos.x, apsStructLists[otherPlayer]->pos.y);
@ -350,7 +350,7 @@ PROPULSION_STATS *psPropStats;
/* Go to a new location cos there's no droids left in the world....ahhhhhhh*/
case OVERRIDE_SEEK:
requestRadarTrack((16 + rand()%(mapWidth-31))*TILE_UNITS, (16 + rand()%(mapHeight-31)) * TILE_UNITS );
gotNewTarget = TRUE;
gotNewTarget = true;
break;
default:
break;
@ -394,10 +394,10 @@ BOOL tooNearEdge( UDWORD x, UDWORD y )
(y > ((visibleTiles.y/2) * TILE_UNITS)) &&
(y < ((mapHeight-(visibleTiles.y/2)) * TILE_UNITS)) )
{
return(FALSE);
return(false);
}
else
{
return(TRUE);
return(true);
}
}

View File

@ -107,13 +107,13 @@ SDWORD newHeight;
BOOL inHighlight(UDWORD realX, UDWORD realY)
{
BOOL retVal = FALSE;
BOOL retVal = false;
if (realX>=buildSite.xTL && realX<=buildSite.xBR)
{
if (realY>=buildSite.yTL && realY<=buildSite.yBR)
{
retVal = TRUE;
retVal = true;
}
}
@ -179,7 +179,7 @@ BOOL process3DBuilding(void)
//if not trying to build ignore
if (buildState == BUILD3D_NONE)
{
return TRUE;
return true;
}
@ -194,7 +194,7 @@ BOOL process3DBuilding(void)
bY += 1;
}
if (validLocation(sBuildDetails.psStats, bX, bY, selectedPlayer, TRUE))
if (validLocation(sBuildDetails.psStats, bX, bY, selectedPlayer, true))
{
buildState = BUILD3D_VALID;
}
@ -251,10 +251,10 @@ BOOL process3DBuilding(void)
{
sBuildDetails.CallBack(sBuildDetails.x,sBuildDetails.y,sBuildDetails.UserData);
buildState = BUILD3D_NONE;
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -263,7 +263,7 @@ BOOL found3DBuilding(UDWORD *x, UDWORD *y)
{
if (buildState != BUILD3D_FINISHED)
{
return FALSE;
return false;
}
*x = sBuildDetails.x;
@ -278,7 +278,7 @@ BOOL found3DBuilding(UDWORD *x, UDWORD *y)
buildState = BUILD3D_NONE;
return TRUE;
return true;
}
/* See if a second position for a build has been found */
@ -288,13 +288,13 @@ BOOL found3DBuildLocTwo(UDWORD *px1, UDWORD *py1, UDWORD *px2, UDWORD *py2)
((STRUCTURE_STATS *)sBuildDetails.psStats)->type != REF_DEFENSE) ||
wallDrag.status != DRAG_RELEASED)
{
return FALSE;
return false;
}
//whilst we're still looking for a valid location - return FALSE
//whilst we're still looking for a valid location - return false
if (buildState == BUILD3D_POS)
{
return FALSE;
return false;
}
wallDrag.status = DRAG_INACTIVE;
@ -302,7 +302,7 @@ BOOL found3DBuildLocTwo(UDWORD *px1, UDWORD *py1, UDWORD *px2, UDWORD *py2)
*py1 = wallDrag.y1;
*px2 = wallDrag.x2;
*py2 = wallDrag.y2;
return TRUE;
return true;
}
/*returns true if the build state is not equal to BUILD3D_NONE*/
@ -310,10 +310,10 @@ BOOL tryingToGetLocation(void)
{
if (buildState == BUILD3D_NONE)
{
return FALSE;
return false;
}
else
{
return TRUE;
return true;
}
}

View File

@ -274,19 +274,19 @@ static BOOL essentialEffect(EFFECT_GROUP group, EFFECT_TYPE type)
case EFFECT_DESTRUCTION:
case EFFECT_SAT_LASER:
case EFFECT_STRUCTURE:
return(TRUE);
return(true);
break;
case EFFECT_EXPLOSION:
if(type == EXPLOSION_TYPE_LAND_LIGHT)
{
return(TRUE);
return(true);
}
else
{
return(FALSE);
return(false);
}
default:
return(FALSE);
return(false);
break;
}
}
@ -298,9 +298,9 @@ static BOOL utterlyReject( EFFECT_GROUP group )
case EFFECT_BLOOD:
case EFFECT_DUST_BALL:
case EFFECT_CONSTRUCTION:
return(TRUE);
return(true);
default:
return(FALSE);
return(false);
break;
}
}
@ -430,7 +430,7 @@ void addEffect(Vector3i *pos, EFFECT_GROUP group, EFFECT_TYPE type,BOOL specifie
}
/* Quick optimsation to reject every second non-essential effect if it's off grid */
if(clipXY(pos->x, pos->z) == FALSE)
if(clipXY(pos->x, pos->z) == false)
{
/* If effect is essentail - then let it through */
if(!essentialEffect(group,type) )
@ -444,11 +444,11 @@ void addEffect(Vector3i *pos, EFFECT_GROUP group, EFFECT_TYPE type,BOOL specifie
/* Smoke gets culled more than most off grid effects */
if(group == EFFECT_SMOKE)
{
bSmoke = TRUE;
bSmoke = true;
}
else
{
bSmoke = FALSE;
bSmoke = false;
}
/* Others intermittently (50/50 for most and 25/100 for smoke */
if(bSmoke ? (aeCalls & 0x03) : (aeCalls & 0x01) )
@ -568,7 +568,7 @@ void addEffect(Vector3i *pos, EFFECT_GROUP group, EFFECT_TYPE type,BOOL specifie
effectSetUpFirework(&asEffectsList[freeEffect]);
break;
default:
ASSERT( FALSE,"Weirdy group type for an effect" );
ASSERT( false,"Weirdy group type for an effect" );
break;
}
@ -588,9 +588,9 @@ void addEffect(Vector3i *pos, EFFECT_GROUP group, EFFECT_TYPE type,BOOL specifie
*/
#ifdef DEBUG
if ( validatePie( group, asEffectsList[freeEffect].imd ) == FALSE )
if ( validatePie( group, asEffectsList[freeEffect].imd ) == false )
{
ASSERT( FALSE,"No PIE found or specified for an effect" );
ASSERT( false,"No PIE found or specified for an effect" );
}
#endif
@ -613,14 +613,14 @@ static BOOL validatePie( EFFECT_GROUP group, iIMDShape *pie )
if(group == EFFECT_DESTRUCTION || group == EFFECT_FIRE || group == EFFECT_SAT_LASER)
{
/* Ok in these cases */
return(TRUE);
return(true);
}
return(FALSE);
return(false);
}
else
{
return(TRUE);
return(true);
}
}
// ----------------------------------------------------------------------------------------
@ -745,9 +745,9 @@ static void updateFirework(EFFECT *psEffect)
UDWORD drop;
/* Move it */
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, TRUE);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, TRUE);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, TRUE);
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, true);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, true);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, true);
if(psEffect->type == FIREWORK_TYPE_LAUNCHER)
{
@ -757,7 +757,7 @@ static void updateFirework(EFFECT *psEffect)
dv.x = psEffect->position.x;
dv.z = psEffect->position.z;
dv.y = psEffect->position.y + (psEffect->radius / 2);
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_MEDIUM,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_MEDIUM,false,NULL,0);
audio_PlayStaticTrack(psEffect->position.x, psEffect->position.z, ID_SOUND_EXPLOSION);
for(dif =0; dif < (psEffect->radius*2); dif+=20)
@ -782,22 +782,22 @@ static void updateFirework(EFFECT *psEffect)
dv.z = psEffect->position.z + yDif;
dv.y = psEffect->position.y + dif;
effectGiveAuxVar(100);
addEffect(&dv,EFFECT_FIREWORK, FIREWORK_TYPE_STARBURST,FALSE,NULL,0);
addEffect(&dv,EFFECT_FIREWORK, FIREWORK_TYPE_STARBURST,false,NULL,0);
dv.x = psEffect->position.x - xDif;
dv.z = psEffect->position.z - yDif;
dv.y = psEffect->position.y + dif;
effectGiveAuxVar(100);
addEffect(&dv,EFFECT_FIREWORK, FIREWORK_TYPE_STARBURST,FALSE,NULL,0);
addEffect(&dv,EFFECT_FIREWORK, FIREWORK_TYPE_STARBURST,false,NULL,0);
dv.x = psEffect->position.x + xDif;
dv.z = psEffect->position.z - yDif;
dv.y = psEffect->position.y + dif;
effectGiveAuxVar(100);
addEffect(&dv,EFFECT_FIREWORK, FIREWORK_TYPE_STARBURST,FALSE,NULL,0);
addEffect(&dv,EFFECT_FIREWORK, FIREWORK_TYPE_STARBURST,false,NULL,0);
dv.x = psEffect->position.x - xDif;
dv.z = psEffect->position.z + yDif;
dv.y = psEffect->position.y + dif;
effectGiveAuxVar(100);
addEffect(&dv,EFFECT_FIREWORK, FIREWORK_TYPE_STARBURST,FALSE,NULL,0);
addEffect(&dv,EFFECT_FIREWORK, FIREWORK_TYPE_STARBURST,false,NULL,0);
}
}
killEffect(psEffect);
@ -810,7 +810,7 @@ static void updateFirework(EFFECT *psEffect)
dv.z = psEffect->position.z;
/* Add a trail graphic */
addEffect(&dv,EFFECT_SMOKE,SMOKE_TYPE_TRAIL,FALSE,NULL,0);
addEffect(&dv,EFFECT_SMOKE,SMOKE_TYPE_TRAIL,false,NULL,0);
}
}
else // must be a startburst
@ -882,7 +882,7 @@ static void updateSatLaser(EFFECT *psEffect)
dv.x = xPos+(200-rand()%400);
dv.z = yPos+(200-rand()%400);
dv.y = startHeight + rand()%100;
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_MEDIUM,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_MEDIUM,false,NULL,0);
}
/* Add a sound effect */
audio_PlayStaticTrack(psEffect->position.x, psEffect->position.z, ID_SOUND_EXPLOSION);
@ -891,7 +891,7 @@ static void updateSatLaser(EFFECT *psEffect)
dv.x = xPos;
dv.z = yPos;
dv.y = startHeight+SHOCK_WAVE_HEIGHT;
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_SHOCKWAVE,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_SHOCKWAVE,false,NULL,0);
/* Now, add the column of light */
@ -909,22 +909,22 @@ static void updateSatLaser(EFFECT *psEffect)
dv.z = yPos+yDif;
dv.y = startHeight+i;
effectGiveAuxVar(100);
addEffect(&dv,EFFECT_EXPLOSION, EXPLOSION_TYPE_MEDIUM,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION, EXPLOSION_TYPE_MEDIUM,false,NULL,0);
dv.x = xPos-xDif+i/64;
dv.z = yPos-yDif;
dv.y = startHeight+i;
effectGiveAuxVar(100);
addEffect(&dv,EFFECT_EXPLOSION, EXPLOSION_TYPE_MEDIUM,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION, EXPLOSION_TYPE_MEDIUM,false,NULL,0);
dv.x = xPos+xDif+i/64;
dv.z = yPos-yDif;
dv.y = startHeight+i;
effectGiveAuxVar(100);
addEffect(&dv,EFFECT_EXPLOSION, EXPLOSION_TYPE_MEDIUM,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION, EXPLOSION_TYPE_MEDIUM,false,NULL,0);
dv.x = xPos-xDif+i/64;
dv.z = yPos+yDif;
dv.y = startHeight+i;
effectGiveAuxVar(100);
addEffect(&dv,EFFECT_EXPLOSION, EXPLOSION_TYPE_MEDIUM,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION, EXPLOSION_TYPE_MEDIUM,false,NULL,0);
}
}
}
@ -1000,7 +1000,7 @@ static void updateExplosion(EFFECT *psEffect)
if(psEffect->type == EXPLOSION_TYPE_SHOCKWAVE)
{
psEffect->size += timeAdjustedIncrement(SHOCKWAVE_SPEED, TRUE);
psEffect->size += timeAdjustedIncrement(SHOCKWAVE_SPEED, true);
scaling = (float)psEffect->size / (float)MAX_SHOCKWAVE_SIZE;
psEffect->frameNumber = scaling * EffectGetNumFrames(psEffect);
@ -1048,7 +1048,7 @@ static void updateExplosion(EFFECT *psEffect)
/* Tesla explosions are the only ones that rise, or indeed move */
if(psEffect->type == EXPLOSION_TYPE_TESLA)
{
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, TRUE);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, true);
}
}
@ -1071,9 +1071,9 @@ static void updateBlood(EFFECT *psEffect)
}
}
/* Move it about in the world */
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, TRUE);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, TRUE);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, TRUE);
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, true);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, true);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, true);
}
// ----------------------------------------------------------------------------------------
@ -1115,9 +1115,9 @@ static void updatePolySmoke(EFFECT *psEffect)
}
/* Update position */
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, TRUE);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, TRUE);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, TRUE);
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, true);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, true);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, true);
/* If it doesn't get killed by frame number, then by age */
if(TEST_CYCLIC(psEffect))
@ -1161,9 +1161,9 @@ static void updateGraviton(EFFECT *psEffect)
}
/* Move it about in the world */
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, TRUE);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, TRUE);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, TRUE);
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, true);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, true);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, true);
/* If it's bounced/drifted off the map then kill it */
if (map_coord(psEffect->position.x) >= mapWidth
@ -1200,7 +1200,7 @@ static void updateGraviton(EFFECT *psEffect)
dv.z = psEffect->position.z;
/* Add a trail graphic */
addEffect(&dv,EFFECT_SMOKE,SMOKE_TYPE_TRAIL,FALSE,NULL,0);
addEffect(&dv,EFFECT_SMOKE,SMOKE_TYPE_TRAIL,false,NULL,0);
}
}
@ -1216,17 +1216,17 @@ static void updateGraviton(EFFECT *psEffect)
dv.x = psEffect->position.x;
dv.y = psEffect->position.y;
dv.z = psEffect->position.z;
addEffect(&dv,EFFECT_BLOOD,BLOOD_TYPE_NORMAL,FALSE,NULL,0);
addEffect(&dv,EFFECT_BLOOD,BLOOD_TYPE_NORMAL,false,NULL,0);
}
}
/* Spin it round a bit */
psEffect->rotation.x += timeAdjustedIncrement(psEffect->spin.x, TRUE);
psEffect->rotation.y += timeAdjustedIncrement(psEffect->spin.y, TRUE);
psEffect->rotation.z += timeAdjustedIncrement(psEffect->spin.z, TRUE);
psEffect->rotation.x += timeAdjustedIncrement(psEffect->spin.x, true);
psEffect->rotation.y += timeAdjustedIncrement(psEffect->spin.y, true);
psEffect->rotation.z += timeAdjustedIncrement(psEffect->spin.z, true);
/* Update velocity (and retarding of descent) according to present frame rate */
accel = timeAdjustedIncrement(GRAVITON_GRAVITY, TRUE);
accel = timeAdjustedIncrement(GRAVITON_GRAVITY, true);
psEffect->velocity.y += accel;
/* If it's bounced/drifted off the map then kill it */
@ -1271,7 +1271,7 @@ static void updateGraviton(EFFECT *psEffect)
dv.x = psEffect->position.x;
dv.y = psEffect->position.y + 10;
dv.z = psEffect->position.z;
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_VERY_SMALL,FALSE,NULL,0);
addEffect(&dv,EFFECT_EXPLOSION,EXPLOSION_TYPE_VERY_SMALL,false,NULL,0);
}
killEffect(psEffect);
return;
@ -1341,7 +1341,7 @@ static void updateDestruction(EFFECT *psEffect)
pos.x = psEffect->position.x;
pos.z = psEffect->position.z;
pos.y = psEffect->position.y;
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LARGE,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LARGE,false,NULL,0);
killEffect(psEffect);
return;
}
@ -1384,7 +1384,7 @@ static void updateDestruction(EFFECT *psEffect)
heightScatter = TILE_UNITS/6;
break;
default:
ASSERT( FALSE,"Weirdy destruction type effect" );
ASSERT( false,"Weirdy destruction type effect" );
break;
}
@ -1405,7 +1405,7 @@ static void updateDestruction(EFFECT *psEffect)
switch(effectType)
{
case 0:
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING,FALSE,NULL,0);
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING,false,NULL,0);
break;
case 1:
case 2:
@ -1414,16 +1414,16 @@ static void updateDestruction(EFFECT *psEffect)
case 5:
if(psEffect->type == DESTRUCTION_TYPE_SKYSCRAPER)
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LARGE,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_LARGE,false,NULL,0);
}
/* Only structures get the big explosions */
else if(psEffect->type==DESTRUCTION_TYPE_STRUCTURE)
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_MEDIUM,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_MEDIUM,false,NULL,0);
}
else
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
}
break;
case 6:
@ -1433,19 +1433,19 @@ static void updateDestruction(EFFECT *psEffect)
case 10:
if(psEffect->type == DESTRUCTION_TYPE_STRUCTURE)
{
addEffect(&pos,EFFECT_GRAVITON,GRAVITON_TYPE_EMITTING_ST,TRUE,getRandomDebrisImd(),0);
addEffect(&pos,EFFECT_GRAVITON,GRAVITON_TYPE_EMITTING_ST,true,getRandomDebrisImd(),0);
}
else
{
addEffect(&pos,EFFECT_GRAVITON,GRAVITON_TYPE_EMITTING_DR,TRUE,getRandomDebrisImd(),0);
addEffect(&pos,EFFECT_GRAVITON,GRAVITON_TYPE_EMITTING_DR,true,getRandomDebrisImd(),0);
}
break;
case 11:
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING,FALSE,NULL,0);
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING,false,NULL,0);
break;
case 12:
case 13:
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
break;
case 14:
/* Add sound effect, but only if we're less than 3/4 of the way thru' destruction */
@ -1491,9 +1491,9 @@ static void updateConstruction(EFFECT *psEffect)
/* Move it about in the world */
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, TRUE);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, TRUE);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, TRUE);
psEffect->position.x += timeAdjustedIncrement(psEffect->velocity.x, true);
psEffect->position.y += timeAdjustedIncrement(psEffect->velocity.y, true);
psEffect->position.z += timeAdjustedIncrement(psEffect->velocity.z, true);
/* If it doesn't get killed by frame number, then by height */
@ -1546,11 +1546,11 @@ static void updateFire(EFFECT *psEffect)
if(psEffect->type == FIRE_TYPE_SMOKY_BLUE)
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_FLAMETHROWER,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_FLAMETHROWER,false,NULL,0);
}
else
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
}
if(psEffect->type == FIRE_TYPE_SMOKY || psEffect->type == FIRE_TYPE_SMOKY_BLUE)
@ -1558,14 +1558,14 @@ static void updateFire(EFFECT *psEffect)
pos.x = (psEffect->position.x + ((rand() % psEffect->radius / 2) - (rand() % (2 * psEffect->radius / 2))));
pos.z = (psEffect->position.z + ((rand() % psEffect->radius / 2) - (rand() % (2 * psEffect->radius / 2))));
pos.y = map_Height(pos.x,pos.z);
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING_HIGH,FALSE,NULL,0);
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_DRIFTING_HIGH,false,NULL,0);
}
else
{
pos.x = (psEffect->position.x + ((rand() % psEffect->radius) - (rand() % (2 * psEffect->radius))));
pos.z = (psEffect->position.z + ((rand() % psEffect->radius) - (rand() % (2 * psEffect->radius))));
pos.y = map_Height(pos.x,pos.z);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
}
/*
@ -1574,7 +1574,7 @@ static void updateFire(EFFECT *psEffect)
pos.z = psEffect->position.z;
scatter.x = psEffect->radius; scatter.y = 0; scatter.z = psEffect->radius;
addMultiEffect(&pos,&scatter,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,2,0,0);
addMultiEffect(&pos,&scatter,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,2,0,0);
*/
}
@ -1728,23 +1728,23 @@ UDWORD timeSlice;
timeSlice = gameTime%2000;
if(timeSlice<400)
{
if(type == LL_MIDDLE) return(FALSE); else return(TRUE); // reject all expect middle
if(type == LL_MIDDLE) return(false); else return(true); // reject all expect middle
}
else if(timeSlice<800)
{
if(type == LL_OUTER) return(TRUE); else return(FALSE); // reject only outer
if(type == LL_OUTER) return(true); else return(false); // reject only outer
}
else if(timeSlice<1200)
{
return(FALSE); //reject none
return(false); //reject none
}
else if(timeSlice<1600)
{
if(type == LL_OUTER) return(TRUE); else return(FALSE); // reject only outer
if(type == LL_OUTER) return(true); else return(false); // reject only outer
}
else
{
if(type == LL_MIDDLE) return(FALSE); else return(TRUE); // reject all expect middle
if(type == LL_MIDDLE) return(false); else return(true); // reject all expect middle
}
}
@ -2076,7 +2076,7 @@ void effectSetupSmoke(EFFECT *psEffect)
psEffect->baseScale = 25;
break;
default:
ASSERT( FALSE,"Weird smoke type" );
ASSERT( false,"Weird smoke type" );
break;
}
@ -2125,7 +2125,7 @@ void effectSetupGraviton(EFFECT *psEffect)
psEffect->velocity.y = GRAVITON_INIT_VEL_Y;
break;
default:
ASSERT( FALSE,"Weirdy type of graviton" );
ASSERT( false,"Weirdy type of graviton" );
break;
}
@ -2400,11 +2400,11 @@ void initPerimeterSmoke(iIMDShape *pImd, UDWORD x, UDWORD y, UDWORD z)
pos.z = base.z + inStart + shift;
if(rand()%6==1)
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
}
else
{
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_BILLOW,FALSE,NULL,0);
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_BILLOW,false,NULL,0);
}
pos.x = base.x + i + shift;
@ -2412,11 +2412,11 @@ void initPerimeterSmoke(iIMDShape *pImd, UDWORD x, UDWORD y, UDWORD z)
pos.z = base.z + inEnd + shift;
if(rand()%6==1)
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
}
else
{
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_BILLOW,FALSE,NULL,0);
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_BILLOW,false,NULL,0);
}
}
@ -2437,11 +2437,11 @@ void initPerimeterSmoke(iIMDShape *pImd, UDWORD x, UDWORD y, UDWORD z)
pos.z = base.z + i + shift;
if(rand()%6==1)
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
}
else
{
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_BILLOW,FALSE,NULL,0);
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_BILLOW,false,NULL,0);
}
@ -2450,11 +2450,11 @@ void initPerimeterSmoke(iIMDShape *pImd, UDWORD x, UDWORD y, UDWORD z)
pos.z = base.z + i + shift;
if(rand()%6==1)
{
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SMALL,false,NULL,0);
}
else
{
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_BILLOW,FALSE,NULL,0);
addEffect(&pos,EFFECT_SMOKE,SMOKE_TYPE_BILLOW,false,NULL,0);
}
}
}
@ -2595,7 +2595,7 @@ static void effectStructureUpdates(void)
eventPos.x = psStructure->pos.x+psStructure->sDisplay.imd->connectors->x;
eventPos.z = psStructure->pos.y-psStructure->sDisplay.imd->connectors->y;
eventPos.y = psStructure->pos.z+psStructure->sDisplay.imd->connectors->z;
addEffect(&eventPos,EFFECT_SMOKE,SMOKE_TYPE_STEAM,FALSE,NULL,0);
addEffect(&eventPos,EFFECT_SMOKE,SMOKE_TYPE_STEAM,false,NULL,0);
if(selectedPlayer == psStructure->player)
@ -2626,13 +2626,13 @@ static void effectStructureUpdates(void)
/* Add an effect over the central spire - if
connected to Res Extractor and it is active*/
//look through the list to see if any connected Res Extr
active = FALSE;
active = false;
for (i=0; i < NUM_POWER_MODULES; i++)
{
if (psPowerGen->apResExtractors[i]
&& psPowerGen->apResExtractors[i]->pFunctionality->resourceExtractor.active)
{
active = TRUE;
active = true;
break;
}
}
@ -2646,7 +2646,7 @@ static void effectStructureUpdates(void)
{
eventPos.y = psStructure->pos.z + 48;
addEffect(&eventPos,EFFECT_EXPLOSION,
EXPLOSION_TYPE_TESLA,FALSE,NULL,0);
EXPLOSION_TYPE_TESLA,false,NULL,0);
if(selectedPlayer == psStructure->player)
{

View File

@ -55,9 +55,9 @@ BOOL environInit( void )
{
debug( LOG_ERROR, "Can't get memory for the environment data" );
abort();
return FALSE;
return false;
}
return TRUE;
return true;
}
/** This function is called whenever the map changes - load new level or return from an offWorld map. */

View File

@ -115,7 +115,7 @@ static void featureType(FEATURE_STATS* psFeature, const char *pType)
}
}
ASSERT(FALSE, "featureType: Unknown feature type");
ASSERT(false, "featureType: Unknown feature type");
}
/* Load the feature stats */
@ -134,7 +134,7 @@ BOOL loadFeatureStats(const char *pFeatureData, UDWORD bufferSize)
{
debug( LOG_ERROR, "Feature Stats - Out of memory" );
abort();
return FALSE;
return false;
}
psFeature = asFeatureStats;
@ -161,7 +161,7 @@ BOOL loadFeatureStats(const char *pFeatureData, UDWORD bufferSize)
if (!allocateName(&psFeature->pName, featureName))
{
return FALSE;
return false;
}
//determine the feature type
@ -179,7 +179,7 @@ BOOL loadFeatureStats(const char *pFeatureData, UDWORD bufferSize)
{
debug( LOG_ERROR, "Cannot find the feature PIE for record %s", getName( psFeature->pName ) );
abort();
return FALSE;
return false;
}
psFeature->ref = REF_FEATURE_START + i;
@ -190,7 +190,7 @@ BOOL loadFeatureStats(const char *pFeatureData, UDWORD bufferSize)
psFeature++;
}
return TRUE;
return true;
}
/* Release the feature stats memory */
@ -285,7 +285,7 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,BOOL FromSave)
debug( LOG_NEVER, "Oil resource at (%d,%d) is unreachable", startX, startY );
}
if(FromSave == TRUE) {
if(FromSave == true) {
psFeature->pos.x = (UWORD)x;
psFeature->pos.y = (UWORD)y;
} else {
@ -307,7 +307,7 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,BOOL FromSave)
psFeature->direction = 0;
}
//psFeature->damage = featureDamage;
psFeature->selected = FALSE;
psFeature->selected = false;
psFeature->psStats = psStats;
//psFeature->subType = psStats->subType;
psFeature->body = psStats->body;
@ -315,7 +315,7 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,BOOL FromSave)
psFeature->sensorRange = 0;
psFeature->sensorPower = 0;
psFeature->ECMMod = 0;
psFeature->bTargetted = FALSE;
psFeature->bTargetted = false;
psFeature->timeLastHit = 0;
// it has never been drawn
@ -405,7 +405,7 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,BOOL FromSave)
}
}
if( (!psStats->tileDraw) && (FromSave == FALSE) )
if( (!psStats->tileDraw) && (FromSave == false) )
{
psTile->height = (UBYTE)(height / ELEVATION_SCALE);
}
@ -478,7 +478,7 @@ void removeFeature(FEATURE *psDel)
if (psDel->died)
{
// feature has already been killed, quit
ASSERT( FALSE,
ASSERT( false,
"removeFeature: feature already dead" );
return;
}
@ -510,7 +510,7 @@ void removeFeature(FEATURE *psDel)
pos.x = psDel->pos.x;
pos.z = psDel->pos.y;
pos.y = map_Height(pos.x,pos.z);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_DISCOVERY,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_DISCOVERY,false,NULL,0);
scoreUpdateVar(WD_ARTEFACTS_FOUND);
intRefreshScreen();
}
@ -576,7 +576,7 @@ void destroyFeature(FEATURE *psDel)
pos.x = psDel->pos.x + widthScatter - rand()%(2*widthScatter);
pos.z = psDel->pos.y + breadthScatter - rand()%(2*breadthScatter);
pos.y = psDel->pos.z + 32 + rand()%heightScatter;
addEffect(&pos,EFFECT_EXPLOSION,explosionSize,FALSE,NULL,0);
addEffect(&pos,EFFECT_EXPLOSION,explosionSize,false,NULL,0);
}
// if(psDel->sDisplay.imd->pos.ymax>300) // WARNING - STATS CHANGE NEEDED!!!!!!!!!!!
@ -585,7 +585,7 @@ void destroyFeature(FEATURE *psDel)
pos.x = psDel->pos.x;
pos.z = psDel->pos.y;
pos.y = psDel->pos.z;
addEffect(&pos,EFFECT_DESTRUCTION,DESTRUCTION_TYPE_SKYSCRAPER,TRUE,psDel->sDisplay.imd,0);
addEffect(&pos,EFFECT_DESTRUCTION,DESTRUCTION_TYPE_SKYSCRAPER,true,psDel->sDisplay.imd,0);
initPerimeterSmoke(psDel->sDisplay.imd,pos.x,pos.y,pos.z);
// ----- Flip all the tiles under the skyscraper to a rubble tile
@ -630,7 +630,7 @@ void destroyFeature(FEATURE *psDel)
pos.x = psDel->pos.x;
pos.z = psDel->pos.y;
pos.y = map_Height(pos.x,pos.z);
addEffect(&pos,EFFECT_DESTRUCTION,DESTRUCTION_TYPE_FEATURE,FALSE,NULL,0);
addEffect(&pos,EFFECT_DESTRUCTION,DESTRUCTION_TYPE_FEATURE,false,NULL,0);
//play sound
// ffs gj

View File

@ -73,7 +73,7 @@ BOOL formationInitialise(void)
{
psFormationList = NULL;
return TRUE;
return true;
}
// Shutdown the formation system
@ -101,7 +101,7 @@ BOOL formationNew(FORMATION **ppsFormation, FORMATION_TYPE type,
if (psNew == NULL)
{
debug(LOG_ERROR, "formationNew: Out of memory");
return FALSE;
return false;
}
// debug( LOG_NEVER, "formationNew: type %d, at (%d,%d), dir %d\n", type, x, y, dir );
@ -147,7 +147,7 @@ BOOL formationNew(FORMATION **ppsFormation, FORMATION_TYPE type,
psNew->asLines[0].member = -1;
break;
default:
ASSERT( FALSE,"fmNewFormation: unknown formation type" );
ASSERT( false,"fmNewFormation: unknown formation type" );
break;
}
@ -156,7 +156,7 @@ BOOL formationNew(FORMATION **ppsFormation, FORMATION_TYPE type,
*ppsFormation = psNew;
return TRUE;
return true;
}
@ -339,7 +339,7 @@ void formationReset(FORMATION *psFormation)
((DROID *)psObj)->sMove.psFormation = NULL;
break;
default:
ASSERT( FALSE,
ASSERT( false,
"formationReset: unknown unit type" );
break;
}
@ -384,7 +384,7 @@ static void formationFindFree(FORMATION *psFormation, BASE_OBJECT *psObj,
if (psFormation->free == -1)
{
ASSERT( FALSE,
ASSERT( false,
"formationFindFree: no members left to allocate" );
*pX = psFormation->x;
*pY = psFormation->y;
@ -407,7 +407,7 @@ static void formationFindFree(FORMATION *psFormation, BASE_OBJECT *psObj,
rank = 1;
prev = -1;
unit = asLines[line].member;
found = FALSE;
found = false;
while (!found && rank <= MAX_RANK)
{
ASSERT( unit < F_MAXMEMBERS, "formationFindFree: unit out of range" );
@ -418,7 +418,7 @@ static void formationFindFree(FORMATION *psFormation, BASE_OBJECT *psObj,
radius = formationObjRadius(asMembers[unit].psObj);
if (objRadius*2 <= asMembers[unit].dist - radius - currDist)
{
found = TRUE;
found = true;
}
else
{
@ -437,7 +437,7 @@ static void formationFindFree(FORMATION *psFormation, BASE_OBJECT *psObj,
}
else
{
found = TRUE;
found = true;
}
if (found)
@ -447,7 +447,7 @@ static void formationFindFree(FORMATION *psFormation, BASE_OBJECT *psObj,
if (fpathBlockingTile(map_coord(x), map_coord(y)))
{
// blocked, try the next rank
found = FALSE;
found = false;
currDist = psFormation->size * rank;
rank += 1;
}
@ -592,7 +592,7 @@ BOOL formationGetPos( FORMATION *psFormation, BASE_OBJECT *psObj,
/* if (psFormation->refCount == 1)
{
// nothing else in the formation so don't do anything
return FALSE;
return false;
}*/
// see if the unit is close enough to join the formation
@ -603,7 +603,7 @@ BOOL formationGetPos( FORMATION *psFormation, BASE_OBJECT *psObj,
// rangeSq = rangeSq*rangeSq;
// if (distSq > F_JOINRANGE*F_JOINRANGE)
// {
// return FALSE;
// return false;
// }
// see if the unit is already in the formation
@ -648,20 +648,20 @@ BOOL formationGetPos( FORMATION *psFormation, BASE_OBJECT *psObj,
}
else
{
return FALSE;
return false;
}
// check the unit can get to the formation position
if ( bCheckLOS && !fpathTileLOS(map_coord(psObj->pos.x), map_coord(psObj->pos.y),
map_coord(x), map_coord(y)))
{
return FALSE;
return false;
}
*pX = x;
*pY = y;
return TRUE;
return true;
}
@ -678,11 +678,11 @@ BOOL formationMember(FORMATION *psFormation, BASE_OBJECT *psObj)
{
if (asMembers[member].psObj == psObj)
{
return TRUE;
return true;
}
}
return FALSE;
return false;
}
SDWORD formationObjRadius(BASE_OBJECT *psObj)
@ -721,7 +721,7 @@ SDWORD formationObjRadius(BASE_OBJECT *psObj)
radius = psObj->sDisplay.imd->radius/2;
break;
default:
ASSERT( FALSE,"formationObjRadius: unknown object type" );
ASSERT( false,"formationObjRadius: unknown object type" );
radius = 0;
break;
}

View File

@ -90,7 +90,7 @@ BOOL fpathInitialise(void)
fpathBlockingTile = fpathGroundBlockingTile;
psPartialRouteObj = NULL;
return TRUE;
return true;
}
// update routine for the findpath system
@ -118,7 +118,7 @@ BOOL fpathGroundBlockingTile(SDWORD x, SDWORD y)
x >= scrollMaxX-1 || y >= scrollMaxY-1)
{
// coords off map - auto blocking tile
return TRUE;
return true;
}
}
@ -132,9 +132,9 @@ BOOL fpathGroundBlockingTile(SDWORD x, SDWORD y)
(terrainType(psTile) == TER_CLIFFFACE) ||
(terrainType(psTile) == TER_WATER))
{
return TRUE;
return true;
}
return FALSE;
return false;
}
// Check if the map tile at a location blocks a droid
@ -146,7 +146,7 @@ BOOL fpathHoverBlockingTile(SDWORD x, SDWORD y)
x >= scrollMaxX-1 || y >= scrollMaxY-1)
{
// coords off map - auto blocking tile
return TRUE;
return true;
}
ASSERT( !(x <1 || y < 1 || x >= (SDWORD)mapWidth-1 || y >= (SDWORD)mapHeight-1),
@ -158,9 +158,9 @@ BOOL fpathHoverBlockingTile(SDWORD x, SDWORD y)
(TILE_OCCUPIED(psTile) && !TILE_IS_NOTBLOCKING(psTile)) ||
(terrainType(psTile) == TER_CLIFFFACE))
{
return TRUE;
return true;
}
return FALSE;
return false;
}
// Check if the map tile at a location blocks a vtol
@ -179,18 +179,18 @@ static BOOL fpathLiftBlockingTile(SDWORD x, SDWORD y)
{
if ( x<1 || y<1 || x>=(SDWORD)mapWidth-1 || y>=(SDWORD)mapHeight-1 )
{
return TRUE;
return true;
}
psTile = mapTile((UDWORD)x, (UDWORD)y);
if ( TILE_HAS_TALLSTRUCTURE(psTile) )
{
return TRUE;
return true;
}
else
{
return FALSE;
return false;
}
}
@ -200,7 +200,7 @@ static BOOL fpathLiftBlockingTile(SDWORD x, SDWORD y)
y >= (SDWORD)mapHeight-VTOL_MAP_EDGE_TILES )
{
// coords off map - auto blocking tile
return TRUE;
return true;
}
ASSERT( !(x <1 || y < 1 || x >= (SDWORD)mapWidth-1 || y >= (SDWORD)mapHeight-1),
@ -209,7 +209,7 @@ static BOOL fpathLiftBlockingTile(SDWORD x, SDWORD y)
/* no tiles are blocking if returning to rearm */
if( psDroid->action == DACTION_MOVETOREARM )
{
return FALSE;
return false;
}
psTile = mapTile((UDWORD)x, (UDWORD)y);
@ -237,20 +237,20 @@ static BOOL fpathLiftBlockingTile(SDWORD x, SDWORD y)
(SDWORD) map_Height( g_psObjRoute->pos.x, g_psObjRoute->pos.y );
if ( iLiftHeight > iBlockingHeight )
{
return TRUE;
return true;
}
else
{
return FALSE;
return false;
}
}
else if ( TILE_HAS_TALLSTRUCTURE(psTile) )
{
return TRUE;
return true;
}
else
{
return FALSE;
return false;
}
}
@ -261,11 +261,11 @@ BOOL fpathLiftSlideBlockingTile(SDWORD x, SDWORD y)
x >= (SDWORD)GetWidthOfMap()-1 ||
y >= (SDWORD)GetHeightOfMap()-1 )
{
return TRUE;
return true;
}
else
{
return FALSE;
return false;
}
}
@ -298,7 +298,7 @@ static BOOL fpathEndPointCallback(SDWORD x, SDWORD y, SDWORD dist)
vy = y - finalY;
if (vx*vectorX + vy*vectorY <=0)
{
return FALSE;
return false;
}
// note the last clear tile
@ -309,10 +309,10 @@ static BOOL fpathEndPointCallback(SDWORD x, SDWORD y, SDWORD dist)
}
else
{
obstruction = TRUE;
obstruction = true;
}
return TRUE;
return true;
}
/* To plan a path from psObj's current position to 2D position Vector(targetX,targetY)
@ -370,10 +370,10 @@ static BOOL fpathPointInGateway(SDWORD x, SDWORD y, GATEWAY *psGate)
if ((x >= psGate->x1) && (x <= psGate->x2) &&
(y >= psGate->y1) && (y <= psGate->y2))
{
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -627,13 +627,13 @@ static BOOL fpathRouteCloser(MOVE_CONTROL *psMoveCntl, ASTAR_ROUTE *psAStarRoute
if (psAStarRoute->numPoints == 0)
{
// no route to copy do nothing
return FALSE;
return false;
}
if (psMoveCntl->numPoints == 0)
{
// no previous route - this has to be better
return TRUE;
return true;
}
// see which route is closest to the final destination
@ -647,10 +647,10 @@ static BOOL fpathRouteCloser(MOVE_CONTROL *psMoveCntl, ASTAR_ROUTE *psAStarRoute
if (nextDist < prevDist)
{
return TRUE;
return true;
}
return FALSE;
return false;
}
// create a final route from a gateway route
@ -672,11 +672,11 @@ static FPATH_RETVAL fpathGatewayRoute(BASE_OBJECT *psObj, SDWORD routeMode, SDWO
// initialise the move control structures
psMoveCntl->numPoints = 0;
sAStarRoute.numPoints = 0;
bFirstRoute = TRUE;
bFirstRoute = true;
}
// keep trying gateway routes until out of options
bRouting = TRUE;
bRouting = true;
while (bRouting)
{
if (routeMode == ASR_NEWROUTE)
@ -731,7 +731,7 @@ static FPATH_RETVAL fpathGatewayRoute(BASE_OBJECT *psObj, SDWORD routeMode, SDWO
matchPoints = 0;
sAStarRoute.numPoints = 0;
}
bFirstRoute = FALSE;
bFirstRoute = false;
if (routeMode == ASR_NEWROUTE)
{
@ -748,8 +748,8 @@ static FPATH_RETVAL fpathGatewayRoute(BASE_OBJECT *psObj, SDWORD routeMode, SDWO
}
// now generate the route
bRouting = FALSE;
bFinished = FALSE;
bRouting = false;
bFinished = false;
while (!bFinished)
{
if ((psCurrRoute == NULL) ||
@ -823,7 +823,7 @@ static FPATH_RETVAL fpathGatewayRoute(BASE_OBJECT *psObj, SDWORD routeMode, SDWO
fpathAppendRoute(psMoveCntl, &sAStarRoute);
}
fpathBlockGatewayLink(psLastGW, psCurrRoute);
bRouting = TRUE;
bRouting = true;
break;
}
}
@ -838,7 +838,7 @@ static FPATH_RETVAL fpathGatewayRoute(BASE_OBJECT *psObj, SDWORD routeMode, SDWO
}
else
{
bFinished = TRUE;
bFinished = true;
}
}
}
@ -1010,7 +1010,7 @@ FPATH_RETVAL fpathRoute(BASE_OBJECT *psObj, MOVE_CONTROL *psMoveCntl,
clearX = finalX; clearY = finalY;
vectorX = startX - finalX;
vectorY = startY - finalY;
obstruction = FALSE;
obstruction = false;
// cast the ray to find the last clear tile before the obstruction
rayCast(startX,startY, rayPointsToAngle(startX,startY, finalX, finalY),
@ -1136,7 +1136,7 @@ exit:
{
if (psTile->tileInfoBits & BITS_FPATHBLOCK)
{
ASSERT( FALSE,"fpathRoute: blocking flags still in the map" );
ASSERT( false,"fpathRoute: blocking flags still in the map" );
}
psTile += 1;
}
@ -1161,11 +1161,11 @@ static BOOL fpathFindFirstRoutePoint(MOVE_CONTROL *psMove, SDWORD *pIndex, SDWOR
// found it if the dot products have the same sign
if ( (vx1 * vx2 + vy1 * vy2) < 0 )
{
return TRUE;
return true;
}
}
return FALSE;
return false;
}
// See if there is another unit on your side that has a route this unit can use
@ -1177,7 +1177,7 @@ static BOOL fpathFindRoute(DROID *psDroid, SDWORD sX,SDWORD sY, SDWORD tX,SDWORD
if (!formationFind(&psFormation, tX,tY))
{
return FALSE;
return false;
}
// now look for a unit in this formation with a route that can be used
@ -1203,7 +1203,7 @@ static BOOL fpathFindRoute(DROID *psDroid, SDWORD sX,SDWORD sY, SDWORD tX,SDWORD
clearX = finalX; clearY = finalY;
vectorX = startX - finalX;
vectorY = startY - finalY;
obstruction = FALSE;
obstruction = false;
// cast the ray to find the last clear tile before the obstruction
rayCast(startX,startY, rayPointsToAngle(startX,startY, finalX, finalY),
@ -1220,10 +1220,10 @@ static BOOL fpathFindRoute(DROID *psDroid, SDWORD sX,SDWORD sY, SDWORD tX,SDWORD
// now see if the route
return TRUE;
return true;
}
}
}
return FALSE;
return false;
}

View File

@ -76,9 +76,9 @@ static char textureSize[WIDG_MAXSTR];
tMode titleMode; // the global case
char aLevelName[MAX_LEVEL_NAME_SIZE+1]; //256]; // vital! the wrf file to use.
BOOL bForceEditorLoaded = FALSE;
BOOL bUsingKeyboard = FALSE; // to disable mouse pointer when using keys.
BOOL bUsingSlider = FALSE;
BOOL bForceEditorLoaded = false;
BOOL bUsingKeyboard = false; // to disable mouse pointer when using keys.
BOOL bUsingSlider = false;
// ////////////////////////////////////////////////////////////////////////////
// Function Definitions
@ -105,17 +105,17 @@ static void displayBigSlider (WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset,
// Returns TRUE if escape key pressed on PC or close button pressed on Playstation.
// Returns true if escape key pressed on PC or close button pressed on Playstation.
//
BOOL CancelPressed(void)
{
if(keyPressed(KEY_ESC)) {
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -182,34 +182,34 @@ void changeTitleMode(tMode mode)
startConnectionScreen();
break;
case MULTIOPTION:
bUsingKeyboard = FALSE;
bUsingKeyboard = false;
if(oldMode == MULTILIMIT)
{
startMultiOptions(TRUE);
startMultiOptions(true);
}
else
{
startMultiOptions(FALSE);
startMultiOptions(false);
}
break;
case GAMEFIND:
bUsingKeyboard = FALSE;
bUsingKeyboard = false;
startGameFind();
break;
case MULTILIMIT:
bUsingKeyboard = FALSE;
bUsingKeyboard = false;
startLimitScreen();
break;
case KEYMAP:
bUsingKeyboard = FALSE;
startKeyMapEditor(TRUE);
bUsingKeyboard = false;
startKeyMapEditor(true);
break;
case STARTGAME:
case QUIT:
case LOADSAVEGAME:
bUsingKeyboard = FALSE;
bForceEditorLoaded = FALSE;
bUsingKeyboard = false;
bForceEditorLoaded = false;
case SHOWINTRO:
break;
@ -234,16 +234,16 @@ BOOL startTitleMenu(void)
addTopForm();
addBottomForm();
addTextButton(FRONTEND_SINGLEPLAYER, FRONTEND_POS2X, FRONTEND_POS2Y, _("Single Player Campaign"), FALSE, FALSE);
addTextButton(FRONTEND_MULTIPLAYER, FRONTEND_POS3X, FRONTEND_POS3Y, _("Multi Player Game"), FALSE, FALSE);
addTextButton(FRONTEND_TUTORIAL, FRONTEND_POS4X, FRONTEND_POS4Y, _("Tutorial") ,FALSE,FALSE);
addTextButton(FRONTEND_OPTIONS, FRONTEND_POS5X, FRONTEND_POS5Y, _("Options") ,FALSE,FALSE);
addTextButton(FRONTEND_SINGLEPLAYER, FRONTEND_POS2X, FRONTEND_POS2Y, _("Single Player Campaign"), false, false);
addTextButton(FRONTEND_MULTIPLAYER, FRONTEND_POS3X, FRONTEND_POS3Y, _("Multi Player Game"), false, false);
addTextButton(FRONTEND_TUTORIAL, FRONTEND_POS4X, FRONTEND_POS4Y, _("Tutorial") ,false,false);
addTextButton(FRONTEND_OPTIONS, FRONTEND_POS5X, FRONTEND_POS5Y, _("Options") ,false,false);
addTextButton(FRONTEND_QUIT, FRONTEND_POS6X, FRONTEND_POS6Y, _("Quit Game"), FALSE, FALSE);
addTextButton(FRONTEND_QUIT, FRONTEND_POS6X, FRONTEND_POS6Y, _("Quit Game"), false, false);
addSideText(FRONTEND_SIDETEXT, FRONTEND_SIDEX, FRONTEND_SIDEY, _("MAIN MENU"));
return TRUE;
return true;
}
@ -276,7 +276,7 @@ BOOL runTitleMenu(void)
widgDisplayScreen(psWScreen); // show the widgets currently running
return TRUE;
return true;
}
@ -290,13 +290,13 @@ BOOL startTutorialMenu(void)
addBottomForm();
addTextButton(FRONTEND_TUTORIAL, FRONTEND_POS3X,FRONTEND_POS3Y, _("Tutorial"),FALSE,FALSE);
addTextButton(FRONTEND_FASTPLAY, FRONTEND_POS4X,FRONTEND_POS4Y, _("Fast Play"),FALSE,FALSE);
addTextButton(FRONTEND_TUTORIAL, FRONTEND_POS3X,FRONTEND_POS3Y, _("Tutorial"),false,false);
addTextButton(FRONTEND_FASTPLAY, FRONTEND_POS4X,FRONTEND_POS4Y, _("Fast Play"),false,false);
addSideText (FRONTEND_SIDETEXT ,FRONTEND_SIDEX,FRONTEND_SIDEY,_("TUTORIALS"));
// TRANSLATORS: "Return", in this context, means "return to previous screen/menu"
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,TRUE);
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,true);
return TRUE;
return true;
}
BOOL runTutorialMenu(void)
@ -333,7 +333,7 @@ BOOL runTutorialMenu(void)
widgDisplayScreen(psWScreen); // show the widgets currently running
return TRUE;
return true;
}
@ -346,11 +346,11 @@ void startSinglePlayerMenu(void)
addTopForm();
addBottomForm();
addTextButton(FRONTEND_LOADGAME, FRONTEND_POS4X,FRONTEND_POS4Y, _("Load Campaign"),FALSE,FALSE);
addTextButton(FRONTEND_NEWGAME, FRONTEND_POS3X,FRONTEND_POS3Y,_("New Campaign") ,FALSE,FALSE);
addTextButton(FRONTEND_LOADGAME, FRONTEND_POS4X,FRONTEND_POS4Y, _("Load Campaign"),false,false);
addTextButton(FRONTEND_NEWGAME, FRONTEND_POS3X,FRONTEND_POS3Y,_("New Campaign") ,false,false);
addSideText (FRONTEND_SIDETEXT ,FRONTEND_SIDEX,FRONTEND_SIDEY,_("SINGLE PLAYER"));
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,TRUE);
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,true);
}
static void frontEndNewGame( void )
@ -360,7 +360,7 @@ static void frontEndNewGame( void )
strlcpy(aLevelName, DEFAULT_LEVEL, sizeof(aLevelName));
seq_ClearSeqList();
seq_AddSeqToList("cam1/c001.rpl",NULL,"cam1/c001.txa",FALSE);
seq_AddSeqToList("cam1/c001.rpl",NULL,"cam1/c001.txa",false);
seq_StartNextFullScreenVideo();
break;
@ -392,7 +392,7 @@ BOOL runSinglePlayerMenu(void)
if(bLoadSaveUp)
{
if(runLoadSave(FALSE))// check for file name.
if(runLoadSave(false))// check for file name.
{
loadOK();
}
@ -412,9 +412,9 @@ BOOL runSinglePlayerMenu(void)
strlcpy(aLevelName, "CAM_2A", sizeof(aLevelName));
changeTitleMode(STARTGAME);
#ifdef LOADINGBACKDROPS
AddLoadingBackdrop(TRUE);
AddLoadingBackdrop(true);
#else
initLoadingScreen(TRUE);
initLoadingScreen(true);
#endif
break;
@ -422,9 +422,9 @@ BOOL runSinglePlayerMenu(void)
strlcpy(aLevelName, "CAM_3A", sizeof(aLevelName));
changeTitleMode(STARTGAME);
#ifdef LOADINGBACKDROPS
AddLoadingBackdrop(TRUE);
AddLoadingBackdrop(true);
#else
initLoadingScreen(TRUE);
initLoadingScreen(true);
#endif
break;
case FRONTEND_LOADGAME:
@ -457,7 +457,7 @@ BOOL runSinglePlayerMenu(void)
displayLoadSave();
}
return TRUE;
return true;
}
@ -471,14 +471,14 @@ BOOL startMultiPlayerMenu(void)
addSideText (FRONTEND_SIDETEXT , FRONTEND_SIDEX,FRONTEND_SIDEY,_("MULTI PLAYER"));
addTextButton(FRONTEND_HOST, FRONTEND_POS2X,FRONTEND_POS2Y, _("Host Game"),FALSE,FALSE);
addTextButton(FRONTEND_JOIN, FRONTEND_POS3X,FRONTEND_POS3Y, _("Join Game"),FALSE,FALSE);
addTextButton(FRONTEND_HOST, FRONTEND_POS2X,FRONTEND_POS2Y, _("Host Game"),false,false);
addTextButton(FRONTEND_JOIN, FRONTEND_POS3X,FRONTEND_POS3Y, _("Join Game"),false,false);
addTextButton(FRONTEND_SKIRMISH, FRONTEND_POS4X,FRONTEND_POS4Y, _("One Player Skirmish"),FALSE,FALSE);
addTextButton(FRONTEND_SKIRMISH, FRONTEND_POS4X,FRONTEND_POS4Y, _("One Player Skirmish"),false,false);
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,TRUE);
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,true);
return TRUE;
return true;
}
@ -490,13 +490,13 @@ BOOL runMultiPlayerMenu(void)
switch(id)
{
case FRONTEND_SKIRMISH:
NetPlay.bComms = FALSE; // use network = false
NetPlay.bComms = false; // use network = false
case FRONTEND_HOST:
ingame.bHostSetup = TRUE;
ingame.bHostSetup = true;
changeTitleMode(MULTIOPTION);
break;
case FRONTEND_JOIN:
ingame.bHostSetup = FALSE;
ingame.bHostSetup = false;
changeTitleMode(PROTOCOL);
break;
@ -509,7 +509,7 @@ BOOL runMultiPlayerMenu(void)
widgDisplayScreen(psWScreen); // show the widgets currently running
return TRUE;
return true;
}
@ -522,14 +522,14 @@ BOOL startOptionsMenu(void)
addBottomForm();
addSideText (FRONTEND_SIDETEXT , FRONTEND_SIDEX,FRONTEND_SIDEY, _("GAME OPTIONS"));
addTextButton(FRONTEND_GAMEOPTIONS, FRONTEND_POS2X,FRONTEND_POS2Y, _("Game Options"),FALSE,FALSE);
addTextButton(FRONTEND_GAMEOPTIONS2,FRONTEND_POS3X,FRONTEND_POS3Y, _("Graphics Options"),FALSE,FALSE);
addTextButton(FRONTEND_GAMEOPTIONS4, FRONTEND_POS4X,FRONTEND_POS4Y, "Video Options", FALSE, FALSE);
addTextButton(FRONTEND_GAMEOPTIONS3, FRONTEND_POS5X,FRONTEND_POS5Y, _("Audio Options"),FALSE,FALSE);
addTextButton(FRONTEND_KEYMAP, FRONTEND_POS6X,FRONTEND_POS6Y, _("Key Mappings"),FALSE,FALSE);
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,TRUE);
addTextButton(FRONTEND_GAMEOPTIONS, FRONTEND_POS2X,FRONTEND_POS2Y, _("Game Options"),false,false);
addTextButton(FRONTEND_GAMEOPTIONS2,FRONTEND_POS3X,FRONTEND_POS3Y, _("Graphics Options"),false,false);
addTextButton(FRONTEND_GAMEOPTIONS4, FRONTEND_POS4X,FRONTEND_POS4Y, "Video Options", false, false);
addTextButton(FRONTEND_GAMEOPTIONS3, FRONTEND_POS5X,FRONTEND_POS5Y, _("Audio Options"),false,false);
addTextButton(FRONTEND_KEYMAP, FRONTEND_POS6X,FRONTEND_POS6Y, _("Key Mappings"),false,false);
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,true);
return TRUE;
return true;
}
@ -584,7 +584,7 @@ BOOL runOptionsMenu(void)
widgDisplayScreen(psWScreen); // show the widgets currently running
return TRUE;
return true;
}
// ////////////////////////////////////////////////////////////////////////////
@ -598,99 +598,99 @@ BOOL startGameOptions2Menu(void)
////////////
// mouseflip
addTextButton(FRONTEND_MFLIP, FRONTEND_POS2X-35, FRONTEND_POS2Y, _("Reverse Mouse"),TRUE,FALSE);
addTextButton(FRONTEND_MFLIP, FRONTEND_POS2X-35, FRONTEND_POS2Y, _("Reverse Mouse"),true,false);
if( getInvertMouseStatus() )
{// flipped
addTextButton(FRONTEND_MFLIP_R, FRONTEND_POS2M-55, FRONTEND_POS2Y, _("On"),TRUE,FALSE);
addTextButton(FRONTEND_MFLIP_R, FRONTEND_POS2M-55, FRONTEND_POS2Y, _("On"),true,false);
}
else
{ // not flipped
addTextButton(FRONTEND_MFLIP_R, FRONTEND_POS2M-55, FRONTEND_POS2Y, _("Off"),TRUE,FALSE);
addTextButton(FRONTEND_MFLIP_R, FRONTEND_POS2M-55, FRONTEND_POS2Y, _("Off"),true,false);
}
////////////
// screenshake
addTextButton(FRONTEND_SSHAKE, FRONTEND_POS3X-35, FRONTEND_POS3Y, _("Screen Shake"),TRUE,FALSE);
addTextButton(FRONTEND_SSHAKE, FRONTEND_POS3X-35, FRONTEND_POS3Y, _("Screen Shake"),true,false);
if(getShakeStatus())
{// shaking on
addTextButton(FRONTEND_SSHAKE_R, FRONTEND_POS3M-55, FRONTEND_POS3Y, _("On"),TRUE,FALSE);
addTextButton(FRONTEND_SSHAKE_R, FRONTEND_POS3M-55, FRONTEND_POS3Y, _("On"),true,false);
}
else
{//shaking off.
addTextButton(FRONTEND_SSHAKE_R, FRONTEND_POS3M-55, FRONTEND_POS3Y, _("Off"),TRUE,FALSE);
addTextButton(FRONTEND_SSHAKE_R, FRONTEND_POS3M-55, FRONTEND_POS3Y, _("Off"),true,false);
}
////////////
// fog
addTextButton(FRONTEND_FOGTYPE, FRONTEND_POS4X-35, FRONTEND_POS4Y, _("Fog"),TRUE,FALSE);
addTextButton(FRONTEND_FOGTYPE, FRONTEND_POS4X-35, FRONTEND_POS4Y, _("Fog"),true,false);
if(war_GetFog())
{
addTextButton(FRONTEND_FOGTYPE_R,FRONTEND_POS4M-55,FRONTEND_POS4Y, _("Mist"),TRUE,FALSE);
addTextButton(FRONTEND_FOGTYPE_R,FRONTEND_POS4M-55,FRONTEND_POS4Y, _("Mist"),true,false);
}
else
{
addTextButton(FRONTEND_FOGTYPE_R,FRONTEND_POS4M-55,FRONTEND_POS4Y, _("Fog Of War"),TRUE,FALSE);
addTextButton(FRONTEND_FOGTYPE_R,FRONTEND_POS4M-55,FRONTEND_POS4Y, _("Fog Of War"),true,false);
}
// ////////////
// //sequence mode.
addTextButton(FRONTEND_SEQUENCE, FRONTEND_POS6X-35,FRONTEND_POS6Y, _("Video Playback"),TRUE,FALSE);
addTextButton(FRONTEND_SEQUENCE, FRONTEND_POS6X-35,FRONTEND_POS6Y, _("Video Playback"),true,false);
if (war_GetSeqMode() == SEQ_FULL)
{
addTextButton(FRONTEND_SEQUENCE_R, FRONTEND_POS6M-55,FRONTEND_POS6Y, _("Full"),TRUE,FALSE);
addTextButton(FRONTEND_SEQUENCE_R, FRONTEND_POS6M-55,FRONTEND_POS6Y, _("Full"),true,false);
}
else if (war_GetSeqMode() == SEQ_SMALL)
{
addTextButton(FRONTEND_SEQUENCE_R, FRONTEND_POS6M-55,FRONTEND_POS6Y, _("Windowed"),TRUE,FALSE); }
addTextButton(FRONTEND_SEQUENCE_R, FRONTEND_POS6M-55,FRONTEND_POS6Y, _("Windowed"),true,false); }
else
{
addTextButton(FRONTEND_SEQUENCE_R, FRONTEND_POS6M-55,FRONTEND_POS6Y, _("Minimal"),TRUE,FALSE);
addTextButton(FRONTEND_SEQUENCE_R, FRONTEND_POS6M-55,FRONTEND_POS6Y, _("Minimal"),true,false);
}
////////////
//subtitle mode.
if(war_GetAllowSubtitles())
{
addTextButton(FRONTEND_SUBTITLES, FRONTEND_POS5X-35,FRONTEND_POS5Y, _("Subtitles"),TRUE,FALSE);
addTextButton(FRONTEND_SUBTITLES, FRONTEND_POS5X-35,FRONTEND_POS5Y, _("Subtitles"),true,false);
}
else
{
addTextButton(FRONTEND_SUBTITLES, FRONTEND_POS5X-35,FRONTEND_POS5Y, _("Subtitles"),TRUE,TRUE);
addTextButton(FRONTEND_SUBTITLES, FRONTEND_POS5X-35,FRONTEND_POS5Y, _("Subtitles"),true,true);
}
if(war_GetAllowSubtitles())
{
if ( !seq_GetSubtitles() )
{
addTextButton(FRONTEND_SUBTITLES_R, FRONTEND_POS5M-55,FRONTEND_POS5Y, _("Off"),TRUE,FALSE);
addTextButton(FRONTEND_SUBTITLES_R, FRONTEND_POS5M-55,FRONTEND_POS5Y, _("Off"),true,false);
}
else
{
addTextButton(FRONTEND_SUBTITLES_R, FRONTEND_POS5M-55,FRONTEND_POS5Y, _("On"),TRUE,FALSE);
addTextButton(FRONTEND_SUBTITLES_R, FRONTEND_POS5M-55,FRONTEND_POS5Y, _("On"),true,false);
}
}
else
{
addTextButton(FRONTEND_SUBTITLES_R, FRONTEND_POS5M - 55, FRONTEND_POS5Y, _("Off"), TRUE, TRUE);
addTextButton(FRONTEND_SUBTITLES_R, FRONTEND_POS5M - 55, FRONTEND_POS5Y, _("Off"), true, true);
}
////////////
//shadows
addTextButton(FRONTEND_SHADOWS, FRONTEND_POS7X - 35, FRONTEND_POS7Y, _("Shadows"), TRUE, FALSE);
addTextButton(FRONTEND_SHADOWS, FRONTEND_POS7X - 35, FRONTEND_POS7Y, _("Shadows"), true, false);
if (getDrawShadows())
{
addTextButton(FRONTEND_SHADOWS_R, FRONTEND_POS7M - 55, FRONTEND_POS7Y, _("On"), TRUE, FALSE);
addTextButton(FRONTEND_SHADOWS_R, FRONTEND_POS7M - 55, FRONTEND_POS7Y, _("On"), true, false);
}
else
{ // not flipped
addTextButton(FRONTEND_SHADOWS_R, FRONTEND_POS7M - 55, FRONTEND_POS7Y, _("Off"), TRUE, FALSE);
addTextButton(FRONTEND_SHADOWS_R, FRONTEND_POS7M - 55, FRONTEND_POS7Y, _("Off"), true, false);
}
////////////
// quit.
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,TRUE);
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,true);
return TRUE;
return true;
}
@ -705,12 +705,12 @@ BOOL runGameOptions2Menu(void)
case FRONTEND_SSHAKE_R:
if( getShakeStatus() )
{
setShakeStatus(FALSE);
setShakeStatus(false);
widgSetString(psWScreen,FRONTEND_SSHAKE_R, _("Off"));
}
else
{
setShakeStatus(TRUE);
setShakeStatus(true);
widgSetString(psWScreen,FRONTEND_SSHAKE_R, _("On"));
}
break;
@ -719,12 +719,12 @@ BOOL runGameOptions2Menu(void)
case FRONTEND_MFLIP_R:
if( getInvertMouseStatus() )
{// flipped
setInvertMouseStatus(FALSE);
setInvertMouseStatus(false);
widgSetString(psWScreen,FRONTEND_MFLIP_R, _("Off"));
}
else
{ // not flipped
setInvertMouseStatus(TRUE);
setInvertMouseStatus(true);
widgSetString(psWScreen,FRONTEND_MFLIP_R, _("On"));
}
break;
@ -734,15 +734,15 @@ BOOL runGameOptions2Menu(void)
if (war_GetFog())
{ // turn off crap fog, turn on vis fog.
debug(LOG_FOG, "runGameOptions2Menu: Fog of war ON, visual fog OFF");
war_SetFog(FALSE);
avSetStatus(TRUE);
war_SetFog(false);
avSetStatus(true);
widgSetString(psWScreen,FRONTEND_FOGTYPE_R, _("Fog Of War"));
}
else
{ // turn off vis fog, turn on normal crap fog.
debug(LOG_FOG, "runGameOptions2Menu: Fog of war OFF, visual fog ON");
avSetStatus(FALSE);
war_SetFog(TRUE);
avSetStatus(false);
war_SetFog(true);
widgSetString(psWScreen,FRONTEND_FOGTYPE_R, _("Mist"));
}
break;
@ -755,12 +755,12 @@ BOOL runGameOptions2Menu(void)
case FRONTEND_SUBTITLES_R:
if( seq_GetSubtitles())
{// turn off
seq_SetSubtitles(FALSE);
seq_SetSubtitles(false);
widgSetString(psWScreen,FRONTEND_SUBTITLES_R,_("Off"));
}
else
{// turn on
seq_SetSubtitles(TRUE);
seq_SetSubtitles(true);
widgSetString(psWScreen,FRONTEND_SUBTITLES_R,_("On"));
}
break;
@ -809,7 +809,7 @@ BOOL runGameOptions2Menu(void)
widgDisplayScreen(psWScreen); // show the widgets currently running
return TRUE;
return true;
}
@ -822,25 +822,25 @@ BOOL startGameOptions3Menu(void)
addBottomForm();
// 2d audio
addTextButton(FRONTEND_FX, FRONTEND_POS2X-25,FRONTEND_POS2Y, _("Voice Volume"),TRUE,FALSE);
addTextButton(FRONTEND_FX, FRONTEND_POS2X-25,FRONTEND_POS2Y, _("Voice Volume"),true,false);
addFESlider(FRONTEND_FX_SL, FRONTEND_BOTFORM, FRONTEND_POS2M, FRONTEND_POS2Y+5, AUDIO_VOL_MAX, (int)(sound_GetUIVolume() * 100.0), FRONTEND_FX );
// 3d audio
addTextButton(FRONTEND_3D_FX, FRONTEND_POS3X-25,FRONTEND_POS3Y, _("FX Volume"),TRUE,FALSE);
addTextButton(FRONTEND_3D_FX, FRONTEND_POS3X-25,FRONTEND_POS3Y, _("FX Volume"),true,false);
addFESlider(FRONTEND_3D_FX_SL, FRONTEND_BOTFORM, FRONTEND_POS3M, FRONTEND_POS3Y+5, AUDIO_VOL_MAX, (int)(sound_GetEffectsVolume() * 100.0), FRONTEND_3D_FX );
// cd audio
addTextButton(FRONTEND_MUSIC, FRONTEND_POS4X-25,FRONTEND_POS4Y, _("Music Volume"),TRUE,FALSE);
addTextButton(FRONTEND_MUSIC, FRONTEND_POS4X-25,FRONTEND_POS4Y, _("Music Volume"),true,false);
addFESlider(FRONTEND_MUSIC_SL, FRONTEND_BOTFORM, FRONTEND_POS4M, FRONTEND_POS4Y+5, AUDIO_VOL_MAX, (int)(sound_GetMusicVolume() * 100.0), FRONTEND_MUSIC );
// quit.
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,TRUE);
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,true);
//add some text down the side of the form
addSideText (FRONTEND_SIDETEXT , FRONTEND_SIDEX,FRONTEND_SIDEY, _("GAME OPTIONS"));
return TRUE;
return true;
}
BOOL runGameOptions3Menu(void)
@ -884,7 +884,7 @@ BOOL runGameOptions3Menu(void)
widgDisplayScreen(psWScreen); // show the widgets currently running
return TRUE;
return true;
}
// Additional graphics game options menu
@ -901,45 +901,45 @@ BOOL startGameOptions4Menu(void)
addBottomForm();
// Fullscreen/windowed
addTextButton(FRONTEND_WINDOWMODE, FRONTEND_POS2X-35, FRONTEND_POS2Y, _("Graphics Mode*"), TRUE, FALSE);
addTextButton(FRONTEND_WINDOWMODE, FRONTEND_POS2X-35, FRONTEND_POS2Y, _("Graphics Mode*"), true, false);
if (war_getFullscreen())
{
addTextButton(FRONTEND_WINDOWMODE_R, FRONTEND_POS2M-55, FRONTEND_POS2Y, _("Fullscreen"), TRUE, FALSE);
addTextButton(FRONTEND_WINDOWMODE_R, FRONTEND_POS2M-55, FRONTEND_POS2Y, _("Fullscreen"), true, false);
}
else
{
addTextButton(FRONTEND_WINDOWMODE_R, FRONTEND_POS2M-55, FRONTEND_POS2Y, _("Windowed"), TRUE, FALSE);
addTextButton(FRONTEND_WINDOWMODE_R, FRONTEND_POS2M-55, FRONTEND_POS2Y, _("Windowed"), true, false);
}
// Resolution
addTextButton(FRONTEND_RESOLUTION, FRONTEND_POS3X-35, FRONTEND_POS3Y, _("Resolution*"), TRUE, FALSE);
addTextButton(FRONTEND_RESOLUTION_R, FRONTEND_POS3M-55, FRONTEND_POS3Y, resolution, TRUE, FALSE);
addTextButton(FRONTEND_RESOLUTION, FRONTEND_POS3X-35, FRONTEND_POS3Y, _("Resolution*"), true, false);
addTextButton(FRONTEND_RESOLUTION_R, FRONTEND_POS3M-55, FRONTEND_POS3Y, resolution, true, false);
widgSetString(psWScreen, FRONTEND_RESOLUTION_R, resolution);
// Cursor trapping
addTextButton(FRONTEND_TRAP, FRONTEND_POS4X-35, FRONTEND_POS4Y, _("Trap Cursor"), TRUE, FALSE);
addTextButton(FRONTEND_TRAP, FRONTEND_POS4X-35, FRONTEND_POS4Y, _("Trap Cursor"), true, false);
if (war_GetTrapCursor())
{
addTextButton(FRONTEND_TRAP_R, FRONTEND_POS4M-55, FRONTEND_POS4Y, _("On"), TRUE, FALSE);
addTextButton(FRONTEND_TRAP_R, FRONTEND_POS4M-55, FRONTEND_POS4Y, _("On"), true, false);
}
else
{
addTextButton(FRONTEND_TRAP_R, FRONTEND_POS4M-55, FRONTEND_POS4Y, _("Off"), TRUE, FALSE);
addTextButton(FRONTEND_TRAP_R, FRONTEND_POS4M-55, FRONTEND_POS4Y, _("Off"), true, false);
}
// Texture size
addTextButton(FRONTEND_TEXTURESZ, FRONTEND_POS5X-35, FRONTEND_POS5Y, _("Texture size"), TRUE, FALSE);
addTextButton(FRONTEND_TEXTURESZ_R, FRONTEND_POS5M-55, FRONTEND_POS5Y, textureSize, TRUE, FALSE);
addTextButton(FRONTEND_TEXTURESZ, FRONTEND_POS5X-35, FRONTEND_POS5Y, _("Texture size"), true, false);
addTextButton(FRONTEND_TEXTURESZ_R, FRONTEND_POS5M-55, FRONTEND_POS5Y, textureSize, true, false);
// Add a note about changes taking effect on restart for certain options
addTextButton(FRONTEND_TAKESEFFECT, FRONTEND_POS6X-35, FRONTEND_POS6Y, _("* Takes effect on game restart"), TRUE, TRUE);
addTextButton(FRONTEND_TAKESEFFECT, FRONTEND_POS6X-35, FRONTEND_POS6Y, _("* Takes effect on game restart"), true, true);
// Quit/return
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,TRUE);
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29, P_("menu", "Return"),IMAGE_RETURN,IMAGE_RETURN_HI,true);
return TRUE;
return true;
}
BOOL runGameOptions4Menu(void)
@ -953,12 +953,12 @@ BOOL runGameOptions4Menu(void)
case FRONTEND_WINDOWMODE_R:
if (war_getFullscreen())
{
war_setFullscreen(FALSE);
war_setFullscreen(false);
widgSetString(psWScreen, FRONTEND_WINDOWMODE_R, _("Windowed"));
}
else
{
war_setFullscreen(TRUE);
war_setFullscreen(true);
widgSetString(psWScreen, FRONTEND_WINDOWMODE_R, _("Fullscreen"));
}
break;
@ -1000,12 +1000,12 @@ BOOL runGameOptions4Menu(void)
case FRONTEND_TRAP_R:
if (war_GetTrapCursor())
{
war_SetTrapCursor(FALSE);
war_SetTrapCursor(false);
widgSetString(psWScreen, FRONTEND_TRAP_R, _("Off"));
}
else
{
war_SetTrapCursor(TRUE);
war_SetTrapCursor(true);
widgSetString(psWScreen, FRONTEND_TRAP_R, _("On"));
}
break;
@ -1048,7 +1048,7 @@ BOOL runGameOptions4Menu(void)
widgDisplayScreen(psWScreen);
return TRUE;
return true;
}
@ -1063,49 +1063,49 @@ BOOL startGameOptionsMenu(void)
addBottomForm();
// Difficulty
addTextButton(FRONTEND_DIFFICULTY, FRONTEND_POS2X-25, FRONTEND_POS2Y, _("Difficulty"), TRUE, FALSE);
addTextButton(FRONTEND_DIFFICULTY, FRONTEND_POS2X-25, FRONTEND_POS2Y, _("Difficulty"), true, false);
switch (getDifficultyLevel())
{
case DL_EASY:
addTextButton(FRONTEND_DIFFICULTY_R, FRONTEND_POS2M-25, FRONTEND_POS2Y, _("Easy"), TRUE, FALSE);
addTextButton(FRONTEND_DIFFICULTY_R, FRONTEND_POS2M-25, FRONTEND_POS2Y, _("Easy"), true, false);
break;
case DL_NORMAL:
addTextButton(FRONTEND_DIFFICULTY_R, FRONTEND_POS2M-25,FRONTEND_POS2Y, _("Normal"), TRUE, FALSE);
addTextButton(FRONTEND_DIFFICULTY_R, FRONTEND_POS2M-25,FRONTEND_POS2Y, _("Normal"), true, false);
break;
case DL_HARD:
default:
addTextButton(FRONTEND_DIFFICULTY_R, FRONTEND_POS2M-25, FRONTEND_POS2Y, _("Hard"), TRUE, FALSE);
addTextButton(FRONTEND_DIFFICULTY_R, FRONTEND_POS2M-25, FRONTEND_POS2Y, _("Hard"), true, false);
break;
}
// Scroll speed
addTextButton(FRONTEND_SCROLLSPEED, FRONTEND_POS3X-25, FRONTEND_POS3Y, _("Scroll Speed"), TRUE, FALSE);
addTextButton(FRONTEND_SCROLLSPEED, FRONTEND_POS3X-25, FRONTEND_POS3Y, _("Scroll Speed"), true, false);
addFESlider(FRONTEND_SCROLLSPEED_SL, FRONTEND_BOTFORM, FRONTEND_POS3M, FRONTEND_POS3Y+5, 16, scroll_speed_accel / 100, FRONTEND_SCROLLSPEED);
// Colour stuff
w = iV_GetImageWidth(FrontImages, IMAGE_PLAYER0);
h = iV_GetImageHeight(FrontImages, IMAGE_PLAYER0);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P0, FRONTEND_POS4M+(0*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER0, IMAGE_PLAYERX, TRUE);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P4, FRONTEND_POS4M+(1*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER4, IMAGE_PLAYERX, TRUE);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P5, FRONTEND_POS4M+(2*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER5, IMAGE_PLAYERX, TRUE);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P6, FRONTEND_POS4M+(3*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER6, IMAGE_PLAYERX, TRUE);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P7, FRONTEND_POS4M+(4*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER7, IMAGE_PLAYERX, TRUE);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P0, FRONTEND_POS4M+(0*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER0, IMAGE_PLAYERX, true);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P4, FRONTEND_POS4M+(1*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER4, IMAGE_PLAYERX, true);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P5, FRONTEND_POS4M+(2*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER5, IMAGE_PLAYERX, true);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P6, FRONTEND_POS4M+(3*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER6, IMAGE_PLAYERX, true);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FE_P7, FRONTEND_POS4M+(4*(w+6)), FRONTEND_POS4Y, w, h, "", IMAGE_PLAYER7, IMAGE_PLAYERX, true);
// language
addTextButton(FRONTEND_LANGUAGE, FRONTEND_POS2X - 25, FRONTEND_POS5Y, _("Language"), TRUE, FALSE);
addTextButton(FRONTEND_LANGUAGE_R, FRONTEND_POS2M - 25, FRONTEND_POS5Y, getLanguageName(), TRUE, FALSE);
addTextButton(FRONTEND_LANGUAGE, FRONTEND_POS2X - 25, FRONTEND_POS5Y, _("Language"), true, false);
addTextButton(FRONTEND_LANGUAGE_R, FRONTEND_POS2M - 25, FRONTEND_POS5Y, getLanguageName(), true, false);
widgSetButtonState(psWScreen, FE_P0 + getPlayerColour(0), WBUT_LOCK);
addTextButton(FRONTEND_COLOUR, FRONTEND_POS4X-25, FRONTEND_POS4Y, _("Unit Colour"), TRUE, FALSE);
addTextButton(FRONTEND_COLOUR, FRONTEND_POS4X-25, FRONTEND_POS4Y, _("Unit Colour"), true, false);
// Quit
addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_QUIT, 10, 10, 30, 29, P_("menu", "Return"), IMAGE_RETURN, IMAGE_RETURN_HI, TRUE);
addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_QUIT, 10, 10, 30, 29, P_("menu", "Return"), IMAGE_RETURN, IMAGE_RETURN_HI, true);
// Add some text down the side of the form
addSideText(FRONTEND_SIDETEXT, FRONTEND_SIDEX, FRONTEND_SIDEY, _("GAME OPTIONS"));
return TRUE;
return true;
}
BOOL runGameOptionsMenu(void)
@ -1232,7 +1232,7 @@ BOOL runGameOptionsMenu(void)
widgDisplayScreen(psWScreen); // show the widgets currently running
return TRUE;
return true;
}
@ -1281,7 +1281,7 @@ void addBottomForm(void)
sFormInit.height = FRONTEND_BOTFORMH;
sFormInit.pDisplay = intOpenPlainForm;
sFormInit.disableChildren = TRUE;
sFormInit.disableChildren = true;
widgAddForm(psWScreen, &sFormInit);
}
@ -1448,7 +1448,7 @@ void displayTextOption(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGH
{
SDWORD fx,fy, fw;
W_BUTTON *psBut;
BOOL hilight = FALSE;
BOOL hilight = false;
BOOL greyOut = psWidget->UserData; // if option is unavailable.
psBut = (W_BUTTON *)psWidget;
@ -1456,7 +1456,7 @@ void displayTextOption(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGH
if(widgGetMouseOver(psWScreen) == psBut->id) // if mouse is over text then hilight.
{
hilight = TRUE;
hilight = true;
}
fw = iV_GetTextWidth(psBut->pText);

View File

@ -129,7 +129,7 @@ static UDWORD functionType(const char* pType)
return REARM_UPGRADE_TYPE;
}
ASSERT( FALSE, "Unknown Function Type: %s", pType );
ASSERT( false, "Unknown Function Type: %s", pType );
return 0;
}
@ -141,10 +141,10 @@ static BOOL storeName(FUNCTION* pFunction, const char* pNameToStore)
{
debug( LOG_ERROR, "Function Name - Out of memory" );
abort();
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -163,7 +163,7 @@ static BOOL loadProduction(const char *pData)
{
debug( LOG_ERROR, "Production Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(PRODUCTION_FUNCTION));
@ -203,23 +203,23 @@ static BOOL loadProduction(const char *pData)
if (!psFunction->propulsionType)
{
DBERROR(("Unknown Propulsion Type"));
return FALSE;
return false;
}
*/
/*propType = getPropulsionType(propulsionType);
if (propType == INVALID_PROP_TYPE)
{
DBERROR(("Unknown Propulsion Type - %s", propulsionType));
return FALSE;
return false;
}
psFunction->propulsionType = propType;*/
if (!getBodySize(bodySize, (UBYTE*)&psFunction->capacity))
{
ASSERT( FALSE, "loadProduction: unknown body size for %s",psFunction->pName );
ASSERT( false, "loadProduction: unknown body size for %s",psFunction->pName );
return FALSE;
return false;
}
//check prod output < UWORD_MAX
@ -230,12 +230,12 @@ static BOOL loadProduction(const char *pData)
else
{
ASSERT( FALSE, "loadProduction: production Output too big for %s",psFunction->pName );
ASSERT( false, "loadProduction: production Output too big for %s",psFunction->pName );
psFunction->productionOutput = 0;
}
return TRUE;
return true;
}
static BOOL loadProductionUpgradeFunction(const char *pData)
@ -252,7 +252,7 @@ static BOOL loadProductionUpgradeFunction(const char *pData)
{
debug( LOG_ERROR, "Production Upgrade Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(PRODUCTION_UPGRADE_FUNCTION));
@ -278,32 +278,32 @@ static BOOL loadProductionUpgradeFunction(const char *pData)
//set the factory flags
if (factory)
{
psFunction->factory = TRUE;
psFunction->factory = true;
}
else
{
psFunction->factory = FALSE;
psFunction->factory = false;
}
if (cyborg)
{
psFunction->cyborgFactory = TRUE;
psFunction->cyborgFactory = true;
}
else
{
psFunction->cyborgFactory = FALSE;
psFunction->cyborgFactory = false;
}
if (vtol)
{
psFunction->vtolFactory = TRUE;
psFunction->vtolFactory = true;
}
else
{
psFunction->vtolFactory = FALSE;
psFunction->vtolFactory = false;
}
//increment the number of upgrades
//numProductionUpgrades++;
return TRUE;
return true;
}
static BOOL loadResearchFunction(const char *pData)
@ -317,7 +317,7 @@ static BOOL loadResearchFunction(const char *pData)
{
debug( LOG_ERROR, "Research Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(RESEARCH_FUNCTION));
@ -337,7 +337,7 @@ static BOOL loadResearchFunction(const char *pData)
//allocate storage for the name
storeName((FUNCTION *)psFunction, functionName);
return TRUE;
return true;
}
static BOOL loadReArmFunction(const char *pData)
@ -351,7 +351,7 @@ static BOOL loadReArmFunction(const char *pData)
{
debug( LOG_ERROR, "ReArm Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(REARM_FUNCTION));
@ -371,7 +371,7 @@ static BOOL loadReArmFunction(const char *pData)
//allocate storage for the name
storeName((FUNCTION *)psFunction, functionName);
return TRUE;
return true;
}
@ -388,7 +388,7 @@ static BOOL loadUpgradeFunction(const char *pData, UBYTE type)
{
debug( LOG_ERROR, "Upgrade Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(UPGRADE_FUNCTION));
@ -410,14 +410,14 @@ static BOOL loadUpgradeFunction(const char *pData, UBYTE type)
if (modifier > UWORD_MAX)
{
ASSERT( FALSE, "loadUpgradeFunction: modifier too great for %s", functionName );
return FALSE;
ASSERT( false, "loadUpgradeFunction: modifier too great for %s", functionName );
return false;
}
//store the % upgrade
psFunction->upgradePoints = (UWORD)modifier;
return TRUE;
return true;
}
@ -472,7 +472,7 @@ static BOOL loadDroidBodyUpgradeFunction(const char *pData)
{
debug( LOG_ERROR, "UnitBody Upgrade Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(DROIDBODY_UPGRADE_FUNCTION));
@ -496,9 +496,9 @@ static BOOL loadDroidBodyUpgradeFunction(const char *pData)
if (modifier > UWORD_MAX || armourKinetic > UWORD_MAX ||
armourHeat > UWORD_MAX || body > UWORD_MAX)
{
ASSERT( FALSE,
ASSERT( false,
"loadUnitBodyUpgradeFunction: one or more modifiers too great" );
return FALSE;
return false;
}
//store the % upgrades
@ -508,22 +508,22 @@ static BOOL loadDroidBodyUpgradeFunction(const char *pData)
psFunction->armourValue[WC_HEAT] = (UWORD)armourHeat;
if (droid)
{
psFunction->droid = TRUE;
psFunction->droid = true;
}
else
{
psFunction->droid = FALSE;
psFunction->droid = false;
}
if (cyborg)
{
psFunction->cyborg = TRUE;
psFunction->cyborg = true;
}
else
{
psFunction->cyborg = FALSE;
psFunction->cyborg = false;
}
return TRUE;
return true;
}
static BOOL loadDroidSensorUpgradeFunction(const char *pData)
@ -539,7 +539,7 @@ static BOOL loadDroidSensorUpgradeFunction(const char *pData)
{
debug( LOG_ERROR, "UnitSensor Upgrade Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(DROIDSENSOR_UPGRADE_FUNCTION));
@ -561,16 +561,16 @@ static BOOL loadDroidSensorUpgradeFunction(const char *pData)
if (modifier > UWORD_MAX || range > UWORD_MAX)
{
ASSERT( FALSE,
ASSERT( false,
"loadUnitSensorUpgradeFunction: one or more modifiers too great" );
return FALSE;
return false;
}
//store the % upgrades
psFunction->upgradePoints = (UWORD)modifier;
psFunction->range = (UWORD)range;
return TRUE;
return true;
}
static BOOL loadWeaponUpgradeFunction(const char *pData)
@ -588,7 +588,7 @@ static BOOL loadWeaponUpgradeFunction(const char *pData)
{
debug( LOG_ERROR, "Weapon Upgrade Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(WEAPON_UPGRADE_FUNCTION));
@ -614,7 +614,7 @@ static BOOL loadWeaponUpgradeFunction(const char *pData)
psFunction->subClass = getWeaponSubClass(weaponSubClass);
if (psFunction->subClass == INVALID_SUBCLASS)
{
return FALSE;
return false;
}
//check none of the %increases are over UBYTE max
@ -628,7 +628,7 @@ static BOOL loadWeaponUpgradeFunction(const char *pData)
{
debug( LOG_ERROR, "A percentage increase for Weapon Upgrade function is too large" );
abort();
return FALSE;
return false;
}
//copy the data across
@ -643,7 +643,7 @@ static BOOL loadWeaponUpgradeFunction(const char *pData)
//increment the number of upgrades
//numWeaponUpgrades++;
return TRUE;
return true;
}
static BOOL loadStructureUpgradeFunction(const char *pData)
@ -659,7 +659,7 @@ static BOOL loadStructureUpgradeFunction(const char *pData)
{
debug( LOG_ERROR, "Structure Upgrade Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(STRUCTURE_UPGRADE_FUNCTION));
@ -686,7 +686,7 @@ static BOOL loadStructureUpgradeFunction(const char *pData)
{
debug( LOG_ERROR, "A percentage increase for Structure Upgrade function is too large" );
abort();
return FALSE;
return false;
}
//copy the data across
@ -694,7 +694,7 @@ static BOOL loadStructureUpgradeFunction(const char *pData)
psFunction->body = (UWORD)body;
psFunction->resistance = (UWORD)resistance;
return TRUE;
return true;
}
static BOOL loadWallDefenceUpgradeFunction(const char *pData)
@ -710,7 +710,7 @@ static BOOL loadWallDefenceUpgradeFunction(const char *pData)
{
debug( LOG_ERROR, "WallDefence Upgrade Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(WALLDEFENCE_UPGRADE_FUNCTION));
@ -736,14 +736,14 @@ static BOOL loadWallDefenceUpgradeFunction(const char *pData)
{
debug( LOG_ERROR, "A percentage increase for WallDefence Upgrade function is too large" );
abort();
return FALSE;
return false;
}
//copy the data across
psFunction->armour = (UWORD)armour;
psFunction->body = (UWORD)body;
return TRUE;
return true;
}
@ -759,7 +759,7 @@ static BOOL loadPowerGenFunction(const char *pData)
{
debug( LOG_ERROR, "Power Gen Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(POWER_GEN_FUNCTION));
@ -789,7 +789,7 @@ static BOOL loadPowerGenFunction(const char *pData)
//allocate storage for the name
storeName((FUNCTION *)psFunction, functionName);
return TRUE;
return true;
}
static BOOL loadResourceFunction(const char *pData)
@ -804,7 +804,7 @@ static BOOL loadResourceFunction(const char *pData)
{
debug( LOG_ERROR, "Resource Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(RESOURCE_FUNCTION));
@ -824,7 +824,7 @@ static BOOL loadResourceFunction(const char *pData)
//allocate storage for the name
storeName((FUNCTION *)psFunction, functionName);
return TRUE;
return true;
}
@ -840,7 +840,7 @@ static BOOL loadRepairDroidFunction(const char *pData)
{
debug( LOG_ERROR, "Repair Droid Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(REPAIR_DROID_FUNCTION));
@ -861,7 +861,7 @@ static BOOL loadRepairDroidFunction(const char *pData)
//allocate storage for the name
storeName((FUNCTION *)psFunction, functionName);
return TRUE;
return true;
}
@ -880,7 +880,7 @@ static BOOL loadWallFunction(const char *pData)
{
debug( LOG_ERROR, "Wall Function - Out of memory" );
abort();
return FALSE;
return false;
}
memset(psFunction, 0, sizeof(WALL_FUNCTION));
@ -907,11 +907,11 @@ static BOOL loadWallFunction(const char *pData)
{
debug( LOG_ERROR, "Structure Stats Invalid for function - %s", functionName );
abort();
return FALSE;
return false;
}
psFunction->pCornerStat = NULL;
return TRUE;
return true;
}
void productionUpgrade(FUNCTION *pFunction, UBYTE player)
@ -1535,7 +1535,7 @@ BOOL FunctionShutDown(void)
}
free(pStartList);
return TRUE;
return true;
}
BOOL loadFunctionStats(const char *pFunctionData, UDWORD bufferSize)
@ -1576,7 +1576,7 @@ BOOL loadFunctionStats(const char *pFunctionData, UDWORD bufferSize)
{
debug( LOG_ERROR, "Out of memory" );
abort();
return FALSE;
return false;
}
pStartList = asFunctions;
//initialise the storage
@ -1596,7 +1596,7 @@ BOOL loadFunctionStats(const char *pFunctionData, UDWORD bufferSize)
if (!(pLoadFunction[type](pFunctionData)))
{
return FALSE;
return false;
}
//increment the pointer to the start of the next record
pFunctionData = strchr(pFunctionData,'\n') + 1;
@ -1604,5 +1604,5 @@ BOOL loadFunctionStats(const char *pFunctionData, UDWORD bufferSize)
//set the function list pointer to the start
asFunctions = pStartList;
return TRUE;
return true;
}

File diff suppressed because it is too large Load Diff

View File

@ -75,8 +75,8 @@
#define CURRENT_VERSION_NUM VERSION_35
//used in the loadGame
#define KEEPOBJECTS TRUE
#define FREEMEM TRUE
#define KEEPOBJECTS true
#define FREEMEM true
#define VALIDITYKEY_DATE 0x01
#define VALIDITYKEY_VERSION 0x02
@ -122,7 +122,7 @@ typedef struct _score_save_header
*/
/***************************************************************************/
extern BOOL loadGame(const char *pGameToLoad, BOOL keepObjects, BOOL freeMem, BOOL UserSaveGame); // UserSaveGame is TRUE when the save game is not a new level (User Save Game)
extern BOOL loadGame(const char *pGameToLoad, BOOL keepObjects, BOOL freeMem, BOOL UserSaveGame); // UserSaveGame is true when the save game is not a new level (User Save Game)
/*This just loads up the .gam file to determine which level data to set up - split up
so can be called in levLoadData when starting a game from a load save game*/

View File

@ -59,7 +59,7 @@ BOOL gwInitialise(void)
psGateways = NULL;
return TRUE;
return true;
}
@ -98,8 +98,8 @@ BOOL gwNewGateway(SDWORD x1, SDWORD y1, SDWORD x2, SDWORD y2)
(y2 < 0) || (y2 >= gwMapHeight()) ||
((x1 != x2) && (y1 != y2)))
{
ASSERT( FALSE,"gwNewGateway: invalid coordinates" );
return FALSE;
ASSERT( false,"gwNewGateway: invalid coordinates" );
return false;
}
psNew = (GATEWAY*)malloc(sizeof(GATEWAY));
@ -107,7 +107,7 @@ BOOL gwNewGateway(SDWORD x1, SDWORD y1, SDWORD x2, SDWORD y2)
{
debug( LOG_ERROR, "gwNewGateway: out of memory" );
abort();
return FALSE;
return false;
}
// make sure the first coordinate is always the smallest
@ -158,7 +158,7 @@ BOOL gwNewGateway(SDWORD x1, SDWORD y1, SDWORD x2, SDWORD y2)
}
}
return TRUE;
return true;
}
@ -170,8 +170,8 @@ BOOL gwNewLinkGateway(SDWORD x, SDWORD y)
if ((x < 0) || (x >= gwMapWidth()) ||
(y < 0) || (y >= gwMapHeight()))
{
ASSERT( FALSE,"gwNewLinkGateway: invalid coordinates" );
return FALSE;
ASSERT( false,"gwNewLinkGateway: invalid coordinates" );
return false;
}
psNew = (GATEWAY*)malloc(sizeof(GATEWAY));
@ -179,7 +179,7 @@ BOOL gwNewLinkGateway(SDWORD x, SDWORD y)
{
debug( LOG_ERROR, "gwNewGateway: out of memory" );
abort();
return FALSE;
return false;
}
// initialise the gateway
@ -196,7 +196,7 @@ BOOL gwNewLinkGateway(SDWORD x, SDWORD y)
psNew->psNext = psGateways;
psGateways = psNew;
return TRUE;
return true;
}
@ -207,16 +207,16 @@ static BOOL gwBlockingTile(SDWORD x,SDWORD y)
if (x <1 || y < 1 || x >= (SDWORD)mapWidth-1 || y >= (SDWORD)mapHeight-1)
{
// coords off map - auto blocking tile
return TRUE;
return true;
}
psTile = mapTile((UDWORD)x, (UDWORD)y);
if (terrainType(psTile) == TER_CLIFFFACE)
{
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -241,7 +241,7 @@ static BOOL gwFindZone(SDWORD zone, SDWORD cx, SDWORD cy,
{
*px = x;
*py = y;
return TRUE;
return true;
}
}
@ -255,7 +255,7 @@ static BOOL gwFindZone(SDWORD zone, SDWORD cx, SDWORD cy,
{
*px = x;
*py = y;
return TRUE;
return true;
}
}
@ -269,7 +269,7 @@ static BOOL gwFindZone(SDWORD zone, SDWORD cx, SDWORD cy,
{
*px = x;
*py = y;
return TRUE;
return true;
}
}
@ -283,12 +283,12 @@ static BOOL gwFindZone(SDWORD zone, SDWORD cx, SDWORD cy,
{
*px = x;
*py = y;
return TRUE;
return true;
}
}
}
return FALSE;
return false;
}
@ -394,7 +394,7 @@ BOOL gwGenerateLinkGates(void)
gwCalcZoneCenter(zone, &cx,&cy);
if (!gwNewLinkGateway(cx,cy))
{
return FALSE;
return false;
}
debug(LOG_GATEWAY, "new water link gateway at (%d,%d) for zone %d", cx, cy, zone);
}
@ -402,7 +402,7 @@ BOOL gwGenerateLinkGates(void)
debug( LOG_NEVER, "Done\n" );
return TRUE;
return true;
}
@ -483,7 +483,7 @@ BOOL gwLoadGateways(char *pFileBuffer, UDWORD fileSize)
if (!gwNewGateway(x1,y1, x2,y2))
{
return FALSE;
return false;
}
for (; *pPos != '\n' && pPos < (pFileBuffer + fileSize); pPos += 1)
@ -492,7 +492,7 @@ BOOL gwLoadGateways(char *pFileBuffer, UDWORD fileSize)
numGW -= 1;
}
return TRUE;
return true;
}
@ -503,18 +503,18 @@ BOOL gwZoneInEquiv(SDWORD mainZone, SDWORD checkZone)
if (apEquivZones == NULL)
{
return FALSE;
return false;
}
for(i=0; i<aNumEquiv[mainZone]; i+= 1)
{
if (apEquivZones[mainZone][i] == checkZone)
{
return TRUE;
return true;
}
}
return FALSE;
return false;
}
// find a route between two gateways and return
@ -605,7 +605,7 @@ static BOOL gwCheckFloodTiles(GATEWAY *psGate)
if (gwBlockingTile(floodX,floodY))
{
return FALSE;
return false;
}
// second zone is right/below
@ -624,10 +624,10 @@ static BOOL gwCheckFloodTiles(GATEWAY *psGate)
if (gwBlockingTile(floodX,floodY))
{
return FALSE;
return false;
}
return TRUE;
return true;
}
@ -646,7 +646,7 @@ BOOL gwLinkGateways(void)
{
debug( LOG_ERROR, "gwLinkGateways: out of memory" );
abort();
return FALSE;
return false;
}
memset(aZoneReachable, 0, sizeof(UBYTE) * gwNumZones);
@ -681,8 +681,8 @@ BOOL gwLinkGateways(void)
psCurr->x1,psCurr->y1, psCurr->x2,psCurr->y2,
psCurr->zone1, psCurr->zone2 );
aZoneReachable[psCurr->zone1] = TRUE;
aZoneReachable[psCurr->zone2] = TRUE;
aZoneReachable[psCurr->zone1] = true;
aZoneReachable[psCurr->zone2] = true;
}
// now link all the gateways together
@ -734,7 +734,7 @@ BOOL gwLinkGateways(void)
{
debug( LOG_ERROR, "gwLinkGateways: out of memory" );
abort();
return FALSE;
return false;
}
}
else
@ -749,7 +749,7 @@ BOOL gwLinkGateways(void)
zone = psCurr->zone1;
otherZone = psCurr->zone2;
zoneLinks = zone1Links;
bZone1 = TRUE;
bZone1 = true;
while (link < (zone1Links + zone2Links))
{
for(psLink=psGateways; psLink && (link < zoneLinks); psLink=psLink->psNext)
@ -759,14 +759,14 @@ BOOL gwLinkGateways(void)
// don't link a gateway to itself
continue;
}
bAddLink = FALSE;
bAddLink = false;
if (!bZone1 && (psCurr->flags & GWR_WATERLINK))
{
// calculating links for a water link gateway
if (gwZoneInEquiv(psCurr->zone1, psLink->zone1) ||
gwZoneInEquiv(psCurr->zone1, psLink->zone2))
{
bAddLink = TRUE;
bAddLink = true;
}
}
else if ((psLink->zone1 == zone) || (psLink->zone2 == zone) ||
@ -774,7 +774,7 @@ BOOL gwLinkGateways(void)
gwZoneInEquiv(psLink->zone1, zone) &&
!gwZoneInEquiv(psLink->zone1, otherZone) ))
{
bAddLink = TRUE;
bAddLink = true;
}
if (bAddLink)
@ -793,11 +793,11 @@ BOOL gwLinkGateways(void)
zone = psCurr->zone2;
otherZone = psCurr->zone1;
zoneLinks = zone1Links + zone2Links;
bZone1 = FALSE;
bZone1 = false;
}
}
return TRUE;
return true;
}
@ -849,7 +849,7 @@ BOOL gwNewZoneMap(void)
{
debug( LOG_ERROR, "gwNewZoneMap: Out of memory" );
abort();
return FALSE;
return false;
}
for(i=0; i< gwMapHeight(); i++)
@ -857,7 +857,7 @@ BOOL gwNewZoneMap(void)
apRLEZones[i] = NULL;
}
return TRUE;
return true;
}
// Create a new empty zone map line in the zone map.
@ -891,7 +891,7 @@ BOOL gwCreateNULLZoneMap(void)
if (!gwNewZoneMap())
{
return FALSE;
return false;
}
for(y=0; y<gwMapHeight(); y++)
@ -899,13 +899,13 @@ BOOL gwCreateNULLZoneMap(void)
pBuf = gwNewZoneLine(y, 2);
if (!pBuf)
{
return FALSE;
return false;
}
pBuf[0] = (UBYTE)gwMapWidth();
pBuf[1] = 0;
}
return TRUE;
return true;
}
@ -969,7 +969,7 @@ BOOL gwNewEquivTable(SDWORD numZones)
{
debug( LOG_ERROR, "gwNewEquivTable: out of memory" );
abort();
return FALSE;
return false;
}
for(i=0; i<numZones; i+=1)
{
@ -981,14 +981,14 @@ BOOL gwNewEquivTable(SDWORD numZones)
{
debug( LOG_ERROR, "gwNewEquivTable: out of memory" );
abort();
return FALSE;
return false;
}
for(i=0; i<numZones; i+=1)
{
apEquivZones[i] = NULL;
}
return TRUE;
return true;
}
// release the equivalence table
@ -1035,7 +1035,7 @@ BOOL gwSetZoneEquiv(SDWORD zone, SDWORD numEquiv, UBYTE *pEquiv)
{
debug( LOG_ERROR, "gwSetZoneEquiv: out of memory" );
abort();
return FALSE;
return false;
}
aNumEquiv[zone] = (UBYTE)numEquiv;
@ -1044,7 +1044,7 @@ BOOL gwSetZoneEquiv(SDWORD zone, SDWORD numEquiv, UBYTE *pEquiv)
apEquivZones[zone][i] = pEquiv[i];
}
return TRUE;
return true;
}

View File

@ -120,26 +120,26 @@ static BOOL gwrBlockedGateway(GATEWAY *psGate, SDWORD player, UDWORD terrain)
BOOL blocked;
MAPTILE *psTile;
blocked = FALSE;
blocked = false;
psTile = mapTile( (psGate->x1+psGate->x2)/2,
(psGate->y1+psGate->y2)/2);
if ( (terrainType(psTile) == TER_WATER) &&
!(terrain & GWR_TER_WATER))
{
blocked = TRUE;
blocked = true;
}
if ( (terrainType(psTile) != TER_WATER) &&
!(terrain & GWR_TER_LAND))
{
blocked = TRUE;
blocked = true;
}
if (psGate->flags & GWR_IGNORE)
{
blocked = TRUE;
blocked = true;
}
/* blocked = TRUE;
/* blocked = true;
if (psGate->x1 == psGate->x2)
{
for(pos = psGate->y1; pos <= psGate->y2; pos += 1)
@ -148,7 +148,7 @@ static BOOL gwrBlockedGateway(GATEWAY *psGate, SDWORD player, UDWORD terrain)
if (!fpathBlockingTile(psGate->x1, pos) &&
TEST_TILE_VISIBLE(player, psTile))
{
blocked = FALSE;
blocked = false;
}
}
}
@ -160,7 +160,7 @@ static BOOL gwrBlockedGateway(GATEWAY *psGate, SDWORD player, UDWORD terrain)
if (!fpathBlockingTile(pos, psGate->y1) &&
TEST_TILE_VISIBLE(player, psTile))
{
blocked = FALSE;
blocked = false;
}
}
}*/
@ -214,28 +214,28 @@ SDWORD gwrAStarRoute(SDWORD player, UDWORD terrain,
psOpenList = NULL;
for(psNew = psGateways; psNew; psNew=psNew->psNext)
{
add = FALSE;
add = false;
if (psNew->zone1 == zone)
{
psNew->flags |= GWR_ZONE1;
add = TRUE;
add = true;
}
else if (psNew->zone2 == zone)
{
psNew->flags |= GWR_ZONE2;
add = TRUE;
add = true;
}
else if ((psNew->flags & GWR_WATERLINK) &&
gwZoneInEquiv(psNew->zone1, zone))
{
psNew->flags |= GWR_ZONE2;
add = TRUE;
add = true;
}
if (gwrBlockedGateway(psNew, player, terrain))
{
psNew->flags |= GWR_BLOCKED;
add = FALSE;
add = false;
}
if (add && gwrConsiderGateway(psNew))

View File

@ -92,7 +92,7 @@ UDWORD bestSoFar;
if (!vtolDroid(psDroid))
{
/* Clever (?) bit that reads whether we're interested in droids being selected or not */
if( (bSelected ? psDroid->selected : TRUE ) )
if( (bSelected ? psDroid->selected : true ) )
{
/* Get the differences */
xDif = abs(psDroid->pos.x - x);
@ -172,7 +172,7 @@ BOOL droidOnScreen( DROID *psDroid, SDWORD tolerance )
{
SDWORD dX,dY;
if (DrawnInLastFrame(psDroid->sDisplay.frameNumber)==TRUE)
if (DrawnInLastFrame(psDroid->sDisplay.frameNumber)==true)
{
dX = psDroid->sDisplay.screenX;
dY = psDroid->sDisplay.screenY;
@ -181,8 +181,8 @@ SDWORD dX,dY;
&& dX < (SDWORD)(pie_GetVideoBufferWidth()+tolerance)
&& dY < (SDWORD)(pie_GetVideoBufferHeight()+tolerance))
{
return(TRUE);
return(true);
}
}
return(FALSE);
return(false);
}

View File

@ -33,7 +33,7 @@
#include "multiplay.h"
static DROID_GROUP *firstGroup = NULL;
static BOOL grpInitialized = FALSE;
static BOOL grpInitialized = false;
// sizes for the group heap
#define GRP_HEAP_INIT 45
@ -43,8 +43,8 @@ static BOOL grpInitialized = FALSE;
BOOL grpInitialise(void)
{
firstGroup = NULL;
grpInitialized = TRUE;
return TRUE;
grpInitialized = true;
return true;
}
// shutdown the group system
@ -61,7 +61,7 @@ void grpShutDown(void)
free(psDel);
}
firstGroup = NULL;
grpInitialized = FALSE;
grpInitialized = false;
}
// create a new group
@ -72,7 +72,7 @@ BOOL grpCreate(DROID_GROUP **ppsGroup)
if (*ppsGroup == NULL)
{
debug(LOG_ERROR, "grpCreate: Out of memory");
return FALSE;
return false;
}
// Add node to beginning of list
@ -95,7 +95,7 @@ BOOL grpCreate(DROID_GROUP **ppsGroup)
(*ppsGroup)->psList = NULL;
(*ppsGroup)->psCommander = NULL;
return TRUE;
return true;
}
// add a droid to a group
@ -113,7 +113,7 @@ void grpJoin(DROID_GROUP *psGroup, DROID *psDroid)
{
if (psGroup->psList && psDroid->player != psGroup->psList->player)
{
ASSERT( FALSE,"grpJoin: Cannot have more than one players droids in a group" );
ASSERT( false,"grpJoin: Cannot have more than one players droids in a group" );
return;
}
@ -164,7 +164,7 @@ void grpJoinEnd(DROID_GROUP *psGroup, DROID *psDroid)
{
if (psGroup->psList && psDroid->player != psGroup->psList->player)
{
ASSERT( FALSE,"grpJoin: Cannot have more than one players droids in a group" );
ASSERT( false,"grpJoin: Cannot have more than one players droids in a group" );
return;
}
@ -214,7 +214,7 @@ void grpLeave(DROID_GROUP *psGroup, DROID *psDroid)
if (psDroid != NULL && psDroid->psGroup != psGroup)
{
ASSERT( FALSE, "grpLeave: droid group does not match" );
ASSERT( false, "grpLeave: droid group does not match" );
return;
}
@ -347,14 +347,14 @@ void orderGroupLoc(DROID_GROUP *psGroup, DROID_ORDER order, UDWORD x, UDWORD y)
if(bMultiPlayer)
{
SendGroupOrderGroup(psGroup,order,x,y,NULL);
bMultiPlayer = FALSE;
bMultiPlayer = false;
for(psCurr=psGroup->psList; psCurr; psCurr = psCurr->psGrpNext)
{
orderDroidLoc(psCurr, order, x,y);
}
bMultiPlayer = TRUE;
bMultiPlayer = true;
}
else
{
@ -376,14 +376,14 @@ void orderGroupObj(DROID_GROUP *psGroup, DROID_ORDER order, BASE_OBJECT *psObj)
if(bMultiPlayer)
{
SendGroupOrderGroup(psGroup,order,0,0,psObj);
bMultiPlayer = FALSE;
bMultiPlayer = false;
for(psCurr = psGroup->psList; psCurr; psCurr = psCurr->psGrpNext)
{
orderDroidObj(psCurr, order, (BASE_OBJECT *)psObj);
}
bMultiPlayer = TRUE;
bMultiPlayer = true;
}
else
{

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