Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

competely replace the need for alut

  • Loading branch information...
commit 7e7d0b59265a91fba91e432116aec628a5487123 1 parent 2106a6c
@urkle urkle authored
View
19 CMakeLists.txt
@@ -6,8 +6,6 @@ set(OALWrapper_VERSION_MINOR 0)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeScripts)
-OPTION(WITH_ALUT "Include alut WAVE loading" OFF)
-
SET(PRIVATE_LIB_DIR
CACHE PATH "Location of local private library path to use"
)
@@ -61,15 +59,6 @@ IF(APP_PRIVATE_LIB_DIR)
MESSAGE(FATAL_ERROR "Could not find vorbisfile library")
ENDIF()
- IF(WITH_ALUT)
- IF(EXISTS ${APP_PRIVATE_LIB_DIR}/${PRIVATE_LIB_SUFFIX}/libalut.so)
- SET(ALUT_LIBRARY "${APP_PRIVATE_LIB_DIR}/${PRIVATE_LIB_SUFFIX}/libalut.so" CACHE FILEPATH "ALUT")
- ENDIF()
- IF(NOT ALUT_LIBRARY)
- MESSAGE(FATAL_ERROR "Could not find alut library")
- ENDIF()
- ENDIF()
-
IF(EXISTS ${APP_PRIVATE_LIB_DIR}/${PRIVATE_LIB_SUFFIX}/libopenal.so)
SET(OPENAL_LIBRARY "${APP_PRIVATE_LIB_DIR}/${PRIVATE_LIB_SUFFIX}/libopenal.so" CACHE FILEPATH "OpenAL")
ENDIF()
@@ -82,9 +71,6 @@ ELSE()
FIND_PACKAGE(VorbisFile)
FIND_PACKAGE(OpenAL)
- IF(WITH_ALUT)
- FIND_PACKAGE(ALUT)
- ENDIF()
INCLUDE_DIRECTORIES(
${OGG_INCLUDE_DIR}
${VORBIS_INCLUDE_DIR}
@@ -93,10 +79,6 @@ ELSE()
)
ENDIF()
-IF(WITH_ALUT)
- ADD_DEFINITIONS(-DWITH_ALUT)
-ENDIF()
-
include_directories(
include
)
@@ -130,7 +112,6 @@ TARGET_LINK_LIBRARIES(OALWrapper
${OGG_LIBRARY}
${VORBIS_LIBRARY}
${VORBISFILE_LIBRARY}
- ${ALUT_LIBRARY}
${OPENAL_LIBRARY}
SDL
)
View
78 CMakeScripts/FindALUT.cmake
@@ -1,78 +0,0 @@
-# Locate ALUT
-# This module defines XXX_FOUND, XXX_INCLUDE_DIRS and XXX_LIBRARIES standard variables
-#
-# $ALUTDIR is an environment variable that would
-# correspond to the ./configure --prefix=$ALUTDIR
-# used in building ALUT.
-#
-# Created by Sukender (Benoit Neil). Based on FindOpenAL.cmake module.
-
-IF(ALUT_USE_AL_SUBDIR)
- SET(ALUT_HEADER_NAMES "AL/alut.h")
- SET(ALUT_HEADER_SUFFIXES include)
-ELSE()
- SET(ALUT_HEADER_NAMES "alut.h")
- SET(ALUT_HEADER_SUFFIXES include/AL include/OpenAL include)
-ENDIF()
-
-SET(ALUT_SEARCH_PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local
- /usr
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
-)
-
-FIND_PATH(ALUT_INCLUDE_DIR NAMES ${ALUT_HEADER_NAMES}
- HINTS
- $ENV{ALUTDIR}
- $ENV{ALUT_PATH}
- PATH_SUFFIXES ${ALUT_HEADER_SUFFIXES}
- PATHS ${ALUT_SEARCH_PATHS}
-)
-
-FIND_LIBRARY(ALUT_LIBRARY
- NAMES alut libalut
- HINTS
- $ENV{ALUTDIR}
- $ENV{ALUT_PATH}
- PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 Release
- PATHS ${ALUT_SEARCH_PATHS}
-)
-
-# First search for d-suffixed libs
-FIND_LIBRARY(ALUT_LIBRARY_DEBUG
- NAMES alutd libalutd
- HINTS
- $ENV{ALUTDIR}
- $ENV{ALUT_PATH}
- PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 Debug
- PATHS ${ALUT_SEARCH_PATHS}
-)
-
-IF(NOT ALUT_LIBRARY_DEBUG)
- # Then search for non suffixed libs if necessary, but only in debug dirs
- FIND_LIBRARY(ALUT_LIBRARY_DEBUG
- NAMES alut libalut
- HINTS
- $ENV{ALUTDIR}
- $ENV{ALUT_PATH}
- PATH_SUFFIXES Debug
- PATHS ${ALUT_SEARCH_PATHS}
- )
-ENDIF()
-
-IF(ALUT_LIBRARY)
- IF(ALUT_LIBRARY_DEBUG)
- SET(ALUT_LIBRARIES optimized "${ALUT_LIBRARY}" debug "${ALUT_LIBRARY_DEBUG}")
- ELSE()
- SET(ALUT_LIBRARIES "${ALUT_LIBRARY}") # Could add "general" keyword, but it is optional
- ENDIF()
-ENDIF()
-
-# handle the QUIETLY and REQUIRED arguments and set XXX_FOUND to TRUE if all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG ALUT_LIBRARIES ALUT_INCLUDE_DIR)
View
2  LICENSE
@@ -1,4 +1,4 @@
-OALWrapper - a C++ Wrapper around OpenAL and ALUT
+OALWrapper - a C++ Wrapper around OpenAL
Copyright (C) 2007-2010 - Frictional Games
View
4 OALWrapper.xcodeproj/project.pbxproj
@@ -13,7 +13,6 @@
DB15511711E64ECC005799BB /* Ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBF4974311A0414300C8A45D /* Ogg.framework */; };
DB15511811E64ECD005799BB /* Vorbis.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBF4974411A0414300C8A45D /* Vorbis.framework */; };
DB15511C11E64F14005799BB /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB15511B11E64F14005799BB /* SDL.framework */; };
- DB15512211E64F20005799BB /* ALUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB15512111E64F20005799BB /* ALUT.framework */; };
DB15512911E64F4C005799BB /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = DB15512811E64F4C005799BB /* SDLMain.m */; };
DB15512D11E64F8A005799BB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB15512C11E64F8A005799BB /* Cocoa.framework */; };
DBF9A480119B18C100CCFDC9 /* OAL_AudioData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A469119B18C100CCFDC9 /* OAL_AudioData.cpp */; };
@@ -55,7 +54,6 @@
DB1550DB11E64C8E005799BB /* SimpleTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SimpleTest; sourceTree = BUILT_PRODUCTS_DIR; };
DB15511111E64EBE005799BB /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
DB15511B11E64F14005799BB /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = Library/Frameworks/SDL.framework; sourceTree = SDKROOT; };
- DB15512111E64F20005799BB /* ALUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ALUT.framework; path = Library/Frameworks/ALUT.framework; sourceTree = SDKROOT; };
DB15512711E64F4C005799BB /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = "<group>"; };
DB15512811E64F4C005799BB /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = "<group>"; };
DB15512C11E64F8A005799BB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
@@ -120,7 +118,6 @@
DB15511711E64ECC005799BB /* Ogg.framework in Frameworks */,
DB15511811E64ECD005799BB /* Vorbis.framework in Frameworks */,
DB15511C11E64F14005799BB /* SDL.framework in Frameworks */,
- DB15512211E64F20005799BB /* ALUT.framework in Frameworks */,
DB15512D11E64F8A005799BB /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -160,7 +157,6 @@
DBF4974411A0414300C8A45D /* Vorbis.framework */,
DB15511111E64EBE005799BB /* OpenAL.framework */,
DB15511B11E64F14005799BB /* SDL.framework */,
- DB15512111E64F20005799BB /* ALUT.framework */,
DB15512C11E64F8A005799BB /* Cocoa.framework */,
);
name = Frameworks;
View
3  include/OALWrapper/OAL_Funcs.h
@@ -19,9 +19,6 @@
#ifdef WIN32
#pragma comment(lib, "libvorbis.lib")
#pragma comment(lib, "libvorbisfile.lib")
-#ifdef WITH_ALUT
- #pragma comment(lib, "alut.lib")
-#endif
#pragma comment(lib, "openal32.lib")
#pragma comment(lib, "SDL.lib")
#endif
View
6 include/OALWrapper/OAL_Types.h
@@ -60,15 +60,9 @@
// system headers
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
- #ifdef WITH_ALUT
- #include <ALUT/alut.h>
- #endif
#else
#include <AL/al.h>
#include <AL/alc.h>
- #ifdef WITH_ALUT
- #include <AL/alut.h>
- #endif
#endif
// Included headers not available on all systems
#include <AL/alext.h>
View
70 sources/OAL_WAVSample.cpp
@@ -32,69 +32,19 @@
bool cOAL_WAVSample::CreateFromFile(const wstring &asFilename)
{
-#ifdef WITH_ALUT
- DEF_FUNC_NAME("cOAL_WAVSample::Load()");
- FUNC_USES_AL;
-
- if(mbStatus==false)
- return false;
-
- Reset();
-
- ALenum status;
- ALvoid *pPCMBuffer = NULL;
- ALsizei lSize;
-
- msFilename = asFilename;
+ FILE *fileHandle = OpenFileW(asFilename, L"rb");
+ fseek(fileHandle, 0, SEEK_END);
+ size_t pos = ftell(fileHandle);
+ fseek(fileHandle, 0, SEEK_SET);
- // TEMP: Need to get rid of the ALUT funcs to use Unicode here :S
- string sFilename = WString2String(asFilename);
- ///////////////////////////////////////////////////////////////
- // This worked indeed, but didnt return a freeable pointer.
- // Will be used when some fix is found
- //pPCMBuffer = alutLoadMemoryFromFile ( asFilename.c_str(), &eFormat, &lDataSize, &fFrequency );
+ void *buffer = malloc(pos);
-#if defined(__APPLE__)
- alutLoadWAVFile ( (ALbyte*) sFilename.c_str(), &mFormat, &pPCMBuffer, &lSize, &mlFrequency);
-#else
- alutLoadWAVFile ( (ALbyte*) sFilename.c_str(), &mFormat, &pPCMBuffer, &lSize, &mlFrequency, AL_FALSE);
-#endif
- status = alutGetError ();
- switch (status)
- {
- case ALUT_ERROR_NO_ERROR:
- break;
- default:
- mbStatus = false;
- break;
- }
+ fread(buffer, pos, 1, fileHandle);
+ fclose(fileHandle);
+ bool result = CreateFromBuffer(buffer, pos);
+ free(buffer);
- cOAL_Buffer* pBuffer = mvBuffers.front();
- if(pBuffer->Feed(pPCMBuffer, lSize)==false)
- {
- mlBuffersUsed = 1;
- //free( pPCMBuffer );
- alutUnloadWAV( mFormat, pPCMBuffer, lSize, mlFrequency);
- status = alutGetError();
- mbStatus = false;
- return false;
- }
-
- RUN_AL_FUNC(alGetBufferi( pBuffer->GetObjectID(), AL_CHANNELS, &mlChannels ));
-
- mlSamples = lSize/(mlChannels*GetBytesPerSample());
-
- mfTotalTime = ((double)mlSamples)/mlFrequency;
-
-
-// free( pPCMBuffer );
- alutUnloadWAV( mFormat, pPCMBuffer, lSize, mlFrequency);
- status = alutGetError ();
-
- return true;
-#else
- return false;
-#endif
+ return result;
}
struct RIFF_Header {
View
1  tests/PlaySound/main.cpp
@@ -73,6 +73,7 @@ int main (int argc, char *argv[])
void *buffer = malloc(pos);
fread(buffer, pos, 1, fp);
+ fclose(fp);
pSample = OAL_Sample_LoadFromBuffer(buffer, pos);
free(buffer);
Please sign in to comment.
Something went wrong with that request. Please try again.