~ubuntu-branches/debian/jessie/scummvm/jessie

« back to all changes in this revision

Viewing changes to engines/mads/mads.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2014-08-10 00:50:36 UTC
  • mfrom: (1.2.22)
  • Revision ID: package-import@ubuntu.com-20140810005036-wls6i0dsxqfxu70g
Tags: 1.7.0+dfsg-1
* New upstream release [July 2014].
  - remove old/obsolete patches.
  + added new "drop1test.patch" to disable problematic test.
  + build with "--disable-eventrecorder" to avoid FTBFS in tests.
  + added "libjpeg-dev" and "libfaad-dev" to Build-Depends.
* Install all arch-independent files (themes, game data, etc.).
* Build-time re-compression of "classic" theme.
* Added "debian/gbp.conf".
* Standards-Version to 3.9.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ScummVM - Graphic Adventure Engine
 
2
 *
 
3
 * ScummVM is the legal property of its developers, whose names
 
4
 * are too numerous to list here. Please refer to the COPYRIGHT
 
5
 * file distributed with this source distribution.
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU General Public License
 
9
 * as published by the Free Software Foundation; either version 2
 
10
 * of the License, or (at your option) any later version.
 
11
 
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
20
 *
 
21
 */
 
22
 
 
23
#ifndef MADS_MADS_H
 
24
#define MADS_MADS_H
 
25
 
 
26
#include "common/scummsys.h"
 
27
#include "common/system.h"
 
28
#include "common/error.h"
 
29
#include "common/random.h"
 
30
#include "common/util.h"
 
31
#include "engines/engine.h"
 
32
#include "graphics/surface.h"
 
33
#include "mads/debugger.h"
 
34
#include "mads/dialogs.h"
 
35
#include "mads/events.h"
 
36
#include "mads/font.h"
 
37
#include "mads/game.h"
 
38
#include "mads/screen.h"
 
39
#include "mads/msurface.h"
 
40
#include "mads/resources.h"
 
41
#include "mads/sound.h"
 
42
 
 
43
/**
 
44
 * This is the namespace of the MADS engine.
 
45
 *
 
46
 * Status of this engine: In Development
 
47
 *
 
48
 * Games using this engine:
 
49
 * - Rex Nebular and the Cosmic Gender Bender
 
50
 */
 
51
namespace MADS {
 
52
 
 
53
#define DEBUG_BASIC 1
 
54
#define DEBUG_INTERMEDIATE 2
 
55
#define DEBUG_DETAILED 3
 
56
 
 
57
enum MADSDebugChannels {
 
58
        kDebugPath      = 1 << 0,
 
59
        kDebugScripts   = 1 << 1,
 
60
        kDebugGraphics  = 1 << 2
 
61
};
 
62
 
 
63
enum {
 
64
        GType_RexNebular = 0,
 
65
        GType_Dragonsphere = 1,
 
66
        GType_Phantom = 2
 
67
};
 
68
 
 
69
enum ScreenFade {
 
70
        SCREEN_FADE_SMOOTH = 0,
 
71
        SCREEN_FADE_MEDIUM = 1,
 
72
        SCREEN_FADE_FAST = 2
 
73
};
 
74
 
 
75
struct MADSGameDescription;
 
76
 
 
77
 
 
78
class MADSEngine : public Engine {
 
79
private:
 
80
        const MADSGameDescription *_gameDescription;
 
81
        Common::RandomSource _randomSource;
 
82
 
 
83
        /**
 
84
         * Handles basic initialisation
 
85
         */
 
86
        void initialize();
 
87
protected:
 
88
        // Engine APIs
 
89
        virtual Common::Error run();
 
90
        virtual bool hasFeature(EngineFeature f) const;
 
91
public:
 
92
        Debugger *_debugger;
 
93
        Dialogs *_dialogs;
 
94
        EventsManager *_events;
 
95
        Font *_font;
 
96
        Game *_game;
 
97
        Palette *_palette;
 
98
        Resources *_resources;
 
99
        ScreenSurface _screen;
 
100
        SoundManager *_sound;
 
101
        AudioPlayer *_audio;
 
102
        bool _easyMouse;
 
103
        bool _invObjectsAnimated;
 
104
        bool _textWindowStill;
 
105
        ScreenFade _screenFade;
 
106
        bool _musicFlag;
 
107
        bool _dithering;
 
108
public:
 
109
        MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc);
 
110
        virtual ~MADSEngine();
 
111
 
 
112
        uint32 getFeatures() const;
 
113
        Common::Language getLanguage() const;
 
114
        Common::Platform getPlatform() const;
 
115
        uint16 getVersion() const;
 
116
        uint32 getGameID() const;
 
117
        uint32 getGameFeatures() const;
 
118
 
 
119
        int getRandomNumber(int maxNumber);
 
120
        int getRandomNumber(int minNumber, int maxNumber);
 
121
        int hypotenuse(int xv, int yv);
 
122
 
 
123
        /**
 
124
        * Returns true if it is currently okay to restore a game
 
125
        */
 
126
        bool canLoadGameStateCurrently();
 
127
 
 
128
        /**
 
129
        * Returns true if it is currently okay to save the game
 
130
        */
 
131
        bool canSaveGameStateCurrently();
 
132
 
 
133
        /**
 
134
        * Support method that generates a savegame name
 
135
        * @param slot           Slot number
 
136
        */
 
137
        Common::String generateSaveName(int slot);
 
138
 
 
139
        /**
 
140
         * Handles loading a game via the GMM
 
141
         */
 
142
        virtual Common::Error loadGameState(int slot);
 
143
 
 
144
        /**
 
145
         * Handles saving the game via the GMM
 
146
         */
 
147
        virtual Common::Error saveGameState(int slot, const Common::String &desc);
 
148
};
 
149
 
 
150
} // End of namespace MADS
 
151
 
 
152
#endif /* MADS_MADS_H */