aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/utils.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2016-09-18 00:02:11 +0200
committerEugene Sandulenko2016-09-18 00:16:29 +0200
commit83a82a98420423f2aa27b7e7eedce13b03ec34b2 (patch)
tree8788af30097d288e3ca79b7acf43a059093229e0 /engines/fullpipe/utils.cpp
parent973df9d2fda30e92e51de98482592333f4e229bd (diff)
downloadscummvm-rg350-83a82a98420423f2aa27b7e7eedce13b03ec34b2.tar.gz
scummvm-rg350-83a82a98420423f2aa27b7e7eedce13b03ec34b2.tar.bz2
scummvm-rg350-83a82a98420423f2aa27b7e7eedce13b03ec34b2.zip
FULLPIPE: Further work on saving
Diffstat (limited to 'engines/fullpipe/utils.cpp')
-rw-r--r--engines/fullpipe/utils.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index 32503764d3..fff2dad15b 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -109,6 +109,17 @@ char *MfcArchive::readPascalString(bool twoByte) {
return tmp;
}
+void MfcArchive::writePascalString(char *str, bool twoByte) {
+ int len = strlen(str);
+
+ if (twoByte)
+ writeUint16LE(len);
+ else
+ writeByte(len);
+
+ write(str, len);
+}
+
MemoryObject::MemoryObject() {
_memfilename = 0;
_mfield_8 = 0;
@@ -391,7 +402,9 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
debugC(7, kDebugLoading, "parseClass::obTag = %d (%04x) at 0x%08x", obTag, obTag, pos() - 2);
- if (obTag == 0xffff) {
+ if (obTag == 0x0000) {
+ return NULL;
+ } else if (obTag == 0xffff) {
int schema = readUint16LE();
debugC(7, kDebugLoading, "parseClass::schema = %d", schema);
@@ -446,6 +459,13 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
return res;
}
+void MfcArchive::writeObject(CObject *obj) {
+ if (obj == NULL)
+ writeUint16LE(0);
+ else
+ obj->save(*this);
+}
+
char *genFileName(int superId, int sceneId, const char *ext) {
char *s = (char *)calloc(256, 1);