[Scummvm-cvs-logs] SF.net SVN: scummvm:[43560] scummvm/trunk/engines/gob/save/ saveload_playtoons.cpp
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Thu Aug 20 14:30:37 CEST 2009
Revision: 43560
http://scummvm.svn.sourceforge.net/scummvm/?rev=43560&view=rev
Author: strangerke
Date: 2009-08-20 12:30:37 +0000 (Thu, 20 Aug 2009)
Log Message:
-----------
modify props size to avoid later error (Size is still temporary) and prepare the magic number => constant modification
Modified Paths:
--------------
scummvm/trunk/engines/gob/save/saveload_playtoons.cpp
Modified: scummvm/trunk/engines/gob/save/saveload_playtoons.cpp
===================================================================
--- scummvm/trunk/engines/gob/save/saveload_playtoons.cpp 2009-08-20 12:07:54 UTC (rev 43559)
+++ scummvm/trunk/engines/gob/save/saveload_playtoons.cpp 2009-08-20 12:30:37 UTC (rev 43560)
@@ -31,26 +31,8 @@
SaveLoad_Playtoons::SaveFile SaveLoad_Playtoons::_saveFiles[] = {
{ "did.inf", kSaveModeSave, 0, 0}, //
- { "dan.itk", kSaveModeNone, 0, 0}, // Playtoons CK initial detection file
- { "disk.001", kSaveModeExists, 0, 0}, // Playtoons 1 identification file
- { "disk.002", kSaveModeExists, 0, 0}, // Playtoons 2 identification file
- { "disk.003", kSaveModeExists, 0, 0}, // Playtoons 3 identification file
- { "disk.004", kSaveModeExists, 0, 0}, // Playtoons 4 identification file
- { "disk.005", kSaveModeExists, 0, 0}, // Playtoons 5 identification file
- { "disk.006", kSaveModeExists, 0, 0}, // Playtoons CK 1 identification file
- { "disk.007", kSaveModeExists, 0, 0}, // Playtoons CK 2 identification file
- { "disk.008", kSaveModeExists, 0, 0}, // Playtoons CK 3 identification file
-/*
- { "titre.001", kSaveModeExists, 0, 0}, // Playtoons 1 titles
- { "titre.002", kSaveModeExists, 0, 0}, // Playtoons 2 titles
- { "titre.003", kSaveModeExists, 0, 0}, // Playtoons 3 titles
- { "titre.004", kSaveModeExists, 0, 0}, // Playtoons 4 titles
- { "titre.005", kSaveModeExists, 0, 0}, // Playtoons 5 titles
- { "titre.006", kSaveModeExists, 0, 0}, // Playtoons CK 1 empty title (???)
- { "titre.007", kSaveModeExists, 0, 0}, // Playtoons CK 2 empty title (???)
- { "titre.008", kSaveModeExists, 0, 0}, // Playtoons CK 3 empty title (???)
- { "mdo.def", kSaveModeExists, 0, 0}, //
-*/
+ { "dan.itk", kSaveModeNone, 0, 0}, // Playtoons CK detection file
+
};
SaveLoad_Playtoons::GameHandler::File::File(GobEngine *vm, const char *base) :
@@ -66,7 +48,7 @@
if (varSize == 0)
return -1;
- return ((offset - 2900) / varSize);
+ return ((offset - (1642 + 2400)) / varSize);
}
int SaveLoad_Playtoons::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -75,12 +57,12 @@
if (varSize == 0)
return -1;
- return ((offset - 2900) % varSize);
+ return ((offset - (1642 + 2400)) % varSize);
}
SaveLoad_Playtoons::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
- memset(_props, 0, 500);
+ memset(_props, 0, 1642);
memset(_index, 0, 2400);
_slotFile = new File(vm, target);
@@ -96,7 +78,7 @@
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 2900);
+ return _slotFile->tallyUpFiles(varSize, 1642 + 2400);
}
bool SaveLoad_Playtoons::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -111,17 +93,17 @@
size = varSize;
}
- if (offset < 500) {
+ if (offset < 1642) {
// Properties
- if ((offset + size) > 500) {
+ if ((offset + size) > 1642) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset < 2900) {
+ } else if (offset < 1642 + 2400) {
// Save index
if (size != 2400) {
@@ -198,17 +180,17 @@
size = varSize;
}
- if (offset < 500) {
+ if (offset < 1642) {
// Properties
- if ((offset + size) > 500) {
+ if ((offset + size) > 1642) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset < 2900) {
+ } else if (offset < 1642 + 2400) {
// Save index
if (size != 2400) {
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