1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef TRECISION_ACTOR_H
24 #define TRECISION_ACTOR_H
25 
26 #include "trecision/struct.h"
27 #include "common/scummsys.h"
28 #include "common/serializer.h"
29 
30 namespace Trecision {
31 
32 #define MAXLIGHT 40
33 
34 class TrecisionEngine;
35 
36 class Actor {
37 	TrecisionEngine *_vm;
38 
39 	SLight _lightArea[MAXLIGHT];
40 	SCamera _cameraArea;
41 	uint8 *_textureData;
42 	STexture _textureArea[MAXMAT];
43 
44 	void initTextures();
45 	void readModel(const char *filename);
46 	void microproseHeadFix(uint32 actionNum);
47 
48 public:
49 	Actor(TrecisionEngine *vm);
50 	~Actor();
51 
52 	SVertex *_characterArea;
53 	SVertex *_vertex;
54 
55 	SFace *_face;
56 	SLight *_light;
57 	SCamera *_camera;
58 	STexture *_textures;
59 
60 	int16  _textureCoord[MAXFACE][3][2];
61 
62 	uint32 _vertexNum;
63 	uint32 _faceNum;
64 	uint32 _lightNum;
65 
66 	float _px, _pz;
67 	float _dx, _dz;
68 	float _theta;
69 
70 	int _lim[6];
71 
72 	int _curFrame;
73 	int _curAction;
74 
75 	void syncGameStream(Common::Serializer &ser);
76 	void actorDoAction(int action);
77 	void actorStop();
78 	void read3D(Common::SeekableReadStreamEndian *ff);
79 	float frameCenter(SVertex *v);
80 	void updateStepSound();
81 	bool actorRectIsValid() const;
82 	Common::Rect getActorRect() const;
83 };
84 
85 } // End of namespace Trecision
86 #endif
87 
88