]> git.jsancho.org Git - lugaru.git/commitdiff
Drop Open_Stream
authorAlexander Monakov <amonakov@gmail.com>
Fri, 17 Dec 2010 23:20:39 +0000 (02:20 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Fri, 17 Dec 2010 23:20:39 +0000 (02:20 +0300)
Source/GameInitDispose.cpp
Source/openal_wrapper.cpp
Source/openal_wrapper.h

index 6c9cf0f7c86430e544cac7b2d7f8fb3624cdd54c..8158a49544e4d6a338ba6dbcce26e951b4c3c609 100644 (file)
@@ -902,7 +902,7 @@ void Game::InitGame()
 
        OPENAL_SetSFXMasterVolume((int)(volume*255));
 
-       strm[stream_music3] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music3.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=0;}
+       strm[stream_music3] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:music3.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=0;}
 //     OPENAL_Sample_SetMinMaxDistance(strm[stream_music3], 4.0f, 1000.0f);
        OPENAL_Stream_SetMode(strm[stream_music3], OPENAL_LOOP_NORMAL);
 
@@ -916,42 +916,42 @@ void Game::InitGame()
        FadeLoadingScreen(20);
 
        if(ambientsound){
-               strm[stream_wind] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:wind.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
+               strm[stream_wind] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:wind.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
 //             OPENAL_Sample_SetMinMaxDistance(strm[stream_wind], 4.0f, 1000.0f);
                OPENAL_Stream_SetMode(strm[stream_wind], OPENAL_LOOP_NORMAL);
 
                FadeLoadingScreen(30);
 
-               strm[stream_desertambient] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:desertambient.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
+               strm[stream_desertambient] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:desertambient.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
 //             OPENAL_Sample_SetMinMaxDistance(strm[stream_desertambient], 4.0f, 1000.0f);
                OPENAL_Stream_SetMode(strm[stream_desertambient], OPENAL_LOOP_NORMAL);
        }
 
        FadeLoadingScreen(40);
 
-       strm[stream_firesound] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:fire.ogg"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
+       strm[stream_firesound] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:fire.ogg"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=5;}
 //     OPENAL_Sample_SetMinMaxDistance(strm[stream_firesound], 8.0f, 2000.0f);
        OPENAL_Stream_SetMode(strm[stream_firesound], OPENAL_LOOP_NORMAL);
 
        FadeLoadingScreen(50);
 
        //if(musictoggle){
-       strm[stream_music1grass] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music1grass.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=1;}
+       strm[stream_music1grass] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:music1grass.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=1;}
 //     OPENAL_Sample_SetMinMaxDistance(strm[stream_music1grass], 4.0f, 1000.0f);
        OPENAL_Stream_SetMode(strm[stream_music1grass], OPENAL_LOOP_NORMAL);
 
-       strm[stream_music1snow] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music1snow.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=2;}
+       strm[stream_music1snow] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:music1snow.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=2;}
 //     OPENAL_Sample_SetMinMaxDistance(strm[stream_music1snow], 4.0f, 1000.0f);
        OPENAL_Stream_SetMode(strm[stream_music1snow], OPENAL_LOOP_NORMAL);
 
        FadeLoadingScreen(60);
 
-       strm[stream_music1desert] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music1desert.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=3;}
+       strm[stream_music1desert] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:music1desert.mp3"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=3;}
 //     OPENAL_Sample_SetMinMaxDistance(strm[stream_music1desert], 4.0f, 1000.0f);
        OPENAL_Stream_SetMode(strm[stream_music1desert], OPENAL_LOOP_NORMAL);
 
        FadeLoadingScreen(80);
-       strm[stream_music2] = OPENAL_Stream_Open(ConvertFileName(":Data:Sounds:music2.ogg"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=4;}
+       strm[stream_music2] = OPENAL_Sample_Load(OPENAL_FREE, ConvertFileName(":Data:Sounds:music2.ogg"), OPENAL_2D, 0, 0); if(visibleloading){LoadingScreen(); loadscreencolor=4;}
 //     OPENAL_Sample_SetMinMaxDistance(strm[stream_music2], 4.0f, 1000.0f);
        OPENAL_Stream_SetMode(strm[stream_music2], OPENAL_LOOP_NORMAL);
 
index e3757172536a15d416a72b7b2d7f4704504c4086..4dddfd59df1d7c72f14b5e6c0cf1222fbd86a7b9 100644 (file)
@@ -114,14 +114,6 @@ typedef struct OPENAL_SAMPLE
     int is2d;
 } OPENAL_SAMPLE;
 
-typedef struct OPENAL_STREAM
-{
-    char *name;
-    ALuint bid;  // buffer id.
-    int mode;
-    int is2d;
-} OPENAL_STREAM;
-
 static size_t num_channels = 0;
 static OPENAL_Channels *channels = NULL;
 static bool initialized = false;
@@ -600,11 +592,6 @@ AL_API signed char OPENAL_StopSound(int channel)
     return true;
 }
 
-AL_API OPENAL_STREAM *OPENAL_Stream_Open(const char *name_or_data, unsigned int mode, int offset, int length)
-{
-    return (OPENAL_STREAM *) OPENAL_Sample_Load(OPENAL_FREE, name_or_data, mode, offset, length);
-}
-
 AL_API void OPENAL_Stream_Close(OPENAL_STREAM *stream)
 {
     OPENAL_Sample_Free((OPENAL_SAMPLE *) stream);
index a15a6dedecd131b8573f9523ef2e8cd6c0683a7f..99fad2cea8eaa4d4f7b1512f8c91fceef8bd4736 100644 (file)
@@ -44,7 +44,7 @@
 
 
 typedef struct OPENAL_SAMPLE    OPENAL_SAMPLE;
-typedef struct OPENAL_STREAM    OPENAL_STREAM;
+typedef OPENAL_SAMPLE    OPENAL_STREAM;
 typedef struct OPENAL_DSPUNIT   OPENAL_DSPUNIT;
 
 enum OPENAL_OUTPUTTYPES
@@ -86,7 +86,6 @@ AL_API signed char OPENAL_SetVolume(int channel, int vol);
 AL_API signed char OPENAL_SetPaused(int channel, signed char paused);
 AL_API void OPENAL_SetSFXMasterVolume(int volume);
 AL_API signed char OPENAL_StopSound(int channel);
-AL_API OPENAL_STREAM *OPENAL_Stream_Open(const char *name_or_data, unsigned int mode, int offset, int length);
 AL_API void OPENAL_Stream_Close(OPENAL_STREAM *stream);
 AL_API OPENAL_SAMPLE *OPENAL_Stream_GetSample(OPENAL_STREAM *stream);
 AL_API int OPENAL_Stream_PlayEx(int channel, OPENAL_STREAM *stream, OPENAL_DSPUNIT *dsp, signed char startpaused);