diff options
Diffstat (limited to 'sword2')
-rw-r--r-- | sword2/build_display.cpp | 10 | ||||
-rw-r--r-- | sword2/debug.cpp | 12 | ||||
-rw-r--r-- | sword2/debug.h | 8 | ||||
-rw-r--r-- | sword2/driver/driver96.h | 10 | ||||
-rw-r--r-- | sword2/driver/rdwin.cpp | 6 |
5 files changed, 22 insertions, 24 deletions
diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp index 600d0b19b7..53f1c99e4f 100644 --- a/sword2/build_display.cpp +++ b/sword2/build_display.cpp @@ -98,7 +98,6 @@ extern uint32 mouse_status; // So I know if the control Panel can be activated void Start_new_palette(void); //Tony25Sept96 void Register_frame(int32 *params, buildit *build_unit); // (1nov96JEL) -void Process_image(buildit *frame); void Process_layer(uint32 layer_number); //Tony24Sept96 void Sort_the_sort_list(void); //Tony18Sept96 @@ -119,7 +118,9 @@ void Send_fore_par1_frames(void); //James23Jan97 void Build_display(void) //Tony21Sept96 { BOOL end; +#ifdef _DEBUG uint8 pal[12]={0,0,0,0,0,0,0,0,0,255,0,0}; +#endif uint8 *file; _multiScreenHeader *screenLayerTable; @@ -323,7 +324,6 @@ void DisplayMsg( uint8 *text, int time ) // Chris 15May97 mem *text_spr; _frameHeader *frame; _spriteInfo spriteInfo; - bool done = false; _palEntry pal[256]; _palEntry oldPal[256]; int16 oldY; @@ -1035,7 +1035,6 @@ int32 FN_register_frame(int32 *params) // (27nov96 JEL) void Start_new_palette(void) //Tony25Sept96 { //start layer palette fading up - uint8 black[4]={0,0,0,0}; uint8 *screenFile; @@ -1145,7 +1144,6 @@ void SetFullPalette(int32 palRes) // James17jun97 // params 0 resource number of palette file // or 0 if it's to be the palette from the current screen - uint8 black[4]={0,0,0,0}; uint8 *file; _standardHeader *head; @@ -1156,7 +1154,7 @@ void SetFullPalette(int32 palRes) // James17jun97 // - but restoring the screen palette after 'dark_plaette_13' should now work properly too! if (LOCATION==13) // hut interior { - if (palRes==0xffffffff) // unpausing + if (palRes==-1) // unpausing palRes = lastPaletteRes; // restore whatever palette was last set (screen palette or 'dark_palette_13') } else @@ -1166,7 +1164,7 @@ void SetFullPalette(int32 palRes) // James17jun97 // because we might actually need to use a separate palette file anyway // eg. for pausing & unpausing during the eclipse - if (palRes==0xffffffff) // unpausing (fudged for location 13) + if (palRes==-1) // unpausing (fudged for location 13) palRes=0; // we really meant '0' if ((palRes==0) && (lastPaletteRes)) diff --git a/sword2/debug.cpp b/sword2/debug.cpp index c7f1010140..8ca012cb35 100644 --- a/sword2/debug.cpp +++ b/sword2/debug.cpp @@ -25,7 +25,7 @@ #include "debug.h" //-------------------------------------------------------------------------------------- -#if _DEBUG // this whole file (except ExitWithReport) only included on debug versions +#ifdef _DEBUG // this whole file (except ExitWithReport) only included on debug versions #include <stdlib.h> @@ -89,7 +89,7 @@ void DrawRect( int16 x, int16 y, int16 x2, int16 y2, uint8 pen ); // THIS FUNCTION STAYS IN THE RELEASE VERSION // IN FACT, CON_FATAL_ERROR IS MAPPED TO THIS AS WELL, SO WE HAVE A MORE PRESENTABLE ERROR REPORT -void ExitWithReport(char *format,...) // (6dec96 JEL) +void ExitWithReport(const char *format,...) // (6dec96 JEL) { // Send a printf type string to Paul's windows routine char buf[500]; @@ -105,16 +105,16 @@ void ExitWithReport(char *format,...) // (6dec96 JEL) ServiceWindows(); RestoreDisplay(); - ReportFatalError((uint8 *)buf); // display message box + ReportFatalError((const uint8 *)buf); // display message box CloseAppWindow(); while (ServiceWindows() != RDERR_APPCLOSED); exit(0); } -#if _DEBUG // all other functions only for _DEBUG version +#ifdef _DEBUG // all other functions only for _DEBUG version //-------------------------------------------------------------------------------------- -void Zdebug(char *format,...) //Tony's special debug logging file March96 +void Zdebug(const char *format,...) //Tony's special debug logging file March96 { // Write a printf type string to a debug file @@ -142,7 +142,7 @@ void Zdebug(char *format,...) //Tony's special debug logging file March96 } //-------------------------------------------------------------------------------------- -void Zdebug(uint32 stream, char *format,...) //Tony's special debug logging file March96 +void Zdebug(uint32 stream, const char *format,...) //Tony's special debug logging file March96 { // Write a printf type string to a debug file diff --git a/sword2/debug.h b/sword2/debug.h index 0ecca67830..7e8a7d49e2 100644 --- a/sword2/debug.h +++ b/sword2/debug.h @@ -61,8 +61,8 @@ extern uint32 player_graphic_no_frames; extern int32 showVar[MAX_SHOWVARS]; -void Zdebug(char * ,...); // Tony's special debug logging file March96 -void Zdebug(uint32 stream, char *format,...); +void Zdebug(const char * ,...); // Tony's special debug logging file March96 +void Zdebug(uint32 stream, const char *format,...); void Build_debug_text(void); // James's debug text display void Draw_debug_graphics(void); // James's debug graphics display @@ -78,14 +78,14 @@ void Print_current_info(void); //Tony30Oct96 #define Print_current_info NULL */ -void Zdebug(char * ,...); // Tony's special debug logging file March96 +void Zdebug(const char * ,...); // Tony's special debug logging file March96 void Build_debug_text(void); // James's debug text display void Draw_debug_graphics(void); // James's debug graphics display #endif // _DEBUG // this whole file only included on debug versions //-------------------------------------------------------------------------------------- -void ExitWithReport(char *format,...); // (6dec96 JEL) IN BOTH DEBUG & RELEASE VERSIONS +void ExitWithReport(const char *format,...); // (6dec96 JEL) IN BOTH DEBUG & RELEASE VERSIONS diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h index 87c40c3fbd..dfa812bac0 100644 --- a/sword2/driver/driver96.h +++ b/sword2/driver/driver96.h @@ -410,7 +410,7 @@ // // --------------------------------------------------------------------------- // -// int32 ReportFatalError(uint8 *error) +// int32 ReportFatalError(const uint8 *error) // // Creates a message box and displays the error string passed in, as well as // the filename and line that the function was called from @@ -1475,8 +1475,8 @@ extern int32 GrabScreenShot(void); //extern int32 InitialiseWindow(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow, char *gameName); extern int32 CloseAppWindow(void); extern int32 ServiceWindows(void); -extern int32 _ReportDriverError(int32 error, uint8 *filename, uint32 line); -extern int32 _ReportFatalError(uint8 *error, uint8 *filename, uint32 line); +extern int32 _ReportDriverError(int32 error, const uint8 *filename, uint32 line); +extern int32 _ReportFatalError(const uint8 *error, const uint8 *filename, uint32 line); extern int32 DisableQuitKey(void); extern void SetWindowName(const char *windowName); //----------------------------------------------------------------------------- @@ -1622,8 +1622,8 @@ extern void GetModuleFileName(void *module, char *destStr, uint32 maxLen); //----------------------------------------------------------------------------- //Macro for calling error handler with source filename and line. //----------------------------------------------------------------------------- -#define ReportDriverError(f) _ReportDriverError(f, (uint8 *) __FILE__, (uint32) __LINE__) -#define ReportFatalError(f) _ReportFatalError(f, (uint8 *) __FILE__, (uint32) __LINE__) +#define ReportDriverError(f) _ReportDriverError(f, (const uint8 *) __FILE__, (uint32) __LINE__) +#define ReportFatalError(f) _ReportFatalError(f, (const uint8 *) __FILE__, (uint32) __LINE__) //----------------------------------------------------------------------------- diff --git a/sword2/driver/rdwin.cpp b/sword2/driver/rdwin.cpp index f945b3ca14..9d24d552d7 100644 --- a/sword2/driver/rdwin.cpp +++ b/sword2/driver/rdwin.cpp @@ -574,10 +574,10 @@ int32 ServiceWindows(void) -int32 _ReportDriverError(int32 error, uint8 *filename, uint32 line) +int32 _ReportDriverError(int32 error, const uint8 *filename, uint32 line) { - warning("stub _ReportDriverError 0x%.8x file: %s, line: %d ", error, (char *) filename, line); + warning("stub _ReportDriverError 0x%.8x file: %s, line: %d ", error, (const char *) filename, line); /* char errorText[128]; @@ -594,7 +594,7 @@ int32 _ReportDriverError(int32 error, uint8 *filename, uint32 line) -int32 _ReportFatalError(uint8 *error, uint8 *filename, uint32 line) +int32 _ReportFatalError(const uint8 *error, const uint8 *filename, uint32 line) { |