Sfoglia il codice sorgente

Reenabled ALUT.

Trying to build with freeALUT on Mac. Segfaults on launch.
Thomas Buck 10 anni fa
parent
commit
87875896ee
7 ha cambiato i file con 535 aggiunte e 509 eliminazioni
  1. 27
    15
      Makefile
  2. 14
    6
      README.md
  3. 3
    3
      src/Md3.cpp
  4. 68
    68
      src/Md3.h
  5. 7
    1
      src/Sound.cpp
  6. 2
    2
      src/TombRaider.cpp
  7. 414
    414
      src/TombRaider.h

+ 27
- 15
Makefile Vedi File

@@ -15,13 +15,14 @@ NAME_DEB=openraider
15 15
 MAJOR_VERSION=0
16 16
 MINOR_VERSION=1
17 17
 MICRO_VERSION=1
18
-BUILD_ID=20030713
18
+BUILD_ID=20131214
19 19
 PRE=
20 20
 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)$(PRE)
21 21
 VERSION_DEB=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION).$(BUILD_ID)
22 22
 BUILD_HOST=$(shell uname -s -n -r -m)
23
-#ARCH=$(shell uname -m)
24
-ARCH=i386
23
+ARCH=$(shell uname -m)
24
+#ARCH=i386
25
+UNAME=$(shell uname -s)
25 26
 
26 27
 ###############################################################
27 28
 
@@ -43,12 +44,20 @@ DEBUG_OBJ=
43 44
 
44 45
 ###############################################################
45 46
 # OpenAL, Sound support
46
-#BASE_DEFS += -DHAVE_OPENAL
47
-#BASE_LIBS += -lopenal
47
+BASE_DEFS += -DHAVE_OPENAL
48
+
49
+ifeq ($(UNAME),Darwin)
50
+BASE_LIBS += -lalut
51
+BASE_LIBS += -framework OpenAL
52
+BASE_LIBS += -framework OpenGL
53
+BASE_LIBS += -framework GLUT
54
+else
55
+BASE_LIBS += -lopenal
56
+endif
48 57
 
49 58
 # libferit, File transfer via HTTP/FTP/etc support
50 59
 LIBFERIT_LIB=/usr/local/lib/libferit.so
51
-LIBFERIT=$(shell if test -e $(LIBFERIT_LIB) > /dev/null; then echo -n yes; fi)
60
+LIBFERIT=$(shell if test -e $(LIBFERIT_LIB) > /dev/null; then echo yes; fi)
52 61
 
53 62
 ifeq ($(LIBFERIT), yes)
54 63
 	BASE_DEFS += -DHAVE_LIBFERIT
@@ -57,7 +66,7 @@ endif
57 66
 
58 67
 ###############################################################
59 68
 
60
-TREE_DIR=OpenRaider.cvs
69
+TREE_DIR=OpenRaider
61 70
 BUILD_DEBUG_DIR=bin/debug
62 71
 BUILD_RELEASE_DIR=bin/release
63 72
 BUILD_PROF_DIR=bin/prof
@@ -81,7 +90,7 @@ BASE_CFLAGS=-Wall $(BASE_DEFS) \
81 90
 	-DVERSION=\"\\\"$(NAME)-$(VERSION)-$(BUILD_ID)\\\"\" \
82 91
 	-DBUILD_HOST=\"\\\"$(BUILD_HOST)\\\"\"
83 92
 
84
-LD_FLAGS=-framework OpenGL -framework GLUT -L/opt/X11/lib -L/opt/local/lib -lXmu -lXt -lSM -lICE -lXext -lX11 -lXi \
93
+LD_FLAGS=-L/opt/X11/lib -L/opt/local/lib -lXmu -lXt -lSM -lICE -lXext -lX11 -lXi \
85 94
 	-lGL -lGLU -lm $(BASE_LIBS)
86 95
 
87 96
 RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
@@ -146,7 +155,7 @@ memory:
146 155
 	LD_FLAGS="$(LD_FLAGS)"
