Browse Source

All Unit Tests without warning

Thomas Buck 11 years ago
parent
commit
db95bfd412
9 changed files with 76 additions and 67 deletions
  1. 1
    0
      ChangeLog
  2. 1
    1
      include/Sound.h
  3. 58
    58
      include/Texture.h
  4. 1
    1
      src/Sound.cpp
  5. 4
    4
      src/Texture.cpp
  6. 6
    1
      test/GLString.cpp
  7. 2
    1
      test/Sound.cpp
  8. 0
    0
      test/greatest.h
  9. 3
    1
      test/mtk_tga.cpp

+ 1
- 0
ChangeLog View File

6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
7
 
7
 
8
 	[ 20140110 ]
8
 	[ 20140110 ]
9
+	* All Unit Tests build without warning
9
 	* Converted many FIXME comments to be in the doxygen documentation
10
 	* Converted many FIXME comments to be in the doxygen documentation
10
 	* Removed hel & mstl folders, moved into parent directory
11
 	* Removed hel & mstl folders, moved into parent directory
11
 	* mtk_tga Unit Test uses greatest
12
 	* mtk_tga Unit Test uses greatest

+ 1
- 1
include/Sound.h View File

57
      * \param flags (un)set options. Use SoundFlags enum
57
      * \param flags (un)set options. Use SoundFlags enum
58
      * \returns 0 for no error or < 0 error flag
58
      * \returns 0 for no error or < 0 error flag
59
      */
59
      */
60
-    int addFile(char *filename, int *source, unsigned int flags);
60
+    int addFile(const char *filename, int *source, unsigned int flags);
61
 
61
 
62
     /*!
62
     /*!
63
      * \brief Load wav file from buffer
63
      * \brief Load wav file from buffer

+ 58
- 58
include/Texture.h View File

1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
 /*==========================================================================
2
 /*==========================================================================
3
- * 
3
+ *
4
  * Project : MTK, Freyja, OpenRaider
4
  * Project : MTK, Freyja, OpenRaider
5
  * Author  : Terry 'Mongoose' Hendrix II
5
  * Author  : Terry 'Mongoose' Hendrix II
6
  * Website : http://www.westga.edu/~stu7440
6
  * Website : http://www.westga.edu/~stu7440
10
  *
10
  *
11
  *           See file COPYING for license details.
11
  *           See file COPYING for license details.
12
  *
12
  *
13
- * 
14
- *-- History ---------------------------------------------------------- 
15
  *
13
  *
16
- * 2003.06.30, 
14
+ *-- History ----------------------------------------------------------
15
+ *
16
+ * 2003.06.30,
17
  * Mongoose - API update, SDL_TTF support moved here, misc features
17
  * Mongoose - API update, SDL_TTF support moved here, misc features
18
  *            SDL_TTF support based on Sam Lantinga's public domain
18
  *            SDL_TTF support based on Sam Lantinga's public domain
19
- *            SDL_TTF demo functions and algorithms 
19
+ *            SDL_TTF demo functions and algorithms
20
  *
20
  *
21
  * 2001.05.29:
21
  * 2001.05.29:
22
  * Mongoose - Removed legacy code and done clean up
22
  * Mongoose - Removed legacy code and done clean up
39
 	int x, y, w, h;
39
 	int x, y, w, h;
40
 	int minx; int maxx; int miny; int maxy; int advance;
40
 	int minx; int maxx; int miny; int maxy; int advance;
41
 
41
 
42
-} ttf_glyph_t; 
42
+} ttf_glyph_t;
43
 
43
 
44
 typedef struct
44
 typedef struct
45
 {
45
 {
46
 	unsigned int utf8Offset;
46
 	unsigned int utf8Offset;
47
-	unsigned int count;   
47
+	unsigned int count;
48
 
48
 
49
-/* [utf8Offset -> utf8Offset+count], 
49
+/* [utf8Offset -> utf8Offset+count],
50
 	 matches indexing into glyphs[0 -> count] for texcoords, etc
50
 	 matches indexing into glyphs[0 -> count] for texcoords, etc
51
 	----------------------------------------
51
 	----------------------------------------
52
 	41     -> 126     ASCII English w/ special chars,
52
 	41     -> 126     ASCII English w/ special chars,
62
 	int fontDescent;
62
 	int fontDescent;
63
 	int fontSpacing;
63
 	int fontSpacing;
64
 
64
 
65
-} ttf_texture_t; 
65
+} ttf_texture_t;
66
 
66
 
67
 
67
 
68
 typedef struct
68
 typedef struct
102
 
102
 
103
    Texture();
103
    Texture();
104
 	/*------------------------------------------------------
104
 	/*------------------------------------------------------
105
-	 * Pre  : 
105
+	 * Pre  :
106
 	 * Post : Constructs an object of Texture
106
 	 * Post : Constructs an object of Texture
107
 	 *
107
 	 *
108
 	 *-- History ------------------------------------------
108
 	 *-- History ------------------------------------------
110
 	 * 2001.05.29:
110
 	 * 2001.05.29:
111
 	 * Mongoose - Big code clean up, documentation
111
 	 * Mongoose - Big code clean up, documentation
112
 	 *
112
 	 *
113
-	 * 2000.10.05: 
113
+	 * 2000.10.05:
114
 	 * Mongoose - Created
114
 	 * Mongoose - Created
115
 	 ------------------------------------------------------*/
