From 333c30b8c7f6781605f517f2a7150f78a77556fc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 May 2012 11:37:33 +1000 Subject: TONY: Removed unused drive & folder defines and code --- engines/tony/adv.h | 8 ------- engines/tony/globals.h | 3 +++ engines/tony/window.cpp | 61 ------------------------------------------------- engines/tony/window.h | 10 +------- 4 files changed, 4 insertions(+), 78 deletions(-) (limited to 'engines') diff --git a/engines/tony/adv.h b/engines/tony/adv.h index 90a9c245b5..93359688f6 100644 --- a/engines/tony/adv.h +++ b/engines/tony/adv.h @@ -48,14 +48,6 @@ namespace Tony { #define RM_SKIPY ((RM_BBY - RM_SY) / 2) #define RM_SKIPX 0 -// Name lengths -// FIXME: Some of these can likely be removed when refactoring is completed -#define MAX_DRIVE 10 -#define MAX_DIR 255 -#define MAX_PATH 255 -#define MAX_FNAME 100 -#define MAX_EXT 10 - // Tony's actions enum RMTonyAction { TA_GOTO = 0, diff --git a/engines/tony/globals.h b/engines/tony/globals.h index 1c2835cf40..9115b22ccc 100644 --- a/engines/tony/globals.h +++ b/engines/tony/globals.h @@ -44,6 +44,9 @@ namespace Tony { #define T_MAREMETA 7 +#define MAX_PATH 255 + + struct CharacterStruct { uint32 code; RMItem *item; diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index 58d0bba2ba..26dbaf88fc 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -195,69 +195,8 @@ void RMWindow::plotLines(const byte *lpBuf, const Common::Point ¢er, int x, * RMSnapshot Methods \****************************************************************************/ -char RMSnapshot::bufDrive[MAX_DRIVE]; -char RMSnapshot::bufDir[MAX_DIR]; -char RMSnapshot::bufName[MAX_FNAME]; -char RMSnapshot::bufExt[MAX_EXT]; -char RMSnapshot::filename[512]; byte RMSnapshot::rgb[RM_SX * RM_SY * 3]; -bool RMSnapshot::GetFreeSnapName(char *fn) { -#ifdef REFACTOR_ME - int i, j, k; - uint32 h; - - theGame.GetDataDirectory(RMGame::DD_SHOTS, fn); - _splitpath(fn, bufDrive, bufDir, NULL, NULL); - - for (i = 1; i < 10; i++) { - wsprintf(bufName, "rm%d00", i); - _makepath(fn, bufDrive, bufDir, bufName, ".bmp"); - h = CreateFile(fn, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (h == CORO_INVALID_PID_VALUE) - break; - CloseHandle(h); - } - - i--; - - for (j = 1; j < 10; j++) { - wsprintf(bufName, "rm%d%d0", i, j); - _makepath(fn, bufDrive, bufDir, bufName, ".bmp"); - h = CreateFile(fn, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (h == CORO_INVALID_PID_VALUE) - break; - CloseHandle(h); - } - - j--; - - for (k = 0; k < 10; k++) { - wsprintf(bufName, "rm%d%d%d", i, j, k); - _makepath(fn, bufDrive, bufDir, bufName, ".bmp"); - h = CreateFile(fn, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (h == CORO_INVALID_PID_VALUE) - break; - CloseHandle(h); - } - - if (k == 10) { - k = 0; - j++; - if (j == 10) { - j = 0; - i++; - if (i == 10) - return false; - } - - wsprintf(bufName, "rm%d%d%d", i, j, k); - _makepath(fn, bufDrive, bufDir, bufName, ".bmp"); - } -#endif - return true; -} - void RMSnapshot::GrabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) { uint16 *src = (uint16 *)lpBuf; diff --git a/engines/tony/window.h b/engines/tony/window.h index ea26df3920..9483f693ab 100644 --- a/engines/tony/window.h +++ b/engines/tony/window.h @@ -41,16 +41,8 @@ struct DDSURFACEDESC { class RMSnapshot { private: - // Buffer used to create a path - static char bufDrive[MAX_DRIVE], bufDir[MAX_DIR], bufName[MAX_FNAME], bufExt[MAX_EXT]; - static char filename[512]; - - // Buffer used to convert a RGB + // Buffer used to convert to RGB static byte rgb[RM_SX * RM_SY * 3]; - -private: - bool GetFreeSnapName(char *fn); - public: // Take a screenshot void GrabScreenshot(byte *lpBuf, int dezoom = 1, uint16 *lpDestBuf = NULL); -- cgit v1.2.3