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/GameWinDX9.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'Stars45/GameWinDX9.cpp') diff --git a/Stars45/GameWinDX9.cpp b/Stars45/GameWinDX9.cpp index 5414027..5d04c97 100644 --- a/Stars45/GameWinDX9.cpp +++ b/Stars45/GameWinDX9.cpp @@ -10,6 +10,7 @@ #include #include "Bitmap.h" +#include "Clock.h" #include "Color.h" #include "DataLoader.h" #include "Game.h" @@ -35,6 +36,8 @@ GameWinDX9::GetInstance() GameWinDX9::GameWinDX9() : max_tex_size {2048}, screen_color {Color::Black}, + hInst{nullptr}, + hwnd{nullptr}, is_windowed {false}, is_active {false}, is_device_lost {false}, @@ -554,6 +557,29 @@ GameWinDX9::LoadPalette(PALETTEENTRY* pal, BYTE* inv) int +GameWinDX9::Run() +{ + MSG msg; + status = RUN; + 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(); + } + } + return exit_code ? exit_code : msg.wParam; +} + + +int GameWinDX9::MaxTexSize() const { if (video) { @@ -605,6 +631,20 @@ GameWinDX9::GetScreenHeight() const } +HINSTANCE +GameWinDX9::GetHINST() +{ + return hInst; +} + + +HWND +GameWinDX9::GetHWND() +{ + return hwnd; +} + + void GameWinDX9::SetMaxTexSize(int n) { -- cgit v1.1