147 156
 
148 157
 depend:
149
-	@-echo -n "Making deps..."
158
+	@-echo "Making deps..."
150 159
 	@-echo "# Autogenerated dependency file" > depend
151 160
 	@-find ./src -name "*.cpp" -exec ./deps.sh $(BASE_DEFS) {} \; >> depend
152 161
 	@-echo "       [done]"
@@ -191,6 +200,9 @@ OBJS = \
191 200
 
192 201
 $(BUILDDIR)/$(NAME) : $(OBJS)
193 202
 	$(CC) $(CFLAGS) $(LD_FLAGS) -o $@ $(OBJS)
203
+ifeq ($(UNAME),Darwin)
204
+	install_name_tool -change libalut.0.1.0.dylib /opt/local/lib/libalut.0.1.0.dylib $@
205
+endif
194 206
 
195 207
 #################################################################
196 208
 
@@ -201,19 +213,19 @@ $(BUILDDIR)/$(NAME) : $(OBJS)
201 213
 clean: clean-emacs clean-build clean-test clean-obj clean-dep
202 214
 
203 215
 clean-dep:
204
-	@-echo -n "Cleaning dependencies                        "
216
+	@-echo "Cleaning dependencies                        "
205 217
 	@-rm -f depend
206 218
 	@-echo "[DONE]"
207 219
 
208 220
 clean-test:
