2011-02-20 07:31:34 +00:00
|
|
|
/* 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"
|
2011-02-20 07:31:34 +00:00
|
|
|
#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"
|
2011-09-20 15:49:20 +00:00
|
|
|
#include "pegasus/hotspot.h"
|
2011-09-09 03:04:28 +00:00
|
|
|
#include "pegasus/input.h"
|
2011-09-20 15:49:20 +00:00
|
|
|
#include "pegasus/notification.h"
|
|
|
|
#include "pegasus/items/inventory.h"
|
2011-09-01 16:54:00 +00:00
|
|
|
#include "pegasus/neighborhood/neighborhood.h"
|
2011-02-20 07:31:34 +00:00
|
|
|
|
2011-05-12 16:14:47 +00:00
|
|
|
namespace Video {
|
2011-09-20 18:19:54 +00:00
|
|
|
class QuickTimeDecoder;
|
2011-05-12 16:14:47 +00:00
|
|
|
}
|
|
|
|
|
2011-02-20 07:31:34 +00:00
|
|
|
namespace Pegasus {
|
|
|
|
|
2011-05-12 20:17:12 +00:00
|
|
|
class PegasusConsole;
|
2011-02-20 07:31:34 +00:00
|
|
|
struct PegasusGameDescription;
|
|
|
|
class SoundManager;
|
|
|
|
class GraphicsManager;
|
2011-09-07 17:13:34 +00:00
|
|
|
class Idler;
|
2011-09-09 00:38:12 +00:00
|
|
|
class Cursor;
|
2011-09-16 00:39:37 +00:00
|
|
|
class TimeBase;
|
2011-02-20 07:31:34 +00:00
|
|
|
|
2011-09-20 15:49:20 +00:00
|
|
|
class PegasusEngine : public ::Engine, public InputHandler, public NotificationManager {
|
2011-09-09 03:04:28 +00:00
|
|
|
friend class InputHandler;
|
2011-02-20 07:31:34 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
PegasusEngine(OSystem *syst, const PegasusGameDescription *gamedesc);
|
|
|
|
virtual ~PegasusEngine();
|
2011-09-16 13:20:41 +00:00
|
|
|
|
|
|
|
// Engine stuff
|
2011-02-20 07:31:34 +00:00
|
|
|
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
|
2011-02-20 07:31:34 +00:00
|
|
|
GraphicsManager *_gfx;
|
2011-09-20 18:19:54 +00:00
|
|
|
Common::MacResManager *_resFork;
|
2011-02-20 07:31:34 +00:00
|
|
|
|
2011-09-16 13:20:41 +00:00
|
|
|
// Misc.
|
2011-02-20 07:31:34 +00:00
|
|
|
bool isDemo() const;
|
2011-09-07 17:13:34 +00:00
|
|
|
void addIdler(Idler *idler);
|
|
|
|
void removeIdler(Idler *idler);
|
2011-09-16 00:39:37 +00:00
|
|
|
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; }
|
2011-09-16 00:39:37 +00:00
|
|
|
|
2011-09-09 03:04:28 +00:00
|
|
|
protected:
|
|
|
|
Common::Error run();
|
|
|
|
|
|
|
|
Cursor *_cursor;
|
|
|
|
|
2011-09-20 15:49:20 +00:00
|
|
|
Notification _shellNotification;
|
|
|
|
virtual void receiveNotification(Notification *notification, const tNotificationFlags flags);
|
|
|
|
|
2011-02-20 07:31:34 +00:00
|
|
|
private:
|
2011-05-12 20:17:12 +00:00
|
|
|
// Console
|
|
|
|
PegasusConsole *_console;
|
2011-05-13 01:30:09 +00:00
|
|
|
|
2011-09-21 01:57:34 +00:00
|
|
|
// Intro
|
|
|
|
void runIntro();
|
2011-05-13 01:30:09 +00:00
|
|
|
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);
|
2011-09-20 15:49:20 +00:00
|
|
|
Inventory _items;
|
|
|
|
Inventory _biochips;
|
2011-09-16 00:39:37 +00:00
|
|
|
|
|
|
|
// TimeBases
|
|
|
|
Common::List<TimeBase *> _timeBases;
|
2011-09-20 18:19:54 +00:00
|
|
|
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
|
2011-09-20 15:49:20 +00:00
|
|
|
|
|
|
|
// Misc.
|
|
|
|
Hotspot _returnHotspot;
|
2011-09-21 01:57:34 +00:00
|
|
|
void showLoadDialog();
|
2011-02-20 07:31:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Pegasus
|
|
|
|
|
|
|
|
#endif
|