Browse Source

Removed redundant USING/HAVE defines

Thomas Buck 10 years ago
parent
commit
f483c3e5e5
4 changed files with 18 additions and 21 deletions
  1. 1
    0
      ChangeLog
  2. 2
    6
      Makefile
  3. 4
    4
      src/SDLSystem.cpp
  4. 11
    11
      src/Sound.cpp

+ 1
- 0
ChangeLog View File

@@ -7,6 +7,7 @@
7 7
 
8 8
 	[ 20140102 ]
9 9
 	* Replaced the (unknown) included sample sound file
10
+	* Removed some redundant build config defines
10 11
 
11 12
 	[ 20140101 ]
12 13
 	* Fixed Wavebuffer loading of Sound subsystem, as well as

+ 2
- 6
Makefile View File

@@ -33,7 +33,7 @@ UNAME=$(shell uname -s)
33 33
 BASE_DEFS=$(shell sdl-config --cflags) -Isrc -I/opt/local/include -DSDL_INTERFACE \
34 34
 	-DUSING_OPENGL -DZLIB_SUPPORT -DUSING_EMITTER \
35 35
 	-DUSING_OPENAL -DUSING_MTK_TGA -DUSING_PTHREADS \
36
-	-DUSING_HEL -DHAVE_SDL_TTF -DHAVE_OPENGL
36
+	-DUSING_HEL -DHAVE_SDL_TTF
37 37
 
38 38
 BASE_LIBS=$(shell sdl-config --libs) -lz -lstdc++ \
39 39
 	-lpthread -lSDL_ttf
@@ -42,10 +42,6 @@ BASE_LIBS=$(shell sdl-config --libs) -lz -lstdc++ \
42 42
 DEBUG_DEFS=-DDEBUG -DEXPERIMENTAL
43 43
 DEBUG_OBJ=
44 44
 
45
-###############################################################
46
-# OpenAL, Sound support
47
-BASE_DEFS += -DHAVE_OPENAL
48
-
49 45
 ifeq ($(UNAME),Darwin)
50 46
 AUDIO_LIBS += -lalut
51 47
 AUDIO_LIBS += -L/opt/local/lib
@@ -516,7 +512,7 @@ Network.test:
516 512
 Sound.test:
517 513
 	mkdir -p $(BUILD_TEST_DIR)
518 514
 	$(CC) $(TEST_FLAGS) -DUNIT_TEST_SOUND \
519
-		-DUSING_OPENAL -DHAVE_OPENAL $(AUDIO_LIBS) \
515
+		-DUSING_OPENAL $(AUDIO_LIBS) \
520 516
 		src/Sound.cpp -o $(BUILD_TEST_DIR)/Sound.test
521 517
 ifeq ($(UNAME),Darwin)
522 518
 	install_name_tool -change libalut.0.1.0.dylib /opt/local/lib/libalut.0.1.0.dylib $(BUILD_TEST_DIR)/Sound.test

+ 4
- 4
src/SDLSystem.cpp View File

@@ -33,17 +33,17 @@
33 33
 #include <cmath>
34 34
 
35 35
 #ifdef MEMEORY_TEST
36
-#   include "memeory_test.h"
36
+#include "memeory_test.h"
37 37
 #endif
38 38
 
39
-#ifdef HAVE_OPENGL
39
+#ifdef USING_OPENGL
40 40
 #include <SDL/SDL_opengl.h>
41 41
 #else
42
-#   error "SDLSystem requires -DHAVE_OPENGL"
42
+#error "SDLSystem requires -DUSING_OPENGL"
43 43
 #endif
44 44
 
45 45
 #ifdef PS2_LINUX
46
-#   include "ps2.h"
46
+#include "ps2.h"
47 47
 #endif
48 48
 
49 49
 #include "SDLSystem.h"

+ 11
- 11
src/Sound.cpp View File

@@ -8,7 +8,7 @@
8 8
  * \author xythobuz
9 9
  */
10 10
 
