mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 07:31:03 +00:00
- use the texture wrappers in a few places.
This commit is contained in:
parent
4ecb4aacb2
commit
483617d3e1
4 changed files with 18 additions and 18 deletions
|
@ -267,9 +267,9 @@ void dbLoadMap(const char* pPath, DVector3& pos, short* pAngle, sectortype** cur
|
|||
pSector->setzfrommap(LittleLong(load.ceilingz), LittleLong(load.floorz));
|
||||
pSector->ceilingstat = ESectorFlags::FromInt(LittleShort(load.ceilingstat));
|
||||
pSector->floorstat = ESectorFlags::FromInt(LittleShort(load.floorstat));
|
||||
pSector->ceilingpicnum = LittleShort(load.ceilingpic);
|
||||
pSector->setceilingtexture(tileGetTextureID(LittleShort(load.ceilingpic)));
|
||||
pSector->ceilingheinum = LittleShort(load.ceilingheinum);
|
||||
pSector->floorpicnum = LittleShort(load.floorpic);
|
||||
pSector->setfloortexture(tileGetTextureID(LittleShort(load.floorpic)));
|
||||
pSector->floorheinum = LittleShort(load.floorheinum);
|
||||
pSector->type = LittleShort(load.type);
|
||||
pSector->hitag = LittleShort(load.hitag);
|
||||
|
|
|
@ -7189,10 +7189,10 @@ void usePictureChanger(DBloodActor* sourceactor, int objType, sectortype* targSe
|
|||
switch (objType) {
|
||||
case OBJ_SECTOR:
|
||||
if (valueIsBetween(sourceactor->xspr.data1, -1, 32767))
|
||||
targSect->floorpicnum = sourceactor->xspr.data1;
|
||||
targSect->setfloortexture(tileGetTextureID(sourceactor->xspr.data1));
|
||||
|
||||
if (valueIsBetween(sourceactor->xspr.data2, -1, 32767))
|
||||
targSect->ceilingpicnum = sourceactor->xspr.data2;
|
||||
targSect->setceilingtexture(tileGetTextureID(sourceactor->xspr.data2));
|
||||
|
||||
if (valueIsBetween(sourceactor->xspr.data3, -1, 32767))
|
||||
targSect->floorpal = uint8_t(sourceactor->xspr.data3);
|
||||
|
@ -7212,10 +7212,10 @@ void usePictureChanger(DBloodActor* sourceactor, int objType, sectortype* targSe
|
|||
break;
|
||||
case OBJ_WALL:
|
||||
if (valueIsBetween(sourceactor->xspr.data1, -1, 32767))
|
||||
targWall->wallpicnum = sourceactor->xspr.data1;
|
||||
targWall->setwalltexture(tileGetTextureID(sourceactor->xspr.data1));
|
||||
|
||||
if (valueIsBetween(sourceactor->xspr.data2, -1, 32767))
|
||||
targWall->overpicnum = sourceactor->xspr.data2;
|
||||
targWall->setovertexture(tileGetTextureID(sourceactor->xspr.data2));
|
||||
|
||||
if (valueIsBetween(sourceactor->xspr.data3, -1, 32767))
|
||||
targWall->pal = uint8_t(sourceactor->xspr.data3);
|
||||
|
|
|
@ -284,11 +284,11 @@ void DoSectorPanning(void)
|
|||
|
||||
if (pXSector->panFloor) // Floor
|
||||
{
|
||||
int nTile = pSector->floorpicnum;
|
||||
auto nTex = TexMan.GetGameTexture(pSector->floortexture());
|
||||
if (pSector->floorstat & CSTAT_SECTOR_ALIGN)
|
||||
angle -= DAngle90;
|
||||
int xBits = tileWidth(nTile) >> int((pSector->floorstat & CSTAT_SECTOR_TEXHALF) != 0);
|
||||
int yBits = tileHeight(nTile) >> int((pSector->floorstat & CSTAT_SECTOR_TEXHALF) != 0);
|
||||
int xBits = int(nTex->GetDisplayWidth()) >> int((pSector->floorstat & CSTAT_SECTOR_TEXHALF) != 0);
|
||||
int yBits = int(nTex->GetDisplayHeight()) >> int((pSector->floorstat & CSTAT_SECTOR_TEXHALF) != 0);
|
||||
double px = angle.Cos() * (speed << 2) / xBits;
|
||||
double py = angle.Sin() * (speed << 2) / xBits;
|
||||
pSector->addfloorxpan((float)px * (1.f / 256));
|
||||
|
@ -296,11 +296,11 @@ void DoSectorPanning(void)
|
|||
}
|
||||
if (pXSector->panCeiling) // Ceiling
|
||||
{
|
||||
int nTile = pSector->ceilingpicnum;
|
||||
auto nTex = TexMan.GetGameTexture(pSector->ceilingtexture());
|
||||
if (pSector->ceilingstat & CSTAT_SECTOR_ALIGN)
|
||||
angle -= DAngle90;
|
||||
int xBits = tileWidth(nTile) >> int((pSector->ceilingstat & CSTAT_SECTOR_TEXHALF) != 0);
|
||||
int yBits = tileHeight(nTile) >> int((pSector->ceilingstat & CSTAT_SECTOR_TEXHALF) != 0);
|
||||
int xBits = int(nTex->GetDisplayWidth()) >> int((pSector->ceilingstat & CSTAT_SECTOR_TEXHALF) != 0);
|
||||
int yBits = int(nTex->GetDisplayHeight()) >> int((pSector->ceilingstat & CSTAT_SECTOR_TEXHALF) != 0);
|
||||
double px = angle.Cos() * (speed << 2) / xBits;
|
||||
double py = angle.Sin() * (speed << 2) / xBits;
|
||||
pSector->addceilingxpan((float)px * (1.f / 256));
|
||||
|
|
|
@ -1074,8 +1074,8 @@ void DoSector(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
|||
else SetGameVarID(lVar2, sectp->floorstat, sActor, sPlayer);
|
||||
break;
|
||||
case SECTOR_CEILINGPICNUM:
|
||||
if (bSet) sectp->ceilingpicnum = lValue;
|
||||
else SetGameVarID(lVar2, sectp->legacyTileNum(sectortype::ceiling), sActor, sPlayer);
|
||||
if (bSet) sectp->setceilingtexture(tileGetTextureID(lValue));
|
||||
else SetGameVarID(lVar2, legacyTileNum(sectp->ceilingtexture()), sActor, sPlayer);
|
||||
break;
|
||||
case SECTOR_CEILINGSLOPE:
|
||||
if (bSet) sectp->setceilingslope(lValue);
|
||||
|
@ -1098,8 +1098,8 @@ void DoSector(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
|||
else SetGameVarID(lVar2, sectp->ceilingypan(), sActor, sPlayer);
|
||||
break;
|
||||
case SECTOR_FLOORPICNUM:
|
||||
if (bSet) sectp->floorpicnum = lValue;
|
||||
else SetGameVarID(lVar2, sectp->legacyTileNum(sectortype::ceiling), sActor, sPlayer);
|
||||
if (bSet) sectp->setfloortexture(tileGetTextureID(lValue));
|
||||
else SetGameVarID(lVar2, legacyTileNum(sectp->floortexture()), sActor, sPlayer);
|
||||
break;
|
||||
case SECTOR_FLOORSLOPE:
|
||||
if (bSet) sectp->setfloorslope(lValue);
|
||||
|
@ -3454,7 +3454,7 @@ int ParseState::parse(void)
|
|||
case concmd_gettexturefloor:
|
||||
{
|
||||
insptr++;
|
||||
SetGameVarID(g_iTextureID, g_ac->sector()->legacyTileNum(sectortype::ceiling), g_ac, g_p);
|
||||
SetGameVarID(g_iTextureID, legacyTileNum(g_ac->sector()->floortexture()), g_ac, g_p);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3591,7 +3591,7 @@ int ParseState::parse(void)
|
|||
case concmd_gettextureceiling:
|
||||
{
|
||||
insptr++;
|
||||
SetGameVarID(g_iTextureID, g_ac->sector()->legacyTileNum(sectortype::ceiling), g_ac, g_p);
|
||||
SetGameVarID(g_iTextureID, legacyTileNum(g_ac->sector()->ceilingtexture()), g_ac, g_p);
|
||||
break;
|
||||
}
|
||||
case concmd_ifvarvarand:
|
||||
|
|
Loading…
Reference in a new issue