diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/module.mk | 1 | ||||
-rw-r--r-- | engines/mads/phantom/game_phantom.cpp | 4 | ||||
-rw-r--r-- | engines/mads/phantom/game_phantom.h | 11 | ||||
-rw-r--r-- | engines/mads/phantom/globals_phantom.cpp | 49 | ||||
-rw-r--r-- | engines/mads/phantom/globals_phantom.h | 75 |
5 files changed, 129 insertions, 11 deletions
diff --git a/engines/mads/module.mk b/engines/mads/module.mk index 96353e9ae5..a9544944db 100644 --- a/engines/mads/module.mk +++ b/engines/mads/module.mk @@ -4,6 +4,7 @@ MODULE_OBJS := \ dragonsphere/game_dragonsphere.o \ dragonsphere/dragonsphere_scenes.o \ phantom/game_phantom.o \ + phantom/globals_phantom.o \ phantom/phantom_scenes.o \ nebular/dialogs_nebular.o \ nebular/game_nebular.o \ diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp index 0b2531ef65..2384b94dec 100644 --- a/engines/mads/phantom/game_phantom.cpp +++ b/engines/mads/phantom/game_phantom.cpp @@ -28,7 +28,7 @@ #include "mads/msurface.h" #include "mads/phantom/game_phantom.h" //#include "mads/nebular/dialogs_nebular.h" -//#include "mads/nebular/globals_nebular.h" +#include "mads/phantom/globals_phantom.h" #include "mads/phantom/phantom_scenes.h" namespace MADS { @@ -57,6 +57,8 @@ void GamePhantom::initializeGlobals() { _player._facing = FACING_NORTH; _player._turnToFacing = FACING_NORTH; + _globals[kCurrentYear] = 1993; + /* Section #1 variables */ // TODO diff --git a/engines/mads/phantom/game_phantom.h b/engines/mads/phantom/game_phantom.h index 99cc2c1230..654ec86ba3 100644 --- a/engines/mads/phantom/game_phantom.h +++ b/engines/mads/phantom/game_phantom.h @@ -26,7 +26,7 @@ #include "common/scummsys.h" #include "mads/game.h" #include "mads/globals.h" -//#include "mads/nebular/globals_nebular.h" +#include "mads/phantom/globals_phantom.h" namespace MADS { @@ -64,15 +64,6 @@ enum InventoryObject { OBJ_OAR = 24 }; -// HACK: A stub for now, remove from here once it's implemented properly -class PhantomGlobals : public Globals { -public: - PhantomGlobals() { - resize(210); // Rex has 210 globals - } - virtual ~PhantomGlobals() {} -}; - class GamePhantom : public Game { friend class Game; protected: diff --git a/engines/mads/phantom/globals_phantom.cpp b/engines/mads/phantom/globals_phantom.cpp new file mode 100644 index 0000000000..e0db0a1bb0 --- /dev/null +++ b/engines/mads/phantom/globals_phantom.cpp @@ -0,0 +1,49 @@ +/* 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/scummsys.h" +#include "common/config-manager.h" +#include "mads/phantom/globals_phantom.h" + +namespace MADS { + +namespace Phantom { + +PhantomGlobals::PhantomGlobals() + : Globals() { + // Initialize lists + resize(210); + _spriteIndexes.resize(30); + _sequenceIndexes.resize(30); +} + +void PhantomGlobals::synchronize(Common::Serializer &s) { + Globals::synchronize(s); + + _spriteIndexes.synchronize(s); + _sequenceIndexes.synchronize(s); +} + + +} // End of namespace Phantom + +} // End of namespace MADS diff --git a/engines/mads/phantom/globals_phantom.h b/engines/mads/phantom/globals_phantom.h new file mode 100644 index 0000000000..44d8c9e4bc --- /dev/null +++ b/engines/mads/phantom/globals_phantom.h @@ -0,0 +1,75 @@ +/* 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. + * + */ + +#ifndef MADS_GLOBALS_PHANTOM_H +#define MADS_GLOBALS_PHANTOM_H + +#include "common/scummsys.h" +#include "common/array.h" +#include "mads/game.h" +#include "mads/resources.h" + +namespace MADS { + +namespace Phantom { + +enum GlobalId { + kWalkerTiming = 0, +// kWalkerTiming0 = 1, + + kCurrentYear = 10, // current year (1881 or 1993) + + //kTalkInanimateCount = 4, + + /* Section #1 variables */ + + /* Section #2 variables */ + + /* Section #3 Variables */ + + /* Section #4 Variables */ + + /* Section #5 Variables */ + +}; + +class PhantomGlobals : public Globals { +public: + SynchronizedList _spriteIndexes; + SynchronizedList _sequenceIndexes; +public: + /** + * Constructor + */ + PhantomGlobals(); + + /** + * Synchronize the globals data + */ + virtual void synchronize(Common::Serializer &s); +}; + +} // End of namespace Phantom + +} // End of namespace MADS + +#endif /* MADS_GLOBALS_PHANTOM_H */ |