ScummVM API documentation
GraphicsTypes.h
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 modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of HPL1 Engine.
26  */
27 
28 #ifndef HPL_GRAPHICSTYPES_H
29 #define HPL_GRAPHICSTYPES_H
30 
31 #include "common/array.h"
32 #include "common/list.h"
33 #include "hpl1/engine/graphics/Color.h"
34 #include "hpl1/engine/math/MathTypes.h"
35 
36 namespace hpl {
37 
38 #define MAX_TEXTUREUNITS (8)
39 #define MAX_NUM_OF_LIGHTS (30)
40 
41 enum eMatrix {
42  eMatrix_ModelView,
43  eMatrix_Projection,
44  eMatrix_Texture,
45  eMatrix_LastEnum
46 };
47 
48 enum eTileRotation {
49  eTileRotation_0,
50  eTileRotation_90,
51  eTileRotation_180,
52  eTileRotation_270,
53  eTileRotation_LastEnum
54 };
55 
56 enum ePrimitiveType {
57  ePrimitiveType_Tri,
58  ePrimitiveType_Quad,
59  ePrimitiveType_LastEnum
60 };
61 
62 typedef tFlag tAnimTransformFlag;
63 
64 #define eAnimTransformFlag_Translate (0x00000001)
65 #define eAnimTransformFlag_Scale (0x00000002)
66 #define eAnimTransformFlag_Rotate (0x00000004)
67 
68 #define klNumOfAnimTransformFlags (3)
69 
70 const tAnimTransformFlag kvAnimTransformFlags[] = {eAnimTransformFlag_Translate,
71  eAnimTransformFlag_Scale, eAnimTransformFlag_Rotate};
72 
73 //-----------------------------------------
74 
75 enum eColorDataFormat {
76  eColorDataFormat_RGB,
77  eColorDataFormat_RGBA,
78  eColorDataFormat_ALPHA,
79  eColorDataFormat_BGR,
80  eColorDataFormat_BGRA,
81  eColorDataFormat_LastEnum
82 };
83 
84 //---------------------------------------
85 
86 enum eFontAlign {
87  eFontAlign_Left,
88  eFontAlign_Right,
89  eFontAlign_Center,
90  eFontAlign_LastEnum
91 };
92 
93 //---------------------------------------
94 
95 class cKeyFrame {
96 public:
97  cVector3f trans;
98  cVector3f scale;
99  cQuaternion rotation;
100  float time;
101 };
102 
104 typedef tKeyFramePtrVec::iterator tKeyFramePtrVecIt;
105 
107 typedef tKeyFrameVec::iterator tKeyFrameVecIt;
108 
109 //---------------------------------------
110 
111 enum eAnimationEventType {
112  eAnimationEventType_PlaySound,
113  eAnimationEventType_LastEnum
114 };
115 
116 //---------------------------------------
117 
119 public:
120  cVertexBonePair(unsigned int aVtx, unsigned int aBone, float aW) {
121  vtxIdx = aVtx;
122  boneIdx = aBone;
123  weight = aW;
124  }
125  cVertexBonePair() {}
126 
127  unsigned int vtxIdx;
128  unsigned int boneIdx;
129  float weight;
130 };
131 
133 typedef tVertexBonePairVec::iterator tVertexBonePairVecIt;
134 
135 //---------------------------------------
136 
137 class cVertex {
138 public:
139  cVertex() : pos(0), tex(0), col(0) {}
140  cVertex(const cVector3f &avPos, const cVector3f &avTex, const cColor &aCol) {
141  pos = avPos;
142  tex = avTex;
143  col = aCol;
144  }
145 
146  cVertex(const cVector3f &avPos, const cColor &aCol) {
147  pos = avPos;
148  col = aCol;
149  }
150 
151  cVector3f pos;
152  cVector3f tex;
153  cVector3f tan;
154  cVector3f norm;
155  cColor col;
156 };
157 
160 
162 typedef tVertexVec::iterator tVertexVecIt;
163 } // namespace hpl
164 
165 #endif // HPL_GRAPHICSTYPES_H
Definition: AI.h:36
Definition: list.h:44
T * iterator
Definition: array.h:54
Definition: Quaternion.h:36
Definition: GraphicsTypes.h:118
Definition: GraphicsTypes.h:137
Definition: GraphicsTypes.h:95
Definition: Color.h:37
Definition: list_intern.h:51