The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
[Patch] Code update for new versions of ALUT - by someone972 - 05-10-2012, 04:25 AM



Users browsing this thread: 1 Guest(s)