mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-03 22:44:32 +00:00
Remove commented-out code
This commit is contained in:
parent
0f39b825e1
commit
eb128e65a4
162 changed files with 2092 additions and 6594 deletions
|
@ -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 "AfterEffect.h"
|
||||
//#include "math.h"
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
|
@ -76,7 +76,7 @@ AfterEffectManager::~AfterEffectManager()
|
|||
for (i = 0; i < xDivs; i++)
|
||||
{
|
||||
delete[] drawGrid[i];
|
||||
}
|
||||
}
|
||||
delete[] drawGrid;
|
||||
}
|
||||
deleteEffects();
|
||||
|
@ -128,7 +128,7 @@ void AfterEffectManager::clear()
|
|||
|
||||
void AfterEffectManager::update(float dt)
|
||||
{
|
||||
if (core->particlesPaused) return;
|
||||
if (core->particlesPaused) return;
|
||||
|
||||
resetGrid();
|
||||
|
||||
|
@ -138,7 +138,7 @@ void AfterEffectManager::update(float dt)
|
|||
active = false;
|
||||
|
||||
for (int i = 0; i < effects.size(); i++)
|
||||
{
|
||||
{
|
||||
Effect *e = effects[i];
|
||||
if (e)
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ void AfterEffectManager::render()
|
|||
|
||||
glColor4f(1,1,1,1);
|
||||
renderGrid();
|
||||
//renderGridPoints();
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
@ -234,29 +234,29 @@ void AfterEffectManager::renderGrid()
|
|||
backupBuffer.startCapture();
|
||||
}
|
||||
|
||||
//float div = xDivs;
|
||||
|
||||
for (int i = 0; i < (xDivs-1); i++)
|
||||
{
|
||||
for (int j = 0; j < (yDivs-1); j++)
|
||||
{
|
||||
glBegin(GL_QUADS);
|
||||
//glColor3f(i/div, i/div, i/div);
|
||||
{
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
glTexCoord2f(i/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,i/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB,0,0);
|
||||
|
||||
|
||||
glVertex2f(offx + vw*drawGrid[i][j].x, offy + vh*drawGrid[i][j].y);
|
||||
glTexCoord2f(i/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,i/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB,0,(float)(screenHeight/(yDivs-1))/16);
|
||||
|
||||
|
||||
glVertex2f(offx + vw*drawGrid[i][j+1].x, offy + vh*drawGrid[i][j+1].y);
|
||||
glTexCoord2f((i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,(i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB,(float)(screenWidth/(xDivs-1))/16,(float)(screenHeight/(yDivs-1))/16);
|
||||
glTexCoord2f((i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
|
||||
|
||||
glVertex2f(offx + vw*drawGrid[i+1][j+1].x, offy + vh*drawGrid[i+1][j+1].y);
|
||||
glTexCoord2f((i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,(i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB,(float)(screenWidth/(xDivs-1))/16,0);
|
||||
glVertex2f(offx + vw*drawGrid[i+1][j].x, offy + vh*drawGrid[i+1][j].y);
|
||||
glTexCoord2f((i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
|
||||
|
||||
glVertex2f(offx + vw*drawGrid[i+1][j].x, offy + vh*drawGrid[i+1][j].y);
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ void AfterEffectManager::renderGrid()
|
|||
|
||||
activeShader->bind();
|
||||
activeShader->setInt("tex", 0);
|
||||
|
||||
|
||||
// note that offx, offy are negative here!
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2d(0.0f, 0.0f);
|
||||
|
@ -305,7 +305,7 @@ void AfterEffectManager::renderGrid()
|
|||
glTexCoord2d(0.0f, percentY);
|
||||
glVertex3f(offx, offy, 0.0f);
|
||||
glEnd();
|
||||
|
||||
|
||||
activeShader->unbind();
|
||||
}
|
||||
}
|
||||
|
@ -319,8 +319,8 @@ void AfterEffectManager::renderGrid()
|
|||
for (int i = 0; i < (xDivs-1); i++)
|
||||
{
|
||||
for (int j = 0; j < (yDivs-1); j++)
|
||||
{
|
||||
glBegin(GL_POINTS);
|
||||
{
|
||||
glBegin(GL_POINTS);
|
||||
//glColor3f(i/div, i/div, i/div);
|
||||
glTexCoord2f(i/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,i/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
|
@ -330,17 +330,17 @@ void AfterEffectManager::renderGrid()
|
|||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,i/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB,0,(float)(screenHeight/(yDivs-1))/16);
|
||||
glVertex2f(800*drawGrid[i][j+1].x, 600*drawGrid[i][j+1].y);
|
||||
glTexCoord2f((i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,(i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB,(float)(screenWidth/(xDivs-1))/16,(float)(screenHeight/(yDivs-1))/16);
|
||||
glTexCoord2f((i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,(i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j+1)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB,(float)(screenWidth/(xDivs-1))/16,(float)(screenHeight/(yDivs-1))/16);
|
||||
glVertex2f(800*drawGrid[i+1][j+1].x, 600*drawGrid[i+1][j+1].y);
|
||||
glTexCoord2f((i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,(i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB,(float)(screenWidth/(xDivs-1))/16,0);
|
||||
glVertex2f(800*drawGrid[i+1][j].x, 600*drawGrid[i+1][j].y);
|
||||
glTexCoord2f((i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE0_ARB,(i+1)/(float)(xDivs-1)*percentX, 1*percentY-(j)/(float)(yDivs-1)*percentY);
|
||||
//glMultiTexCoord2fARB(GL_TEXTURE1_ARB,(float)(screenWidth/(xDivs-1))/16,0);
|
||||
glVertex2f(800*drawGrid[i+1][j].x, 600*drawGrid[i+1][j].y);
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//glDisable(GL_TEXTURE_2D);
|
||||
|
@ -349,7 +349,7 @@ void AfterEffectManager::renderGrid()
|
|||
|
||||
//bwShader.unbind();
|
||||
//glActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
//if (bRenderGridPoints)
|
||||
// renderGridPoints();
|
||||
}
|
||||
|
@ -432,31 +432,15 @@ void AfterEffectManager::addEffect(Effect *e)
|
|||
effects.push_back(e);
|
||||
}
|
||||
numEffects++;
|
||||
//float lowest = 9999;
|
||||
Vector base(0,0,0);
|
||||
//Vector *newPos = &base;
|
||||
//Vector *v;
|
||||
e->position.x /= screenWidth;
|
||||
//e->position.x *= xDivs;
|
||||
e->position.y /= screenHeight;
|
||||
//e->position.y *= yDivs;
|
||||
|
||||
/*
|
||||
for (int x = 1; x < xDivs-1; x++)
|
||||
{
|
||||
for (int y = 1; y < yDivs-1; y++)
|
||||
{
|
||||
v = &drawGrid[x][y];
|
||||
float dist = (v->x - e->position.x)*(v->x - e->position.x)+(v->y - e->position.y)*(v->y - e->position.y);
|
||||
if (dist < lowest)
|
||||
{
|
||||
lowest = dist;
|
||||
newPos = &drawGrid[x][y];
|
||||
}
|
||||
}
|
||||
}
|
||||
e->position = Vector(newPos->x, newPos->y, newPos->z);
|
||||
*/
|
||||
Vector base(0,0,0);
|
||||
|
||||
|
||||
e->position.x /= screenWidth;
|
||||
|
||||
e->position.y /= screenHeight;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -465,18 +449,13 @@ void ShockEffect::update(float dt, Vector ** drawGrid, int xDivs, int yDivs)
|
|||
{
|
||||
dt *= timeMultiplier;
|
||||
Effect::update(dt, drawGrid, xDivs, yDivs);
|
||||
//GLdouble sx, sy,sz;
|
||||
/*
|
||||
gluProject(position.x,position.y,position.z,
|
||||
nCameraPointer->modelMatrix,nCameraPointer->projMatrix,nCameraPointer->viewport,
|
||||
&sx,&sy,&sz); // Find out where the light is on the screen.
|
||||
centerPoint.Set(sx/(float)nCameraPointer->viewport[2],1-sy/(float)nCameraPointer->viewport[3],sz);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
centerPoint = position;
|
||||
centerPoint -= ((core->screenCenter-originalCenter)*core->globalScale.x)/core->width;
|
||||
//centerPoint = position/xDivs;
|
||||
//centerPoint = drawGrid[xDivs/2][yDivs/2];
|
||||
|
||||
|
||||
float xDist,yDist,tDist;
|
||||
|
||||
|
||||
|
@ -484,8 +463,7 @@ void ShockEffect::update(float dt, Vector ** drawGrid, int xDivs, int yDivs)
|
|||
currentDistance+=dt*frequency;
|
||||
|
||||
|
||||
//float distFromCamp =(core->cameraPos - position).getLength2D();//v3dDist(nCameraPointer->pos, position);
|
||||
//if (distFromCamp < 4)
|
||||
|
||||
float distFromCamp = 4;
|
||||
|
||||
float adjWaveLength = waveLength/distFromCamp;
|
||||
|
@ -498,33 +476,21 @@ void ShockEffect::update(float dt, Vector ** drawGrid, int xDivs, int yDivs)
|
|||
{
|
||||
for (int j = 1; j < (yDivs-1); j++)
|
||||
{
|
||||
/*
|
||||
Vector p = getNearestPointOnLine(centerPoint, centerPoint + Vector(-200, -200), Vector(drawGrid[i][j].x*core->width, drawGrid[i][j].y*core->height));
|
||||
|
||||
p.x /= core->width;
|
||||
p.y /= core->height;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
xDist = (centerPoint.x - drawGrid[i][j].x)/.75;
|
||||
yDist = centerPoint.y - drawGrid[i][j].y;
|
||||
|
||||
/*
|
||||
xDist = (p.x - drawGrid[i][j].x)/.75;
|
||||
yDist = p.y - drawGrid[i][j].y;
|
||||
*/
|
||||
|
||||
//xDist = 1;
|
||||
//yDist = 2;
|
||||
|
||||
|
||||
tDist = sqrtf(xDist*xDist+yDist*yDist);
|
||||
|
||||
//drawGrid[i][j].x += (rand()%100)/10000.0f;
|
||||
//drawGrid[i][j].y += (rand()%100)/10000.0f;
|
||||
|
||||
|
||||
if (tDist < currentDistance*adjWaveLength)
|
||||
{
|
||||
//drawGrid[i][j].x += rand()%50;
|
||||
//drawGrid[i][j].y += rand()%50;
|
||||
|
||||
|
||||
drawGrid[i][j].x += adjAmplitude*sinf(-tDist/adjWaveLength+currentDistance)*.75f;
|
||||
drawGrid[i][j].y += adjAmplitude*cosf(-tDist/adjWaveLength+currentDistance);
|
||||
}
|
||||
|
@ -540,20 +506,9 @@ RippleEffect::RippleEffect() : Effect()
|
|||
|
||||
void RippleEffect::update(float dt, Vector ** drawGrid, int xDivs, int yDivs)
|
||||
{
|
||||
/*
|
||||
// whole screen roll
|
||||
time += dt;
|
||||
float amp = 0.01;
|
||||
for (int i = 0; i < (xDivs-1); i++)
|
||||
{
|
||||
for (int j = 0; j < (yDivs-1); j++)
|
||||
{
|
||||
float offset = +i/float(xDivs) +j/float(xDivs);
|
||||
//drawGrid[i][j].x += sinf(time+offset)*amp;
|
||||
drawGrid[i][j].y += cosf((time+offset)*2.5f)*amp;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
time += dt*0.5f;
|
||||
float amp = 0.002;
|
||||
for (int i = 0; i < (xDivs-1); i++)
|
||||
|
@ -561,7 +516,7 @@ void RippleEffect::update(float dt, Vector ** drawGrid, int xDivs, int yDivs)
|
|||
for (int j = 0; j < (yDivs-1); j++)
|
||||
{
|
||||
float offset = i/float(xDivs) + (core->screenCenter.x/float(core->width)/2) +j/float(xDivs) + (core->screenCenter.y/float(core->height)/2);
|
||||
//drawGrid[i][j].x += sinf(time+offset)*amp;
|
||||
|
||||
drawGrid[i][j].x += sinf((time+offset)*7.5f)*(amp*0.5f);
|
||||
drawGrid[i][j].y += cosf((time+offset)*7.5f)*amp;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue