Pārlūkot izejas kodu

Reenabled ALUT.

Trying to build with freeALUT on Mac. Segfaults on launch.
Thomas Buck 11 gadus atpakaļ
vecāks
revīzija
87875896ee
7 mainītis faili ar 535 papildinājumiem un 509 dzēšanām
  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 Parādīt failu

15
 MAJOR_VERSION=0
15
 MAJOR_VERSION=0
16
 MINOR_VERSION=1
16
 MINOR_VERSION=1
17
 MICRO_VERSION=1
17
 MICRO_VERSION=1
18
-BUILD_ID=20030713
18
+BUILD_ID=20131214
19
 PRE=
19
 PRE=
20
 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)$(PRE)
20
 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)$(PRE)
21
 VERSION_DEB=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION).$(BUILD_ID)
21
 VERSION_DEB=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION).$(BUILD_ID)
22
 BUILD_HOST=$(shell uname -s -n -r -m)
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
 
44
 
44
 ###############################################################
45
 ###############################################################
45
 # OpenAL, Sound support
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
 # libferit, File transfer via HTTP/FTP/etc support
58
 # libferit, File transfer via HTTP/FTP/etc support
50
 LIBFERIT_LIB=/usr/local/lib/libferit.so
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
 ifeq ($(LIBFERIT), yes)
62
 ifeq ($(LIBFERIT), yes)
54
 	BASE_DEFS += -DHAVE_LIBFERIT
63
 	BASE_DEFS += -DHAVE_LIBFERIT
57
 
66
 
58
 ###############################################################
67
 ###############################################################
59
 
68
 
60
-TREE_DIR=OpenRaider.cvs
69
+TREE_DIR=OpenRaider
61
 BUILD_DEBUG_DIR=bin/debug
70
 BUILD_DEBUG_DIR=bin/debug
62
 BUILD_RELEASE_DIR=bin/release
71
 BUILD_RELEASE_DIR=bin/release
63
 BUILD_PROF_DIR=bin/prof
72
 BUILD_PROF_DIR=bin/prof
81
 	-DVERSION=\"\\\"$(NAME)-$(VERSION)-$(BUILD_ID)\\\"\" \
90
 	-DVERSION=\"\\\"$(NAME)-$(VERSION)-$(BUILD_ID)\\\"\" \
82
 	-DBUILD_HOST=\"\\\"$(BUILD_HOST)\\\"\"
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
 	-lGL -lGLU -lm $(BASE_LIBS)
94
 	-lGL -lGLU -lm $(BASE_LIBS)
86
 
95
 
87
 RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
96
 RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
146
 	LD_FLAGS="$(LD_FLAGS)"
155
 	LD_FLAGS="$(LD_FLAGS)"
147
 
156
 
148
 depend:
157
 depend:
149
-	@-echo -n "Making deps..."
158
+	@-echo "Making deps..."
150
 	@-echo "# Autogenerated dependency file" > depend
159
 	@-echo "# Autogenerated dependency file" > depend
151
 	@-find ./src -name "*.cpp" -exec ./deps.sh $(BASE_DEFS) {} \; >> depend
160
 	@-find ./src -name "*.cpp" -exec ./deps.sh $(BASE_DEFS) {} \; >> depend
152
 	@-echo "       [done]"
161
 	@-echo "       [done]"
191
 
200
 
192
 $(BUILDDIR)/$(NAME) : $(OBJS)
201
 $(BUILDDIR)/$(NAME) : $(OBJS)
193
 	$(CC) $(CFLAGS) $(LD_FLAGS) -o $@ $(OBJS)
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
 clean: clean-emacs clean-build clean-test clean-obj clean-dep
213
 clean: clean-emacs clean-build clean-test clean-obj clean-dep
202
 
214
 
203
 clean-dep:
215
 clean-dep:
204
-	@-echo -n "Cleaning dependencies                        "
216
+	@-echo "Cleaning dependencies                        "
205
 	@-rm -f depend
