mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2024-11-21 16:30:19 +01:00
Compare commits
3 commits
917b68d630
...
6c299ed103
Author | SHA1 | Date | |
---|---|---|---|
|
6c299ed103 | ||
|
fc1975a607 | ||
|
e61bbd634c |
2 changed files with 19 additions and 13 deletions
|
@ -77,10 +77,10 @@ Tested with: macOS Big Sur (Intel) with Xcode 13 & macOS Montery Beta (Apple Sil
|
|||
* ~~Decompile original game~~
|
||||
* ~~Resizable window, scaled graphics~~
|
||||
* ~~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.
|
||||
* Cross-platform port
|
||||
* Using SDL2, SDL2_mixer, ImGui
|
||||
* Maybe: Android port
|
||||
* Maybe: Text translations
|
||||
* Maybe: Android port
|
||||
* Maybe x2: support for other two tables
|
||||
* Table specific BL (control interactions and missions) is hardcoded, othere parts might be also patched
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ bool winmain::LaunchBallEnabled = true;
|
|||
bool winmain::HighScoresEnabled = true;
|
||||
bool winmain::DemoActive = false;
|
||||
char* winmain::BasePath;
|
||||
int winmain::MainMenuHeight = 0;
|
||||
int winmain::MainMenuHeight = 0;
|
||||
std::string winmain::FpsDetails;
|
||||
double winmain::UpdateToFrameRatio;
|
||||
winmain::DurationMs winmain::TargetFrameTime;
|
||||
|
@ -88,18 +88,25 @@ int winmain::WinMain(LPCSTR lpCmdLine)
|
|||
return 1;
|
||||
}
|
||||
|
||||
SDL_Renderer* renderer = SDL_CreateRenderer
|
||||
(
|
||||
window,
|
||||
-1,
|
||||
SDL_RENDERER_ACCELERATED
|
||||
);
|
||||
Renderer = renderer;
|
||||
// If HW fails, fallback to SW SDL renderer.
|
||||
SDL_Renderer* renderer = nullptr;
|
||||
for (int i = 0; i < 2 && !renderer; i++)
|
||||
{
|
||||
Renderer = renderer = SDL_CreateRenderer
|
||||
(
|
||||
window,
|
||||
-1,
|
||||
i == 0 ? SDL_RENDERER_ACCELERATED : SDL_RENDERER_SOFTWARE
|
||||
);
|
||||
}
|
||||
if (!renderer)
|
||||
{
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Could not create renderer", SDL_GetError(), window);
|
||||
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_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest");
|
||||
|
||||
|
@ -332,7 +339,6 @@ void winmain::RenderUi()
|
|||
}
|
||||
ImGui::End();
|
||||
ImGui::PopStyleVar();
|
||||
return;
|
||||
}
|
||||
|
||||
// No demo window in release to save space
|
||||
|
@ -341,7 +347,7 @@ void winmain::RenderUi()
|
|||
ImGui::ShowDemoWindow(&ShowImGuiDemo);
|
||||
#endif
|
||||
|
||||
if (ImGui::BeginMainMenuBar())
|
||||
if (Options.ShowMenu && ImGui::BeginMainMenuBar())
|
||||
{
|
||||
int currentMenuHeight = static_cast<int>(ImGui::GetWindowSize().y);
|
||||
if (MainMenuHeight != currentMenuHeight)
|
||||
|
|
Loading…
Reference in a new issue