mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 23:51:01 +00:00
- slides.
This commit is contained in:
parent
44639faabb
commit
e57f9e08e9
3 changed files with 93 additions and 93 deletions
|
@ -221,6 +221,10 @@ Collision MoveCreatureWithCaution(DExhumedActor* actor);
|
||||||
void WheresMyMouth(int nPlayer, vec3_t* pos, int *sectnum);
|
void WheresMyMouth(int nPlayer, vec3_t* pos, int *sectnum);
|
||||||
int GetActorHeight(DExhumedActor* nSprite);
|
int GetActorHeight(DExhumedActor* nSprite);
|
||||||
DExhumedActor* insertActor(int, int);
|
DExhumedActor* insertActor(int, int);
|
||||||
|
inline DExhumedActor* insertActor(sectortype* s, int st)
|
||||||
|
{
|
||||||
|
return insertActor(sector.IndexOf(s), st);
|
||||||
|
}
|
||||||
DExhumedActor* GrabBody();
|
DExhumedActor* GrabBody();
|
||||||
DExhumedActor* GrabBodyGunSprite();
|
DExhumedActor* GrabBodyGunSprite();
|
||||||
void CreatePushBlock(int nSector);
|
void CreatePushBlock(int nSector);
|
||||||
|
@ -294,7 +298,7 @@ DExhumedActor* BuildEnergyBlock(int nSector);
|
||||||
int BuildElevC(int arg1, int nChannel, int nSector, DExhumedActor* nWallSprite, int arg5, int arg6, int nCount, ...);
|
int BuildElevC(int arg1, int nChannel, int nSector, DExhumedActor* nWallSprite, int arg5, int arg6, int nCount, ...);
|
||||||
int BuildElevF(int nChannel, int nSector, DExhumedActor* nWallSprite, int arg_4, int arg_5, int nCount, ...);
|
int BuildElevF(int nChannel, int nSector, DExhumedActor* nWallSprite, int arg_4, int arg_5, int nCount, ...);
|
||||||
int BuildWallFace(int nChannel, walltype* pWall, int nCount, ...);
|
int BuildWallFace(int nChannel, walltype* pWall, int nCount, ...);
|
||||||
int BuildSlide(int nChannel, int edx, int ebx, int ecx, int arg1, int arg2, int arg3);
|
int BuildSlide(int nChannel, walltype* edx, walltype* ebx, walltype* ecx, walltype* arg1, walltype* arg2, walltype* arg3);
|
||||||
|
|
||||||
// queen
|
// queen
|
||||||
|
|
||||||
|
|
|
@ -116,10 +116,10 @@ struct slideData
|
||||||
int16_t nRunRec;
|
int16_t nRunRec;
|
||||||
int16_t nRunC;
|
int16_t nRunC;
|
||||||
|
|
||||||
int nStartWall;
|
walltype* pStartWall;
|
||||||
int nWall1;
|
walltype* pWall1;
|
||||||
int nWall2;
|
walltype* pWall2;
|
||||||
int nWall3;
|
walltype* pWall3;
|
||||||
int x1;
|
int x1;
|
||||||
int y1;
|
int y1;
|
||||||
int x2;
|
int x2;
|
||||||
|
@ -136,7 +136,7 @@ struct slideData
|
||||||
|
|
||||||
struct Point
|
struct Point
|
||||||
{
|
{
|
||||||
int nSector;
|
sectortype* pSector;
|
||||||
int16_t nNext;
|
int16_t nNext;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -274,10 +274,10 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, slideData& w, slid
|
||||||
{
|
{
|
||||||
if (arc.BeginObject(keyname))
|
if (arc.BeginObject(keyname))
|
||||||
{
|
{
|
||||||
arc("at0", w.nStartWall)
|
arc("at0", w.pStartWall)
|
||||||
("at4", w.nWall1)
|
("at4", w.pWall1)
|
||||||
("at8", w.nWall2)
|
("at8", w.pWall2)
|
||||||
("atc", w.nWall3)
|
("atc", w.pWall3)
|
||||||
("x1", w.x1)
|
("x1", w.x1)
|
||||||
("y1", w.y1)
|
("y1", w.y1)
|
||||||
("x2", w.x2)
|
("x2", w.x2)
|
||||||
|
@ -303,7 +303,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Point& w, Point* d
|
||||||
{
|
{
|
||||||
if (arc.BeginObject(keyname))
|
if (arc.BeginObject(keyname))
|
||||||
{
|
{
|
||||||
arc("at0", w.nSector)
|
arc("at0", w.pSector)
|
||||||
("ate", w.nNext)
|
("ate", w.nNext)
|
||||||
.EndObject();
|
.EndObject();
|
||||||
}
|
}
|
||||||
|
@ -934,11 +934,11 @@ void InitSlide()
|
||||||
SlideData.Clear();
|
SlideData.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
int BuildSlide(int nChannel, int nStartWall, int nWall1, int ecx, int nWall2, int nWall3, int nWall4)
|
int BuildSlide(int nChannel, walltype* pStartWall, walltype* pWall1, walltype* p2ndLastWall, walltype* pWall2, walltype* pWall3, walltype* pWall4)
|
||||||
{
|
{
|
||||||
auto nSlide = SlideData.Reserve(1);
|
auto nSlide = SlideData.Reserve(1);
|
||||||
|
|
||||||
int nSector = wall[nStartWall].sector;
|
auto pSector = pStartWall->sectorp();
|
||||||
|
|
||||||
SlideData[nSlide].nRunRec = -1;
|
SlideData[nSlide].nRunRec = -1;
|
||||||
SlideData[nSlide].nChannel = nChannel;
|
SlideData[nSlide].nChannel = nChannel;
|
||||||
|
@ -949,12 +949,9 @@ int BuildSlide(int nChannel, int nStartWall, int nWall1, int ecx, int nWall2, in
|
||||||
SlideData[nSlide].nStart = nPoint;
|
SlideData[nSlide].nStart = nPoint;
|
||||||
|
|
||||||
PointList[nPoint].nNext = -1;
|
PointList[nPoint].nNext = -1;
|
||||||
PointList[nPoint].nSector = nSector;
|
PointList[nPoint].pSector = pSector;
|
||||||
|
|
||||||
int startwall = sector[nSector].wallptr;
|
for(auto& wal : wallsofsector(pSector))
|
||||||
int endwall = startwall + sector[nSector].wallnum;
|
|
||||||
|
|
||||||
for (int nWall = startwall; nWall < endwall; nWall++)
|
|
||||||
{
|
{
|
||||||
int ax = SlideData[nSlide].nStart;
|
int ax = SlideData[nSlide].nStart;
|
||||||
|
|
||||||
|
@ -962,7 +959,7 @@ int BuildSlide(int nChannel, int nStartWall, int nWall1, int ecx, int nWall2, in
|
||||||
{
|
{
|
||||||
while (ax >= 0)
|
while (ax >= 0)
|
||||||
{
|
{
|
||||||
if (wall[nWall].nextsector == PointList[ax].nSector) {
|
if (wal.nextSector() == PointList[ax].pSector) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -971,62 +968,62 @@ int BuildSlide(int nChannel, int nStartWall, int nWall1, int ecx, int nWall2, in
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (wall[nWall].twoSided())
|
if (wal.twoSided())
|
||||||
{
|
{
|
||||||
nPoint = GrabPoint();
|
nPoint = GrabPoint();
|
||||||
|
|
||||||
PointList[nPoint].nNext = SlideData[nSlide].nStart;
|
PointList[nPoint].nNext = SlideData[nSlide].nStart;
|
||||||
PointList[nPoint].nSector = wall[nWall].nextsector;
|
PointList[nPoint].pSector = wal.nextSector();
|
||||||
|
|
||||||
SlideData[nSlide].nStart = nPoint;
|
SlideData[nSlide].nStart = nPoint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SlideData[nSlide].nStartWall = nStartWall;
|
SlideData[nSlide].pStartWall = pStartWall;
|
||||||
SlideData[nSlide].nWall1 = nWall1;
|
SlideData[nSlide].pWall1 = pWall1;
|
||||||
SlideData[nSlide].nWall2 = nWall2;
|
SlideData[nSlide].pWall2 = pWall2;
|
||||||
SlideData[nSlide].nWall3 = nWall3;
|
SlideData[nSlide].pWall3 = pWall3;
|
||||||
|
|
||||||
SlideData[nSlide].x1 = wall[nStartWall].x;
|
SlideData[nSlide].x1 = pStartWall->x;
|
||||||
SlideData[nSlide].y1 = wall[nStartWall].y;
|
SlideData[nSlide].y1 = pStartWall->y;
|
||||||
|
|
||||||
SlideData[nSlide].x2 = wall[nWall2].x;
|
SlideData[nSlide].x2 = pWall2->x;
|
||||||
SlideData[nSlide].y2 = wall[nWall2].y;
|
SlideData[nSlide].y2 = pWall2->y;
|
||||||
|
|
||||||
SlideData[nSlide].x3 = wall[nWall1].x;
|
SlideData[nSlide].x3 = pWall1->x;
|
||||||
SlideData[nSlide].y3 = wall[nWall1].y;
|
SlideData[nSlide].y3 = pWall1->y;
|
||||||
|
|
||||||
SlideData[nSlide].x4 = wall[nWall3].x;
|
SlideData[nSlide].x4 = pWall3->x;
|
||||||
SlideData[nSlide].y4 = wall[nWall3].y;
|
SlideData[nSlide].y4 = pWall3->y;
|
||||||
|
|
||||||
SlideData[nSlide].x5 = wall[ecx].x;
|
SlideData[nSlide].x5 = p2ndLastWall->x;
|
||||||
SlideData[nSlide].y5 = wall[ecx].y;
|
SlideData[nSlide].y5 = p2ndLastWall->y;
|
||||||
|
|
||||||
SlideData[nSlide].x6 = wall[nWall4].x;
|
SlideData[nSlide].x6 = pWall4->x;
|
||||||
SlideData[nSlide].y6 = wall[nWall4].y;
|
SlideData[nSlide].y6 = pWall4->y;
|
||||||
|
|
||||||
StartInterpolation(nStartWall, Interp_Wall_X);
|
StartInterpolation(pStartWall, Interp_Wall_X);
|
||||||
StartInterpolation(nStartWall, Interp_Wall_Y);
|
StartInterpolation(pStartWall, Interp_Wall_Y);
|
||||||
|
|
||||||
StartInterpolation(nWall1, Interp_Wall_X);
|
StartInterpolation(pWall1, Interp_Wall_X);
|
||||||
StartInterpolation(nWall1, Interp_Wall_Y);
|
StartInterpolation(pWall1, Interp_Wall_Y);
|
||||||
|
|
||||||
StartInterpolation(nWall2, Interp_Wall_X);
|
StartInterpolation(pWall2, Interp_Wall_X);
|
||||||
StartInterpolation(nWall2, Interp_Wall_Y);
|
StartInterpolation(pWall2, Interp_Wall_Y);
|
||||||
|
|
||||||
StartInterpolation(nWall3, Interp_Wall_X);
|
StartInterpolation(pWall3, Interp_Wall_X);
|
||||||
StartInterpolation(nWall3, Interp_Wall_Y);
|
StartInterpolation(pWall3, Interp_Wall_Y);
|
||||||
|
|
||||||
|
|
||||||
auto pActor = insertActor(nSector, 899);
|
auto pActor = insertActor(pSector, 899);
|
||||||
auto pSprite = &pActor->s();
|
auto pSprite = &pActor->s();
|
||||||
|
|
||||||
SlideData[nSlide].pActor = pActor;
|
SlideData[nSlide].pActor = pActor;
|
||||||
pSprite->cstat = 0x8000;
|
pSprite->cstat = 0x8000;
|
||||||
pSprite->x = wall[nStartWall].x;
|
pSprite->x = pStartWall->x;
|
||||||
pSprite->y = wall[nStartWall].y;
|
pSprite->y = pStartWall->y;
|
||||||
pSprite->z = sector[nSector].floorz;
|
pSprite->z = pSector->floorz;
|
||||||
pSprite->backuppos();
|
pSprite->backuppos();
|
||||||
|
|
||||||
SlideData[nSlide].nRunC = 0;
|
SlideData[nSlide].nRunC = 0;
|
||||||
|
@ -1076,9 +1073,9 @@ void AISlide::Tick(RunListEvent* ev)
|
||||||
|
|
||||||
if (cx == 1)
|
if (cx == 1)
|
||||||
{
|
{
|
||||||
int nWall = SlideData[nSlide].nWall1;
|
auto pWall = SlideData[nSlide].pWall1;
|
||||||
int x = wall[nWall].x;
|
int x = pWall->x;
|
||||||
int y = wall[nWall].y;
|
int y = pWall->y;
|
||||||
|
|
||||||
int nSeekA = LongSeek(&x, SlideData[nSlide].x5, 20, 20);
|
int nSeekA = LongSeek(&x, SlideData[nSlide].x5, 20, 20);
|
||||||
int var_34 = nSeekA;
|
int var_34 = nSeekA;
|
||||||
|
@ -1088,7 +1085,7 @@ void AISlide::Tick(RunListEvent* ev)
|
||||||
int var_2C = nSeekB;
|
int var_2C = nSeekB;
|
||||||
int var_24 = nSeekB;
|
int var_24 = nSeekB;
|
||||||
|
|
||||||
dragpoint(SlideData[nSlide].nWall1, x, y);
|
dragpoint(SlideData[nSlide].pWall1, x, y);
|
||||||
movesprite(SlideData[nSlide].pActor, var_34 << 14, var_2C << 14, 0, 0, 0, CLIPMASK1);
|
movesprite(SlideData[nSlide].pActor, var_34 << 14, var_2C << 14, 0, 0, 0, CLIPMASK1);
|
||||||
|
|
||||||
if (var_34 == 0)
|
if (var_34 == 0)
|
||||||
|
@ -1099,17 +1096,17 @@ void AISlide::Tick(RunListEvent* ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nWall = SlideData[nSlide].nStartWall;
|
pWall = SlideData[nSlide].pStartWall;
|
||||||
|
|
||||||
y = wall[nWall].y + var_24;
|
y = pWall->y + var_24;
|
||||||
x = wall[nWall].x + var_20;
|
x = pWall->x + var_20;
|
||||||
|
|
||||||
dragpoint(SlideData[nSlide].nStartWall, x, y);
|
dragpoint(SlideData[nSlide].pStartWall, x, y);
|
||||||
|
|
||||||
nWall = SlideData[nSlide].nWall3;
|
pWall = SlideData[nSlide].pWall3;
|
||||||
|
|
||||||
x = wall[nWall].x;
|
x = pWall->x;
|
||||||
y = wall[nWall].y;
|
y = pWall->y;
|
||||||
|
|
||||||
int nSeekC = LongSeek(&x, SlideData[nSlide].x6, 20, 20);
|
int nSeekC = LongSeek(&x, SlideData[nSlide].x6, 20, 20);
|
||||||
int var_30 = nSeekC;
|
int var_30 = nSeekC;
|
||||||
|
@ -1119,24 +1116,24 @@ void AISlide::Tick(RunListEvent* ev)
|
||||||
int edi = nSeekD;
|
int edi = nSeekD;
|
||||||
var_24 = nSeekD;
|
var_24 = nSeekD;
|
||||||
|
|
||||||
dragpoint(SlideData[nSlide].nWall3, x, y);
|
dragpoint(SlideData[nSlide].pWall3, x, y);
|
||||||
|
|
||||||
if (var_30 == 0 && edi == 0) {
|
if (var_30 == 0 && edi == 0) {
|
||||||
ebp++;
|
ebp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
nWall = SlideData[nSlide].nWall2;
|
pWall = SlideData[nSlide].pWall2;
|
||||||
|
|
||||||
x = wall[nWall].x + var_20;
|
x = pWall->x + var_20;
|
||||||
y = wall[nWall].y + var_24;
|
y = pWall->y + var_24;
|
||||||
|
|
||||||
dragpoint(SlideData[nSlide].nWall2, x, y);
|
dragpoint(SlideData[nSlide].pWall2, x, y);
|
||||||
}
|
}
|
||||||
else if (cx == 0) // right branch
|
else if (cx == 0) // right branch
|
||||||
{
|
{
|
||||||
int nWall = SlideData[nSlide].nStartWall;
|
auto pWall = SlideData[nSlide].pStartWall;
|
||||||
int x = wall[nWall].x;
|
int x = pWall->x;
|
||||||
int y = wall[nWall].y;
|
int y = pWall->y;
|
||||||
|
|
||||||
int nSeekA = LongSeek(&x, SlideData[nSlide].x1, 20, 20);
|
int nSeekA = LongSeek(&x, SlideData[nSlide].x1, 20, 20);
|
||||||
int edi = nSeekA;
|
int edi = nSeekA;
|
||||||
|
@ -1146,23 +1143,23 @@ void AISlide::Tick(RunListEvent* ev)
|
||||||
int ecx = nSeekB;
|
int ecx = nSeekB;
|
||||||
int var_28 = nSeekB;
|
int var_28 = nSeekB;
|
||||||
|
|
||||||
dragpoint(SlideData[nSlide].nStartWall, x, y);
|
dragpoint(SlideData[nSlide].pStartWall, x, y);
|
||||||
|
|
||||||
if (edi == 0 && ecx == 0) {
|
if (edi == 0 && ecx == 0) {
|
||||||
ebp = clipmask;
|
ebp = clipmask;
|
||||||
}
|
}
|
||||||
|
|
||||||
nWall = SlideData[nSlide].nWall1;
|
pWall = SlideData[nSlide].pWall1;
|
||||||
|
|
||||||
y = wall[nWall].y + var_28;
|
y = pWall->y + var_28;
|
||||||
x = wall[nWall].x + var_1C;
|
x = pWall->x + var_1C;
|
||||||
|
|
||||||
dragpoint(SlideData[nSlide].nWall1, x, y);
|
dragpoint(SlideData[nSlide].pWall1, x, y);
|
||||||
|
|
||||||
nWall = SlideData[nSlide].nWall2;
|
pWall = SlideData[nSlide].pWall2;
|
||||||
|
|
||||||
x = wall[nWall].x;
|
x = pWall->x;
|
||||||
y = wall[nWall].y;
|
y = pWall->y;
|
||||||
|
|
||||||
int nSeekC = LongSeek(&x, SlideData[nSlide].x2, 20, 20);
|
int nSeekC = LongSeek(&x, SlideData[nSlide].x2, 20, 20);
|
||||||
edi = nSeekC;
|
edi = nSeekC;
|
||||||
|
@ -1172,18 +1169,18 @@ void AISlide::Tick(RunListEvent* ev)
|
||||||
ecx = nSeekD;
|
ecx = nSeekD;
|
||||||
var_28 = nSeekD;
|
var_28 = nSeekD;
|
||||||
|
|
||||||
dragpoint(SlideData[nSlide].nWall2, x, y);
|
dragpoint(SlideData[nSlide].pWall2, x, y);
|
||||||
|
|
||||||
if (edi == 0 && ecx == 0) {
|
if (edi == 0 && ecx == 0) {
|
||||||
ebp++;
|
ebp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
nWall = SlideData[nSlide].nWall3;
|
pWall = SlideData[nSlide].pWall3;
|
||||||
|
|
||||||
y = wall[nWall].y + var_28;
|
y = pWall->y + var_28;
|
||||||
x = wall[nWall].x + var_1C;
|
x = pWall->x + var_1C;
|
||||||
|
|
||||||
dragpoint(SlideData[nSlide].nWall3, x, y);
|
dragpoint(SlideData[nSlide].pWall3, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// loc_21A51:
|
// loc_21A51:
|
||||||
|
|
|
@ -1594,29 +1594,28 @@ void runlist_ProcessWallTag(walltype* pWall, int nLotag, int nHitag)
|
||||||
case 19:
|
case 19:
|
||||||
case 20:
|
case 20:
|
||||||
{
|
{
|
||||||
int nLastWall = 0;
|
walltype* pLastWall = nullptr;
|
||||||
int n2ndLastWall = 0;
|
walltype* p2ndLastWall = nullptr;
|
||||||
|
|
||||||
int nStart = wallnum(pWall);
|
auto pStart = pWall;
|
||||||
int nWall = nStart;
|
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
nWall = wall[nWall].point2; // get the next (right side) wall point
|
pWall = pWall->point2Wall(); // get the next (right side) wall point
|
||||||
|
|
||||||
if (nStart == nWall) { // we've looped back around
|
if (pStart == pWall) { // we've looped back around
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
n2ndLastWall = nLastWall;
|
p2ndLastWall = pLastWall;
|
||||||
nLastWall = nWall;
|
pLastWall = pWall;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nWall2 = wall[nStart].point2;
|
auto pWall2 = pStart->point2Wall();
|
||||||
int nWall3 = wall[nWall2].point2;
|
auto pWall3 = pWall2->point2Wall();
|
||||||
int nWall4 = wall[nWall3].point2;
|
auto pWall4 = pWall3->point2Wall();
|
||||||
|
|
||||||
int nSlide = BuildSlide(nChannel, nStart, nLastWall, n2ndLastWall, nWall2, nWall3, nWall4);
|
int nSlide = BuildSlide(nChannel, pStart, pLastWall, p2ndLastWall, pWall2, pWall3, pWall4);
|
||||||
|
|
||||||
runlist_AddRunRec(sRunChannels[nChannel].a, nSlide, 0x80000);
|
runlist_AddRunRec(sRunChannels[nChannel].a, nSlide, 0x80000);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue