mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-08 14:58:13 +03:00
Windows: Implement reset menu command
A bit hacky but works.
This commit is contained in:
+7
-7
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user