-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdune.h
128 lines (105 loc) · 2.59 KB
/
dune.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/* 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 DUNE_H
#define DUNE_H
#include "dune/archive.h"
#include "dune/graphics.h"
#include "common/random.h"
#include "engines/advancedDetector.h"
#include "engines/engine.h"
#include "gui/debugger.h"
namespace Dune {
class HnmPlayer;
class SpriteSheet;
enum HNMVideos {
HNM_DFL2,
HNM_MNT1,
HNM_MNT2,
HNM_MNT3,
HNM_MNT4,
HNM_SIET,
HNM_PALACE,
HNM_PALACE2,
HNM_FORT,
HNM_FORT2,
HNM_DEAD3,
HNM_DEAD,
HNM_DEAD2,
HNM_VER,
HNM_TITLE,
HNM_MTG1,
HNM_MTG2,
HNM_MTG3,
HNM_PLANT,
HNM_CREDITS,
HNM_VIRGIN,
HNM_CRYO,
HNM_CRYO2,
HNM_PRESENT,
HNM_IRULAN,
HNM_SEQA,
HNM_SEQL,
HNM_SEQM,
HNM_SEQP,
HNM_SEQG,
HNM_SEQJ,
HNM_SEQK,
HNM_SEQI,
HNM_SEQD,
HNM_SEQN,
HNM_SEQR
};
class DuneEngine : public Engine {
public:
DuneEngine(OSystem *syst, const ADGameDescription *desc);
~DuneEngine() override;
Common::Error run() override;
bool isCD();
int _timerTicks;
Graphics _graphics;
byte *_framebuffer1;
byte *_framebuffer2;
byte *_screen;
int _screenBufferSize;
uint16 _currentBankId;
byte *_currentBankData;
void loadBank(uint16 index);
SpriteSheet *currentSpriteSheet = nullptr;
// private:
Common::RandomSource *_rnd;
const ADGameDescription *_gameDescription;
Archive _archive;
void dumpResource(const char *filename);
void runIntro();
HnmPlayer *_video;
void loadVideo(uint16 videoId);
void playVideo(uint16 videoId);
void dumpSAL(const char *fn);
void openSpriteSheet(const char *filename);
void drawSprite(int index, int x, int y, byte draw_flags);
void applyPalette(Common::ReadStream *reader);
void loadBank();
void loadResourceByIndex();
void applyPaletteBlock(Common::ReadStream *reader);
};
} // End of namespace Dune
#endif