diff options
author | Max Horn | 2002-09-13 18:04:17 +0000 |
---|---|---|
committer | Max Horn | 2002-09-13 18:04:17 +0000 |
commit | 316afec6ff9054b7cc33956d40032c2be9d623ae (patch) | |
tree | 6d30c0dc820ba1519c7819c15f8d2ef43d14a1a6 /scumm/smush | |
parent | f2da602963351a9acc9e0288c439789f9f7dfb3d (diff) | |
download | scummvm-rg350-316afec6ff9054b7cc33956d40032c2be9d623ae.tar.gz scummvm-rg350-316afec6ff9054b7cc33956d40032c2be9d623ae.tar.bz2 scummvm-rg350-316afec6ff9054b7cc33956d40032c2be9d623ae.zip |
some changes to allow me to play The Dig directly from CD (be nice if upper case names are used...)
svn-id: r4936
Diffstat (limited to 'scumm/smush')
-rw-r--r-- | scumm/smush/chunk.cpp | 3 | ||||
-rw-r--r-- | scumm/smush/player.cpp | 16 |
2 files changed, 10 insertions, 9 deletions
diff --git a/scumm/smush/chunk.cpp b/scumm/smush/chunk.cpp index f665c4db36..1c70919c01 100644 --- a/scumm/smush/chunk.cpp +++ b/scumm/smush/chunk.cpp @@ -23,6 +23,7 @@ #include "chunk.h" #include "common/engine.h" // for debug, warning, error +#include "common/file.h" #include <stdio.h> // for FILE, fopen, fclose, fseek and ftell #include <string.h> // for memcpy @@ -40,7 +41,7 @@ public: FilePtr(const char * fname) : _refcount(1), _curPos(0) { debug(9, "FilePtr created for %s", fname); _filename = strdup(fname); - _ifs = fopen(fname, "rb"); + _ifs = fopen_nocase(fname, "rb"); if(_ifs == NULL) error("FilePtr unable to read file \"%s\"", fname); } ~FilePtr() { diff --git a/scumm/smush/player.cpp b/scumm/smush/player.cpp index 829d4d9437..6e3091f5bf 100644 --- a/scumm/smush/player.cpp +++ b/scumm/smush/player.cpp @@ -20,6 +20,7 @@ */ #include <stdafx.h> +#include "common/file.h" #include "common/util.h" #include "common/engine.h" // for debug, warning, error @@ -614,19 +615,18 @@ void SmushPlayer::handleAnimHeader(Chunk & b) { } } +#define NEW_FILE 1 static StringResource * getStrings(const char * file, bool is_encoded) { debug(7, "trying to read text ressources from %s", file); - FILE * is; - is = fopen(file, "rb"); - if(is == NULL) return 0; - fseek(is, 0, SEEK_END); - int32 length = ftell(is); - fseek(is, 0, SEEK_SET); + File theFile; + theFile.open(file); + if (!theFile.isOpen()) + return 0; + int32 length = theFile.size(); char * filebuffer = new char [length + 1]; assert(filebuffer); - fread (filebuffer, length, 1, is); + theFile.read(filebuffer, length); filebuffer[length] = 0; - fclose(is); if(is_encoded) { static const int32 ETRS_HEADER_LENGTH = 16; assert(length > ETRS_HEADER_LENGTH); |