1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-04 21:34:41 +00:00

sync with icculus repo

This commit is contained in:
fgenesis 2011-11-20 15:44:17 +01:00
commit e64fb75f84
48 changed files with 21570 additions and 521 deletions

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//#include "DrawText.h"
#include "RenderObject.h"
#include "glfont2.h"
#include "../ExternalLibs/glfont2/glfont2.h"
enum BitmapFontEffect
{

View file

@ -3947,14 +3947,14 @@ void Core::render(int startLayer, int endLayer, bool useFrameBufferIfAvail)
afterEffectManager->render();
}
if (i == postProcessingFx.layer)
{
postProcessingFx.preRender();
}
if (i == postProcessingFx.renderLayer)
{
postProcessingFx.render();
}
if (i == postProcessingFx.layer)
{
postProcessingFx.preRender();
}
if (i == postProcessingFx.renderLayer)
{
postProcessingFx.render();
}
if (darkLayer.isUsed() )
{

View file

@ -28,7 +28,7 @@ PostProcessingFX::PostProcessingFX()
blendType = 0;
layer = renderLayer = 0;
intensity = 0.1;
blurTimes = 12;
blurTimes = 12;
radialBlurColor = Vector(1,1,1);
for (int i = 0; i < FXT_MAX; i++)
enabled[i] = false;
@ -69,8 +69,8 @@ void PostProcessingFX::disable(FXTypes type)
void PostProcessingFX::render()
{
if(!core->frameBuffer.isEnabled())
return;
if(!core->frameBuffer.isEnabled())
return;
for (int i = 0; i < FXT_MAX; i++)
{
@ -83,39 +83,39 @@ void PostProcessingFX::render()
{
case FXT_RADIALBLUR:
float windowW = core->getWindowWidth();
float windowH = core->getWindowHeight();
float textureW = core->frameBuffer.getWidth();
float textureH = core->frameBuffer.getHeight();
float windowW = core->getWindowWidth();
float windowH = core->getWindowHeight();
float textureW = core->frameBuffer.getWidth();
float textureH = core->frameBuffer.getHeight();
float alpha = intensity;
float alpha = intensity;
float offX = -(core->getVirtualOffX() * windowW / core->getVirtualWidth());
float offY = -(core->getVirtualOffY() * windowH / core->getVirtualHeight());
float offX = -(core->getVirtualOffX() * windowW / core->getVirtualWidth());
float offY = -(core->getVirtualOffY() * windowH / core->getVirtualHeight());
float width2 = windowW / 2;
float height2 = windowH / 2;
float width2 = windowW / 2;
float height2 = windowH / 2;
float pw = float(windowW)/float(textureW);
float ph = float(windowH)/float(textureH);
float pw = float(windowW)/float(textureW);
float ph = float(windowH)/float(textureH);
glLoadIdentity();
glLoadIdentity();
glTranslatef(width2 + offX, height2 + offY, 0);
glTranslatef(width2 + offX, height2 + offY, 0);
glEnable(GL_TEXTURE_2D);
glEnable(GL_TEXTURE_2D);
core->frameBuffer.bindTexture();
core->frameBuffer.bindTexture();
glEnable(GL_BLEND);
glEnable(GL_BLEND);
if (blendType == 1)
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
else
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
if (blendType == 1)
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
else
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
float percentX = pw, percentY = ph;
float percentX = pw, percentY = ph;
float inc = 0.01;
float spost = 0.0f; // Starting Texture Coordinate Offset
@ -126,17 +126,17 @@ void PostProcessingFX::render()
{
glColor4f(radialBlurColor.x, radialBlurColor.y, radialBlurColor.z, alpha); // Set The Alpha Value (Starts At 0.2)
glTexCoord2d(spost, spost);
glVertex3f(-width2, height2, 0.0);
glTexCoord2d(spost, spost);
glVertex3f(-width2, height2, 0.0);
glTexCoord2d(percentX-spost, spost);
glVertex3f( width2, height2, 0.0);
glTexCoord2d(percentX-spost, spost);
glVertex3f( width2, height2, 0.0);
glTexCoord2d(percentX-spost, percentY-spost);
glVertex3f( width2, -height2, 0.0);
glTexCoord2d(percentX-spost, percentY-spost);
glVertex3f( width2, -height2, 0.0);
glTexCoord2d(spost, percentY-spost);
glVertex3f(-width2, -height2, 0.0);
glTexCoord2d(spost, percentY-spost);
glVertex3f(-width2, -height2, 0.0);
spost += inc; // Gradually Increase spost (Zooming Closer To Texture Center)
alpha -= alphadec; // Gradually Decrease alpha (Gradually Fading Image Out)
@ -144,9 +144,9 @@ void PostProcessingFX::render()
glEnd();
glColor4f(1,1,1,1);
glBindTexture(GL_TEXTURE_2D, 0);
RenderObject::lastTextureApplied = 0;
glColor4f(1,1,1,1);
glBindTexture(GL_TEXTURE_2D, 0);
RenderObject::lastTextureApplied = 0;
break;

View file

@ -34,7 +34,7 @@ class PostProcessingFX
{
public:
PostProcessingFX();
void init();
void init();
void update(float dt);
void preRender();
void render();
@ -45,9 +45,9 @@ public:
// blur
Vector radialBlurColor;
int blurTimes;
int blurTimes;
/// misc
/// misc
int renderLayer;
int layer;
float intensity;

View file

@ -980,7 +980,7 @@ class OpenALSystem
public:
OpenALSystem();
~OpenALSystem();
FMOD_RESULT init(int maxchannels, const FMOD_INITFLAGS flags, const void *extradriverdata, std::string defaultDevice);
FMOD_RESULT init(int maxchannels, const FMOD_INITFLAGS flags, const void *extradriverdata);
FMOD_RESULT update();
FMOD_RESULT release();
FMOD_RESULT getVersion(unsigned int *version);
@ -1130,25 +1130,12 @@ FMOD_RESULT OpenALSystem::getVersion(unsigned int *version)
return FMOD_OK;
}
ALBRIDGE(System,init,(int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata, std::string defaultDevice),(maxchannels,flags,extradriverdata, defaultDevice))
FMOD_RESULT OpenALSystem::init(int maxchannels, const FMOD_INITFLAGS flags, const void *extradriverdata, std::string defaultDevice)
ALBRIDGE(System,init,(int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata),(maxchannels,flags,extradriverdata))
FMOD_RESULT OpenALSystem::init(int maxchannels, const FMOD_INITFLAGS flags, const void *extradriverdata)
{
ALCdevice *dev = NULL;
if (!defaultDevice.empty())
{
dev = alcOpenDevice(defaultDevice.c_str()); // Try to use device specified in user config
}
if (!dev)
{
dev = alcOpenDevice(NULL); // Fall back to system default device
}
ALCdevice *dev = alcOpenDevice(NULL);
if (!dev)
{
return FMOD_ERR_INTERNAL;
}
// OpenAL doesn't provide a way to request sources that can be either
// mono or stereo, so we need to request both separately (thus allocating

View file

@ -158,7 +158,7 @@ namespace FMOD
FMOD_RESULT getDriverCaps(int id, FMOD_CAPS *caps, int *minfrequency, int *maxfrequency, FMOD_SPEAKERMODE *controlpanelspeakermode);
FMOD_RESULT getMasterChannelGroup(ChannelGroup **channelgroup);
FMOD_RESULT getVersion(unsigned int *version);
FMOD_RESULT init(int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata, std::string defaultDevice);
FMOD_RESULT init(int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
FMOD_RESULT playSound(FMOD_CHANNELINDEX channelid, Sound *sound, bool paused, Channel **channel);
FMOD_RESULT setDSPBufferSize(unsigned int bufferlength, int numbuffers);
FMOD_RESULT setFileSystem(FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek, int blockalign);

1646
BBGE/GL/gl.h Normal file

File diff suppressed because it is too large Load diff

14
BBGE/GL/gles.h Normal file
View file

@ -0,0 +1,14 @@
/* OpenGL ES-specific. --ryan. */
/* I should probably put an official GLES header in here instead. Oh well. */
#ifdef __cplusplus
extern "C" {
#endif
void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
void glClearDepthf(GLclampf depth);
#ifdef __cplusplus
}
#endif

7204
BBGE/GL/glext.h Normal file

File diff suppressed because it is too large Load diff

View file

@ -229,8 +229,8 @@ void RenderObjectLayer::moveToFront(RenderObject *r)
renderObjects[curIdx] = 0;
renderObjects[newIdx] = r;
r->setIdx(newIdx);
if (firstFreeIdx == newIdx)
firstFreeIdx++;
if (firstFreeIdx > curIdx)
firstFreeIdx = curIdx;
}
else if (objectCount == size)
{
@ -242,7 +242,7 @@ void RenderObjectLayer::moveToFront(RenderObject *r)
r->setIdx(size);
for (int i = size+1; i < newSize; i++)
renderObjects[i] = 0;
firstFreeIdx = size+1;
firstFreeIdx = curIdx;
}
else
{
@ -254,18 +254,20 @@ void RenderObjectLayer::moveToFront(RenderObject *r)
if (!renderObjects[lastFree])
break;
}
for (int i = lastFree + 1; i <= lastUsed; i++)
{
renderObjects[i-1] = renderObjects[i];
if(renderObjects[i-1])
renderObjects[i-1]->setIdx(i-1);
renderObjects[i-1]->setIdx(i-1); // Known to be non-NULL.
}
renderObjects[lastUsed] = r;
r->setIdx(lastUsed);
if (firstFreeIdx == lastFree)
firstFreeIdx = lastUsed + 1;
firstFreeIdx = curIdx;
while (renderObjects[firstFreeIdx])
{
firstFreeIdx++;
if(firstFreeIdx >= size)
firstFreeIdx = 0;
}
}
#endif // RLT_FIXED
#ifdef RLT_DYNAMIC
@ -298,7 +300,9 @@ void RenderObjectLayer::moveToBack(RenderObject *r)
renderObjects[curIdx] = 0;
renderObjects[newIdx] = r;
r->setIdx(newIdx);
if (firstFreeIdx == newIdx)
// firstFreeIdx must be 0 here; if we filled slot 0, then
// scan forward for the next empty element.
while (renderObjects[firstFreeIdx])
firstFreeIdx++;
}
else if (objectCount == size)
@ -312,8 +316,7 @@ void RenderObjectLayer::moveToBack(RenderObject *r)
for (int i = newSize - 1; i >= sizeDiff; i--)
{
renderObjects[i] = renderObjects[i - sizeDiff];
if(renderObjects[i])
renderObjects[i]->setIdx(i);
renderObjects[i]->setIdx(i); // Known to be non-NULL.
}
for (int i = 0; i < newIdx; i++)
renderObjects[i] = 0;
@ -329,8 +332,7 @@ void RenderObjectLayer::moveToBack(RenderObject *r)
for (int i = firstFreeIdx; i > 0; i--)
{
renderObjects[i] = renderObjects[i-1];
if(renderObjects[i])
renderObjects[i]->setIdx(i);
renderObjects[i]->setIdx(i); // Known to be non-NULL.
}
renderObjects[0] = r;
r->setIdx(0);

View file

@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "SkeletalSprite.h"
#include "tinyxml.h"
#include "../ExternalLibs/tinyxml.h"
#include "Core.h"
#include "Particles.h"
#include "MathFunctions.h"

View file

@ -326,15 +326,15 @@ SoundManager::SoundManager(const std::string &defaultDevice)
}
debugLog("init");
result = SoundCore::system->init(channels, FMOD_INIT_NORMAL, 0, defaultDevice); /* Replace with whatever channel count and flags you use! */
result = SoundCore::system->init(channels, FMOD_INIT_NORMAL, 0); /* Replace with whatever channel count and flags you use! */
if (result == FMOD_ERR_OUTPUT_CREATEBUFFER) /* Ok, the speaker mode selected isn't supported by this soundcard. Switch it back to stereo... */
{
debugLog("err_output_createbuffer, speaker mode");
result = SoundCore::system->setSpeakerMode(FMOD_SPEAKERMODE_STEREO);
if (checkError()) goto get_out;
debugLog("init 2");
result = SoundCore::system->init(channels, FMOD_INIT_NORMAL, 0, defaultDevice); /* Replace with whatever channel count and flags you use! */
result = SoundCore::system->init(channels, FMOD_INIT_NORMAL, 0); /* Replace with whatever channel count and flags you use! */
if (checkError()) goto get_out;
}

View file

@ -66,6 +66,17 @@ void initInputCodeMap()
inputCodeMap["KEY_9"] = KEY_9;
inputCodeMap["KEY_0"] = KEY_0;
inputCodeMap["KEY_NUMPAD1"] = KEY_NUMPAD1;
inputCodeMap["KEY_NUMPAD2"] = KEY_NUMPAD2;
inputCodeMap["KEY_NUMPAD3"] = KEY_NUMPAD3;
inputCodeMap["KEY_NUMPAD4"] = KEY_NUMPAD4;
inputCodeMap["KEY_NUMPAD5"] = KEY_NUMPAD5;
inputCodeMap["KEY_NUMPAD6"] = KEY_NUMPAD6;
inputCodeMap["KEY_NUMPAD7"] = KEY_NUMPAD7;
inputCodeMap["KEY_NUMPAD8"] = KEY_NUMPAD8;
inputCodeMap["KEY_NUMPAD9"] = KEY_NUMPAD9;
inputCodeMap["KEY_NUMPAD0"] = KEY_NUMPAD0;
inputCodeMap["KEY_F1"] = KEY_F1;
inputCodeMap["KEY_F2"] = KEY_F2;
inputCodeMap["KEY_F3"] = KEY_F3;

6496
BBGE/glext/glext.h Normal file

File diff suppressed because it is too large Load diff