Skip to content

Commit

Permalink
Main.cpp PPC SDL compat
Browse files Browse the repository at this point in the history
  • Loading branch information
jorio committed Sep 3, 2022
1 parent af467be commit 0c4f784
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ static void ParseCommandLine(int argc, char** argv)

static void Boot(const char* executablePath)
{
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);

// Start our "machine"
Pomme::Init();

Expand All @@ -151,7 +153,9 @@ static void Boot(const char* executablePath)

tryAgain:
// Set up GL attributes
#if !(__APPLE__ && __POWERPC__)
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
#endif
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
if (gGamePrefs.antialiasingLevel)
Expand All @@ -166,7 +170,11 @@ static void Boot(const char* executablePath)
float screenFillRatio = 2.0f / 3.0f;

SDL_Rect displayBounds = { .x = 0, .y = 0, .w = GAME_VIEW_WIDTH, .h = GAME_VIEW_HEIGHT };
#if SDL_VERSION_ATLEAST(2,0,5)
SDL_GetDisplayUsableBounds(display, &displayBounds);
#else
SDL_GetDisplayBounds(display, &displayBounds);
#endif
TQ3Vector2D fitted = FitRectKeepAR(GAME_VIEW_WIDTH, GAME_VIEW_HEIGHT, displayBounds.w, displayBounds.h);
int initialWidth = (int) (fitted.x * screenFillRatio);
int initialHeight = (int) (fitted.y * screenFillRatio);
Expand Down

0 comments on commit 0c4f784

Please sign in to comment.