From dd5567613f4e733b62760c981cb547fe9656fced Mon Sep 17 00:00:00 2001 From: Benjamin Haisch Date: Mon, 11 Aug 2008 12:43:00 +0000 Subject: TOLTECS: - Renamed stuff and cleanups - Beginnings of the saveload system (incomplete) --- engines/toltecs/saveload.cpp | 114 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 engines/toltecs/saveload.cpp (limited to 'engines/toltecs/saveload.cpp') diff --git a/engines/toltecs/saveload.cpp b/engines/toltecs/saveload.cpp new file mode 100644 index 0000000000..52325b9ab3 --- /dev/null +++ b/engines/toltecs/saveload.cpp @@ -0,0 +1,114 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * + */ + +#include "common/events.h" +#include "common/keyboard.h" +#include "common/file.h" +#include "common/savefile.h" +#include "common/config-manager.h" + +#include "base/plugins.h" +#include "base/version.h" + +#include "sound/mixer.h" + +#include "toltecs/toltecs.h" +#include "toltecs/animation.h" +#include "toltecs/input.h" +#include "toltecs/palette.h" +#include "toltecs/resource.h" +#include "toltecs/script.h" +#include "toltecs/screen.h" +#include "toltecs/segmap.h" + +namespace Toltecs { + +// TODO: Saveload is not working yet + +void ToltecsEngine::savegame(const char *filename) { + + Common::OutSaveFile *out; + if (!(out = g_system->getSavefileManager()->openForSaving(filename))) { + warning("Can't create file '%s', game not saved", filename); + } + + // Save game variables + for (uint variable = 0; variable < 22; variable++) { + int16 value = _script->getGameVar(variable); + out->writeUint16LE(value); + } + + _palette->saveState(out); + _script->saveState(out); + _anim->saveState(out); + + // Save GUI + { + + } + +/* +case 0: return "mouseDisabled"; +case 1: return "mouseY"; +case 2: return "mouseX"; +case 3: return "mouseButton"; +case 4: return "verbLineY"; +case 5: return "verbLineX"; +case 6: return "verbLineWidth"; +case 7: return "verbLineCount"; +case 8: return "verbLineNum"; +case 9: return "talkTextItemNum"; +case 10: return "talkTextY"; +case 11: return "talkTextX"; +case 12: return "talkTextFontColor"; +case 13: return "cameraY"; +case 14: return "cameraX"; +case 15: return "walkSpeedY"; +case 16: return "walkSpeedX"; +case 17: return "flag01"; +case 18: return "sceneResIndex"; +case 19: return "cameraTop"; +case 20: return "sceneHeight"; +case 21: return "sceneWidth"; +*/ + +/* +PersistentGameVarRef +PersistentGameVarRef +PersistentGameVarRef +PersistentGameVarRef +PersistentGameVarRef +PersistentGameVarRef +PersistentGameVarRef +PersistentGameVarRef +*/ + + delete out; + +} + +void ToltecsEngine::loadgame(const char *filename) { +} + + +} // End of namespace Toltecs -- cgit v1.2.3