Fix screen transitions

This commit is contained in:
Arthur 2018-12-27 14:58:07 -05:00 committed by mazmazz
parent 08579d9447
commit 25ef570a81

View file

@ -998,7 +998,7 @@ EXPORT void HWRAPI(Draw2DLine) (F2DCoord * v1,
p[9] = v1->x + dx; p[10] = -(v1->y - dy); p[11] = 1;
pglDisableClientState(GL_TEXTURE_COORD_ARRAY);
pglColor4ubv((GLubyte*)&Color);
pglColor4ubv((GLubyte*)&Color.s);
pglVertexPointer(3, GL_FLOAT, 0, p);
pglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
@ -2369,27 +2369,31 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
// Draw the end screen that fades in
pglActiveTexture(GL_TEXTURE0);
pglEnable(GL_TEXTURE_2D);
pglBindTexture(GL_TEXTURE_2D, endScreenWipe);
pglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
pglActiveTexture(GL_TEXTURE1);
pglEnable(GL_TEXTURE_2D);
pglBindTexture(GL_TEXTURE_2D, fademaskdownloaded);
pglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
// const float defaultST[8]
pglVertexPointer(3, GL_FLOAT, 0, screenVerts);
pglClientActiveTexture(GL_TEXTURE0);
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
pglVertexPointer(3, GL_FLOAT, 0, screenVerts);
pglClientActiveTexture(GL_TEXTURE1);
pglEnableClientState(GL_TEXTURE_COORD_ARRAY);
pglTexCoordPointer(2, GL_FLOAT, 0, defaultST);
pglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
pglClientActiveTexture(GL_TEXTURE0);
pglDisable(GL_TEXTURE_2D); // disable the texture in the 2nd texture unit
pglDisableClientState(GL_TEXTURE_COORD_ARRAY);
pglActiveTexture(GL_TEXTURE0);
pglClientActiveTexture(GL_TEXTURE0);
tex_downloaded = endScreenWipe;
}