209
-	@-echo -n "Cleaning test builds                         "
221
+	@-echo "Cleaning test builds                         "
210 222
 	@-rm -f $(BUILD_TEST_DIR)/*.o
211 223
 	@-rm -f $(BUILD_TEST_DIR)/*.test
212 224
 	@-rm -rf $(BUILD_TEST_DIR)/*.build
213 225
 	@-echo "[DONE]"
214 226
 
215 227
 clean-obj:
216
-	@-echo -n "Cleaning objects                             "
228
+	@-echo "Cleaning objects                             "
217 229
 	@-rm -f $(BUILD_PROF_DIR)/*.o
218 230
 	@-rm -f $(BUILD_DEBUG_DIR)/*.o
219 231
 	@-rm -f $(BUILD_RELEASE_DIR)/*.o
@@ -222,12 +234,12 @@ clean-obj:
222 234
 	@-echo "[DONE]"
223 235
 
224 236
 clean-emacs:
225
-	@-echo -n "Cleaning emacs files                         "
237
+	@-echo "Cleaning emacs files                         "
226 238
 	@-rm -f `find . -name "*~" -print`
227 239
 	@-echo "[DONE]"
228 240
 
229 241
 clean-build:
230
-	@-echo -n "Cleaning builds                              "
242
+	@-echo "Cleaning builds                              "
231 243
 	@-rm -f $(BUILD_PROF_DIR)/$(NAME)
232 244
 	@-rm -f $(BUILD_DEBUG_DIR)/$(NAME)
233 245
 	@-rm -f $(BUILD_RELEASE_DIR)/$(NAME)
@@ -235,7 +247,7 @@ clean-build:
235 247
 	@-echo "[DONE]"
236 248
 
237 249
 clean-deb:
238
-	@-echo -n "Cleaning DEBs                                "
250
+	@-echo "Cleaning DEBs                                "
239 251
 	@-rm -rf $(DEB_DIR)
240 252
 	@-echo "[DONE]"
241 253
 

+ 14
- 6
README.md Vedi File

@@ -6,6 +6,20 @@ This project aims to get OpenRaider running in a modern Unix.
6 6
 
7 7
 ## Dependencies
8 8
 
9
+On Mac OS X 10.9 with [XCode](https://developer.apple.com/xcode/) and [MacPorts](http://www.macports.org) installed, the following should be enough:
10
+
11
+    sudo port install libsdl libsdl_ttf cmake
12
+
13
+You will also need an installed [X11 Server](http://xquartz.macosforge.org/trac)!
14
+
15
+Also, to get Sound, get [freealut](https://github.com/vancegroup/freealut) and compile it like this:
16
+
17
+    mkdir build
18
+    cd build
19
+    cmake .. -DCMAKE_INSTALL_PREFIX:STRING="/opt/local" -DCMAKE_C_FLAGS:STRING="-O2"
20
+    make
21
+    sudo make install
22
+
9 23
 + Linux 2.4.16 SMP kernel (Debian distrobution)
10 24
 + GCC 2.95.2 compiler and supporting development packages
11 25
 + X11 4.1.0 with X11 development package
@@ -14,12 +28,6 @@ This project aims to get OpenRaider running in a modern Unix.
14 28
 + OpenAL 0.0.6 development package
15 29
 + libz 1.1.3 development package
16 30
 
17
-On Mac OS X 10.9 with [XCode](https://developer.apple.com/xcode/) and [MacPorts](http://www.macports.org) installed, the following should be enough:
18
-
19
-    sudo port install libsdl libsdl_ttf
20
-
21
-You will also need an installed [X11 Server](http://xquartz.macosforge.org/trac)!
22
-
23 31
 ## License
24 32
 
25 33
 OpenRaider is based on code, specs, and alogrithms from:

+ 3
- 3
src/Md3.cpp Vedi File

@@ -842,7 +842,7 @@ int Md3::save(char *filename)
842 842
 // Private Mutators
843 843
 ////////////////////////////////////////////////////////////
844 844
 
845
-void Md3::printDebug(char *method, char *s, ...)
845
+void Md3::printDebug(const char *method, const char *s, ...)
846 846
 {
847 847
 	va_list args;
848 848
 
@@ -860,7 +860,7 @@ void Md3::printDebug(char *method, char *s, ...)
860 860
 }
861 861
 
862 862
 
863
-void Md3::printError(char *method, char *s, ...)
863
+void Md3::printError(const char *method, const char *s, ...)
864 864
 {
865 865
 	va_list args;
866 866
 
@@ -873,7 +873,7 @@ void Md3::printError(char *method, char *s, ...)
873 873
 }
874 874
 
875 875
 
876
-void Md3::printWarning(char *method, char *s, ...)
876
+void Md3::printWarning(const char *method, const char *s, ...)
877 877
 {
878 878
 	va_list args;
879 879
 

+ 68
- 68
src/Md3.h Vedi File

@@ -1,6 +1,6 @@
1 1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2 2
 /*==========================================================================
3
- * 
3
+ *
4 4
  * Project : Freyja
5 5
  * Author  : Terry 'Mongoose' Hendrix II
6 6
  * Website : http://gooseegg.sourceforge.net
@@ -17,11 +17,11 @@
17 17
  *           so - since this class is desgined using their specs...
18 18
  *
19 19
  *-- Test Defines -----------------------------------------------------
20
- *           
21
- * UNIT_TEST_MD3      - Builds Md3 class as a console unit test program 
20
+ *
21
+ * UNIT_TEST_MD3      - Builds Md3 class as a console unit test program
22 22
  * UNIT_TEST_MD3_LV2  - Does more debugging when used with unit test
23 23
  *
24
- *-- History ---------------------------------------------------------- 
24
+ *-- History ----------------------------------------------------------
25 25
  *
26 26
  * 2002.10.19:
27 27
  * Mongoose - Interface update, Animation support starts
@@ -53,21 +53,21 @@ typedef float mat3_t[3][3];
53 53
 
54 54
 typedef struct md3_tag_s
55 55
 {
56
-  char name[64];    /* Name of 'tag' as it's usually 
57
-							  called in the md3 files try to 
58
-							  see it as a sub-mesh/seperate 
59
-							  mesh-part. 
60
-							  
61
-							  Sometimes this 64 string may 
62
-							  contain some garbage, but 
56
+  char name[64];    /* Name of 'tag' as it's usually
57
+							  called in the md3 files try to
58
+							  see it as a sub-mesh/seperate
59
+							  mesh-part.
60
+
61
+							  Sometimes this 64 string may
62
+							  contain some garbage, but
63 63
 							  i've been told this is because
64 64
 							  some tools leave garbage in
65 65
 							  those strings, but they ARE
66 66
 							  strings... */
