aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/screen_manager.h
blob: 0fd6bfad8b6e708468f1035c3f17b213a623a4da (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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/* 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 TITANIC_SCREEN_MANAGER_H
#define TITANIC_SCREEN_MANAGER_H

#include "common/scummsys.h"
#include "common/array.h"
#include "titanic/direct_draw.h"
#include "titanic/font.h"
#include "titanic/input_handler.h"
#include "titanic/video_surface.h"
#include "titanic/core/resource_key.h"

namespace Titanic {

class TitanicEngine;

class CSurface {
};

class CScreenManagerRec {
public:
	int _field0;
	int _field4;
	int _field8;
	int _fieldC;
public:
	CScreenManagerRec();
};

struct MouseCursor {
	void show() {}
	void hide() {}
};

class CScreenManager {
protected:
	TitanicEngine *_vm;
public:
	static CScreenManager *_screenManagerPtr;
	static CScreenManager *_currentScreenManagerPtr;

	/**
	 * Set the current screen manager
	 */
	static CScreenManager *setCurrent();
public:
	Common::Array<CVideoSurface *> _backSurfaces;
	CVideoSurface *_frontRenderSurface;
	CScreenManagerRec _entries[2];
	MouseCursor *_mouseCursor;
	void *_textCursor;
	CInputHandler *_inputHandler;
	int _fontNumber;
public:
	CScreenManager(TitanicEngine *vm);
	virtual ~CScreenManager();

	void fn1() {}
	void fn2() {}



	virtual void setWindowHandle(int v);
	virtual bool resetWindowHandle(int v);
	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0;
	virtual void proc5() = 0;
	virtual void proc6() = 0;
	virtual void proc7() = 0;
	virtual void proc8() = 0;
	virtual void proc9() = 0;
	virtual void proc10() = 0;
	virtual void proc11() = 0;
	virtual void proc12() = 0;
	virtual void proc13() = 0;
	virtual void proc14() = 0;
	virtual void proc15() = 0;
	virtual void proc16() = 0;
	virtual void getFont() = 0;
	virtual void proc18() = 0;
	virtual void proc19() = 0;
	virtual void proc20() = 0;
	virtual void proc21() = 0;

	/**
	 * Creates a surface of a given size
	 */
	virtual CVideoSurface *createSurface(int w, int h) = 0;
	
	/**
	 * Creates a surface from a specified resource
	 */
	virtual CVideoSurface *createSurface(const CResourceKey &key) = 0;
	
	virtual void proc24() = 0;
	virtual void proc25() = 0;
	virtual void showCursor() = 0;
	virtual void proc27() = 0;
};

class OSScreenManager: CScreenManager {
private:
	DirectDrawManager _directDrawManager;

	/**
	 * Frees any surface buffers
	 */
	void destroyFrontAndBackBuffers();

	/**
	 * Load game cursors
	 */
	void loadCursors();
public:
	int _field48;
	int _field4C;
	int _field50;
	int _field54;
	STFont _fonts[4];
public:
	OSScreenManager(TitanicEngine *vm);
	virtual ~OSScreenManager();

	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2);
	virtual void proc5();
	virtual void proc6();
	virtual void proc7();
	virtual void proc8();
	virtual void proc9();
	virtual void proc10();
	virtual void proc11();
	virtual void proc12();
	virtual void proc13();
	virtual void proc14();
	virtual void proc15();
	virtual void proc16();
	virtual void getFont();
	virtual void proc18();
	virtual void proc19();
	virtual void proc20();
	virtual void proc21();

	/**
	 * Creates a surface of a given size
	 */
	virtual CVideoSurface *createSurface(int w, int h);
	
	/**
	 * Creates a surface from a specified resource
	 */
	virtual CVideoSurface *createSurface(const CResourceKey &key);

	virtual void proc23();
	virtual void proc24();
	virtual void proc25();
	virtual void showCursor();
	virtual void proc27();
};

} // End of namespace Titanic

#endif /* TITANIC_SCREEN_MANAGER_H */