1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 14:09:06 +00:00

sync with icculus repo

This commit is contained in:
fgenesis 2012-02-09 17:40:35 +01:00
parent 5623b11f83
commit 321a65a9fb
2 changed files with 15 additions and 22 deletions

View file

@ -803,25 +803,24 @@ bool isTouchingLine(Vector lineStart, Vector lineEnd, Vector point, int radius,
GLuint generateEmptyTexture(int quality) // Create An Empty Texture
{
GLuint txtnumber=0; // Texture ID
unsigned int* data; // Stored Data
unsigned char *data; // Stored Data
// Create Storage Space For Texture Data (128x128x4)
int size = (quality * quality)* 4;
data = (unsigned int*)new GLuint[size];
memset(data, 0, size * sizeof(GLuint)); // Clear Storage Memory
int size = (quality * quality) * 4;
data = new unsigned char[size];
memset(data, 0, size); // Clear Storage Memory
#ifdef BBGE_BUILD_OPENGL
glGenTextures(1, &txtnumber); // Create 1 Texture
glBindTexture(GL_TEXTURE_2D, txtnumber); // Bind The Texture
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 4, quality, quality, 0,
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, quality, quality, 0,
GL_RGBA, GL_UNSIGNED_BYTE, data); // Build Texture Using Information In data
#endif
delete [] data; // Release data
delete [] data; // Release data
return txtnumber; // Return The Texture ID
}

View file

@ -360,7 +360,7 @@ void OggDecoder::decode_loop(OggDecoder *this_)
while (!this_->stop_thread)
{
#ifdef BBGE_BUILD_SDL
SDL_Delay(1);
SDL_Delay(10);
#endif
int processed = 0;
@ -376,6 +376,12 @@ void OggDecoder::decode_loop(OggDecoder *this_)
}
}
#if (defined(BBGE_BUILD_SDL) && (SDL_BYTEORDER == SDL_BIG_ENDIAN))
#define BBGE_BIGENDIAN 1
#else
#define BBGE_BIGENDIAN 0
#endif
void OggDecoder::queue(ALuint buffer)
{
if (!playing || eof)
@ -391,7 +397,8 @@ void OggDecoder::queue(ALuint buffer)
int bitstream_unused;
const int nread = ov_read(
&vf, pcm_buffer + pcm_size, buffer_size - pcm_size,
/*bigendianp*/ 0, /*word*/ 2, /*sgned*/ 1, &bitstream_unused
/*bigendianp*/ BBGE_BIGENDIAN, /*word*/ 2, /*sgned*/ 1,
&bitstream_unused
);
if (nread == 0 || nread == OV_EOF)
{
@ -513,8 +520,6 @@ namespace FMOD {
return ((OpenAL##cls *) this)->method args; \
}
static ALenum GVorbisFormat = AL_NONE;
// FMOD::Sound implementation ...
class OpenALSound
@ -1217,17 +1222,6 @@ FMOD_RESULT OpenALSystem::init(int maxchannels, const FMOD_INITFLAGS flags, cons
SANITY_CHECK_OPENAL_CALL();
GVorbisFormat = AL_NONE;
if (alIsExtensionPresent("AL_EXT_vorbis"))
GVorbisFormat = alGetEnumValue("AL_FORMAT_VORBIS_EXT");
#if 0 // Disabled output: every bug report thinks this is the culprit. --ryan.
if (GVorbisFormat == AL_NONE)
fprintf(stderr, "WARNING: no AL_EXT_vorbis support. We'll use more RAM.\n");
#endif
SANITY_CHECK_OPENAL_CALL();
master_channel_group = new OpenALChannelGroup("master");
num_channels = maxchannels;