67 67
 
68 68
   vec3_t center;    /* Relative position of tag */
69
- 
70
-  mat3_t rotation;  /* The direction the tag is facing 
69
+
70
+  mat3_t rotation;  /* The direction the tag is facing
71 71
 							  relative to the rest of the model */
72 72
 
73 73
 } md3_tag_t;
@@ -79,7 +79,7 @@ typedef struct md3_boneframe_s
79 79
   float  maxs[3];
80 80
   float  center[3];
81 81
   float  scale;
82
-  char   creator[16]; 
82
+  char   creator[16];
83 83
 
84 84
 } md3_bone_t;
85 85
 
@@ -87,7 +87,7 @@ typedef struct md3_boneframe_s
87 87
 typedef struct md3_skin_s
88 88
 {
89 89
   char name[68];       /* Name of skin used by mesh
90
-								  65 chars, 
90
+								  65 chars,
91 91
 								  32 bit aligned == 68 chars  */
92 92
 
93 93
   int index;           /* For shader use (skin is a shader) */
@@ -113,10 +113,10 @@ typedef struct md3_vertex_s
113 113
 {
114 114
   signed short pos[3];       /* Vertex X/Y/Z coordinate */
115 115
 
116
-  unsigned char st[2];       /* Enviromental mapping 
117
-										  texture coordinates 
116
+  unsigned char st[2];       /* Enviromental mapping
117
+										  texture coordinates
118 118
 										  (Acutally encoded normal?) */
119
-	
119
+
120 120
 	float norm[3];            /* Decoded normal from above decoded */
121 121
 
122 122
 } md3_vertex_t;
@@ -128,37 +128,37 @@ typedef struct md3_mesh_s
128 128
 
129 129
   char id[4];          /* Mesh alias id, must be IDP3  */
130 130
 
131
-  char name[68];       /* Name of mesh  
131
+  char name[68];       /* Name of mesh
132 132
 								  65 chars,
133 133
 								  32 bit aligned == 68 chars */
134 134
   int flags;
135 135
 
136 136
 
137
-  int  num_frames;     /* Number of VertexMorph frames 
137
+  int  num_frames;     /* Number of VertexMorph frames
138 138
 								  in mesh */
139 139
 
140 140
   int num_shaders;     /* Number of shaders in mesh*/
141 141
 
142
-  int  num_skins;      /* Number of skins in mesh, 
142
+  int  num_skins;      /* Number of skins in mesh,
143 143
 								  for backwards compatibility with
144 144
 								  incorrect/obsolete spec  */
145 145
 
146 146
   int  num_vertices;   /* Number of vertices */
147
- 
147
+
148 148
   int  num_triangles;  /* Number of triangles */
149
- 
150
-  int  tris_offset;    /* Starting position of 
151
-								  Triangle data, relative 
149
+
150
+  int  tris_offset;    /* Starting position of
151
+								  Triangle data, relative
152 152
 								  to start of Mesh_Header  */
153 153
 
154 154
   int  header_size;    /* Size of header  */
155
-  
156
-  int  texel_offset;   /* Starting position of 
157
-								  texvector data, relative 
155
+
156
+  int  texel_offset;   /* Starting position of
157
+								  texvector data, relative
158 158
 								  to start of Mesh_Header */
159
- 
160
-  int  vertex_offset;  /* Starting position of 
161
-								  vertex data,relative 
159
+
160
+  int  vertex_offset;  /* Starting position of
161
+								  vertex data,relative
162 162
 								  to start of Mesh_Header  */
163 163
 
164 164
   int  mesh_size;      /* Size of mesh  */
@@ -171,7 +171,7 @@ typedef struct md3_mesh_s
171 171
   md3_tri_index_t *tris;  /* Triangles */
172 172
 
173 173
   md3_texel_t *texel;     /* Texels */
174
-  
174
+
175 175
   md3_vertex_t *vertex;   /* Vertices */
176 176
 
177 177
 } md3_mesh_t;
