Fix Exiting Native Android

This commit is contained in:
TheBrokenRail
2023-11-03 18:43:28 -04:00
committed by iProgramInCpp
parent 8d3abda2fe
commit 8823acecbd
2 changed files with 14 additions and 5 deletions

View File

@@ -445,21 +445,30 @@ void android_main(struct android_app* state) {
while ((ident = ALooper_pollAll(engine.animating ? 0 : -1, NULL, &events,
(void**)&source)) >= 0) {
if (source != NULL) {
if (source != NULL)
{
source->process(state, source);
}
if (state->destroyRequested != 0)
{
goto exit;
}
}
if (engine.animating)
{
if (engine.ninecraftApp->wantToQuit())
break;
engine.ninecraftApp->update();
eglSwapBuffers(engine.display, engine.surface);
if (engine.ninecraftApp->wantToQuit())
{
ANativeActivity_finish(state->activity);
}
}
}
exit:
engine.ninecraftApp->saveOptions();
delete engine.ninecraftApp;
}

View File

@@ -978,7 +978,7 @@ void Minecraft::sizeUpdate(int newWidth, int newHeight)
m_pScreen->setSize(int(Minecraft::width * Gui::InvGuiScale), int(Minecraft::height * Gui::InvGuiScale));
if (m_pInputHolder)
m_pInputHolder->setScreenSize(newWidth * guiScaleMultiplier, newHeight * guiScaleMultiplier);
m_pInputHolder->setScreenSize(Minecraft::width, Minecraft::height);
}
float Minecraft::getBestScaleForThisScreenSize(int width, int height)