Almost all strings and buffers are now of type char. This fixes
more than half the warnings on gcc4, and makes sure we do not get signedness problems between platforms where char is defined with different signedness. Also set line-ending properites for some bison/flex files that did not have it set. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@563 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
438868b7dc
commit
2149739999
|
@ -153,7 +153,7 @@ void registry_set_key( const char *k, const char *v )
|
|||
BOOL registry_load( char *filename )
|
||||
{
|
||||
char buffer[MAXLINESIZE];
|
||||
UBYTE * bptr = NULL, * bufstart = NULL;
|
||||
char *bptr = NULL, *bufstart = NULL;
|
||||
char key[32];
|
||||
unsigned int l;
|
||||
UDWORD filesize;
|
||||
|
|
|
@ -514,7 +514,7 @@ void frameShutDown(void)
|
|||
|
||||
If hard_fail is true, we will assert and report on failures.
|
||||
***************************************************************************/
|
||||
static BOOL loadFile2(char *pFileName, UBYTE **ppFileData, UDWORD *pFileSize,
|
||||
static BOOL loadFile2(char *pFileName, char **ppFileData, UDWORD *pFileSize,
|
||||
BOOL AllocateMem, BOOL hard_fail)
|
||||
{
|
||||
PHYSFS_file *pfile;
|
||||
|
@ -541,7 +541,7 @@ static BOOL loadFile2(char *pFileName, UBYTE **ppFileData, UDWORD *pFileSize,
|
|||
|
||||
if (AllocateMem == TRUE) {
|
||||
// Allocate a buffer to store the data and a terminating zero
|
||||
*ppFileData = (UBYTE*)MALLOC(filesize + 1);
|
||||
*ppFileData = MALLOC(filesize + 1);
|
||||
if (*ppFileData == NULL) {
|
||||
debug(LOG_ERROR, "loadFile2: Out of memory loading %s", pFileName);
|
||||
assert(FALSE);
|
||||
|
@ -631,20 +631,20 @@ BOOL saveFile(const char *pFileName, const char *pFileData, UDWORD fileSize)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL loadFile(const char *pFileName, UBYTE **ppFileData, UDWORD *pFileSize)
|
||||
BOOL loadFile(const char *pFileName, char **ppFileData, UDWORD *pFileSize)
|
||||
{
|
||||
return loadFile2(unix_path(pFileName), ppFileData, pFileSize, TRUE, TRUE);
|
||||
}
|
||||
|
||||
// load a file from disk into a fixed memory buffer
|
||||
BOOL loadFileToBuffer(char *pFileName, UBYTE *pFileBuffer, UDWORD bufferSize, UDWORD *pSize)
|
||||
BOOL loadFileToBuffer(char *pFileName, char *pFileBuffer, UDWORD bufferSize, UDWORD *pSize)
|
||||
{
|
||||
*pSize = bufferSize;
|
||||
return loadFile2(unix_path(pFileName), &pFileBuffer, pSize, FALSE, TRUE);
|
||||
}
|
||||
|
||||
// as above but returns quietly if no file found
|
||||
BOOL loadFileToBufferNoError(char *pFileName, UBYTE *pFileBuffer, UDWORD bufferSize, UDWORD *pSize)
|
||||
BOOL loadFileToBufferNoError(char *pFileName, char *pFileBuffer, UDWORD bufferSize, UDWORD *pSize)
|
||||
{
|
||||
*pSize = bufferSize;
|
||||
return loadFile2(unix_path(pFileName), &pFileBuffer, pSize, FALSE, FALSE);
|
||||
|
|
|
@ -155,17 +155,17 @@ extern void frameSetWindowProc(DEFWINPROCTYPE winProc);
|
|||
|
||||
/* Load the file with name pointed to by pFileName into a memory buffer. */
|
||||
BOOL loadFile(const char *pFileName, // The filename
|
||||
UBYTE **ppFileData, // A buffer containing the file contents
|
||||
char **ppFileData, // A buffer containing the file contents
|
||||
UDWORD *pFileSize); // The size of this buffer
|
||||
|
||||
/* Save the data in the buffer into the given file */
|
||||
extern BOOL saveFile(const char *pFileName, const char *pFileData, UDWORD fileSize);
|
||||
|
||||
// load a file from disk into a fixed memory buffer
|
||||
BOOL loadFileToBuffer(char *pFileName, UBYTE *pFileBuffer, UDWORD bufferSize, UDWORD *pSize);
|
||||
BOOL loadFileToBuffer(char *pFileName, char *pFileBuffer, UDWORD bufferSize, UDWORD *pSize);
|
||||
|
||||
// as above but returns quietly if no file found
|
||||
BOOL loadFileToBufferNoError(char *pFileName, UBYTE *pFileBuffer, UDWORD bufferSize,
|
||||
BOOL loadFileToBufferNoError(char *pFileName, char *pFileBuffer, UDWORD bufferSize,
|
||||
UDWORD *pSize);
|
||||
|
||||
extern SDWORD ftol(float f);
|
||||
|
|
|
@ -31,7 +31,7 @@ STRING aCurrResDir[FILE_MAXCHAR];
|
|||
static SDWORD resBlockID;
|
||||
|
||||
// buffer to load file data into
|
||||
static UBYTE *pFileBuffer = NULL;
|
||||
static char *pFileBuffer = NULL;
|
||||
static SDWORD fileBufferSize = 0;
|
||||
|
||||
// prototypes
|
||||
|
@ -97,10 +97,10 @@ void resSetBaseDir(STRING *pResDir)
|
|||
|
||||
/* Parse the res file */
|
||||
BOOL resLoad(STRING *pResFile, SDWORD blockID,
|
||||
UBYTE *pLoadBuffer, SDWORD bufferSize,
|
||||
char *pLoadBuffer, SDWORD bufferSize,
|
||||
BLOCK_HEAP *psMemHeap)
|
||||
{
|
||||
UBYTE *pBuffer;
|
||||
char *pBuffer;
|
||||
UDWORD size;
|
||||
BLOCK_HEAP *psOldHeap;
|
||||
|
||||
|
@ -274,7 +274,7 @@ void SetLastHashName(UDWORD HashName)
|
|||
// Structure for each file currently in use in the resource ... probably only going to be one ... but we will handle upto MAXLOADEDRESOURCE
|
||||
typedef struct
|
||||
{
|
||||
UBYTE *pBuffer; // a pointer to the data
|
||||
char *pBuffer; // a pointer to the data
|
||||
UDWORD size; // number of bytes
|
||||
UBYTE type; // what type of resource is it
|
||||
} RESOURCEFILE;
|
||||
|
@ -321,7 +321,7 @@ BOOL RetreiveResourceFile(char *ResourceName, RESOURCEFILE **NewResource)
|
|||
SDWORD ResID;
|
||||
RESOURCEFILE *ResData;
|
||||
UDWORD size;
|
||||
UBYTE *pBuffer;
|
||||
char *pBuffer;
|
||||
|
||||
ResID=FindEmptyResourceFile();
|
||||
if (ResID==-1) return(FALSE); // all resource files are full
|
||||
|
@ -339,8 +339,7 @@ BOOL RetreiveResourceFile(char *ResourceName, RESOURCEFILE **NewResource)
|
|||
blockSuspendUsage();
|
||||
|
||||
// This is needed for files that do not fit in the WDG cache ... (VAB file for example)
|
||||
// FIXME: evil cast
|
||||
if (!loadFile(ResourceName, (UBYTE **) &pBuffer, &size))
|
||||
if (!loadFile(ResourceName, &pBuffer, &size))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
#define RESID_MAXCHAR 40
|
||||
|
||||
/* Function pointer for a function that loads from a memory buffer */
|
||||
typedef BOOL (*RES_BUFFERLOAD)(UBYTE *pBuffer, UDWORD size, void **pData);
|
||||
typedef BOOL (*RES_BUFFERLOAD)(char *pBuffer, UDWORD size, void **pData);
|
||||
/* Function pointer for a function that loads from a filename */
|
||||
typedef BOOL (*RES_FILELOAD)(STRING *pFile, void **pData);
|
||||
typedef BOOL (*RES_FILELOAD)(char *pFile, void **pData);
|
||||
|
||||
/* Function pointer for releasing a resource loaded by the above functions */
|
||||
typedef void (*RES_FREE)(void *pData);
|
||||
|
@ -80,7 +80,7 @@ extern void resSetBaseDir(STRING *pResDir);
|
|||
/* Parse the res file */
|
||||
struct _block_heap;
|
||||
BOOL resLoad(STRING *pResFile, SDWORD blockID,
|
||||
UBYTE *pLoadBuffer, SDWORD bufferSize,
|
||||
char *pLoadBuffer, SDWORD bufferSize,
|
||||
struct _block_heap *psMemHeap);
|
||||
|
||||
/* Release all the resources currently loaded and the resource load functions */
|
||||
|
|
|
@ -17,7 +17,7 @@ extern STRING aResDir[FILE_MAXCHAR];
|
|||
extern STRING aCurrResDir[FILE_MAXCHAR];
|
||||
|
||||
/* Set the current input buffer for the lexer - used by resLoad */
|
||||
extern void resSetInputBuffer(UBYTE *pBuffer, UDWORD size);
|
||||
extern void resSetInputBuffer(char *pBuffer, UDWORD size);
|
||||
|
||||
/* Give access to the line number and current text for error messages */
|
||||
extern void resGetErrorData(int *pLine, char **ppText);
|
||||
|
|
|
@ -32,8 +32,8 @@ static UDWORD currText=0;
|
|||
static BOOL inComment = FALSE;
|
||||
|
||||
/* Pointer to the input buffer */
|
||||
static UBYTE *pInputBuffer = NULL;
|
||||
static UBYTE *pEndBuffer = NULL;
|
||||
static char *pInputBuffer = NULL;
|
||||
static char *pEndBuffer = NULL;
|
||||
|
||||
#define YY_INPUT(buf,result,max_size) \
|
||||
if (pInputBuffer != pEndBuffer) { \
|
||||
|
@ -104,7 +104,7 @@ file { return FILETOKEN; }
|
|||
%%
|
||||
|
||||
/* Set the current input buffer for the lexer */
|
||||
void resSetInputBuffer(UBYTE *pBuffer, UDWORD size)
|
||||
void resSetInputBuffer(char *pBuffer, UDWORD size)
|
||||
{
|
||||
pInputBuffer = pBuffer;
|
||||
pEndBuffer = pBuffer + size;
|
||||
|
|
|
@ -354,7 +354,7 @@ STRING *strresGetString(STR_RES *psRes, UDWORD id)
|
|||
|
||||
|
||||
/* Load a string resource file */
|
||||
BOOL strresLoad(STR_RES *psRes, UBYTE *pData, UDWORD size)
|
||||
BOOL strresLoad(STR_RES *psRes, char *pData, UDWORD size)
|
||||
{
|
||||
psCurrRes = psRes;
|
||||
strresSetInputBuffer(pData, size);
|
||||
|
|
|
@ -64,7 +64,7 @@ extern BOOL strresGetIDString(STR_RES *psRes, STRING *pIDStr, STRING **ppStoredI
|
|||
extern STRING *strresGetString(STR_RES *psRes, UDWORD id);
|
||||
|
||||
/* Load a string resource file */
|
||||
extern BOOL strresLoad(STR_RES *psRes, UBYTE *pData, UDWORD size);
|
||||
extern BOOL strresLoad(STR_RES *psRes, char *pData, UDWORD size);
|
||||
|
||||
/* Return the the length of a STRING */
|
||||
extern UDWORD stringLen(STRING *pStr);
|
||||
|
|
|
@ -103,8 +103,8 @@ typedef struct {
|
|||
|
||||
typedef struct
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
int x;
|
||||
int y;
|
||||
} POINT;
|
||||
|
||||
#endif /* !WIN32 */
|
||||
|
|
|
@ -307,8 +307,7 @@ anim_SetVals( char szFileName[], UWORD uwAnimID )
|
|||
/***************************************************************************/
|
||||
|
||||
// the playstation version uses sscanf's ... see animload.c
|
||||
BASEANIM *
|
||||
anim_LoadFromBuffer( UBYTE *pBuffer, UDWORD size )
|
||||
BASEANIM *anim_LoadFromBuffer(char *pBuffer, UDWORD size)
|
||||
{
|
||||
if ( ParseResourceFile( pBuffer, size ) == FALSE )
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ ANIMGLOBALS;
|
|||
|
||||
BOOL anim_Init( GETSHAPEFUNC );
|
||||
BOOL anim_Shutdown( void );
|
||||
BASEANIM * anim_LoadFromBuffer( UBYTE *pBuffer, UDWORD size );
|
||||
BASEANIM * anim_LoadFromBuffer(char *pBuffer, UDWORD size);
|
||||
void anim_ReleaseAnim( BASEANIM *psAnim );
|
||||
BOOL anim_Create3D( char szPieFileName[], UWORD uwFrames,
|
||||
UWORD uwFrameRate, UWORD uwObj,
|
||||
|
|
|
@ -18,8 +18,8 @@ static BOOL g_bParsingSubFile;
|
|||
static FILE *g_fpOld;
|
||||
|
||||
/* Pointer to the input buffer */
|
||||
static UBYTE *pInputBuffer = NULL;
|
||||
static UBYTE *pEndBuffer = NULL;
|
||||
static char *pInputBuffer = NULL;
|
||||
static char *pEndBuffer = NULL;
|
||||
|
||||
#define YY_INPUT(buf,result,max_size) \
|
||||
if (pInputBuffer != pEndBuffer) { \
|
||||
|
@ -123,8 +123,7 @@ audp_wrap( void )
|
|||
/* Set the current input buffer for the lexer */
|
||||
/***************************************************************************/
|
||||
|
||||
void
|
||||
parserSetInputBuffer( UBYTE *pBuffer, UDWORD size )
|
||||
void parserSetInputBuffer(char *pBuffer, UDWORD size)
|
||||
{
|
||||
pInputBuffer = pBuffer;
|
||||
pEndBuffer = pBuffer + size;
|
||||
|
|
|
@ -207,7 +207,7 @@ void audp_error(char *pMessage,...)
|
|||
/***************************************************************************/
|
||||
/* Read a resource file */
|
||||
|
||||
BOOL ParseResourceFile( UBYTE *pData, UDWORD fileSize )
|
||||
BOOL ParseResourceFile(char *pData, UDWORD fileSize)
|
||||
{
|
||||
// Tell lex about the input buffer
|
||||
parserSetInputBuffer( pData, fileSize );
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
extern void IncludeFile( char szFileName[] );
|
||||
extern BOOL ParseFile( char szFileName[] );
|
||||
extern void IncludeFile( char szFileName[] );
|
||||
extern void parserSetInputBuffer( UBYTE *pBuffer, UDWORD size );
|
||||
extern BOOL ParseResourceFile( UBYTE *pData, UDWORD fileSize );
|
||||
extern void parserSetInputBuffer(char *pBuffer, UDWORD size);
|
||||
extern BOOL ParseResourceFile(char *pData, UDWORD fileSize);
|
||||
extern BOOL ParsingBuffer( void );
|
||||
extern void parseGetErrorData(int *pLine, char **ppText);
|
||||
|
||||
|
|
|
@ -65,13 +65,12 @@ UWORD iV_GetImageCenterY(IMAGEFILE *ImageFile, UWORD ID)
|
|||
return ImageFile->ImageDefs[ID].YOffset + ImageFile->ImageDefs[ID].Height/2;
|
||||
}
|
||||
|
||||
IMAGEFILE *iV_LoadImageFile(UBYTE *FileData, UDWORD FileSize)
|
||||
IMAGEFILE *iV_LoadImageFile(char *FileData, UDWORD FileSize)
|
||||
{
|
||||
UBYTE *Ptr;
|
||||
char *Ptr;
|
||||
IMAGEHEADER *Header;
|
||||
IMAGEFILE *ImageFile;
|
||||
IMAGEDEF *ImageDef;
|
||||
|
||||
int i;
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ SWORD iV_GetImageYOffset(IMAGEFILE *ImageFile,UWORD ID);
|
|||
UWORD iV_GetImageCenterX(IMAGEFILE *ImageFile,UWORD ID);
|
||||
UWORD iV_GetImageCenterY(IMAGEFILE *ImageFile,UWORD ID);
|
||||
|
||||
IMAGEFILE *iV_LoadImageFile(UBYTE *FileData, UDWORD FileSize);
|
||||
IMAGEFILE *iV_LoadImageFile(char *FileData, UDWORD FileSize);
|
||||
void iV_FreeImageFile(IMAGEFILE *ImageFile);
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ static void wzpng_read_data(png_structp ctx, png_bytep area, png_size_t size)
|
|||
}
|
||||
}
|
||||
|
||||
iBool pie_PNGLoadMem(int8 *pngimage, iSprite *s, iColour *pal)
|
||||
iBool pie_PNGLoadMem(char *pngimage, iSprite *s, iColour *pal)
|
||||
{
|
||||
unsigned int PNG_BYTES_TO_CHECK;
|
||||
png_structp png_ptr = NULL;
|
||||
|
@ -32,7 +32,7 @@ iBool pie_PNGLoadMem(int8 *pngimage, iSprite *s, iColour *pal)
|
|||
wzpng_io_buf* buf = (wzpng_io_buf*)malloc(sizeof(wzpng_io_buf));
|
||||
|
||||
assert(pngimage != NULL);
|
||||
buf->buffer = (char*)pngimage;
|
||||
buf->buffer = pngimage;
|
||||
buf->length = 10000000;
|
||||
|
||||
PNG_BYTES_TO_CHECK = 4;
|
||||
|
@ -142,7 +142,7 @@ error:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL pie_PNGLoadMemToBuffer(int8 *pngimage, iSprite *s, iColour *pal)
|
||||
BOOL pie_PNGLoadMemToBuffer(char *pngimage, iSprite *s, iColour *pal)
|
||||
{
|
||||
return pie_PNGLoadMem(pngimage, s, pal);
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@ extern void pie_DownLoadRadar(unsigned char *buffer, UDWORD texPageID);
|
|||
extern void pie_RenderRadar(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y);
|
||||
extern void pie_RenderRadarRotated(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y,int angle);
|
||||
|
||||
extern void pie_UploadDisplayBuffer(UBYTE *DisplayBuffer);
|
||||
extern void pie_DownloadDisplayBuffer(UBYTE *DisplayBuffer);
|
||||
extern void pie_UploadDisplayBuffer(char *DisplayBuffer);
|
||||
extern void pie_DownloadDisplayBuffer(char *DisplayBuffer);
|
||||
|
||||
extern void pie_D3DSetupRenderForFlip(SDWORD surfaceOffsetX, SDWORD surfaceOffsetY, UWORD* pSrcData, SDWORD srcWidth, SDWORD srcHeight, SDWORD srcStride);
|
||||
extern void pie_D3DRenderForFlip(void);
|
||||
|
|
|
@ -195,8 +195,8 @@ extern void SetBSPCameraPos(SDWORD x,SDWORD y,SDWORD z);
|
|||
extern void pie_D3DPoly(PIED3DPOLY *poly);
|
||||
|
||||
// PNG
|
||||
BOOL pie_PNGLoadMemToBuffer(int8 *pngimage, iSprite *s, iColour *pal);
|
||||
iBool pie_PNGLoadMem(int8 *pngimage, iSprite *s, iColour *pal);
|
||||
BOOL pie_PNGLoadMemToBuffer(char *pngimage, iSprite *s, iColour *pal);
|
||||
iBool pie_PNGLoadMem(char *pngimage, iSprite *s, iColour *pal);
|
||||
|
||||
//necromancer
|
||||
extern void pie_DrawTile(PIEVERTEX *pv0, PIEVERTEX *pv1, PIEVERTEX *pv2, PIEVERTEX *pv3, SDWORD texPage);
|
||||
|
|
|
@ -52,9 +52,9 @@ extern void DrawTransColourImage(IMAGEFILE *ImageFile,UWORD ID,int x,int y,SWORD
|
|||
extern void iV_SetMousePointer(IMAGEFILE *ImageFile,UWORD ImageID);
|
||||
extern void iV_DrawMousePointer(int x,int y);
|
||||
extern void DownLoadRadar(unsigned char *buffer);
|
||||
extern void UploadDisplayBuffer(UBYTE *DisplayBuffer);
|
||||
extern void DownloadDisplayBuffer(UBYTE *DisplayBuffer);
|
||||
extern void ScaleBitmapRGB(UBYTE *DisplayBuffer,int Width,int Height,int ScaleR,int ScaleG,int ScaleB);
|
||||
extern void UploadDisplayBuffer(char *DisplayBuffer);
|
||||
extern void DownloadDisplayBuffer(char *DisplayBuffer);
|
||||
extern void ScaleBitmapRGB(char *DisplayBuffer,int Width,int Height,int ScaleR,int ScaleG,int ScaleB);
|
||||
|
||||
|
||||
extern UDWORD iV_GetMouseFrame(void);
|
||||
|
|
|
@ -41,7 +41,7 @@ extern iTexPage _TEX_PAGE[iV_TEX_MAX];
|
|||
//*************************************************************************
|
||||
|
||||
int iV_GetTexture(char *filename);
|
||||
extern int pie_ReloadTexPage(STRING *filename,SBYTE *pBuffer);
|
||||
extern int pie_ReloadTexPage(STRING *filename, char *pBuffer);
|
||||
extern int pie_AddBMPtoTexPages(iSprite* s, STRING *filename, int type, iBool bColourKeyed, iBool bResource);
|
||||
void pie_ChangeTexPage(int tex_index, iSprite* s, int type, iBool bColourKeyed, iBool bResource);
|
||||
extern void pie_TexInit(void);
|
||||
|
|
|
@ -55,7 +55,7 @@ extern void pie_SetFormattedTextFlags(UDWORD Flags);
|
|||
extern UDWORD pie_GetFormattedTextFlags(void);
|
||||
extern void pie_StartTextExtents(void);
|
||||
extern void pie_FillTextExtents(int BorderThickness,UBYTE r,UBYTE g,UBYTE b,BOOL Alpha);
|
||||
extern UDWORD pie_DrawFormattedText(UBYTE *String,UDWORD x,UDWORD y,UDWORD Width,UDWORD Justify,BOOL DrawBack);
|
||||
extern UDWORD pie_DrawFormattedText(char *String, UDWORD x, UDWORD y, UDWORD Width, UDWORD Justify, BOOL DrawBack);
|
||||
|
||||
extern void pie_DrawText(STRING *string,UDWORD x,UDWORD y);
|
||||
extern void pie_DrawTextToSurface(STRING *String, int XPos, int YPos);
|
||||
|
|
|
@ -424,25 +424,16 @@ void pie_ImageDefTrans(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,int y,i
|
|||
pie_ImageDef(Image,Bmp,Modulus,x,y,FALSE);
|
||||
}
|
||||
|
||||
void pie_UploadDisplayBuffer(UBYTE *DisplayBuffer)
|
||||
void pie_UploadDisplayBuffer(char *DisplayBuffer)
|
||||
{
|
||||
pie_GlobalRenderEnd(FALSE);
|
||||
screen_Upload(NULL);
|
||||
pie_GlobalRenderBegin();
|
||||
}
|
||||
|
||||
void pie_DownloadDisplayBuffer(UBYTE *DisplayBuffer)
|
||||
void pie_DownloadDisplayBuffer(char *DisplayBuffer)
|
||||
{
|
||||
/*
|
||||
switch (pie_GetRenderEngine())
|
||||
{
|
||||
case ENGINE_4101:
|
||||
DownloadDisplayBuffer(DisplayBuffer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
*/
|
||||
/* Not implemented */
|
||||
}
|
||||
|
||||
UDWORD radarTexture;
|
||||
|
|
|
@ -577,7 +577,7 @@ void DownLoadRadar(unsigned char *buffer)
|
|||
|
||||
// Upload the current display back buffer into system memory.
|
||||
//
|
||||
void UploadDisplayBuffer(UBYTE *DisplayBuffer)
|
||||
void UploadDisplayBuffer(char *DisplayBuffer)
|
||||
{
|
||||
|
||||
UDWORD *Source = (UDWORD*) rendSurface.buffer;
|
||||
|
@ -596,7 +596,7 @@ void UploadDisplayBuffer(UBYTE *DisplayBuffer)
|
|||
// Download buffer in system memory to the display back buffer.
|
||||
//
|
||||
/*
|
||||
void DownloadDisplayBuffer(UBYTE *DisplayBuffer)
|
||||
void DownloadDisplayBuffer(char *DisplayBuffer)
|
||||
{
|
||||
#ifndef PIEPSX // was #ifndef PSX
|
||||
UDWORD *Source = (UDWORD*)DisplayBuffer;
|
||||
|
@ -617,7 +617,7 @@ void DownloadDisplayBuffer(UBYTE *DisplayBuffer)
|
|||
|
||||
//*************************************************************************
|
||||
|
||||
void DownloadDisplayBuffer(UBYTE *DisplayBuffer)
|
||||
void DownloadDisplayBuffer(char *DisplayBuffer)
|
||||
{
|
||||
UDWORD *Source = (UDWORD*)DisplayBuffer;
|
||||
UDWORD *Dest = (UDWORD*) rendSurface.buffer;
|
||||
|
@ -653,9 +653,9 @@ void DownloadDisplayBuffer(UBYTE *DisplayBuffer)
|
|||
//*************************************************************************
|
||||
// Scale a bitmaps colours.
|
||||
//
|
||||
void ScaleBitmapRGB(UBYTE *DisplayBuffer,int Width,int Height,int ScaleR,int ScaleG,int ScaleB)
|
||||
void ScaleBitmapRGB(char *DisplayBuffer,int Width,int Height,int ScaleR,int ScaleG,int ScaleB)
|
||||
{
|
||||
UBYTE *Ptr = DisplayBuffer;
|
||||
char *Ptr = DisplayBuffer;
|
||||
UDWORD Size = Width*Height;
|
||||
UDWORD i;
|
||||
|
||||
|
|
|
@ -269,8 +269,8 @@ void (*iV_TransTriangle)(iVertex *vrt);
|
|||
//void (*iV_Box)(int x0,int y0, int x1, int y1, uint32 colour);
|
||||
//void (*iV_BoxFill)(int x0, int y0, int x1, int y1, uint32 colour);
|
||||
|
||||
//void (*iV_DownloadDisplayBuffer)(UBYTE *DisplayBuffer);
|
||||
//void (*pie_DownLoadRadar)(unsigned char *buffer);
|
||||
//void (*iV_DownloadDisplayBuffer)(char *DisplayBuffer);
|
||||
//void (*pie_DownLoadRadar)(char *buffer);
|
||||
|
||||
//void (*iV_TransBoxFill)(SDWORD x0, SDWORD y0, SDWORD x1, SDWORD y1);
|
||||
//void (*iV_UniTransBoxFill)(SDWORD x0,SDWORD y0, SDWORD x1, SDWORD y1, UDWORD rgb, UDWORD transparency);
|
||||
|
|
|
@ -179,7 +179,7 @@ int iV_GetTexture(char *filename)
|
|||
}
|
||||
|
||||
// According to logfile not used, deprecating
|
||||
WZ_DEPRECATED int pie_ReloadTexPage(STRING *filename, SBYTE *pBuffer)
|
||||
WZ_DEPRECATED int pie_ReloadTexPage(STRING *filename, char *pBuffer)
|
||||
{
|
||||
int i = 0;
|
||||
iSprite s;
|
||||
|
@ -200,8 +200,7 @@ WZ_DEPRECATED int pie_ReloadTexPage(STRING *filename, SBYTE *pBuffer)
|
|||
s.height = _TEX_PAGE[i].tex.height;
|
||||
s.bmp = _TEX_PAGE[i].tex.bmp;
|
||||
|
||||
// FIXME: evil cast
|
||||
pie_PNGLoadMemToBuffer((int8 *)pBuffer, &s, NULL);
|
||||
pie_PNGLoadMemToBuffer(pBuffer, &s, NULL);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
|
|
@ -342,10 +342,10 @@ void SetExtentsMode_USEMAX(void)
|
|||
//
|
||||
// Returns y coord of next text line.
|
||||
//
|
||||
UDWORD pie_DrawFormattedText(UBYTE *String,UDWORD x,UDWORD y,UDWORD Width,UDWORD Justify,BOOL DrawBack)
|
||||
UDWORD pie_DrawFormattedText(char *String, UDWORD x, UDWORD y, UDWORD Width, UDWORD Justify, BOOL DrawBack)
|
||||
{
|
||||
int i,si,osi;
|
||||
int Len = strlen((char*)String);
|
||||
int Len = strlen(String);
|
||||
int jx = x; // Default to left justify.
|
||||
int jy = y;
|
||||
int WWidth;
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
// ////////////////////////////////////////////////////////////////////////
|
||||
// Prototypes
|
||||
UDWORD NEThashFile (STRING *pFileName);
|
||||
UDWORD NEThashBuffer (UBYTE *pData, UDWORD size);
|
||||
UDWORD NEThashFile(char *pFileName);
|
||||
UDWORD NEThashBuffer(char *pData, UDWORD size);
|
||||
|
||||
BOOL NETsetKey (UDWORD c1,UDWORD c2,UDWORD c3, UDWORD c4);
|
||||
NETMSG* NETmanglePacket (NETMSG *msg);
|
||||
|
@ -37,7 +37,7 @@ BOOL NETunmangleData ( long *input, long *result, UDWORD dataSize);
|
|||
|
||||
// ////////////////////////////////////////////////////////////////////////
|
||||
// make a hash value from an exe name.
|
||||
UDWORD NEThashFile(STRING *pFileName)
|
||||
UDWORD NEThashFile(char *pFileName)
|
||||
{
|
||||
UDWORD hashval,c,*val;
|
||||
PHYSFS_file *pFileHandle;
|
||||
|
@ -88,7 +88,7 @@ UDWORD NEThashFile(STRING *pFileName)
|
|||
// ////////////////////////////////////////////////////////////////////////
|
||||
// return a hash from a data buffer.
|
||||
|
||||
UDWORD NEThashBuffer(UBYTE *pData, UDWORD size)
|
||||
UDWORD NEThashBuffer(char *pData, UDWORD size)
|
||||
{
|
||||
UDWORD hashval,*val;
|
||||
UDWORD pt;
|
||||
|
|
|
@ -169,9 +169,9 @@ extern NETMSG* NETmanglePacket(NETMSG *msg);
|
|||
extern VOID NETunmanglePacket(NETMSG *msg);
|
||||
extern BOOL NETmangleData(long *input, long *result, UDWORD dataSize);
|
||||
extern BOOL NETunmangleData(long *input, long *result, UDWORD dataSize);
|
||||
extern UDWORD NEThashFile(STRING *pFileName);
|
||||
extern UDWORD NEThashFile(char *pFileName);
|
||||
extern UCHAR NEThashVal(UDWORD value);
|
||||
extern UDWORD NEThashBuffer(unsigned char *pData, UDWORD size);
|
||||
extern UDWORD NEThashBuffer(char *pData, UDWORD size);
|
||||
|
||||
extern WZ_DEPRECATED BOOL NETcheckRegistryEntries (char *name,char *guid);
|
||||
extern WZ_DEPRECATED BOOL NETsetRegistryEntries (char *name,char *guid,char *file,char *cline,char *path,char *cdir);
|
||||
|
|
|
@ -19,7 +19,7 @@ typedef struct _event_save_header
|
|||
|
||||
|
||||
// save the context information for the script system
|
||||
static BOOL eventSaveContext(UBYTE *pBuffer, UDWORD *pSize)
|
||||
static BOOL eventSaveContext(char *pBuffer, UDWORD *pSize)
|
||||
{
|
||||
UDWORD size, valSize;
|
||||
SDWORD numVars, i, numContext;
|
||||
|
@ -27,7 +27,7 @@ static BOOL eventSaveContext(UBYTE *pBuffer, UDWORD *pSize)
|
|||
VAL_CHUNK *psCVals;
|
||||
INTERP_VAL *psVal;
|
||||
SCR_VAL_SAVE saveFunc;
|
||||
UBYTE *pPos;
|
||||
char *pPos;
|
||||
//not hashed STRING *pScriptID;
|
||||
UDWORD hashedName;
|
||||
UWORD *pValSize = NULL;
|
||||
|
@ -60,7 +60,7 @@ static BOOL eventSaveContext(UBYTE *pBuffer, UDWORD *pSize)
|
|||
|
||||
if (pBuffer != NULL)
|
||||
{
|
||||
//not hashed strcpy((STRING *)pPos, pScriptID);
|
||||
//not hashed strcpy(pPos, pScriptID);
|
||||
//not hashed pPos += strlen(pScriptID) + 1;
|
||||
*((UDWORD*)pPos) = (UDWORD)hashedName;
|
||||
pPos += sizeof(UDWORD);
|
||||
|
@ -159,14 +159,14 @@ static BOOL eventSaveContext(UBYTE *pBuffer, UDWORD *pSize)
|
|||
}
|
||||
|
||||
// load the context information for the script system
|
||||
static BOOL eventLoadContext(SDWORD version, UBYTE *pBuffer, UDWORD *pSize)
|
||||
static BOOL eventLoadContext(SDWORD version, char *pBuffer, UDWORD *pSize)
|
||||
{
|
||||
UDWORD size, valSize, data;
|
||||
SDWORD numVars, i, numContext, context;
|
||||
SCRIPT_CONTEXT *psCCont;
|
||||
INTERP_TYPE type;
|
||||
SCR_VAL_LOAD loadFunc;
|
||||
UBYTE *pPos;
|
||||
char *pPos;
|
||||
STRING *pScriptID;
|
||||
SCRIPT_CODE *psCode;
|
||||
SWORD release;
|
||||
|
@ -272,14 +272,14 @@ static BOOL eventLoadContext(SDWORD version, UBYTE *pBuffer, UDWORD *pSize)
|
|||
}
|
||||
|
||||
// load the context information for the script system
|
||||
static BOOL eventLoadContextHashed(SDWORD version, UBYTE *pBuffer, UDWORD *pSize)
|
||||
static BOOL eventLoadContextHashed(SDWORD version, char *pBuffer, UDWORD *pSize)
|
||||
{
|
||||
UDWORD size, valSize, data;
|
||||
SDWORD numVars, i, numContext, context;
|
||||
SCRIPT_CONTEXT *psCCont;
|
||||
INTERP_TYPE type;
|
||||
SCR_VAL_LOAD loadFunc;
|
||||
UBYTE *pPos;
|
||||
char *pPos;
|
||||
//not hashed STRING *pScriptID;
|
||||
UDWORD hashedName;
|
||||
SCRIPT_CODE *psCode;
|
||||
|
@ -427,11 +427,11 @@ BOOL eventFindContext(SDWORD id, SCRIPT_CONTEXT **ppsContext)
|
|||
}
|
||||
|
||||
// save a list of triggers
|
||||
BOOL eventSaveTriggerList(ACTIVE_TRIGGER *psList, UBYTE *pBuffer, UDWORD *pSize)
|
||||
BOOL eventSaveTriggerList(ACTIVE_TRIGGER *psList, char *pBuffer, UDWORD *pSize)
|
||||
{
|
||||
ACTIVE_TRIGGER *psCurr;
|
||||
UDWORD size;
|
||||
UBYTE *pPos;
|
||||
char *pPos;
|
||||
SDWORD numTriggers, context;
|
||||
|
||||
size = 0;
|
||||
|
@ -483,10 +483,10 @@ BOOL eventSaveTriggerList(ACTIVE_TRIGGER *psList, UBYTE *pBuffer, UDWORD *pSize)
|
|||
|
||||
|
||||
// load a list of triggers
|
||||
BOOL eventLoadTriggerList(SDWORD version, UBYTE *pBuffer, UDWORD *pSize)
|
||||
static BOOL eventLoadTriggerList(SDWORD version, char *pBuffer, UDWORD *pSize)
|
||||
{
|
||||
UDWORD size, event, offset, time;
|
||||
UBYTE *pPos;
|
||||
char *pPos;
|
||||
SDWORD numTriggers, context, type, trigger, i;
|
||||
SCRIPT_CONTEXT *psContext;
|
||||
|
||||
|
@ -540,10 +540,10 @@ BOOL eventLoadTriggerList(SDWORD version, UBYTE *pBuffer, UDWORD *pSize)
|
|||
|
||||
|
||||
// Save the state of the event system
|
||||
BOOL eventSaveState(SDWORD version, UBYTE **ppBuffer, UDWORD *pFileSize)
|
||||
BOOL eventSaveState(SDWORD version, char **ppBuffer, UDWORD *pFileSize)
|
||||
{
|
||||
UDWORD size, totalSize;
|
||||
UBYTE *pBuffer, *pPos;
|
||||
char *pBuffer, *pPos;
|
||||
EVENT_SAVE_HDR *psHdr;
|
||||
|
||||
totalSize = sizeof(EVENT_SAVE_HDR);
|
||||
|
@ -621,10 +621,10 @@ BOOL eventSaveState(SDWORD version, UBYTE **ppBuffer, UDWORD *pFileSize)
|
|||
|
||||
|
||||
// Load the state of the event system
|
||||
BOOL eventLoadState(UBYTE *pBuffer, UDWORD fileSize, BOOL bHashed)
|
||||
BOOL eventLoadState(char *pBuffer, UDWORD fileSize, BOOL bHashed)
|
||||
{
|
||||
UDWORD size, totalSize, version;
|
||||
UBYTE *pPos;
|
||||
char *pPos;
|
||||
EVENT_SAVE_HDR *psHdr;
|
||||
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
#define _evntsave_h
|
||||
|
||||
// Save the state of the event system
|
||||
extern BOOL eventSaveState(SDWORD version, UBYTE **ppBuffer, UDWORD *pFileSize);
|
||||
extern BOOL eventSaveState(SDWORD version, char **ppBuffer, UDWORD *pFileSize);
|
||||
|
||||
// Load the state of the event system
|
||||
extern BOOL eventLoadState(UBYTE *pBuffer, UDWORD fileSize, BOOL bHashed);
|
||||
extern BOOL eventLoadState(char *pBuffer, UDWORD fileSize, BOOL bHashed);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -594,7 +594,7 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
|
|||
|
||||
if(!IsRetStackEmpty()) //There was a caller function before this one
|
||||
{
|
||||
if(!PopRetStack(&ip)) //Pop return address
|
||||
if(!PopRetStack(ip)) //Pop return address
|
||||
{
|
||||
debug( LOG_ERROR, "interpRunScript() - PopRetStack(): failed to pop return adress.");
|
||||
return FALSE;
|
||||
|
@ -782,4 +782,4 @@ BOOL PopRetStack(UDWORD *psVal)
|
|||
SDWORD GetCallDepth()
|
||||
{
|
||||
return (retStackPos + 1) / 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,9 +59,9 @@ typedef enum _access_type
|
|||
// function pointer for script variable saving
|
||||
// if pBuffer is NULL the script system is just asking how much space the saved variable will require
|
||||
// otherwise pBuffer points to an array to store the value in
|
||||
typedef BOOL (*SCR_VAL_SAVE)(INTERP_TYPE type, UDWORD data, UBYTE *pBuffer, UDWORD *pSize);
|
||||
typedef BOOL (*SCR_VAL_SAVE)(INTERP_TYPE type, UDWORD data, char *pBuffer, UDWORD *pSize);
|
||||
// function pointer for script variable loading
|
||||
typedef BOOL (*SCR_VAL_LOAD)(SDWORD version, INTERP_TYPE type, UBYTE *pBuffer, UDWORD size, UDWORD *pData);
|
||||
typedef BOOL (*SCR_VAL_LOAD)(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size, UDWORD *pData);
|
||||
|
||||
/* Type for a user type symbol */
|
||||
typedef struct _type_symbol
|
||||
|
@ -244,7 +244,7 @@ extern CONST_SYMBOL *asScrConstantTab;
|
|||
extern CALLBACK_SYMBOL *asScrCallbackTab;
|
||||
|
||||
/* Set the current input buffer for the lexer */
|
||||
extern void scriptSetInputBuffer(UBYTE *pBuffer, UDWORD size);
|
||||
extern void scriptSetInputBuffer(char *pBuffer, UDWORD size);
|
||||
|
||||
/* Initialise the parser ready for a new script */
|
||||
extern BOOL scriptInitParser(void);
|
||||
|
@ -267,7 +267,7 @@ extern BOOL scriptAddVariable(VAR_DECL *psStorage, VAR_IDENT_DECL *psVarIdent);
|
|||
extern BOOL scriptAddTrigger(STRING *pIdent, TRIGGER_DECL *psDecl, UDWORD line);
|
||||
|
||||
/* Add a new event symbol */
|
||||
extern BOOL scriptDeclareEvent(STRING *pIdent, EVENT_SYMBOL **ppsEvent, INT numArgs);
|
||||
extern BOOL scriptDeclareEvent(STRING *pIdent, EVENT_SYMBOL **ppsEvent, UDWORD numArgs);
|
||||
|
||||
// Add the code to a defined event
|
||||
extern BOOL scriptDefineEvent(EVENT_SYMBOL *psEvent, CODE_BLOCK *psCode, SDWORD trigger);
|
||||
|
|
|
@ -73,8 +73,7 @@ extern SDWORD GetCallDepth();
|
|||
*/
|
||||
|
||||
/* Compile a script program */
|
||||
extern BOOL scriptCompile(UBYTE *pData, UDWORD fileSize,
|
||||
SCRIPT_CODE **ppsProg, SCR_DEBUGTYPE debugType);
|
||||
extern BOOL scriptCompile(char *pData, UDWORD fileSize, SCRIPT_CODE **ppsProg, SCR_DEBUGTYPE debugType);
|
||||
|
||||
/* Free a SCRIPT_CODE structure */
|
||||
extern void scriptFreeCode(SCRIPT_CODE *psCode);
|
||||
|
|
|
@ -1,446 +1,446 @@
|
|||
%{
|
||||
/*
|
||||
* script.l
|
||||
*
|
||||
* Script file lexer.
|
||||
*/
|
||||
|
||||
#include "lib/framework/frame.h"
|
||||
#include "interp.h"
|
||||
#include "parse.h"
|
||||
#include "script.h"
|
||||
|
||||
/* Get the Yacc definitions */
|
||||
#include "script_parser.h"
|
||||
|
||||
/* Maximum length for any TEXT value */
|
||||
#ifndef YYLMAX
|
||||
#define YYLMAX 255
|
||||
#endif
|
||||
|
||||
/* Store for any string values */
|
||||
static STRING aText[TEXT_BUFFERS][YYLMAX];
|
||||
static UDWORD currText=0;
|
||||
|
||||
// Note if we are in a comment
|
||||
static BOOL inComment = FALSE;
|
||||
|
||||
/* Pointer to the input buffer */
|
||||
static UBYTE *pInputBuffer = NULL;
|
||||
static UBYTE *pEndBuffer = NULL;
|
||||
|
||||
#define YY_INPUT(buf, result, max_size) \
|
||||
if (pInputBuffer != pEndBuffer) { \
|
||||
buf[0] = *(pInputBuffer++); result = 1; \
|
||||
} else { \
|
||||
buf[0] = EOF; result = YY_NULL; \
|
||||
}
|
||||
|
||||
#undef scr_getc
|
||||
#define scr_getc() (pInputBuffer != pEndBuffer ? *(pInputBuffer++) : EOF)
|
||||
|
||||
/* Get the token type for a variable symbol */
|
||||
SDWORD scriptGetVarToken(VAR_SYMBOL *psVar)
|
||||
{
|
||||
BOOL object;
|
||||
|
||||
// See if this is an object pointer
|
||||
if (!asScrTypeTab || psVar->type < VAL_USERTYPESTART)
|
||||
{
|
||||
object = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
object = asScrTypeTab[psVar->type - VAL_USERTYPESTART].accessType == AT_OBJECT;
|
||||
}
|
||||
|
||||
if (psVar->storage == ST_OBJECT)
|
||||
{
|
||||
/* This is an object member variable */
|
||||
if (object)
|
||||
{
|
||||
return OBJ_OBJVAR;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psVar->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_OBJVAR;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_OBJVAR;
|
||||
break;
|
||||
default:
|
||||
return USER_OBJVAR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (psVar->dimensions > 0)
|
||||
{
|
||||
/* This is an array variable */
|
||||
if (object)
|
||||
{
|
||||
return OBJ_ARRAY;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psVar->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_ARRAY;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_ARRAY;
|
||||
break;
|
||||
default:
|
||||
return VAR_ARRAY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This is a standard variable */
|
||||
if (object)
|
||||
{
|
||||
return OBJ_VAR;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psVar->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_VAR;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_VAR;
|
||||
break;
|
||||
default:
|
||||
return VAR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the token type for a constant symbol */
|
||||
SDWORD scriptGetConstToken(CONST_SYMBOL *psConst)
|
||||
{
|
||||
BOOL object;
|
||||
|
||||
// See if this is an object constant
|
||||
if (!asScrTypeTab || psConst->type < VAL_USERTYPESTART)
|
||||
{
|
||||
object = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
object = asScrTypeTab[psConst->type - VAL_USERTYPESTART].accessType == AT_OBJECT;
|
||||
}
|
||||
|
||||
switch (psConst->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_CONSTANT;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_CONSTANT;
|
||||
break;
|
||||
default:
|
||||
if (object)
|
||||
{
|
||||
return OBJ_CONSTANT;
|
||||
}
|
||||
else
|
||||
{
|
||||
return USER_CONSTANT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the token type for a function symbol */
|
||||
SDWORD scriptGetFuncToken(FUNC_SYMBOL *psFunc)
|
||||
{
|
||||
BOOL object;
|
||||
|
||||
// See if this is an object pointer
|
||||
if (!asScrTypeTab || psFunc->type < VAL_USERTYPESTART)
|
||||
{
|
||||
object = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
object = asScrTypeTab[psFunc->type - VAL_USERTYPESTART].accessType == AT_OBJECT;
|
||||
}
|
||||
|
||||
if (object)
|
||||
{
|
||||
return OBJ_FUNC;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psFunc->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_FUNC;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_FUNC;
|
||||
break;
|
||||
case VAL_VOID:
|
||||
return FUNC;
|
||||
break;
|
||||
default:
|
||||
return USER_FUNC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Get the token type for a custom function symbol */
|
||||
SDWORD scriptGetCustomFuncToken(EVENT_SYMBOL *psFunc)
|
||||
{
|
||||
BOOL object;
|
||||
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken" );
|
||||
|
||||
// See if this is an object pointer
|
||||
object = asScrTypeTab[psFunc->retType - VAL_USERTYPESTART].accessType == AT_OBJECT;
|
||||
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken 3" );
|
||||
|
||||
if (object)
|
||||
{
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: object" );
|
||||
return OBJ_FUNC_CUST;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psFunc->retType)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: VAL_BOOL" );
|
||||
return BOOL_FUNC_CUST;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: VAL_INT" );
|
||||
return NUM_FUNC_CUST;
|
||||
break;
|
||||
case VAL_STRING: /* <NEW> */
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: VAL_STRING" );
|
||||
return STRING_FUNC_CUST;
|
||||
break;
|
||||
case VAL_VOID:
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: void function" );
|
||||
return VOID_FUNC_CUST;
|
||||
break;
|
||||
default:
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: default" );
|
||||
return USER_FUNC_CUST;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
debug( LOG_SCRIPT, "END scriptGetCustomFuncToken" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%option prefix="scr_"
|
||||
%option nounput
|
||||
%option yylineno
|
||||
|
||||
%x COMMENT
|
||||
%x SLCOMMENT
|
||||
%x QUOTE
|
||||
|
||||
%%
|
||||
/* Match to key words */
|
||||
/*begin return START;*/
|
||||
/*end return END;*/
|
||||
wait return WAIT;
|
||||
every return EVERY;
|
||||
trigger return TRIGGER;
|
||||
event return EVENT;
|
||||
inactive return INACTIVE;
|
||||
init return INITIALISE;
|
||||
link return LINK;
|
||||
ref return REF;
|
||||
|
||||
/* new stuff */
|
||||
function return FUNCTION;
|
||||
return return RETURN;
|
||||
|
||||
public { scr_lval.stype = ST_PUBLIC; return STORAGE; }
|
||||
private { scr_lval.stype = ST_PRIVATE; return STORAGE; }
|
||||
while return WHILE;
|
||||
if return IF;
|
||||
else return ELSE;
|
||||
exit return EXIT;
|
||||
pause return PAUSE;
|
||||
|
||||
/* Match to type key words */
|
||||
bool { scr_lval.tval = VAL_BOOL; return TYPE; }
|
||||
BOOL { scr_lval.tval = VAL_BOOL; return TYPE; }
|
||||
int { scr_lval.tval = VAL_INT; return TYPE; }
|
||||
INT { scr_lval.tval = VAL_INT; return TYPE; }
|
||||
|
||||
/* return value for void functions */
|
||||
void { scr_lval.tval = VAL_VOID; return TYPE; }
|
||||
VOID { scr_lval.tval = VAL_VOID; return TYPE; }
|
||||
|
||||
/* string type isn't implemented yet */
|
||||
/* string { ais_lval.tval = VAL_STRING; return TYPE; } */
|
||||
/* object { scr_lval.tval = VAL_OBJECT; 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; }
|
||||
|
||||
/* Match boolean operators */
|
||||
"==" return BOOLEQUAL;
|
||||
"!=" return NOTEQUAL;
|
||||
">=" return GREATEQUAL;
|
||||
"<=" return LESSEQUAL;
|
||||
">" return GREATER;
|
||||
"<" return LESS;
|
||||
and return _AND;
|
||||
AND return _AND;
|
||||
or return _OR;
|
||||
OR return _OR;
|
||||
not return _NOT;
|
||||
NOT return _NOT;
|
||||
|
||||
/* Match floating point numbers */
|
||||
/*-?[0-9]*"."[0-9]+ { scr_lval.fval = (float)atof(scr_text); return FLOAT; }*/
|
||||
|
||||
/* Match integer numbers */
|
||||
-?[0-9]+ { scr_lval.ival = atol(scr_text); return INTEGER; }
|
||||
|
||||
/* Match identifiers */
|
||||
[a-zA-Z][0-9_a-zA-Z]* {
|
||||
/* See if this identifier has been defined as a type */
|
||||
if (scriptLookUpType(scr_text, &scr_lval.tval))
|
||||
{
|
||||
DBP0(("[lex] TYPE\n"));
|
||||
return TYPE;
|
||||
}
|
||||
/* See if this identifier has been defined as a variable */
|
||||
else if (scriptLookUpVariable(scr_text, &scr_lval.vSymbol))
|
||||
{
|
||||
DBP0(("[lex] variable\n"));
|
||||
return scriptGetVarToken(scr_lval.vSymbol);
|
||||
}
|
||||
/* See if this identifier has been defined as a constant */
|
||||
else if (scriptLookUpConstant(scr_text, &scr_lval.cSymbol))
|
||||
{
|
||||
DBP0(("[lex] constant\n"));
|
||||
return scriptGetConstToken(scr_lval.cSymbol);
|
||||
}
|
||||
/* See if this identifier has been defined as a function */
|
||||
else if (scriptLookUpFunction(scr_text, &scr_lval.fSymbol))
|
||||
{
|
||||
DBP0(("[lex] func\n"));
|
||||
return scriptGetFuncToken(scr_lval.fSymbol);
|
||||
}
|
||||
|
||||
/* See if this identifier has been defined as a custom function */
|
||||
else if (scriptLookUpCustomFunction(scr_text, &scr_lval.eSymbol))
|
||||
{
|
||||
debug( LOG_SCRIPT, "scriptLookUpCustomFunction: '%s' - custom function", scr_text );
|
||||
return scriptGetCustomFuncToken(scr_lval.eSymbol);
|
||||
}
|
||||
|
||||
else if (scriptLookUpTrigger(scr_text, &scr_lval.tSymbol))
|
||||
{
|
||||
DBP0(("[lex] TRIG_SYM\n"));
|
||||
return TRIG_SYM;
|
||||
}
|
||||
else if (scriptLookUpEvent(scr_text, &scr_lval.eSymbol))
|
||||
{
|
||||
DBP0(("[lex] EVENT_SYM\n"));
|
||||
return EVENT_SYM;
|
||||
}
|
||||
else if (scriptLookUpCallback(scr_text, &scr_lval.cbSymbol))
|
||||
{
|
||||
DBP0(("[lex] CALLBACK_SYM\n"));
|
||||
return CALLBACK_SYM;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(aText[currText], scr_text);
|
||||
scr_lval.sval = aText[currText];
|
||||
currText = (currText + 1) % TEXT_BUFFERS;
|
||||
DBP0(("[lex] IDENT\n"));
|
||||
return IDENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* Match quoted text */
|
||||
\" { BEGIN QUOTE; }
|
||||
<QUOTE>\" { BEGIN 0; }
|
||||
<QUOTE>[^\"\n]* {
|
||||
strcpy(aText[currText], scr_text);
|
||||
scr_lval.sval = aText[currText];
|
||||
currText = (currText + 1) % TEXT_BUFFERS;
|
||||
return QTEXT;
|
||||
}
|
||||
|
||||
/* Skip white space */
|
||||
[ \t\n\x0d\x0a] ;
|
||||
|
||||
/* Strip comments */
|
||||
"/*" { inComment=TRUE; BEGIN COMMENT; }
|
||||
<COMMENT>"*/" |
|
||||
<COMMENT>"*/"\n { inComment=FALSE; BEGIN 0; }
|
||||
<COMMENT>. |
|
||||
<COMMENT>\n ;
|
||||
|
||||
/* Strip single line comments */
|
||||
"//" { BEGIN SLCOMMENT; }
|
||||
<SLCOMMENT>\n { BEGIN 0; }
|
||||
<SLCOMMENT>[^\n]* ;
|
||||
|
||||
/* Match anything that's been missed and pass it as a char */
|
||||
. return scr_text[0];
|
||||
|
||||
%%
|
||||
|
||||
/* Set the current input buffer for the lexer */
|
||||
void scriptSetInputBuffer(UBYTE *pBuffer, UDWORD size)
|
||||
{
|
||||
pInputBuffer = pBuffer;
|
||||
pEndBuffer = pBuffer + size;
|
||||
|
||||
/* Reset the lexer in case it's been used before */
|
||||
scr__flush_buffer( YY_CURRENT_BUFFER );
|
||||
}
|
||||
|
||||
void scriptGetErrorData(int *pLine, char **ppText)
|
||||
{
|
||||
*pLine = scr_lineno;
|
||||
*ppText = scr_text;
|
||||
}
|
||||
|
||||
int scr_wrap(void)
|
||||
{
|
||||
if (inComment)
|
||||
{
|
||||
DBERROR(("Warning: reched end of file in a comment"));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
%{
|
||||
/*
|
||||
* script.l
|
||||
*
|
||||
* Script file lexer.
|
||||
*/
|
||||
|
||||
#include "lib/framework/frame.h"
|
||||
#include "interp.h"
|
||||
#include "parse.h"
|
||||
#include "script.h"
|
||||
|
||||
/* Get the Yacc definitions */
|
||||
#include "script_parser.h"
|
||||
|
||||
/* Maximum length for any TEXT value */
|
||||
#ifndef YYLMAX
|
||||
#define YYLMAX 255
|
||||
#endif
|
||||
|
||||
/* Store for any string values */
|
||||
static STRING aText[TEXT_BUFFERS][YYLMAX];
|
||||
static UDWORD currText=0;
|
||||
|
||||
// Note if we are in a comment
|
||||
static BOOL inComment = FALSE;
|
||||
|
||||
/* Pointer to the input buffer */
|
||||
static char *pInputBuffer = NULL;
|
||||
static char *pEndBuffer = NULL;
|
||||
|
||||
#define YY_INPUT(buf, result, max_size) \
|
||||
if (pInputBuffer != pEndBuffer) { \
|
||||
buf[0] = *(pInputBuffer++); result = 1; \
|
||||
} else { \
|
||||
buf[0] = EOF; result = YY_NULL; \
|
||||
}
|
||||
|
||||
#undef scr_getc
|
||||
#define scr_getc() (pInputBuffer != pEndBuffer ? *(pInputBuffer++) : EOF)
|
||||
|
||||
/* Get the token type for a variable symbol */
|
||||
SDWORD scriptGetVarToken(VAR_SYMBOL *psVar)
|
||||
{
|
||||
BOOL object;
|
||||
|
||||
// See if this is an object pointer
|
||||
if (!asScrTypeTab || psVar->type < VAL_USERTYPESTART)
|
||||
{
|
||||
object = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
object = asScrTypeTab[psVar->type - VAL_USERTYPESTART].accessType == AT_OBJECT;
|
||||
}
|
||||
|
||||
if (psVar->storage == ST_OBJECT)
|
||||
{
|
||||
/* This is an object member variable */
|
||||
if (object)
|
||||
{
|
||||
return OBJ_OBJVAR;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psVar->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_OBJVAR;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_OBJVAR;
|
||||
break;
|
||||
default:
|
||||
return USER_OBJVAR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (psVar->dimensions > 0)
|
||||
{
|
||||
/* This is an array variable */
|
||||
if (object)
|
||||
{
|
||||
return OBJ_ARRAY;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psVar->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_ARRAY;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_ARRAY;
|
||||
break;
|
||||
default:
|
||||
return VAR_ARRAY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This is a standard variable */
|
||||
if (object)
|
||||
{
|
||||
return OBJ_VAR;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psVar->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_VAR;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_VAR;
|
||||
break;
|
||||
default:
|
||||
return VAR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the token type for a constant symbol */
|
||||
SDWORD scriptGetConstToken(CONST_SYMBOL *psConst)
|
||||
{
|
||||
BOOL object;
|
||||
|
||||
// See if this is an object constant
|
||||
if (!asScrTypeTab || psConst->type < VAL_USERTYPESTART)
|
||||
{
|
||||
object = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
object = asScrTypeTab[psConst->type - VAL_USERTYPESTART].accessType == AT_OBJECT;
|
||||
}
|
||||
|
||||
switch (psConst->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_CONSTANT;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_CONSTANT;
|
||||
break;
|
||||
default:
|
||||
if (object)
|
||||
{
|
||||
return OBJ_CONSTANT;
|
||||
}
|
||||
else
|
||||
{
|
||||
return USER_CONSTANT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the token type for a function symbol */
|
||||
SDWORD scriptGetFuncToken(FUNC_SYMBOL *psFunc)
|
||||
{
|
||||
BOOL object;
|
||||
|
||||
// See if this is an object pointer
|
||||
if (!asScrTypeTab || psFunc->type < VAL_USERTYPESTART)
|
||||
{
|
||||
object = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
object = asScrTypeTab[psFunc->type - VAL_USERTYPESTART].accessType == AT_OBJECT;
|
||||
}
|
||||
|
||||
if (object)
|
||||
{
|
||||
return OBJ_FUNC;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psFunc->type)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
return BOOL_FUNC;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
return NUM_FUNC;
|
||||
break;
|
||||
case VAL_VOID:
|
||||
return FUNC;
|
||||
break;
|
||||
default:
|
||||
return USER_FUNC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Get the token type for a custom function symbol */
|
||||
SDWORD scriptGetCustomFuncToken(EVENT_SYMBOL *psFunc)
|
||||
{
|
||||
BOOL object;
|
||||
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken" );
|
||||
|
||||
// See if this is an object pointer
|
||||
object = asScrTypeTab[psFunc->retType - VAL_USERTYPESTART].accessType == AT_OBJECT;
|
||||
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken 3" );
|
||||
|
||||
if (object)
|
||||
{
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: object" );
|
||||
return OBJ_FUNC_CUST;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (psFunc->retType)
|
||||
{
|
||||
case VAL_BOOL:
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: VAL_BOOL" );
|
||||
return BOOL_FUNC_CUST;
|
||||
break;
|
||||
case VAL_INT:
|
||||
// case VAL_FLOAT:
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: VAL_INT" );
|
||||
return NUM_FUNC_CUST;
|
||||
break;
|
||||
case VAL_STRING: /* <NEW> */
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: VAL_STRING" );
|
||||
return STRING_FUNC_CUST;
|
||||
break;
|
||||
case VAL_VOID:
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: void function" );
|
||||
return VOID_FUNC_CUST;
|
||||
break;
|
||||
default:
|
||||
debug( LOG_SCRIPT, "scriptGetCustomFuncToken: default" );
|
||||
return USER_FUNC_CUST;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
debug( LOG_SCRIPT, "END scriptGetCustomFuncToken" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%option prefix="scr_"
|
||||
%option nounput
|
||||
%option yylineno
|
||||
|
||||
%x COMMENT
|
||||
%x SLCOMMENT
|
||||
%x QUOTE
|
||||
|
||||
%%
|
||||
/* Match to key words */
|
||||
/*begin return START;*/
|
||||
/*end return END;*/
|
||||
wait return WAIT;
|
||||
every return EVERY;
|
||||
trigger return TRIGGER;
|
||||
event return EVENT;
|
||||
inactive return INACTIVE;
|
||||
init return INITIALISE;
|
||||
link return LINK;
|
||||
ref return REF;
|
||||
|
||||
/* new stuff */
|
||||
function return FUNCTION;
|
||||
return return RETURN;
|
||||
|
||||
public { scr_lval.stype = ST_PUBLIC; return STORAGE; }
|
||||
private { scr_lval.stype = ST_PRIVATE; return STORAGE; }
|
||||
while return WHILE;
|
||||
if return IF;
|
||||
else return ELSE;
|
||||
exit return EXIT;
|
||||
pause return PAUSE;
|
||||
|
||||
/* Match to type key words */
|
||||
bool { scr_lval.tval = VAL_BOOL; return TYPE; }
|
||||
BOOL { scr_lval.tval = VAL_BOOL; return TYPE; }
|
||||
int { scr_lval.tval = VAL_INT; return TYPE; }
|
||||
INT { scr_lval.tval = VAL_INT; return TYPE; }
|
||||
|
||||
/* return value for void functions */
|
||||
void { scr_lval.tval = VAL_VOID; return TYPE; }
|
||||
VOID { scr_lval.tval = VAL_VOID; return TYPE; }
|
||||
|
||||
/* string type isn't implemented yet */
|
||||
/* string { ais_lval.tval = VAL_STRING; return TYPE; } */
|
||||
/* object { scr_lval.tval = VAL_OBJECT; 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; }
|
||||
|
||||
/* Match boolean operators */
|
||||
"==" return BOOLEQUAL;
|
||||
"!=" return NOTEQUAL;
|
||||
">=" return GREATEQUAL;
|
||||
"<=" return LESSEQUAL;
|
||||
">" return GREATER;
|
||||
"<" return LESS;
|
||||
and return _AND;
|
||||
AND return _AND;
|
||||
or return _OR;
|
||||
OR return _OR;
|
||||
not return _NOT;
|
||||
NOT return _NOT;
|
||||
|
||||
/* Match floating point numbers */
|
||||
/*-?[0-9]*"."[0-9]+ { scr_lval.fval = (float)atof(scr_text); return FLOAT; }*/
|
||||
|
||||
/* Match integer numbers */
|
||||
-?[0-9]+ { scr_lval.ival = atol(scr_text); return INTEGER; }
|
||||
|
||||
/* Match identifiers */
|
||||
[a-zA-Z][0-9_a-zA-Z]* {
|
||||
/* See if this identifier has been defined as a type */
|
||||
if (scriptLookUpType(scr_text, &scr_lval.tval))
|
||||
{
|
||||
DBP0(("[lex] TYPE\n"));
|
||||
return TYPE;
|
||||
}
|
||||
/* See if this identifier has been defined as a variable */
|
||||
else if (scriptLookUpVariable(scr_text, &scr_lval.vSymbol))
|
||||
{
|
||||
DBP0(("[lex] variable\n"));
|
||||
return scriptGetVarToken(scr_lval.vSymbol);
|
||||
}
|
||||
/* See if this identifier has been defined as a constant */
|
||||
else if (scriptLookUpConstant(scr_text, &scr_lval.cSymbol))
|
||||
{
|
||||
DBP0(("[lex] constant\n"));
|
||||
return scriptGetConstToken(scr_lval.cSymbol);
|
||||
}
|
||||
/* See if this identifier has been defined as a function */
|
||||
else if (scriptLookUpFunction(scr_text, &scr_lval.fSymbol))
|
||||
{
|
||||
DBP0(("[lex] func\n"));
|
||||
return scriptGetFuncToken(scr_lval.fSymbol);
|
||||
}
|
||||
|
||||
/* See if this identifier has been defined as a custom function */
|
||||
else if (scriptLookUpCustomFunction(scr_text, &scr_lval.eSymbol))
|
||||
{
|
||||
debug( LOG_SCRIPT, "scriptLookUpCustomFunction: '%s' - custom function", scr_text );
|
||||
return scriptGetCustomFuncToken(scr_lval.eSymbol);
|
||||
}
|
||||
|
||||
else if (scriptLookUpTrigger(scr_text, &scr_lval.tSymbol))
|
||||
{
|
||||
DBP0(("[lex] TRIG_SYM\n"));
|
||||
return TRIG_SYM;
|
||||
}
|
||||
else if (scriptLookUpEvent(scr_text, &scr_lval.eSymbol))
|
||||
{
|
||||
DBP0(("[lex] EVENT_SYM\n"));
|
||||
return EVENT_SYM;
|
||||
}
|
||||
else if (scriptLookUpCallback(scr_text, &scr_lval.cbSymbol))
|
||||
{
|
||||
DBP0(("[lex] CALLBACK_SYM\n"));
|
||||
return CALLBACK_SYM;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(aText[currText], scr_text);
|
||||
scr_lval.sval = aText[currText];
|
||||
currText = (currText + 1) % TEXT_BUFFERS;
|
||||
DBP0(("[lex] IDENT\n"));
|
||||
return IDENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* Match quoted text */
|
||||
\" { BEGIN QUOTE; }
|
||||
<QUOTE>\" { BEGIN 0; }
|
||||
<QUOTE>[^\"\n]* {
|
||||
strcpy(aText[currText], scr_text);
|
||||
scr_lval.sval = aText[currText];
|
||||
currText = (currText + 1) % TEXT_BUFFERS;
|
||||
return QTEXT;
|
||||
}
|
||||
|
||||
/* Skip white space */
|
||||
[ \t\n\x0d\x0a] ;
|
||||
|
||||
/* Strip comments */
|
||||
"/*" { inComment=TRUE; BEGIN COMMENT; }
|
||||
<COMMENT>"*/" |
|
||||
<COMMENT>"*/"\n { inComment=FALSE; BEGIN 0; }
|
||||
<COMMENT>. |
|
||||
<COMMENT>\n ;
|
||||
|
||||
/* Strip single line comments */
|
||||
"//" { BEGIN SLCOMMENT; }
|
||||
<SLCOMMENT>\n { BEGIN 0; }
|
||||
<SLCOMMENT>[^\n]* ;
|
||||
|
||||
/* Match anything that's been missed and pass it as a char */
|
||||
. return scr_text[0];
|
||||
|
||||
%%
|
||||
|
||||
/* Set the current input buffer for the lexer */
|
||||
void scriptSetInputBuffer(char *pBuffer, UDWORD size)
|
||||
{
|
||||
pInputBuffer = pBuffer;
|
||||
pEndBuffer = pBuffer + size;
|
||||
|
||||
/* Reset the lexer in case it's been used before */
|
||||
scr__flush_buffer( YY_CURRENT_BUFFER );
|
||||
}
|
||||
|
||||
void scriptGetErrorData(int *pLine, char **ppText)
|
||||
{
|
||||
*pLine = scr_lineno;
|
||||
*ppText = scr_text;
|
||||
}
|
||||
|
||||
int scr_wrap(void)
|
||||
{
|
||||
if (inComment)
|
||||
{
|
||||
DBERROR(("Warning: reached end of file in a comment"));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -74,7 +74,8 @@ BOOL audio_Disabled( void )
|
|||
BOOL audio_Init( AUDIO_CALLBACK pStopTrackCallback )
|
||||
{
|
||||
// init audio system
|
||||
if (g_bAudioEnabled = sound_Init(MAX_SAME_SAMPLES))
|
||||
g_bAudioEnabled = sound_Init(MAX_SAME_SAMPLES);
|
||||
if (g_bAudioEnabled)
|
||||
{
|
||||
// allocate sample heap
|
||||
if ( !HEAP_CREATE(&g_psSampleHeap, AUDIO_SAMPLE_HEAP_INIT, AUDIO_SAMPLE_HEAP_EXT, sizeof(AUDIO_SAMPLE)) )
|
||||
|
@ -648,7 +649,7 @@ BOOL audio_LoadTrackFromFile( signed char szFileName[] )
|
|||
// =======================================================================================================================
|
||||
// =======================================================================================================================
|
||||
//
|
||||
void *audio_LoadTrackFromBuffer( UBYTE *pBuffer, UDWORD udwSize )
|
||||
void *audio_LoadTrackFromBuffer(char *pBuffer, UDWORD udwSize)
|
||||
{
|
||||
// if audio not enabled return TRUE to carry on game without audio
|
||||
if ( g_bAudioEnabled == FALSE )
|
||||
|
|
|
@ -17,7 +17,7 @@ extern BOOL audio_Shutdown();
|
|||
extern BOOL audio_Disabled( void );
|
||||
|
||||
extern BOOL audio_LoadTrackFromFile( signed char szFileName[] );
|
||||
extern void * audio_LoadTrackFromBuffer( UBYTE *pBuffer, UDWORD udwSize );
|
||||
extern void * audio_LoadTrackFromBuffer(char *pBuffer, UDWORD udwSize);
|
||||
extern BOOL audio_SetTrackVals( char szFileName[], BOOL bLoop, int *piID,
|
||||
int iVol, int iPriority, int iAudibleRadius, int VagID );
|
||||
extern BOOL audio_SetTrackValsHashName( UDWORD hash, BOOL bLoop, int iTrack, int iVol,
|
||||
|
|
|
@ -370,7 +370,7 @@ BOOL sound_ReadTrackFromBuffer( TRACK *psTrack, void *pBuffer, UDWORD udwSize )
|
|||
// =======================================================================================================================
|
||||
// =======================================================================================================================
|
||||
//
|
||||
BOOL sound_ReadTrackFromFile( TRACK *psTrack, signed char szFileName[] )
|
||||
BOOL sound_ReadTrackFromFile(TRACK *psTrack, char szFileName[])
|
||||
{
|
||||
PHYSFS_file * f = PHYSFS_openRead(szFileName);
|
||||
static char* buffer = NULL;
|
||||
|
|
|
@ -238,7 +238,7 @@ BOOL sound_AddTrack( TRACK *pTrack )
|
|||
// =======================================================================================================================
|
||||
// =======================================================================================================================
|
||||
//
|
||||
void *sound_LoadTrackFromBuffer( UBYTE *pBuffer, UDWORD udwSize )
|
||||
void *sound_LoadTrackFromBuffer(char *pBuffer, UDWORD udwSize)
|
||||
{
|
||||
//~~~~~~~~~~~~
|
||||
TRACK *pTrack;
|
||||
|
@ -287,7 +287,7 @@ void *sound_LoadTrackFromBuffer( UBYTE *pBuffer, UDWORD udwSize )
|
|||
// =======================================================================================================================
|
||||
// =======================================================================================================================
|
||||
//
|
||||
BOOL sound_LoadTrackFromFile( signed char szFileName[] )
|
||||
BOOL sound_LoadTrackFromFile(char szFileName[])
|
||||
{
|
||||
//~~~~~~~~~~~~
|
||||
TRACK *pTrack;
|
||||
|
|
|
@ -98,8 +98,8 @@ typedef struct TRACK
|
|||
BOOL sound_Init( SDWORD iMaxSameSamples );
|
||||
BOOL sound_Shutdown();
|
||||
|
||||
BOOL sound_LoadTrackFromFile( signed char szFileName[] );
|
||||
void * sound_LoadTrackFromBuffer( UBYTE *pBuffer, UDWORD udwSize );
|
||||
BOOL sound_LoadTrackFromFile(char szFileName[]);
|
||||
void * sound_LoadTrackFromBuffer(char *pBuffer, UDWORD udwSize);
|
||||
BOOL sound_SetTrackVals( TRACK *psTrack, BOOL bLoop, SDWORD iTrack,
|
||||
SDWORD iVol, SDWORD iPriority, SDWORD iAudibleRadius,
|
||||
SDWORD VagID );
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
BOOL sound_InitLibrary( void );
|
||||
void sound_ShutdownLibrary( void );
|
||||
|
||||
BOOL sound_ReadTrackFromFile( TRACK * psTrack, signed char szFileName[] );
|
||||
BOOL sound_ReadTrackFromFile(TRACK * psTrack, char szFileName[]);
|
||||
BOOL sound_ReadTrackFromBuffer( TRACK * psTrack, void *pBuffer,
|
||||
UDWORD udwSize );
|
||||
void sound_FreeTrack( TRACK * psTrack );
|
||||
|
|
188
src/data.c
188
src/data.c
|
@ -68,7 +68,7 @@ void dataISpriteRelease(void *pData);
|
|||
* Source
|
||||
*
|
||||
*********************************************************/
|
||||
void calcCheatHash(UBYTE *pBuffer, UDWORD size, UDWORD cheat)
|
||||
void calcCheatHash(char *pBuffer, UDWORD size, UDWORD cheat)
|
||||
{
|
||||
if(!bMultiPlayer)
|
||||
{
|
||||
|
@ -103,7 +103,7 @@ void dataClearSaveFlag(void)
|
|||
|
||||
|
||||
/* Load the body stats */
|
||||
BOOL bufferSBODYLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSBODYLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SBODY);
|
||||
if (!loadBodyStats((SBYTE*)pBuffer, size))
|
||||
|
@ -129,7 +129,7 @@ void dataReleaseStats(void *pData)
|
|||
|
||||
|
||||
/* Load the weapon stats */
|
||||
BOOL bufferSWEAPONLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSWEAPONLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size, CHEAT_SWEAPON);
|
||||
if (!loadWeaponStats((SBYTE*)pBuffer, size))
|
||||
|
@ -148,7 +148,7 @@ BOOL bufferSWEAPONLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the constructor stats */
|
||||
BOOL bufferSCONSTRLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSCONSTRLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SCONSTR);
|
||||
if (!loadConstructStats((SBYTE*)pBuffer, size))
|
||||
|
@ -167,7 +167,7 @@ BOOL bufferSCONSTRLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the ECM stats */
|
||||
BOOL bufferSECMLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSECMLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SECM);
|
||||
|
||||
|
@ -187,7 +187,7 @@ BOOL bufferSECMLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the Propulsion stats */
|
||||
BOOL bufferSPROPLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSPROPLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SPROP);
|
||||
|
||||
|
@ -207,7 +207,7 @@ BOOL bufferSPROPLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the Sensor stats */
|
||||
BOOL bufferSSENSORLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSSENSORLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SSENSOR);
|
||||
|
||||
|
@ -227,7 +227,7 @@ BOOL bufferSSENSORLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the Repair stats */
|
||||
BOOL bufferSREPAIRLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSREPAIRLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SREPAIR);
|
||||
|
||||
|
@ -247,7 +247,7 @@ BOOL bufferSREPAIRLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the Brain stats */
|
||||
BOOL bufferSBRAINLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSBRAINLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SBRAIN);
|
||||
|
||||
|
@ -266,26 +266,8 @@ BOOL bufferSBRAINLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* Load the Program stats */
|
||||
/*BOOL bufferSPROGRAMLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
if (!loadProgramStats((SBYTE*)pBuffer, size))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!allocComponentList(COMP_PROGRAM, numProgramStats))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//not interested in this value
|
||||
*ppData = NULL;
|
||||
return TRUE;
|
||||
}*/
|
||||
|
||||
/* Load the PropulsionType stats */
|
||||
BOOL bufferSPROPTYPESLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSPROPTYPESLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SPROPTY);
|
||||
|
||||
|
@ -301,7 +283,7 @@ BOOL bufferSPROPTYPESLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the propulsion type sound stats */
|
||||
BOOL bufferSPROPSNDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSPROPSNDLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
if (!loadPropulsionSounds((SBYTE*)pBuffer, size))
|
||||
{
|
||||
|
@ -314,7 +296,7 @@ BOOL bufferSPROPSNDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the SSPECABIL stats */
|
||||
BOOL bufferSSPECABILLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSSPECABILLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
if (!loadSpecialAbility((SBYTE*)pBuffer, size))
|
||||
{
|
||||
|
@ -328,7 +310,7 @@ BOOL bufferSSPECABILLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the STERRTABLE stats */
|
||||
BOOL bufferSTERRTABLELoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSTERRTABLELoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_STERRT);
|
||||
|
||||
|
@ -344,7 +326,7 @@ BOOL bufferSTERRTABLELoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the body/propulsion IMDs stats */
|
||||
BOOL bufferSBPIMDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSBPIMDLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
if (!loadBodyPropulsionIMDs((SBYTE*)pBuffer, size))
|
||||
{
|
||||
|
@ -358,7 +340,7 @@ BOOL bufferSBPIMDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the weapon sound stats */
|
||||
BOOL bufferSWEAPSNDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSWEAPSNDLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
if (!loadWeaponSounds((SBYTE*)pBuffer, size))
|
||||
{
|
||||
|
@ -372,7 +354,7 @@ BOOL bufferSWEAPSNDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the Weapon Effect modifier stats */
|
||||
BOOL bufferSWEAPMODLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSWEAPMODLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SWEAPMOD);
|
||||
|
||||
|
@ -389,7 +371,7 @@ BOOL bufferSWEAPMODLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
|
||||
|
||||
/* Load the Template stats */
|
||||
BOOL bufferSTEMPLLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSTEMPLLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_STEMP);
|
||||
|
||||
|
@ -412,7 +394,7 @@ void dataSTEMPLRelease(void *pData)
|
|||
}
|
||||
|
||||
/* Load the Template weapons stats */
|
||||
BOOL bufferSTEMPWEAPLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSTEMPWEAPLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_STEMPWEAP);
|
||||
|
||||
|
@ -427,22 +409,8 @@ BOOL bufferSTEMPWEAPLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* Load the Template programs stats */
|
||||
/*BOOL bufferSTEMPPROGLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
if (!loadDroidPrograms((SBYTE*)pBuffer, size))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
//not interested in this value
|
||||
*ppData = NULL;
|
||||
return TRUE;
|
||||
}*/
|
||||
|
||||
/* Load the Structure stats */
|
||||
BOOL bufferSSTRUCTLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSSTRUCTLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SSTRUCT);
|
||||
|
||||
|
@ -469,7 +437,7 @@ void dataSSTRUCTRelease(void *pData)
|
|||
}
|
||||
|
||||
/* Load the Structure Weapons stats */
|
||||
BOOL bufferSSTRWEAPLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSSTRWEAPLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SSTRWEAP);
|
||||
|
||||
|
@ -485,7 +453,7 @@ BOOL bufferSSTRWEAPLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the Structure Functions stats */
|
||||
BOOL bufferSSTRFUNCLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSSTRFUNCLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_STRFUNC);
|
||||
|
||||
|
@ -501,7 +469,7 @@ BOOL bufferSSTRFUNCLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the Structure strength modifier stats */
|
||||
BOOL bufferSSTRMODLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSSTRMODLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SSTRMOD);
|
||||
|
||||
|
@ -516,7 +484,7 @@ BOOL bufferSSTRMODLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the Feature stats */
|
||||
BOOL bufferSFEATLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSFEATLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
|
||||
calcCheatHash(pBuffer,size,CHEAT_SFEAT);
|
||||
|
@ -539,7 +507,7 @@ void dataSFEATRelease(void *pData)
|
|||
}
|
||||
|
||||
/* Load the Functions stats */
|
||||
BOOL bufferSFUNCLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSFUNCLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_SFUNC);
|
||||
|
||||
|
@ -570,7 +538,7 @@ void dataRESCHRelease(void *pData)
|
|||
}
|
||||
|
||||
/* Load the Research stats */
|
||||
BOOL bufferRESCHLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferRESCHLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_RESCH);
|
||||
|
||||
|
@ -596,7 +564,7 @@ BOOL bufferRESCHLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the research pre-requisites */
|
||||
BOOL bufferRPREREQLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferRPREREQLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_RPREREQ);
|
||||
|
||||
|
@ -610,23 +578,8 @@ BOOL bufferRPREREQLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* Load the research components required */
|
||||
/*BOOL bufferRCOMPREQLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
//DON'T DO ANYTHING WITH IT SINCE SHOULDN'T BE LOADING ANYMORE - AB 20/04/98
|
||||
if (!loadResearchArtefacts((SBYTE*)pBuffer, size, REQ_LIST))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
//not interested in this value
|
||||
*ppData = NULL;
|
||||
return TRUE;
|
||||
}*/
|
||||
|
||||
/* Load the research components made redundant */
|
||||
BOOL bufferRCOMPREDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferRCOMPREDLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
calcCheatHash(pBuffer,size,CHEAT_RCOMPRED);
|
||||
|
||||
|
@ -642,7 +595,7 @@ BOOL bufferRCOMPREDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the research component results */
|
||||
BOOL bufferRCOMPRESLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferRCOMPRESLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
|
||||
calcCheatHash(pBuffer,size,CHEAT_RCOMPRES);
|
||||
|
@ -659,7 +612,7 @@ BOOL bufferRCOMPRESLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the research structures required */
|
||||
BOOL bufferRSTRREQLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferRSTRREQLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
|
||||
calcCheatHash(pBuffer,size,CHEAT_RSTRREQ);
|
||||
|
@ -676,9 +629,8 @@ BOOL bufferRSTRREQLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the research structures made redundant */
|
||||
BOOL bufferRSTRREDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferRSTRREDLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
|
||||
calcCheatHash(pBuffer,size,CHEAT_RSTRRED);
|
||||
|
||||
if (!loadResearchStructures((SBYTE*)pBuffer, size, RED_LIST))
|
||||
|
@ -692,9 +644,8 @@ BOOL bufferRSTRREDLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the research structure results */
|
||||
BOOL bufferRSTRRESLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferRSTRRESLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
|
||||
calcCheatHash(pBuffer,size,CHEAT_RSTRRES);
|
||||
|
||||
if (!loadResearchStructures((SBYTE*)pBuffer, size, RES_LIST))
|
||||
|
@ -709,7 +660,7 @@ BOOL bufferRSTRRESLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the research functions */
|
||||
BOOL bufferRFUNCLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferRFUNCLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
|
||||
calcCheatHash(pBuffer,size,CHEAT_RFUNC);
|
||||
|
@ -726,7 +677,7 @@ BOOL bufferRFUNCLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
/* Load the message viewdata */
|
||||
BOOL bufferSMSGLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferSMSGLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
VIEWDATA *pViewData;
|
||||
|
||||
|
@ -750,13 +701,10 @@ void dataSMSGRelease(void *pData)
|
|||
}
|
||||
|
||||
/* Load an imd */
|
||||
BOOL dataIMDBufferLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL dataIMDBufferLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
iIMDShape *psIMD;
|
||||
char *pBufferPosition;
|
||||
|
||||
// FIXME: evil cast
|
||||
pBufferPosition = (char *)pBuffer;
|
||||
char *pBufferPosition = pBuffer;
|
||||
|
||||
psIMD = iV_ProcessIMD(&pBufferPosition, pBufferPosition + size, "", "", FALSE);
|
||||
if (psIMD == NULL) {
|
||||
|
@ -769,22 +717,14 @@ BOOL dataIMDBufferLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
|
||||
/* Release an imd */
|
||||
/*void dataIMDRelease(void *pData)
|
||||
BOOL dataIMGPAGELoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
iV_IMDRelease(pData);
|
||||
}*/
|
||||
|
||||
|
||||
BOOL dataIMGPAGELoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
// iPalette sPal;
|
||||
iSprite *psSprite = (iSprite*) MALLOC(sizeof(iSprite));
|
||||
if (!psSprite) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(!pie_PNGLoadMem((SBYTE *)pBuffer,psSprite,NULL))
|
||||
if (!pie_PNGLoadMem(pBuffer, psSprite, NULL))
|
||||
{
|
||||
debug( LOG_ERROR, "IMGPAGE load failed" );
|
||||
return FALSE;
|
||||
|
@ -803,13 +743,13 @@ void dataIMGPAGERelease(void *pData)
|
|||
}
|
||||
|
||||
// Tertiles loader. This version for hardware renderer.
|
||||
BOOL dataHWTERTILESLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL dataHWTERTILESLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
// tile loader.
|
||||
if (bTilesPCXLoaded)
|
||||
{
|
||||
debug( LOG_TEXTURE, "Reloading terrain tiles\n" );
|
||||
if(!pie_PNGLoadMem((SBYTE *)pBuffer,&tilesPCX,NULL))
|
||||
if(!pie_PNGLoadMem(pBuffer,&tilesPCX,NULL))
|
||||
{
|
||||
debug( LOG_ERROR, "HWTERTILES reload failed" );
|
||||
return FALSE;
|
||||
|
@ -818,7 +758,7 @@ BOOL dataHWTERTILESLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
else
|
||||
{
|
||||
debug( LOG_TEXTURE, "Loading terrain tiles\n" );
|
||||
if(!pie_PNGLoadMem((SBYTE *)pBuffer,&tilesPCX,NULL))
|
||||
if(!pie_PNGLoadMem(pBuffer,&tilesPCX,NULL))
|
||||
{
|
||||
debug( LOG_ERROR, "HWTERTILES load failed" );
|
||||
return FALSE;
|
||||
|
@ -867,7 +807,7 @@ void dataHWTERTILESRelease(void *pData)
|
|||
}
|
||||
|
||||
|
||||
BOOL dataIMGLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL dataIMGLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
IMAGEFILE *ImageFile;
|
||||
|
||||
|
@ -892,7 +832,7 @@ void dataIMGRelease(void *pData)
|
|||
#define TEXTUREHEIGHT (256)
|
||||
|
||||
/* Load a texturepage into memory */
|
||||
BOOL bufferTexPageLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL bufferTexPageLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
TEXTUREPAGE *NewTexturePage;
|
||||
iPalette *psPal;
|
||||
|
@ -951,7 +891,7 @@ BOOL bufferTexPageLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
{
|
||||
// replace the old texture page with the new one
|
||||
debug(LOG_TEXTURE, "bufferTexPageLoad: replacing old");
|
||||
id = pie_ReloadTexPage(texfile,(UBYTE *)pBuffer);
|
||||
id = pie_ReloadTexPage(texfile, pBuffer);
|
||||
ASSERT((id >=0,"pie_ReloadTexPage failed"));
|
||||
*ppData = NULL;
|
||||
}
|
||||
|
@ -1004,27 +944,6 @@ BOOL bufferTexPageLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
|
||||
}
|
||||
|
||||
BOOL bufferTexPageLoadSoftOnly(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
if (!war_GetTranslucent())
|
||||
{
|
||||
return bufferTexPageLoad(pBuffer, size, ppData);
|
||||
}
|
||||
*ppData = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL bufferTexPageLoadHardOnly(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
if (war_GetTranslucent())
|
||||
{
|
||||
return bufferTexPageLoad(pBuffer, size, ppData);
|
||||
}
|
||||
*ppData = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* Release an iSprite */
|
||||
void dataISpriteRelease(void *pData)
|
||||
{
|
||||
|
@ -1063,7 +982,7 @@ void dataTexPageRelease(void *pData)
|
|||
|
||||
|
||||
/* Load an audio file */
|
||||
BOOL dataAudioLoad( UBYTE *pBuffer, UDWORD size, void **ppData )
|
||||
BOOL dataAudioLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
TRACK *psTrack;
|
||||
|
||||
|
@ -1099,7 +1018,7 @@ void dataAudioRelease( void *pData )
|
|||
|
||||
|
||||
/* Load an audio file */
|
||||
BOOL dataAudioCfgLoad( UBYTE *pBuffer, UDWORD size, void **ppData )
|
||||
BOOL dataAudioCfgLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
*ppData = NULL;
|
||||
|
||||
|
@ -1116,7 +1035,7 @@ BOOL dataAudioCfgLoad( UBYTE *pBuffer, UDWORD size, void **ppData )
|
|||
|
||||
|
||||
/* Load an anim file */
|
||||
BOOL dataAnimLoad( UBYTE *pBuffer, UDWORD size, void **ppData )
|
||||
BOOL dataAnimLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
BASEANIM *psAnim;
|
||||
|
||||
|
@ -1135,17 +1054,14 @@ BOOL dataAnimLoad( UBYTE *pBuffer, UDWORD size, void **ppData )
|
|||
|
||||
|
||||
/* Load an audio config file */
|
||||
BOOL dataAnimCfgLoad( UBYTE *pBuffer, UDWORD size, void **ppData )
|
||||
BOOL dataAnimCfgLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
*ppData = NULL;
|
||||
// printf("\n\n\n\n\n\n\n=======dataAnimCfgLoad=========\n\n %s \n\n\n\n\n\n",pBuffer);
|
||||
if ( ParseResourceFile( pBuffer, size ) == FALSE )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1156,7 +1072,7 @@ void dataAnimRelease( void *pData )
|
|||
}
|
||||
|
||||
/* Load a string resource file */
|
||||
BOOL dataStrResLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL dataStrResLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
// recreate the string resource if it was freed by a WRF release
|
||||
if (psStringRes == NULL)
|
||||
|
@ -1188,7 +1104,7 @@ void dataStrResRelease(void *pData)
|
|||
|
||||
/* Load a script file */
|
||||
// All scripts, binary or otherwise are now passed through this routine
|
||||
BOOL dataScriptLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL dataScriptLoad(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
SCRIPT_CODE *psProg=NULL;
|
||||
BLOCK_HEAP *psHeap;
|
||||
|
@ -1219,7 +1135,7 @@ BOOL dataScriptLoad(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
}
|
||||
|
||||
// Load a script variable values file
|
||||
BOOL dataScriptLoadVals(UBYTE *pBuffer, UDWORD size, void **ppData)
|
||||
BOOL dataScriptLoadVals(char *pBuffer, UDWORD size, void **ppData)
|
||||
{
|
||||
*ppData = NULL;
|
||||
|
||||
|
@ -1242,7 +1158,7 @@ BOOL dataScriptLoadVals(UBYTE *pBuffer, UDWORD size, void **ppData)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL dataSaveGameLoad(STRING *pFile, void **ppData)
|
||||
BOOL dataSaveGameLoad(char *pFile, void **ppData)
|
||||
{
|
||||
if (!stageTwoInitialise())
|
||||
{
|
||||
|
@ -1296,7 +1212,6 @@ static RES_TYPE_MIN ResourceTypes[]=
|
|||
{"SSENSOR", bufferSSENSORLoad, NULL},
|
||||
{"SECM", bufferSECMLoad, NULL},
|
||||
{"SREPAIR", bufferSREPAIRLoad, NULL},
|
||||
//{"SPROGRAM", bufferSPROGRAMLoad, NULL},
|
||||
{"SCONSTR", bufferSCONSTRLoad, NULL},
|
||||
{"SPROPTYPES", bufferSPROPTYPESLoad, NULL},
|
||||
{"SPROPSND", bufferSPROPSNDLoad, NULL},
|
||||
|
@ -1307,7 +1222,6 @@ static RES_TYPE_MIN ResourceTypes[]=
|
|||
{"SWEAPMOD", bufferSWEAPMODLoad, NULL},
|
||||
{"STEMPL", bufferSTEMPLLoad, dataSTEMPLRelease}, //template and associated files
|
||||
{"STEMPWEAP", bufferSTEMPWEAPLoad, NULL},
|
||||
//{"STEMPPROG", bufferSTEMPPROGLoad, NULL},
|
||||
{"SSTRUCT", bufferSSTRUCTLoad, dataSSTRUCTRelease}, //structure stats and associated files
|
||||
{"SSTRFUNC", bufferSSTRFUNCLoad, NULL},
|
||||
{"SSTRWEAP", bufferSSTRWEAPLoad, NULL},
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
/* Pass all the data loading functions to the framework library */
|
||||
extern BOOL dataInitLoadFuncs(void);
|
||||
|
||||
extern BOOL dataIMGPAGELoad(UBYTE *pBuffer, UDWORD size, void **ppData);
|
||||
extern BOOL dataIMGPAGELoad(char *pBuffer, UDWORD size, void **ppData);
|
||||
extern void dataIMGPAGERelease(void *pData);
|
||||
|
||||
extern void dataSetSaveFlag(void);
|
||||
|
|
|
@ -2997,7 +2997,7 @@ iIMDShape *psOrig;
|
|||
|
||||
// -----------------------------------------------------------------------------------
|
||||
/* This will read in the effects data */
|
||||
BOOL readFXData( UBYTE *pFileData, UDWORD fileSize )
|
||||
BOOL readFXData(char *pFileData, UDWORD fileSize)
|
||||
{
|
||||
UDWORD expectedFileSize;
|
||||
FX_SAVEHEADER *psHeader;
|
||||
|
|
|
@ -231,7 +231,7 @@ extern void initPerimeterSmoke ( iIMDShape *pImd, UDWORD x, UDWORD y, UDWORD z
|
|||
#define SKY_MULT 1
|
||||
#define SKY_SHIMMY_BASE ((DEG(1)*SKY_MULT)/2)
|
||||
#define SKY_SHIMMY (SKY_SHIMMY_BASE - (rand()%(2*SKY_SHIMMY_BASE)))
|
||||
extern BOOL readFXData( UBYTE *pFileData, UDWORD fileSize );
|
||||
BOOL readFXData(char *pFileData, UDWORD fileSize);
|
||||
extern BOOL writeFXData( STRING *pFileName );
|
||||
extern void effectSetSize(UDWORD size);
|
||||
extern void effectSetLandLightSpec(LAND_LIGHT_SPEC spec);
|
||||
|
|
302
src/game.c
302
src/game.c
|
@ -1187,85 +1187,85 @@ static BOOL IsScenario;
|
|||
* Local ProtoTypes
|
||||
*/
|
||||
/***************************************************************************/
|
||||
BOOL gameLoad(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL gameLoadV7(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL gameLoadV(UBYTE *pFileData, UDWORD filesize, UDWORD version);
|
||||
BOOL gameLoad(char *pFileData, UDWORD filesize);
|
||||
static BOOL gameLoadV7(char *pFileData, UDWORD filesize);
|
||||
static BOOL gameLoadV(char *pFileData, UDWORD filesize, UDWORD version);
|
||||
static BOOL writeGameFile(STRING *pFileName, SDWORD saveType);
|
||||
static BOOL writeMapFile(STRING *pFileName);
|
||||
|
||||
static BOOL loadSaveDroidInitV2(UBYTE *pFileData, UDWORD filesize,UDWORD quantity);
|
||||
static BOOL loadSaveDroidInitV2(char *pFileData, UDWORD filesize,UDWORD quantity);
|
||||
|
||||
static BOOL loadSaveDroidInit(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveDroidInit(char *pFileData, UDWORD filesize);
|
||||
static DROID_TEMPLATE *FindDroidTemplate(STRING *name,UDWORD player);
|
||||
|
||||
static BOOL loadSaveDroid(UBYTE *pFileData, UDWORD filesize, DROID **ppsCurrentDroidLists);
|
||||
static BOOL loadSaveDroidV11(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists);
|
||||
static BOOL loadSaveDroidV19(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists);
|
||||
static BOOL loadSaveDroidV(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists);
|
||||
static BOOL loadSaveDroid(char *pFileData, UDWORD filesize, DROID **ppsCurrentDroidLists);
|
||||
static BOOL loadSaveDroidV11(char *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists);
|
||||
static BOOL loadSaveDroidV19(char *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists);
|
||||
static BOOL loadSaveDroidV(char *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists);
|
||||
static BOOL loadDroidSetPointers(void);
|
||||
static BOOL writeDroidFile(STRING *pFileName, DROID **ppsCurrentDroidLists);
|
||||
|
||||
static BOOL loadSaveStructure(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveStructureV7(UBYTE *pFileData, UDWORD filesize, UDWORD numStructures);
|
||||
static BOOL loadSaveStructureV19(UBYTE *pFileData, UDWORD filesize, UDWORD numStructures, UDWORD version);
|
||||
static BOOL loadSaveStructureV(UBYTE *pFileData, UDWORD filesize, UDWORD numStructures, UDWORD version);
|
||||
static BOOL loadSaveStructure(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveStructureV7(char *pFileData, UDWORD filesize, UDWORD numStructures);
|
||||
static BOOL loadSaveStructureV19(char *pFileData, UDWORD filesize, UDWORD numStructures, UDWORD version);
|
||||
static BOOL loadSaveStructureV(char *pFileData, UDWORD filesize, UDWORD numStructures, UDWORD version);
|
||||
static BOOL loadStructSetPointers(void);
|
||||
static BOOL writeStructFile(STRING *pFileName);
|
||||
|
||||
static BOOL loadSaveTemplate(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveTemplateV7(UBYTE *pFileData, UDWORD filesize, UDWORD numTemplates);
|
||||
static BOOL loadSaveTemplateV14(UBYTE *pFileData, UDWORD filesize, UDWORD numTemplates);
|
||||
static BOOL loadSaveTemplateV(UBYTE *pFileData, UDWORD filesize, UDWORD numTemplates);
|
||||
static BOOL writeTemplateFile(STRING *pFileName);
|
||||
static BOOL loadSaveTemplate(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveTemplateV7(char *pFileData, UDWORD filesize, UDWORD numTemplates);
|
||||
static BOOL loadSaveTemplateV14(char *pFileData, UDWORD filesize, UDWORD numTemplates);
|
||||
static BOOL loadSaveTemplateV(char *pFileData, UDWORD filesize, UDWORD numTemplates);
|
||||
static BOOL writeTemplateFile(char *pFileName);
|
||||
|
||||
static BOOL loadSaveFeature(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveFeatureV14(UBYTE *pFileData, UDWORD filesize, UDWORD numFeatures, UDWORD version);
|
||||
static BOOL loadSaveFeatureV(UBYTE *pFileData, UDWORD filesize, UDWORD numFeatures, UDWORD version);
|
||||
static BOOL writeFeatureFile(STRING *pFileName);
|
||||
static BOOL loadSaveFeature(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveFeatureV14(char *pFileData, UDWORD filesize, UDWORD numFeatures, UDWORD version);
|
||||
static BOOL loadSaveFeatureV(char *pFileData, UDWORD filesize, UDWORD numFeatures, UDWORD version);
|
||||
static BOOL writeFeatureFile(char *pFileName);
|
||||
|
||||
BOOL loadTerrainTypeMap(UBYTE *pFileData, UDWORD filesize); // now used in gamepsx.c aswell
|
||||
static BOOL writeTerrainTypeMapFile(STRING *pFileName);
|
||||
BOOL loadTerrainTypeMap(char *pFileData, UDWORD filesize); // now used in gamepsx.c aswell
|
||||
static BOOL writeTerrainTypeMapFile(char *pFileName);
|
||||
|
||||
static BOOL loadSaveCompList(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveCompListV9(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords, UDWORD version);
|
||||
static BOOL loadSaveCompListV(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords, UDWORD version);
|
||||
static BOOL writeCompListFile(STRING *pFileName);
|
||||
static BOOL loadSaveCompList(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveCompListV9(char *pFileData, UDWORD filesize, UDWORD numRecords, UDWORD version);
|
||||
static BOOL loadSaveCompListV(char *pFileData, UDWORD filesize, UDWORD numRecords, UDWORD version);
|
||||
static BOOL writeCompListFile(char *pFileName);
|
||||
|
||||
static BOOL loadSaveStructTypeList(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveStructTypeListV7(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords);
|
||||
static BOOL loadSaveStructTypeListV(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords);
|
||||
static BOOL writeStructTypeListFile(STRING *pFileName);
|
||||
static BOOL loadSaveStructTypeList(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveStructTypeListV7(char *pFileData, UDWORD filesize, UDWORD numRecords);
|
||||
static BOOL loadSaveStructTypeListV(char *pFileData, UDWORD filesize, UDWORD numRecords);
|
||||
static BOOL writeStructTypeListFile(char *pFileName);
|
||||
|
||||
static BOOL loadSaveResearch(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveResearchV8(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords);
|
||||
static BOOL loadSaveResearchV(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords);
|
||||
static BOOL writeResearchFile(STRING *pFileName);
|
||||
static BOOL loadSaveResearch(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveResearchV8(char *pFileData, UDWORD filesize, UDWORD numRecords);
|
||||
static BOOL loadSaveResearchV(char *pFileData, UDWORD filesize, UDWORD numRecords);
|
||||
static BOOL writeResearchFile(char *pFileName);
|
||||
|
||||
static BOOL loadSaveMessage(UBYTE *pFileData, UDWORD filesize, SWORD levelType);
|
||||
static BOOL loadSaveMessageV(UBYTE *pFileData, UDWORD filesize, UDWORD numMessages, UDWORD version, SWORD levelType);
|
||||
static BOOL writeMessageFile(STRING *pFileName);
|
||||
static BOOL loadSaveMessage(char *pFileData, UDWORD filesize, SWORD levelType);
|
||||
static BOOL loadSaveMessageV(char *pFileData, UDWORD filesize, UDWORD numMessages, UDWORD version, SWORD levelType);
|
||||
static BOOL writeMessageFile(char *pFileName);
|
||||
|
||||
#ifdef SAVE_PROXIMITY
|
||||
static BOOL loadSaveProximity(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveProximityV(UBYTE *pFileData, UDWORD filesize, UDWORD numMessages, UDWORD version);
|
||||
static BOOL writeProximityFile(STRING *pFileName);
|
||||
static BOOL loadSaveProximity(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveProximityV(char *pFileData, UDWORD filesize, UDWORD numMessages, UDWORD version);
|
||||
static BOOL writeProximityFile(char *pFileName);
|
||||
#endif
|
||||
|
||||
static BOOL loadSaveFlag(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveFlagV(UBYTE *pFileData, UDWORD filesize, UDWORD numFlags, UDWORD version);
|
||||
static BOOL loadSaveFlag(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveFlagV(char *pFileData, UDWORD filesize, UDWORD numFlags, UDWORD version);
|
||||
static BOOL writeFlagFile(STRING *pFileName);
|
||||
|
||||
static BOOL loadSaveProduction(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveProductionV(UBYTE *pFileData, UDWORD filesize, UDWORD version);
|
||||
static BOOL loadSaveProduction(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveProductionV(char *pFileData, UDWORD filesize, UDWORD version);
|
||||
static BOOL writeProductionFile(STRING *pFileName);
|
||||
|
||||
static BOOL loadSaveStructLimits(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveStructLimitsV19(UBYTE *pFileData, UDWORD filesize, UDWORD numLimits);
|
||||
static BOOL loadSaveStructLimitsV(UBYTE *pFileData, UDWORD filesize, UDWORD numLimits);
|
||||
static BOOL loadSaveStructLimits(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveStructLimitsV19(char *pFileData, UDWORD filesize, UDWORD numLimits);
|
||||
static BOOL loadSaveStructLimitsV(char *pFileData, UDWORD filesize, UDWORD numLimits);
|
||||
static BOOL writeStructLimitsFile(STRING *pFileName);
|
||||
|
||||
static BOOL loadSaveCommandLists(UBYTE *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveCommandListsV(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids);
|
||||
static BOOL loadSaveCommandLists(char *pFileData, UDWORD filesize);
|
||||
static BOOL loadSaveCommandListsV(char *pFileData, UDWORD filesize, UDWORD numDroids);
|
||||
static BOOL writeCommandLists(STRING *pFileName);
|
||||
|
||||
static BOOL writeScriptState(STRING *pFileName);
|
||||
|
@ -1294,7 +1294,7 @@ so can be called in levLoadData when starting a game from a load save game*/
|
|||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadGameInit(STRING *pGameToLoad )
|
||||
{
|
||||
UBYTE *pFileData = NULL;
|
||||
char *pFileData = NULL;
|
||||
UDWORD fileSize;
|
||||
|
||||
/* Load in the chosen file data */
|
||||
|
@ -1342,7 +1342,7 @@ BOOL loadMissionExtras(STRING *pGameToLoad, SWORD levelType)
|
|||
|
||||
UDWORD fileExten, fileSize;
|
||||
|
||||
UBYTE *pFileData = NULL;
|
||||
char *pFileData = NULL;
|
||||
|
||||
strcpy(aFileName, pGameToLoad);
|
||||
fileExten = strlen(pGameToLoad) - 3;
|
||||
|
@ -1420,7 +1420,7 @@ BOOL loadGame(STRING *pGameToLoad, BOOL keepObjects, BOOL freeMem, BOOL UserSave
|
|||
STRING aFileName[256];
|
||||
//OPENFILENAME sOFN;
|
||||
UDWORD fileExten, fileSize, pl;
|
||||
UBYTE *pFileData = NULL;
|
||||
char *pFileData = NULL;
|
||||
UDWORD player, inc, i, j;
|
||||
DROID *psCurr;
|
||||
UWORD missionScrollMinX = 0, missionScrollMinY = 0,
|
||||
|
@ -3174,7 +3174,7 @@ BOOL writeMapFile(STRING *pFileName)
|
|||
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL gameLoad(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL gameLoad(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
GAME_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -3234,7 +3234,7 @@ BOOL gameLoad(UBYTE *pFileData, UDWORD filesize)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// Get campaign number stuff is not needed in this form on the PSX (thank you very much)
|
||||
BOOL getCampaignV(UBYTE *pFileData, UDWORD filesize, UDWORD version)
|
||||
BOOL getCampaignV(char *pFileData, UDWORD filesize, UDWORD version)
|
||||
{
|
||||
SAVE_GAME *psSaveGame;
|
||||
UDWORD sizeOfSaveGame = 0;
|
||||
|
@ -3308,7 +3308,7 @@ BOOL getCampaignV(UBYTE *pFileData, UDWORD filesize, UDWORD version)
|
|||
/* GAME_SAVE_V33 includes GAME_SAVE_V31 */
|
||||
if(version >= VERSION_33) {
|
||||
endian_udword(&psSaveGame->sGame.power);
|
||||
endian_udword(&psSaveGame->sGame.bytesPerSec);
|
||||
endian_uword(&psSaveGame->sGame.bytesPerSec);
|
||||
for(i = 0; i < MaxGames; i++) {
|
||||
endian_sdword(&psSaveGame->sNetPlay.games[i].desc.dwSize);
|
||||
endian_sdword(&psSaveGame->sNetPlay.games[i].desc.dwFlags);
|
||||
|
@ -3451,7 +3451,7 @@ BOOL getCampaignV(UBYTE *pFileData, UDWORD filesize, UDWORD version)
|
|||
/// it now does even less than it looks like on the psx ... cause its pc only
|
||||
UDWORD getCampaign(STRING *pGameToLoad, BOOL *bSkipCDCheck)
|
||||
{
|
||||
UBYTE *pFileData = NULL;
|
||||
char *pFileData = NULL;
|
||||
UDWORD fileSize;
|
||||
GAME_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -3532,7 +3532,7 @@ void game_SetValidityKey(UDWORD keys)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code specific to version 7 of a save game */
|
||||
BOOL gameLoadV7(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL gameLoadV7(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
SAVE_GAME_V7 *psSaveGame;
|
||||
LEVEL_DATASET *psNewLevel;
|
||||
|
@ -3602,7 +3602,7 @@ BOOL gameLoadV7(UBYTE *pFileData, UDWORD filesize)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* non specific version of a save game */
|
||||
BOOL gameLoadV(UBYTE *pFileData, UDWORD filesize, UDWORD version)
|
||||
BOOL gameLoadV(char *pFileData, UDWORD filesize, UDWORD version)
|
||||
{
|
||||
SAVE_GAME *psSaveGame;
|
||||
// LEVEL_DATASET *psNewLevel;
|
||||
|
@ -3699,7 +3699,7 @@ BOOL gameLoadV(UBYTE *pFileData, UDWORD filesize, UDWORD version)
|
|||
/* GAME_SAVE_V33 includes GAME_SAVE_V31 */
|
||||
if(version >= VERSION_33) {
|
||||
endian_udword(&psSaveGame->sGame.power);
|
||||
endian_udword(&psSaveGame->sGame.bytesPerSec);
|
||||
endian_uword(&psSaveGame->sGame.bytesPerSec);
|
||||
for(i = 0; i < MaxGames; i++) {
|
||||
endian_sdword(&psSaveGame->sNetPlay.games[i].desc.dwSize);
|
||||
endian_sdword(&psSaveGame->sNetPlay.games[i].desc.dwFlags);
|
||||
|
@ -4163,7 +4163,7 @@ BOOL writeGameFile(STRING *pFileName, SDWORD saveType)
|
|||
|
||||
/* Allocate the data buffer */
|
||||
fileSize = GAME_HEADER_SIZE + sizeof(SAVE_GAME);
|
||||
pFileData = (UBYTE *) MALLOC(fileSize);
|
||||
pFileData = MALLOC(fileSize);
|
||||
if (pFileData == NULL)
|
||||
{
|
||||
DBERROR(("Out of memory"));
|
||||
|
@ -4338,7 +4338,7 @@ BOOL writeGameFile(STRING *pFileName, SDWORD saveType)
|
|||
/* SAVE_GAME is GAME_SAVE_V33 */
|
||||
/* GAME_SAVE_V33 includes GAME_SAVE_V31 */
|
||||
endian_udword(&psSaveGame->sGame.power);
|
||||
endian_udword(&psSaveGame->sGame.bytesPerSec);
|
||||
endian_uword(&psSaveGame->sGame.bytesPerSec);
|
||||
for(i = 0; i < MaxGames; i++) {
|
||||
endian_sdword(&psSaveGame->sNetPlay.games[i].desc.dwSize);
|
||||
endian_sdword(&psSaveGame->sNetPlay.games[i].desc.dwFlags);
|
||||
|
@ -4456,7 +4456,7 @@ error:
|
|||
// Process the droid initialisation file (dinit.bjo). Creates droids for
|
||||
// the scenario being loaded. This is *NEVER* called for a user save game
|
||||
//
|
||||
BOOL loadSaveDroidInit(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveDroidInit(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
DROIDINIT_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -4501,7 +4501,7 @@ BOOL loadSaveDroidInit(UBYTE *pFileData, UDWORD filesize)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// Used for all droids
|
||||
BOOL loadSaveDroidInitV2(UBYTE *pFileData, UDWORD filesize,UDWORD quantity)
|
||||
BOOL loadSaveDroidInitV2(char *pFileData, UDWORD filesize,UDWORD quantity)
|
||||
{
|
||||
SAVE_DROIDINIT *pDroidInit;
|
||||
DROID_TEMPLATE *psTemplate;
|
||||
|
@ -4640,7 +4640,7 @@ UDWORD RemapPlayerNumber(UDWORD OldNumber)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/*This is *ALWAYS* called by a User Save Game */
|
||||
BOOL loadSaveDroid(UBYTE *pFileData, UDWORD filesize, DROID **ppsCurrentDroidLists)
|
||||
BOOL loadSaveDroid(char *pFileData, UDWORD filesize, DROID **ppsCurrentDroidLists)
|
||||
{
|
||||
DROID_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -5441,7 +5441,7 @@ BOOL loadDroidSetPointers(void)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code specific to version 11 of a save droid */
|
||||
BOOL loadSaveDroidV11(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists)
|
||||
BOOL loadSaveDroidV11(char *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists)
|
||||
{
|
||||
SAVE_DROID_V11 *psSaveDroid, sSaveDroid;
|
||||
// DROID_TEMPLATE *psTemplate, sTemplate;
|
||||
|
@ -5560,7 +5560,7 @@ BOOL loadSaveDroidV11(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids, UDWOR
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code specific all versions upto from 12 to 19*/
|
||||
BOOL loadSaveDroidV19(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists)
|
||||
BOOL loadSaveDroidV19(char *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists)
|
||||
{
|
||||
SAVE_DROID_V18 *psSaveDroid, sSaveDroid;
|
||||
// DROID_TEMPLATE *psTemplate, sTemplate;
|
||||
|
@ -5711,7 +5711,7 @@ BOOL loadSaveDroidV19(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids, UDWOR
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code for all versions after save name change v19*/
|
||||
BOOL loadSaveDroidV(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists)
|
||||
BOOL loadSaveDroidV(char *pFileData, UDWORD filesize, UDWORD numDroids, UDWORD version, DROID **ppsCurrentDroidLists)
|
||||
{
|
||||
SAVE_DROID *psSaveDroid, sSaveDroid;
|
||||
// DROID_TEMPLATE *psTemplate, sTemplate;
|
||||
|
@ -6285,7 +6285,7 @@ BOOL writeDroidFile(STRING *pFileName, DROID **ppsCurrentDroidLists)
|
|||
|
||||
/* Allocate the data buffer */
|
||||
fileSize = DROID_HEADER_SIZE + totalDroids*sizeof(SAVE_DROID);
|
||||
pFileData = (UBYTE *) MALLOC(fileSize);
|
||||
pFileData = MALLOC(fileSize);
|
||||
if (pFileData == NULL)
|
||||
{
|
||||
DBERROR(("Out of memory"));
|
||||
|
@ -6321,7 +6321,7 @@ BOOL writeDroidFile(STRING *pFileName, DROID **ppsCurrentDroidLists)
|
|||
|
||||
buildSaveDroidFromDroid(psSaveDroid, psCurr, DROID_NORMAL);
|
||||
|
||||
psSaveDroid = (SAVE_DROID *)((UBYTE *)psSaveDroid + sizeof(SAVE_DROID));
|
||||
psSaveDroid = (SAVE_DROID *)((char *)psSaveDroid + sizeof(SAVE_DROID));
|
||||
// if transporter save any droids in the grp
|
||||
if (psCurr->droidType == DROID_TRANSPORTER)
|
||||
{
|
||||
|
@ -6331,7 +6331,7 @@ BOOL writeDroidFile(STRING *pFileName, DROID **ppsCurrentDroidLists)
|
|||
if (psTrans->droidType != DROID_TRANSPORTER)
|
||||
{
|
||||
buildSaveDroidFromDroid(psSaveDroid, psTrans, DROID_ON_TRANSPORT);
|
||||
psSaveDroid = (SAVE_DROID *)((UBYTE *)psSaveDroid + sizeof(SAVE_DROID));
|
||||
psSaveDroid = (SAVE_DROID *)((char *)psSaveDroid + sizeof(SAVE_DROID));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6351,7 +6351,7 @@ BOOL writeDroidFile(STRING *pFileName, DROID **ppsCurrentDroidLists)
|
|||
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveStructure(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveStructure(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
STRUCT_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -6410,7 +6410,7 @@ BOOL loadSaveStructure(UBYTE *pFileData, UDWORD filesize)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code specific to version 7 of a save structure */
|
||||
BOOL loadSaveStructureV7(UBYTE *pFileData, UDWORD filesize, UDWORD numStructures)
|
||||
BOOL loadSaveStructureV7(char *pFileData, UDWORD filesize, UDWORD numStructures)
|
||||
{
|
||||
SAVE_STRUCTURE_V2 *psSaveStructure, sSaveStructure;
|
||||
STRUCTURE *psStructure;
|
||||
|
@ -6661,7 +6661,7 @@ UDWORD getResearchIdFromName(STRING *pName)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code for version upto 19of a save structure */
|
||||
BOOL loadSaveStructureV19(UBYTE *pFileData, UDWORD filesize, UDWORD numStructures, UDWORD version)
|
||||
BOOL loadSaveStructureV19(char *pFileData, UDWORD filesize, UDWORD numStructures, UDWORD version)
|
||||
{
|
||||
SAVE_STRUCTURE_V17 *psSaveStructure, sSaveStructure;
|
||||
STRUCTURE *psStructure;
|
||||
|
@ -7115,7 +7115,7 @@ BOOL loadSaveStructureV19(UBYTE *pFileData, UDWORD filesize, UDWORD numStructure
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code for versions after version 20 of a save structure */
|
||||
BOOL loadSaveStructureV(UBYTE *pFileData, UDWORD filesize, UDWORD numStructures, UDWORD version)
|
||||
BOOL loadSaveStructureV(char *pFileData, UDWORD filesize, UDWORD numStructures, UDWORD version)
|
||||
{
|
||||
SAVE_STRUCTURE *psSaveStructure, sSaveStructure;
|
||||
STRUCTURE *psStructure;
|
||||
|
@ -7581,7 +7581,7 @@ BOOL writeStructFile(STRING *pFileName)
|
|||
|
||||
/* Allocate the data buffer */
|
||||
fileSize = STRUCT_HEADER_SIZE + totalStructs*sizeof(SAVE_STRUCTURE);
|
||||
pFileData = (UBYTE *) MALLOC(fileSize);
|
||||
pFileData = MALLOC(fileSize);
|
||||
if (pFileData == NULL)
|
||||
{
|
||||
DBERROR(("Out of memory"));
|
||||
|
@ -7818,7 +7818,7 @@ BOOL writeStructFile(STRING *pFileName)
|
|||
endian_udword(&psSaveStruct->burnStart);
|
||||
endian_udword(&psSaveStruct->burnDamage);
|
||||
|
||||
psSaveStruct = (SAVE_STRUCTURE *)((UBYTE *)psSaveStruct + sizeof(SAVE_STRUCTURE));
|
||||
psSaveStruct = (SAVE_STRUCTURE *)((char *)psSaveStruct + sizeof(SAVE_STRUCTURE));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7939,7 +7939,7 @@ BOOL loadStructSetPointers(void)
|
|||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveFeature(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveFeature(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
FEATURE_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -7991,7 +7991,7 @@ BOOL loadSaveFeature(UBYTE *pFileData, UDWORD filesize)
|
|||
// -----------------------------------------------------------------------------------------
|
||||
#ifdef ALLOWOLDSAVEGAMES
|
||||
/* code specific to version 2 of a save feature */
|
||||
BOOL loadSaveFeatureV2(UBYTE *pFileData, UDWORD filesize, UDWORD numFeatures)
|
||||
BOOL loadSaveFeatureV2(char *pFileData, UDWORD filesize, UDWORD numFeatures)
|
||||
{
|
||||
SAVE_FEATURE_V2 *psSaveFeature;
|
||||
FEATURE *pFeature;
|
||||
|
@ -8100,7 +8100,7 @@ BOOL loadSaveFeatureV2(UBYTE *pFileData, UDWORD filesize, UDWORD numFeatures)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code for all version 8 - 14 save features */
|
||||
BOOL loadSaveFeatureV14(UBYTE *pFileData, UDWORD filesize, UDWORD numFeatures, UDWORD version)
|
||||
BOOL loadSaveFeatureV14(char *pFileData, UDWORD filesize, UDWORD numFeatures, UDWORD version)
|
||||
{
|
||||
SAVE_FEATURE_V14 *psSaveFeature;
|
||||
FEATURE *pFeature;
|
||||
|
@ -8215,7 +8215,7 @@ BOOL loadSaveFeatureV14(UBYTE *pFileData, UDWORD filesize, UDWORD numFeatures, U
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code for all post version 7 save features */
|
||||
BOOL loadSaveFeatureV(UBYTE *pFileData, UDWORD filesize, UDWORD numFeatures, UDWORD version)
|
||||
BOOL loadSaveFeatureV(char *pFileData, UDWORD filesize, UDWORD numFeatures, UDWORD version)
|
||||
{
|
||||
SAVE_FEATURE *psSaveFeature;
|
||||
FEATURE *pFeature;
|
||||
|
@ -8338,7 +8338,7 @@ BOOL writeFeatureFile(STRING *pFileName)
|
|||
|
||||
/* Allocate the data buffer */
|
||||
fileSize = FEATURE_HEADER_SIZE + totalFeatures * sizeof(SAVE_FEATURE);
|
||||
pFileData = (UBYTE *) MALLOC(fileSize);
|
||||
pFileData = MALLOC(fileSize);
|
||||
if (pFileData == NULL)
|
||||
{
|
||||
DBERROR(("Out of memory"));
|
||||
|
@ -8394,7 +8394,7 @@ BOOL writeFeatureFile(STRING *pFileName)
|
|||
endian_udword(&psSaveFeature->burnStart);
|
||||
endian_udword(&psSaveFeature->burnDamage);
|
||||
|
||||
psSaveFeature = (SAVE_FEATURE *)((UBYTE *)psSaveFeature + sizeof(SAVE_FEATURE));
|
||||
psSaveFeature = (SAVE_FEATURE *)((char *)psSaveFeature + sizeof(SAVE_FEATURE));
|
||||
}
|
||||
|
||||
/* FEATURE_SAVEHEADER */
|
||||
|
@ -8412,7 +8412,7 @@ BOOL writeFeatureFile(STRING *pFileName)
|
|||
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveTemplate(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveTemplate(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
TEMPLATE_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -8469,7 +8469,7 @@ BOOL loadSaveTemplate(UBYTE *pFileData, UDWORD filesize)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* code specific to version 7 of a save template */
|
||||
BOOL loadSaveTemplateV7(UBYTE *pFileData, UDWORD filesize, UDWORD numTemplates)
|
||||
BOOL loadSaveTemplateV7(char *pFileData, UDWORD filesize, UDWORD numTemplates)
|
||||
{
|
||||
SAVE_TEMPLATE_V2 *psSaveTemplate, sSaveTemplate;
|
||||
DROID_TEMPLATE *psTemplate;
|
||||
|
@ -8597,7 +8597,7 @@ error:
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* none specific version of a save template */
|
||||
BOOL loadSaveTemplateV14(UBYTE *pFileData, UDWORD filesize, UDWORD numTemplates)
|
||||
BOOL loadSaveTemplateV14(char *pFileData, UDWORD filesize, UDWORD numTemplates)
|
||||
{
|
||||
SAVE_TEMPLATE_V14 *psSaveTemplate, sSaveTemplate;
|
||||
DROID_TEMPLATE *psTemplate, *psDestTemplate;
|
||||
|
@ -8757,7 +8757,7 @@ error:
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
/* none specific version of a save template */
|
||||
BOOL loadSaveTemplateV(UBYTE *pFileData, UDWORD filesize, UDWORD numTemplates)
|
||||
BOOL loadSaveTemplateV(char *pFileData, UDWORD filesize, UDWORD numTemplates)
|
||||
{
|
||||
SAVE_TEMPLATE *psSaveTemplate, sSaveTemplate;
|
||||
DROID_TEMPLATE *psTemplate, *psDestTemplate;
|
||||
|
@ -8958,7 +8958,7 @@ BOOL writeTemplateFile(STRING *pFileName)
|
|||
|
||||
/* Allocate the data buffer */
|
||||
fileSize = TEMPLATE_HEADER_SIZE + totalTemplates*sizeof(SAVE_TEMPLATE);
|
||||
pFileData = (UBYTE *) MALLOC(fileSize);
|
||||
pFileData = MALLOC(fileSize);
|
||||
if (pFileData == NULL)
|
||||
{
|
||||
DBERROR(("Out of memory"));
|
||||
|
@ -9030,7 +9030,7 @@ BOOL writeTemplateFile(STRING *pFileName)
|
|||
endian_udword(&psSaveTemplate->numWeaps);
|
||||
endian_udword(&psSaveTemplate->multiPlayerID);
|
||||
|
||||
psSaveTemplate = (SAVE_TEMPLATE *)((UBYTE *)psSaveTemplate + sizeof(SAVE_TEMPLATE));
|
||||
psSaveTemplate = (SAVE_TEMPLATE *)((char *)psSaveTemplate + sizeof(SAVE_TEMPLATE));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9056,7 +9056,7 @@ BOOL writeTemplateFile(STRING *pFileName)
|
|||
// -----------------------------------------------------------------------------------------
|
||||
|
||||
// load up a terrain tile type map file
|
||||
BOOL loadTerrainTypeMap(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadTerrainTypeMap(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
TILETYPE_SAVEHEADER *psHeader;
|
||||
UDWORD i;
|
||||
|
@ -9121,7 +9121,7 @@ BOOL loadTerrainTypeMap(UBYTE *pFileData, UDWORD filesize)
|
|||
static BOOL writeTerrainTypeMapFile(STRING *pFileName)
|
||||
{
|
||||
TILETYPE_SAVEHEADER *psHeader;
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
UDWORD fileSize, i;
|
||||
UWORD *pType;
|
||||
|
||||
|
@ -9166,7 +9166,7 @@ static BOOL writeTerrainTypeMapFile(STRING *pFileName)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// load up component list file
|
||||
BOOL loadSaveCompList(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveCompList(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
COMPLIST_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -9216,7 +9216,7 @@ BOOL loadSaveCompList(UBYTE *pFileData, UDWORD filesize)
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveCompListV9(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords, UDWORD version)
|
||||
BOOL loadSaveCompListV9(char *pFileData, UDWORD filesize, UDWORD numRecords, UDWORD version)
|
||||
{
|
||||
SAVE_COMPLIST_V6 *psSaveCompList;
|
||||
UDWORD i;
|
||||
|
@ -9282,7 +9282,7 @@ BOOL loadSaveCompListV9(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords, UD
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveCompListV(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords, UDWORD version)
|
||||
BOOL loadSaveCompListV(char *pFileData, UDWORD filesize, UDWORD numRecords, UDWORD version)
|
||||
{
|
||||
SAVE_COMPLIST *psSaveCompList;
|
||||
UDWORD i;
|
||||
|
@ -9339,7 +9339,7 @@ BOOL loadSaveCompListV(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords, UDW
|
|||
static BOOL writeCompListFile(STRING *pFileName)
|
||||
{
|
||||
COMPLIST_SAVEHEADER *psHeader;
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
SAVE_COMPLIST *psSaveCompList;
|
||||
UDWORD fileSize, totalComp, player, i;
|
||||
COMP_BASE_STATS *psStats;
|
||||
|
@ -9380,7 +9380,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
psSaveCompList->type = COMP_BODY;
|
||||
psSaveCompList->player = (UBYTE)player;
|
||||
psSaveCompList->state = apCompLists[player][COMP_BODY][i];
|
||||
psSaveCompList = (SAVE_COMPLIST *)((UBYTE *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
psSaveCompList = (SAVE_COMPLIST *)((char *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
}
|
||||
for(i = 0; i < numWeaponStats; i++)
|
||||
{
|
||||
|
@ -9391,7 +9391,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
psSaveCompList->type = COMP_WEAPON;
|
||||
psSaveCompList->player = (UBYTE)player;
|
||||
psSaveCompList->state = apCompLists[player][COMP_WEAPON][i];
|
||||
psSaveCompList = (SAVE_COMPLIST *)((UBYTE *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
psSaveCompList = (SAVE_COMPLIST *)((char *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
}
|
||||
for(i = 0; i < numConstructStats; i++)
|
||||
{
|
||||
|
@ -9402,7 +9402,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
psSaveCompList->type = COMP_CONSTRUCT;
|
||||
psSaveCompList->player = (UBYTE)player;
|
||||
psSaveCompList->state = apCompLists[player][COMP_CONSTRUCT][i];
|
||||
psSaveCompList = (SAVE_COMPLIST *)((UBYTE *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
psSaveCompList = (SAVE_COMPLIST *)((char *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
}
|
||||
for(i = 0; i < numECMStats; i++)
|
||||
{
|
||||
|
@ -9413,7 +9413,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
psSaveCompList->type = COMP_ECM;
|
||||
psSaveCompList->player = (UBYTE)player;
|
||||
psSaveCompList->state = apCompLists[player][COMP_ECM][i];
|
||||
psSaveCompList = (SAVE_COMPLIST *)((UBYTE *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
psSaveCompList = (SAVE_COMPLIST *)((char *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
}
|
||||
for(i = 0; i < numPropulsionStats; i++)
|
||||
{
|
||||
|
@ -9424,7 +9424,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
psSaveCompList->type = COMP_PROPULSION;
|
||||
psSaveCompList->player = (UBYTE)player;
|
||||
psSaveCompList->state = apCompLists[player][COMP_PROPULSION][i];
|
||||
psSaveCompList = (SAVE_COMPLIST *)((UBYTE *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
psSaveCompList = (SAVE_COMPLIST *)((char *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
}
|
||||
for(i = 0; i < numSensorStats; i++)
|
||||
{
|
||||
|
@ -9435,7 +9435,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
psSaveCompList->type = COMP_SENSOR;
|
||||
psSaveCompList->player = (UBYTE)player;
|
||||
psSaveCompList->state = apCompLists[player][COMP_SENSOR][i];
|
||||
psSaveCompList = (SAVE_COMPLIST *)((UBYTE *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
psSaveCompList = (SAVE_COMPLIST *)((char *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
}
|
||||
for(i = 0; i < numRepairStats; i++)
|
||||
{
|
||||
|
@ -9446,7 +9446,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
psSaveCompList->type = COMP_REPAIRUNIT;
|
||||
psSaveCompList->player = (UBYTE)player;
|
||||
psSaveCompList->state = apCompLists[player][COMP_REPAIRUNIT][i];
|
||||
psSaveCompList = (SAVE_COMPLIST *)((UBYTE *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
psSaveCompList = (SAVE_COMPLIST *)((char *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
}
|
||||
for(i = 0; i < numBrainStats; i++)
|
||||
{
|
||||
|
@ -9457,7 +9457,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
psSaveCompList->type = COMP_BRAIN;
|
||||
psSaveCompList->player = (UBYTE)player;
|
||||
psSaveCompList->state = apCompLists[player][COMP_BRAIN][i];
|
||||
psSaveCompList = (SAVE_COMPLIST *)((UBYTE *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
psSaveCompList = (SAVE_COMPLIST *)((char *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
}
|
||||
/*for(i = 0; i < numProgramStats; i++)
|
||||
{
|
||||
|
@ -9470,7 +9470,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
psSaveCompList->type = COMP_PROGRAM;
|
||||
psSaveCompList->player = (UBYTE)player;
|
||||
psSaveCompList->state = apCompLists[player][COMP_PROGRAM][i];
|
||||
psSaveCompList = (SAVE_COMPLIST *)((UBYTE *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
psSaveCompList = (SAVE_COMPLIST *)((char *)psSaveCompList + sizeof(SAVE_COMPLIST));
|
||||
}*/
|
||||
}
|
||||
|
||||
|
@ -9489,7 +9489,7 @@ static BOOL writeCompListFile(STRING *pFileName)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// load up structure type list file
|
||||
BOOL loadSaveStructTypeList(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveStructTypeList(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
STRUCTLIST_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -9539,7 +9539,7 @@ BOOL loadSaveStructTypeList(UBYTE *pFileData, UDWORD filesize)
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveStructTypeListV7(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords)
|
||||
BOOL loadSaveStructTypeListV7(char *pFileData, UDWORD filesize, UDWORD numRecords)
|
||||
{
|
||||
SAVE_STRUCTLIST_V6 *psSaveStructList;
|
||||
UDWORD i, statInc;
|
||||
|
@ -9597,7 +9597,7 @@ BOOL loadSaveStructTypeListV7(UBYTE *pFileData, UDWORD filesize, UDWORD numRecor
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveStructTypeListV(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords)
|
||||
BOOL loadSaveStructTypeListV(char *pFileData, UDWORD filesize, UDWORD numRecords)
|
||||
{
|
||||
SAVE_STRUCTLIST *psSaveStructList;
|
||||
UDWORD i, statInc;
|
||||
|
@ -9660,7 +9660,7 @@ static BOOL writeStructTypeListFile(STRING *pFileName)
|
|||
{
|
||||
STRUCTLIST_SAVEHEADER *psHeader;
|
||||
SAVE_STRUCTLIST *psSaveStructList;
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
UDWORD fileSize, player, i;
|
||||
STRUCTURE_STATS *psStats;
|
||||
|
||||
|
@ -9696,7 +9696,7 @@ static BOOL writeStructTypeListFile(STRING *pFileName)
|
|||
strcpy(psSaveStructList->name, psStats->pName);
|
||||
psSaveStructList->state = apStructTypeLists[player][i];
|
||||
psSaveStructList->player = (UBYTE)player;
|
||||
psSaveStructList = (SAVE_STRUCTLIST *)((UBYTE *)psSaveStructList +
|
||||
psSaveStructList = (SAVE_STRUCTLIST *)((char *)psSaveStructList +
|
||||
sizeof(SAVE_STRUCTLIST));
|
||||
}
|
||||
}
|
||||
|
@ -9717,7 +9717,7 @@ static BOOL writeStructTypeListFile(STRING *pFileName)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// load up saved research file
|
||||
BOOL loadSaveResearch(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveResearch(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
RESEARCH_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -9767,7 +9767,7 @@ BOOL loadSaveResearch(UBYTE *pFileData, UDWORD filesize)
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveResearchV8(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords)
|
||||
BOOL loadSaveResearchV8(char *pFileData, UDWORD filesize, UDWORD numRecords)
|
||||
{
|
||||
SAVE_RESEARCH_V8 *psSaveResearch;
|
||||
UDWORD i, statInc;
|
||||
|
@ -9850,7 +9850,7 @@ BOOL loadSaveResearchV8(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords)
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveResearchV(UBYTE *pFileData, UDWORD filesize, UDWORD numRecords)
|
||||
BOOL loadSaveResearchV(char *pFileData, UDWORD filesize, UDWORD numRecords)
|
||||
{
|
||||
SAVE_RESEARCH *psSaveResearch;
|
||||
UDWORD i, statInc;
|
||||
|
@ -9931,7 +9931,7 @@ static BOOL writeResearchFile(STRING *pFileName)
|
|||
{
|
||||
RESEARCH_SAVEHEADER *psHeader;
|
||||
SAVE_RESEARCH *psSaveResearch;
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
UDWORD fileSize, player, i;
|
||||
RESEARCH *psStats;
|
||||
|
||||
|
@ -9977,7 +9977,7 @@ static BOOL writeResearchFile(STRING *pFileName)
|
|||
for(player = 0; player < MAX_PLAYERS; player++)
|
||||
endian_udword(&psSaveResearch->currentPoints[player]);
|
||||
|
||||
psSaveResearch = (SAVE_RESEARCH *)((UBYTE *)psSaveResearch +
|
||||
psSaveResearch = (SAVE_RESEARCH *)((char *)psSaveResearch +
|
||||
sizeof(SAVE_RESEARCH));
|
||||
}
|
||||
|
||||
|
@ -9994,7 +9994,7 @@ static BOOL writeResearchFile(STRING *pFileName)
|
|||
// -----------------------------------------------------------------------------------------
|
||||
//#ifdef NEW_SAVE //V11 Save
|
||||
// load up saved message file
|
||||
BOOL loadSaveMessage(UBYTE *pFileData, UDWORD filesize, SWORD levelType)
|
||||
BOOL loadSaveMessage(char *pFileData, UDWORD filesize, SWORD levelType)
|
||||
{
|
||||
MESSAGE_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -10023,7 +10023,7 @@ BOOL loadSaveMessage(UBYTE *pFileData, UDWORD filesize, SWORD levelType)
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveMessageV(UBYTE *pFileData, UDWORD filesize, UDWORD numMessages, UDWORD version, SWORD levelType)
|
||||
BOOL loadSaveMessageV(char *pFileData, UDWORD filesize, UDWORD numMessages, UDWORD version, SWORD levelType)
|
||||
{
|
||||
SAVE_MESSAGE *psSaveMessage;
|
||||
MESSAGE *psMessage;
|
||||
|
@ -10062,7 +10062,7 @@ BOOL loadSaveMessageV(UBYTE *pFileData, UDWORD filesize, UDWORD numMessages, UDW
|
|||
psSaveMessage = (SAVE_MESSAGE *) pFileData;
|
||||
|
||||
/* SAVE_MESSAGE */
|
||||
endian_sdword(&psSaveMessage->type);
|
||||
endian_sdword(&psSaveMessage->type); /* FIXME: enum may not be this type! */
|
||||
endian_udword(&psSaveMessage->objId);
|
||||
endian_udword(&psSaveMessage->player);
|
||||
|
||||
|
@ -10139,7 +10139,7 @@ static BOOL writeMessageFile(STRING *pFileName)
|
|||
{
|
||||
MESSAGE_SAVEHEADER *psHeader;
|
||||
SAVE_MESSAGE *psSaveMessage;
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
UDWORD fileSize, player;
|
||||
MESSAGE *psMessage;
|
||||
PROXIMITY_DISPLAY *psProx;
|
||||
|
@ -10225,11 +10225,11 @@ static BOOL writeMessageFile(STRING *pFileName)
|
|||
psSaveMessage->read = psMessage->read; //flag to indicate whether message has been read
|
||||
psSaveMessage->player = psMessage->player; //which player this message belongs to
|
||||
|
||||
endian_sdword(&psSaveMessage->type);
|
||||
endian_sdword(&psSaveMessage->type); /* FIXME: enum may be different type! */
|
||||
endian_udword(&psSaveMessage->objId);
|
||||
endian_udword(&psSaveMessage->player);
|
||||
|
||||
psSaveMessage = (SAVE_MESSAGE *)((UBYTE *)psSaveMessage + sizeof(SAVE_MESSAGE));
|
||||
psSaveMessage = (SAVE_MESSAGE *)((char *)psSaveMessage + sizeof(SAVE_MESSAGE));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10250,7 +10250,7 @@ static BOOL writeMessageFile(STRING *pFileName)
|
|||
// -----------------------------------------------------------------------------------------
|
||||
#ifdef SAVE_PROXIMITY_STUFF//V14 Save this is not done because all messages are rebuilt
|
||||
// load up saved proximity file
|
||||
BOOL loadSaveProximity(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveProximity(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
PROXIMITY_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -10279,7 +10279,7 @@ BOOL loadSaveProximity(UBYTE *pFileData, UDWORD filesize)
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveProximityV(UBYTE *pFileData, UDWORD filesize, UDWORD numProximitys, UDWORD version)
|
||||
BOOL loadSaveProximityV(char *pFileData, UDWORD filesize, UDWORD numProximitys, UDWORD version)
|
||||
{
|
||||
SAVE_PROXIMITY *psSaveProximity;
|
||||
PROXIMITY_DISPLAY *psProximity;
|
||||
|
@ -10336,7 +10336,7 @@ static BOOL writeProximityFile(STRING *pFileName)
|
|||
{
|
||||
PROXIMITY_SAVEHEADER *psHeader;
|
||||
SAVE_PROXIMITY *psSaveProximity;
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
UDWORD fileSize, player;
|
||||
PROXIMITY_DISPLAY *psProximity;
|
||||
UDWORD numProximitys = 0;
|
||||
|
@ -10407,7 +10407,7 @@ static BOOL writeProximityFile(STRING *pFileName)
|
|||
endian_udword(&psSaveProximity->strobe);
|
||||
endian_udword(&psSaveProximity->buttonID);
|
||||
|
||||
psSaveProximity = (SAVE_PROXIMITY *)((UBYTE *)psSaveProximity + sizeof(SAVE_PROXIMITY));
|
||||
psSaveProximity = (SAVE_PROXIMITY *)((char *)psSaveProximity + sizeof(SAVE_PROXIMITY));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10428,7 +10428,7 @@ static BOOL writeProximityFile(STRING *pFileName)
|
|||
// -----------------------------------------------------------------------------------------
|
||||
//#ifdef NEW_SAVE //V11 Save
|
||||
// load up saved flag file
|
||||
BOOL loadSaveFlag(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveFlag(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
FLAG_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -10457,7 +10457,7 @@ BOOL loadSaveFlag(UBYTE *pFileData, UDWORD filesize)
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveFlagV(UBYTE *pFileData, UDWORD filesize, UDWORD numflags, UDWORD version)
|
||||
BOOL loadSaveFlagV(char *pFileData, UDWORD filesize, UDWORD numflags, UDWORD version)
|
||||
{
|
||||
SAVE_FLAG *psSaveflag;
|
||||
FLAG_POSITION *psflag;
|
||||
|
@ -10494,7 +10494,7 @@ BOOL loadSaveFlagV(UBYTE *pFileData, UDWORD filesize, UDWORD numflags, UDWORD ve
|
|||
psSaveflag = (SAVE_FLAG *) pFileData;
|
||||
|
||||
/* SAVE_FLAG */
|
||||
endian_sdword(&psSaveflag->type);
|
||||
endian_sdword(&psSaveflag->type); /* FIXME: enum may not be this type! */
|
||||
endian_udword(&psSaveflag->frameNumber);
|
||||
endian_udword(&psSaveflag->screenX);
|
||||
endian_udword(&psSaveflag->screenY);
|
||||
|
@ -10602,7 +10602,7 @@ static BOOL writeFlagFile(STRING *pFileName)
|
|||
SAVE_FLAG *psSaveflag;
|
||||
STRUCTURE *psStruct;
|
||||
FACTORY *psFactory;
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
UDWORD fileSize, player;
|
||||
FLAG_POSITION *psflag;
|
||||
UDWORD numflags = 0;
|
||||
|
@ -10693,7 +10693,7 @@ static BOOL writeFlagFile(STRING *pFileName)
|
|||
}
|
||||
|
||||
/* SAVE_FLAG */
|
||||
endian_sdword(&psSaveflag->type);
|
||||
endian_sdword(&psSaveflag->type); /* FIXME: enum may be different type! */
|
||||
endian_udword(&psSaveflag->frameNumber);
|
||||
endian_udword(&psSaveflag->screenX);
|
||||
endian_udword(&psSaveflag->screenY);
|
||||
|
@ -10704,7 +10704,7 @@ static BOOL writeFlagFile(STRING *pFileName)
|
|||
endian_sdword(&psSaveflag->coords.z);
|
||||
endian_udword(&psSaveflag->repairId);
|
||||
|
||||
psSaveflag = (SAVE_FLAG *)((UBYTE *)psSaveflag + sizeof(SAVE_FLAG));
|
||||
psSaveflag = (SAVE_FLAG *)((char *)psSaveflag + sizeof(SAVE_FLAG));
|
||||
}
|
||||
}
|
||||
//and add the delivery points not in the list
|
||||
|
@ -10744,7 +10744,7 @@ static BOOL writeFlagFile(STRING *pFileName)
|
|||
}
|
||||
|
||||
/* SAVE_FLAG */
|
||||
endian_sdword(&psSaveflag->type);
|
||||
endian_sdword(&psSaveflag->type); /* FIXME: enum may be different type! */
|
||||
endian_udword(&psSaveflag->frameNumber);
|
||||
endian_udword(&psSaveflag->screenX);
|
||||
endian_udword(&psSaveflag->screenY);
|
||||
|
@ -10755,7 +10755,7 @@ static BOOL writeFlagFile(STRING *pFileName)
|
|||
endian_sdword(&psSaveflag->coords.z);
|
||||
endian_udword(&psSaveflag->repairId);
|
||||
|
||||
psSaveflag = (SAVE_FLAG *)((UBYTE *)psSaveflag + sizeof(SAVE_FLAG));
|
||||
psSaveflag = (SAVE_FLAG *)((char *)psSaveflag + sizeof(SAVE_FLAG));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -10782,7 +10782,7 @@ static BOOL writeFlagFile(STRING *pFileName)
|
|||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
//#ifdef PRODUCTION
|
||||
BOOL loadSaveProduction(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveProduction(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
PRODUCTION_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -10810,7 +10810,7 @@ BOOL loadSaveProduction(UBYTE *pFileData, UDWORD filesize)
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveProductionV(UBYTE *pFileData, UDWORD filesize, UDWORD version)
|
||||
BOOL loadSaveProductionV(char *pFileData, UDWORD filesize, UDWORD version)
|
||||
{
|
||||
SAVE_PRODUCTION *psSaveProduction;
|
||||
PRODUCTION_RUN *psCurrentProd;
|
||||
|
@ -10863,7 +10863,7 @@ static BOOL writeProductionFile(STRING *pFileName)
|
|||
{
|
||||
PRODUCTION_SAVEHEADER *psHeader;
|
||||
SAVE_PRODUCTION *psSaveProduction;
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
UDWORD fileSize;
|
||||
PRODUCTION_RUN *psCurrentProd;
|
||||
UDWORD factoryType,factoryNum,runNum;
|
||||
|
@ -10911,7 +10911,7 @@ static BOOL writeProductionFile(STRING *pFileName)
|
|||
/* SAVE_PRODUCTION */
|
||||
endian_udword(&psSaveProduction->multiPlayerID);
|
||||
|
||||
psSaveProduction = (SAVE_PRODUCTION *)((UBYTE *)psSaveProduction + sizeof(SAVE_PRODUCTION));
|
||||
psSaveProduction = (SAVE_PRODUCTION *)((char *)psSaveProduction + sizeof(SAVE_PRODUCTION));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10932,7 +10932,7 @@ static BOOL writeProductionFile(STRING *pFileName)
|
|||
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveStructLimits(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveStructLimits(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
#ifdef ALLOWSAVE
|
||||
STRUCTLIMITS_SAVEHEADER *psHeader;
|
||||
|
@ -10980,7 +10980,7 @@ BOOL loadSaveStructLimits(UBYTE *pFileData, UDWORD filesize)
|
|||
// -----------------------------------------------------------------------------------------
|
||||
#ifdef ALLOWSAVE // !?**@?!
|
||||
/* code specific to version 2 of saveStructLimits */
|
||||
BOOL loadSaveStructLimitsV19(UBYTE *pFileData, UDWORD filesize, UDWORD numLimits)
|
||||
BOOL loadSaveStructLimitsV19(char *pFileData, UDWORD filesize, UDWORD numLimits)
|
||||
{
|
||||
SAVE_STRUCTLIMITS_V2 *psSaveLimits;
|
||||
UDWORD count, statInc;
|
||||
|
@ -11048,7 +11048,7 @@ BOOL loadSaveStructLimitsV19(UBYTE *pFileData, UDWORD filesize, UDWORD numLimits
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveStructLimitsV(UBYTE *pFileData, UDWORD filesize, UDWORD numLimits)
|
||||
BOOL loadSaveStructLimitsV(char *pFileData, UDWORD filesize, UDWORD numLimits)
|
||||
{
|
||||
SAVE_STRUCTLIMITS *psSaveLimits;
|
||||
UDWORD count, statInc;
|
||||
|
@ -11131,7 +11131,7 @@ BOOL writeStructLimitsFile(STRING *pFileName)
|
|||
|
||||
// Allocate the data buffer
|
||||
fileSize = STRUCTLIMITS_HEADER_SIZE + (totalLimits * (sizeof(SAVE_STRUCTLIMITS)));
|
||||
pFileData = (UBYTE *) MALLOC(fileSize);
|
||||
pFileData = MALLOC(fileSize);
|
||||
if (pFileData == NULL)
|
||||
{
|
||||
DBERROR(("Out of memory"));
|
||||
|
@ -11158,7 +11158,7 @@ BOOL writeStructLimitsFile(STRING *pFileName)
|
|||
strcpy(psSaveLimit->name, psStructStats->pName);
|
||||
psSaveLimit->limit = asStructLimits[player][i].limit;
|
||||
psSaveLimit->player = (UBYTE)player;
|
||||
psSaveLimit = (SAVE_STRUCTLIMITS *)((UBYTE *)psSaveLimit + sizeof(SAVE_STRUCTLIMITS));
|
||||
psSaveLimit = (SAVE_STRUCTLIMITS *)((char *)psSaveLimit + sizeof(SAVE_STRUCTLIMITS));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11175,7 +11175,7 @@ BOOL writeStructLimitsFile(STRING *pFileName)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL loadSaveCommandLists(UBYTE *pFileData, UDWORD filesize)
|
||||
BOOL loadSaveCommandLists(char *pFileData, UDWORD filesize)
|
||||
{
|
||||
COMMAND_SAVEHEADER *psHeader;
|
||||
|
||||
|
@ -11213,7 +11213,7 @@ BOOL loadSaveCommandLists(UBYTE *pFileData, UDWORD filesize)
|
|||
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
BOOL loadSaveCommandListsV(UBYTE *pFileData, UDWORD filesize, UDWORD numDroids)
|
||||
BOOL loadSaveCommandListsV(char *pFileData, UDWORD filesize, UDWORD numDroids)
|
||||
{
|
||||
SAVE_COMMAND *psSaveCommand;
|
||||
DROID *psDroid;
|
||||
|
@ -11270,7 +11270,7 @@ BOOL writeCommandLists(STRING *pFileName)
|
|||
|
||||
// Allocate the data buffer
|
||||
fileSize = COMMAND_HEADER_SIZE + (totalDroids * (sizeof(SAVE_COMMAND)));
|
||||
pFileData = (UBYTE *) MALLOC(fileSize);
|
||||
pFileData = MALLOC(fileSize);
|
||||
if (pFileData == NULL)
|
||||
{
|
||||
DBERROR(("Out of memory"));
|
||||
|
@ -11295,7 +11295,7 @@ BOOL writeCommandLists(STRING *pFileName)
|
|||
for (psDroid = apsCmdDesignation[player]; psDroid != NULL; psDroid = psDroid->psNext)
|
||||
{
|
||||
psSaveCommand->droidID = psDroid->id;
|
||||
psSaveCommand = (SAVE_COMMAND*)((UBYTE *)psSaveCommand + sizeof(SAVE_COMMAND));
|
||||
psSaveCommand = (SAVE_COMMAND*)((char *)psSaveCommand + sizeof(SAVE_COMMAND));
|
||||
}
|
||||
*/
|
||||
psDroid = cmdDroidGetDesignator(player);
|
||||
|
@ -11312,7 +11312,7 @@ BOOL writeCommandLists(STRING *pFileName)
|
|||
/* COMMAND_SAVE_V20 */
|
||||
endian_udword(&psSaveCommand->droidID);
|
||||
|
||||
psSaveCommand = (SAVE_COMMAND*)((UBYTE *)psSaveCommand + sizeof(SAVE_COMMAND));
|
||||
psSaveCommand = (SAVE_COMMAND*)((char *)psSaveCommand + sizeof(SAVE_COMMAND));
|
||||
}
|
||||
|
||||
/* COMMAND_SAVEHEADER */
|
||||
|
@ -11334,7 +11334,7 @@ BOOL writeCommandLists(STRING *pFileName)
|
|||
// write the event state to a file on disk
|
||||
static BOOL writeScriptState(STRING *pFileName)
|
||||
{
|
||||
UBYTE *pBuffer;
|
||||
char *pBuffer;
|
||||
UDWORD fileSize;
|
||||
|
||||
if (!eventSaveState(3, &pBuffer, &fileSize))
|
||||
|
@ -11356,7 +11356,7 @@ static BOOL writeScriptState(STRING *pFileName)
|
|||
// load the script state given a .gam name
|
||||
BOOL loadScriptState(STRING *pFileName)
|
||||
{
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
UDWORD fileSize;
|
||||
BOOL bHashed = FALSE;
|
||||
|
||||
|
@ -11662,7 +11662,7 @@ BOOL plotStructurePreview(iSprite *backDropSprite,UBYTE scale,UDWORD offX,UDWORD
|
|||
STRUCT_SAVEHEADER *psHeader;
|
||||
STRING aFileName[256];
|
||||
UDWORD xx,yy,x,y,count,fileSize,sizeOfSaveStruture;
|
||||
UBYTE *pFileData = NULL;
|
||||
char *pFileData = NULL;
|
||||
LEVEL_DATASET *psLevel;
|
||||
|
||||
levFindDataSet(game.map, &psLevel);
|
||||
|
@ -11796,7 +11796,7 @@ BOOL plotStructurePreview16(unsigned char*backDropSprite,UBYTE scale,UDWORD offX
|
|||
STRUCT_SAVEHEADER *psHeader;
|
||||
STRING aFileName[256];
|
||||
UDWORD xx,yy,x,y,count,fileSize,sizeOfSaveStruture;
|
||||
UBYTE *pFileData = NULL;
|
||||
char *pFileData = NULL;
|
||||
LEVEL_DATASET *psLevel;
|
||||
|
||||
levFindDataSet(game.map, &psLevel);
|
||||
|
|
|
@ -116,7 +116,7 @@ extern BOOL loadMissionExtras(STRING *pGameToLoad, SWORD levelType);
|
|||
extern BOOL loadScriptState(STRING *pFileName);
|
||||
|
||||
//direct access for forceloader
|
||||
extern BOOL gameLoad(UBYTE *pFileData, UDWORD filesize);
|
||||
extern BOOL gameLoad(char *pFileData, UDWORD filesize);
|
||||
|
||||
extern BOOL saveGame(STRING *aFileName, SDWORD saveType);
|
||||
|
||||
|
|
|
@ -523,10 +523,10 @@ void gwFreeGateway(GATEWAY *psDel)
|
|||
|
||||
|
||||
// load a gateway list
|
||||
BOOL gwLoadGateways(UBYTE *pFileBuffer, UDWORD fileSize)
|
||||
BOOL gwLoadGateways(char *pFileBuffer, UDWORD fileSize)
|
||||
{
|
||||
SDWORD numGW, x1,y1, x2,y2;
|
||||
UBYTE *pPos;
|
||||
char *pPos;
|
||||
|
||||
// get the number of gateways
|
||||
pPos = pFileBuffer;
|
||||
|
|
|
@ -42,7 +42,7 @@ BOOL gwGenerateLinkGates(void);
|
|||
void gwFreeGateway(GATEWAY *psDel);
|
||||
|
||||
// load a gateway list
|
||||
BOOL gwLoadGateways(UBYTE *pFileBuffer, UDWORD fileSize);
|
||||
BOOL gwLoadGateways(char *pFileBuffer, UDWORD fileSize);
|
||||
|
||||
// Process the map to create all the map zones
|
||||
BOOL gwProcessMap(void);
|
||||
|
|
|
@ -162,7 +162,7 @@ BOOL ReticuleUp = FALSE;
|
|||
BOOL Refreshing = FALSE;
|
||||
|
||||
|
||||
UBYTE *DisplayBuffer;
|
||||
char *DisplayBuffer;
|
||||
UDWORD displayBufferSize;
|
||||
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ as big as Pie View in Research Msg now*/
|
|||
extern iIMDShape *pNewDesignIMD;
|
||||
|
||||
|
||||
extern UBYTE *DisplayBuffer;
|
||||
extern char *DisplayBuffer;
|
||||
extern UDWORD displayBufferSize;
|
||||
|
||||
|
||||
|
|
|
@ -726,7 +726,7 @@ BOOL InitialiseGlobals(void)
|
|||
|
||||
|
||||
BOOL loadLevFile(const char* filename, int datadir) {
|
||||
UBYTE *pBuffer;
|
||||
char *pBuffer;
|
||||
UDWORD size;
|
||||
|
||||
if ( !PHYSFS_exists(filename)
|
||||
|
@ -1014,7 +1014,7 @@ BOOL systemInitialise(void)
|
|||
{
|
||||
displayBufferSize = 5000000;
|
||||
}
|
||||
DisplayBuffer = (UBYTE*)MALLOC(displayBufferSize);
|
||||
DisplayBuffer = MALLOC(displayBufferSize);
|
||||
if (DisplayBuffer == NULL)
|
||||
{
|
||||
DBERROR(("Unable to allocate memory for display buffer"));
|
||||
|
|
|
@ -2340,7 +2340,7 @@ BOOL bFound;
|
|||
// --------------------------------------------------------------------------
|
||||
void kf_ScriptTest( void )
|
||||
{
|
||||
UBYTE *pBuffer;
|
||||
char *pBuffer;
|
||||
UDWORD size;
|
||||
|
||||
eventSaveState(1,&pBuffer, &size);
|
||||
|
|
|
@ -315,11 +315,11 @@ VOID displayKeyMap(struct _widget *psWidget, UDWORD xOffset, UDWORD yOffset, UDW
|
|||
iV_SetFont(WFont); // font
|
||||
iV_SetTextColour(-1); //colour
|
||||
|
||||
pie_DrawText((UCHAR*)psMapping->pName, x+2, y+(psWidget->height/2)+3);
|
||||
pie_DrawText(psMapping->pName, x + 2, y + (psWidget->height / 2) + 3);
|
||||
|
||||
// draw binding
|
||||
keyMapToString(sKey,psMapping);
|
||||
pie_DrawText((UCHAR*)sKey, x+370, y+(psWidget->height/2)+3);
|
||||
pie_DrawText(sKey, x + 370, y + (psWidget->height / 2) + 3);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ static STRING aText[YYLMAX];
|
|||
static BOOL inComment = FALSE;
|
||||
|
||||
/* Pointer to the input buffer */
|
||||
static UBYTE *pInputBuffer = NULL;
|
||||
static UBYTE *pEndBuffer = NULL;
|
||||
static char *pInputBuffer = NULL;
|
||||
static char *pEndBuffer = NULL;
|
||||
|
||||
#define YY_INPUT(buf, result, max_size) \
|
||||
if (pInputBuffer != pEndBuffer) { \
|
||||
|
@ -108,7 +108,7 @@ miss_clear return LTK_MCLEAR;
|
|||
%%
|
||||
|
||||
/* Set the current input buffer for the lexer */
|
||||
void levSetInputBuffer(UBYTE *pBuffer, UDWORD size)
|
||||
void levSetInputBuffer(char *pBuffer, UDWORD size)
|
||||
{
|
||||
pInputBuffer = pBuffer;
|
||||
pEndBuffer = pBuffer + size;
|
||||
|
|
|
@ -39,7 +39,7 @@ extern void levError(STRING *pError);
|
|||
extern int lev_lex(void);
|
||||
|
||||
/* Set the current input buffer for the lexer */
|
||||
extern void levSetInputBuffer(UBYTE *pBuffer, UDWORD size);
|
||||
extern void levSetInputBuffer(char *pBuffer, UDWORD size);
|
||||
|
||||
extern void levGetErrorData(int *pLine, char **ppText);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
// block ID number start for the current level data (as opposed to a dataset)
|
||||
#define CURRENT_DATAID LEVEL_MAXFILES
|
||||
|
||||
static UBYTE currentLevelName[32];
|
||||
static char currentLevelName[32];
|
||||
|
||||
// the current level descriptions
|
||||
LEVEL_DATASET *psLevels;
|
||||
|
@ -153,7 +153,7 @@ BOOL levFindDataSet(STRING *pName, LEVEL_DATASET **ppsDataSet)
|
|||
}
|
||||
|
||||
// parse a level description data file
|
||||
BOOL levParse(UBYTE *pBuffer, SDWORD size, int datadir)
|
||||
BOOL levParse(char *pBuffer, SDWORD size, int datadir)
|
||||
{
|
||||
SDWORD token, state, currData=0;
|
||||
LEVEL_DATASET *psDataSet = NULL;
|
||||
|
|
|
@ -58,7 +58,7 @@ typedef struct _level_dataset
|
|||
extern LEVEL_DATASET *psLevels;
|
||||
|
||||
// parse a level description data file
|
||||
extern BOOL levParse(UBYTE *pBuffer, SDWORD size, int datadir);
|
||||
extern BOOL levParse(char *pBuffer, SDWORD size, int datadir);
|
||||
|
||||
// shutdown the level system
|
||||
extern void levShutDown(void);
|
||||
|
|
|
@ -463,7 +463,7 @@ init://jump here from the end if re_initialising
|
|||
DBERROR(("Out of memory"));
|
||||
return -1;
|
||||
}
|
||||
if (!loadFileToBuffer("palette.bin", (UBYTE*)psPaletteBuffer, (256 * sizeof(iColour)+1),&pSize))
|
||||
if (!loadFileToBuffer("palette.bin", psPaletteBuffer, (256 * sizeof(iColour)+1),&pSize))
|
||||
{
|
||||
DBERROR(("Couldn't load palette data"));
|
||||
return -1;
|
||||
|
|
34
src/map.c
34
src/map.c
|
@ -191,7 +191,7 @@ UBYTE terrainTypes[MAX_TILE_TEXTURES];
|
|||
|
||||
|
||||
/* pointer to a load map function - depends on version */
|
||||
BOOL (*pLoadMapFunc)(UBYTE *pFileData, UDWORD fileSize);
|
||||
BOOL (*pLoadMapFunc)(char *pFileData, UDWORD fileSize);
|
||||
|
||||
MAPTILE *GetCurrentMap(void) // returns a pointer to the current loaded map data
|
||||
{
|
||||
|
@ -311,7 +311,7 @@ BOOL mapNew(UDWORD width, UDWORD height)
|
|||
}
|
||||
|
||||
/* load the map data - for version 1 */
|
||||
BOOL mapLoadV1(UBYTE *pFileData, UDWORD fileSize)
|
||||
BOOL mapLoadV1(char *pFileData, UDWORD fileSize)
|
||||
{
|
||||
UDWORD i,j;
|
||||
MAP_SAVETILEV1 *psTileData;
|
||||
|
@ -345,7 +345,7 @@ BOOL mapLoadV1(UBYTE *pFileData, UDWORD fileSize)
|
|||
}
|
||||
psTileData = (MAP_SAVETILEV1 *)(((UBYTE *)psTileData) + SAVE_TILE_SIZEV1);
|
||||
}
|
||||
if (((UBYTE *)psTileData) - pFileData > (SDWORD)fileSize)
|
||||
if ((char *)psTileData - pFileData > fileSize)
|
||||
{
|
||||
DBERROR(("mapLoad: unexpected end of file"));
|
||||
return FALSE;
|
||||
|
@ -360,7 +360,7 @@ BOOL mapLoadV1(UBYTE *pFileData, UDWORD fileSize)
|
|||
}
|
||||
|
||||
/* load the map data - for version 1 */
|
||||
BOOL mapLoadV2(UBYTE *pFileData, UDWORD fileSize)
|
||||
BOOL mapLoadV2(char *pFileData, UDWORD fileSize)
|
||||
{
|
||||
UDWORD i,j;
|
||||
MAP_SAVETILEV2 *psTileData;
|
||||
|
@ -391,7 +391,7 @@ BOOL mapLoadV2(UBYTE *pFileData, UDWORD fileSize)
|
|||
psTileData = (MAP_SAVETILEV2 *)(((UBYTE *)psTileData) + SAVE_TILE_SIZE);
|
||||
}
|
||||
|
||||
if (((UBYTE *)psTileData) - pFileData > (SDWORD)fileSize)
|
||||
if ((char *)psTileData - pFileData > fileSize)
|
||||
{
|
||||
DBERROR(("mapLoad: unexpected end of file"));
|
||||
return FALSE;
|
||||
|
@ -407,7 +407,7 @@ BOOL mapLoadV2(UBYTE *pFileData, UDWORD fileSize)
|
|||
|
||||
|
||||
/* load the map data - for version 3 */
|
||||
BOOL mapLoadV3(UBYTE *pFileData, UDWORD fileSize)
|
||||
BOOL mapLoadV3(char *pFileData, UDWORD fileSize)
|
||||
{
|
||||
UDWORD i,j;
|
||||
MAP_SAVETILEV2 *psTileData;
|
||||
|
@ -537,7 +537,7 @@ BOOL mapLoadV3(UBYTE *pFileData, UDWORD fileSize)
|
|||
}
|
||||
}
|
||||
|
||||
if (((UBYTE *)pZone) - pFileData > (SDWORD)fileSize)
|
||||
if ((char *)pZone - pFileData > fileSize)
|
||||
{
|
||||
DBERROR(("mapLoadV3: unexpected end of file"));
|
||||
return FALSE;
|
||||
|
@ -573,7 +573,7 @@ BOOL mapLoadV3(UBYTE *pFileData, UDWORD fileSize)
|
|||
|
||||
|
||||
/* Initialise the map structure */
|
||||
BOOL mapLoad(UBYTE *pFileData, UDWORD fileSize)
|
||||
BOOL mapLoad(char *pFileData, UDWORD fileSize)
|
||||
{
|
||||
// UDWORD i;
|
||||
// UDWORD tmp, bitCount, widthShift;
|
||||
|
@ -890,7 +890,7 @@ BOOL mapSave(char **ppFileData, UDWORD *pFileSize)
|
|||
|
||||
#if 0
|
||||
/* Save the map data */
|
||||
BOOL mapSaveMission(UBYTE **ppFileData, UDWORD *pFileSize)
|
||||
BOOL mapSaveMission(char **ppFileData, UDWORD *pFileSize)
|
||||
{
|
||||
UDWORD i;
|
||||
MAP_SAVEHEADER *psHeader;
|
||||
|
@ -918,7 +918,7 @@ BOOL mapSaveMission(UBYTE **ppFileData, UDWORD *pFileSize)
|
|||
*pFileSize += 1+aNumEquiv[i];
|
||||
}
|
||||
|
||||
*ppFileData = (UBYTE *)MALLOC(*pFileSize);
|
||||
*ppFileData = MALLOC(*pFileSize);
|
||||
if (*ppFileData == NULL)
|
||||
{
|
||||
DBERROR(("Out of memory"));
|
||||
|
@ -1587,11 +1587,11 @@ UDWORD GetHeightOfMap(void)
|
|||
BOOL writeVisibilityData( STRING *pFileName )
|
||||
{
|
||||
char *pFileData; // Pointer to the necessary allocated memory
|
||||
UBYTE *pVisData; // Pointer to the start of the map data
|
||||
UDWORD fileSize; // How many bytes we need - depends on compression
|
||||
VIS_SAVEHEADER *psHeader; // Pointer to the header part of the file
|
||||
UDWORD mapEntries; // Effectively, how many tiles are there?
|
||||
UDWORD i;
|
||||
char *pVisData; // Pointer to the start of the map data
|
||||
UDWORD fileSize; // How many bytes we need - depends on compression
|
||||
VIS_SAVEHEADER *psHeader; // Pointer to the header part of the file
|
||||
UDWORD mapEntries; // Effectively, how many tiles are there?
|
||||
UDWORD i;
|
||||
BOOL status = TRUE;
|
||||
|
||||
/* How many tiles do we write out data from? */
|
||||
|
@ -1601,7 +1601,7 @@ UDWORD i;
|
|||
fileSize = ( sizeof(struct _vis_save_header) + ( mapEntries*sizeof(UBYTE) ) );
|
||||
|
||||
/* Try and allocate it - freed up in same function */
|
||||
pFileData = (UBYTE *)MALLOC(fileSize);
|
||||
pFileData = MALLOC(fileSize);
|
||||
|
||||
/* Did we get it? */
|
||||
if(!pFileData)
|
||||
|
@ -1648,7 +1648,7 @@ UDWORD i;
|
|||
|
||||
// -----------------------------------------------------------------------------------
|
||||
/* This will read in the visibility data */
|
||||
BOOL readVisibilityData( UBYTE *pFileData, UDWORD fileSize )
|
||||
BOOL readVisibilityData(char *pFileData, UDWORD fileSize)
|
||||
{
|
||||
UDWORD expectedFileSize;
|
||||
UDWORD mapEntries;
|
||||
|
|
|
@ -263,7 +263,7 @@ extern BOOL mapShutdown(void);
|
|||
extern BOOL mapNew(UDWORD width, UDWORD height);
|
||||
|
||||
/* Load the map data */
|
||||
extern BOOL mapLoad(UBYTE *pFileData, UDWORD fileSize);
|
||||
extern BOOL mapLoad(char *pFileData, UDWORD fileSize);
|
||||
|
||||
/* Save the map data */
|
||||
extern BOOL mapSave(char **ppFileData, UDWORD *pFileSize);
|
||||
|
@ -389,7 +389,7 @@ extern void getTileMaxMin(UDWORD x, UDWORD y, UDWORD *pMax, UDWORD *pMin);
|
|||
MAPTILE *GetCurrentMap(void); // returns a pointer to the current loaded map data
|
||||
UDWORD GetHeightOfMap(void);
|
||||
UDWORD GetWidthOfMap(void);
|
||||
extern BOOL readVisibilityData( UBYTE *pFileData, UDWORD fileSize );
|
||||
extern BOOL readVisibilityData(char *pFileData, UDWORD fileSize);
|
||||
extern BOOL writeVisibilityData( STRING *pFileName );
|
||||
extern void mapFreeTilesAndStrips( void );
|
||||
|
||||
|
|
|
@ -780,7 +780,7 @@ VIEWDATA *loadViewData(SBYTE *pViewMsgData, UDWORD bufferSize)
|
|||
sscanf(pViewMsgData,",%[^','],%d%n", audioName, &count,&cnt);
|
||||
pViewMsgData += cnt;
|
||||
|
||||
ASSERT((count < UWORD_MAX, "loadViewData: numFrames too high for ", name));
|
||||
ASSERT((count < UWORD_MAX, "loadViewData: numFrames too high for %s", name));
|
||||
|
||||
psViewReplay->pSeqList[dataInc].numFrames = (UWORD)count;
|
||||
|
||||
|
|
|
@ -87,8 +87,8 @@ extern BOOL plotStructurePreview16(unsigned char *backDropSprite,UBYTE scale,UDW
|
|||
extern BOOL NETsetupTCPIP(LPVOID *addr, char * machine);
|
||||
|
||||
BOOL bHosted = FALSE; //we have set up a game
|
||||
UBYTE sPlayer[128]; // player name (to be used)
|
||||
UBYTE buildTime[8] = "67HGDV3"; //RODZ was __TIME__ ;
|
||||
char sPlayer[128]; // player name (to be used)
|
||||
char buildTime[8] = "67HGDV3"; //RODZ was __TIME__ ;
|
||||
static BOOL bColourChooserUp= FALSE;
|
||||
static SWORD SettingsUp = 0;
|
||||
static UBYTE InitialProto = 0;
|
||||
|
@ -194,15 +194,14 @@ void loadMapPreview(void)
|
|||
{
|
||||
STRING aFileName[256];
|
||||
UDWORD fileSize;
|
||||
UBYTE *pFileData = NULL;
|
||||
char *pFileData = NULL;
|
||||
LEVEL_DATASET *psLevel;
|
||||
|
||||
// iBitmap
|
||||
UDWORD i,j,x,y,height,offX,offY,offX2,offY2,tmp;
|
||||
UBYTE scale,col,coltab[16],bitDepth=8;
|
||||
UDWORD i, j, x, y, height, offX2, offY2;
|
||||
UBYTE scale,col;
|
||||
MAPTILE *psTile,*WTile;
|
||||
iSprite backDropSprite;
|
||||
UDWORD oursize,*optr;
|
||||
UDWORD oursize;
|
||||
unsigned char *ptr, *imageData;
|
||||
|
||||
if(psMapTiles)
|
||||
|
@ -909,7 +908,7 @@ FAIL:
|
|||
if(safeSearch)
|
||||
{
|
||||
iV_SetFont(FEFont);
|
||||
pie_DrawText((UCHAR*)strresGetString(psStringRes,STR_MUL_SEARCHING),D_W+260,D_H+460);
|
||||
pie_DrawText(strresGetString(psStringRes, STR_MUL_SEARCHING), D_W+260, D_H+460);
|
||||
}
|
||||
|
||||
DrawEnd();
|
||||
|
@ -2158,10 +2157,10 @@ static void processMultiopWidgets(UDWORD id)
|
|||
break;
|
||||
|
||||
case MULTIOP_PNAME:
|
||||
strcpy((STRING*)sPlayer,widgGetString(psWScreen, MULTIOP_PNAME));
|
||||
strcpy(sPlayer,widgGetString(psWScreen, MULTIOP_PNAME));
|
||||
|
||||
// chop to 15 chars..
|
||||
while(strlen((STRING*)sPlayer) > 15) // clip name.
|
||||
while(strlen(sPlayer) > 15) // clip name.
|
||||
{
|
||||
sPlayer[strlen(sPlayer)-1]='\0';
|
||||
}
|
||||
|
@ -2746,7 +2745,7 @@ BOOL startMultiOptions(BOOL bReenter)
|
|||
game.maxPlayers = 4;
|
||||
}
|
||||
|
||||
strncpy((CHAR *)game.version,(STRING*)buildTime,8); // note buildtime.
|
||||
strncpy(game.version, buildTime, 8); // note buildtime.
|
||||
|
||||
ingame.localOptionsReceived = FALSE;
|
||||
if(ingame.numStructureLimits)
|
||||
|
@ -3528,7 +3527,7 @@ void displayRemoteGame(struct _widget *psWidget, UDWORD xOffset, UDWORD yOffset,
|
|||
{
|
||||
NetPlay.games[i].name[strlen(NetPlay.games[i].name)-1]='\0';
|
||||
}
|
||||
iV_DrawText((UCHAR*)NetPlay.games[i].name,x+100,y+24); // name
|
||||
iV_DrawText(NetPlay.games[i].name, x + 100, y + 24); // name
|
||||
|
||||
// get game info.
|
||||
if( (NetPlay.games[i].desc.dwFlags & SESSION_JOINDISABLED)
|
||||
|
@ -3545,9 +3544,9 @@ void displayRemoteGame(struct _widget *psWidget, UDWORD xOffset, UDWORD yOffset,
|
|||
}
|
||||
else
|
||||
{
|
||||
iV_DrawText((UCHAR*)strresGetString(psStringRes,STR_MUL_PLAYERS),x+5,y+18);
|
||||
iV_DrawText(strresGetString(psStringRes, STR_MUL_PLAYERS), x + 5, y + 18);
|
||||
sprintf(tmp,"%d/%d",NetPlay.games[i].desc.dwCurrentPlayers,NetPlay.games[i].desc.dwMaxPlayers);
|
||||
iV_DrawText((UCHAR*)tmp,x+17,y+33);
|
||||
iV_DrawText(tmp, x + 17, y + 33);
|
||||
}
|
||||
|
||||
AddCursorSnap(&InterfaceSnap,
|
||||
|
@ -3616,7 +3615,7 @@ void displayPlayer(struct _widget *psWidget, UDWORD xOffset, UDWORD yOffset, UDW
|
|||
{
|
||||
NetPlay.players[i].name[strlen(NetPlay.players[i].name)-1]='\0';
|
||||
}
|
||||
iV_DrawText((UCHAR*)NetPlay.players[i].name,x+65,y+22);
|
||||
iV_DrawText(NetPlay.players[i].name, x + 65, y + 22);
|
||||
|
||||
// ping rating
|
||||
if(ingame.PingTimes[j] >= PING_LO && ingame.PingTimes[j] < PING_MED)
|
||||
|
|
|
@ -24,7 +24,7 @@ extern BOOL addMultiBut (W_SCREEN *screen, UDWORD formid,UDWORD id,UDWORD x,
|
|||
UDWORD width, UDWORD height, UDWORD tipres,
|
||||
UDWORD norm,UDWORD hi,BOOL showmouseover);
|
||||
extern char sForceName[256];
|
||||
extern UBYTE sPlayer[128];
|
||||
extern char sPlayer[128];
|
||||
|
||||
VOID kickPlayer (DPID dpid);
|
||||
UDWORD addPlayerBox (BOOL); // players (mid) box
|
||||
|
|
|
@ -136,11 +136,11 @@ BOOL intDisplayMultiJoiningStatus(UBYTE joinCount)
|
|||
RenderWindowFrame(&FrameNormal, x, y ,w, h); // draw a wee blu box.
|
||||
|
||||
// display how far done..
|
||||
pie_DrawText((UCHAR*)strresGetString(psStringRes,STR_GAM_JOINING),
|
||||
pie_DrawText(strresGetString(psStringRes, STR_GAM_JOINING),
|
||||
x+(w/2)-(iV_GetTextWidth(strresGetString(psStringRes,STR_GAM_JOINING))/2),
|
||||
y+(h/2)-8 );
|
||||
sprintf(sTmp,"%d%%", PERCENT((NetPlay.playercount-joinCount),NetPlay.playercount) );
|
||||
pie_DrawText((UCHAR*)sTmp ,x+(w/2)-10,y+(h/2)+10 );
|
||||
pie_DrawText(sTmp ,x + (w / 2) - 10, y + (h / 2) + 10);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -250,11 +250,7 @@ void displayRequestOption(struct _widget *psWidget, UDWORD xOffset, UDWORD yOffs
|
|||
butString[strlen(butString)-1]='\0';
|
||||
}
|
||||
|
||||
//draw text
|
||||
iV_DrawText( (UCHAR*)butString,
|
||||
x+6,
|
||||
y+12);
|
||||
|
||||
iV_DrawText(butString, x + 6, y + 12); //draw text
|
||||
|
||||
// if map, then draw no. of players.
|
||||
for(count=0;count<(UDWORD)psWidget->pUserData;count++)
|
||||
|
@ -743,18 +739,18 @@ void displayExtraGubbins(UDWORD height)
|
|||
iV_SetFont(WFont); // font
|
||||
iV_SetTextColour(-1); //colour
|
||||
|
||||
iV_DrawText((UCHAR*)strresGetString(psStringRes, STR_MUL_ALLIANCES),MULTIMENU_FORM_X+MULTIMENU_C0,MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText((UCHAR*)strresGetString(psStringRes, STR_MUL_SCORE) ,MULTIMENU_FORM_X+MULTIMENU_C8,MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText((UCHAR*)strresGetString(psStringRes, STR_MUL_KILLS) ,MULTIMENU_FORM_X+MULTIMENU_C9,MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText((UCHAR*)strresGetString(psStringRes, STR_MUL_PING) ,MULTIMENU_FORM_X+MULTIMENU_C10,MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText((UCHAR*)strresGetString(psStringRes,STR_MUL_PLAY) , MULTIMENU_FORM_X+MULTIMENU_C11,MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(strresGetString(psStringRes, STR_MUL_ALLIANCES), MULTIMENU_FORM_X+MULTIMENU_C0, MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(strresGetString(psStringRes, STR_MUL_SCORE), MULTIMENU_FORM_X+MULTIMENU_C8, MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(strresGetString(psStringRes, STR_MUL_KILLS), MULTIMENU_FORM_X+MULTIMENU_C9, MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(strresGetString(psStringRes, STR_MUL_PING), MULTIMENU_FORM_X+MULTIMENU_C10, MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(strresGetString(psStringRes, STR_MUL_PLAY), MULTIMENU_FORM_X+MULTIMENU_C11, MULTIMENU_FORM_Y+MULTIMENU_FONT_OSET);
|
||||
|
||||
#ifdef DEBUG
|
||||
sprintf(str,"Traf:%d/%d",NETgetBytesSent(),NETgetBytesRecvd());
|
||||
iV_DrawText((UCHAR*)str,MULTIMENU_FORM_X,MULTIMENU_FORM_Y+MULTIMENU_FORM_H);
|
||||
iV_DrawText(str, MULTIMENU_FORM_X, MULTIMENU_FORM_Y+MULTIMENU_FORM_H);
|
||||
|
||||
sprintf(str,"Pack:%d/%d",NETgetPacketsSent(), NETgetPacketsRecvd());
|
||||
iV_DrawText((UCHAR*)str,MULTIMENU_FORM_X+80,MULTIMENU_FORM_Y+MULTIMENU_FORM_H);
|
||||
iV_DrawText(str, MULTIMENU_FORM_X+80, MULTIMENU_FORM_Y+MULTIMENU_FORM_H);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
@ -789,7 +785,7 @@ void displayMultiPlayer(struct _widget *psWidget, UDWORD xOffset, UDWORD yOffset
|
|||
{
|
||||
str[strlen(str)-1]='\0';
|
||||
}
|
||||
iV_DrawText((UCHAR*)str, x+MULTIMENU_C2, y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(str, x+MULTIMENU_C2, y+MULTIMENU_FONT_OSET);
|
||||
|
||||
//c3-7 alliance
|
||||
//manage buttons by showing or hiding them. gifts only in campaign,
|
||||
|
@ -826,7 +822,7 @@ void displayMultiPlayer(struct _widget *psWidget, UDWORD xOffset, UDWORD yOffset
|
|||
{
|
||||
//c8:score,
|
||||
sprintf(str,"%d",getMultiStats(player,TRUE).recentScore);
|
||||
iV_DrawText((UCHAR*)str,x+MULTIMENU_C8,y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(str, x+MULTIMENU_C8, y+MULTIMENU_FONT_OSET);
|
||||
|
||||
//c9:kills,
|
||||
// if(game.type == DMATCH)
|
||||
|
@ -837,7 +833,7 @@ void displayMultiPlayer(struct _widget *psWidget, UDWORD xOffset, UDWORD yOffset
|
|||
// {
|
||||
sprintf(str,"%d",getMultiStats(player,TRUE).recentKills);
|
||||
// }
|
||||
iV_DrawText((UCHAR*)str,x+MULTIMENU_C9,y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(str, x+MULTIMENU_C9, y+MULTIMENU_FONT_OSET);
|
||||
|
||||
//c10:ping
|
||||
if(player != selectedPlayer)
|
||||
|
@ -850,21 +846,21 @@ void displayMultiPlayer(struct _widget *psWidget, UDWORD xOffset, UDWORD yOffset
|
|||
{
|
||||
sprintf(str,"%d",ingame.PingTimes[player]);
|
||||
}
|
||||
iV_DrawText((UCHAR*)str,x+MULTIMENU_C10,y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(str, x+MULTIMENU_C10, y+MULTIMENU_FONT_OSET);
|
||||
}
|
||||
|
||||
//c11:played
|
||||
sprintf(str,"%d",getMultiStats(player,TRUE).played);
|
||||
iV_DrawText((UCHAR*)str,x+MULTIMENU_C11,y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(str, x+MULTIMENU_C11, y+MULTIMENU_FONT_OSET);
|
||||
}
|
||||
else
|
||||
{
|
||||
// estimate of score.
|
||||
sprintf(str,"%d",ingame.skScores[player][0]);
|
||||
iV_DrawText((UCHAR*)str,x+MULTIMENU_C8,y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(str, x+MULTIMENU_C8, y+MULTIMENU_FONT_OSET);
|
||||
// estimated kills
|
||||
sprintf(str,"%d",ingame.skScores[player][1]);
|
||||
iV_DrawText((UCHAR*)str,x+MULTIMENU_C9,y+MULTIMENU_FONT_OSET);
|
||||
iV_DrawText(str, x+MULTIMENU_C9, y+MULTIMENU_FONT_OSET);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1353,7 +1349,7 @@ void intDisplayMiniMultiMenu(void)
|
|||
|
||||
// display how far done..
|
||||
sprintf(sTmp,"%d%%", PERCENT(arenaPlayersReceived,MAX_PLAYERS) );
|
||||
iV_DrawText((UCHAR*)sTmp ,x+(w/2)-10,y+(h/2)+3 );
|
||||
iV_DrawText(sTmp, x+(w/2)-10, y+(h/2)+3);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1406,7 +1402,7 @@ void intDisplayMiniMultiMenu(void)
|
|||
{
|
||||
sTmp[strlen(sTmp)-1]='\0';
|
||||
}
|
||||
iV_DrawText((UCHAR*)sTmp,x+16,y+13);
|
||||
iV_DrawText(sTmp, x + 16, y + 13);
|
||||
|
||||
if(players >1)
|
||||
{
|
||||
|
@ -1416,7 +1412,7 @@ void intDisplayMiniMultiMenu(void)
|
|||
{
|
||||
sTmp[strlen(sTmp)-1]='\0';
|
||||
}
|
||||
iV_DrawText((UCHAR*)sTmp ,x+16,y+26);
|
||||
iV_DrawText(sTmp, x + 16, y + 26);
|
||||
}
|
||||
|
||||
if(players >2)
|
||||
|
@ -1424,14 +1420,14 @@ void intDisplayMiniMultiMenu(void)
|
|||
if(j!=7 && j!=6)
|
||||
{
|
||||
sprintf(sTmp,"%d",8-j);
|
||||
iV_DrawText((UCHAR*)sTmp,x+5,y+39);
|
||||
iV_DrawText(sTmp, x + 5, y + 39);
|
||||
|
||||
strcpy(sTmp,getPlayerName(scp[selectedPlayer]));
|
||||
while(iV_GetTextWidth(sTmp) >= RADWIDTH-20 )
|
||||
{
|
||||
sTmp[strlen(sTmp)-1]='\0';
|
||||
}
|
||||
iV_DrawText((UCHAR*) sTmp,x+16,y+39);
|
||||
iV_DrawText(sTmp, x + 16, y + 39);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1441,7 +1437,7 @@ void intDisplayMiniMultiMenu(void)
|
|||
{
|
||||
sTmp[strlen(sTmp)-1]='\0';
|
||||
}
|
||||
iV_DrawText((UCHAR*)sTmp ,x+16,y+39);
|
||||
iV_DrawText(sTmp, x + 16, y + 39);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1187,7 +1187,7 @@ BOOL recvTemplate(NETMSG * m)
|
|||
|
||||
player = (UBYTE)(m->body[0]);
|
||||
|
||||
ASSERT((player<MAX_PLAYERS,"recvtemplate: invalid player size:%d"));
|
||||
ASSERT((player < MAX_PLAYERS, "recvtemplate: invalid player size: %d", player));
|
||||
|
||||
if(m->size < sizeof(DROID_TEMPLATE))
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@ extern GAMESPY gameSpy;
|
|||
typedef struct {
|
||||
UBYTE type; // DMATCH/CAMPAIGN/SKIRMISH/TEAMPLAY etc...
|
||||
STRING map[128]; // name of multiplayer map being used.
|
||||
UBYTE version[8]; // version of warzone
|
||||
char version[8]; // version of warzone
|
||||
UBYTE maxPlayers; // max players to allow
|
||||
STRING name[128]; // game name (to be used)
|
||||
BOOL bComputerPlayers; // Allow computer players
|
||||
|
|
|
@ -527,7 +527,7 @@ BOOL loadForce(char *name)
|
|||
|
||||
if (!PHYSFS_close(pFileHandle))
|
||||
{
|
||||
debug(LOG_ERROR, "loadForce: Close failed for %s", fileName, PHYSFS_getLastError());
|
||||
debug(LOG_ERROR, "loadForce: Close failed for %s: %s", fileName, PHYSFS_getLastError());
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -584,7 +584,7 @@ BOOL loadMultiStats(STRING *sPlayerName,PLAYERSTATS *playerStats)
|
|||
{
|
||||
STRING fileName[255]="";
|
||||
UDWORD size;
|
||||
UBYTE *pFileData;
|
||||
char *pFileData;
|
||||
PLAYERSTATS blankstats = {0};
|
||||
SAVEDPLAYERSTATS st,*codedst;
|
||||
UDWORD tmp[4];
|
||||
|
@ -658,7 +658,9 @@ BOOL saveMultiStats(STRING *sFileName, STRING *sPlayerName,PLAYERSTATS *playerSt
|
|||
strcpy(fileName,MultiPlayersPath);
|
||||
strcat(fileName,sFileName);
|
||||
strcat(fileName,".sta");
|
||||
saveFile(fileName,(UBYTE*)&codedst,sizeof(SAVEDPLAYERSTATS));
|
||||
|
||||
// FIXME: ugly cast
|
||||
saveFile(fileName, (char *)&codedst, sizeof(SAVEDPLAYERSTATS));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -454,7 +454,7 @@ DROID *psDroid;
|
|||
}
|
||||
// -----------------------------------------------------------------------------------
|
||||
/* This will save out the score data */
|
||||
BOOL writeScoreData( STRING *pFileName )
|
||||
BOOL writeScoreData(char *pFileName)
|
||||
{
|
||||
char *pFileData; // Pointer to the necessary allocated memory
|
||||
MISSION_DATA *pScoreData;
|
||||
|
@ -466,7 +466,7 @@ SCORE_SAVEHEADER *psHeader; // Pointer to the header part of the file
|
|||
fileSize = ( sizeof(struct _score_save_header) + sizeof(struct mission_data) );
|
||||
|
||||
/* Try and allocate it - freed up in same function */
|
||||
pFileData = (UBYTE *)MALLOC(fileSize);
|
||||
pFileData = MALLOC(fileSize);
|
||||
|
||||
/* Did we get it? */
|
||||
if(!pFileData)
|
||||
|
@ -506,7 +506,7 @@ SCORE_SAVEHEADER *psHeader; // Pointer to the header part of the file
|
|||
|
||||
// -----------------------------------------------------------------------------------
|
||||
/* This will read in the score data */
|
||||
BOOL readScoreData( UBYTE *pFileData, UDWORD fileSize )
|
||||
BOOL readScoreData(char *pFileData, UDWORD fileSize)
|
||||
{
|
||||
UDWORD expectedFileSize;
|
||||
SCORE_SAVEHEADER *psHeader;
|
||||
|
|
|
@ -76,7 +76,7 @@ extern void scoreDataToConsole ( void );
|
|||
extern void scoreDataToScreen ( void );
|
||||
extern void constructTime ( STRING *psText, UDWORD hours, UDWORD minutes, UDWORD seconds );
|
||||
extern void getAsciiTime ( STRING *psText, UDWORD time );
|
||||
extern BOOL readScoreData ( UBYTE *pFileData, UDWORD fileSize );
|
||||
extern BOOL readScoreData ( char *pFileData, UDWORD fileSize );
|
||||
extern BOOL writeScoreData ( STRING *pFileName );
|
||||
|
||||
#endif
|
||||
|
|
|
@ -466,12 +466,12 @@ STRING *scrGetStatName(INTERP_TYPE type, UDWORD data)
|
|||
}
|
||||
|
||||
// default value save routine
|
||||
BOOL scrValDefSave(INTERP_TYPE type, UDWORD data, UBYTE *pBuffer, UDWORD *pSize)
|
||||
BOOL scrValDefSave(INTERP_TYPE type, UDWORD data, char *pBuffer, UDWORD *pSize)
|
||||
{
|
||||
VIEWDATA *psIntMessage;
|
||||
STRING *pName;
|
||||
RESEARCH *psResearch;
|
||||
UBYTE *pPos;
|
||||
char *pPos;
|
||||
DROID *psCDroid;
|
||||
SDWORD members;
|
||||
DROID_GROUP *psGroup;
|
||||
|
@ -685,9 +685,9 @@ BOOL scrValDefSave(INTERP_TYPE type, UDWORD data, UBYTE *pBuffer, UDWORD *pSize)
|
|||
}
|
||||
|
||||
// default value load routine
|
||||
BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, UBYTE *pBuffer, UDWORD size, UDWORD *pData)
|
||||
BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size, UDWORD *pData)
|
||||
{
|
||||
UBYTE *pPos;
|
||||
char *pPos;
|
||||
DROID *psCDroid;
|
||||
SDWORD index, members;
|
||||
UDWORD id;
|
||||
|
|
|
@ -57,10 +57,10 @@ extern BOOL scrObjToFeature(void);
|
|||
extern BOOL scrGroupObjGet(UDWORD index);
|
||||
|
||||
// default value save routine
|
||||
extern BOOL scrValDefSave(INTERP_TYPE type, UDWORD data, UBYTE *pBuffer, UDWORD *pSize);
|
||||
extern BOOL scrValDefSave(INTERP_TYPE type, UDWORD data, char *pBuffer, UDWORD *pSize);
|
||||
|
||||
// default value load routine
|
||||
extern BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, UBYTE *pBuffer, UDWORD size, UDWORD *pData);
|
||||
extern BOOL scrValDefLoad(SDWORD version, INTERP_TYPE type, char *pBuffer, UDWORD size, UDWORD *pData);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -34,7 +34,7 @@ typedef struct _array_indexes
|
|||
} ARRAY_INDEXES;
|
||||
|
||||
/* Set the current input buffer for the lexer */
|
||||
extern void scrvSetInputBuffer(UBYTE *pBuffer, UDWORD size);
|
||||
extern void scrvSetInputBuffer(char *pBuffer, UDWORD size);
|
||||
|
||||
extern void scrvGetErrorData(int *pLine, char **ppText);
|
||||
|
||||
|
@ -93,7 +93,7 @@ extern void scrvShutDown(void);
|
|||
extern void scrvReset(void);
|
||||
|
||||
// Load a script value file
|
||||
extern BOOL scrvLoad(UBYTE *pData, UDWORD size);
|
||||
extern BOOL scrvLoad(char *pData, UDWORD size);
|
||||
|
||||
// Link any object types to the actual pointer values
|
||||
//extern BOOL scrvLinkValues(void);
|
||||
|
|
|
@ -28,8 +28,8 @@ static UDWORD currText=0;
|
|||
static BOOL inComment = FALSE;
|
||||
|
||||
/* Pointer to the input buffer */
|
||||
static UBYTE *pInputBuffer = NULL;
|
||||
static UBYTE *pEndBuffer = NULL;
|
||||
static char *pInputBuffer = NULL;
|
||||
static char *pEndBuffer = NULL;
|
||||
|
||||
#define YY_INPUT(buf,result,max_size) \
|
||||
if (pInputBuffer != pEndBuffer) { \
|
||||
|
@ -132,7 +132,7 @@ FALSE { scrv_lval.bval = FALSE; return BOOLEAN_T; }
|
|||
%%
|
||||
|
||||
/* Set the current input buffer for the lexer */
|
||||
void scrvSetInputBuffer(UBYTE *pBuffer, UDWORD size)
|
||||
void scrvSetInputBuffer(char *pBuffer, UDWORD size)
|
||||
{
|
||||
pInputBuffer = pBuffer;
|
||||
pEndBuffer = pBuffer + size;
|
||||
|
|
|
@ -783,7 +783,7 @@ BOOL scrvLookUpArray(STRING *pIdent, UDWORD *pIndex)
|
|||
|
||||
|
||||
// Load a script value file
|
||||
BOOL scrvLoad(UBYTE *pData, UDWORD size)
|
||||
BOOL scrvLoad(char *pData, UDWORD size)
|
||||
{
|
||||
scrvSetInputBuffer(pData, size);
|
||||
|
||||
|
|
|
@ -843,13 +843,13 @@ BOOL seq_ClearTextForVideo(void)
|
|||
|
||||
BOOL seq_AddTextFromFile(STRING *pTextName, BOOL bJustify)
|
||||
{
|
||||
UBYTE *pTextBuffer, *pCurrentLine, *pText;
|
||||
char *pTextBuffer, *pCurrentLine, *pText;
|
||||
UDWORD fileSize;
|
||||
// HANDLE fileHandle;
|
||||
// WIN32_FIND_DATA findData;
|
||||
// BOOL endOfFile = FALSE;
|
||||
SDWORD xOffset, yOffset, startFrame, endFrame;
|
||||
UBYTE* seps = "\n";
|
||||
char *seps = "\n";
|
||||
|
||||
strcpy(aTextName,"sequenceAudio\\");
|
||||
strcat(aTextName,pTextName);
|
||||
|
|
Loading…
Reference in New Issue