[Scummvm-cvs-logs] SF.net SVN: scummvm: [25847] scummvm/trunk/engines/scumm
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Sun Feb 25 08:26:42 CET 2007
Revision: 25847
http://scummvm.svn.sourceforge.net/scummvm/?rev=25847&view=rev
Author: kirben
Date: 2007-02-24 23:26:41 -0800 (Sat, 24 Feb 2007)
Log Message:
-----------
Rename file class, since it is been used for disk images of Apple II and Commodore 64 versions now.
Modified Paths:
--------------
scummvm/trunk/engines/scumm/file.cpp
scummvm/trunk/engines/scumm/file.h
scummvm/trunk/engines/scumm/scumm.cpp
Modified: scummvm/trunk/engines/scumm/file.cpp
===================================================================
--- scummvm/trunk/engines/scumm/file.cpp 2007-02-25 07:23:52 UTC (rev 25846)
+++ scummvm/trunk/engines/scumm/file.cpp 2007-02-25 07:26:41 UTC (rev 25847)
@@ -1461,7 +1461,7 @@
}
#pragma mark -
-#pragma mark --- ScummC64File ---
+#pragma mark --- ScummDiskImage ---
#pragma mark -
static const int maniacResourcesPerFile[55] = {
@@ -1483,7 +1483,7 @@
};
-ScummC64File::ScummC64File(const char *disk1, const char *disk2, GameSettings game) : _stream(0), _buf(0) {
+ScummDiskImage::ScummDiskImage(const char *disk1, const char *disk2, GameSettings game) : _stream(0), _buf(0) {
_disk1 = disk1;
_disk2 = disk2;
_game = game;
@@ -1507,28 +1507,28 @@
}
}
-uint32 ScummC64File::write(const void *, uint32) {
- error("ScummC64File does not support writing!");
+uint32 ScummDiskImage::write(const void *, uint32) {
+ error("ScummDiskImage does not support writing!");
return 0;
}
-void ScummC64File::setEnc(byte enc) {
+void ScummDiskImage::setEnc(byte enc) {
_stream->setEnc(enc);
}
-byte ScummC64File::fileReadByte() {
+byte ScummDiskImage::fileReadByte() {
byte b = 0;
File::read(&b, 1);
return b;
}
-uint16 ScummC64File::fileReadUint16LE() {
+uint16 ScummDiskImage::fileReadUint16LE() {
uint16 a = fileReadByte();
uint16 b = fileReadByte();
return a | (b << 8);
}
-bool ScummC64File::openDisk(char num) {
+bool ScummDiskImage::openDisk(char num) {
if (num == '1')
num = 1;
if (num == '2')
@@ -1543,21 +1543,21 @@
else if (num == 2)
File::open(_disk2.c_str());
else {
- error("ScummC64File::open(): wrong disk (%c)", num);
+ error("ScummDiskImage::open(): wrong disk (%c)", num);
return false;
}
_openedDisk = num;
if (!File::isOpen()) {
- error("ScummC64File::open(): cannot open disk (%d)", num);
+ error("ScummDiskImage::open(): cannot open disk (%d)", num);
return false;
}
}
return true;
}
-bool ScummC64File::open(const Common::String &filename, AccessMode mode) {
+bool ScummDiskImage::open(const Common::String &filename, AccessMode mode) {
uint16 signature;
// check signature
@@ -1571,7 +1571,7 @@
signature = fileReadUint16LE();
if (signature != 0x0A31) {
- error("ScummC64File::open(): signature not found in disk 1!");
+ error("ScummDiskImage::open(): signature not found in disk 1!");
return false;
}
@@ -1596,7 +1596,7 @@
}
-uint16 ScummC64File::extractIndex(Common::WriteStream *out) {
+uint16 ScummDiskImage::extractIndex(Common::WriteStream *out) {
int i;
uint16 reslen = 0;
@@ -1651,7 +1651,7 @@
return reslen;
}
-bool ScummC64File::generateIndex() {
+bool ScummDiskImage::generateIndex() {
int bufsize;
bufsize = extractIndex(0);
@@ -1671,7 +1671,7 @@
return true;
}
-uint16 ScummC64File::extractResource(Common::WriteStream *out, int res) {
+uint16 ScummDiskImage::extractResource(Common::WriteStream *out, int res) {
const int AppleSectorOffset[36] = {
0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256,
272, 288, 304, 320, 336, 352, 368,
@@ -1707,7 +1707,7 @@
return reslen;
}
-bool ScummC64File::generateResource(int res) {
+bool ScummDiskImage::generateResource(int res) {
int bufsize;
if (res >= _numRooms)
@@ -1730,7 +1730,7 @@
return true;
}
-void ScummC64File::close() {
+void ScummDiskImage::close() {
if (_stream)
delete _stream;
_stream = 0;
@@ -1741,7 +1741,7 @@
File::close();
}
-bool ScummC64File::openSubFile(const Common::String &filename) {
+bool ScummDiskImage::openSubFile(const Common::String &filename) {
assert(isOpen());
const char *ext = strrchr(filename.c_str(), '.');
Modified: scummvm/trunk/engines/scumm/file.h
===================================================================
--- scummvm/trunk/engines/scumm/file.h 2007-02-25 07:23:52 UTC (rev 25846)
+++ scummvm/trunk/engines/scumm/file.h 2007-02-25 07:26:41 UTC (rev 25847)
@@ -111,7 +111,7 @@
};
-class ScummC64File : public BaseScummFile {
+class ScummDiskImage : public BaseScummFile {
private:
Common::MemoryReadStream *_stream;
byte _roomDisks[59], _roomTracks[59], _roomSectors[59];
@@ -142,7 +142,7 @@
uint16 fileReadUint16LE();
public:
- ScummC64File(const char *disk1, const char *disk2, GameSettings game);
+ ScummDiskImage(const char *disk1, const char *disk2, GameSettings game);
void setEnc(byte value);
bool open(const Common::String &filename, AccessMode mode = kFileReadMode);
Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp 2007-02-25 07:23:52 UTC (rev 25846)
+++ scummvm/trunk/engines/scumm/scumm.cpp 2007-02-25 07:26:41 UTC (rev 25847)
@@ -988,7 +988,7 @@
tmpBuf1 = "maniac1.dsk";
tmpBuf2 = "maniac2.dsk";
- _fileHandle = new ScummC64File(tmpBuf1, tmpBuf2, _game);
+ _fileHandle = new ScummDiskImage(tmpBuf1, tmpBuf2, _game);
_containerFile = tmpBuf1;
_filenamePattern.pattern = "%.2d.LFL";
@@ -1005,7 +1005,7 @@
tmpBuf2 = "zak2.d64";
}
- _fileHandle = new ScummC64File(tmpBuf1, tmpBuf2, _game);
+ _fileHandle = new ScummDiskImage(tmpBuf1, tmpBuf2, _game);
_containerFile = tmpBuf1;
_filenamePattern.pattern = "%.2d.LFL";
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