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;
226 uint _sequencesCount;
238 void Init(
int width,
int height);
239 void SetCamera(
int rotX,
int rotY,
int rotZ,
int posX,
int posY,
int posZ,
int cameraAp);
240 void TransformSceneXYZ(
int x,
int y,
int z,
int& xOut,
int& yOut);
245 void SetSequence(uint animId, uint delay);
246 Common::Rect Draw(
int direction,
int x,
int y,
int z,
int tDelta);
249 const Math::Matrix4& MatrixCurrent()
const;
255 void MatrixTranslate(
float x,
float y,
float z);
256 void MatrixScale(
float x,
float y,
float z);
257 void MatrixRotateX(
float angle);
258 void MatrixRotateY(
float angle);
259 void MatrixRotateZ(
float angle);
261 void SetViewport(
int ap);
269 void UpdateTextures();
271 Meshes LoadMeshes(
const Hunks &hunks, uint hunk, uint offset,
int frame);
272 template<
bool convert>
273 AnimationData LoadAnimationData(
const Hunks &hunks, uint hunk, uint offset);
277 void RunRenderProgram(
Model &model,
bool preprocess);
282 void TransformMesh(
Mesh& mesh, Vectors& vertices);
283 void CalculateNormals(
Mesh& mesh, Vectors& vertices, Vectors &normals);
286 void RenderModel(
Model& model);
287 void RenderMesh(
Mesh& mesh, Vectors& vertices, Vectors &normals);
288 void RenderMeshPartColor(
MeshPart& part, Vectors& vertices, Vectors &normals);
289 void RenderMeshPartTexture(
MeshPart& part, Vectors& vertices, Vectors &normals);
298 #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