Lost, in a dream of mirrors, lost, in a paradox...

git-svn-id: https://svn.eduke32.com/eduke32@702 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2008-04-10 08:39:05 +00:00
parent e872a59fa5
commit 1db4ea8f36
2 changed files with 11 additions and 9 deletions

View file

@ -151,7 +151,7 @@ static int polymer_initwall(short wallnum);
static void polymer_updatewall(short wallnum); static void polymer_updatewall(short wallnum);
static void polymer_drawwall(short sectnum, short wallnum); static void polymer_drawwall(short sectnum, short wallnum);
// HSR // HSR
static void polymer_buffertoplane(GLfloat* buffer, GLushort* indices, GLdouble* plane); static void polymer_buffertoplane(GLfloat* buffer, GLushort* indices, int indicecount, GLdouble* plane);
static void polymer_crossproduct(GLfloat* in_a, GLfloat* in_b, GLdouble* out); static void polymer_crossproduct(GLfloat* in_a, GLfloat* in_b, GLdouble* out);
static void polymer_pokesector(short sectnum); static void polymer_pokesector(short sectnum);
static void polymer_extractfrustum(GLdouble* modelview, GLdouble* projection, float* frustum); static void polymer_extractfrustum(GLdouble* modelview, GLdouble* projection, float* frustum);

View file

@ -678,7 +678,8 @@ static void polymer_displayrooms(short dacursectnum)
static void polymer_drawplane(short sectnum, short wallnum, GLuint glpic, GLfloat* color, GLfloat* buffer, GLushort* indices, int indicecount, GLdouble* plane) static void polymer_drawplane(short sectnum, short wallnum, GLuint glpic, GLfloat* color, GLfloat* buffer, GLushort* indices, int indicecount, GLdouble* plane)
{ {
if ((depth < 1) && (plane != NULL) && 1) // insert mirror condition here if ((depth < 1) && (plane != NULL) &&
(wallnum >= 0) && (wall[wallnum].overpicnum == 560)) // insert mirror condition here
{ {
int gx, gy, gz, px, py, pz; int gx, gy, gz, px, py, pz;
float coeff; float coeff;
@ -776,7 +777,7 @@ static void polymer_drawplane(short sectnum, short wallnum, GLuint glpic
bglMatrixMode(GL_MODELVIEW); bglMatrixMode(GL_MODELVIEW);
bglPopMatrix(); bglPopMatrix();
bglColor4f(color[0], color[1], color[2], 0.5f); bglColor4f(color[0], color[1], color[2], 0.0f);
} }
else else
bglColor4f(color[0], color[1], color[2], color[3]); bglColor4f(color[0], color[1], color[2], color[3]);
@ -784,7 +785,8 @@ static void polymer_drawplane(short sectnum, short wallnum, GLuint glpic
bglBindTexture(GL_TEXTURE_2D, glpic); bglBindTexture(GL_TEXTURE_2D, glpic);
OMGDRAWSHIT; OMGDRAWSHIT;
if ((depth < 1) && (plane != NULL) && 1) // insert mirror condition here if ((depth < 1) && (plane != NULL) &&
(wallnum >= 0) && (wall[wallnum].overpicnum == 560)) // insert mirror condition here
{ {
bglDisable(GL_STENCIL_TEST); bglDisable(GL_STENCIL_TEST);
bglClear(GL_STENCIL_BUFFER_BIT); bglClear(GL_STENCIL_BUFFER_BIT);
@ -1088,8 +1090,8 @@ finish:
if (wallinvalidate) if (wallinvalidate)
{ {
s->invalidid++; s->invalidid++;
polymer_buffertoplane(s->floorbuffer, s->floorindices, s->floorplane); polymer_buffertoplane(s->floorbuffer, s->floorindices, s->indicescount, s->floorplane);
polymer_buffertoplane(s->ceilbuffer, s->ceilindices, s->ceilplane); polymer_buffertoplane(s->ceilbuffer, s->ceilindices, s->indicescount, s->ceilplane);
} }
s->controlstate = 1; s->controlstate = 1;
@ -1662,7 +1664,7 @@ static void polymer_updatewall(short wallnum)
memcpy(&w->bigportal[6], &s->ceilbuffer[(wal->point2 - sec->wallptr) * 5], sizeof(GLfloat) * 3); memcpy(&w->bigportal[6], &s->ceilbuffer[(wal->point2 - sec->wallptr) * 5], sizeof(GLfloat) * 3);
memcpy(&w->bigportal[9], &s->ceilbuffer[(wallnum - sec->wallptr) * 5], sizeof(GLfloat) * 3); memcpy(&w->bigportal[9], &s->ceilbuffer[(wallnum - sec->wallptr) * 5], sizeof(GLfloat) * 3);
polymer_buffertoplane(w->bigportal, NULL, w->plane); polymer_buffertoplane(w->bigportal, NULL, 4, w->plane);
w->controlstate = 1; w->controlstate = 1;
@ -1695,7 +1697,7 @@ static void polymer_drawwall(short sectnum, short wallnum)
#define INDICE(n) ((indices) ? (indices[i+n]*5) : ((i+n)*3)) #define INDICE(n) ((indices) ? (indices[i+n]*5) : ((i+n)*3))
// HSR // HSR
static void polymer_buffertoplane(GLfloat* buffer, GLushort* indices, GLdouble* plane) static void polymer_buffertoplane(GLfloat* buffer, GLushort* indices, int indicecount, GLdouble* plane)
{ {
GLfloat vec1[3], vec2[3]; GLfloat vec1[3], vec2[3];
int i; int i;
@ -1716,7 +1718,7 @@ static void polymer_buffertoplane(GLfloat* buffer, GLushort* indices, GL
vec1[0] = plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]; vec1[0] = plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2];
i+= 3; i+= 3;
} }
while (vec1[0] == 0); while ((i < indicecount) && (vec1[0] == 0));
vec1[0] = sqrt(vec1[0]); vec1[0] = sqrt(vec1[0]);
plane[0] /= vec1[0]; plane[0] /= vec1[0];