aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/kyra_v3.h
blob: 6d476a066ad57e04c6ff8eae83db3b8dcdfc6bbb (plain)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* 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.
 *
 * $URL$
 * $Id$
 *
 */

#ifndef KYRA_KYRA_V3_H
#define KYRA_KYRA_V3_H

#include "kyra/kyra.h"
#include "kyra/screen_v3.h"

namespace Kyra {

class SoundDigital;
class Screen_v3;
class MainMenu;

class KyraEngine_v3 : public KyraEngine {
public:
	KyraEngine_v3(OSystem *system, const GameFlags &flags);
	~KyraEngine_v3();

	Screen *screen() { return _screen; }
	SoundDigital *soundDigital() { return _soundDigital; }

	int go();

	void playVQA(const char *name);

	virtual Movie *createWSAMovie();
private:
	int init();

	void preinit();
	void realInit();

	void setupOpcodeTable() {}

	Screen_v3 *_screen;
	SoundDigital *_soundDigital;

	// sound specific
private:
	void playMenuAudioFile();

	int _musicSoundChannel;
	const char *_menuAudioFile;

	static const char *_soundList[];
	static const int _soundListSize;

	int _curMusicTrack;

	void playMusicTrack(int track, int force);
	void stopMusicTrack();

	int musicUpdate(int forceRestart);

	void snd_playVoiceFile(int) {}

	// main menu
	void initMainMenu();
	void uninitMainMenu();

	Movie *_menuAnim;
	MainMenu *_menu;

	// game speed
	bool skipFlag() const { return false; }
	void resetSkipFlag(bool) {}

	// timer
	void setupTimers() {}
	void setWalkspeed(uint8) {}

	// pathfinder
	bool lineIsPassable(int, int) { return false; }

	// unknown
private:
	uint8 *_unkPage1;
	uint8 *_unkPage2;

	uint8 *_unkBuffer5;
	uint8 *_unkBuffer6;
	uint8 *_unkBuffer7;
	uint8 *_unkBuffer9;

	uint8 *_costpalData;

	uint8 *_unkWSAPtr;

	uint8 *_unkShapeTable[20];

	// main menu
	static const char *_mainMenuStrings[];

	// translation stuff
	uint8 *_scoreFile;
	uint8 *_cCodeFile;
	uint8 *_scenesList;

	// interface?
	uint8 *_interfaceCPS1;
	uint8 *_interfaceCPS2;

	// shapes
	uint8 *_gameShapes[50];

	uint8 *_mouseSHPBuf;

	// items
	uint8 *_itemBuffer1;
	uint8 *_itemBuffer2;

	uint8 *_itemList;

	void initItems();

	// resource specific
private:
	static const char *_languageExtension[];
	static const int _languageExtensionSize;

	int getMaxFileSize(const char *file);
	char *appendLanguage(char *buf, int lang, int bufSize);

	bool loadLanguageFile(const char *file, uint8 *&buffer);
};

} // end of namespace Kyra

#endif