217
 	@-rm -f depend
206
 	@-echo "[DONE]"
218
 	@-echo "[DONE]"
207
 
219
 
208
 clean-test:
220
 clean-test:
209
-	@-echo -n "Cleaning test builds                         "
221
+	@-echo "Cleaning test builds                         "
210
 	@-rm -f $(BUILD_TEST_DIR)/*.o
222
 	@-rm -f $(BUILD_TEST_DIR)/*.o
211
 	@-rm -f $(BUILD_TEST_DIR)/*.test
223
 	@-rm -f $(BUILD_TEST_DIR)/*.test
212
 	@-rm -rf $(BUILD_TEST_DIR)/*.build
224
 	@-rm -rf $(BUILD_TEST_DIR)/*.build
213
 	@-echo "[DONE]"
225
 	@-echo "[DONE]"
214
 
226
 
215
 clean-obj:
227
 clean-obj:
216
-	@-echo -n "Cleaning objects                             "
228
+	@-echo "Cleaning objects                             "
217
 	@-rm -f $(BUILD_PROF_DIR)/*.o
229
 	@-rm -f $(BUILD_PROF_DIR)/*.o
218
 	@-rm -f $(BUILD_DEBUG_DIR)/*.o
230
 	@-rm -f $(BUILD_DEBUG_DIR)/*.o
219
 	@-rm -f $(BUILD_RELEASE_DIR)/*.o
231
 	@-rm -f $(BUILD_RELEASE_DIR)/*.o
222
 	@-echo "[DONE]"
234
 	@-echo "[DONE]"
223
 
235
 
224
 clean-emacs:
236
 clean-emacs:
225
-	@-echo -n "Cleaning emacs files                         "
237
+	@-echo "Cleaning emacs files                         "
226
 	@-rm -f `find . -name "*~" -print`
238
 	@-rm -f `find . -name "*~" -print`
227
 	@-echo "[DONE]"
239
 	@-echo "[DONE]"
228
 
240
 
229
 clean-build:
241
 clean-build:
230
-	@-echo -n "Cleaning builds                              "
242
+	@-echo "Cleaning builds                              "
231
 	@-rm -f $(BUILD_PROF_DIR)/$(NAME)
243
 	@-rm -f $(BUILD_PROF_DIR)/$(NAME)
232
 	@-rm -f $(BUILD_DEBUG_DIR)/$(NAME)
244
 	@-rm -f $(BUILD_DEBUG_DIR)/$(NAME)
233
 	@-rm -f $(BUILD_RELEASE_DIR)/$(NAME)
245
 	@-rm -f $(BUILD_RELEASE_DIR)/$(NAME)
235
 	@-echo "[DONE]"
247
 	@-echo "[DONE]"
236
 
248
 
237
 clean-deb:
249
 clean-deb:
238
-	@-echo -n "Cleaning DEBs                                "
250
+	@-echo "Cleaning DEBs                                "
239
 	@-rm -rf $(DEB_DIR)
251
 	@-rm -rf $(DEB_DIR)
240
 	@-echo "[DONE]"
252
 	@-echo "[DONE]"
241
 
253
 

+ 14
- 6
README.md Parādīt failu

6
 
6
 
7
 ## Dependencies
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
 + Linux 2.4.16 SMP kernel (Debian distrobution)
23
 + Linux 2.4.16 SMP kernel (Debian distrobution)
10
 + GCC 2.95.2 compiler and supporting development packages
24
 + GCC 2.95.2 compiler and supporting development packages
11
 + X11 4.1.0 with X11 development package
25
 + X11 4.1.0 with X11 development package
14
 + OpenAL 0.0.6 development package
28
 + OpenAL 0.0.6 development package
15
 + libz 1.1.3 development package
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
 ## License
31
 ## License
24
 
32
 
25
 OpenRaider is based on code, specs, and alogrithms from:
33
 OpenRaider is based on code, specs, and alogrithms from:

+ 3
- 3
src/Md3.cpp Parādīt failu

842
 // Private Mutators
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
 	va_list args;
847
 	va_list args;
848
 
848
 
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
 	va_list args;
865
 	va_list args;
866
 
866
 
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
 	va_list args;
878
 	va_list args;
879
 
879
 

+ 68
- 68
src/Md3.h Parādīt failu

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 : Freyja
4
  * Project : Freyja
5
  * Author  : Terry 'Mongoose' Hendrix II
5
  * Author  : Terry 'Mongoose' Hendrix II
6
  * Website : http://gooseegg.sourceforge.net
6
  * Website : http://gooseegg.sourceforge.net
17
  *           so - since this class is desgined using their specs...
17
  *           so - since this class is desgined using their specs...
18
  *
18
  *
19
  *-- Test Defines -----------------------------------------------------
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
  * UNIT_TEST_MD3_LV2  - Does more debugging when used with unit test
22
  * UNIT_TEST_MD3_LV2  - Does more debugging when used with unit test
23
  *
23
  *
24
- *-- History ---------------------------------------------------------- 
24
+ *-- History ----------------------------------------------------------
25
  *
25
  *
26
  * 2002.10.19:
26
  * 2002.10.19:
27
  * Mongoose - Interface update, Animation support starts
27
  * Mongoose - Interface update, Animation support starts
53
 
53
 
54
 typedef struct md3_tag_s
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
 							  i've been told this is because
63
 							  i've been told this is because
64
 							  some tools leave garbage in
64
 							  some tools leave garbage in
65
 							  those strings, but they ARE
65
 							  those strings, but they ARE
66
 							  strings... */
