brought up-to-date with latest changes from main repo

This commit is contained in:
bill@Ixion
2009-08-26 11:07:44 -05:00
parent 0aae22d523
commit 8a6f16a4f6
10 changed files with 2010 additions and 1690 deletions
+4
View File
@@ -16,3 +16,7 @@ glob:*.lib
glob:*.ncb
glob:*.exe
glob:*.bat
glob:platform/macosx/build
glob:platform/macosx/love.xcodeproj/bill*
glob:*.DS_Store
glob:*.dylib
+1 -1
View File
@@ -40,7 +40,7 @@
<key>CFBundleSignature</key>
<string>LoVe</string>
<key>CFBundleVersion</key>
<string>0.5</string>
<string>0.6.0</string>
<key>NSMainNibFile</key>
<string>SDLMain</string>
<key>NSPrincipalClass</key>
File diff suppressed because it is too large Load Diff
+52 -47
View File
@@ -1,49 +1,54 @@
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#ifndef LOVE_AUDIO_OPENAL_AUDIO_H
#define LOVE_AUDIO_OPENAL_AUDIO_H
// STD
#include <queue>
#include <map>
#include <iostream>
#include <cmath>
// STD
#include <queue>
#include <map>
#include <iostream>
#include <cmath>
// SDL
#include <SDL.h>
// OpenAL
#include <AL/alc.h>
#include <AL/al.h>
// LOVE
#include <audio/Audio.h>
#include <common/config.h>
#include <sound/SoundData.h>
#include "Sound.h"
#include "Sound.h"
#include "Music.h"
#include "Source.h"
#include "Pool.h"
// OpenAL
#ifdef LOVE_MACOSX
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <AL/alc.h>
#include <AL/al.h>
#endif
namespace love
{
namespace audio
@@ -75,25 +80,25 @@ namespace openal
// Implements Module.
const char * getName() const;
// Implements Audio.
love::audio::Sound * newSound(love::sound::SoundData * data);
love::audio::Music * newMusic(love::sound::Decoder * decoder);
love::audio::Source * newSource(Audible * audible);
// Implements Audio.
love::audio::Sound * newSound(love::sound::SoundData * data);
love::audio::Music * newMusic(love::sound::Decoder * decoder);
love::audio::Source * newSource(Audible * audible);
int getNumSources() const;
int getMaxSources() const;
void play(love::audio::Source * source);
void play(love::audio::Sound * sound);
void play(love::audio::Music * music);
void play();
void stop(love::audio::Source * source);
void stop();
void pause(love::audio::Source * source);
void pause();
void resume(love::audio::Source * source);
void resume();
void rewind(love::audio::Source * source);
void rewind();
void setVolume(float volume);
int getMaxSources() const;
void play(love::audio::Source * source);
void play(love::audio::Sound * sound);
void play(love::audio::Music * music);
void play();
void stop(love::audio::Source * source);
void stop();
void pause(love::audio::Source * source);
void pause();
void resume(love::audio::Source * source);
void resume();
void rewind(love::audio::Source * source);
void rewind();
void setVolume(float volume);
float getVolume() const;
void getPosition(float * v) const;
+76 -70
View File
@@ -1,73 +1,79 @@
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#ifndef LOVE_AUDIO_OPENAL_MUSIC_H
#define LOVE_AUDIO_OPENAL_MUSIC_H
// LOVE
#include <audio/Music.h>
#include <sound/Decoder.h>
#include "Pool.h"
// OpenAL
#include <AL/alc.h>
#include <AL/al.h>
namespace love
{
namespace audio
{
namespace openal
{
// Forward declarations.
class Audio;
class Music : public love::audio::Music
{
private:
static const unsigned int NUM_BUFFERS = 32;
ALuint buffers[NUM_BUFFERS];
Pool * pool;
love::sound::Decoder * decoder;
ALuint source;
public:
Music(Pool * pool, love::sound::Decoder * decoder);
virtual ~Music();
// Implements Audible.
void play(love::audio::Source * source);
void update(love::audio::Source * source);
void stop(love::audio::Source * source);
void rewind(love::audio::Source * source);
// Implements Music.
love::audio::Music * clone();
private:
bool stream(love::audio::Source * source, ALuint buffer);
}; // Sound
} // openal
} // audio
} // love
#ifndef LOVE_AUDIO_OPENAL_MUSIC_H
#define LOVE_AUDIO_OPENAL_MUSIC_H
// LOVE
#include <audio/Music.h>
#include <common/config.h>
#include <sound/Decoder.h>
#include "Pool.h"
// OpenAL
#ifdef LOVE_MACOSX
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <AL/alc.h>
#include <AL/al.h>
#endif
namespace love
{
namespace audio
{
namespace openal
{
// Forward declarations.
class Audio;
class Music : public love::audio::Music
{
private:
static const unsigned int NUM_BUFFERS = 32;
ALuint buffers[NUM_BUFFERS];
Pool * pool;
love::sound::Decoder * decoder;
ALuint source;
public:
Music(Pool * pool, love::sound::Decoder * decoder);
virtual ~Music();
// Implements Audible.
void play(love::audio::Source * source);
void update(love::audio::Source * source);
void stop(love::audio::Source * source);
void rewind(love::audio::Source * source);
// Implements Music.
love::audio::Music * clone();
private:
bool stream(love::audio::Source * source, ALuint buffer);
}; // Sound
} // openal
} // audio
} // love
#endif // LOVE_AUDIO_OPENAL_MUSIC_H
+40 -34
View File
@@ -1,43 +1,49 @@
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#ifndef LOVE_AUDIO_OPENAL_POOL_H
#define LOVE_AUDIO_OPENAL_POOL_H
// STD
#include <queue>
#include <map>
#include <iostream>
#include <cmath>
// STD
#include <queue>
#include <map>
#include <iostream>
#include <cmath>
// SDL
#include <SDL.h>
// OpenAL
#include <AL/alc.h>
#include <AL/al.h>
// LOVE
#include <audio/Source.h>
#include <common/config.h>
#include <common/Exception.h>
// OpenAL
#ifdef LOVE_MACOSX
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <AL/alc.h>
#include <AL/al.h>
#endif
namespace love
{
namespace audio
@@ -69,13 +75,13 @@ namespace openal
Pool();
~Pool();
/**
* Gets the OpenAL format identifier based on number of
* channels and bits.
* @param channels Either 1 (mono) or 2 (stereo).
* @param bits Either 8-bit samples, or 16-bit samples.
* @return One of AL_FORMAT_*, or 0 if unsupported format.
**/
/**
* Gets the OpenAL format identifier based on number of
* channels and bits.
* @param channels Either 1 (mono) or 2 (stereo).
* @param bits Either 8-bit samples, or 16-bit samples.
* @return One of AL_FORMAT_*, or 0 if unsupported format.
**/
ALenum getFormat(int channels, int bits) const;
/**
+70 -62
View File
@@ -1,69 +1,77 @@
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#ifndef LOVE_AUDIO_OPENAL_SOUND_H
#define LOVE_AUDIO_OPENAL_SOUND_H
// LOVE
#include <sound/SoundData.h>
#include <audio/Sound.h>
#include "Pool.h"
// OpenAL
#include <AL/alc.h>
#include <AL/al.h>
namespace love
{
namespace audio
{
namespace openal
{
// Forward declarations.
class Audio;
class Sound : public love::audio::Sound
{
private:
#ifndef LOVE_AUDIO_OPENAL_SOUND_H
#define LOVE_AUDIO_OPENAL_SOUND_H
// LOVE
#include <sound/SoundData.h>
#include <audio/Sound.h>
#include <common/config.h>
#include "Pool.h"
// OpenAL
#ifdef LOVE_MACOSX
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <AL/alc.h>
#include <AL/al.h>
#endif
namespace love
{
namespace audio
{
namespace openal
{
// Forward declarations.
class Audio;
class Sound : public love::audio::Sound
{
private:
Pool * pool;
// Sounds only need one buffer.
ALuint buffer;
ALuint source;
public:
Sound(Pool * pool, love::sound::SoundData * data);
virtual ~Sound();
// Implements Audible.
void play(love::audio::Source * s);
void update(love::audio::Source * s);
void stop(love::audio::Source * s);
void rewind(love::audio::Source * s);
}; // Sound
} // openal
} // audio
} // love
ALuint buffer;
ALuint source;
public:
Sound(Pool * pool, love::sound::SoundData * data);
virtual ~Sound();
// Implements Audible.
void play(love::audio::Source * s);
void update(love::audio::Source * s);
void stop(love::audio::Source * s);
void rewind(love::audio::Source * s);
}; // Sound
} // openal
} // audio
} // love
#endif // LOVE_AUDIO_OPENAL_SOUND_H
+83 -77
View File
@@ -1,83 +1,89 @@
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#ifndef LOVE_AUDIO_OPENAL_SOURCE_H
#define LOVE_AUDIO_OPENAL_SOURCE_H
// LOVE
#include <common/Object.h>
#include <audio/Source.h>
#include "Pool.h"
// OpenAL
#include <AL/alc.h>
#include <AL/al.h>
namespace love
{
namespace audio
{
namespace openal
{
class Audio;
class Source : public love::audio::Source
{
#ifndef LOVE_AUDIO_OPENAL_SOURCE_H
#define LOVE_AUDIO_OPENAL_SOURCE_H
// LOVE
#include <common/config.h>
#include <common/Object.h>
#include <audio/Source.h>
#include "Pool.h"
// OpenAL
#ifdef LOVE_MACOSX
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <AL/alc.h>
#include <AL/al.h>
#endif
namespace love
{
namespace audio
{
namespace openal
{
class Audio;
class Source : public love::audio::Source
{
private:
Pool * pool;
ALuint source;
float pitch;
float volume;
public:
Source(Pool * pool);
Source(Pool * pool, Audible * audible);
virtual ~Source();
void play();
void stop();
void pause();
void resume();
void rewind();
bool isFinished() const;
void update();
void setPitch(float pitch);
float getPitch() const;
void setVolume(float volume);
float getVolume() const;
void setPosition(float * v);
void getPosition(float * v) const;
void setVelocity(float * v);
void getVelocity(float * v) const;
void setDirection(float * v);
void getDirection(float * v) const;
}; // Source
} // openal
} // audio
} // love
ALuint source;
float pitch;
float volume;
public:
Source(Pool * pool);
Source(Pool * pool, Audible * audible);
virtual ~Source();
void play();
void stop();
void pause();
void resume();
void rewind();
bool isFinished() const;
void update();
void setPitch(float pitch);
float getPitch() const;
void setVolume(float volume);
float getVolume() const;
void setPosition(float * v);
void getPosition(float * v) const;
void setVelocity(float * v);
void getVelocity(float * v) const;
void setDirection(float * v);
void getDirection(float * v) const;
}; // Source
} // openal
} // audio
} // love
#endif // LOVE_AUDIO_OPENAL_SOURCE_H
+4
View File
@@ -1477,6 +1477,8 @@ static int rt_get_caller_pc(unsigned long *paddr,
*paddr = uc->uc_mcontext.mc_eip;
#elif defined(__dietlibc__)
*paddr = uc->uc_mcontext.eip;
#elif defined(__APPLE__)
fp = uc->uc_mcontext->__ss.__eip;
#else
*paddr = uc->uc_mcontext.gregs[REG_EIP];
#endif
@@ -1486,6 +1488,8 @@ static int rt_get_caller_pc(unsigned long *paddr,
fp = uc->uc_mcontext.mc_ebp;
#elif defined(__dietlibc__)
fp = uc->uc_mcontext.ebp;
#elif defined(__APPLE__)
fp = uc->uc_mcontext->__ss.__ebp;
#else
fp = uc->uc_mcontext.gregs[REG_EBP];
#endif
+20 -20
View File
@@ -1,21 +1,21 @@
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#include "Sound.h"
@@ -59,8 +59,8 @@ namespace lullaby
decoder = new Mpg123Decoder(data, ext, bufferSize, sampleRate);
else if (VorbisDecoder::accepts(ext))
decoder = new VorbisDecoder(data, ext, bufferSize, sampleRate);
else if (FLACDecoder::accepts(ext))
decoder = new FLACDecoder(data, ext, bufferSize, sampleRate);
/*else if (FLACDecoder::accepts(ext))
decoder = new FLACDecoder(data, ext, bufferSize, sampleRate);*/
// else if(OtherDecoder::accept(ext))