mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-15 04:00:53 +00:00
- make sector panning variables floats and added some convenience wrappers.
This commit is contained in:
parent
82d80f3f07
commit
d545eb7aa9
17 changed files with 96 additions and 99 deletions
|
@ -647,12 +647,12 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor
|
||||||
pSector->extra = LittleShort(load.extra);
|
pSector->extra = LittleShort(load.extra);
|
||||||
pSector->ceilingshade = load.ceilingshade;
|
pSector->ceilingshade = load.ceilingshade;
|
||||||
pSector->ceilingpal = load.ceilingpal;
|
pSector->ceilingpal = load.ceilingpal;
|
||||||
pSector->ceilingxpanning = load.ceilingxpanning;
|
pSector->ceilingxpan_ = load.ceilingxpanning;
|
||||||
pSector->ceilingypanning = load.ceilingypanning;
|
pSector->ceilingypan_ = load.ceilingypanning;
|
||||||
pSector->floorshade = load.floorshade;
|
pSector->floorshade = load.floorshade;
|
||||||
pSector->floorpal = load.floorpal;
|
pSector->floorpal = load.floorpal;
|
||||||
pSector->floorxpanning = load.floorxpanning;
|
pSector->floorxpan_ = load.floorxpanning;
|
||||||
pSector->floorypanning = load.floorypanning;
|
pSector->floorypan_ = load.floorypanning;
|
||||||
pSector->visibility = load.visibility;
|
pSector->visibility = load.visibility;
|
||||||
qsector_filler[i] = load.fogpal;
|
qsector_filler[i] = load.fogpal;
|
||||||
pSector->fogpal = 0;
|
pSector->fogpal = 0;
|
||||||
|
@ -734,12 +734,12 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor
|
||||||
pXSector->marker0 = bitReader.readUnsigned(16);
|
pXSector->marker0 = bitReader.readUnsigned(16);
|
||||||
pXSector->marker1 = bitReader.readUnsigned(16);
|
pXSector->marker1 = bitReader.readUnsigned(16);
|
||||||
pXSector->Crush = bitReader.readUnsigned(1);
|
pXSector->Crush = bitReader.readUnsigned(1);
|
||||||
pXSector->ceilXPanFrac = bitReader.readUnsigned(8);
|
pSector->ceilingxpan_ += bitReader.readUnsigned(8) / 256.f;
|
||||||
pXSector->ceilYPanFrac = bitReader.readUnsigned(8);
|
pSector->ceilingypan_ += bitReader.readUnsigned(8) / 256.f;
|
||||||
pXSector->floorXPanFrac = bitReader.readUnsigned(8);
|
pSector->floorxpan_ += bitReader.readUnsigned(8) / 256.f;
|
||||||
pXSector->damageType = bitReader.readUnsigned(3);
|
pXSector->damageType = bitReader.readUnsigned(3);
|
||||||
pXSector->floorpal = bitReader.readUnsigned(4);
|
pXSector->floorpal = bitReader.readUnsigned(4);
|
||||||
pXSector->floorYPanFrac = bitReader.readUnsigned(8);
|
pSector->floorypan_ = bitReader.readUnsigned(8) / 256.f;
|
||||||
pXSector->locked = bitReader.readUnsigned(1);
|
pXSector->locked = bitReader.readUnsigned(1);
|
||||||
pXSector->windVel = bitReader.readUnsigned(10);
|
pXSector->windVel = bitReader.readUnsigned(10);
|
||||||
pXSector->windAng = bitReader.readUnsigned(11);
|
pXSector->windAng = bitReader.readUnsigned(11);
|
||||||
|
|
|
@ -213,12 +213,8 @@ struct XSECTOR {
|
||||||
uint8_t Depth; // Depth
|
uint8_t Depth; // Depth
|
||||||
uint8_t Key; // Key
|
uint8_t Key; // Key
|
||||||
uint8_t ceilpal; // Ceil pal2
|
uint8_t ceilpal; // Ceil pal2
|
||||||
uint8_t ceilXPanFrac; // Ceiling x panning frac
|
|
||||||
uint8_t ceilYPanFrac; // Ceiling y panning frac
|
|
||||||
uint8_t floorXPanFrac; // Floor x panning frac
|
|
||||||
uint8_t damageType; // DamageType
|
uint8_t damageType; // DamageType
|
||||||
uint8_t floorpal; // Floor pal2
|
uint8_t floorpal; // Floor pal2
|
||||||
uint8_t floorYPanFrac; // Floor y panning frac
|
|
||||||
uint8_t bobZRange; // Motion Z range
|
uint8_t bobZRange; // Motion Z range
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -510,10 +510,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSECTOR& w, XSECTO
|
||||||
("depth", w.Depth, def->Depth)
|
("depth", w.Depth, def->Depth)
|
||||||
("key", w.Key, def->Key)
|
("key", w.Key, def->Key)
|
||||||
("ceilpal", w.ceilpal, def->ceilpal)
|
("ceilpal", w.ceilpal, def->ceilpal)
|
||||||
("ceilxpanfrac", w.ceilXPanFrac, def->ceilXPanFrac)
|
|
||||||
("ceilypanfrac", w.ceilYPanFrac, def->ceilYPanFrac)
|
|
||||||
("floorxpanfrac", w.floorXPanFrac, def->floorXPanFrac)
|
|
||||||
("floorypanfrac", w.floorYPanFrac, def->floorYPanFrac)
|
|
||||||
("floorpal", w.floorpal, def->floorpal)
|
("floorpal", w.floorpal, def->floorpal)
|
||||||
("damagetype", w.damageType, def->damageType)
|
("damagetype", w.damageType, def->damageType)
|
||||||
("bobzrange", w.bobZRange, def->bobZRange)
|
("bobzrange", w.bobZRange, def->bobZRange)
|
||||||
|
|
|
@ -1648,16 +1648,16 @@ void useObjResizer(XSPRITE* pXSource, short objType, int objIndex) {
|
||||||
// for sectors
|
// for sectors
|
||||||
case 6:
|
case 6:
|
||||||
if (valueIsBetween(pXSource->data1, -1, 32767))
|
if (valueIsBetween(pXSource->data1, -1, 32767))
|
||||||
sector[objIndex].floorxpanning = ClipRange(pXSource->data1, 0, 255);
|
sector[objIndex].floorxpan_ = ClipRange(pXSource->data1, 0, 255);
|
||||||
|
|
||||||
if (valueIsBetween(pXSource->data2, -1, 32767))
|
if (valueIsBetween(pXSource->data2, -1, 32767))
|
||||||
sector[objIndex].floorypanning = ClipRange(pXSource->data2, 0, 255);
|
sector[objIndex].floorypan_ = ClipRange(pXSource->data2, 0, 255);
|
||||||
|
|
||||||
if (valueIsBetween(pXSource->data3, -1, 32767))
|
if (valueIsBetween(pXSource->data3, -1, 32767))
|
||||||
sector[objIndex].ceilingxpanning = ClipRange(pXSource->data3, 0, 255);
|
sector[objIndex].ceilingxpan_ = ClipRange(pXSource->data3, 0, 255);
|
||||||
|
|
||||||
if (valueIsBetween(pXSource->data4, -1, 65535))
|
if (valueIsBetween(pXSource->data4, -1, 65535))
|
||||||
sector[objIndex].ceilingypanning = ClipRange(pXSource->data4, 0, 255);
|
sector[objIndex].ceilingypan_ = ClipRange(pXSource->data4, 0, 255);
|
||||||
break;
|
break;
|
||||||
// for sprites
|
// for sprites
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -2627,10 +2627,10 @@ bool condCheckMixed(XSPRITE* pXCond, EVENT event, int cmpOp, bool PUSH) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 29: return (pObj->hitag & arg1);
|
case 29: return (pObj->hitag & arg1);
|
||||||
case 30: return condCmp(pObj->floorxpanning, arg1, arg2, cmpOp);
|
case 30: return condCmp(pObj->floorxpan(), arg1, arg2, cmpOp);
|
||||||
case 31: return condCmp(pObj->ceilingxpanning, arg1, arg2, cmpOp);
|
case 31: return condCmp(pObj->ceilingxpan(), arg1, arg2, cmpOp);
|
||||||
case 32: return condCmp(pObj->floorypanning, arg1, arg2, cmpOp);
|
case 32: return condCmp(pObj->floorypan(), arg1, arg2, cmpOp);
|
||||||
case 33: return condCmp(pObj->ceilingypanning, arg1, arg2, cmpOp);
|
case 33: return condCmp(pObj->ceilingypan(), arg1, arg2, cmpOp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,34 +280,26 @@ void DoSectorPanning(void)
|
||||||
if (pXSector->panFloor) // Floor
|
if (pXSector->panFloor) // Floor
|
||||||
{
|
{
|
||||||
int nTile = pSector->floorpicnum;
|
int nTile = pSector->floorpicnum;
|
||||||
int px = (pSector->floorxpanning << 8) + pXSector->floorXPanFrac;
|
|
||||||
int py = (pSector->floorypanning << 8) + pXSector->floorYPanFrac;
|
|
||||||
if (pSector->floorstat & 64)
|
if (pSector->floorstat & 64)
|
||||||
angle -= 512;
|
angle -= 512;
|
||||||
int xBits = tileWidth(nTile) >> int((pSector->floorstat & 8) != 0);
|
int xBits = tileWidth(nTile) >> int((pSector->floorstat & 8) != 0);
|
||||||
px += mulscale30(speed << 2, Cos(angle)) / xBits;
|
int px = mulscale30(speed << 2, Cos(angle)) / xBits;
|
||||||
int yBits = tileHeight(nTile) >> int((pSector->floorstat & 8) != 0);
|
int yBits = tileHeight(nTile) >> int((pSector->floorstat & 8) != 0);
|
||||||
py -= mulscale30(speed << 2, Sin(angle)) / yBits;
|
int py = mulscale30(speed << 2, Sin(angle)) / yBits;
|
||||||
pSector->floorxpanning = px >> 8;
|
pSector->addfloorxpan(px * (1. / 256));
|
||||||
pSector->floorypanning = py >> 8;
|
pSector->addfloorypan(-py * (1. / 256));
|
||||||
pXSector->floorXPanFrac = px & 255;
|
|
||||||
pXSector->floorYPanFrac = py & 255;
|
|
||||||
}
|
}
|
||||||
if (pXSector->panCeiling) // Ceiling
|
if (pXSector->panCeiling) // Ceiling
|
||||||
{
|
{
|
||||||
int nTile = pSector->ceilingpicnum;
|
int nTile = pSector->ceilingpicnum;
|
||||||
int px = (pSector->ceilingxpanning << 8) + pXSector->ceilXPanFrac;
|
|
||||||
int py = (pSector->ceilingypanning << 8) + pXSector->ceilYPanFrac;
|
|
||||||
if (pSector->ceilingstat & 64)
|
if (pSector->ceilingstat & 64)
|
||||||
angle -= 512;
|
angle -= 512;
|
||||||
int xBits = tileWidth(nTile) >> int((pSector->floorstat & 8) != 0);
|
int xBits = tileWidth(nTile) >> int((pSector->ceilingstat & 8) != 0);
|
||||||
px += mulscale30(speed << 2, Cos(angle)) / xBits;
|
int px = mulscale30(speed << 2, Cos(angle)) / xBits;
|
||||||
int yBits = tileHeight(nTile) >> int((pSector->floorstat & 8) != 0);
|
int yBits = tileHeight(nTile) >> int((pSector->ceilingstat & 8) != 0);
|
||||||
py -= mulscale30(speed << 2, Sin(angle)) / yBits;
|
int py = mulscale30(speed << 2, Sin(angle)) / yBits;
|
||||||
pSector->ceilingxpanning = px >> 8;
|
pSector->addceilingxpan(px * (1. / 256));
|
||||||
pSector->ceilingypanning = py >> 8;
|
pSector->addceilingypan(-py * (1. / 256));
|
||||||
pXSector->ceilXPanFrac = px & 255;
|
|
||||||
pXSector->ceilYPanFrac = py & 255;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,16 +29,27 @@ struct sectortype
|
||||||
uint16_t ceilingstat, floorstat;
|
uint16_t ceilingstat, floorstat;
|
||||||
int16_t ceilingpicnum, ceilingheinum;
|
int16_t ceilingpicnum, ceilingheinum;
|
||||||
int8_t ceilingshade;
|
int8_t ceilingshade;
|
||||||
uint8_t ceilingpal, /*CM_FLOORZ:*/ ceilingxpanning, ceilingypanning;
|
uint8_t ceilingpal; /*CM_FLOORZ:*/
|
||||||
int16_t floorpicnum, floorheinum;
|
int16_t floorpicnum, floorheinum;
|
||||||
int8_t floorshade;
|
int8_t floorshade;
|
||||||
uint8_t floorpal, floorxpanning, floorypanning;
|
uint8_t floorpal;;
|
||||||
uint8_t /*CM_CEILINGZ:*/ visibility, fogpal;
|
uint8_t /*CM_CEILINGZ:*/ visibility, fogpal;
|
||||||
union {
|
union {
|
||||||
int16_t lotag, type;
|
int16_t lotag, type;
|
||||||
};
|
};
|
||||||
int16_t hitag;
|
int16_t hitag;
|
||||||
int16_t extra;
|
int16_t extra;
|
||||||
|
|
||||||
|
float ceilingxpan_, ceilingypan_, floorxpan_, floorypan_;
|
||||||
|
|
||||||
|
int ceilingxpan() const { return int(ceilingxpan_); }
|
||||||
|
int ceilingypan() const { return int(ceilingypan_); }
|
||||||
|
int floorxpan() const { return int(floorxpan_); }
|
||||||
|
int floorypan() const { return int(floorypan_); }
|
||||||
|
void addfloorxpan(float add) { floorxpan_ = fmod(floorxpan_ + add + 512, 256); } // +512 is for handling negative offsets
|
||||||
|
void addfloorypan(float add) { floorypan_ = fmod(floorypan_ + add + 512, 256); } // +512 is for handling negative offsets
|
||||||
|
void addceilingxpan(float add) { ceilingxpan_ = fmod(ceilingxpan_ + add + 512, 256); } // +512 is for handling negative offsets
|
||||||
|
void addceilingypan(float add) { ceilingypan_ = fmod(ceilingypan_ + add + 512, 256); } // +512 is for handling negative offsets
|
||||||
};
|
};
|
||||||
|
|
||||||
//cstat:
|
//cstat:
|
||||||
|
|
|
@ -1749,8 +1749,8 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
|
||||||
asm2 = (globalx2<<globalyshift);
|
asm2 = (globalx2<<globalyshift);
|
||||||
globalx1 <<= globalxshift;
|
globalx1 <<= globalxshift;
|
||||||
globaly2 <<= globalyshift;
|
globaly2 <<= globalyshift;
|
||||||
set_globalpos(((int64_t) globalposx<<(20+globalxshift))+(((uint32_t) sec->floorxpanning)<<24),
|
set_globalpos(((int64_t) globalposx<<(20+globalxshift))+(((uint32_t) sec->floorxpan())<<24),
|
||||||
((int64_t) globalposy<<(20+globalyshift))-(((uint32_t) sec->floorypanning)<<24),
|
((int64_t) globalposy<<(20+globalyshift))-(((uint32_t) sec->floorypan())<<24),
|
||||||
globalposz);
|
globalposz);
|
||||||
renderFillPolygon(npoints);
|
renderFillPolygon(npoints);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1578,7 +1578,9 @@ static void polymost_drawalls(int32_t const bunch)
|
||||||
|
|
||||||
global_cf_fogpal = sec->fogpal;
|
global_cf_fogpal = sec->fogpal;
|
||||||
global_cf_shade = sec->floorshade, global_cf_pal = sec->floorpal; global_cf_z = sec->floorz; // REFACT
|
global_cf_shade = sec->floorshade, global_cf_pal = sec->floorpal; global_cf_z = sec->floorz; // REFACT
|
||||||
global_cf_xpanning = sec->floorxpanning; global_cf_ypanning = sec->floorypanning, global_cf_heinum = sec->floorheinum;
|
global_cf_xpanning = sec->floorxpan_;
|
||||||
|
global_cf_ypanning = sec->floorypan_;
|
||||||
|
global_cf_heinum = sec->floorheinum;
|
||||||
global_getzofslope_func = &fgetflorzofslope;
|
global_getzofslope_func = &fgetflorzofslope;
|
||||||
|
|
||||||
if (globalpicnum >= r_rortexture && globalpicnum < r_rortexture + r_rortexturerange && r_rorphase == 0)
|
if (globalpicnum >= r_rortexture && globalpicnum < r_rortexture + r_rortexturerange && r_rorphase == 0)
|
||||||
|
@ -1818,7 +1820,9 @@ static void polymost_drawalls(int32_t const bunch)
|
||||||
|
|
||||||
global_cf_fogpal = sec->fogpal;
|
global_cf_fogpal = sec->fogpal;
|
||||||
global_cf_shade = sec->ceilingshade, global_cf_pal = sec->ceilingpal; global_cf_z = sec->ceilingz; // REFACT
|
global_cf_shade = sec->ceilingshade, global_cf_pal = sec->ceilingpal; global_cf_z = sec->ceilingz; // REFACT
|
||||||
global_cf_xpanning = sec->ceilingxpanning; global_cf_ypanning = sec->ceilingypanning, global_cf_heinum = sec->ceilingheinum;
|
global_cf_xpanning = sec->ceilingxpan_;
|
||||||
|
global_cf_ypanning = sec->ceilingypan_,
|
||||||
|
global_cf_heinum = sec->ceilingheinum;
|
||||||
global_getzofslope_func = &fgetceilzofslope;
|
global_getzofslope_func = &fgetceilzofslope;
|
||||||
|
|
||||||
if (globalpicnum >= r_rortexture && globalpicnum < r_rortexture + r_rortexturerange && r_rorphase == 0)
|
if (globalpicnum >= r_rortexture && globalpicnum < r_rortexture + r_rortexturerange && r_rorphase == 0)
|
||||||
|
|
|
@ -55,14 +55,14 @@ static void ReadSectorV7(FileReader& fr, sectortype& sect)
|
||||||
sect.ceilingheinum = fr.ReadUInt16();
|
sect.ceilingheinum = fr.ReadUInt16();
|
||||||
sect.ceilingshade = fr.ReadInt8();
|
sect.ceilingshade = fr.ReadInt8();
|
||||||
sect.ceilingpal = fr.ReadUInt8();
|
sect.ceilingpal = fr.ReadUInt8();
|
||||||
sect.ceilingxpanning = fr.ReadUInt8();
|
sect.ceilingxpan_ = fr.ReadUInt8();
|
||||||
sect.ceilingypanning = fr.ReadUInt8();
|
sect.ceilingypan_ = fr.ReadUInt8();
|
||||||
sect.floorpicnum = fr.ReadUInt16();
|
sect.floorpicnum = fr.ReadUInt16();
|
||||||
sect.floorheinum = fr.ReadUInt16();
|
sect.floorheinum = fr.ReadUInt16();
|
||||||
sect.floorshade = fr.ReadInt8();
|
sect.floorshade = fr.ReadInt8();
|
||||||
sect.floorpal = fr.ReadUInt8();
|
sect.floorpal = fr.ReadUInt8();
|
||||||
sect.floorxpanning = fr.ReadUInt8();
|
sect.floorxpan_ = fr.ReadUInt8();
|
||||||
sect.floorypanning = fr.ReadUInt8();
|
sect.floorypan_ = fr.ReadUInt8();
|
||||||
sect.visibility = fr.ReadUInt8();
|
sect.visibility = fr.ReadUInt8();
|
||||||
sect.fogpal = fr.ReadUInt8(); // note: currently unused, except for Blood.
|
sect.fogpal = fr.ReadUInt8(); // note: currently unused, except for Blood.
|
||||||
sect.lotag = fr.ReadInt16();
|
sect.lotag = fr.ReadInt16();
|
||||||
|
@ -82,10 +82,10 @@ static void ReadSectorV6(FileReader& fr, sectortype& sect)
|
||||||
sect.floorz = fr.ReadInt32();
|
sect.floorz = fr.ReadInt32();
|
||||||
sect.ceilingshade = fr.ReadInt8();
|
sect.ceilingshade = fr.ReadInt8();
|
||||||
sect.floorshade = fr.ReadInt8();
|
sect.floorshade = fr.ReadInt8();
|
||||||
sect.ceilingxpanning = fr.ReadUInt8();
|
sect.ceilingxpan_ = fr.ReadUInt8();
|
||||||
sect.floorxpanning = fr.ReadUInt8();
|
sect.floorxpan_ = fr.ReadUInt8();
|
||||||
sect.ceilingypanning = fr.ReadUInt8();
|
sect.ceilingypan_ = fr.ReadUInt8();
|
||||||
sect.floorypanning = fr.ReadUInt8();
|
sect.floorypan_ = fr.ReadUInt8();
|
||||||
sect.ceilingstat = fr.ReadUInt8();
|
sect.ceilingstat = fr.ReadUInt8();
|
||||||
sect.floorstat = fr.ReadUInt8();
|
sect.floorstat = fr.ReadUInt8();
|
||||||
sect.ceilingpal = fr.ReadUInt8();
|
sect.ceilingpal = fr.ReadUInt8();
|
||||||
|
@ -109,10 +109,10 @@ static void ReadSectorV5(FileReader& fr, sectortype& sect)
|
||||||
sect.floorz = fr.ReadInt32();
|
sect.floorz = fr.ReadInt32();
|
||||||
sect.ceilingshade = fr.ReadInt8();
|
sect.ceilingshade = fr.ReadInt8();
|
||||||
sect.floorshade = fr.ReadInt8();
|
sect.floorshade = fr.ReadInt8();
|
||||||
sect.ceilingxpanning = fr.ReadUInt8();
|
sect.ceilingxpan_ = fr.ReadUInt8();
|
||||||
sect.floorxpanning = fr.ReadUInt8();
|
sect.floorxpan_ = fr.ReadUInt8();
|
||||||
sect.ceilingypanning = fr.ReadUInt8();
|
sect.ceilingypan_ = fr.ReadUInt8();
|
||||||
sect.floorypanning = fr.ReadUInt8();
|
sect.floorypan_ = fr.ReadUInt8();
|
||||||
sect.ceilingstat = fr.ReadUInt8();
|
sect.ceilingstat = fr.ReadUInt8();
|
||||||
sect.floorstat = fr.ReadUInt8();
|
sect.floorstat = fr.ReadUInt8();
|
||||||
sect.ceilingpal = fr.ReadUInt8();
|
sect.ceilingpal = fr.ReadUInt8();
|
||||||
|
|
|
@ -539,14 +539,14 @@ FSerializer &Serialize(FSerializer &arc, const char *key, sectortype &c, sectort
|
||||||
("ceilingheinum", c.ceilingheinum, def->ceilingheinum)
|
("ceilingheinum", c.ceilingheinum, def->ceilingheinum)
|
||||||
("ceilingshade", c.ceilingshade, def->ceilingshade)
|
("ceilingshade", c.ceilingshade, def->ceilingshade)
|
||||||
("ceilingpal", c.ceilingpal, def->ceilingpal)
|
("ceilingpal", c.ceilingpal, def->ceilingpal)
|
||||||
("ceilingxpanning", c.ceilingxpanning, def->ceilingxpanning)
|
("ceilingxpanning", c.ceilingxpan_, def->ceilingxpan_)
|
||||||
("ceilingypanning", c.ceilingypanning, def->ceilingypanning)
|
("ceilingypanning", c.ceilingypan_, def->ceilingypan_)
|
||||||
("floorpicnum", c.floorpicnum, def->floorpicnum)
|
("floorpicnum", c.floorpicnum, def->floorpicnum)
|
||||||
("floorheinum", c.floorheinum, def->floorheinum)
|
("floorheinum", c.floorheinum, def->floorheinum)
|
||||||
("floorshade", c.floorshade, def->floorshade)
|
("floorshade", c.floorshade, def->floorshade)
|
||||||
("floorpal", c.floorpal, def->floorpal)
|
("floorpal", c.floorpal, def->floorpal)
|
||||||
("floorxpanning", c.floorxpanning, def->floorxpanning)
|
("floorxpanning", c.floorxpan_, def->floorxpan_)
|
||||||
("floorypanning", c.floorypanning, def->floorypanning)
|
("floorypanning", c.floorypan_, def->floorypan_)
|
||||||
("visibility", c.visibility, def->visibility)
|
("visibility", c.visibility, def->visibility)
|
||||||
("fogpal", c.fogpal, def->fogpal)
|
("fogpal", c.fogpal, def->fogpal)
|
||||||
("lotag", c.lotag, def->lotag)
|
("lotag", c.lotag, def->lotag)
|
||||||
|
|
|
@ -676,8 +676,8 @@ void DoFlows()
|
||||||
sFlowInfo[i].field_8 &= sFlowInfo[i].field_18;
|
sFlowInfo[i].field_8 &= sFlowInfo[i].field_18;
|
||||||
|
|
||||||
short nSector = sFlowInfo[i].field_0;
|
short nSector = sFlowInfo[i].field_0;
|
||||||
sector[nSector].floorxpanning = sFlowInfo[i].field_4 >> 14;
|
sector[nSector].addfloorxpan(sFlowInfo[i].field_4 / 16384.f);
|
||||||
sector[nSector].floorypanning = sFlowInfo[i].field_8 >> 14;
|
sector[nSector].addfloorypan(sFlowInfo[i].field_8 / 16384.f);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -685,8 +685,8 @@ void DoFlows()
|
||||||
{
|
{
|
||||||
short nSector = sFlowInfo[i].field_0;
|
short nSector = sFlowInfo[i].field_0;
|
||||||
|
|
||||||
sector[nSector].ceilingxpanning = sFlowInfo[i].field_4 >> 14;
|
sector[nSector].addceilingxpan(sFlowInfo[i].field_4 / 16384.f);
|
||||||
sector[nSector].ceilingypanning = sFlowInfo[i].field_8 >> 14;
|
sector[nSector].addceilingypan(sFlowInfo[i].field_8 / 16384.f);
|
||||||
|
|
||||||
sFlowInfo[i].field_4 &= sFlowInfo[i].field_14;
|
sFlowInfo[i].field_4 &= sFlowInfo[i].field_14;
|
||||||
sFlowInfo[i].field_8 &= sFlowInfo[i].field_18;
|
sFlowInfo[i].field_8 &= sFlowInfo[i].field_18;
|
||||||
|
|
|
@ -4335,11 +4335,11 @@ void handle_se20(DDukeActor* actor)
|
||||||
setsprite(ps[p].GetActor(), ps[p].posx, ps[p].posy, ps[p].posz + PHEIGHT);
|
setsprite(ps[p].GetActor(), ps[p].posx, ps[p].posy, ps[p].posz + PHEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->floorxpanning -= x >> 3;
|
sc->addfloorxpan(-x / 8.f);
|
||||||
sc->floorypanning -= l >> 3;
|
sc->addfloorypan(-l / 8.f);
|
||||||
|
|
||||||
sc->ceilingxpanning -= x >> 3;
|
sc->addceilingxpan(-x / 8.f);
|
||||||
sc->ceilingypanning -= l >> 3;
|
sc->addceilingypan(-l / 8.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4601,7 +4601,7 @@ void handle_se24(DDukeActor *actor, int16_t *list1, int16_t *list2, int TRIPBOMB
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sector[actor->s.sectnum].floorxpanning += actor->s.yvel >> 7;
|
sector[actor->s.sectnum].addfloorxpan(actor->s.yvel / 128.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
|
@ -4191,14 +4191,14 @@ void destroyit(DDukeActor *actor)
|
||||||
sector[sectnum].ceilingheinum = sector[it_sect].ceilingheinum;
|
sector[sectnum].ceilingheinum = sector[it_sect].ceilingheinum;
|
||||||
sector[sectnum].ceilingshade = sector[it_sect].ceilingshade;
|
sector[sectnum].ceilingshade = sector[it_sect].ceilingshade;
|
||||||
sector[sectnum].ceilingpal = sector[it_sect].ceilingpal;
|
sector[sectnum].ceilingpal = sector[it_sect].ceilingpal;
|
||||||
sector[sectnum].ceilingxpanning = sector[it_sect].ceilingxpanning;
|
sector[sectnum].ceilingxpan_ = sector[it_sect].ceilingxpan_;
|
||||||
sector[sectnum].ceilingypanning = sector[it_sect].ceilingypanning;
|
sector[sectnum].ceilingypan_ = sector[it_sect].ceilingypan_;
|
||||||
sector[sectnum].floorpicnum = sector[it_sect].floorpicnum;
|
sector[sectnum].floorpicnum = sector[it_sect].floorpicnum;
|
||||||
sector[sectnum].floorheinum = sector[it_sect].floorheinum;
|
sector[sectnum].floorheinum = sector[it_sect].floorheinum;
|
||||||
sector[sectnum].floorshade = sector[it_sect].floorshade;
|
sector[sectnum].floorshade = sector[it_sect].floorshade;
|
||||||
sector[sectnum].floorpal = sector[it_sect].floorpal;
|
sector[sectnum].floorpal = sector[it_sect].floorpal;
|
||||||
sector[sectnum].floorxpanning = sector[it_sect].floorxpanning;
|
sector[sectnum].floorxpan_ = sector[it_sect].floorxpan_;
|
||||||
sector[sectnum].floorypanning = sector[it_sect].floorypanning;
|
sector[sectnum].floorypan_ = sector[it_sect].floorypan_;
|
||||||
sector[sectnum].visibility = sector[it_sect].visibility;
|
sector[sectnum].visibility = sector[it_sect].visibility;
|
||||||
sectorextra[sectnum] = sectorextra[it_sect]; // TRANSITIONAL: at least rename this.
|
sectorextra[sectnum] = sectorextra[it_sect]; // TRANSITIONAL: at least rename this.
|
||||||
sector[sectnum].lotag = sector[it_sect].lotag;
|
sector[sectnum].lotag = sector[it_sect].lotag;
|
||||||
|
|
|
@ -1083,8 +1083,12 @@ void DoSector(char bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
else SetGameVarID((int)lVar2, sector[iSector].ceilingpal, sActor, sPlayer);
|
else SetGameVarID((int)lVar2, sector[iSector].ceilingpal, sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case SECTOR_CEILINGXPANNING:
|
case SECTOR_CEILINGXPANNING:
|
||||||
if (bSet) sector[iSector].ceilingxpanning = lValue;
|
if (bSet) sector[iSector].ceilingxpan_ = lValue;
|
||||||
else SetGameVarID((int)lVar2, sector[iSector].ceilingypanning, sActor, sPlayer);
|
else SetGameVarID((int)lVar2, sector[iSector].ceilingxpan(), sActor, sPlayer);
|
||||||
|
break;
|
||||||
|
case SECTOR_CEILINGYPANNING:
|
||||||
|
if (bSet) sector[iSector].ceilingypan_ = lValue;
|
||||||
|
else SetGameVarID((int)lVar2, sector[iSector].ceilingypan(), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case SECTOR_FLOORPICNUM:
|
case SECTOR_FLOORPICNUM:
|
||||||
if (bSet) sector[iSector].floorpicnum = lValue;
|
if (bSet) sector[iSector].floorpicnum = lValue;
|
||||||
|
@ -1103,12 +1107,12 @@ void DoSector(char bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
else SetGameVarID((int)lVar2, sector[iSector].floorpal, sActor, sPlayer);
|
else SetGameVarID((int)lVar2, sector[iSector].floorpal, sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case SECTOR_FLOORXPANNING:
|
case SECTOR_FLOORXPANNING:
|
||||||
if (bSet) sector[iSector].floorxpanning = lValue;
|
if (bSet) sector[iSector].floorxpan_ = lValue;
|
||||||
else SetGameVarID((int)lVar2, sector[iSector].floorxpanning, sActor, sPlayer);
|
else SetGameVarID((int)lVar2, sector[iSector].floorxpan(), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case SECTOR_FLOORYPANNING:
|
case SECTOR_FLOORYPANNING:
|
||||||
if (bSet) sector[iSector].floorypanning = lValue;
|
if (bSet) sector[iSector].floorypan_ = lValue;
|
||||||
else SetGameVarID((int)lVar2, sector[iSector].floorypanning, sActor, sPlayer);
|
else SetGameVarID((int)lVar2, sector[iSector].floorypan(), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case SECTOR_VISIBILITY:
|
case SECTOR_VISIBILITY:
|
||||||
if (bSet) sector[iSector].visibility = lValue;
|
if (bSet) sector[iSector].visibility = lValue;
|
||||||
|
|
|
@ -1259,8 +1259,8 @@ void moveclouds(double smoothratio)
|
||||||
cloudy += ps[screenpeek].angle.ang.bsin(-9);
|
cloudy += ps[screenpeek].angle.ang.bsin(-9);
|
||||||
for (int i = 0; i < numclouds; i++)
|
for (int i = 0; i < numclouds; i++)
|
||||||
{
|
{
|
||||||
sector[clouds[i]].ceilingxpanning = cloudx >> 6;
|
sector[clouds[i]].addceilingxpan(cloudx / 64.f);
|
||||||
sector[clouds[i]].ceilingypanning = cloudy >> 6;
|
sector[clouds[i]].addceilingypan(cloudy / 64.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,11 +233,11 @@ void CopySectorMatch(short match)
|
||||||
dsectp->floorpal = ssectp->floorpal;
|
dsectp->floorpal = ssectp->floorpal;
|
||||||
dsectp->ceilingpal = ssectp->ceilingpal;
|
dsectp->ceilingpal = ssectp->ceilingpal;
|
||||||
|
|
||||||
dsectp->floorxpanning = ssectp->floorxpanning;
|
dsectp->floorxpan_ = ssectp->floorxpan_;
|
||||||
dsectp->ceilingxpanning = ssectp->ceilingxpanning;
|
dsectp->ceilingxpan_ = ssectp->ceilingxpan_;
|
||||||
|
|
||||||
dsectp->floorypanning = ssectp->floorypanning;
|
dsectp->floorypan_ = ssectp->floorypan_;
|
||||||
dsectp->ceilingypanning = ssectp->ceilingypanning;
|
dsectp->ceilingypan_ = ssectp->ceilingypan_;
|
||||||
|
|
||||||
dsectp->floorstat = ssectp->floorstat;
|
dsectp->floorstat = ssectp->floorstat;
|
||||||
dsectp->ceilingstat = ssectp->ceilingstat;
|
dsectp->ceilingstat = ssectp->ceilingstat;
|
||||||
|
|
|
@ -3210,11 +3210,8 @@ DoPanning(void)
|
||||||
nx = mulscale20(sp->xvel, bcos(sp->ang));
|
nx = mulscale20(sp->xvel, bcos(sp->ang));
|
||||||
ny = mulscale20(sp->xvel, bsin(sp->ang));
|
ny = mulscale20(sp->xvel, bsin(sp->ang));
|
||||||
|
|
||||||
sectp->floorxpanning += nx;
|
sectp->addfloorxpan(nx);
|
||||||
sectp->floorypanning += ny;
|
sectp->addfloorypan(ny);
|
||||||
|
|
||||||
sectp->floorxpanning &= 255;
|
|
||||||
sectp->floorypanning &= 255;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it.Reset(STAT_CEILING_PAN);
|
it.Reset(STAT_CEILING_PAN);
|
||||||
|
@ -3226,11 +3223,8 @@ DoPanning(void)
|
||||||
nx = mulscale20(sp->xvel, bcos(sp->ang));
|
nx = mulscale20(sp->xvel, bcos(sp->ang));
|
||||||
ny = mulscale20(sp->xvel, bsin(sp->ang));
|
ny = mulscale20(sp->xvel, bsin(sp->ang));
|
||||||
|
|
||||||
sectp->ceilingxpanning += nx;
|
sectp->addceilingxpan(nx);
|
||||||
sectp->ceilingypanning += ny;
|
sectp->addceilingypan(ny);
|
||||||
|
|
||||||
sectp->ceilingxpanning &= 255;
|
|
||||||
sectp->ceilingypanning &= 255;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it.Reset(STAT_WALL_PAN);
|
it.Reset(STAT_WALL_PAN);
|
||||||
|
|
Loading…
Reference in a new issue