66
 							  strings... */
67
 
67
 
68
   vec3_t center;    /* Relative position of tag */
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
 							  relative to the rest of the model */
71
 							  relative to the rest of the model */
72
 
72
 
73
 } md3_tag_t;
73
 } md3_tag_t;
79
   float  maxs[3];
79
   float  maxs[3];
80
   float  center[3];
80
   float  center[3];
81
   float  scale;
81
   float  scale;
82
-  char   creator[16]; 
82
+  char   creator[16];
83
 
83
 
84
 } md3_bone_t;
84
 } md3_bone_t;
85
 
85
 
87
 typedef struct md3_skin_s
87
 typedef struct md3_skin_s
88
 {
88
 {
89
   char name[68];       /* Name of skin used by mesh
89
   char name[68];       /* Name of skin used by mesh
90
-								  65 chars, 
90
+								  65 chars,
91
 								  32 bit aligned == 68 chars  */
91
 								  32 bit aligned == 68 chars  */
92
 
92
 
93
   int index;           /* For shader use (skin is a shader) */
93
   int index;           /* For shader use (skin is a shader) */
113
 {
113
 {
114
   signed short pos[3];       /* Vertex X/Y/Z coordinate */
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
 										  (Acutally encoded normal?) */
118
 										  (Acutally encoded normal?) */
119
-	
119
+
120
 	float norm[3];            /* Decoded normal from above decoded */
120
 	float norm[3];            /* Decoded normal from above decoded */
121
 
121
 
122
 } md3_vertex_t;
122
 } md3_vertex_t;
128
 
128
 
129
   char id[4];          /* Mesh alias id, must be IDP3  */
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
 								  65 chars,
132
 								  65 chars,
133
 								  32 bit aligned == 68 chars */
133
 								  32 bit aligned == 68 chars */
134
   int flags;
134
   int flags;
135
 
135
 
136
 
136
 
137
-  int  num_frames;     /* Number of VertexMorph frames 
137
+  int  num_frames;     /* Number of VertexMorph frames
138
 								  in mesh */
138
 								  in mesh */
139
 
139
 
140
   int num_shaders;     /* Number of shaders in mesh*/
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
 								  for backwards compatibility with
143
 								  for backwards compatibility with
144
 								  incorrect/obsolete spec  */
144
 								  incorrect/obsolete spec  */
145
 
145
 
146
   int  num_vertices;   /* Number of vertices */
146
   int  num_vertices;   /* Number of vertices */
147
- 
147
+
148
   int  num_triangles;  /* Number of triangles */
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
 								  to start of Mesh_Header  */
152
 								  to start of Mesh_Header  */
153
 
153
 
154
   int  header_size;    /* Size of header  */
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
 								  to start of Mesh_Header */
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
 								  to start of Mesh_Header  */
162
 								  to start of Mesh_Header  */
163
 
163
 
164
   int  mesh_size;      /* Size of mesh  */
164
   int  mesh_size;      /* Size of mesh  */
171
   md3_tri_index_t *tris;  /* Triangles */
171
   md3_tri_index_t *tris;  /* Triangles */
172
 
172
 
173
   md3_texel_t *texel;     /* Texels */
173
   md3_texel_t *texel;     /* Texels */
174
-  
174
+
175
   md3_vertex_t *vertex;   /* Vertices */
175
   md3_vertex_t *vertex;   /* Vertices */
176
 
176
 
177
 } md3_mesh_t;
177
 } md3_mesh_t;
