Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 350


Ignore:
Timestamp:
Nov 29, 2007, 5:12:16 PM (17 years ago)
Author:
nicolape
Message:
  • Added CmakeLists so that it works on my machine for testing
  • Fixed a Bug in AudioBuffer
Location:
code/branches/audio
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/audio/CMakeLists.txt

    r345 r350  
    5050FIND_PACKAGE(Boost)
    5151FIND_PACKAGE(OpenAL)
     52FIND_PACKAGE(ALUT)      # Only for testing on my machine
    5253
    5354#Sets the search paths for the linking
    54 LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR} ${ENet_LIBRARY} ${OPENAL_LIB_DIR} ${Boost_LIBRARY_DIRS} ${OPENAL_LIBRARY} core objects loader network weapon classHierarchy audio openal alut)
     55LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR} ${ENet_LIBRARY} ${OPENAL_LIB_DIR} ${ALUT_LIB_DIR} ${Boost_LIBRARY_DIRS} ${OPENAL_LIBRARY} core objects loader network weapon classHierarchy audio openal alut)
    5556#Sets the search path for include files
    5657INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} ${ENet_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR})
  • code/branches/audio/src/audio/AudioBuffer.cc

    r349 r350  
    55        AudioBuffer::AudioBuffer(std::string fileName)
    66        {
    7                
     7                // Load wav data into buffers.
     8                alGenBuffers(1, &buffer);
     9
     10                if(alGetError() != AL_NO_ERROR)
     11                        loaded=AL_FALSE;
     12
     13                alutLoadWAVFile((ALbyte*)fileName.c_str(), &format, &data, &size, &freq, &loop);
     14                alBufferData(buffer, format, data, size, freq);
     15                alutUnloadWAV(format, data, size, freq);
     16
     17                // Do another error check and return.
     18                if(alGetError() != AL_NO_ERROR)
     19                        loaded=AL_FALSE;
     20       
     21                loaded=AL_TRUE;
    822        }
    923       
  • code/branches/audio/src/audio/AudioBuffer.h

    r349 r350  
    1919        private:
    2020                // Buffers hold sound data.
    21                 ALuint data;
     21                ALuint buffer;
    2222                // Identifier
    2323                std::string name;
     24                // True if AL was able to load data
     25                ALboolean loaded;
     26               
     27                ALenum format;
     28                ALsizei size;
     29                ALvoid* data;
     30                ALsizei freq;
     31                ALboolean loop;
    2432        };
    2533}
Note: See TracChangeset for help on using the changeset viewer.