Skip to content

Commit

Permalink
Merge pull request #7 from happymimimix/master
Browse files Browse the repository at this point in the history
Ensure the window size is divisable by 2!
  • Loading branch information
happymimimix authored Dec 15, 2024
2 parents 42d6315 + a8c0890 commit 6c23b55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ static pascal OSErr OpenEventHandlerProc(const AppleEvent *event, AppleEvent *,

#endif

static const int WindowWidth = round(static_cast<float>(Compatible::GetDisplayWidth()) / 1.5f);
static const int WindowHeight = round(static_cast<float>(Compatible::GetDisplayHeight()) / 1.5f);
int WindowWidth = round(static_cast<float>(Compatible::GetDisplayWidth()) / 1.5f);
int WindowHeight = round(static_cast<float>(Compatible::GetDisplayHeight()) / 1.5f);

GameStateManager state_manager(WindowWidth, WindowHeight);

const static wstring application_name = L"SFBM v1.5.2";
const static wstring application_name = L"SFBM v1.5.3";
const static std::wstring friendly_app_name = WSTRING(L"SFBM " + PianoGameVersionString);

const static wstring error_header1 = L"SFBM detected a";
Expand Down Expand Up @@ -101,7 +101,13 @@ int WINAPI WinMain (HINSTANCE instance, HINSTANCE, PSTR, int iCmdShow)
int main(int argc, char *argv[])
#endif
{

// Ensure the calculated window size is divisable by 2
if (WindowWidth % 2) {
WindowWidth++;
}
if (WindowHeight % 2) {
WindowHeight++;
}
#ifdef WIN32
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
#include <string>

// See readme.txt for a list of what has changed between versions
static const std::wstring PianoGameVersionString = L"v1.5.2";
static const std::wstring PianoGameVersionString = L"v1.5.3";

#endif

0 comments on commit 6c23b55

Please sign in to comment.