diff --git a/src/game.cc b/src/game.cc index d774337..978a385 100644 --- a/src/game.cc +++ b/src/game.cc @@ -188,7 +188,6 @@ int gameInitWithOptions(const char* windowTitle, bool isMapper, int font, int a4 fontSetCurrent(font); screenshotHandlerConfigure(KEY_F12, gameTakeScreenshot); - pauseHandlerConfigure(-1, nullptr); tileDisable(); diff --git a/src/input.cc b/src/input.cc index 6f43ba7..33acd6e 100644 --- a/src/input.cc +++ b/src/input.cc @@ -39,8 +39,6 @@ typedef struct TickerListNode { } TickerListNode; static int dequeueInputEvent(); -static void pauseGame(); -static int pauseHandlerDefaultImpl(); static void screenshotBlitter(unsigned char* src, int src_pitch, int a3, int x, int y, int width, int height, int dest_x, int dest_y); static void buildNormalizedQwertyKeys(); static void _GNW95_process_key(KeyboardData* data); @@ -73,18 +71,12 @@ static int _input_mx; // 0x6AC754 static int _input_my; -// 0x6AC75C -static bool gPaused; - // 0x6AC760 static int gScreenshotKeyCode; // 0x6AC764 static int _using_msec_timer; -// 0x6AC768 -static int gPauseKeyCode; - // 0x6AC76C static ScreenshotHandler* gScreenshotHandler; @@ -94,9 +86,6 @@ static int gInputEventQueueReadIndex; // 0x6AC774 static unsigned char* gScreenshotBuffer; -// 0x6AC778 -static PauseHandler* gPauseHandler; - // 0x6AC77C static int gInputEventQueueWriteIndex; @@ -137,9 +126,6 @@ int inputInit(int a1) _input_mx = -1; _input_my = -1; gRunLoopDisabled = 0; - gPaused = false; - gPauseKeyCode = KEY_ALT_P; - gPauseHandler = pauseHandlerDefaultImpl; gScreenshotHandler = screenshotHandlerDefaultImpl; gTickerListHead = nullptr; gScreenshotKeyCode = KEY_ALT_C; @@ -223,11 +209,6 @@ void enqueueInputEvent(int a1) return; } - if (a1 == gPauseKeyCode) { - pauseGame(); - return; - } - if (a1 == gScreenshotKeyCode) { takeScreenshot(); return; @@ -290,10 +271,6 @@ void inputEventQueueReset() // 0x4C8D1C void tickersExecute() { - if (gPaused) { - return; - } - if (gRunLoopDisabled) { return; } @@ -363,74 +340,6 @@ void tickersDisable() gRunLoopDisabled = true; } -// 0x4C8DFC -static void pauseGame() -{ - if (!gPaused) { - gPaused = true; - - int win = gPauseHandler(); - - while (inputGetInput() != KEY_ESCAPE) { - } - - gPaused = false; - windowDestroy(win); - } -} - -// 0x4C8E38 -static int pauseHandlerDefaultImpl() -{ - int windowWidth = fontGetStringWidth("Paused") + 32; - int windowHeight = 3 * fontGetLineHeight() + 16; - - int win = windowCreate((rectGetWidth(&_scr_size) - windowWidth) / 2, - (rectGetHeight(&_scr_size) - windowHeight) / 2, - windowWidth, - windowHeight, - 256, - WINDOW_MODAL | WINDOW_MOVE_ON_TOP); - if (win == -1) { - return -1; - } - - windowDrawBorder(win); - - unsigned char* windowBuffer = windowGetBuffer(win); - fontDrawText(windowBuffer + 8 * windowWidth + 16, - "Paused", - windowWidth, - windowWidth, - _colorTable[31744]); - - _win_register_text_button(win, - (windowWidth - fontGetStringWidth("Done") - 16) / 2, - windowHeight - 8 - fontGetLineHeight() - 6, - -1, - -1, - -1, - KEY_ESCAPE, - "Done", - 0); - - windowRefresh(win); - - return win; -} - -// 0x4C8F34 -void pauseHandlerConfigure(int keyCode, PauseHandler* handler) -{ - gPauseKeyCode = keyCode; - - if (handler == nullptr) { - handler = pauseHandlerDefaultImpl; - } - - gPauseHandler = handler; -} - // 0x4C8F4C void takeScreenshot() { diff --git a/src/input.h b/src/input.h index b0101ac..cef0092 100644 --- a/src/input.h +++ b/src/input.h @@ -5,7 +5,6 @@ namespace fallout { typedef void(TickerProc)(); -typedef int(PauseHandler)(); typedef int(ScreenshotHandler)(int width, int height, unsigned char* buffer, unsigned char* palette); int inputInit(int a1); @@ -20,7 +19,6 @@ void tickersAdd(TickerProc* fn); void tickersRemove(TickerProc* fn); void tickersEnable(); void tickersDisable(); -void pauseHandlerConfigure(int keyCode, PauseHandler* fn); void takeScreenshot(); int screenshotHandlerDefaultImpl(int width, int height, unsigned char* data, unsigned char* palette); void screenshotHandlerConfigure(int keyCode, ScreenshotHandler* handler);