@@ -192,7 +192,7 @@ public:
192 192
 
193 193
 	Md3();
194 194
 	/*------------------------------------------------------
195
-	 * Pre  : 
195
+	 * Pre  :
196 196
 	 * Post : Md3 object is constructed
197 197
 	 *
198 198
 	 *-- History ------------------------------------------
@@ -230,10 +230,10 @@ public:
230 230
 	////////////////////////////////////////////////////////////
231 231
 	// Public Accessors
232 232
 	////////////////////////////////////////////////////////////
233
-  
233
+
234 234
 	unsigned int getNumMeshes();
235 235
 	/*------------------------------------------------------
236
-	 * Pre  : 
236
+	 * Pre  :
237 237
 	 * Post : Mesh count is returned
238 238
 	 *
239 239
 	 *-- History ------------------------------------------
@@ -245,7 +245,7 @@ public:
245 245
 
246 246
 	unsigned int getNumTags();
247 247
 	/*------------------------------------------------------
248
-	 * Pre  : 
248
+	 * Pre  :
249 249
 	 * Post : Tag count is returned
250 250
 	 *
251 251
 	 *-- History ------------------------------------------
@@ -254,10 +254,10 @@ public:
254 254
 	 * Mongoose - Created, Obsoletes:
255 255
 	 *            2000.06.03, int NumTags();
256 256
 	 ------------------------------------------------------*/
257
-  
257
+
258 258
 	unsigned int getNumBones();
259 259
 	/*------------------------------------------------------
260
-	 * Pre  : 
260
+	 * Pre  :
261 261
 	 * Post : Bone count is returned
262 262
 	 *
263 263
 	 *-- History ------------------------------------------
@@ -269,7 +269,7 @@ public:
269 269
 
270 270
 	md3_mesh_t *getMeshes();
271 271
 	/*------------------------------------------------------
272
-	 * Pre  : 
272
+	 * Pre  :
273 273
 	 * Post : Mesh list is returned
274 274
 	 *
275 275
 	 *-- History ------------------------------------------
@@ -278,10 +278,10 @@ public:
278 278
 	 * Mongoose - Created, Obsoletes:
279 279
 	 *            2000.06.03, md3_mesh_t *Mesh();
280 280
 	 ------------------------------------------------------*/
281
-  
281
+
282 282
 	md3_tag_t *getTags();
283 283
 	/*------------------------------------------------------
284
-	 * Pre  : 
284
+	 * Pre  :
285 285
 	 * Post : Tag list is returned
286 286
 	 *
287 287
 	 *-- History ------------------------------------------
@@ -290,10 +290,10 @@ public:
290 290
 	 * Mongoose - Created, Obsoletes:
291 291
 	 *            2000.06.03, md3_tag_t *Tag();
292 292
 	 ------------------------------------------------------*/
293
-  
293
+
294 294
 	md3_bone_t *getBones();
