Skip to content

Commit

Permalink
Use SDL_sound instead of libvorbisfile
Browse files Browse the repository at this point in the history
This fixes linking on my system, since libvorbisfile is no longer needed
It also simplifies the code a bit
  • Loading branch information
arichardson committed Jul 2, 2013
1 parent 196b5f0 commit 17267f6
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 288 deletions.
8 changes: 4 additions & 4 deletions sound/WaveReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Copyright 2002-2004 Frozenbyte Ltd.

#include "SDL_sound.h"
#include <SDL/SDL_sound.h>
#include "WaveReader.h"
#include "AmplitudeArray.h"
#include "../system/Logger.h"
Expand Down Expand Up @@ -61,7 +61,7 @@ namespace sfx {
filesystem::fb_fread(fileData.get(), 1, size, fileCont);
filesystem::fb_fclose(fileCont);

SDL_RWops *rw = SDL_RWFromMem(fileData.get(), size);
SDL_RWops *rw = SDL_RWFromConstMem(fileData.get(), size);
ioHandle = Sound_NewSample(rw, NULL, NULL, size);
}

Expand All @@ -79,7 +79,7 @@ namespace sfx {
return;

//FIXME: check correct format etc.
igios_unimplemented();
//igios_unimplemented();

audio_len = Sound_DecodeAll(ioHandle);

Expand Down Expand Up @@ -288,7 +288,7 @@ namespace sfx {
}

// returns true if wave file succesfully loaded
WaveReader::operator bool() const
bool WaveReader::isValid() const
{
assert(this != NULL);

Expand Down
2 changes: 1 addition & 1 deletion sound/WaveReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace sfx {
unsigned int getBits() const;

// returns true if wave file succesfully loaded
operator bool() const;
bool isValid() const;
};

} // sfx
Expand Down
Loading

0 comments on commit 17267f6

Please sign in to comment.