Browse Source

Started documenting TombRaider.h

Thomas Buck 11 years ago
parent
commit
7f08e5f072
1 changed files with 174 additions and 289 deletions
  1. 174
    289
      include/TombRaider.h

+ 174
- 289
include/TombRaider.h View File

74
 
74
 
75
 //#include "TombRaider1.h"
75
 //#include "TombRaider1.h"
76
 
76
 
77
-typedef enum
78
-{
77
+typedef enum {
79
   TR_VERSION_UNKNOWN,
78
   TR_VERSION_UNKNOWN,
80
   TR_VERSION_1,
79
   TR_VERSION_1,
81
   TR_VERSION_2,
80
   TR_VERSION_2,
82
   TR_VERSION_3,
81
   TR_VERSION_3,
83
   TR_VERSION_4,
82
   TR_VERSION_4,
84
   TR_VERSION_5
83
   TR_VERSION_5
85
-
86
 } tr2_version_type;
84
 } tr2_version_type;
87
 
85
 
88
 
86
 
89
-typedef enum
90
-{
87
+typedef enum {
91
     TR_FREAD_NORMAL = 0,
88
     TR_FREAD_NORMAL = 0,
92
     TR_FREAD_COMPRESSED
89
     TR_FREAD_COMPRESSED
93
-
94
 } tr_fread_mode_t;
90
 } tr_fread_mode_t;
95
 
91
 
96
 
92
 
97
-typedef enum
98
-{
93
+typedef enum {
99
     tombraiderLight_typeDirectional   = 1,
94
     tombraiderLight_typeDirectional   = 1,
100
     tombraiderLight_typeSpot          = 2,
95
     tombraiderLight_typeSpot          = 2,
101
     tombraiderLight_typePoint         = 3
96
     tombraiderLight_typePoint         = 3
102
-
103
 } tombraiderLightType;
97
 } tombraiderLightType;
104
 
98
 
105
-typedef enum
106
-{
99
+typedef enum {
107
     tombraiderLight_useCutoff         = 1,
100
     tombraiderLight_useCutoff         = 1,
108
     tombraiderLight_useAttenuation    = 2
101
     tombraiderLight_useAttenuation    = 2
109
-
110
 } tombraiderLightFlags;
102
 } tombraiderLightFlags;
111
 
103
 
112
-typedef enum
113
-{
104
+typedef enum {
114
     tombraiderRoom_underWater         = 1
105
     tombraiderRoom_underWater         = 1
115
 } tombraiderRoomFlags;
106
 } tombraiderRoomFlags;
116
 
107
 
117
-typedef enum
118
-{
108
+typedef enum {
119
     tombraiderSector_wall = 1
109
     tombraiderSector_wall = 1
120
 } tombraiderSectorFlags;
110
 } tombraiderSectorFlags;
121
 
111
 
122
-typedef enum
123
-{
112
+typedef enum {
124
     tombraiderFace_Alpha          = 1,
113
     tombraiderFace_Alpha          = 1,
125
     tombraiderFace_Colored        = 2,
114
     tombraiderFace_Colored        = 2,
126
     tombraiderFace_PartialAlpha   = 4
115
     tombraiderFace_PartialAlpha   = 4
127
-
128
 } tombraiderFace_Flags;
116
 } tombraiderFace_Flags;
129
 
117
 
130
 
118
 
131
 #define TR_SOUND_FOOTSTEP0    1
119
 #define TR_SOUND_FOOTSTEP0    1
132
 #define TR_SOUND_F_PISTOL    12
120
 #define TR_SOUND_F_PISTOL    12
133
 
121
 
