1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-11-22 08:50:18 +01:00

Compare commits

..

No commits in common. "6c299ed103328295af743e8dcc4611db2cc90758" and "917b68d6304636ccfbf7aa52daa108d3e071ae96" have entirely different histories.

2 changed files with 13 additions and 19 deletions

View file

@ -77,10 +77,10 @@ Tested with: macOS Big Sur (Intel) with Xcode 13 & macOS Montery Beta (Apple Sil
* ~~Decompile original game~~ * ~~Decompile original game~~
* ~~Resizable window, scaled graphics~~ * ~~Resizable window, scaled graphics~~
* ~~Loader for high-res sprites from CADET.DAT~~ * ~~Loader for high-res sprites from CADET.DAT~~
* ~~Cross-platform port using SDL2, SDL2_mixer, ImGui~~
* Misc features of Full Tilt: 3 music tracks, multiball, centered textboxes, etc. * Misc features of Full Tilt: 3 music tracks, multiball, centered textboxes, etc.
* Maybe: Text translations * Cross-platform port
* Maybe: Android port * Using SDL2, SDL2_mixer, ImGui
* Maybe: Android port
* Maybe x2: support for other two tables * Maybe x2: support for other two tables
* Table specific BL (control interactions and missions) is hardcoded, othere parts might be also patched * Table specific BL (control interactions and missions) is hardcoded, othere parts might be also patched

View file

@ -37,7 +37,7 @@ bool winmain::LaunchBallEnabled = true;
bool winmain::HighScoresEnabled = true; bool winmain::HighScoresEnabled = true;
bool winmain::DemoActive = false; bool winmain::DemoActive = false;
char* winmain::BasePath; char* winmain::BasePath;
int winmain::MainMenuHeight = 0; int winmain::MainMenuHeight = 0;
std::string winmain::FpsDetails; std::string winmain::FpsDetails;
double winmain::UpdateToFrameRatio; double winmain::UpdateToFrameRatio;
winmain::DurationMs winmain::TargetFrameTime; winmain::DurationMs winmain::TargetFrameTime;
@ -88,25 +88,18 @@ int winmain::WinMain(LPCSTR lpCmdLine)
return 1; return 1;
} }
// If HW fails, fallback to SW SDL renderer. SDL_Renderer* renderer = SDL_CreateRenderer
SDL_Renderer* renderer = nullptr; (
for (int i = 0; i < 2 && !renderer; i++) window,
{ -1,
Renderer = renderer = SDL_CreateRenderer SDL_RENDERER_ACCELERATED
( );
window, Renderer = renderer;
-1,
i == 0 ? SDL_RENDERER_ACCELERATED : SDL_RENDERER_SOFTWARE
);
}
if (!renderer) if (!renderer)
{ {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Could not create renderer", SDL_GetError(), window); SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Could not create renderer", SDL_GetError(), window);
return 1; return 1;
} }
SDL_RendererInfo rendererInfo{};
if (!SDL_GetRendererInfo(renderer, &rendererInfo))
printf("Using SDL renderer: %s\n", rendererInfo.name);
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest");
@ -339,6 +332,7 @@ void winmain::RenderUi()
} }
ImGui::End(); ImGui::End();
ImGui::PopStyleVar(); ImGui::PopStyleVar();
return;
} }
// No demo window in release to save space // No demo window in release to save space
@ -347,7 +341,7 @@ void winmain::RenderUi()
ImGui::ShowDemoWindow(&ShowImGuiDemo); ImGui::ShowDemoWindow(&ShowImGuiDemo);
#endif #endif
if (Options.ShowMenu && ImGui::BeginMainMenuBar()) if (ImGui::BeginMainMenuBar())
{ {
int currentMenuHeight = static_cast<int>(ImGui::GetWindowSize().y); int currentMenuHeight = static_cast<int>(ImGui::GetWindowSize().y);
if (MainMenuHeight != currentMenuHeight) if (MainMenuHeight != currentMenuHeight)