Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


[Patch] Code update for new versions of ALUT
someone972 Offline
Member

Posts: 57
Threads: 4
Joined: May 2012
Reputation: 1
#1
[Patch] Code update for new versions of ALUT

The following is the code that needs to be changed/added in order for the new version of ALUT to be used with OALWrapper. This is confirmed to work with ALUT 1.1.0.

In OAL_WAVSample.cpp line 54:
PHP Code: (Select All)
#if defined(__APPLE__)
    
alutLoadWAVFile ( (ALbyte*) sFilename.c_str(), &mFormat, &pPCMBuffer, &lSize, &mlFrequency);
#else
    
alutLoadWAVFile ( (ALbyte*) sFilename.c_str(), &mFormat, &pPCMBuffer, &lSize, &mlFrequencyAL_FALSE);
#endif 
Changes to:
PHP Code: (Select All)
#if defined(__APPLE__)
    
pPCMBuffer alutLoadMemoryFromFile(sFilename.c_str(), &mFormat, &lSize, &mlFrequency);
#else
    
pPCMBuffer alutLoadMemoryFromFile(sFilename.c_str(), &mFormat, &lSize, &mlFrequency);
#endif 

In order for alutLoadMemoryFromFile to work in the new API, ALUT must be initialized first. Therefore some code must be added to OAL_Device.cpp.

At the end of cOAL_Device::Init:
PHP Code: (Select All)
#ifdef WITH_ALUT
    
if(!alutInitWithoutContext(NULL,NULL))
    {
        
LogMsg("",eOAL_LogVerbose_NoneeOAL_LogMsg_Error"Error initializing ALUT\n");
        return 
false;
    }
#endif 
And just before the end in cOAL_Device::Close:
PHP Code: (Select All)
#ifdef WITH_ALUT
    
LogMsg("",eOAL_LogVerbose_LoweOAL_LogMsg_Info"Exiting ALUT...\n" );
    if(!
alutExit())
    {
        
LogMsg("",eOAL_LogVerbose_NoneeOAL_LogMsg_Error"Error exiting ALUT!\n");
    }
#endif 
05-10-2012, 04:25 AM
Find
Urkle Offline
FG - Associate

Posts: 1,172
Threads: 31
Joined: Jul 2006
Reputation: 21
#2
RE: [Patch] Code update for new versions of ALUT

Thanks... I'll take a look at that and confirm on Mac os x and Linux. What platform are you developing/testing on?

Developing away on one of
Multiple Macs running 10.6, 10.7, 10.8, and 10.9.
Linux, 8-core AMD, 8GB RAM, Fedora 18, nVidia 450 1GB
05-10-2012, 04:48 AM
Website Find
someone972 Offline
Member

Posts: 57
Threads: 4
Joined: May 2012
Reputation: 1
#3
RE: [Patch] Code update for new versions of ALUT

I'm testing on Windows XP with MinGW. I'm using Code::Blocks for the IDE.
05-10-2012, 04:53 AM
Find




Users browsing this thread: 1 Guest(s)