mirror of
https://github.com/alexbatalov/fallout2-ce.git
synced 2025-12-19 17:37:04 -05:00
Remove pause window
This commit is contained in:
@@ -188,7 +188,6 @@ int gameInitWithOptions(const char* windowTitle, bool isMapper, int font, int a4
|
|||||||
fontSetCurrent(font);
|
fontSetCurrent(font);
|
||||||
|
|
||||||
screenshotHandlerConfigure(KEY_F12, gameTakeScreenshot);
|
screenshotHandlerConfigure(KEY_F12, gameTakeScreenshot);
|
||||||
pauseHandlerConfigure(-1, nullptr);
|
|
||||||
|
|
||||||
tileDisable();
|
tileDisable();
|
||||||
|
|
||||||
|
|||||||
91
src/input.cc
91
src/input.cc
@@ -39,8 +39,6 @@ typedef struct TickerListNode {
|
|||||||
} TickerListNode;
|
} TickerListNode;
|
||||||
|
|
||||||
static int dequeueInputEvent();
|
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 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 buildNormalizedQwertyKeys();
|
||||||
static void _GNW95_process_key(KeyboardData* data);
|
static void _GNW95_process_key(KeyboardData* data);
|
||||||
@@ -73,18 +71,12 @@ static int _input_mx;
|
|||||||
// 0x6AC754
|
// 0x6AC754
|
||||||
static int _input_my;
|
static int _input_my;
|
||||||
|
|
||||||
// 0x6AC75C
|
|
||||||
static bool gPaused;
|
|
||||||
|
|
||||||
// 0x6AC760
|
// 0x6AC760
|
||||||
static int gScreenshotKeyCode;
|
static int gScreenshotKeyCode;
|
||||||
|
|
||||||
// 0x6AC764
|
// 0x6AC764
|
||||||
static int _using_msec_timer;
|
static int _using_msec_timer;
|
||||||
|
|
||||||
// 0x6AC768
|
|
||||||
static int gPauseKeyCode;
|
|
||||||
|
|
||||||
// 0x6AC76C
|
// 0x6AC76C
|
||||||
static ScreenshotHandler* gScreenshotHandler;
|
static ScreenshotHandler* gScreenshotHandler;
|
||||||
|
|
||||||
@@ -94,9 +86,6 @@ static int gInputEventQueueReadIndex;
|
|||||||
// 0x6AC774
|
// 0x6AC774
|
||||||
static unsigned char* gScreenshotBuffer;
|
static unsigned char* gScreenshotBuffer;
|
||||||
|
|
||||||
// 0x6AC778
|
|
||||||
static PauseHandler* gPauseHandler;
|
|
||||||
|
|
||||||
// 0x6AC77C
|
// 0x6AC77C
|
||||||
static int gInputEventQueueWriteIndex;
|
static int gInputEventQueueWriteIndex;
|
||||||
|
|
||||||
@@ -137,9 +126,6 @@ int inputInit(int a1)
|
|||||||
_input_mx = -1;
|
_input_mx = -1;
|
||||||
_input_my = -1;
|
_input_my = -1;
|
||||||
gRunLoopDisabled = 0;
|
gRunLoopDisabled = 0;
|
||||||
gPaused = false;
|
|
||||||
gPauseKeyCode = KEY_ALT_P;
|
|
||||||
gPauseHandler = pauseHandlerDefaultImpl;
|
|
||||||
gScreenshotHandler = screenshotHandlerDefaultImpl;
|
gScreenshotHandler = screenshotHandlerDefaultImpl;
|
||||||
gTickerListHead = nullptr;
|
gTickerListHead = nullptr;
|
||||||
gScreenshotKeyCode = KEY_ALT_C;
|
gScreenshotKeyCode = KEY_ALT_C;
|
||||||
@@ -223,11 +209,6 @@ void enqueueInputEvent(int a1)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a1 == gPauseKeyCode) {
|
|
||||||
pauseGame();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (a1 == gScreenshotKeyCode) {
|
if (a1 == gScreenshotKeyCode) {
|
||||||
takeScreenshot();
|
takeScreenshot();
|
||||||
return;
|
return;
|
||||||
@@ -290,10 +271,6 @@ void inputEventQueueReset()
|
|||||||
// 0x4C8D1C
|
// 0x4C8D1C
|
||||||
void tickersExecute()
|
void tickersExecute()
|
||||||
{
|
{
|
||||||
if (gPaused) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gRunLoopDisabled) {
|
if (gRunLoopDisabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -363,74 +340,6 @@ void tickersDisable()
|
|||||||
gRunLoopDisabled = true;
|
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
|
// 0x4C8F4C
|
||||||
void takeScreenshot()
|
void takeScreenshot()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace fallout {
|
|||||||
|
|
||||||
typedef void(TickerProc)();
|
typedef void(TickerProc)();
|
||||||
|
|
||||||
typedef int(PauseHandler)();
|
|
||||||
typedef int(ScreenshotHandler)(int width, int height, unsigned char* buffer, unsigned char* palette);
|
typedef int(ScreenshotHandler)(int width, int height, unsigned char* buffer, unsigned char* palette);
|
||||||
|
|
||||||
int inputInit(int a1);
|
int inputInit(int a1);
|
||||||
@@ -20,7 +19,6 @@ void tickersAdd(TickerProc* fn);
|
|||||||
void tickersRemove(TickerProc* fn);
|
void tickersRemove(TickerProc* fn);
|
||||||
void tickersEnable();
|
void tickersEnable();
|
||||||
void tickersDisable();
|
void tickersDisable();
|
||||||
void pauseHandlerConfigure(int keyCode, PauseHandler* fn);
|
|
||||||
void takeScreenshot();
|
void takeScreenshot();
|
||||||
int screenshotHandlerDefaultImpl(int width, int height, unsigned char* data, unsigned char* palette);
|
int screenshotHandlerDefaultImpl(int width, int height, unsigned char* data, unsigned char* palette);
|
||||||
void screenshotHandlerConfigure(int keyCode, ScreenshotHandler* handler);
|
void screenshotHandlerConfigure(int keyCode, ScreenshotHandler* handler);
|
||||||
|
|||||||
Reference in New Issue
Block a user