Windows: Implement reset menu command

A bit hacky but works.
This commit is contained in:
kichikuou
2020-10-10 15:26:01 +09:00
parent da53cda5ab
commit 9637701340
5 changed files with 16 additions and 10 deletions
+7 -7
View File
@@ -93,16 +93,16 @@ int main(int argc, char *argv[])
EM_ASM( xsystem35.shell.windowSizeChanged(); );
#endif
nact->mainloop();
bool restart = true;
while (restart) {
restart = nact->mainloop();
delete nact;
if (restart)
nact = NACT::create(game_id, font_file, playlist);
}
SDL_DestroyWindow(g_window);
SDL_Quit();
// system3 開放
delete nact;
// MCI 開放
//release_mci();
return 0;
}
+3
View File
@@ -372,6 +372,9 @@ AGS::~AGS()
}
SDL_FreeSurface(hBmpDest);
SDL_DestroyTexture(sdlTexture);
SDL_DestroyRenderer(sdlRenderer);
}
void AGS::set_palette(int index, int r, int g, int b)
+3 -1
View File
@@ -96,6 +96,7 @@ NACT::NACT(int sys_ver, uint32 crc32_a, uint32 crc32_b, const char* font_file, c
#endif
terminate = false;
restart_after_terminate = false;
}
NACT::~NACT()
@@ -116,7 +117,7 @@ NACT::~NACT()
platform_finalize();
}
void NACT::mainloop()
bool NACT::mainloop()
{
int sleep_cnt = 0;
@@ -127,6 +128,7 @@ void NACT::mainloop()
SDL_Delay(10);
}
}
return restart_after_terminate;
}
// コマンドパーサ
+2 -1
View File
@@ -229,13 +229,14 @@ protected:
// 終了フラグ
bool terminate;
bool restart_after_terminate;
// Platform-specific setup / cleanup code
void platform_initialize();
void platform_finalize();
public:
void mainloop();
bool mainloop();
int get_screen_height();
+1 -1
View File
@@ -134,7 +134,7 @@ void NACT::on_syswmevent(SDL_SysWMmsg* msg)
case WM_COMMAND:
switch (msg->msg.win.wParam) {
case ID_RESTART:
// TODO: Implement
terminate = restart_after_terminate = true;
break;
case ID_EXIT:
terminate = true;