diff options
-rw-r--r-- | queen/queen.cpp | 13 | ||||
-rw-r--r-- | queen/resource.cpp | 5 |
2 files changed, 9 insertions, 9 deletions
diff --git a/queen/queen.cpp b/queen/queen.cpp index 038755043e..93f2e70e35 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -91,13 +91,6 @@ namespace Queen { QueenEngine::QueenEngine(GameDetector *detector, OSystem *syst) : Engine(syst) { - - if (!_mixer->isReady()) - warning("Sound initialisation failed."); - - _mixer->setVolume(ConfMan.getInt("sfx_volume")); - - _system->initSize(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT); } QueenEngine::~QueenEngine() { @@ -329,6 +322,8 @@ void QueenEngine::go() { } void QueenEngine::initialise(void) { + _system->initSize(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT); + _bam = new BamScene(this); _resource = new Resource(); _bankMan = new BankManager(_resource); @@ -347,6 +342,10 @@ void QueenEngine::initialise(void) { _logic = new LogicGame(this); } + if (!_mixer->isReady()) + warning("Sound initialisation failed."); + _mixer->setVolume(ConfMan.getInt("sfx_volume")); + int midiDriver = GameDetector::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE); MidiDriver *driver = GameDetector::createMidi(midiDriver); if (!driver) diff --git a/queen/resource.cpp b/queen/resource.cpp index 47e02dc89f..7e358c3461 100644 --- a/queen/resource.cpp +++ b/queen/resource.cpp @@ -70,10 +70,11 @@ Resource::~Resource() { } ResourceEntry *Resource::resourceEntry(const char *filename) const { + assert(filename[0] && strlen(filename) < 14); + char entryName[14]; char *ptr = entryName; - assert(strlen(filename)); strcpy(entryName, filename); do *ptr = toupper(*ptr); @@ -104,8 +105,8 @@ uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, uint32 *size, if (size != NULL) { *size = sz; } - byte *dstBuf; + byte *dstBuf; if (useMalloc) { dstBuf = (byte *)malloc(sz); } else { |