From 64b4f13b36030963b507be6e8fc4c4eb7bf22206 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 26 Oct 2019 11:12:01 -0700 Subject: GLK: LEVEL9: Compilation fixes --- engines/glk/level9/detection.cpp | 4 ++-- engines/glk/level9/detection.h | 4 ++-- engines/glk/level9/level9_main.cpp | 6 +++++- engines/glk/level9/level9_main.h | 2 +- engines/glk/level9/os_glk.cpp | 16 ++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/engines/glk/level9/detection.cpp b/engines/glk/level9/detection.cpp index 93e8143b3c..5788c0f95c 100644 --- a/engines/glk/level9/detection.cpp +++ b/engines/glk/level9/detection.cpp @@ -514,7 +514,7 @@ void Scanner::fullScan(byte *startFile, uint32 size) { /*----------------------------------------------------------------------*/ -GameDetection::GameDetection(byte *&startData, size_t &fileSize) : +GameDetection::GameDetection(byte *&startData, uint32 &fileSize) : _startData(startData), _fileSize(fileSize), _crcInitialized(false), _gameName(nullptr) { Common::fill(&_crcTable[0], &_crcTable[256], 0); } @@ -723,7 +723,7 @@ bool Level9MetaEngine::detectGames(const Common::FSList &fslist, DetectedGames & if (!gameFile.open(*file)) continue; - size_t fileSize = gameFile.size(); + uint32 fileSize = gameFile.size(); if (fileSize > 0xffff) { // Too big to possibly be a Level 9 game gameFile.close(); diff --git a/engines/glk/level9/detection.h b/engines/glk/level9/detection.h index ae876b9bc5..f6832d1a8c 100644 --- a/engines/glk/level9/detection.h +++ b/engines/glk/level9/detection.h @@ -101,7 +101,7 @@ public: class GameDetection : public Scanner { private: byte *&_startData; - size_t &_fileSize; + uint32 &_fileSize; bool _crcInitialized; uint16 _crcTable[256]; public: @@ -110,7 +110,7 @@ public: /** * Constructor */ - GameDetection(byte *&startData, size_t &fileSize); + GameDetection(byte *&startData, uint32 &fileSize); /** * Identify a game from its data length, checksum, and CRC. Returns the diff --git a/engines/glk/level9/level9_main.cpp b/engines/glk/level9/level9_main.cpp index bbaad57a40..3cc027e2ea 100644 --- a/engines/glk/level9/level9_main.cpp +++ b/engines/glk/level9/level9_main.cpp @@ -78,7 +78,7 @@ enum L9GfxTypes { GFX_V2, GFX_V3A, GFX_V3B, GFX_V3C }; /* Global Variables */ L9BYTE *startfile, *pictureaddress, *picturedata; byte *startdata; -size_t FileSize, picturesize; +uint32 FileSize, picturesize; byte *L9Pointers[12]; byte *absdatablock, *list2ptr, *list3ptr, *list9startptr, *acodeptr; @@ -1808,6 +1808,10 @@ L9BOOL corruptinginput() { } while (TRUE); /* ip22 */ checknumber(); + + // Unused variables + (void)keywordnumber; + return TRUE; } diff --git a/engines/glk/level9/level9_main.h b/engines/glk/level9/level9_main.h index 95d9f18338..5bd1dffc06 100644 --- a/engines/glk/level9/level9_main.h +++ b/engines/glk/level9/level9_main.h @@ -87,7 +87,7 @@ struct Bitmap { #define L9SETDWORD(x,val) WRITE_LE_UINT32(x, val) extern byte *startdata; -extern size_t FileSize; +extern uint32 FileSize; extern void level9_initialize(); diff --git a/engines/glk/level9/os_glk.cpp b/engines/glk/level9/os_glk.cpp index ab171c300c..ac9a4eee9d 100644 --- a/engines/glk/level9/os_glk.cpp +++ b/engines/glk/level9/os_glk.cpp @@ -1007,14 +1007,15 @@ static void gln_graphics_timeout() { static int deferred_repaint = FALSE; /* Local delayed repaint flag */ static int ignore_counter; /* Count of calls ignored */ - static int x_offset, y_offset; /* Point plot offsets */ + +#ifndef GARGLK static int yield_counter; /* Yields in rendering */ static int saved_layer; /* Saved current layer */ static int saved_x, saved_y; /* Saved x,y coord */ static int total_regions; /* Debug statistic */ - +#endif gln_byte *on_screen; /* On-screen image buffer */ gln_byte *off_screen; /* Off-screen image buffer */ long picture_size; /* Picture size in pixels */ @@ -1133,13 +1134,14 @@ static void gln_graphics_timeout() { x_offset, y_offset, GLN_GRAPHICS_PIXEL, gln_graphics_width, gln_graphics_height); - +#ifndef GARGLK /* Start a fresh picture rendering pass. */ yield_counter = 0; saved_layer = 0; saved_x = 0; saved_y = 0; total_regions = 0; +#endif /* Clear the new picture and deferred repaint flags. */ gln_graphics_new_picture = FALSE; @@ -2333,7 +2335,7 @@ static void gln_status_print() { /* Bracket, and output the extracted game name. */ g_vm->glk_put_string("[ "); - g_vm->glk_put_string((char *) game_name); + g_vm->glk_put_string(game_name); for (index = strlen(game_name); index <= GLN_DEFAULT_STATUS_WIDTH; index++) @@ -4544,12 +4546,6 @@ int __wrap_tolower(int ch) { static const int GLN_WATCHDOG_TIMEOUT = 5, GLN_WATCHDOG_PERIOD = 10240; -/* - * The following values need to be passed between the startup_code and main - * functions. - */ -static const char *gln_game_message = nullptr; /* Error message. */ - /* * gln_establish_picture_filename() * -- cgit v1.2.3