192
 
192
 
193
 	Md3();
193
 	Md3();
194
 	/*------------------------------------------------------
194
 	/*------------------------------------------------------
195
-	 * Pre  : 
195
+	 * Pre  :
196
 	 * Post : Md3 object is constructed
196
 	 * Post : Md3 object is constructed
197
 	 *
197
 	 *
198
 	 *-- History ------------------------------------------
198
 	 *-- History ------------------------------------------
230
 	////////////////////////////////////////////////////////////
230
 	////////////////////////////////////////////////////////////
231
 	// Public Accessors
231
 	// Public Accessors
232
 	////////////////////////////////////////////////////////////
232
 	////////////////////////////////////////////////////////////
233
-  
233
+
234
 	unsigned int getNumMeshes();
234
 	unsigned int getNumMeshes();
235
 	/*------------------------------------------------------
235
 	/*------------------------------------------------------
236
-	 * Pre  : 
236
+	 * Pre  :
237
 	 * Post : Mesh count is returned
237
 	 * Post : Mesh count is returned
238
 	 *
238
 	 *
239
 	 *-- History ------------------------------------------
239
 	 *-- History ------------------------------------------
245
 
245
 
246
 	unsigned int getNumTags();
246
 	unsigned int getNumTags();
247
 	/*------------------------------------------------------
247
 	/*------------------------------------------------------
248
-	 * Pre  : 
248
+	 * Pre  :
249
 	 * Post : Tag count is returned
249
 	 * Post : Tag count is returned
250
 	 *
250
 	 *
251
 	 *-- History ------------------------------------------
251
 	 *-- History ------------------------------------------
254
 	 * Mongoose - Created, Obsoletes:
254
 	 * Mongoose - Created, Obsoletes:
255
 	 *            2000.06.03, int NumTags();
255
 	 *            2000.06.03, int NumTags();
256
 	 ------------------------------------------------------*/
256
 	 ------------------------------------------------------*/
257
-  
257
+
258
 	unsigned int getNumBones();
258
 	unsigned int getNumBones();
259
 	/*------------------------------------------------------
259
 	/*------------------------------------------------------
260
-	 * Pre  : 
260
+	 * Pre  :
261
 	 * Post : Bone count is returned
261
 	 * Post : Bone count is returned
262
 	 *
262
 	 *
263
 	 *-- History ------------------------------------------
263
 	 *-- History ------------------------------------------
269
 
269
 
270
 	md3_mesh_t *getMeshes();
270
 	md3_mesh_t *getMeshes();
271
 	/*------------------------------------------------------
271
 	/*------------------------------------------------------
272
-	 * Pre  : 
272
+	 * Pre  :
273
 	 * Post : Mesh list is returned
273
 	 * Post : Mesh list is returned
274
 	 *
274
 	 *
275
 	 *-- History ------------------------------------------
275
 	 *-- History ------------------------------------------
278
 	 * Mongoose - Created, Obsoletes:
278
 	 * Mongoose - Created, Obsoletes:
279
 	 *            2000.06.03, md3_mesh_t *Mesh();
279
 	 *            2000.06.03, md3_mesh_t *Mesh();
280
 	 ------------------------------------------------------*/
