[Scummvm-cvs-logs] SF.net SVN: scummvm: [25827] scummvm/trunk/engines/scumm
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat Feb 24 20:20:16 CET 2007
Revision: 25827
http://scummvm.svn.sourceforge.net/scummvm/?rev=25827&view=rev
Author: fingolfin
Date: 2007-02-24 11:20:15 -0800 (Sat, 24 Feb 2007)
Log Message:
-----------
SCUMM: cleanup (moved small header specific code from ScummEngine::readResTypeList to ScummEngine_v4::readResTypeList)
Modified Paths:
--------------
scummvm/trunk/engines/scumm/intern.h
scummvm/trunk/engines/scumm/resource.cpp
scummvm/trunk/engines/scumm/resource_v4.cpp
Modified: scummvm/trunk/engines/scumm/intern.h
===================================================================
--- scummvm/trunk/engines/scumm/intern.h 2007-02-24 19:15:10 UTC (rev 25826)
+++ scummvm/trunk/engines/scumm/intern.h 2007-02-24 19:20:15 UTC (rev 25827)
@@ -214,6 +214,7 @@
virtual void resetScumm();
protected:
+ virtual void readResTypeList(int id, const char *name);
virtual void readIndexFile();
virtual void loadCharset(int no);
virtual void resetRoomObjects();
Modified: scummvm/trunk/engines/scumm/resource.cpp
===================================================================
--- scummvm/trunk/engines/scumm/resource.cpp 2007-02-24 19:15:10 UTC (rev 25826)
+++ scummvm/trunk/engines/scumm/resource.cpp 2007-02-24 19:20:15 UTC (rev 25827)
@@ -512,26 +512,19 @@
error("Invalid number of %ss (%d) in directory", name, num);
}
- if (_game.features & GF_SMALL_HEADER) {
- for (i = 0; i < num; i++) {
- _res->roomno[id][i] = _fileHandle->readByte();
- _res->roomoffs[id][i] = _fileHandle->readUint32LE();
- }
- } else {
- for (i = 0; i < num; i++) {
- _res->roomno[id][i] = _fileHandle->readByte();
- }
- for (i = 0; i < num; i++) {
- _res->roomoffs[id][i] = _fileHandle->readUint32LE();
+ for (i = 0; i < num; i++) {
+ _res->roomno[id][i] = _fileHandle->readByte();
+ }
+ for (i = 0; i < num; i++) {
+ _res->roomoffs[id][i] = _fileHandle->readUint32LE();
- if (id == rtRoom && _game.heversion >= 70)
- _heV7RoomIntOffsets[i] = _res->roomoffs[id][i];
- }
+ if (id == rtRoom && _game.heversion >= 70)
+ _heV7RoomIntOffsets[i] = _res->roomoffs[id][i];
+ }
- if (_game.heversion >= 70) {
- for (i = 0; i < num; i++) {
- _res->globsize[id][i] = _fileHandle->readUint32LE();
- }
+ if (_game.heversion >= 70) {
+ for (i = 0; i < num; i++) {
+ _res->globsize[id][i] = _fileHandle->readUint32LE();
}
}
}
Modified: scummvm/trunk/engines/scumm/resource_v4.cpp
===================================================================
--- scummvm/trunk/engines/scumm/resource_v4.cpp 2007-02-24 19:15:10 UTC (rev 25826)
+++ scummvm/trunk/engines/scumm/resource_v4.cpp 2007-02-24 19:20:15 UTC (rev 25827)
@@ -30,6 +30,26 @@
namespace Scumm {
+extern const char *resTypeFromId(int id);
+
+void ScummEngine_v4::readResTypeList(int id, const char *name) {
+ int num;
+ int i;
+
+ debug(9, "readResTypeList(%s,%s)", resTypeFromId(id), name);
+
+ num = _fileHandle->readUint16LE();
+
+ if (num != _res->num[id]) {
+ error("Invalid number of %ss (%d) in directory", name, num);
+ }
+
+ for (i = 0; i < num; i++) {
+ _res->roomno[id][i] = _fileHandle->readByte();
+ _res->roomoffs[id][i] = _fileHandle->readUint32LE();
+ }
+}
+
void ScummEngine_v4::readIndexFile() {
uint16 blocktype;
uint32 itemsize;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list