scummvm/engines/fullpipe/fullpipe.h

293 lines
6.6 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.
*
*/
2013-09-06 14:57:49 +03:00
#ifndef FULLPIPE_FULLPIPE_H
#define FULLPIPE_FULLPIPE_H
#include "common/scummsys.h"
#include "common/events.h"
#include "common/keyboard.h"
#include "common/random.h"
#include "common/savefile.h"
#include "common/system.h"
#include "audio/mixer.h"
#include "graphics/surface.h"
#include "engines/engine.h"
2013-12-07 00:16:56 +00:00
#include "gui/debugger.h"
#include "fullpipe/console.h"
struct ADGameDescription;
namespace Fullpipe {
enum FullpipeGameFeatures {
};
class BehaviorManager;
2013-09-18 19:26:02 +04:00
class BaseModalObject;
2013-09-18 19:39:14 +04:00
class GameLoader;
2013-09-18 19:37:07 +04:00
class GameVar;
class InputController;
class Inventory2;
struct CursorInfo;
struct EntranceInfo;
class ExCommand;
2013-11-19 18:53:17 -08:00
class Floaters;
class GameProject;
class GameObject;
class GlobalMessageQueueList;
struct MessageHandler;
2013-07-28 14:54:25 +03:00
struct MovTable;
class MGM;
2013-06-21 21:30:38 -04:00
class NGIArchive;
class PictureObject;
class Scene;
class SoundList;
class StaticANIObject;
2013-08-07 00:43:08 +03:00
class Vars;
int global_messageHandler1(ExCommand *cmd);
int global_messageHandler2(ExCommand *cmd);
int global_messageHandler3(ExCommand *cmd);
int global_messageHandler4(ExCommand *cmd);
void global_messageHandler_handleSound(ExCommand *cmd);
class FullpipeEngine : public ::Engine {
protected:
Common::Error run();
public:
FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc);
virtual ~FullpipeEngine();
2013-12-07 00:16:56 +00:00
Console *_console;
GUI::Debugger *getDebugger() { return _console; }
void initialize();
2013-07-28 14:54:25 +03:00
void setMusicAllowed(int val) { _musicAllowed = val; }
// Detection related functions
const ADGameDescription *_gameDescription;
const char *getGameId() const;
Common::Platform getPlatform() const;
bool hasFeature(EngineFeature f) const;
Common::RandomSource *_rnd;
Common::KeyCode _keyState;
uint16 _buttonState;
2013-06-19 14:46:25 -04:00
void updateEvents();
Graphics::Surface _backgroundSurface;
2013-09-18 19:39:14 +04:00
GameLoader *_gameLoader;
2013-06-20 16:39:05 -04:00
GameProject *_gameProject;
bool loadGam(const char *fname, int scene = 0);
2013-06-01 17:20:40 +03:00
2013-09-18 19:37:07 +04:00
GameVar *getGameLoaderGameVar();
InputController *getGameLoaderInputController();
2013-06-01 17:20:40 +03:00
int _gameProjectVersion;
int _pictureScale;
2013-06-01 17:20:40 +03:00
int _scrollSpeed;
bool _updateFlag;
bool _flgCanOpenMap;
bool _gamePaused;
bool _flgGameIsRunning;
bool _inputArFlag;
bool _recordEvents;
2013-07-20 01:00:26 +03:00
Common::Rect _sceneRect;
int _sceneWidth;
int _sceneHeight;
Scene *_currentScene;
Scene *_scene2;
StaticANIObject *_aniMan;
StaticANIObject *_aniMan2;
2013-08-07 20:52:23 +03:00
byte *_globalPalette;
InputController *_inputController;
bool _inputDisabled;
int _currentCheat;
int _currentCheatPos;
void defHandleKeyDown(int key);
SoundList *_currSoundList1[11];
int _currSoundListCount;
bool _soundEnabled;
bool _flgSoundList;
void stopAllSounds();
void toggleMute();
void playSound(int id, int flag);
void playTrack(GameVar *sceneVar, const char *name, bool delayed);
void startSceneTrack();
void stopSoundStream2();
void stopAllSoundStreams();
2013-12-14 17:38:14 +02:00
void stopAllSoundInstances(int id);
2013-08-07 00:43:08 +03:00
int _sfxVolume;
GlobalMessageQueueList *_globalMessageQueueList;
MessageHandler *_messageHandlers;
2013-07-20 01:00:26 +03:00
int _msgX;
int _msgY;
int _msgObjectId2;
int _msgId;
Common::List<ExCommand *> _exCommandList;
bool _isProcessingMessages;
int _mouseVirtX;
int _mouseVirtY;
Common::Point _mouseScreenPos;
BehaviorManager *_behaviorManager;
2013-07-28 14:54:25 +03:00
MovTable *_movTable;
2013-11-19 18:53:17 -08:00
Floaters *_floaters;
MGM *_mgm;
2013-11-19 18:53:17 -08:00
Common::Array<Common::Point *> _arcadeKeys;
2013-07-28 14:54:25 +03:00
void initMap();
void updateMapPiece(int mapId, int update);
void updateScreen();
2013-07-28 14:54:25 +03:00
void freeGameLoader();
2013-07-30 14:45:39 +03:00
void cleanup();
bool _gameContinue;
bool _needRestart;
2013-07-28 14:54:25 +03:00
bool _flgPlayIntro;
int _musicAllowed;
bool _normalSpeed;
void enableSaves() { _isSaveAllowed = true; }
void disableSaves(ExCommand *ex);
2013-06-19 14:46:25 -04:00
void initObjectStates();
void setLevelStates();
void setSwallowedEggsState();
void loadAllScenes();
2013-06-19 14:46:25 -04:00
2013-07-28 14:54:25 +03:00
void initCursors();
void addCursor(CursorInfo *cursorInfo, Scene *inv, int pictureId, int hotspotX, int hotspotY, int itemPictureOffsX, int itemPictureOffsY);
2013-07-28 14:54:25 +03:00
int32 _mapTable[200];
Scene *_inventoryScene;
Inventory2 *_inventory;
int _currSelectedInventoryItemId;
2013-06-20 15:26:21 -04:00
int32 _updateTicks;
int32 _lastInputTicks;
int32 _lastButtonUpTicks;
2013-09-18 19:26:02 +04:00
BaseModalObject *_modalObject;
int (*_updateScreenCallback)();
int (*_updateCursorCallback)();
int _cursorId;
int _minCursorId;
int _maxCursorId;
Common::Array<int> _objectIdCursors;
GameObject *_objectAtCursor;
int _objectIdAtCursor;
void setCursor(int id);
2013-11-04 00:28:13 +02:00
void updateCursorCommon();
2013-08-07 20:52:23 +03:00
int getObjectState(const char *objname);
2013-06-19 14:46:25 -04:00
void setObjectState(const char *name, int state);
int getObjectEnumState(const char *name, const char *state);
bool sceneSwitcher(EntranceInfo *entrance);
2013-06-20 16:39:05 -04:00
Scene *accessScene(int sceneId);
2013-09-18 19:37:07 +04:00
void setSceneMusicParameters(GameVar *var);
int convertScene(int scene);
int getSceneEntrance(int scene);
int getSceneFromTag(int tag);
2013-06-20 15:26:21 -04:00
2013-06-21 21:30:38 -04:00
NGIArchive *_currArchive;
void openMap();
void openHelp();
void openMainMenu();
PictureObject *_arcadeOverlay;
PictureObject *_arcadeOverlayHelper;
int _arcadeOverlayX;
int _arcadeOverlayY;
int _arcadeOverlayMidX;
int _arcadeOverlayMidY;
2013-11-21 07:44:52 -08:00
void initArcadeKeys(const char *varname);
void processArcade(ExCommand *ex);
void winArcade();
void setArcadeOverlay(int picId);
int drawArcadeOverlay(int adjust);
void getAllInventory();
int lift_getButtonIdP(int objid);
void lift_setButton(const char *name, int state);
2013-11-04 00:28:13 +02:00
void lift_sub5(Scene *sc, int qu1, int qu2);
2013-11-06 00:40:09 +02:00
void lift_exitSeq(ExCommand *ex);
void lift_closedoorSeq();
void lift_animation3();
void lift_goAnimation();
void lift_sub1(StaticANIObject *ani);
void lift_startExitQueue();
void lift_sub05(ExCommand *ex);
GameVar *_musicGameVar;
Audio::SoundHandle _sceneTrackHandle;
public:
bool _isSaveAllowed;
bool canLoadGameStateCurrently() { return _isSaveAllowed; }
bool canSaveGameStateCurrently() { return _isSaveAllowed; }
};
extern FullpipeEngine *g_fp;
2013-08-07 00:43:08 +03:00
extern Vars *g_vars;
2013-06-20 15:26:21 -04:00
} // End of namespace Fullpipe
2013-09-06 14:57:49 +03:00
#endif /* FULLPIPE_FULLPIPE_H */