280
 	 ------------------------------------------------------*/
281
-  
281
+
282
 	md3_tag_t *getTags();
282
 	md3_tag_t *getTags();
283
 	/*------------------------------------------------------
283
 	/*------------------------------------------------------
284
-	 * Pre  : 
284
+	 * Pre  :
285
 	 * Post : Tag list is returned
285
 	 * Post : Tag list is returned
286
 	 *
286
 	 *
287
 	 *-- History ------------------------------------------
287
 	 *-- History ------------------------------------------
290
 	 * Mongoose - Created, Obsoletes:
290
 	 * Mongoose - Created, Obsoletes:
291
 	 *            2000.06.03, md3_tag_t *Tag();
291
 	 *            2000.06.03, md3_tag_t *Tag();
292
 	 ------------------------------------------------------*/
292
 	 ------------------------------------------------------*/
293
-  
293
+
294
 	md3_bone_t *getBones();
294
 	md3_bone_t *getBones();
295
 	/*------------------------------------------------------
295
 	/*------------------------------------------------------
296
-	 * Pre  : 
296
+	 * Pre  :
297
 	 * Post : Bone list is returned
297
 	 * Post : Bone list is returned
298
 	 *
298
 	 *
299
 	 *-- History ------------------------------------------
299
 	 *-- History ------------------------------------------
307
 	////////////////////////////////////////////////////////////
307
 	////////////////////////////////////////////////////////////
308
 	// Public Mutators
308
 	// Public Mutators
309
 	////////////////////////////////////////////////////////////
309
 	////////////////////////////////////////////////////////////
310
-  
310
+
311
 	void toggleFlag(Md3Flag flag);
311
 	void toggleFlag(Md3Flag flag);
312
 	/*------------------------------------------------------
312
 	/*------------------------------------------------------
313
-	 * Pre  : 
313
+	 * Pre  :
314
 	 * Post : Toggles a flag
314
 	 * Post : Toggles a flag
315
 	 *
315
 	 *
316
 	 *-- History ------------------------------------------
316
 	 *-- History ------------------------------------------
321
 
321
 
322
 	void reset();
322
 	void reset();
323
 	/*------------------------------------------------------
323
 	/*------------------------------------------------------
324
-	 * Pre  : 
324
+	 * Pre  :
325
 	 * Post : Resets all model data
325
 	 * Post : Resets all model data
326
 	 *
326
 	 *
327
 	 *-- History ------------------------------------------
327
 	 *-- History ------------------------------------------
332
 
332
 
333
 	void setDebug(unsigned char level);
333
 	void setDebug(unsigned char level);
334
 	/*------------------------------------------------------
334
 	/*------------------------------------------------------
335
-	 * Pre  : 
335
+	 * Pre  :
336
 	 * Post : level 0 = errors, 1 = warnings, 2 = debug1
336
 	 * Post : level 0 = errors, 1 = warnings, 2 = debug1
337
 	 *
337
 	 *
338
 	 *-- History ------------------------------------------
338
 	 *-- History ------------------------------------------
343
 
343
 
344
 	int load(char *filename);
344
 	int load(char *filename);
345
 	/*------------------------------------------------------
345
 	/*------------------------------------------------------
346
-	 * Pre  : 
346
+	 * Pre  :
347
 	 * Post : Error code is returned, 0 no error
347
 	 * Post : Error code is returned, 0 no error
348
 	 *        Md3 filename is read into memory
348
 	 *        Md3 filename is read into memory
349
 	 *
349
 	 *
355
 
355
 
356
 	int save(char *filename);
356
 	int save(char *filename);
357
 	/*------------------------------------------------------
357
 	/*------------------------------------------------------
358
-	 * Pre  : 
358
+	 * Pre  :
359
 	 * Post : Error code is returned, 0 no error
359
 	 * Post : Error code is returned, 0 no error
360
 	 *        Md3 saved as filename
360
 	 *        Md3 saved as filename
361
 	 *
361
 	 *
377
 	unsigned int nextFrame;
377
 	unsigned int nextFrame;
378
 	float time;
378
 	float time;
379
 	float lastTime;
379
 	float lastTime;
380
- 
380
+
381
 private:
381
 private:
382
 
382
 
383
 	////////////////////////////////////////////////////////////
383
 	////////////////////////////////////////////////////////////
389
 	// Private Mutators
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
 	 * Post : Dumps error to stderr
395
 	 * Post : Dumps error to stderr
396
 	 *
396
 	 *
397
 	 *-- History ------------------------------------------
397
 	 *-- History ------------------------------------------
400
 	 * Mongoose - Created
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
 	 * Post : Dumps warning to stderr
406
 	 * Post : Dumps warning to stderr
407
 	 *
407
 	 *
408
 	 *-- History ------------------------------------------
408
 	 *-- History ------------------------------------------
411
 	 * Mongoose - Created
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
 	 * Pre  : Debugging is on
416
 	 * Pre  : Debugging is on
417
 	 * Post : Dumps debug info
417
 	 * Post : Dumps debug info
425
 	void createMeshes(unsigned int num);
425
 	void createMeshes(unsigned int num);
426
 	/*------------------------------------------------------
426
 	/*------------------------------------------------------
427
 	 * Pre  : Model hasn't been init yet
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
 	 *-- History ------------------------------------------
430
 	 *-- History ------------------------------------------
431
 	 *
431
 	 *
438
 	void createTags(unsigned int num);
438
 	void createTags(unsigned int num);
439
 	/*------------------------------------------------------
439
 	/*------------------------------------------------------
440
 	 * Pre  : Model hasn't been init yet
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
 	 *-- History ------------------------------------------
443
 	 *-- History ------------------------------------------
444
 	 *
444
 	 *
451
 	void createBones(unsigned int num);
451
 	void createBones(unsigned int num);
452
 	/*------------------------------------------------------
452
 	/*------------------------------------------------------
453
 	 * Pre  : Model hasn't been init yet
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
 	 *-- History ------------------------------------------
456
 	 *-- History ------------------------------------------
457
 	 *
457
 	 *
471
 
471
 
472
 	int m_version;            /* Version number, always 15 */
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
 										  68 chars */
