[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.94,2.95 resource_v2.cpp,1.16,1.17
James Brown
ender at users.sourceforge.net
Thu May 29 01:06:06 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv20743/scumm
Modified Files:
intern.h resource_v2.cpp
Log Message:
A few small V2 detection/init changes
Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.94
retrieving revision 2.95
diff -u -d -r2.94 -r2.95
--- intern.h 22 May 2003 22:42:44 -0000 2.94
+++ intern.h 29 May 2003 08:05:20 -0000 2.95
@@ -177,6 +177,8 @@
class Scumm_v2 : public Scumm_v3 {
protected:
void readIndexFile();
+ void readClassicIndexFile(); // V1
+ void readEnhancedIndexFile(); // V2
void loadCharset(int no);
void readMAXS();
Index: resource_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v2.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- resource_v2.cpp 18 May 2003 21:14:48 -0000 1.16
+++ resource_v2.cpp 29 May 2003 08:05:20 -0000 1.17
@@ -24,18 +24,11 @@
#include "intern.h"
#include "resource.h"
+void Scumm_v2::readClassicIndexFile() {
+ error("Classic non-blocked format not yet implemented");
+}
-void Scumm_v2::readIndexFile() {
- int magic = 0;
- debug(9, "readIndexFile()");
-
- closeRoom();
- openRoom(0);
-
- magic = _fileHandle.readUint16LE();
- if (magic != 0x0100)
- warning("The magic id doesn't match (0x%X)", magic);
-
+void Scumm_v2::readEnhancedIndexFile() {
_numGlobalObjects = _fileHandle.readUint16LE();
_fileHandle.seek(_numGlobalObjects, SEEK_CUR); // Skip object flags
_numRooms = _fileHandle.readByte();
@@ -68,6 +61,30 @@
readResTypeList(rtCostume, MKID('COST'), "costume");
readResTypeList(rtScript, MKID('SCRP'), "script");
readResTypeList(rtSound, MKID('SOUN'), "sound");
+}
+
+void Scumm_v2::readIndexFile() {
+ int magic = 0;
+ debug(9, "readIndexFile()");
+
+ closeRoom();
+ openRoom(0);
+
+ magic = _fileHandle.readUint16LE();
+
+ switch(magic) {
+ case 0x0100:
+ warning("Enhanced V2 game detected");
+ readEnhancedIndexFile();
+ break;
+ case 0x0A31:
+ warning("Classic V1 game detected");
+ readClassicIndexFile();
+ break;
+ default:
+ error("Unknown magic id (0x%X) - this version is unsupported", magic);
+ break;
+ }
closeRoom();
}
@@ -94,7 +111,6 @@
}
void Scumm_v2::loadCharset(int num) {
- warning("loadCharset(%d): Charset loading not yet implemented for V1/V2", num);
- // TODO: For the old games, the charset is actually encoded in the engine. So we must
- // rip it out of one of the .exes, and create a fake resource here.
+ // Stub, V2 font resources are hardcoded into the engine. Possibly do some
+ // kind of language detection here in the future for multiple fonts...
}
More information about the Scummvm-git-logs
mailing list