mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-26 06:18:23 +00:00
ICB: Added return to launcher functionality
This commit is contained in:
parent
0a305db7ec
commit
22fb7015ff
@ -135,9 +135,15 @@ Common::KeymapArray IcbEngine::initKeymapsIcb(const char *target) {
|
||||
return Keymap::arrayOf(engineKeyMap);
|
||||
}
|
||||
|
||||
bool IcbEngine::hasFeature(EngineFeature f) const {
|
||||
return
|
||||
(f == kSupportsReturnToLauncher);
|
||||
}
|
||||
|
||||
// TODO: Refactor, this is currently implemented in p4_pc.cpp
|
||||
void InitEngine(const char *cmdLine);
|
||||
bool mainLoopIteration();
|
||||
void quitEngine();
|
||||
|
||||
Common::Error IcbEngine::run() {
|
||||
initGfx(false, false);
|
||||
@ -152,6 +158,10 @@ void IcbEngine::initGfx(bool hwAccel, bool fullscreen) {
|
||||
|
||||
void IcbEngine::mainLoop() {
|
||||
while (mainLoopIteration()) {
|
||||
if (shouldQuit()) {
|
||||
quitEngine();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,10 +42,11 @@ public:
|
||||
|
||||
Common::RandomSource *getRandomSource() { return _randomSource; }
|
||||
static Common::Array<Common::Keymap *> initKeymapsIcb(const char *target);
|
||||
bool hasFeature(EngineFeature f) const override;
|
||||
|
||||
protected:
|
||||
// Engine APIs
|
||||
virtual Common::Error run();
|
||||
virtual Common::Error run() override;
|
||||
|
||||
private:
|
||||
void initGfx(bool hwAccel, bool fullscreen);
|
||||
|
@ -262,6 +262,27 @@ void InitEngine(const char *lpCmdLine) {
|
||||
ReadConfigFromIniFile();
|
||||
}
|
||||
|
||||
void quitEngine() {
|
||||
Zdebug("\nap closed");
|
||||
Zdebug("Be Vigilant!\n");
|
||||
|
||||
if (g_mission)
|
||||
g_icb_mission->___delete_mission();
|
||||
|
||||
Close_Sound_Engine();
|
||||
|
||||
if (surface_manager)
|
||||
delete surface_manager;
|
||||
|
||||
Save_config_file(); // write user options ini file
|
||||
DestoryRevRenderDevice();
|
||||
|
||||
// Shutdown the runtime cluster manager
|
||||
g_theClusterManager->Shutdown();
|
||||
|
||||
DestroyGlobalObjects();
|
||||
}
|
||||
|
||||
bool mainLoopIteration() {
|
||||
Common::Event event;
|
||||
|
||||
@ -309,24 +330,7 @@ bool mainLoopIteration() {
|
||||
break;
|
||||
|
||||
case Common::EVENT_QUIT:
|
||||
Zdebug("\nap closed");
|
||||
Zdebug("Be Vigilant!\n");
|
||||
|
||||
if (g_mission)
|
||||
g_icb_mission->___delete_mission();
|
||||
|
||||
Close_Sound_Engine();
|
||||
|
||||
if (surface_manager)
|
||||
delete surface_manager;
|
||||
|
||||
Save_config_file(); // write user options ini file
|
||||
DestoryRevRenderDevice();
|
||||
|
||||
// Shutdown the runtime cluster manager
|
||||
g_theClusterManager->Shutdown();
|
||||
|
||||
DestroyGlobalObjects();
|
||||
quitEngine();
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user