476
 										  68 chars */
477
- 
477
+
478
 	int m_num_bones;          /* Number of Bone */
478
 	int m_num_bones;          /* Number of Bone */
479
 
479
 
480
 	int m_num_tags;           /* Number of 'tags' per Bone */
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
 	int m_max_skins;          /* Maximum number of unique skins
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
 										  geometeric data (mesh structures) */
494
 										  geometeric data (mesh structures) */
495
 
495
 
496
 	int m_file_size;          /* Size of file */
496
 	int m_file_size;          /* Size of file */

+ 7
- 1
src/Sound.cpp Parādīt failu

23
 #ifdef __APPLE__
23
 #ifdef __APPLE__
24
 #include <OpenAL/al.h>
24
 #include <OpenAL/al.h>
25
 #include <OpenAL/alc.h>
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
 #else
29
 #else
27
 #   include <AL/al.h>
30
 #   include <AL/al.h>
28
 #   include <AL/alc.h>
31
 #   include <AL/alc.h>
158
 		return -2;
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
    if (err == AL_FALSE)
169
    if (err == AL_FALSE)
164
 	{
170
 	{

+ 2
- 2
src/TombRaider.cpp Parādīt failu

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
     va_list args;
6248
     va_list args;
6249
 
6249
 
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
   va_list args;
6260
   va_list args;
6261
 
6261
 

+ 414
- 414
src/TombRaider.h
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


Notiek ielāde…
Atcelt
Saglabāt