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
|
/* 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 PRINCE_HERO_H
#define PRINCE_HERO_H
#include "common/scummsys.h"
#include "common/array.h"
#include "graphics/surface.h"
namespace Prince {
class Animation;
class Hero {
public:
static const uint32 kMoveSetSize = 26;
static const int16 kZoomStep = 4;
static const int16 kMaxPicWidth = 1280;
static const int16 kZoomBitmapWidth = kMaxPicWidth / kZoomStep;
enum State {
STAY = 0,
TURN = 1,
MOVE = 2,
BORE = 3,
SPEC = 4,
TALK = 5,
MVAN = 6,
TRAN = 7,
RUN = 8,
DMOVE = 9
};
enum Direction {
LEFT = 1,
RIGHT = 2,
UP = 3,
DOWN = 4
};
enum MoveSet {
Move_SL,
Move_SR,
Move_SU,
Move_SD,
Move_ML,
Move_MR,
Move_MU,
Move_MD,
Move_TL,
Move_TR,
Move_TU,
Move_TD,
Move_MLU,
Move_MLD,
Move_MLR,
Move_MRU,
Move_MRD,
Move_MRL,
Move_MUL,
Move_MUR,
Move_MUD,
Move_MDL,
Move_MDR,
Move_MDU,
Move_BORED1,
Move_BORED2
};
Hero();
~Hero();
Common::RandomSource _randomSource;
bool loadAnimSet(uint32 heroAnimNumber);
const Graphics::Surface * getSurface();
void setPos(int16 x, int16 y) { _middleX = x; _middleY = y; }
void setVisible(bool flag) { _visible = flag; }
void showHero();
void moveHero();
void rotateHero();
void setScale(int8 zoomBitmapValue);
void selectZoom();
void countDrawPosition();
void showHeroAnimFrame();
void specialAnim();
void getState();
//private:
uint16 _number;
uint16 _visible;
int16 _state;
int16 _middleX; // middle of X
int16 _middleY; // lower part of hero
int16 _drawX;
int16 _drawY;
int16 _lastDirection;
int16 _destDirection;
int16 _moveSetType;
int8 _zoomFactor;
int16 _scaleValue;
// Coords array of coordinates
// DirTab array of directions
// CurrCoords current coordinations
// CurrDirTab current direction
// LastDir previous move direction
// DestDir
// LeftRight previous left/right direction
// UpDown previous up/down direction
uint _phase; // Phase animation phase
// Step x/y step size depends on direction
// MaxBoredom stand still timeout
int16 _boredomTime;// Boredom current boredom time in frames
uint16 _boreNum; // Bore anim frame
int16 _talkTime; // TalkTime time of talk anim
int32 _specAnim; // SpecAnim additional anim
uint16 _currHeight; // height of current anim phase
// Inventory array of items
// Inventory2 array of items
// Font subtitiles font
// Color subtitiles color
// AnimSet number of animation set
Common::Array<Animation *> _moveSet; // MoveAnims MoveSet
// TurnAnim ??
Animation *_zoomBitmap; // change to sth else, not Animation ??
uint32 _moveDelay;
uint32 _shadMinus; //??
};
}
#endif
/* vim: set tabstop=4 noexpandtab: */
|