From 8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 31 Mar 2022 23:41:46 +0200 Subject: Moved HINST and HWND from Game to GameWinDX9 --- Stars45/Game.cpp | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) (limited to 'Stars45/Game.cpp') diff --git a/Stars45/Game.cpp b/Stars45/Game.cpp index bd6484e..3b480cc 100644 --- a/Stars45/Game.cpp +++ b/Stars45/Game.cpp @@ -34,7 +34,6 @@ const double MAX_FRAME_TIME_NORMAL = 1.0 / 5.0; Game::Game() : world(0), video_factory(0), video(0), video_settings(0), soundcard(0), screen(0), totaltime(0), - hInst(0), hwnd(0), status(Game::OK), exit_code(0), window_style(0) { Clock::Init(); @@ -75,24 +74,6 @@ Game::~Game() // +--------------------------------------------------------------------+ -HINSTANCE Game::GetHINST() -{ - if (game) - return game->hInst; - - return 0; -} - -HWND Game::GetHWND() -{ - if (game) - return game->hwnd; - - return 0; -} - -// +--------------------------------------------------------------------+ - bool Game::Init(HINSTANCE hi, HINSTANCE hpi, LPSTR cmdline, int nCmdShow) { @@ -129,31 +110,12 @@ Game::InitGame() int Game::Run() { - MSG msg; - status = RUN; - Print("\n"); - Print("+====================================================================+\n"); - Print("| RUN |\n"); - Print("+====================================================================+\n"); - - // Polling messages from event queue until quit Clock::GetInstance()->Set(); while (status < EXIT && !Panic::Panicked()) { - if (PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE)) { - if (msg.message == WM_QUIT) - break; - - TranslateMessage(&msg); - DispatchMessage(&msg); - } - else { - if (GameLoop()) - WaitMessage(); - } + GameLoop(); } - - return exit_code ? exit_code : msg.wParam; + return exit_code; } // +--------------------------------------------------------------------+ -- cgit v1.1