115
 	 ------------------------------------------------------*/
116
 
116
 
124
 	 * 2001.05.29:
124
 	 * 2001.05.29:
125
 	 * Mongoose - Big code clean up, documentation
125
 	 * Mongoose - Big code clean up, documentation
126
 	 *
126
 	 *
127
-	 * 2000.10.05: 
127
+	 * 2000.10.05:
128
 	 * Mongoose - Created
128
 	 * Mongoose - Created
129
 	 ------------------------------------------------------*/
129
 	 ------------------------------------------------------*/
130
 
130
 
134
 	////////////////////////////////////////////////////////////
134
 	////////////////////////////////////////////////////////////
135
 
135
 
136
 	static unsigned char *generateColorTexture(unsigned char rgba[4],
136
 	static unsigned char *generateColorTexture(unsigned char rgba[4],
137
-															 unsigned int width, 
137
+															 unsigned int width,
138
 															 unsigned int height);
138
 															 unsigned int height);
139
 	/*------------------------------------------------------
139
 	/*------------------------------------------------------
140
 	 * Pre  : <Rgba> is 32bpp RGBA color
140
 	 * Pre  : <Rgba> is 32bpp RGBA color
141
 	 *        <Width> and <Height> are powers of two, pref
141
 	 *        <Width> and <Height> are powers of two, pref
142
 	 *        the same number
142
 	 *        the same number
143
-	 * Post : 
143
+	 * Post :
144
 	 *
144
 	 *
145
 	 *-- History ------------------------------------------
145
 	 *-- History ------------------------------------------
146
 	 *
146
 	 *
150
 
150
 
151
 	gl_font_t *generateFont(ttf_texture_t *texture);
151
 	gl_font_t *generateFont(ttf_texture_t *texture);
152
 	/*------------------------------------------------------
152
 	/*------------------------------------------------------
153
-	 * Pre  : 
154
-	 * Post : 
153
+	 * Pre  :
154
+	 * Post :
155
 	 *
155
 	 *
156
 	 *-- History ------------------------------------------
156
 	 *-- History ------------------------------------------
157
 	 *
157
 	 *
159
 	 * Mongoose - Created
159
 	 * Mongoose - Created
160
 	 ------------------------------------------------------*/
160
 	 ------------------------------------------------------*/
161
 
161
 
