1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2025-09-03 23:20:14 +02:00
SpaceCadetPinball/SpaceCadetPinball/winmain.h
Gábor Dobra ada2776fb8 Don't resume game when paused manually
You get an annoying behavior when:
- press F3 to pause
- minimize the window
- (keep it in the background, do other stuff)
- bring the window back to focus, accidentally (Alt+Tab)
- game resumes even if I explicitly paused it with F3

This commit makes F3 (and Pause in the menu) require an explicit
resume via F3 (or Pause), other pauses like moving the window still
get resumed automatically.
2022-01-04 18:37:54 +01:00

40 lines
1.3 KiB
C++

#pragma once
#include "gdrv.h"
class winmain
{
public:
static const DWORD WndStyle = WS_GROUP | WS_SYSMENU | WS_DLGFRAME | WS_BORDER | WS_MAXIMIZE | WS_CLIPCHILDREN |
WS_THICKFRAME | WS_MAXIMIZEBOX;
static char DatFileName[300];
static int single_step;
static HINSTANCE hinst;
static HWND hwnd_frame;
static int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
static LRESULT CALLBACK message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
static void memalloc_failure();
static int ProcessWindowMessages();
static int check_expiration_date();
static HDC _GetDC(HWND hWnd);
static int a_dialog(HINSTANCE hInstance, HWND hWnd);
static void end_pause(bool explicitResume = false);
static void new_game();
static void pause(bool autoResume = true);
static void help_introduction(HINSTANCE a1, HWND a2);
static void Restart();
private:
static int return_value, bQuit, DispFrameRate, DispGRhistory, activated;
static int has_focus, mouse_down, last_mouse_x, last_mouse_y, no_time_loss;
static UINT iFrostUniqueMsg;
static gdrv_bitmap8 gfr_display;
static HCURSOR mouse_hsave;
static bool restart;
static bool explicitPaused;
static HDC _BeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
static void ResetTimer()
{
timeEndPeriod(1u);
}
};