134
-enum TR4_Objects
135
-{
122
+enum TR4_Objects {
136
     TR4_LARA = 0,
123
     TR4_LARA = 0,
137
     TR4_PISTOLS_ANIM = 1,
124
     TR4_PISTOLS_ANIM = 1,
138
     TR4_UZI_ANIM = 2,
125
     TR4_UZI_ANIM = 2,
168
 #define TR_ANIAMTION_GRAB_LEDGE       96
155
 #define TR_ANIAMTION_GRAB_LEDGE       96
169
 #define TR_ANIAMTION_PULLING_UP       97
156
 #define TR_ANIAMTION_PULLING_UP       97
170
 
157
 
171
-/*---------------------------------------------------------------
172
- * Basic 24-bit colour structure
173
- * (although it appears that only 6 bits
174
- * per colour are actually used, making it 18-bit colour)
175
- ---------------------------------------------------------------*/
176
-typedef struct tr2_colour_s
177
-{
178
-  unsigned char r;
179
-  unsigned char g;
180
-  unsigned char b;
181
-}  __attribute__ ((packed)) tr2_colour_t;
182
-
183
-
184
-/*--------------------------------------------------------------
185
- * Basic vertex structure.
158
+/*!
159
+ * \brief Basic 24-bit colour structure.
160
+ *
161
+ * It appears that only 6 bits per colour are actually
162
+ * used, making it 18-bit colour.
163
+ */
164
+typedef struct {
165
+    unsigned char r; //!< Red part
166
+    unsigned char g; //!< Green part
167
+    unsigned char b; //!< Blue part
168
+} __attribute__ ((packed)) tr2_colour_t;
169
+
170
+
171
+/*!
172
+ * \brief Basic vertex structure.
173
+ *
186
  * Note that all vertices are relative coordinates;
174
  * Note that all vertices are relative coordinates;
187
  * each mesh (room, object, etc.) has its own offset by
175
  * each mesh (room, object, etc.) has its own offset by
188
  * which the vertex coordinates are translated.
176
  * which the vertex coordinates are translated.
189
- --------------------------------------------------------------*/
190
-typedef struct tr2_vertex_s
191
-{
192
-  short x;
193
-  short y;
194
-  short z;
195
-}  __attribute__ ((packed))   tr2_vertex_t;
196
-
197
-
198
-/*--------------------------------------------------------------
199
- * A rectangular (quad) face definition.
177
+ */
178
+typedef struct {
179
+    short x;
180
+    short y;
181
+    short z;
182
+} __attribute__ ((packed)) tr2_vertex_t;
183
+
184
+/*!
185
+ * \brief A rectangular (quad) face definition.
186
+ *
200
  * Four vertices (the values are indices into the
187
  * Four vertices (the values are indices into the
201
  * appropriate vertex list) and a texture (an index
188
  * appropriate vertex list) and a texture (an index
202
  * into the texture list) or colour (index into 8-bit palette).
189
  * into the texture list) or colour (index into 8-bit palette).
204
  * I've seen a few coloured polygons where Texture is
191
  * I've seen a few coloured polygons where Texture is
205
  * greater than 255, but ANDing the value with 0xFF
192
  * greater than 255, but ANDing the value with 0xFF
206
  * seems to produce acceptable results.
193
  * seems to produce acceptable results.
207
- --------------------------------------------------------------*/
208
-typedef struct tr2_quad_s /* was tr2_face4  */
209
-{
210
-  unsigned short vertices[4];
211
-  unsigned short texture;
212
-}  __attribute__ ((packed))   tr2_quad_t;
213
-
214
-typedef struct tr4_quad_s
215
-{
216
-    unsigned short vertices[4];  // The 4 vertices of a quad
217
-    unsigned short texture;      // Object-texture index
218
-    unsigned short lighting;     // transparency flag & strength of
219
-                                 // the hilight
220
-    // Bit 0: if set, alpha channel = intensity (same meaning that when the Attribute field of tr2_object_texture is 2. Cf TRosetta stone document)
221
-    // Bit 1-7: strength of the hilight. In TR4, objects can exhibit some kind of light reflection when seen from some particular angles. These bits give the strength of this effect: the more bigger the value is, the more visible is the effect.
222
-}  __attribute__ ((packed))   tr4_quad_t;
194
+ */
195
+typedef struct {
196
+    unsigned short vertices[4];
197
+    unsigned short texture;
198
+} __attribute__ ((packed)) tr2_quad_t; // was tr2_face4
199
+
200
+typedef struct {
201
+    unsigned short vertices[4]; //!< The 4 vertices of a quad
202
+    unsigned short texture;     //!< Object-texture index
203
+    unsigned short lighting;    //!< Transparency flag & strength of the highlight
204
+    /*!<
205
+     * Bit 0: if set, alpha channel = intensity (same meaning that when the
206
+     * Attribute field of tr2_object_texture is 2. Cf TRosetta stone document)
207
+     *
208
+     * Bit 1-7: strength of the highlight. In TR4, objects can exhibit some kind
209
+     * of light reflection when seen from some particular angles. These bits give
210
+     * the strength of this effect:
211
+     * the more bigger the value is, the more visible is the effect.
212
+     */
213
+} __attribute__ ((packed)) tr4_quad_t;
223
 
214
 
224
 /*--------------------------------------------------------------
215
 /*--------------------------------------------------------------
225
  * A triangular face definition.
216
  * A triangular face definition.
1371
 
1362
 
1372
 } tr5_animation_t;
1363
 } tr5_animation_t;
1373
 
1364
 
1374
-typedef struct tr5_cinematic_frame_s
1375
-{
1365
+typedef struct {
1376
     unsigned int unknown[24];
1366
     unsigned int unknown[24];
1377
 } tr5_cinematic_frame_t;
1367
 } tr5_cinematic_frame_t;
1378
 
1368
 
1380
 #pragma pack(pop, tr2_h, 1)
1370
 #pragma pack(pop, tr2_h, 1)
1381
 #endif
1371
 #endif
1382
 
1372
 
1383
-class TombRaider
1384
-{
1373
+class TombRaider {
1385
 public:
1374
 public:
1386
 
1375
 
1387
-    ////////////////////////////////////////////////////////////
1388
-    // Constructors
1389
-    ////////////////////////////////////////////////////////////
1390
-
1376
+    /*!
1377
+     * \brief Constructs an object of TombRaider
1378
+     */
1391
     TombRaider();
1379
     TombRaider();
1392
-    /*------------------------------------------------------
1393
-     * Pre  :
1394
-     * Post : Constructs an object of TombRaider
1395
-     *
1396
-     *-- History ------------------------------------------
1397
-     *
1398
-     * 2000.05.13:
1399
-     * Mongoose - Created
1400
-     ------------------------------------------------------*/
1401
 
1380
 
1381
+    /*!
1382
+     * \brief Deconstructs an object of TombRaider
1383
+     */
1402
     ~TombRaider();
1384
     ~TombRaider();
1403
-    /*------------------------------------------------------
1404
-     * Pre  : TombRaider object is allocated
1405
-     * Post : Deconstructs an object of TombRaider
1406
-     *
1407
-     *-- History ------------------------------------------
1408
-     *
1409
-     * 2000.05.13:
1410
-     * Mongoose - Created
1411
-     ------------------------------------------------------*/
1412
 
1385
 
1413
     ////////////////////////////////////////////////////////////
1386
     ////////////////////////////////////////////////////////////
1414
     // Wash me -- not part of cleaned API
1387
     // Wash me -- not part of cleaned API
1420
 
1393
 
1421
     int NumTextures();
1394
     int NumTextures();
1422
 
1395
 
1396
+    /*!
1397
+     * \brief Get number of _special_ textures/images
1398
+     * \returns number of special textures/images
1399
+     */
1423
     int NumSpecialTextures();
1400
     int NumSpecialTextures();
1424
-    /*------------------------------------------------------
1425
-     * Pre  :
1426
-     * Post : Returns number of "special" textures/images
1427
-     *
1428
-     *-- History ------------------------------------------
1429
-     *
1430
-     * 2001.06.19:
1431
-     * Mongoose - Created
1432
-     ------------------------------------------------------*/
1433
 
1401
 
1434
     int NumAnimations();
1402
     int NumAnimations();
1435
 
1403
 
1453
 
1421
 
1454
     tr2_object_texture_t *ObjectTextures();
1422
     tr2_object_texture_t *ObjectTextures();
1455
 
1423
 
1424
+    /*!
1425
+     * \brief Get number of boxes
1426
+     * \returns number of boxes
1427
+     */
1456
     unsigned int getNumBoxes();
1428
     unsigned int getNumBoxes();
1457
-    /*------------------------------------------------------
1458
-     * Pre  :
1459
-     * Post : returns number of boxes
1460
-     *
1461
-     *-- History ------------------------------------------
1462
-     *
1463
-     * 200?.??.??:
1464
-     * Mongoose - Created
1465
-     ------------------------------------------------------*/
1466
 
1429
 
1467
     tr2_box_t *Box();
1430
     tr2_box_t *Box();
1468
 
1431
 
1611
      * Mongoose - Created
1574
      * Mongoose - Created
1612
      ------------------------------------------------------*/
1575
      ------------------------------------------------------*/
1613
 
1576
 
1577
+    /*!
1578
+     * \brief Get number of bump maps in loaded pak
1579
+     * \returns number of bump maps
1580
+     */
1614
     int getBumpMapCount();
1581
     int getBumpMapCount();
1615
-    /*------------------------------------------------------
1616
-     * Pre  :
1617
-     * Post : Returns number of bump maps in loaded pak
1618
-     *
1619
-     *-- History ------------------------------------------
1620
-     *
1621
-     * 2002.12.24:
1622
-     * Mongoose - Created
1623
-     ------------------------------------------------------*/
1624
 
1582
 
1625
     void getColor(int index, float color[4]);
1583
     void getColor(int index, float color[4]);
1626
 
1584
 
1640
      * Mongoose - Created
1598
      * Mongoose - Created
1641
      ------------------------------------------------------*/
1599
      ------------------------------------------------------*/
1642
 
1600
 
1601
+    /*!
1602
+     * \brief Get SIGNED mesh count (TR encoded < 0 errors)
1603
+     * \returns signed mesh count
1604
+     */
1643
     int getMeshCount();
1605
     int getMeshCount();
1644
-    /*------------------------------------------------------
1645
-     * Pre  :
1646
-     * Post : Returns SIGNED mesh count ( TR encoded < 0 errs )
1647
-     *
1648
-     *-- History ------------------------------------------
1649
-     *
1650
-     * 2000.05.13:
1651
-     * Mongoose - Created
1652
-     ------------------------------------------------------*/
1653
 
1606
 
1654
     void getMeshColoredRectangle(unsigned int meshIndex,
1607
     void getMeshColoredRectangle(unsigned int meshIndex,
1655
                                           unsigned int faceIndex,
1608
                                           unsigned int faceIndex,
1779
      * Mongoose - Created
1732
      * Mongoose - Created
1780
      ------------------------------------------------------*/
1733
      ------------------------------------------------------*/
1781
 
1734
 
1735
+    /*!
1736
+     * \brief Get number of collision boxes in room (unified)
1737
+     * \param roomIndex room index
1738
+     * \returns number of collision boxes in room
1739
+     */
1782
     unsigned int getRoomBoxCount(unsigned int roomIndex);
1740
     unsigned int getRoomBoxCount(unsigned int roomIndex);
1783
-    /*------------------------------------------------------
1784
-     * Pre  :
1785
-     * Post : Returns number of collision boxes in room ( unified )
1786
-     *
1787
-     *-- History ------------------------------------------
1788
-     *
1789
-     * 2003.05.24:
1790
-     * Mongoose - Created
1791
-     ------------------------------------------------------*/
1792
 
1741
 
1793
     void getRoomInfo(unsigned int index,
1742
     void getRoomInfo(unsigned int index,
1794
-                          unsigned int *flags, float pos[3],
1795
-                          float bboxMin[3], float bboxMax[3]);
1743
+                        unsigned int *flags, float pos[3],
1744
+                        float bboxMin[3], float bboxMax[3]);
1796
 
1745
 
1797
     int getRoomLight(unsigned int roomIndex, unsigned int index,
1746
     int getRoomLight(unsigned int roomIndex, unsigned int index,
1798
-                          float pos[4], float color[4], float dir[3],
1799
-                          float *attenuation, float *cutoffAngle,
1800
-                          unsigned int *type, unsigned int *flags);
1747
+                        float pos[4], float color[4], float dir[3],
1748
+                        float *attenuation, float *cutoffAngle,
1749
+                        unsigned int *type, unsigned int *flags);
1801
     /*------------------------------------------------------
1750
     /*------------------------------------------------------
1802
      * Pre  : All parms are allocated
1751
      * Pre  : All parms are allocated
1803
      * Post : Returns a single light from a room ( unified )
1752
      * Post : Returns a single light from a room ( unified )
1808
      * Mongoose - Created
1757
      * Mongoose - Created
1809
      ------------------------------------------------------*/
1758
      ------------------------------------------------------*/
1810
 
1759
 
1760
+    /*!
1761
+     * \brief Get number of lights in room (unified)
1762
+     * \param roomIndex room index
1763
+     * \returns number of lights in room
1764
+     */
1811
     unsigned int getRoomLightCount(unsigned int roomIndex);
1765
     unsigned int getRoomLightCount(unsigned int roomIndex);
1812
-    /*------------------------------------------------------
1813
-     * Pre  :
1814
-     * Post : Returns number of lights in room ( unified )
1815
-     *
1816
-     *-- History ------------------------------------------
1817
-     *
1818
-     * 2003.05.24:
1819
-     * Mongoose - Created
1820
-     ------------------------------------------------------*/
1821
 
1766
 
1822
     int getRoomModel(unsigned int roomIndex, unsigned int index,
1767
     int getRoomModel(unsigned int roomIndex, unsigned int index,
1823
-                          int *modelIndex, float pos[3], float *yaw);
1768
+                        int *modelIndex, float pos[3], float *yaw);
1824
     /*------------------------------------------------------
1769
     /*------------------------------------------------------
1825
      * Pre  : All parms are allocated
1770
      * Pre  : All parms are allocated
1826
      * Post : Returns a single model info from a room ( unified )
1771
      * Post : Returns a single model info from a room ( unified )
1831
      * Mongoose - Created
1776
      * Mongoose - Created
1832
      ------------------------------------------------------*/
1777
      ------------------------------------------------------*/
1833
 
1778
 
1779
+    /*!
1780
+     * \brief Get number of room models in room (unified)
1781
+     * \param roomIndex room index
1782
+     * \returns number of room models in room
1783
+     */
1834
     unsigned int getRoomModelCount(unsigned int roomIndex);
1784
     unsigned int getRoomModelCount(unsigned int roomIndex);
1835
-    /*------------------------------------------------------
1836
-     * Pre  :
1837
-     * Post : Returns number of room models in room ( unified )
1838
-     *
1839
-     *-- History ------------------------------------------
1840
-     *
1841
-     * 2003.05.24:
1842
-     * Mongoose - Created
1843
-     ------------------------------------------------------*/
1844
 
1785
 
1845
     int getRoomPortal(unsigned int roomIndex, unsigned int index,
1786
     int getRoomPortal(unsigned int roomIndex, unsigned int index,
1846
-                            int *adjoiningRoom, float normal[3], float vertices[12]);
1787
+                        int *adjoiningRoom, float normal[3], float vertices[12]);
1847
     /*------------------------------------------------------
1788
     /*------------------------------------------------------
1848
      * Pre  :
1789
      * Pre  :
1849
      * Post : Returns a single portal from room ( unified )
1790
      * Post : Returns a single portal from room ( unified )
1854
      * Mongoose - Created
1795
      * Mongoose - Created
1855
      ------------------------------------------------------*/
1796
      ------------------------------------------------------*/
1856
 
1797
 
1798
+    /*!
1799
+     * \brief Get number of portals from room (unified)
1800
+     * \param roomIndex room index
1801
+     * \returns number of portals from room
1802
+     */
1857
     unsigned int getRoomPortalCount(unsigned int roomIndex);
1803
     unsigned int getRoomPortalCount(unsigned int roomIndex);
1858
-    /*------------------------------------------------------
1859
-     * Pre  :
1860
-     * Post : Returns number of portals from room ( unified )
1861
-     *
1862
-     *-- History ------------------------------------------
1863
-     *
1864
-     * 2003.05.24:
1865
-     * Mongoose - Created
1866
-     ------------------------------------------------------*/
1867
 
1804
 
1868
     void getRoomRectangle(unsigned int roomIndex, unsigned int rectangleIndex,
1805
     void getRoomRectangle(unsigned int roomIndex, unsigned int rectangleIndex,
1869
-                                 unsigned int *indices, float *texCoords, int *texture,
1870
-                                 unsigned int *flags);
1806
+                            unsigned int *indices, float *texCoords, int *texture,
1807
+                            unsigned int *flags);
1871
     /*------------------------------------------------------
1808
     /*------------------------------------------------------
1872
      * Pre  :
1809
      * Pre  :
1873
      * Post : Gets rectangle data with texCoords for non-matching
1810
      * Post : Gets rectangle data with texCoords for non-matching
1879
      * Mongoose - Created
1816
      * Mongoose - Created
1880
      ------------------------------------------------------*/
1817
      ------------------------------------------------------*/
1881
 
1818
 
1819
+    /*!
1820
+     * \brief Get number of rectangles from room (unified)
1821
+     * \param roomIndex room index
1822
+     * \returns number of rectangles from room
1823
+     */
1882
     unsigned int getRoomRectangleCount(unsigned int roomIndex);
1824
     unsigned int getRoomRectangleCount(unsigned int roomIndex);
1883
-    /*------------------------------------------------------
1884
-     * Pre  :
1885
-     * Post : Returns number of rectangles from room ( unified )
1886
-     *
1887
-     *-- History ------------------------------------------
1888
-     *
1889
-     * 2003.05.24:
1890
-     * Mongoose - Created
1891
-     ------------------------------------------------------*/
1892
 
1825
 
1893
     int getRoomSector(unsigned int roomIndex, unsigned int index,
1826
     int getRoomSector(unsigned int roomIndex, unsigned int index,
1894
-                            unsigned int *flags, float *ceiling, float *floor,
1895
-                            int *floorDataIndex, int *boxIndex,
1896
-                            int *roomBelow, int *roomAbove);
1827
+                        unsigned int *flags, float *ceiling, float *floor,
1828
+                        int *floorDataIndex, int *boxIndex,
1829
+                        int *roomBelow, int *roomAbove);
1897
     /*------------------------------------------------------
1830
     /*------------------------------------------------------
1898
      * Pre  :
1831
      * Pre  :
1899
      * Post : Returns a single sector from room ( unified )
1832
      * Post : Returns a single sector from room ( unified )
1905
      ------------------------------------------------------*/
1838
      ------------------------------------------------------*/
1906
 
1839
 
1907
     unsigned int getRoomSectorCount(unsigned int roomIndex,
1840
     unsigned int getRoomSectorCount(unsigned int roomIndex,
1908
-                                              unsigned int *zSectorsCount,
1909
-                                              unsigned int *xSectorsCount);
1841
+                                    unsigned int *zSectorsCount,
1842
+                                    unsigned int *xSectorsCount);
1910
     /*------------------------------------------------------
1843
     /*------------------------------------------------------
1911
      * Pre  :
1844
      * Pre  :
1912
      * Post : Returns number of sectors in room ( unified )
1845
      * Post : Returns number of sectors in room ( unified )
1920
      ------------------------------------------------------*/
1853
      ------------------------------------------------------*/
1921
 
1854
 
1922
     void getRoomSprite(unsigned int roomIndex, unsigned int index,
1855
     void getRoomSprite(unsigned int roomIndex, unsigned int index,
1923
-                             float scale, int *texture,
1924
-                             float *pos, float *vertices, float *texcoords);
1925
-
1856
+                        float scale, int *texture,
1857
+                        float *pos, float *vertices, float *texcoords);
1858
+
1859
+    /*!
1860
+     * \brief Get number of sprites in room (unified)
1861
+     * \param roomIndex room index
1862
+     * \returns number of sprites in room
1863
+     */
1926
     unsigned int getRoomSpriteCount(unsigned int roomIndex);
1864
     unsigned int getRoomSpriteCount(unsigned int roomIndex);
1927
-    /*------------------------------------------------------
1928
-     * Pre  :
1929
-     * Post : Returns number of sprites in room ( unified )
1930
-     *
1931
-     *-- History ------------------------------------------
1932
-     *
1933
-     * 2003.05.24:
1934
-     * Mongoose - Created
1935
-     ------------------------------------------------------*/
1936
 
1865
 
1937
     void getRoomTriangle(unsigned int roomIndex, unsigned int triangleIndex,
1866
     void getRoomTriangle(unsigned int roomIndex, unsigned int triangleIndex,
1938
-                                unsigned int *indices, float *texCoords, int *texture,
1939
-                                unsigned int *flags);
1867
+                            unsigned int *indices, float *texCoords, int *texture,
1868
+                            unsigned int *flags);
1940
     /*------------------------------------------------------
1869
     /*------------------------------------------------------
1941
      * Pre  :
1870
      * Pre  :
1942
      * Post : Gets triangle data with texCoords for non-matching
1871
      * Post : Gets triangle data with texCoords for non-matching
1949
      ------------------------------------------------------*/
1878
      ------------------------------------------------------*/
1950
 
1879
 
1951
     void getRoomTriangles(unsigned int index, int textureOffset,
1880
     void getRoomTriangles(unsigned int index, int textureOffset,
1952
-                                 unsigned int *count, unsigned int **indices,
1953
-                                 float **texCoords, int **textures,
1954
-                                 unsigned int **flags);
1881
+                            unsigned int *count, unsigned int **indices,
1882
+                            float **texCoords, int **textures,
1883
+                            unsigned int **flags);
1955
     /*------------------------------------------------------
1884
     /*------------------------------------------------------
1956
      * Pre  :
1885
      * Pre  :
1957
      * Post : Gets triangle data with texCoords for non-matching
1886
      * Post : Gets triangle data with texCoords for non-matching
1968
      ------------------------------------------------------*/
1897
      ------------------------------------------------------*/
1969
 
1898
 
1970
     void getRoomTriangles(unsigned int roomIndex, int textureOffset,
1899
     void getRoomTriangles(unsigned int roomIndex, int textureOffset,
1971
-                                 unsigned int *count,
1972
-                                 unsigned int **indices, float **vertices,
1973
-                                 float **texCoords, float **colors,
1974
-                                 int **textures, unsigned int **flags);
1900
+                            unsigned int *count,
1901
+                            unsigned int **indices, float **vertices,
1902
+                            float **texCoords, float **colors,
1903
+                            int **textures, unsigned int **flags);
1975
     /*------------------------------------------------------
1904
     /*------------------------------------------------------
1976
      * Pre  :
1905
      * Pre  :
1977
      * Post : Gets triangle data with duplicated
1906
      * Post : Gets triangle data with duplicated
1987
      * Mongoose - Created
1916
      * Mongoose - Created
1988
      ------------------------------------------------------*/
1917
      ------------------------------------------------------*/
1989
 
1918
 
1919
+    /*!
1920
+     * \brief Get number of triangles from room (unified)
1921
+     * \param roomIndex room index
1922
+     * \returns number of triangles from room
1923
+     */
1990
     unsigned int getRoomTriangleCount(unsigned int roomIndex);
1924
     unsigned int getRoomTriangleCount(unsigned int roomIndex);
1991
-    /*------------------------------------------------------
1992
-     * Pre  :
1993
-     * Post : Returns number of triangles from room ( unified )
1994
-     *
1995
-     *-- History ------------------------------------------
1996
-     *
1997
-     * 2003.05.24:
1998
-     * Mongoose - Created
1999
-     ------------------------------------------------------*/
2000
 
1925
 
2001
     void getRoomVertex(unsigned int roomIndex, unsigned int vertexIndex,
1926
     void getRoomVertex(unsigned int roomIndex, unsigned int vertexIndex,
2002
-                             float *xyz, float *rgba);
1927
+                        float *xyz, float *rgba);
2003
     /*------------------------------------------------------
1928
     /*------------------------------------------------------
2004
      * Pre  : Given room index and vertex index and
1929
      * Pre  : Given room index and vertex index and
2005
      *         xyz is allocated float[3]
1930
      *         xyz is allocated float[3]
2014
      ------------------------------------------------------*/
1939
      ------------------------------------------------------*/
2015
 
1940
 
2016
     void getRoomVertexArrays(unsigned int roomIndex,
1941
     void getRoomVertexArrays(unsigned int roomIndex,
2017
-                                     unsigned int *vertexCount, float **vertices,
2018
-                                     unsigned int *normalCount, float **normals,
2019
-                                     unsigned int *colorCount, float **colors);
1942
+                                unsigned int *vertexCount, float **vertices,
1943
+                                unsigned int *normalCount, float **normals,
1944
+                                unsigned int *colorCount, float **colors);
2020
     /*------------------------------------------------------
1945
     /*------------------------------------------------------
2021
      * Pre  : Given room index
1946
      * Pre  : Given room index
2022
      *
1947
      *
2043
      * Mongoose - Created
1968
      * Mongoose - Created
2044
      ------------------------------------------------------*/
1969
      ------------------------------------------------------*/
2045
 
1970
 
1971
+    /*!
1972
+     * \brief Get sky mesh ID
1973
+     * \returns moveable id of sky mesh or -1 if none
1974
+     */
2046
     int getSkyModelId();
1975
     int getSkyModelId();
2047
-    /*------------------------------------------------------
2048
-     * Pre  :
2049
-     * Post : Returns moveable id of sky mesh or -1 if none
2050
-     *
2051
-     *-- History ------------------------------------------
2052
-     *
2053
-     * 2001.05.28:
2054
-     * Mongoose - Created
2055
-     ------------------------------------------------------*/
2056
 
1976
 
2057
     void getSprites();
1977
     void getSprites();
2058
 
1978
 
2059
     void getSoundSample(unsigned int index,
1979
     void getSoundSample(unsigned int index,
2060
-                              unsigned int *bytes, unsigned char **data);
1980
+                        unsigned int *bytes, unsigned char **data);
2061
     /*------------------------------------------------------
1981
     /*------------------------------------------------------
2062
      * Pre  :
1982
      * Pre  :
2063
      * Post : Returns a copy of a sound sample and
1983
      * Post : Returns a copy of a sound sample and
2069
      * Mongoose - Created
1989
      * Mongoose - Created
2070
      ------------------------------------------------------*/
1990
      ------------------------------------------------------*/
2071
 
1991
 
1992
+    /*!
1993
+     * \brief Get number of loaded sound samples
1994
+     * \returns number of sound samples loaded
1995
+     */
2072
     unsigned int getSoundSamplesCount();
1996
     unsigned int getSoundSamplesCount();
2073
-    /*------------------------------------------------------
2074
-     * Pre  :
2075
-     * Post : Returns number of sound samples loaded
2076
-     *
2077
-     *-- History ------------------------------------------
2078
-     *
2079
-     * 2003.05.10:
2080
-     * Mongoose - Created
2081
-     ------------------------------------------------------*/
2082
 
1997
 
2083
     bool isMeshValid(int index);
1998
     bool isMeshValid(int index);
2084
     /*------------------------------------------------------
1999
     /*------------------------------------------------------
2091
      * Mongoose - Created
2006
      * Mongoose - Created
2092
      ------------------------------------------------------*/
2007
      ------------------------------------------------------*/
2093
 
2008
 
2009
+    /*!
2010
+     * \brief Check if a room is valid (TRC support)
2011
+     * \param index room index
2012
+     * \returns true if room is valid
2013
+     */
2094
     bool isRoomValid(int index);
2014
     bool isRoomValid(int index);
2095
-    /*------------------------------------------------------
2096
-     * Pre  :
2097
-     * Post : Returns true if room is valid ( TRC support )
2098
-     *
2099
-     *-- History ------------------------------------------
2100
-     *
2101
-     * 2003.05.24:
2102
-     * Mongoose - Created
2103
-     ------------------------------------------------------*/
2104
-
2105
-
2106
-    ////////////////////////////////////////////////////////////
2107
-    // Public Mutators
2108
-    ////////////////////////////////////////////////////////////
2109
 
2015
 
2016
+    /*!
2017
+     * \brief Load an external sound pak for TR2 and TR3
2018
+     * \param filename pak to load
2019
+     * \returns < 0 on error
2020
+     */
2110
     int loadSFX(char *filename);
2021
     int loadSFX(char *filename);
2111
-    /*------------------------------------------------------
2112
-     * Pre  :
2113
-     * Post : Loads an external sound pak for TR2 and TR3
2114
-     *        games.  Returns < 0 if error.
2115
-     *
2116
-     *-- History ------------------------------------------
2117
-     *
2118
-     * 2003.05.12:
2119
-     * Mongoose - Created
2120
-     ------------------------------------------------------*/
2121
 
2022
 
2122
     void reset();
2023
     void reset();
2123
 
2024
 
2124
     void setDebug(bool toggle);
2025
     void setDebug(bool toggle);
2125
 
2026
 
2027
+    /*!
2028
+     * \brief Sets lighting factor for each vertex color per room in TR3 paks
2029
+     * \param f new lighting factor
2030
+     */
2126
     void setRoomVertexLightingFactor(float f);
2031
     void setRoomVertexLightingFactor(float f);
2127
-    /*------------------------------------------------------
2128
-     * Pre  :
2129
-     * Post : Sets lighting factor for each vertex color per
2130
-     *        room in TR3 paks
2131
-     *
2132
-     *-- History ------------------------------------------
2133
-     *
2134
-     * 2003.05.13:
2135
-     * Mongoose - Created
2136
-     ------------------------------------------------------*/
2137
 
2032
 
2033
+    /*!
2034
+     * \brief Set scaling for sprite texel alignment, etc.
2035
+     * \param f new scaling factor
2036
+     */
2138
     void setTexelScalingFactor(float f);
2037
     void setTexelScalingFactor(float f);
2139
-    /*------------------------------------------------------
2140
-     * Pre  :
2141
-     * Post : Sets scaling for sprite texel alignment, etc
2142
-     *
2143
-     *-- History ------------------------------------------
2144
-     *
2145
-     * 2003.05.22:
2146
-     * Mongoose - Created
2147
-     ------------------------------------------------------*/
2148
-
2149
 
2038
 
2150
 private:
2039
 private:
2151
 
2040
 
2152
-    ////////////////////////////////////////////////////////////
2153
-    // Private Accessors
2154
-    ////////////////////////////////////////////////////////////
2155
-
2156
     void extractMeshes(unsigned char *mesh_data,
2041
     void extractMeshes(unsigned char *mesh_data,
2157
-                             unsigned int num_mesh_pointers,
2158
-                             unsigned int *mesh_pointers);
2042
+                        unsigned int num_mesh_pointers,
2043
+                        unsigned int *mesh_pointers);
2159
 
2044
 
2160
     int Fread(void *buffer, size_t size, size_t count, FILE *f);
2045
     int Fread(void *buffer, size_t size, size_t count, FILE *f);
2161
 
2046
 
2172
      ------------------------------------------------------*/
2057
      ------------------------------------------------------*/
2173
 
2058
 
2174
     void getRiffDataTR4(unsigned int index,
2059
     void getRiffDataTR4(unsigned int index,
2175
-                              unsigned int *bytes, unsigned char **data);
2060
+                        unsigned int *bytes, unsigned char **data);
2176
     /*------------------------------------------------------
2061
     /*------------------------------------------------------
2177
      * Pre  :
2062
      * Pre  :
2178
      * Post : Returns a copy of a TR4 sound sample
2063
      * Post : Returns a copy of a TR4 sound sample
2185
      ------------------------------------------------------*/
2070
      ------------------------------------------------------*/
2186
 
2071
 
2187
     int getRiffOffsets(unsigned char *riffData, unsigned int riffDataBytes,
2072
     int getRiffOffsets(unsigned char *riffData, unsigned int riffDataBytes,
2188
-                             unsigned int **offsets, unsigned int numOffsets);
2073
+                        unsigned int **offsets, unsigned int numOffsets);
2189
     /*------------------------------------------------------
2074
     /*------------------------------------------------------
2190
      * Pre  :
2075
      * Pre  :
2191
      * Post : Returns an array of offsets for a contigous
2076
      * Post : Returns an array of offsets for a contigous

Loading…
Cancel
Save