162
-	ttf_texture_t *generateFontTexture(char *filename, int pointSize, 
162
+	ttf_texture_t *generateFontTexture(const char *filename, int pointSize,
163
 												  unsigned int textureWidth,
163
 												  unsigned int textureWidth,
164
 												  unsigned char color[3],
164
 												  unsigned char color[3],
165
 												  unsigned int utf8Offset,
165
 												  unsigned int utf8Offset,
172
 	 *        <Color> is RGB 24bit color
172
 	 *        <Color> is RGB 24bit color
173
 	 *        <Utf8Offset> is offset into font's encoding chart
173
 	 *        <Utf8Offset> is offset into font's encoding chart
174
 	 *        <Count> is number of glyphs to read from offset start
174
 	 *        <Count> is number of glyphs to read from offset start
175
-	 *        <Verbose> dumps debug info to stdout 
175
+	 *        <Verbose> dumps debug info to stdout
176
 	 *
176
 	 *
177
 	 * Post : Generates a font texture with typeset info from TTF
177
 	 * Post : Generates a font texture with typeset info from TTF
178
 	 *
178
 	 *
188
 
188
 
189
    int getTextureCount();
189
    int getTextureCount();
190
 	/*------------------------------------------------------
190
 	/*------------------------------------------------------
191
-	 * Pre  : 
191
+	 * Pre  :
192
 	 * Post : Returns number of textures in use, or -1 for
192
 	 * Post : Returns number of textures in use, or -1 for
193
 	 *        error ( Not initalized )
193
 	 *        error ( Not initalized )
194
 	 *
194
 	 *
197
 	 * 2001.05.29:
197
 	 * 2001.05.29:
198
 	 * Mongoose - Big code clean up, documentation
198
 	 * Mongoose - Big code clean up, documentation
199
 	 *
199
 	 *
200
-	 * 2000.10.05: 
200
+	 * 2000.10.05:
201
 	 * Mongoose - Created
201
 	 * Mongoose - Created
202
 	 ------------------------------------------------------*/
202
 	 ------------------------------------------------------*/
203
 
203
 
204
 	void glScreenShot(char *base, unsigned int width, unsigned int height);
204
 	void glScreenShot(char *base, unsigned int width, unsigned int height);
205
 	/*------------------------------------------------------
205
 	/*------------------------------------------------------
206
-	 * Pre  : <Base> is base filename, 
206
+	 * Pre  : <Base> is base filename,
207
 	 *        <Width> and <Height> are viewport dim
207
 	 *        <Width> and <Height> are viewport dim
208
 	 *
208
 	 *
209
-	 * Post : Dumps a screenshot to disk, 
209
+	 * Post : Dumps a screenshot to disk,
210
 	 *        avoids overwriting files with same base name
210
 	 *        avoids overwriting files with same base name
211
 	 *
211
 	 *
212
 	 *-- History ------------------------------------------
212
 	 *-- History ------------------------------------------
222
 
222
 
223
 	void bindMultiTexture(int texture0, int texture1);
223
 	void bindMultiTexture(int texture0, int texture1);
224
 	/*------------------------------------------------------
224
 	/*------------------------------------------------------
225
-	 * Pre  : 
225
+	 * Pre  :
226
 	 * Post : Sets up multitexture rendering with passed texture ids
226
 	 * Post : Sets up multitexture rendering with passed texture ids
227
 	 *
227
 	 *
228
 	 *-- History ------------------------------------------
228
 	 *-- History ------------------------------------------
241
 	 * 2001.05.29:
241
 	 * 2001.05.29:
242
 	 * Mongoose - Big code clean up, documentation
242
 	 * Mongoose - Big code clean up, documentation
243
 	 *
243
 	 *
244
-	 * 2000.10.05: 
244
+	 * 2000.10.05:
245
 	 * Mongoose - Created
245
 	 * Mongoose - Created
246
 	 ------------------------------------------------------*/
246
 	 ------------------------------------------------------*/
247
 
247
 
248
 	void clearFlag(TextureFlag flag);
248
 	void clearFlag(TextureFlag flag);
249
 	/*------------------------------------------------------
249
 	/*------------------------------------------------------
250
-	 * Pre  : 
250
+	 * Pre  :
251
 	 * Post : CLears a option flag
251
 	 * Post : CLears a option flag
252
 	 *
252
 	 *
253
 	 *-- History ------------------------------------------
253
 	 *-- History ------------------------------------------
258
 
258
 
259
 	void disableMultiTexture();
259
 	void disableMultiTexture();
260
 	/*------------------------------------------------------
260
 	/*------------------------------------------------------
261
-	 * Pre  : 
262
-	 * Post : 
261
+	 * Pre  :
262
+	 * Post :
263
 	 *
263
 	 *
264
 	 *-- History ------------------------------------------
264
 	 *-- History ------------------------------------------
265
 	 *
265
 	 *
269
 
269
 
270
 	void initSDL_TTF();
270
 	void initSDL_TTF();
271
 	/*------------------------------------------------------
271
 	/*------------------------------------------------------
272
-	 * Pre  : 
272
+	 * Pre  :
273
 	 * Post : Loads SDL_TTF if avalible
273
 	 * Post : Loads SDL_TTF if avalible
274
 	 *
274
 	 *
275
 	 *-- History ------------------------------------------
275
 	 *-- History ------------------------------------------
278
 	 * Mongoose - Created
278
 	 * Mongoose - Created
279
 	 ------------------------------------------------------*/
279
 	 ------------------------------------------------------*/
280
 
280
 
281
-   int loadBuffer(unsigned char *image, 
282
-						unsigned int width, unsigned int height, 
281
+   int loadBuffer(unsigned char *image,
282
+						unsigned int width, unsigned int height,
283
 						ColorMode mode, unsigned int bpp);
283
 						ColorMode mode, unsigned int bpp);
284
 	/*------------------------------------------------------
284
 	/*------------------------------------------------------
285
 	 * Pre  : image must be a valid pixmap that agrees
285
 	 * Pre  : image must be a valid pixmap that agrees
292
 	 * 2001.05.29:
292
 	 * 2001.05.29:
293
 	 * Mongoose - Big code clean up, documentation
293
 	 * Mongoose - Big code clean up, documentation
294
 	 *
294
 	 *
295
-	 * 2000.10.05: 
295
+	 * 2000.10.05:
296
 	 * Mongoose - Created
296
 	 * Mongoose - Created
297
 	 ------------------------------------------------------*/
297
 	 ------------------------------------------------------*/
298
 
298
 
299
-   int loadBufferSlot(unsigned char *image, 
300
-							 unsigned int width, unsigned int height, 
299
+   int loadBufferSlot(unsigned char *image,
300
+							 unsigned int width, unsigned int height,
301
 							 ColorMode mode, unsigned int bpp,
301
 							 ColorMode mode, unsigned int bpp,
302
 							 unsigned int slot);
302
 							 unsigned int slot);
303
 	/*------------------------------------------------------
303
 	/*------------------------------------------------------
308
 	 *
308
 	 *
309
 	 *-- History ------------------------------------------
309
 	 *-- History ------------------------------------------
310
 	 *
310
 	 *
311
-	 * 2002.09.05: 
311
+	 * 2002.09.05:
312
 	 * Mongoose - Created
312
 	 * Mongoose - Created
313
 	 ------------------------------------------------------*/
313
 	 ------------------------------------------------------*/
314
 
314
 
315
 	int loadColorTexture(unsigned char rgba[4],
315
 	int loadColorTexture(unsigned char rgba[4],
316
 								unsigned int width, unsigned int height);
316
 								unsigned int width, unsigned int height);
317
 	/*------------------------------------------------------
317
 	/*------------------------------------------------------
318
-	 * Pre  : 
318
+	 * Pre  :
319
 	 * Post : Generates and loads a solid color texture,
319
 	 * Post : Generates and loads a solid color texture,
320
 	 *        returns texture Id or -1 if failed
320
 	 *        returns texture Id or -1 if failed
321
 	 *
321
 	 *
325
 	 * Mongoose - Created
325
 	 * Mongoose - Created
326
 	 ------------------------------------------------------*/
326
 	 ------------------------------------------------------*/
327
 
327
 
328
-	int loadFontTTF(char *filename, 
328
+	int loadFontTTF(const char *filename,
329
 						 unsigned int utf8Offset, unsigned int count);
329
 						 unsigned int utf8Offset, unsigned int count);
330
 	/*------------------------------------------------------
330
 	/*------------------------------------------------------
331
 	 * Pre  : <Filename> of TTF font
331
 	 * Pre  : <Filename> of TTF font
332
 	 *        <Utf8Offset> is offset into UNICODE table
332
 	 *        <Utf8Offset> is offset into UNICODE table
333
 	 *        <Count> is number of glyphs to load
333
 	 *        <Count> is number of glyphs to load
334
 	 *
334
 	 *
335
-	 * Post : Loads a TTF, 
335
+	 * Post : Loads a TTF,
336
 	 *        Generates: texture image, glyph list, and drawlist
336
 	 *        Generates: texture image, glyph list, and drawlist
337
 	 *
337
 	 *
338
 	 *        Returns font id if sucessful, or < 0 if error
338
 	 *        Returns font id if sucessful, or < 0 if error
343
 	 * Mongoose - Created
343
 	 * Mongoose - Created
344
 	 ------------------------------------------------------*/
344
 	 ------------------------------------------------------*/
345
 
345
 
346
-	int loadPNG(char *filename);
346
+	int loadPNG(const char *filename);
347
 	/*------------------------------------------------------
347
 	/*------------------------------------------------------
348
 	 * Pre  : Texture is init and filename/file is valid
348
 	 * Pre  : Texture is init and filename/file is valid
349
 	 * Post : Loads PNG as texture and returns ID or -1 error
349
 	 * Post : Loads PNG as texture and returns ID or -1 error
354
 	 * Mongoose - Created, from Freyja
354
 	 * Mongoose - Created, from Freyja
355
 	 ------------------------------------------------------*/
355
 	 ------------------------------------------------------*/
356
 
356
 
357
-	int loadTGA(char *filename);
357
+	int loadTGA(const char *filename);
358
 	/*------------------------------------------------------
358
 	/*------------------------------------------------------
359
 	 * Pre  : Texture is init and filename/file is valid
359
 	 * Pre  : Texture is init and filename/file is valid
360
 	 * Post : Loads TGA as texture and returns ID or -1 error
360
 	 * Post : Loads TGA as texture and returns ID or -1 error
367
 
367
 
368
    void reset();
368
    void reset();
369
 	/*------------------------------------------------------
369
 	/*------------------------------------------------------
370
-	 * Pre  : 
370
+	 * Pre  :
371
 	 * Post : Resets all texture data
371
 	 * Post : Resets all texture data
372
 	 *
372
 	 *
373
 	 *-- History ------------------------------------------
373
 	 *-- History ------------------------------------------
375
 	 * 2001.05.29:
375
 	 * 2001.05.29:
376
 	 * Mongoose - Big code clean up, documentation
376
 	 * Mongoose - Big code clean up, documentation
377
 	 *
377
 	 *
378
-	 * 2000.10.05: 
378
+	 * 2000.10.05:
379
 	 * Mongoose - Created
379
 	 * Mongoose - Created
380
 	 ------------------------------------------------------*/
380
 	 ------------------------------------------------------*/
381
 
381
 
382
 	void setFlag(TextureFlag flag);
382
 	void setFlag(TextureFlag flag);
383
 	/*------------------------------------------------------
383
 	/*------------------------------------------------------
384
-	 * Pre  : 
384
+	 * Pre  :
385
 	 * Post : Sets a option flag
385
 	 * Post : Sets a option flag
386
 	 *
386
 	 *
387
 	 *-- History ------------------------------------------
387
 	 *-- History ------------------------------------------
393
 	void setMaxTextureCount(unsigned int n);
393
 	void setMaxTextureCount(unsigned int n);
394
 	/*------------------------------------------------------
394
 	/*------------------------------------------------------
395
 	 * Pre  : n is max number of textures you wish to allow
395
 	 * Pre  : n is max number of textures you wish to allow
396
-	 * Post : Sets up GL texturing, and must be called 
396
+	 * Post : Sets up GL texturing, and must be called
397
 	 *        as the first setup step
397
 	 *        as the first setup step
398
 	 *
398
 	 *
399
 	 *-- History ------------------------------------------
399
 	 *-- History ------------------------------------------
401
 	 * 2001.05.29:
401
 	 * 2001.05.29:
402
 	 * Mongoose - Big code clean up, documentation
402
 	 * Mongoose - Big code clean up, documentation
403
 	 *
403
 	 *
404
-	 * 2000.10.05: 
404
+	 * 2000.10.05:
405
 	 * Mongoose - Created
405
 	 * Mongoose - Created
406
 	 ------------------------------------------------------*/
406
 	 ------------------------------------------------------*/
407
 
407
 
408
 	void useMultiTexture(float u, float v);
408
 	void useMultiTexture(float u, float v);
409
 	/*------------------------------------------------------
409
 	/*------------------------------------------------------
410
-	 * Pre  : 
411
-	 * Post : 
410
+	 * Pre  :
411
+	 * Post :
412
 	 *
412
 	 *
413
 	 *-- History ------------------------------------------
413
 	 *-- History ------------------------------------------
414
 	 *
414
 	 *
418
 
418
 
419
 	void useMultiTexture(float aU, float aV, float bU, float bV);
419
 	void useMultiTexture(float aU, float aV, float bU, float bV);
420
 	/*------------------------------------------------------
420
 	/*------------------------------------------------------
421
-	 * Pre  : 
422
-	 * Post : 
421
+	 * Pre  :
422
+	 * Post :
423
 	 *
423
 	 *
424
 	 *-- History ------------------------------------------
424
 	 *-- History ------------------------------------------
425
 	 *
425
 	 *
436
 
436
 
437
 	int nextPower(int seed);
437
 	int nextPower(int seed);
438
 	/*------------------------------------------------------
438
 	/*------------------------------------------------------
439
-	 * Pre  : 
440
-	 * Post : 
439
+	 * Pre  :
440
+	 * Post :
441
 	 *
441
 	 *
442
 	 *-- History ------------------------------------------
442
 	 *-- History ------------------------------------------
443
 	 *
443
 	 *
445
 	 * Mongoose - Created
445
 	 * Mongoose - Created
446
 	 ------------------------------------------------------*/
446
 	 ------------------------------------------------------*/
447
 
447
 
448
-	unsigned char *scaleBuffer(unsigned char *image, int width, int height,	
448
+	unsigned char *scaleBuffer(unsigned char *image, int width, int height,
449
 										int components);
449
 										int components);
450
 	/*------------------------------------------------------
450
 	/*------------------------------------------------------
451
-	 * Pre  : 
452
-	 * Post : 
451
+	 * Pre  :
452
+	 * Post :
453
 	 *
453
 	 *
454
 	 *-- History ------------------------------------------
454
 	 *-- History ------------------------------------------
455
 	 *
455
 	 *
465
    unsigned int *mTextureIds;		/* GL texture list */
465
    unsigned int *mTextureIds;		/* GL texture list */
466
 
466
 
467
    unsigned int mTextureCount;	/* Texture counter */
467
    unsigned int mTextureCount;	/* Texture counter */
468
-	
468
+
469
    unsigned int mTextureLimit;	/* The texture limit */
469
    unsigned int mTextureLimit;	/* The texture limit */
470
 
470
 
471
 	unsigned int mFlags;				/* Class options */
471
 	unsigned int mFlags;				/* Class options */
479
 /* Experimental testing */
479
 /* Experimental testing */
480
 void bufferedPrintf(char *string, unsigned int len, char *s, ...);
480
 void bufferedPrintf(char *string, unsigned int len, char *s, ...);
481
 
481
 
482
-void glPrint3d(float x, float y, float z, 
483
-					float pitch, float yaw, float roll, 
482
+void glPrint3d(float x, float y, float z,
483
+					float pitch, float yaw, float roll,
484
 					float scale,
484
 					float scale,
485
 					char *string);
485
 					char *string);
486
 
486
 
488
 
488
 
489
 	void glEnterMode2d(unsigned int width, unsigned int height);
489
 	void glEnterMode2d(unsigned int width, unsigned int height);
490
 	/*------------------------------------------------------
490
 	/*------------------------------------------------------
491
-	 * Pre  : 
491
+	 * Pre  :
492
 	 * Post : OpenGL ortho projection
492
 	 * Post : OpenGL ortho projection
493
 	 *
493
 	 *
494
 	 *-- History ------------------------------------------
494
 	 *-- History ------------------------------------------
499
 
499
 
500
 	void glExitMode2d();
500
 	void glExitMode2d();
501
 	/*------------------------------------------------------
501
 	/*------------------------------------------------------
502
-	 * Pre  : 
502
+	 * Pre  :
503
 	 * Post : OpenGL model matrix projection
503
 	 * Post : OpenGL model matrix projection
504
 	 *
504
 	 *
505
 	 *-- History ------------------------------------------
505
 	 *-- History ------------------------------------------

+ 1
- 1
src/Sound.cpp View File

111
 
111
 
112
 
112
 
113
 //! \fixme Seperate sourcing and buffering, Mongoose 2002.01.04
113
 //! \fixme Seperate sourcing and buffering, Mongoose 2002.01.04
114
-int Sound::addFile(char *filename, int *source, unsigned int flags)
114
+int Sound::addFile(const char *filename, int *source, unsigned int flags)
115
 {
115
 {
116
 #ifdef USING_OPENAL
116
 #ifdef USING_OPENAL
117
    ALsizei size;
117
    ALsizei size;

+ 4
- 4
src/Texture.cpp View File

242
 }
242
 }
243
 
243
 
244
 
244
 
245
-int Texture::loadFontTTF(char *filename,
245
+int Texture::loadFontTTF(const char *filename,
246
 								 unsigned int utf8Offset, unsigned int count)
246
 								 unsigned int utf8Offset, unsigned int count)
247
 {
247
 {
248
 	ttf_texture_t *texture;
248
 	ttf_texture_t *texture;
380
 }
380
 }
381
 
381
 
382
 
382
 
383
-ttf_texture_t *Texture::generateFontTexture(char *filename, int pointSize,
383
+ttf_texture_t *Texture::generateFontTexture(const char *filename, int pointSize,
384
 														  unsigned int textureWidth,
384
 														  unsigned int textureWidth,
385
 														  unsigned char color[3],
385
 														  unsigned char color[3],
386
 														  unsigned int utf8Offset,
386
 														  unsigned int utf8Offset,
998
 }
998
 }
999
 
999
 
1000
 
1000
 
1001
-int Texture::loadPNG(char *filename)
1001
+int Texture::loadPNG(const char *filename)
1002
 {
1002
 {
1003
 #ifdef USING_MTK_PNG
1003
 #ifdef USING_MTK_PNG
1004
 	FILE *f;
1004
 	FILE *f;
1057
 }
1057
 }
1058
 
1058
 
1059
 
1059
 
1060
-int Texture::loadTGA(char *filename)
1060
+int Texture::loadTGA(const char *filename)
1061
 {
1061
 {
1062
 #ifdef USING_MTK_TGA
1062
 #ifdef USING_MTK_TGA
1063
 	FILE *f;
1063
 	FILE *f;

+ 6
- 1
test/GLString.cpp View File

37
 	aspect = (GLfloat)width/(GLfloat)height;
37
 	aspect = (GLfloat)width/(GLfloat)height;
38
 
38
 
39
 	// Mongoose 2002.01.01, Setup view volume, with a nice FOV
39
 	// Mongoose 2002.01.01, Setup view volume, with a nice FOV
40
-	gluPerspective(40.0, aspect, 1, 2000);
40
+    // gluPerspective is deprecated!
41
+	// gluPerspective(40.0, aspect, 1, 2000);
42
+    // fix: http://stackoverflow.com/a/2417756
43
+    GLfloat fH = tan(float(40.0 / 360.0f * 3.14159f));
44
+    GLfloat fW = fH * aspect;
45
+    glFrustum(-fW, fW, -fH, fH, 1, 2000);
41
 
46
 
42
 	glMatrixMode(GL_MODELVIEW);
47
 	glMatrixMode(GL_MODELVIEW);
43
 }
48
 }

+ 2
- 1
test/Sound.cpp View File

8
 #include <stdio.h>
8
 #include <stdio.h>
9
 #include <unistd.h>
9
 #include <unistd.h>
10
 
10
 
11
-#include <greatest.h>
12
 #include <Sound.h>
11
 #include <Sound.h>
13
 
12
 
13
+#include "greatest.h"
14
+
14
 #define TESTFILE "data/sample.wav"
15
 #define TESTFILE "data/sample.wav"
15
 
16
 
16
 Sound sound;
17
 Sound sound;

include/greatest.h → test/greatest.h View File


+ 3
- 1
test/mtk_tga.cpp View File

6
  */
6
  */
7
 #include <stdio.h>
7
 #include <stdio.h>
8
 #include <stdlib.h>
8
 #include <stdlib.h>
9
-#include <greatest.h>
9
+
10
 #include <mtk_tga.h>
10
 #include <mtk_tga.h>
11
 
11
 
12
+#include "greatest.h"
13
+
12
 #define TESTFILE "data/font-0.tga"
14
 #define TESTFILE "data/font-0.tga"
13
 FILE *f = NULL;
15
 FILE *f = NULL;
14
 
16
 

Loading…
Cancel
Save