mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 03:10:22 +00:00
SUPERNOVA: Adds init function to SupernovaEngine
This commit is contained in:
parent
26543be637
commit
32877639d7
@ -137,6 +137,25 @@ SupernovaEngine::~SupernovaEngine() {
|
||||
}
|
||||
|
||||
Common::Error SupernovaEngine::run() {
|
||||
init();
|
||||
|
||||
while (!shouldQuit()) {
|
||||
uint32 start = _system->getMillis();
|
||||
_gm->updateEvents();
|
||||
_gm->executeRoom();
|
||||
_console->onFrame();
|
||||
_system->updateScreen();
|
||||
int end = _delay - (_system->getMillis() - start);
|
||||
if (end > 0)
|
||||
_system->delayMillis(end);
|
||||
}
|
||||
|
||||
_mixer->stopAll();
|
||||
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
void SupernovaEngine::init() {
|
||||
Graphics::ModeList modes;
|
||||
modes.push_back(Graphics::Mode(320, 200));
|
||||
modes.push_back(Graphics::Mode(640, 480));
|
||||
@ -145,7 +164,7 @@ Common::Error SupernovaEngine::run() {
|
||||
|
||||
Common::Error status = loadGameStrings();
|
||||
if (status.getCode() != Common::kNoError)
|
||||
return status;
|
||||
error("Failed reading game strings");
|
||||
|
||||
initData();
|
||||
initPalette();
|
||||
@ -165,24 +184,8 @@ Common::Error SupernovaEngine::run() {
|
||||
if (loadGameState(saveSlot).getCode() != Common::kNoError)
|
||||
error("Failed to load save game from slot %i", saveSlot);
|
||||
}
|
||||
|
||||
while (!shouldQuit()) {
|
||||
uint32 start = _system->getMillis();
|
||||
_gm->updateEvents();
|
||||
_gm->executeRoom();
|
||||
_console->onFrame();
|
||||
_system->updateScreen();
|
||||
int end = _delay - (_system->getMillis() - start);
|
||||
if (end > 0)
|
||||
_system->delayMillis(end);
|
||||
}
|
||||
|
||||
_mixer->stopAll();
|
||||
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
|
||||
bool SupernovaEngine::hasFeature(EngineFeature f) const {
|
||||
switch (f) {
|
||||
case kSupportsRTL:
|
||||
|
@ -129,6 +129,7 @@ public:
|
||||
int textWidth(const char *text);
|
||||
int textWidth(const uint16 key);
|
||||
Common::Error loadGameStrings();
|
||||
void init();
|
||||
void initData();
|
||||
void initPalette();
|
||||
void paletteFadeIn();
|
||||
|
Loading…
Reference in New Issue
Block a user