scummvm/engines/pegasus/pegasus.h

132 lines
3.5 KiB
C
Raw Normal View History

/* 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 PEGASUS_H
#define PEGASUS_H
2011-09-07 17:13:34 +00:00
#include "common/list.h"
#include "common/macresman.h"
#include "common/scummsys.h"
#include "common/system.h"
#include "common/rect.h"
#include "common/util.h"
#include "engines/engine.h"
#include "pegasus/graphics.h"
#include "pegasus/hotspot.h"
#include "pegasus/input.h"
#include "pegasus/notification.h"
#include "pegasus/items/inventory.h"
#include "pegasus/neighborhood/neighborhood.h"
namespace Video {
class QuickTimeDecoder;
}
namespace Pegasus {
2011-05-12 20:17:12 +00:00
class PegasusConsole;
struct PegasusGameDescription;
class SoundManager;
class GraphicsManager;
2011-09-07 17:13:34 +00:00
class Idler;
class Cursor;
class TimeBase;
class PegasusEngine : public ::Engine, public InputHandler, public NotificationManager {
friend class InputHandler;
public:
PegasusEngine(OSystem *syst, const PegasusGameDescription *gamedesc);
virtual ~PegasusEngine();
2011-09-16 13:20:41 +00:00
// Engine stuff
const PegasusGameDescription *_gameDescription;
bool hasFeature(EngineFeature f) const;
2011-05-12 20:17:12 +00:00
GUI::Debugger *getDebugger();
2011-09-16 13:20:41 +00:00
bool canLoadGameStateCurrently() { return _loadAllowed; }
bool canSaveGameStateCurrently() { return _saveAllowed; }
Common::Error loadGameState(int slot);
Common::Error saveGameState(int slot, const Common::String &desc);
// Base classes
GraphicsManager *_gfx;
Common::MacResManager *_resFork;
2011-09-16 13:20:41 +00:00
// Misc.
bool isDemo() const;
2011-09-07 17:13:34 +00:00
void addIdler(Idler *idler);
void removeIdler(Idler *idler);
void addTimeBase(TimeBase *timeBase);
void removeTimeBase(TimeBase *timeBase);
2011-09-16 13:20:41 +00:00
void swapSaveAllowed(bool allow) { _saveAllowed = allow; }
void swapLoadAllowed(bool allow) { _loadAllowed = allow; }
protected:
Common::Error run();
Cursor *_cursor;
Notification _shellNotification;
virtual void receiveNotification(Notification *notification, const tNotificationFlags flags);
private:
2011-05-12 20:17:12 +00:00
// Console
PegasusConsole *_console;
2011-09-21 01:57:34 +00:00
// Intro
void runIntro();
bool detectOpeningClosingDirectory();
Common::String _introDirectory;
2011-09-07 17:13:34 +00:00
// Idlers
Common::List<Idler *> _idlers;
void giveIdleTime();
2011-09-08 17:12:26 +00:00
// Items
void createItems();
void createItem(tItemID itemID, tNeighborhoodID neighborhoodID, tRoomID roomID, tDirectionConstant direction);
Inventory _items;
Inventory _biochips;
// TimeBases
Common::List<TimeBase *> _timeBases;
void checkCallBacks();
2011-09-16 13:20:41 +00:00
// Save/Load
bool loadFromStream(Common::ReadStream *stream);
bool writeToStream(Common::WriteStream *stream, int saveType);
void makeContinuePoint();
void loadFromContinuePoint();
Common::ReadStream *_continuePoint;
bool _saveAllowed, _loadAllowed; // It's so nice that this was in the original code already :P
// Misc.
Hotspot _returnHotspot;
2011-09-21 01:57:34 +00:00
void showLoadDialog();
};
} // End of namespace Pegasus
#endif