295 295
 	/*------------------------------------------------------
296
-	 * Pre  : 
296
+	 * Pre  :
297 297
 	 * Post : Bone list is returned
298 298
 	 *
299 299
 	 *-- History ------------------------------------------
@@ -307,10 +307,10 @@ public:
307 307
 	////////////////////////////////////////////////////////////
308 308
 	// Public Mutators
309 309
 	////////////////////////////////////////////////////////////
310
-  
310
+
311 311
 	void toggleFlag(Md3Flag flag);
312 312
 	/*------------------------------------------------------
313
-	 * Pre  : 
313
+	 * Pre  :
314 314
 	 * Post : Toggles a flag
315 315
 	 *
316 316
 	 *-- History ------------------------------------------
@@ -321,7 +321,7 @@ public:
321 321
 
322 322
 	void reset();
323 323
 	/*------------------------------------------------------
324
-	 * Pre  : 
324
+	 * Pre  :
325 325
 	 * Post : Resets all model data
326 326
 	 *
327 327
 	 *-- History ------------------------------------------
@@ -332,7 +332,7 @@ public:
332 332
 
333 333
 	void setDebug(unsigned char level);
334 334
 	/*------------------------------------------------------
335
-	 * Pre  : 
335
+	 * Pre  :
336 336
 	 * Post : level 0 = errors, 1 = warnings, 2 = debug1
337 337
 	 *
338 338
 	 *-- History ------------------------------------------
@@ -343,7 +343,7 @@ public:
343 343
 
344 344
 	int load(char *filename);
345 345
 	/*------------------------------------------------------
346
-	 * Pre  : 
346
+	 * Pre  :
347 347
 	 * Post : Error code is returned, 0 no error
348 348
 	 *        Md3 filename is read into memory
349 349
 	 *
@@ -355,7 +355,7 @@ public:
355 355
 
356 356
 	int save(char *filename);
357 357
 	/*------------------------------------------------------
358
-	 * Pre  : 
358
+	 * Pre  :
359 359
 	 * Post : Error code is returned, 0 no error
360 360
 	 *        Md3 saved as filename
361 361
 	 *
@@ -377,7 +377,7 @@ public:
377 377
 	unsigned int nextFrame;
378 378
 	float time;
379 379
 	float lastTime;
380
- 
380
+
381 381
 private:
382 382
 
383 383
 	////////////////////////////////////////////////////////////
@@ -389,9 +389,9 @@ private:
389 389
 	// Private Mutators
390 390
 	////////////////////////////////////////////////////////////
391 391
 
392
-	void printError(char *method, char *s, ...);
392
+	void printError(const char *method, const char *s, ...);
393 393
 	/*------------------------------------------------------
394
-	 * Pre  : 
394
+	 * Pre  :
395 395
 	 * Post : Dumps error to stderr
396 396
 	 *
397 397
 	 *-- History ------------------------------------------
@@ -400,9 +400,9 @@ private:
400 400
 	 * Mongoose - Created
401 401
 	 ------------------------------------------------------*/
402 402
 
403
-	void printWarning(char *method, char *s, ...);
403
+	void printWarning(const char *method, const char *s, ...);
404 404
 	/*------------------------------------------------------
405
-	 * Pre  : 
405
+	 * Pre  :
406 406
 	 * Post : Dumps warning to stderr
407 407
 	 *
408 408
 	 *-- History ------------------------------------------
@@ -411,7 +411,7 @@ private:
411 411
 	 * Mongoose - Created
412 412
 	 ------------------------------------------------------*/
413 413
 
414
-	void printDebug(char *method, char *s, ...);
414
+	void printDebug(const char *method, const char *s, ...);
415 415
 	/*------------------------------------------------------
416 416
 	 * Pre  : Debugging is on
417 417
 	 * Post : Dumps debug info
@@ -425,7 +425,7 @@ private:
425 425
 	void createMeshes(unsigned int num);
426 426
 	/*------------------------------------------------------
427 427
 	 * Pre  : Model hasn't been init yet
428
-	 * Post : Allocates num of meshes for model 
428
+	 * Post : Allocates num of meshes for model
429 429
 	 *
430 430
 	 *-- History ------------------------------------------
431 431
 	 *
@@ -438,7 +438,7 @@ private:
438 438
 	void createTags(unsigned int num);
439 439
 	/*------------------------------------------------------
440 440
 	 * Pre  : Model hasn't been init yet
441
-	 * Post : Allocates num of tags for model 
441
+	 * Post : Allocates num of tags for model
442 442
 	 *
443 443
 	 *-- History ------------------------------------------
444 444
 	 *
@@ -451,7 +451,7 @@ private:
451 451
 	void createBones(unsigned int num);
452 452
 	/*------------------------------------------------------
453 453
 	 * Pre  : Model hasn't been init yet
454
-	 * Post : Allocates num of bones for model 
454
+	 * Post : Allocates num of bones for model
455 455
 	 *
456 456
 	 *-- History ------------------------------------------
457 457
 	 *
@@ -471,26 +471,26 @@ private:
471 471
 
472 472
 	int m_version;            /* Version number, always 15 */
