aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/gui32.h
blob: e57c972af7e558bec8a593fd20c5cce30f9a1885 (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
/* 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 SCI_GRAPHICS_GUI32_H
#define SCI_GRAPHICS_GUI32_H

#include "sci/graphics/helpers.h"

namespace Sci {

class Screen;
class SciPalette;
class Cursor;
class GfxCache;
class GfxCompare;
class Text;

class SciGui32 {
public:
	SciGui32(EngineState *s, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, Cursor *cursor);
	~SciGui32();

	void init();

	void textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight);

	void shakeScreen(uint16 shakeCount, uint16 directions);

	uint16 onControl(byte screenMask, Common::Rect rect);
	void setNowSeen(reg_t objectReference);
	bool canBeHere(reg_t curObject, reg_t listReference);
	bool isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position);
	void baseSetter(reg_t object);

	void hideCursor();
	void showCursor();
	bool isCursorVisible();
	void setCursorShape(GuiResourceId cursorId);
	void setCursorView(GuiResourceId viewNum, int loopNum, int cellNum, Common::Point *hotspot);
	void setCursorPos(Common::Point pos);
	Common::Point getCursorPos();
	void moveCursor(Common::Point pos);
	void setCursorZone(Common::Rect zone);

	void addScreenItem(reg_t object);
	void deleteScreenItem(reg_t object);
	void addPlane(reg_t object);
	void updatePlane(reg_t object);
	void deletePlane(reg_t object);
	byte getHighPlanePri() { return _highPlanePri; }
	void frameOut();
	void globalToLocal(int16 *x, int16 *y, reg_t planeObj);
	void localToGlobal(int16 *x, int16 *y, reg_t planeObj);

	void drawRobot(GuiResourceId robotId);

	bool debugShowMap(int mapNo);

	// FIXME: Don't store EngineState
	void resetEngineState(EngineState *s);

protected:
	Cursor *_cursor;
	EngineState *_s;
	GfxScreen *_screen;
	GfxPalette *_palette;
	GfxCache *_cache;
	GfxCompare *_compare;

private:
	Common::Array<reg_t> _screenItems;
	Common::Array<reg_t> _planes;
	byte _highPlanePri;
};

} // End of namespace Sci

#endif