mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 09:20:51 +00:00
Fix invisible player on mirror
This commit is contained in:
parent
e8337c783e
commit
8b0fb8dfe2
3 changed files with 38 additions and 4 deletions
|
@ -340,7 +340,7 @@ void sub_557C4(int x, int y, int interpolation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth)
|
void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth, int viewPlayer)
|
||||||
{
|
{
|
||||||
if (videoGetRenderMode() == REND_POLYMER)
|
if (videoGetRenderMode() == REND_POLYMER)
|
||||||
return;
|
return;
|
||||||
|
@ -407,6 +407,19 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth)
|
||||||
r_rorphase = 1;
|
r_rorphase = 1;
|
||||||
#endif
|
#endif
|
||||||
int nSector = mirror[i].at4;
|
int nSector = mirror[i].at4;
|
||||||
|
int bakCstat;
|
||||||
|
if (viewPlayer >= 0)
|
||||||
|
{
|
||||||
|
bakCstat = gPlayer[viewPlayer].pSprite->cstat;
|
||||||
|
if (gViewPos == 0)
|
||||||
|
{
|
||||||
|
gPlayer[viewPlayer].pSprite->cstat |= 32768;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gPlayer[viewPlayer].pSprite->cstat |= 514;
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
if (videoGetRenderMode() == REND_POLYMER)
|
if (videoGetRenderMode() == REND_POLYMER)
|
||||||
polymer_setanimatesprites(viewProcessSprites, x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth);
|
polymer_setanimatesprites(viewProcessSprites, x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth);
|
||||||
|
@ -421,6 +434,10 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth)
|
||||||
sector[nSector].floorstat = fstat;
|
sector[nSector].floorstat = fstat;
|
||||||
for (int i = 0; i < 16; i++)
|
for (int i = 0; i < 16; i++)
|
||||||
ClearBitString(gotpic, 4080+i);
|
ClearBitString(gotpic, 4080+i);
|
||||||
|
if (viewPlayer >= 0)
|
||||||
|
{
|
||||||
|
gPlayer[viewPlayer].pSprite->cstat = bakCstat;
|
||||||
|
}
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
r_rorphase = 0;
|
r_rorphase = 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -432,6 +449,19 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth)
|
||||||
r_rorphase = 1;
|
r_rorphase = 1;
|
||||||
#endif
|
#endif
|
||||||
int nSector = mirror[i].at4;
|
int nSector = mirror[i].at4;
|
||||||
|
int bakCstat;
|
||||||
|
if (viewPlayer >= 0)
|
||||||
|
{
|
||||||
|
bakCstat = gPlayer[viewPlayer].pSprite->cstat;
|
||||||
|
if (gViewPos == 0)
|
||||||
|
{
|
||||||
|
gPlayer[viewPlayer].pSprite->cstat |= 32768;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gPlayer[viewPlayer].pSprite->cstat |= 514;
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
if (videoGetRenderMode() == REND_POLYMER)
|
if (videoGetRenderMode() == REND_POLYMER)
|
||||||
polymer_setanimatesprites(viewProcessSprites, x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth);
|
polymer_setanimatesprites(viewProcessSprites, x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth);
|
||||||
|
@ -446,6 +476,10 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth)
|
||||||
sector[nSector].ceilingstat = cstat;
|
sector[nSector].ceilingstat = cstat;
|
||||||
for (int i = 0; i < 16; i++)
|
for (int i = 0; i < 16; i++)
|
||||||
ClearBitString(gotpic, 4080+i);
|
ClearBitString(gotpic, 4080+i);
|
||||||
|
if (viewPlayer >= 0)
|
||||||
|
{
|
||||||
|
gPlayer[viewPlayer].pSprite->cstat = bakCstat;
|
||||||
|
}
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
r_rorphase = 0;
|
r_rorphase = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,4 +25,4 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
void InitMirrors(void);
|
void InitMirrors(void);
|
||||||
void sub_5571C(char mode);
|
void sub_5571C(char mode);
|
||||||
void sub_557C4(int x, int y, int interpolation);
|
void sub_557C4(int x, int y, int interpolation);
|
||||||
void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth);
|
void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth, int viewPlayer);
|
||||||
|
|
|
@ -3191,7 +3191,7 @@ RORHACKOTHER:
|
||||||
for (int i = 0; i < 16; i++)
|
for (int i = 0; i < 16; i++)
|
||||||
ror_status[i] = TestBitString(gotpic, 4080 + i);
|
ror_status[i] = TestBitString(gotpic, 4080 + i);
|
||||||
yax_preparedrawrooms();
|
yax_preparedrawrooms();
|
||||||
DrawMirrors(vd8, vd4, vd0, fix16_from_int(v50), fix16_from_int(v54 + defaultHoriz), gInterpolate);
|
DrawMirrors(vd8, vd4, vd0, fix16_from_int(v50), fix16_from_int(v54 + defaultHoriz), gInterpolate, -1);
|
||||||
drawrooms(vd8, vd4, vd0, v50, v54 + defaultHoriz, vcc);
|
drawrooms(vd8, vd4, vd0, v50, v54 + defaultHoriz, vcc);
|
||||||
yax_drawrooms(viewProcessSprites, vcc, 0, gInterpolate);
|
yax_drawrooms(viewProcessSprites, vcc, 0, gInterpolate);
|
||||||
bool do_ror_hack = false;
|
bool do_ror_hack = false;
|
||||||
|
@ -3267,6 +3267,7 @@ RORHACK:
|
||||||
for (int i = 0; i < 16; i++)
|
for (int i = 0; i < 16; i++)
|
||||||
ror_status[i] = TestBitString(gotpic, 4080+i);
|
ror_status[i] = TestBitString(gotpic, 4080+i);
|
||||||
fix16_t deliriumPitchI = interpolate(fix16_from_int(deliriumPitchO), fix16_from_int(deliriumPitch), gInterpolate);
|
fix16_t deliriumPitchI = interpolate(fix16_from_int(deliriumPitchO), fix16_from_int(deliriumPitch), gInterpolate);
|
||||||
|
DrawMirrors(cX, cY, cZ, cA, q16horiz + fix16_from_int(defaultHoriz) + deliriumPitchI, gInterpolate, gViewIndex);
|
||||||
int bakCstat = gView->pSprite->cstat;
|
int bakCstat = gView->pSprite->cstat;
|
||||||
if (gViewPos == 0)
|
if (gViewPos == 0)
|
||||||
{
|
{
|
||||||
|
@ -3276,7 +3277,6 @@ RORHACK:
|
||||||
{
|
{
|
||||||
gView->pSprite->cstat |= 514;
|
gView->pSprite->cstat |= 514;
|
||||||
}
|
}
|
||||||
DrawMirrors(cX, cY, cZ, cA, q16horiz + fix16_from_int(defaultHoriz) + deliriumPitchI, gInterpolate);
|
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
if (videoGetRenderMode() == REND_POLYMER)
|
if (videoGetRenderMode() == REND_POLYMER)
|
||||||
polymer_setanimatesprites(viewProcessSprites, cX, cY, cZ, fix16_to_int(cA), gInterpolate);
|
polymer_setanimatesprites(viewProcessSprites, cX, cY, cZ, fix16_to_int(cA), gInterpolate);
|
||||||
|
|
Loading…
Reference in a new issue