diff options
author | Gregory Montoir | 2004-11-10 18:09:14 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-11-10 18:09:14 +0000 |
commit | 507d02d8d224a91fadec6914136c657a56e945fe (patch) | |
tree | 9ff588666bef445304f3444178c9a979e6eefdbd | |
parent | 695667d93432dbf34c7dbd3a344eb4f031e00933 (diff) | |
download | scummvm-rg350-507d02d8d224a91fadec6914136c657a56e945fe.tar.gz scummvm-rg350-507d02d8d224a91fadec6914136c657a56e945fe.tar.bz2 scummvm-rg350-507d02d8d224a91fadec6914136c657a56e945fe.zip |
get rid of the gameDataPath stuff as File::open already handles it
svn-id: r15781
-rw-r--r-- | kyra/kyra.cpp | 11 | ||||
-rw-r--r-- | kyra/resource.cpp | 31 | ||||
-rw-r--r-- | kyra/resource.h | 4 |
3 files changed, 9 insertions, 37 deletions
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp index b4f53a7fef..04304324fa 100644 --- a/kyra/kyra.cpp +++ b/kyra/kyra.cpp @@ -99,14 +99,12 @@ KyraEngine::KyraEngine(GameDetector *detector, OSystem *syst) _mixer->setVolume(ConfMan.getInt("sfx_volume") * ConfMan.getInt("master_volume") / 255); - //getGameDataPath(); - // Initialize backen syst->initSize(320, 200); - _screen = new uint8[320*200]; - memset((void*)_screen, 0, sizeof(_screen)); + _screen = new uint8[320 * 200]; + memset(_screen, 0, 320 * 200); - _resMgr = new Resourcemanager(this, getGameDataPath()); + _resMgr = new Resourcemanager(this); assert(_resMgr); setCurrentPalette(_resMgr->loadPalette("PALETTE.COL")); @@ -125,6 +123,7 @@ KyraEngine::KyraEngine(GameDetector *detector, OSystem *syst) KyraEngine::~KyraEngine() { delete _resMgr; + delete _screen; delete _mouse; delete _items; delete _npcScript; @@ -175,7 +174,7 @@ void KyraEngine::shutdown() { } void KyraEngine::updateScreen(void) { - _system->copyRectToScreen(_screen, 320, 0, 0, 320, 240); + _system->copyRectToScreen(_screen, 320, 0, 0, 320, 200); _system->updateScreen(); } diff --git a/kyra/resource.cpp b/kyra/resource.cpp index 00b2ede184..2a91654d38 100644 --- a/kyra/resource.cpp +++ b/kyra/resource.cpp @@ -27,8 +27,7 @@ #include "script.h" namespace Kyra { - Resourcemanager::Resourcemanager(KyraEngine* engine, const char* gamedir) { - _gameDir = gamedir; + Resourcemanager::Resourcemanager(KyraEngine* engine) { _engine = engine; // prefetches all PAK Files @@ -43,7 +42,7 @@ namespace Kyra { for (uint32 tmp = 0; kyraFilelist[tmp]; ++tmp) { // prefetch file - PAKFile* file = new PAKFile(getPath() + kyraFilelist[tmp]); + PAKFile* file = new PAKFile(kyraFilelist[tmp]); assert(file); if (file->isOpen() && file->isValid()) @@ -70,7 +69,7 @@ namespace Kyra { File file_; // test to open it in the main dir - if (file_.open((getPath() + file).c_str())) { + if (file_.open(file)) { *size = file_.size(); @@ -152,30 +151,6 @@ namespace Kyra { return context; } - Common::String Resourcemanager::getPath(void) { - assert(_gameDir); - int32 len = strlen(_gameDir); - - if(len < 1) - error("no valid gamedir"); - - // tests for an path seperator at the end - if (_gameDir[len - 1] == '\\') { - return string(_gameDir); - } else if (_gameDir[len - 1 ] == '/') { - return string(_gameDir); - } - - // creates a path seperator at the end - // we are always using the path seperator from the system - // even if Windows shoudl accept '/' -#ifdef WIN32 - return string(_gameDir) + "\\"; -#else - return string(_gameDir) + "/"; -#endif - } - /////////////////////////////////////////// // Pak file manager #define PAKFile_Iterate Common::List<PakChunk*>::iterator start=_files.begin();start != _files.end(); ++start diff --git a/kyra/resource.h b/kyra/resource.h index e867bdcf21..4aadd83b5a 100644 --- a/kyra/resource.h +++ b/kyra/resource.h @@ -70,7 +70,7 @@ namespace Kyra { public: - Resourcemanager(KyraEngine* engine, const char* gamedir); + Resourcemanager(KyraEngine* engine); virtual ~Resourcemanager(); uint8* fileData(const char* file, uint32* size); @@ -84,8 +84,6 @@ namespace Kyra { protected: KyraEngine* _engine; - string getPath(void); - const char* _gameDir; Common::List<PAKFile*> _pakfiles; }; |