473 473
 
474
-	char m_filename[68];      /* Sometimes left blank... 
475
-										  65 chars, 32bit aligned == 
474
+	char m_filename[68];      /* Sometimes left blank...
475
+										  65 chars, 32bit aligned ==
476 476
 										  68 chars */
477
- 
477
+
478 478
 	int m_num_bones;          /* Number of Bone */
479 479
 
480 480
 	int m_num_tags;           /* Number of 'tags' per Bone */
481 481
 
482
-	int m_num_meshes;         /* Number of meshes/skins */ 
482
+	int m_num_meshes;         /* Number of meshes/skins */
483 483
 
484 484
 	int m_max_skins;          /* Maximum number of unique skins
485
-										  used in md3 file */ 
485
+										  used in md3 file */
486 486
 
487
-	int m_header_length;      /* Always equal to the length of 
488
-										  this header */ 
487
+	int m_header_length;      /* Always equal to the length of
488
+										  this header */
489 489
 
490
-	int m_tag_start;          /* Starting position of 
491
-										  tag-structures */ 
490
+	int m_tag_start;          /* Starting position of
491
+										  tag-structures */
492 492
 
493
-	int m_surfaces_start;     /* Starting position of 
493
+	int m_surfaces_start;     /* Starting position of
494 494
 										  geometeric data (mesh structures) */
495 495
 
496 496
 	int m_file_size;          /* Size of file */

+ 7
- 1
src/Sound.cpp Vedi File

@@ -23,6 +23,9 @@
23 23
 #ifdef __APPLE__
24 24
 #include <OpenAL/al.h>
25 25
 #include <OpenAL/alc.h>
26
+#include <AL/alut.h>
27
+// Another dirty hack to get to use OpenAL and FreeALUT on Mac OS X
28
+#define AL_FORMAT_WAVE_EXT 0x10002
26 29
 #else
27 30
 #   include <AL/al.h>
28 31
 #   include <AL/alc.h>
@@ -158,7 +161,10 @@ int Sound::add(char *filename, int *source, unsigned int flags)
158 161
 		return -2;
159 162
 	}
160 163
 
161
-   err = alutLoadWAV(filename, &data, &format, &size, &bits, &freq);
164
+   // err = alutLoadWAV(filename, &data, &format, &size, &bits, &freq);
165
+   // DEPRECATED?! Dirty solution:
166
+   alutLoadWAVFile(filename, &format, &data, &size, &freq);
167
+   err = AL_TRUE;
162 168
 
163 169
    if (err == AL_FALSE)
164 170
 	{

+ 2
- 2
src/TombRaider.cpp Vedi File

@@ -6243,7 +6243,7 @@ int TombRaider::loadTR5(FILE *f, void (*percent)(int))
6243 6243
 }
6244 6244
 
6245 6245
 
6246
-void TombRaider::print(char *methodName, char *s, ...)
6246
+void TombRaider::print(const char *methodName, const char *s, ...)
6247 6247
 {
6248 6248
     va_list args;
6249 6249
 
@@ -6255,7 +6255,7 @@ void TombRaider::print(char *methodName, char *s, ...)
6255 6255
 }
6256 6256
 
6257 6257
 
6258
-void TombRaider::printDebug(char *methodName, char *s, ...)
6258
+void TombRaider::printDebug(const char *methodName, const char *s, ...)
6259 6259
 {
6260 6260
   va_list args;
6261 6261
 

+ 414
- 414
src/TombRaider.h
File diff soppresso perché troppo grande
Vedi File


Loading…
Annulla
Salva