mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-16 12:40:38 +00:00
- SE150 for RRRA.
It's the same as original SE40. What kind of mess whas done here in Eduke?
This commit is contained in:
parent
1657d90ca9
commit
390afc9490
2 changed files with 22 additions and 175 deletions
|
@ -49,51 +49,32 @@ BEGIN_DUKE_NS
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
#define FOFTILE 13
|
|
||||||
#define FOFTILEX 32
|
|
||||||
#define FOFTILEY 32
|
|
||||||
static int tempsectorz[MAXSECTORS];
|
static int tempsectorz[MAXSECTORS];
|
||||||
static int tempsectorpicnum[MAXSECTORS];
|
static int tempsectorpicnum[MAXSECTORS];
|
||||||
//short tempcursectnum;
|
//short tempcursectnum;
|
||||||
|
|
||||||
void SE40_Draw(int spnum, int x, int y, int z, int a, int h, int smoothratio)
|
void SE40_Draw(int tag, int spnum, int x, int y, int z, int a, int h, int smoothratio)
|
||||||
{
|
{
|
||||||
int i = 0, j = 0, k = 0;
|
int i, j = 0, k = 0;
|
||||||
int floor1 = 0, floor2 = 0, ok = 0, fofmode = 0;
|
int floor1, floor2 = 0, ok = 0, fofmode = 0;
|
||||||
int offx, offy;
|
int offx, offy;
|
||||||
|
|
||||||
if (sprite[spnum].ang != 512) return;
|
if (sprite[spnum].ang != 512) return;
|
||||||
|
|
||||||
i = FOFTILE; //Effect TILE
|
i = FOF; //Effect TILE
|
||||||
|
tileDelete(FOF);
|
||||||
if (!(gotpic[i >> 3] & (1 << (i & 7)))) return;
|
if (!(gotpic[i >> 3] & (1 << (i & 7)))) return;
|
||||||
gotpic[i >> 3] &= ~(1 << (i & 7));
|
gotpic[i >> 3] &= ~(1 << (i & 7));
|
||||||
|
|
||||||
floor1 = spnum;
|
floor1 = spnum;
|
||||||
|
|
||||||
if (sprite[spnum].lotag == 42) fofmode = 40;
|
if (sprite[spnum].lotag == tag + 2) fofmode = tag + 0;
|
||||||
if (sprite[spnum].lotag == 43) fofmode = 41;
|
if (sprite[spnum].lotag == tag + 3) fofmode = tag + 1;
|
||||||
if (sprite[spnum].lotag == 44) fofmode = 40;
|
if (sprite[spnum].lotag == tag + 4) fofmode = tag + 0;
|
||||||
if (sprite[spnum].lotag == 45) fofmode = 41;
|
if (sprite[spnum].lotag == tag + 5) fofmode = tag + 1;
|
||||||
|
|
||||||
// fofmode=sprite[spnum].lotag-2;
|
|
||||||
|
|
||||||
// sectnum=sprite[j].sectnum;
|
|
||||||
// sectnum=cursectnum;
|
|
||||||
ok++;
|
ok++;
|
||||||
|
|
||||||
/* recursive?
|
|
||||||
for(j=0;j<MAXSPRITES;j++)
|
|
||||||
{
|
|
||||||
if(
|
|
||||||
sprite[j].sectnum==sectnum &&
|
|
||||||
sprite[j].picnum==1 &&
|
|
||||||
sprite[j].lotag==110
|
|
||||||
) { DrawFloorOverFloor(j); break;}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// if(ok==0) { Message("no fof",RED); return; }
|
|
||||||
|
|
||||||
for (j = 0; j < MAXSPRITES; j++)
|
for (j = 0; j < MAXSPRITES; j++)
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
|
@ -106,7 +87,7 @@ void SE40_Draw(int spnum, int x, int y, int z, int a, int h, int smoothratio)
|
||||||
}
|
}
|
||||||
// if(ok==1) { Message("no floor1",RED); return; }
|
// if(ok==1) { Message("no floor1",RED); return; }
|
||||||
|
|
||||||
if (fofmode == 40) k = 41; else k = 40;
|
if (fofmode == tag + 0) k = tag + 1; else k = tag + 0;
|
||||||
|
|
||||||
for (j = 0; j < MAXSPRITES; j++)
|
for (j = 0; j < MAXSPRITES; j++)
|
||||||
{
|
{
|
||||||
|
@ -128,14 +109,14 @@ void SE40_Draw(int spnum, int x, int y, int z, int a, int h, int smoothratio)
|
||||||
sprite[j].hitag == sprite[floor1].hitag
|
sprite[j].hitag == sprite[floor1].hitag
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (k == 40)
|
if (k == tag + 0)
|
||||||
{
|
{
|
||||||
tempsectorz[sprite[j].sectnum] = sector[sprite[j].sectnum].floorz;
|
tempsectorz[sprite[j].sectnum] = sector[sprite[j].sectnum].floorz;
|
||||||
sector[sprite[j].sectnum].floorz += (((z - sector[sprite[j].sectnum].floorz) / 32768) + 1) * 32768;
|
sector[sprite[j].sectnum].floorz += (((z - sector[sprite[j].sectnum].floorz) / 32768) + 1) * 32768;
|
||||||
tempsectorpicnum[sprite[j].sectnum] = sector[sprite[j].sectnum].floorpicnum;
|
tempsectorpicnum[sprite[j].sectnum] = sector[sprite[j].sectnum].floorpicnum;
|
||||||
sector[sprite[j].sectnum].floorpicnum = 13;
|
sector[sprite[j].sectnum].floorpicnum = 13;
|
||||||
}
|
}
|
||||||
if (k == 41)
|
if (k == tag + 1)
|
||||||
{
|
{
|
||||||
tempsectorz[sprite[j].sectnum] = sector[sprite[j].sectnum].ceilingz;
|
tempsectorz[sprite[j].sectnum] = sector[sprite[j].sectnum].ceilingz;
|
||||||
sector[sprite[j].sectnum].ceilingz += (((z - sector[sprite[j].sectnum].ceilingz) / 32768) - 1) * 32768;
|
sector[sprite[j].sectnum].ceilingz += (((z - sector[sprite[j].sectnum].ceilingz) / 32768) - 1) * 32768;
|
||||||
|
@ -152,13 +133,10 @@ void SE40_Draw(int spnum, int x, int y, int z, int a, int h, int smoothratio)
|
||||||
#if 0
|
#if 0
|
||||||
drawrooms(offx + sprite[i].x, offy + sprite[i].y, z, a, h, sprite[i].sectnum);
|
drawrooms(offx + sprite[i].x, offy + sprite[i].y, z, a, h, sprite[i].sectnum);
|
||||||
#else
|
#else
|
||||||
renderDrawRoomsQ16(sprite[i].x + x, sprite[i].y + y, z, a, h, sprite[i].sectnum);
|
renderDrawRoomsQ16(sprite[i].x + offx, sprite[i].y + offy, z, a, h, sprite[i].sectnum);
|
||||||
|
|
||||||
//drawing_ror = 1 + level;
|
|
||||||
//if (drawing_ror == 2) G_OROR_DupeSprites(sp);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fi.animatesprites(x, y, fix16_to_int(a), smoothratio);
|
fi.animatesprites(offx + sprite[i].x, offy + sprite[i].y, fix16_to_int(a), smoothratio);
|
||||||
renderDrawMasks();
|
renderDrawMasks();
|
||||||
|
|
||||||
for (j = 0; j < MAXSPRITES; j++) // restore ceiling or floor
|
for (j = 0; j < MAXSPRITES; j++) // restore ceiling or floor
|
||||||
|
@ -168,12 +146,12 @@ void SE40_Draw(int spnum, int x, int y, int z, int a, int h, int smoothratio)
|
||||||
sprite[j].hitag == sprite[floor1].hitag
|
sprite[j].hitag == sprite[floor1].hitag
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (k == 40)
|
if (k == tag + 0)
|
||||||
{
|
{
|
||||||
sector[sprite[j].sectnum].floorz = tempsectorz[sprite[j].sectnum];
|
sector[sprite[j].sectnum].floorz = tempsectorz[sprite[j].sectnum];
|
||||||
sector[sprite[j].sectnum].floorpicnum = tempsectorpicnum[sprite[j].sectnum];
|
sector[sprite[j].sectnum].floorpicnum = tempsectorpicnum[sprite[j].sectnum];
|
||||||
}
|
}
|
||||||
if (k == 41)
|
if (k == tag + 1)
|
||||||
{
|
{
|
||||||
sector[sprite[j].sectnum].ceilingz = tempsectorz[sprite[j].sectnum];
|
sector[sprite[j].sectnum].ceilingz = tempsectorz[sprite[j].sectnum];
|
||||||
sector[sprite[j].sectnum].ceilingpicnum = tempsectorpicnum[sprite[j].sectnum];
|
sector[sprite[j].sectnum].ceilingpicnum = tempsectorpicnum[sprite[j].sectnum];
|
||||||
|
@ -190,14 +168,14 @@ void SE40_Draw(int spnum, int x, int y, int z, int a, int h, int smoothratio)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void se40code(int x, int y, int z, int a, int h, int smoothratio)
|
void se40code(int tag, int x, int y, int z, int a, int h, int smoothratio)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = headspritestat[STAT_RAROR];
|
i = headspritestat[STAT_RAROR];
|
||||||
while (i >= 0)
|
while (i >= 0)
|
||||||
{
|
{
|
||||||
switch (sprite[i].lotag)
|
switch (sprite[i].lotag - tag + 40)
|
||||||
{
|
{
|
||||||
// case 40:
|
// case 40:
|
||||||
// case 41:
|
// case 41:
|
||||||
|
@ -208,7 +186,7 @@ void se40code(int x, int y, int z, int a, int h, int smoothratio)
|
||||||
case 44:
|
case 44:
|
||||||
case 45:
|
case 45:
|
||||||
if (ps[screenpeek].cursectnum == sprite[i].sectnum)
|
if (ps[screenpeek].cursectnum == sprite[i].sectnum)
|
||||||
SE40_Draw(i, x, y, z, a, h, smoothratio);
|
SE40_Draw(tag, i, x, y, z, a, h, smoothratio);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i = nextspritestat[i];
|
i = nextspritestat[i];
|
||||||
|
|
|
@ -114,135 +114,7 @@ void G_HandleSpecialKeys(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void se40code(int tag, int x, int y, int z, int a, int h, int smoothratio);
|
||||||
int32_t SE150_TempSectorZ[MAXSECTORS];
|
|
||||||
int32_t SE150_TempSectorPicnum[MAXSECTORS];
|
|
||||||
|
|
||||||
static void G_SE150_Draw(int32_t spnum, int32_t x, int32_t y, int32_t z, int32_t a, int32_t h, int32_t smoothratio)
|
|
||||||
{
|
|
||||||
int32_t i = 13, j, k = 0;
|
|
||||||
int32_t floor1 = spnum, floor2 = 0, ok = 0, fofmode;
|
|
||||||
int32_t offx, offy;
|
|
||||||
|
|
||||||
if (sprite[spnum].ang != 512) return;
|
|
||||||
|
|
||||||
tileDelete(13);
|
|
||||||
if (!(gotpic[i >> 3] & (1 << (i & 7)))) return;
|
|
||||||
gotpic[i >> 3] &= ~(1 << (i & 7));
|
|
||||||
|
|
||||||
floor1 = spnum;
|
|
||||||
|
|
||||||
if (sprite[spnum].lotag == 152) fofmode = 150;
|
|
||||||
if (sprite[spnum].lotag == 153) fofmode = 151;
|
|
||||||
if (sprite[spnum].lotag == 154) fofmode = 150;
|
|
||||||
if (sprite[spnum].lotag == 155) fofmode = 151;
|
|
||||||
|
|
||||||
ok++;
|
|
||||||
|
|
||||||
for (j = 0; j < MAXSPRITES; j++)
|
|
||||||
{
|
|
||||||
if (
|
|
||||||
sprite[j].picnum == 1 &&
|
|
||||||
sprite[j].lotag == fofmode &&
|
|
||||||
sprite[j].hitag == sprite[floor1].hitag
|
|
||||||
) {
|
|
||||||
floor1 = j; fofmode = sprite[j].lotag; ok++; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// if(ok==1) { Message("no floor1",RED); return; }
|
|
||||||
|
|
||||||
if (fofmode == 150) k = 151; else k = 150;
|
|
||||||
|
|
||||||
for (j = 0; j < MAXSPRITES; j++)
|
|
||||||
{
|
|
||||||
if (
|
|
||||||
sprite[j].picnum == 1 &&
|
|
||||||
sprite[j].lotag == k &&
|
|
||||||
sprite[j].hitag == sprite[floor1].hitag
|
|
||||||
) {
|
|
||||||
floor2 = j; ok++; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if(ok==2) { Message("no floor2",RED); return; }
|
|
||||||
|
|
||||||
for (j = 0; j < MAXSPRITES; j++) // raise ceiling or floor
|
|
||||||
{
|
|
||||||
if (sprite[j].picnum == 1 &&
|
|
||||||
sprite[j].lotag == k + 2 &&
|
|
||||||
sprite[j].hitag == sprite[floor1].hitag
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (k == 150)
|
|
||||||
{
|
|
||||||
SE150_TempSectorZ[sprite[j].sectnum] = sector[sprite[j].sectnum].floorz;
|
|
||||||
sector[sprite[j].sectnum].floorz += (((z - sector[sprite[j].sectnum].floorz) / 32768) + 1) * 32768;
|
|
||||||
SE150_TempSectorPicnum[sprite[j].sectnum] = sector[sprite[j].sectnum].floorpicnum;
|
|
||||||
sector[sprite[j].sectnum].floorpicnum = 13;
|
|
||||||
}
|
|
||||||
else if (k == 151)
|
|
||||||
{
|
|
||||||
SE150_TempSectorZ[sprite[j].sectnum] = sector[sprite[j].sectnum].ceilingz;
|
|
||||||
sector[sprite[j].sectnum].ceilingz += (((z - sector[sprite[j].sectnum].ceilingz) / 32768) - 1) * 32768;
|
|
||||||
SE150_TempSectorPicnum[sprite[j].sectnum] = sector[sprite[j].sectnum].ceilingpicnum;
|
|
||||||
sector[sprite[j].sectnum].ceilingpicnum = 13;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i = floor1;
|
|
||||||
offx = x - sprite[i].x;
|
|
||||||
offy = y - sprite[i].y;
|
|
||||||
i = floor2;
|
|
||||||
|
|
||||||
|
|
||||||
renderDrawRoomsQ16(offx + sprite[i].x, offy + sprite[i].y, z, a, h, sprite[i].sectnum);
|
|
||||||
fi.animatesprites(offx + sprite[i].x, offy + sprite[i].y, fix16_to_int(a), smoothratio);
|
|
||||||
renderDrawMasks();
|
|
||||||
|
|
||||||
for (j = 0; j < MAXSPRITES; j++) // restore ceiling or floor
|
|
||||||
{
|
|
||||||
if (sprite[j].picnum == 1 &&
|
|
||||||
sprite[j].lotag == k + 2 &&
|
|
||||||
sprite[j].hitag == sprite[floor1].hitag
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (k == 150)
|
|
||||||
{
|
|
||||||
sector[sprite[j].sectnum].floorz = SE150_TempSectorZ[sprite[j].sectnum];
|
|
||||||
sector[sprite[j].sectnum].floorpicnum = SE150_TempSectorPicnum[sprite[j].sectnum];
|
|
||||||
}
|
|
||||||
else if (k == 151)
|
|
||||||
{
|
|
||||||
sector[sprite[j].sectnum].ceilingz = SE150_TempSectorZ[sprite[j].sectnum];
|
|
||||||
sector[sprite[j].sectnum].ceilingpicnum = SE150_TempSectorPicnum[sprite[j].sectnum];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void G_SE150(int32_t x, int32_t y, int32_t z, int32_t a, int32_t h, int32_t smoothratio)
|
|
||||||
{
|
|
||||||
for (int i = headspritestat[STAT_RAROR]; i >= 0; i = nextspritestat[i])
|
|
||||||
{
|
|
||||||
switch(sprite[i].lotag)
|
|
||||||
{
|
|
||||||
// case 40:
|
|
||||||
// case 41:
|
|
||||||
// SE40_Draw(i,x,y,a,smoothratio);
|
|
||||||
// break;
|
|
||||||
case 152:
|
|
||||||
case 153:
|
|
||||||
case 154:
|
|
||||||
case 155:
|
|
||||||
if(g_player[screenpeek].ps->cursectnum == sprite[i].sectnum)
|
|
||||||
G_SE150_Draw(i,x,y,z,a,h,smoothratio);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void se40code(int x, int y, int z, int a, int h, int smoothratio);
|
|
||||||
|
|
||||||
void G_HandleMirror(int32_t x, int32_t y, int32_t z, fix16_t a, fix16_t q16horiz, int32_t smoothratio)
|
void G_HandleMirror(int32_t x, int32_t y, int32_t z, fix16_t a, fix16_t q16horiz, int32_t smoothratio)
|
||||||
{
|
{
|
||||||
|
@ -384,7 +256,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
|
||||||
+ mulscale16(((pSprite->ang + 1024 - actor[ud.camerasprite].tempang) & 2047) - 1024, smoothRatio));
|
+ mulscale16(((pSprite->ang + 1024 - actor[ud.camerasprite].tempang) & 2047) - 1024, smoothRatio));
|
||||||
|
|
||||||
if (!RR)
|
if (!RR)
|
||||||
se40code(pSprite->x, pSprite->y, pSprite->z, CAMERA(q16ang), fix16_from_int(pSprite->yvel), smoothRatio);
|
se40code(40, pSprite->x, pSprite->y, pSprite->z, CAMERA(q16ang), fix16_from_int(pSprite->yvel), smoothRatio);
|
||||||
|
|
||||||
renderDrawRoomsQ16(pSprite->x, pSprite->y, pSprite->z - ZOFFSET6, CAMERA(q16ang), fix16_from_int(pSprite->yvel), pSprite->sectnum);
|
renderDrawRoomsQ16(pSprite->x, pSprite->y, pSprite->z - ZOFFSET6, CAMERA(q16ang), fix16_from_int(pSprite->yvel), pSprite->sectnum);
|
||||||
fi.animatesprites(pSprite->x, pSprite->y, fix16_to_int(CAMERA(q16ang)), smoothRatio);
|
fi.animatesprites(pSprite->x, pSprite->y, fix16_to_int(CAMERA(q16ang)), smoothRatio);
|
||||||
|
@ -597,11 +469,8 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
|
||||||
CAMERA(q16horiz) = fix16_clamp(CAMERA(q16horiz), F16(HORIZ_MIN), F16(HORIZ_MAX));
|
CAMERA(q16horiz) = fix16_clamp(CAMERA(q16horiz), F16(HORIZ_MIN), F16(HORIZ_MAX));
|
||||||
|
|
||||||
G_HandleMirror(CAMERA(pos.x), CAMERA(pos.y), CAMERA(pos.z), CAMERA(q16ang), CAMERA(q16horiz), smoothRatio);
|
G_HandleMirror(CAMERA(pos.x), CAMERA(pos.y), CAMERA(pos.z), CAMERA(q16ang), CAMERA(q16horiz), smoothRatio);
|
||||||
if (!RR)
|
if (!RR || RRRA) se40code(RRRA? 150 : 40, CAMERA(pos.x), CAMERA(pos.y), CAMERA(pos.z), CAMERA(q16ang), CAMERA(q16horiz), smoothRatio);
|
||||||
se40code(CAMERA(pos.x), CAMERA(pos.y), CAMERA(pos.z), CAMERA(q16ang), CAMERA(q16horiz), smoothRatio);
|
|
||||||
|
|
||||||
if (RRRA)
|
|
||||||
G_SE150(CAMERA(pos.x), CAMERA(pos.y), CAMERA(pos.z), CAMERA(q16ang), CAMERA(q16horiz), smoothRatio);
|
|
||||||
// for G_PrintCoords
|
// for G_PrintCoords
|
||||||
dr_viewingrange = viewingrange;
|
dr_viewingrange = viewingrange;
|
||||||
dr_yxaspect = yxaspect;
|
dr_yxaspect = yxaspect;
|
||||||
|
|
Loading…
Reference in a new issue