[Scummvm-cvs-logs] CVS: scummvm/kyra kyra.cpp,1.5,1.6 resource.cpp,1.4,1.5 resource.h,1.2,1.3
Gregory Montoir
cyx at users.sourceforge.net
Wed Nov 10 10:10:01 CET 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.460,1.461
- Next message: [Scummvm-cvs-logs] CVS: scummvm/kyra kyra.cpp,1.6,1.7 script.cpp,1.5,1.6 script.h,1.1,1.2 script_v1.cpp,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/kyra
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20125/kyra
Modified Files:
kyra.cpp resource.cpp resource.h
Log Message:
get rid of the gameDataPath stuff as File::open already handles it
Index: kyra.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- kyra.cpp 16 Oct 2004 22:28:29 -0000 1.5
+++ kyra.cpp 10 Nov 2004 18:09:14 -0000 1.6
@@ -99,14 +99,12 @@
_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() {
delete _resMgr;
+ delete _screen;
delete _mouse;
delete _items;
delete _npcScript;
@@ -175,7 +174,7 @@
}
void KyraEngine::updateScreen(void) {
- _system->copyRectToScreen(_screen, 320, 0, 0, 320, 240);
+ _system->copyRectToScreen(_screen, 320, 0, 0, 320, 200);
_system->updateScreen();
}
Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/resource.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- resource.cpp 7 Nov 2004 16:24:40 -0000 1.4
+++ resource.cpp 10 Nov 2004 18:09:14 -0000 1.5
@@ -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 @@
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 @@
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 @@
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
Index: resource.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/resource.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- resource.h 15 Oct 2004 10:32:17 -0000 1.2
+++ resource.h 10 Nov 2004 18:09:14 -0000 1.3
@@ -70,7 +70,7 @@
public:
- Resourcemanager(KyraEngine* engine, const char* gamedir);
+ Resourcemanager(KyraEngine* engine);
virtual ~Resourcemanager();
uint8* fileData(const char* file, uint32* size);
@@ -84,8 +84,6 @@
protected:
KyraEngine* _engine;
- string getPath(void);
- const char* _gameDir;
Common::List<PAKFile*> _pakfiles;
};
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.460,1.461
- Next message: [Scummvm-cvs-logs] CVS: scummvm/kyra kyra.cpp,1.6,1.7 script.cpp,1.5,1.6 script.h,1.1,1.2 script_v1.cpp,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list