24 #ifndef TINSEL_SPRITER_H 25 #define TINSEL_SPRITER_H 27 #include "tinsel/dw.h" 28 #include "common/rect.h" 29 #include "common/stack.h" 30 #include "common/str.h" 32 #include "math/vector3d.h" 33 #include "math/vector2d.h" 34 #include "math/matrix4.h" 36 #if defined(USE_TINYGL) 37 #include "graphics/tinygl/tinygl.h" 44 enum RenderProgramOp : uint16 {
65 uint translateTablesHunk;
69 uint rotateTablesHunk;
102 Math::Vector2d uv[4];
107 MESH_PART_TYPE_COLOR,
108 MESH_PART_TYPE_SOLID,
109 MESH_PART_TYPE_TEXTURE,
136 Vectors translations;
143 MODEL_HAS_TRANSLATION_TABLE = 1,
144 MODEL_HAS_SCALE_TABLE = 2,
145 MODEL_HAS_ROTATION_TABLE = 4
157 AnimationData startTranslateTables;
158 AnimationData startRotateTables;
159 AnimationData startScaleTables;
160 AnimationData endTranslateTables;
161 AnimationData endRotateTables;
162 AnimationData endScaleTables;
172 Math::Vector3d position;
173 Math::Vector3d rotation;
174 Math::Vector3d
scale;
196 Math::Vector3d position;
197 Math::Vector3d rotation;
202 MatrixStack _modelMatrix;
203 MatrixStack* _currentMatrix;
216 bool _textureGenerated;
217 #if defined(USE_TINYGL) 228 uint _sequencesCount;
240 void Init(
int width,
int height);
241 void SetCamera(
int rotX,
int rotY,
int rotZ,
int posX,
int posY,
int posZ,
int cameraAp);
242 void TransformSceneXYZ(
int x,
int y,
int z,
int& xOut,
int& yOut);
247 void SetSequence(uint animId, uint delay);
248 Common::Rect Draw(
int direction,
int x,
int y,
int z,
int tDelta);
251 const Math::Matrix4& MatrixCurrent()
const;
257 void MatrixTranslate(
float x,
float y,
float z);
258 void MatrixScale(
float x,
float y,
float z);
259 void MatrixRotateX(
float angle);
260 void MatrixRotateY(
float angle);
261 void MatrixRotateZ(
float angle);
263 void SetViewport(
int ap);
271 void UpdateTextures();
273 Meshes LoadMeshes(
const Hunks &hunks, uint hunk, uint offset,
int frame);
274 template<
bool convert>
275 AnimationData LoadAnimationData(
const Hunks &hunks, uint hunk, uint offset);
279 void RunRenderProgram(
Model &model,
bool preprocess);
284 void TransformMesh(
Mesh& mesh, Vectors& vertices);
285 void CalculateNormals(
Mesh& mesh, Vectors& vertices, Vectors &normals);
288 void RenderModel(
Model& model);
289 void RenderMesh(
Mesh& mesh, Vectors& vertices, Vectors &normals);
290 void RenderMeshPartColor(
MeshPart& part, Vectors& vertices, Vectors &normals);
291 void RenderMeshPartTexture(
MeshPart& part, Vectors& vertices, Vectors &normals);
300 #endif // TINSEL_SPRITER_H
uint32 SCNHANDLE
Definition: dw.h:31
Definition: spriter.h:119
Definition: spriter.h:187
Definition: spriter.h:135
Definition: spriter.h:179
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: spriter.h:148
Definition: spriter.h:126
Definition: spriter.h:200
Definition: spriter.h:112