2021-04-27 21:56:32 +01:00
|
|
|
/* 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 TRECISION_ACTOR_H
|
|
|
|
#define TRECISION_ACTOR_H
|
|
|
|
|
2021-05-16 22:40:00 +01:00
|
|
|
#include "trecision/struct.h"
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "common/serializer.h"
|
2021-04-27 21:56:32 +01:00
|
|
|
|
|
|
|
namespace Trecision {
|
2021-05-18 12:25:02 +03:00
|
|
|
|
|
|
|
#define MAXLIGHT 40
|
|
|
|
|
2021-05-16 22:40:00 +01:00
|
|
|
class TrecisionEngine;
|
2021-05-01 23:05:36 +01:00
|
|
|
|
2021-04-27 21:56:32 +01:00
|
|
|
class Actor {
|
|
|
|
TrecisionEngine *_vm;
|
|
|
|
|
2021-05-18 12:25:02 +03:00
|
|
|
SLight _lightArea[MAXLIGHT];
|
|
|
|
SCamera _cameraArea;
|
|
|
|
uint8 *_textureData;
|
2021-05-14 21:51:14 +01:00
|
|
|
STexture _textureArea[MAXMAT];
|
|
|
|
|
2021-05-18 12:25:02 +03:00
|
|
|
void initTextures();
|
|
|
|
void readModel(const char *filename);
|
2021-05-19 08:12:01 +01:00
|
|
|
void microproseHeadFix(uint32 actionNum);
|
2021-05-18 12:25:02 +03:00
|
|
|
|
2021-04-27 21:56:32 +01:00
|
|
|
public:
|
|
|
|
Actor(TrecisionEngine *vm);
|
|
|
|
~Actor();
|
|
|
|
|
2021-05-11 00:21:41 +01:00
|
|
|
SVertex *_characterArea;
|
2021-05-18 04:06:53 +01:00
|
|
|
SVertex *_vertex;
|
2021-05-14 21:51:14 +01:00
|
|
|
|
|
|
|
SFace *_face;
|
2021-05-18 04:06:53 +01:00
|
|
|
SLight *_light;
|
2021-05-14 21:51:14 +01:00
|
|
|
SCamera *_camera;
|
2021-05-29 16:48:17 +01:00
|
|
|
STexture *_textures;
|
2021-04-27 21:56:32 +01:00
|
|
|
|
|
|
|
int16 _textureCoord[MAXFACE][3][2];
|
|
|
|
|
2021-05-01 12:05:17 +01:00
|
|
|
uint32 _vertexNum;
|
|
|
|
uint32 _faceNum;
|
2021-05-01 14:47:14 +01:00
|
|
|
uint32 _lightNum;
|
2021-04-27 21:56:32 +01:00
|
|
|
|
2021-05-04 01:39:00 +03:00
|
|
|
float _px, _pz;
|
2021-04-27 21:56:32 +01:00
|
|
|
float _dx, _dz;
|
|
|
|
float _theta;
|
2021-05-14 22:06:54 +01:00
|
|
|
|
|
|
|
int _lim[6];
|
2021-04-27 21:56:32 +01:00
|
|
|
|
|
|
|
int _curFrame;
|
|
|
|
int _curAction;
|
|
|
|
|
|
|
|
void syncGameStream(Common::Serializer &ser);
|
2021-05-01 11:51:28 +01:00
|
|
|
void actorDoAction(int action);
|
|
|
|
void actorStop();
|
2021-05-31 05:05:49 +01:00
|
|
|
void read3D(Common::SeekableReadStreamEndian *ff);
|
2021-05-14 19:56:16 +01:00
|
|
|
float frameCenter(SVertex *v);
|
2021-05-27 17:45:11 +03:00
|
|
|
void updateStepSound();
|
2021-06-16 22:41:05 +03:00
|
|
|
bool actorRectIsValid() const;
|
|
|
|
Common::Rect getActorRect() const;
|
2021-05-15 20:06:24 +01:00
|
|
|
};
|
2021-04-27 21:56:32 +01:00
|
|
|
|
2021-05-15 20:06:24 +01:00
|
|
|
} // End of namespace Trecision
|
2021-04-27 21:56:32 +01:00
|
|
|
#endif
|
|
|
|
|