[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.200,1.201 script_v5.cpp,1.236,1.237 scumm.h,1.395,1.396 sound.cpp,1.331,1.332
Max Horn
fingolfin at users.sourceforge.net
Sat Apr 17 09:30:09 CEST 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/common file.cpp,1.58,1.59 file.h,1.22,1.23 stream.h,1.1,1.2
- Next message: [Scummvm-cvs-logs] CVS: residual bitmap.cpp,1.24,1.25 bitmap.h,1.7,1.8 driver_gl.cpp,1.16,1.17 driver_gl.h,1.8,1.9 engine.cpp,1.30,1.31 material.cpp,1.7,1.8 material.h,1.3,1.4 model.cpp,1.17,1.18 model.h,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31340/scumm
Modified Files:
resource.cpp script_v5.cpp scumm.h sound.cpp
Log Message:
Removed XOR encoding stuff from File class; instead the new Scumm::XORFile class provides this functionality now
Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- resource.cpp 8 Apr 2004 11:48:35 -0000 1.200
+++ resource.cpp 17 Apr 2004 16:29:02 -0000 1.201
@@ -222,7 +222,8 @@
_fileHandle.close();
}
- _fileHandle.open(filename, getGameDataPath(), File::kFileReadMode, encByte);
+ _fileHandle.open(filename);
+ _fileHandle.setEnc(encByte);
return _fileHandle.isOpen();
}
@@ -888,6 +889,7 @@
240, 276, 340, 460,
600, 860, 1200, 1600
};
+
int ScummEngine::convert_extraflags(byte * ptr, byte * src_ptr) {
int flags = src_ptr[0];
Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -d -r1.236 -r1.237
--- script_v5.cpp 5 Apr 2004 23:56:28 -0000 1.236
+++ script_v5.cpp 17 Apr 2004 16:29:03 -0000 1.237
@@ -2684,7 +2684,7 @@
break;
case 15: // SO_TEXTSTRING
msg = _scriptPointer;
- _scriptPointer += resStrLen(_scriptPointer)+ 1;
+ _scriptPointer += resStrLen(_scriptPointer) + 1;
switch (textSlot) {
case 0:
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.395
retrieving revision 1.396
diff -u -d -r1.395 -r1.396
--- scumm.h 5 Apr 2004 23:54:58 -0000 1.395
+++ scumm.h 17 Apr 2004 16:29:03 -0000 1.396
@@ -60,6 +60,25 @@
typedef Common::Map<Common::String, int> ObjectIDMap;
+class XORFile : public File {
+private:
+ byte _encbyte;
+public:
+ XORFile() : _encbyte(0) {}
+ void setEnc(byte value) { _encbyte = value; }
+
+ uint32 read(void *ptr, uint32 len) {
+ uint32 realLen = File::read(ptr, len);
+ if (_encbyte) {
+ byte *p = (byte *)ptr;
+ byte *end = p + realLen;
+ while (p < end)
+ *p++ ^= _encbyte;
+ }
+ return realLen;
+ }
+};
+
// Use g_scumm from error() ONLY
extern ScummEngine *g_scumm;
@@ -599,7 +618,7 @@
void doSentence(int c, int b, int a);
/* Should be in Resource class */
- File _fileHandle;
+ XORFile _fileHandle;
uint32 _fileOffset;
int _resourceHeaderSize;
Common::String _gameName; // This is the name we use for opening resource files
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.331
retrieving revision 1.332
diff -u -d -r1.331 -r1.332
--- sound.cpp 17 Apr 2004 07:22:02 -0000 1.331
+++ sound.cpp 17 Apr 2004 16:29:03 -0000 1.332
@@ -892,7 +892,7 @@
File *Sound::openSfxFile() {
char buf[256];
- File *file = new File();
+ XORFile *file = new XORFile();
_offsetTable = NULL;
struct SoundFileExtensions {
@@ -935,7 +935,8 @@
if (!file->isOpen()) {
sprintf(buf, "%s.tlk", _vm->getGameName());
- file->open(buf, _vm->getGameDataPath(), File::kFileReadMode, 0x69);
+ file->open(buf);
+ file->setEnc(0x69);
_soundMode = kVOCMode;
} else if (_soundMode != kVOCMode) {
/* Now load the 'offset' index in memory to be able to find the MP3 data
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/common file.cpp,1.58,1.59 file.h,1.22,1.23 stream.h,1.1,1.2
- Next message: [Scummvm-cvs-logs] CVS: residual bitmap.cpp,1.24,1.25 bitmap.h,1.7,1.8 driver_gl.cpp,1.16,1.17 driver_gl.h,1.8,1.9 engine.cpp,1.30,1.31 material.cpp,1.7,1.8 material.h,1.3,1.4 model.cpp,1.17,1.18 model.h,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list