1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-03 06:24:32 +00:00

Merge pull request #41

This commit is contained in:
Valentin Ochs 2017-01-12 22:14:26 +01:00 committed by fgenesis
parent 548da72632
commit dcd21b57bd
40 changed files with 281 additions and 177 deletions

View file

@ -264,8 +264,8 @@ void AfterEffectManager::renderGrid()
if (activeShader)
activeShader->unbind();
float width2 = float(vw)/2;
float height2 = float(vh)/2;
//float width2 = float(vw)/2;
//float height2 = float(vh)/2;
if(firstShader != lastShader)

View file

@ -28,6 +28,7 @@ class Effect
{
public:
Effect();
virtual ~Effect(){};
virtual void go(){}
virtual void update(float dt, Vector ** drawGrid, int xDivs, int yDivs){}
bool done;

View file

@ -67,6 +67,13 @@ Vector getDirVector(Direction dir)
case DIR_RIGHT:
return Vector(1, 0);
break;
case DIR_UPLEFT:
case DIR_UPRIGHT:
case DIR_DOWNLEFT:
case DIR_DOWNRIGHT:
case DIR_MAX:
case DIR_NONE:
break;
}
return Vector(0,0);
}
@ -87,6 +94,13 @@ Direction getOppositeDir(Direction dir)
case DIR_RIGHT:
return DIR_LEFT;
break;
case DIR_UPLEFT:
case DIR_UPRIGHT:
case DIR_DOWNLEFT:
case DIR_DOWNRIGHT:
case DIR_MAX:
case DIR_NONE:
break;
}
return DIR_NONE;
@ -108,6 +122,13 @@ Direction getNextDirClockwise(Direction dir)
case DIR_RIGHT:
return DIR_DOWN;
break;
case DIR_UPLEFT:
case DIR_UPRIGHT:
case DIR_DOWNLEFT:
case DIR_DOWNRIGHT:
case DIR_MAX:
case DIR_NONE:
break;
}
return DIR_NONE;
}
@ -200,11 +221,6 @@ static unsigned char charIsUpper(unsigned char c)
return c == upperToLowerTable[c];
}
static unsigned char charIsLower(unsigned char c)
{
return c == lowerToUpperTable[c];
}
static unsigned char charToLower(unsigned char c)
{
return upperToLowerTable[c];
@ -591,7 +607,7 @@ void forEachFile(std::string path, std::string type, void callback(const std::st
dirent *file=0;
while ( (file=readdir(dir)) != NULL )
{
if (file->d_name && strlen(file->d_name) > 4)
if (strlen(file->d_name) > 4)
{
debugLog(file->d_name);
char *extension=strrchr(file->d_name,'.');

View file

@ -1280,35 +1280,6 @@ bool Core::createWindow(int width, int height, int bits, bool fullscreen, std::s
#define M_PI 3.14159265358979323846
#endif
static void
bbgePerspective(float fovy, float aspect, float zNear, float zFar)
{
float sine, cotangent, deltaZ;
float radians = fovy / 2.0f * M_PI / 180.0f;
deltaZ = zFar - zNear;
sine = sinf(radians);
if ((deltaZ == 0.0f) || (sine == 0.0f) || (aspect == 0.0f)) {
return;
}
cotangent = cosf(radians) / sine;
GLfloat m[4][4] = {
{ 1.0f, 0.0f, 0.0f, 0.0f },
{ 0.0f, 1.0f, 0.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 0.0f, 1.0f }
};
m[0][0] = (GLfloat) (cotangent / aspect);
m[1][1] = (GLfloat) cotangent;
m[2][2] = (GLfloat) (-(zFar + zNear) / deltaZ);
m[2][3] = -1.0f;
m[3][2] = (GLfloat) (-2.0f * zNear * zFar / deltaZ);
m[3][3] = 0.0f;
glMultMatrixf(&m[0][0]);
}
void Core::setPixelScale(int pixelScaleX, int pixelScaleY)
{
@ -1564,8 +1535,7 @@ void Core::main(float runTime)
float dt;
float counter = 0;
int frames = 0;
float real_dt = 0;
int frames = 0;
#if (!defined(_DEBUG) || defined(BBGE_BUILD_UNIX)) && defined(BBGE_BUILD_SDL)

View file

@ -162,7 +162,12 @@ void DebugFont::setAlign(Align align)
#include "../BBGE/Quad.h"
DebugButton::DebugButton(int buttonID, DebugButtonReceiver *receiver, int bgWidth, int fsize, bool quitMain)
: RenderObject(), label(0), highlight(0), quitMain(quitMain), receiver(receiver), buttonID(buttonID)
: RenderObject()
, label(0)
, quitMain(quitMain)
, buttonID(buttonID)
, highlight(0)
, receiver(receiver)
{
if (bgWidth == 0)
bgWidth = 150;

View file

@ -80,6 +80,10 @@ void PostProcessingFX::render()
FXTypes type = (FXTypes)i;
switch(type)
{
case FTX_NONE:
break;
case FXT_MAX:
break;
case FXT_RADIALBLUR:
float windowW = core->getWindowWidth();
@ -148,7 +152,7 @@ void PostProcessingFX::render()
RenderObject::lastTextureApplied = 0;
break;
break;
}
glPopMatrix();

View file

@ -185,7 +185,7 @@ protected:
struct ParticleInfluence
{
ParticleInfluence(Vector pos, float spd, float size, bool pull)
: pos(pos), spd(spd), size(size), pull(pull)
: pos(pos), size(size), spd(spd), pull(pull)
{}
ParticleInfluence() : size(0), spd(0), pull(false) {}
Vector pos;

View file

@ -22,7 +22,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <assert.h>
QuadTrail::QuadTrail(int maxPoints, float pointDist)
: RenderObject(), maxPoints(maxPoints), pointDist(pointDist), numPoints(0)
: RenderObject()
, numPoints(0)
, maxPoints(maxPoints)
, pointDist(pointDist)
{
quadTrailAlphaEffect = QTAE_NORMAL;
cull = false;

View file

@ -114,9 +114,9 @@ void Shader::staticInit()
// everything fine when we are here
_useShaders = true;
#endif
end:
end:
#endif
if (_useShaders)
debugLog("Shader support enabled.");
@ -329,14 +329,14 @@ void Shader::_setUniform(Uniform *u)
{
switch(u->type)
{
case GL_FLOAT: glUniform1fvARB(u->location, 1, u->data.f); break;
case GL_FLOAT_VEC2_ARB: glUniform2fvARB(u->location, 1, u->data.f); break;
case GL_FLOAT_VEC3_ARB: glUniform3fvARB(u->location, 1, u->data.f); break;
case GL_FLOAT_VEC4_ARB: glUniform4fvARB(u->location, 1, u->data.f); break;
case GL_INT: glUniform1ivARB(u->location, 1, u->data.i); break;
case GL_INT_VEC2_ARB: glUniform2ivARB(u->location, 1, u->data.i); break;
case GL_INT_VEC3_ARB: glUniform3ivARB(u->location, 1, u->data.i); break;
case GL_INT_VEC4_ARB: glUniform4ivARB(u->location, 1, u->data.i); break;
case GL_FLOAT: glUniform1fvARB(u->location, 1, u->data.f.f); break;
case GL_FLOAT_VEC2_ARB: glUniform2fvARB(u->location, 1, u->data.f.f); break;
case GL_FLOAT_VEC3_ARB: glUniform3fvARB(u->location, 1, u->data.f.f); break;
case GL_FLOAT_VEC4_ARB: glUniform4fvARB(u->location, 1, u->data.f.f); break;
case GL_INT: glUniform1ivARB(u->location, 1, u->data.i.i); break;
case GL_INT_VEC2_ARB: glUniform2ivARB(u->location, 1, u->data.i.i); break;
case GL_INT_VEC3_ARB: glUniform3ivARB(u->location, 1, u->data.i.i); break;
case GL_INT_VEC4_ARB: glUniform4ivARB(u->location, 1, u->data.i.i); break;
}
u->dirty = false;
}
@ -432,10 +432,10 @@ void Shader::setInt(const char *name, int x, int y /* = 0 */, int z /* = 0 */, i
if(unsigned(idx) >= uniforms.size())
return;
Uniform& u = uniforms[idx];
u.data.i[0] = x;
u.data.i[1] = y;
u.data.i[2] = z;
u.data.i[3] = w;
u.data.i.i[0] = x;
u.data.i.i[1] = y;
u.data.i.i[2] = z;
u.data.i.i[3] = w;
u.dirty = true;
uniformsDirty = true;
#endif
@ -450,10 +450,10 @@ void Shader::setFloat(const char *name, float x, float y /* = 0 */, float z /* =
if(unsigned(idx) >= uniforms.size())
return;
Uniform& u = uniforms[idx];
u.data.f[0] = x;
u.data.f[1] = y;
u.data.f[2] = z;
u.data.f[3] = w;
u.data.f.f[0] = x;
u.data.f.f[1] = y;
u.data.f.f[2] = z;
u.data.f.f[3] = w;
u.dirty = true;
uniformsDirty = true;
#endif

View file

@ -62,14 +62,14 @@ private:
bool dirty; // need to flush if true
union
{
struct
struct si
{
int i[4];
};
struct
} i;
struct sf
{
float f[4];
};
} f;
} data;
char name[64];

View file

@ -365,13 +365,16 @@ void BoneCommand::run()
if (e)
e->stop();
}
break;
break;
case AC_SET_PASS:
b->setRenderPass(slot);
break;
case AC_RESET_PASS:
b->setRenderPass(b->originalRenderPass);
break;
break;
case AC_SEGS_START:
case AC_SEGS_STOP:
break;
}
}

View file

@ -105,7 +105,7 @@ public:
class BoneKeyframe
{
public:
BoneKeyframe() : idx(0), x(0), y(0), rot(0), doScale(0), sx(1), sy(1) {}
BoneKeyframe() : idx(0), x(0), y(0), rot(0), sx(1), sy(1), doScale(0) {}
int idx, x, y, rot;
float sx, sy;
bool doScale;

View file

@ -72,7 +72,7 @@ namespace SoundCore
struct FadeCh
{
public:
FadeCh() : v(1), s(1), c(0), d(-1), to(0) {}
FadeCh() : c(0), v(1), s(1), to(0), d(-1) {}
FMOD::Channel *c;
float v,s,to;
int d;
@ -410,6 +410,9 @@ void SoundManager::toggleEffectMusic(SoundEffectType effect, bool on)
dspFlange->remove();
}
break;
case SFX_NONE:
case SFX_MAX:
break;
}
}

View file

@ -84,9 +84,8 @@ enum SoundLoadType
struct PlaySfx
{
PlaySfx() : priority(0.5), handle(0), vol(1), fade(SFT_NONE),
time(0), freq(1), loops(0),
maxdist(0), x(0), y(0), relative(true), positional(false) {}
PlaySfx() : handle(0), vol(1), time(0), freq(1), loops(0), priority(0.5),
maxdist(0), fade(SFT_NONE), x(0), y(0), relative(true), positional(false) {}
std::string name;
intptr_t handle;

View file

@ -230,7 +230,7 @@ bool Texture::load(std::string file)
size_t pos = file.find_last_of('.');
if ((pos != std::string::npos) && (pos >= 0))
if (pos != std::string::npos)
{
// make sure this didn't catch the '.' in /home/username/.Aquaria/* --ryan.
const std::string userdata = core->getUserDataFolder();