diff options
author | Einar Johan Trøan Sømåen | 2012-03-13 18:07:41 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-02 12:42:08 +0200 |
commit | 84fd9d0daca1846829b077aa18a7634df5e5ef9e (patch) | |
tree | d227a02bcc4cf147040428e5d098fd70d0ee45d2 /engines/wintermute/BDiskFile.cpp | |
parent | a5d992d513cc21c643a09410fdccbe26cbd8592f (diff) | |
download | scummvm-rg350-84fd9d0daca1846829b077aa18a7634df5e5ef9e.tar.gz scummvm-rg350-84fd9d0daca1846829b077aa18a7634df5e5ef9e.tar.bz2 scummvm-rg350-84fd9d0daca1846829b077aa18a7634df5e5ef9e.zip |
WINTERMUTE: Add in the Particle-stuff, now everything links, and the AdGame-constructor starts.
Diffstat (limited to 'engines/wintermute/BDiskFile.cpp')
-rw-r--r-- | engines/wintermute/BDiskFile.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/engines/wintermute/BDiskFile.cpp b/engines/wintermute/BDiskFile.cpp index df2db0003d..ed735c846d 100644 --- a/engines/wintermute/BDiskFile.cpp +++ b/engines/wintermute/BDiskFile.cpp @@ -32,6 +32,7 @@ #include "BPkgFile.h"
#include "BDiskFile.h"
#include "common/stream.h"
+#include "common/file.h"
#include "BFileManager.h"
namespace WinterMute {
@@ -61,20 +62,37 @@ HRESULT CBDiskFile::Open(Common::String Filename) { sprintf(FullPath, "%s%s", Game->m_FileManager->m_SinglePaths[i], Filename.c_str());
CorrectSlashes(FullPath);
- error("Tried to open %s, TODO: add SearchMan-support", Filename.c_str());
//m_File = Common::createFileStream(FullPath);
- if (m_File != NULL)
+ Common::File *tempFile = new Common::File();
+ if(tempFile->open(FullPath)) {
+ m_File = tempFile;
+ } else {
+ delete tempFile;
+ }
+/* if (m_File != NULL) {
+ error("Tried to open %s, but failed", Filename.c_str());
break;
+ }*/
}
// if we didn't find it in search paths, try to open directly
if (!m_File) {
strcpy(FullPath, Filename.c_str());
CorrectSlashes(FullPath);
- error("Tried to open %s, TODO: add SearchMan-support", Filename.c_str());
+ //error("Tried to open %s, TODO: add SearchMan-support", Filename.c_str());
//m_File = Common::createFileStream(FullPath);
+ Common::File *tempFile = new Common::File();
+ if (tempFile->open(FullPath)) {
+ m_File = tempFile;
+ } else {
+ delete tempFile;
+ }
}
+ if (!m_File) {
+ warning("Couldn't load %s", Filename.c_str());
+ }
+
if (m_File) {
uint32 magic1, magic2;
magic1 = m_File->readUint32LE();
|