11
-#ifdef HAVE_OPENAL
11
+#ifdef USING_OPENAL
12 12
 #ifdef __APPLE__
13 13
 #include <OpenAL/al.h>
14 14
 #include <OpenAL/alc.h>
@@ -50,7 +50,7 @@ Sound::~Sound()
50 50
 {
51 51
 	if (mInit)
52 52
 	{
53
-#ifdef HAVE_OPENAL
53
+#ifdef USING_OPENAL
54 54
 		alutExit();
55 55
 #endif
56 56
 	}
@@ -73,7 +73,7 @@ int Sound::init()
73 73
 	close(fd);
74 74
 #endif
75 75
 
76
-#ifdef HAVE_OPENAL
76
+#ifdef USING_OPENAL
77 77
 	alutInit(NULL, 0);
78 78
 
79 79
 	mInit = true;
@@ -91,7 +91,7 @@ void Sound::listenAt(float pos[3], float angle[3])
91 91
 	if (!mInit)
92 92
 		return;
93 93
 
94
-#ifdef HAVE_OPENAL
94
+#ifdef USING_OPENAL
95 95
 	alListenerfv(AL_POSITION, pos);
96 96
 	alListenerfv(AL_ORIENTATION, angle);
97 97
 #endif
@@ -103,7 +103,7 @@ void Sound::sourceAt(int source, float pos[3])
103 103
 	if (!mInit || source < 0)
104 104
 		return;
105 105
 
106
-#ifdef HAVE_OPENAL
106
+#ifdef USING_OPENAL
107 107
 	alSourcefv(mSource[source-1], AL_POSITION, pos);
108 108
 #endif
109 109
 }
@@ -112,7 +112,7 @@ void Sound::sourceAt(int source, float pos[3])
112 112
 //! \fixme Seperate sourcing and buffering, Mongoose 2002.01.04
113 113
 int Sound::addFile(char *filename, int *source, unsigned int flags)
114 114
 {
115
-#ifdef HAVE_OPENAL
115
+#ifdef USING_OPENAL
116 116
    ALsizei size;
117 117
    ALfloat freq;
118 118
    ALenum format;
@@ -128,7 +128,7 @@ int Sound::addFile(char *filename, int *source, unsigned int flags)
128 128
 
129 129
 	*source = -1;
130 130
 
131
-#ifdef HAVE_OPENAL
131
+#ifdef USING_OPENAL
132 132
    alGetError();
133 133
 
134 134
 	alGenBuffers(1, &mBuffer[mNextBuffer]);
@@ -181,7 +181,7 @@ int Sound::addFile(char *filename, int *source, unsigned int flags)
181 181
 
182 182
 int Sound::addWave(unsigned char *wav, unsigned int length, int *source, unsigned int flags)
183 183
 {
184
-#ifdef HAVE_OPENAL
184
+#ifdef USING_OPENAL
185 185
    ALsizei size;
186 186
    ALfloat freq;
187 187
    ALenum format;
@@ -196,7 +196,7 @@ int Sound::addWave(unsigned char *wav, unsigned int length, int *source, unsigne
196 196
 
197 197
 	*source = -1;
198 198
 
199
-#ifdef HAVE_OPENAL
199
+#ifdef USING_OPENAL
200 200
 	data = wav;
201 201
 
202 202
    alGetError();
@@ -268,7 +268,7 @@ void Sound::play(int source)
268 268
 		return;
269 269
 	}
270 270
 
271
-#ifdef HAVE_OPENAL
271
+#ifdef USING_OPENAL
272 272
 	alSourcePlay(mSource[source-1]);
273 273
 #endif
274 274
 }
@@ -282,7 +282,7 @@ void Sound::stop(int source)
282 282
 		return;
283 283
 	}
284 284
 
285
-#ifdef HAVE_OPENAL
285
+#ifdef USING_OPENAL
286 286
 	alSourceStop(mSource[source-1]);
287 287
 #endif
288 288
 }

Loading…
Cancel
Save