Add "ulotag" and "uhitag" to get/setactor/wall/sector, which exposes the tags unsigned, without the typecast to int16_t. This might be useful to someone.

git-svn-id: https://svn.eduke32.com/eduke32@3192 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2012-11-16 00:54:04 +00:00
parent 51382ab19c
commit ed464aaadc
3 changed files with 98 additions and 7 deletions

View file

@ -697,6 +697,8 @@ const memberlabel_t SectorLabels[]=
{ "extra", SECTOR_EXTRA, 0, 0 }, { "extra", SECTOR_EXTRA, 0, 0 },
{ "ceilingbunch", SECTOR_CEILINGBUNCH, 0, 0 }, { "ceilingbunch", SECTOR_CEILINGBUNCH, 0, 0 },
{ "floorbunch", SECTOR_FLOORBUNCH, 0, 0 }, { "floorbunch", SECTOR_FLOORBUNCH, 0, 0 },
{ "ulotag", SECTOR_ULOTAG, 0, 0 },
{ "uhitag", SECTOR_UHITAG, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST { "", -1, 0, 0 } // END OF LIST
}; };
@ -719,6 +721,8 @@ const memberlabel_t WallLabels[]=
{ "lotag", WALL_LOTAG, 0, 0 }, { "lotag", WALL_LOTAG, 0, 0 },
{ "hitag", WALL_HITAG, 0, 0 }, { "hitag", WALL_HITAG, 0, 0 },
{ "extra", WALL_EXTRA, 0, 0 }, { "extra", WALL_EXTRA, 0, 0 },
{ "ulotag", WALL_ULOTAG, 0, 0 },
{ "uhitag", WALL_UHITAG, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST { "", -1, 0, 0 } // END OF LIST
}; };
@ -785,6 +789,9 @@ const memberlabel_t ActorLabels[]=
{ "alpha", ACTOR_ALPHA, 0, 0 }, { "alpha", ACTOR_ALPHA, 0, 0 },
{ "ulotag", ACTOR_ULOTAG, 0, 0 },
{ "uhitag", ACTOR_UHITAG, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST { "", -1, 0, 0 } // END OF LIST
}; };

View file

@ -451,6 +451,8 @@ enum SectorLabel_t
SECTOR_EXTRA, SECTOR_EXTRA,
SECTOR_CEILINGBUNCH, SECTOR_CEILINGBUNCH,
SECTOR_FLOORBUNCH, SECTOR_FLOORBUNCH,
SECTOR_ULOTAG,
SECTOR_UHITAG,
SECTOR_END SECTOR_END
}; };
@ -473,6 +475,8 @@ enum WallLabel_t
WALL_LOTAG, WALL_LOTAG,
WALL_HITAG, WALL_HITAG,
WALL_EXTRA, WALL_EXTRA,
WALL_ULOTAG,
WALL_UHITAG,
WALL_END WALL_END
}; };
@ -530,6 +534,8 @@ enum ActorLabel_t
ACTOR_YPANNING, ACTOR_YPANNING,
ACTOR_HTFLAGS, ACTOR_HTFLAGS,
ACTOR_ALPHA, ACTOR_ALPHA,
ACTOR_ULOTAG,
ACTOR_UHITAG,
ACTOR_END ACTOR_END
}; };

View file

@ -2122,7 +2122,7 @@ static void __fastcall VM_AccessWall(int32_t iSet, int32_t lVar1, int32_t lLabel
case WALL_LOTAG: case WALL_LOTAG:
if (iSet) if (iSet)
{ {
wall[iWall].lotag=lValue; wall[iWall].lotag=(int16_t)lValue;
return; return;
} }
Gv_SetVarX(lVar2, (int16_t)wall[iWall].lotag); Gv_SetVarX(lVar2, (int16_t)wall[iWall].lotag);
@ -2131,12 +2131,30 @@ static void __fastcall VM_AccessWall(int32_t iSet, int32_t lVar1, int32_t lLabel
case WALL_HITAG: case WALL_HITAG:
if (iSet) if (iSet)
{ {
wall[iWall].hitag=lValue; wall[iWall].hitag=(int16_t)lValue;
return; return;
} }
Gv_SetVarX(lVar2, (int16_t)wall[iWall].hitag); Gv_SetVarX(lVar2, (int16_t)wall[iWall].hitag);
return; return;
case WALL_ULOTAG:
if (iSet)
{
wall[iWall].lotag=lValue;
return;
}
Gv_SetVarX(lVar2, wall[iWall].lotag);
return;
case WALL_UHITAG:
if (iSet)
{
wall[iWall].hitag=lValue;
return;
}
Gv_SetVarX(lVar2, wall[iWall].hitag);
return;
case WALL_EXTRA: case WALL_EXTRA:
if (iSet) if (iSet)
{ {
@ -2354,7 +2372,7 @@ static void __fastcall VM_AccessSector(int32_t iSet, int32_t lVar1, int32_t lLab
case SECTOR_LOTAG: case SECTOR_LOTAG:
if (iSet) if (iSet)
{ {
sector[iSector].lotag=lValue; sector[iSector].lotag=(int16_t)lValue;
return; return;
} }
Gv_SetVarX(lVar2, (int16_t)sector[iSector].lotag); Gv_SetVarX(lVar2, (int16_t)sector[iSector].lotag);
@ -2363,12 +2381,30 @@ static void __fastcall VM_AccessSector(int32_t iSet, int32_t lVar1, int32_t lLab
case SECTOR_HITAG: case SECTOR_HITAG:
if (iSet) if (iSet)
{ {
sector[iSector].hitag=lValue; sector[iSector].hitag=(int16_t)lValue;
return; return;
} }
Gv_SetVarX(lVar2, (int16_t)sector[iSector].hitag); Gv_SetVarX(lVar2, (int16_t)sector[iSector].hitag);
return; return;
case SECTOR_ULOTAG:
if (iSet)
{
sector[iSector].lotag=lValue;
return;
}
Gv_SetVarX(lVar2, sector[iSector].lotag);
return;
case SECTOR_UHITAG:
if (iSet)
{
sector[iSector].hitag=lValue;
return;
}
Gv_SetVarX(lVar2, sector[iSector].hitag);
return;
case SECTOR_EXTRA: case SECTOR_EXTRA:
if (iSet) if (iSet)
{ {
@ -2498,10 +2534,18 @@ static void __fastcall VM_SetSprite(int32_t lVar1, int32_t lLabelID, int32_t lVa
return; return;
case ACTOR_LOTAG: case ACTOR_LOTAG:
sprite[iActor].lotag=lVar1; sprite[iActor].lotag=(int16_t)lVar1;
return; return;
case ACTOR_HITAG: case ACTOR_HITAG:
sprite[iActor].hitag=(int16_t)lVar1;
return;
case ACTOR_ULOTAG:
sprite[iActor].lotag=lVar1;
return;
case ACTOR_UHITAG:
sprite[iActor].hitag=lVar1; sprite[iActor].hitag=lVar1;
return; return;
@ -2747,6 +2791,14 @@ static void __fastcall VM_GetSprite(int32_t lVar1, int32_t lLabelID, int32_t lVa
Gv_SetVarX(lVar2, (int16_t)sprite[iActor].hitag); Gv_SetVarX(lVar2, (int16_t)sprite[iActor].hitag);
return; return;
case ACTOR_ULOTAG:
Gv_SetVarX(lVar2, sprite[iActor].lotag);
return;
case ACTOR_UHITAG:
Gv_SetVarX(lVar2, sprite[iActor].hitag);
return;
case ACTOR_EXTRA: case ACTOR_EXTRA:
Gv_SetVarX(lVar2, sprite[iActor].extra); Gv_SetVarX(lVar2, sprite[iActor].extra);
return; return;
@ -3089,7 +3141,7 @@ static void __fastcall VM_AccessTsprite(int32_t iSet, int32_t lVar1, int32_t lLa
case ACTOR_LOTAG: case ACTOR_LOTAG:
if (iSet) if (iSet)
{ {
spriteext[iActor].tspr->lotag=lValue; spriteext[iActor].tspr->lotag=(int16_t)lValue;
return; return;
} }
Gv_SetVarX(lVar2, (int16_t)spriteext[iActor].tspr->lotag); Gv_SetVarX(lVar2, (int16_t)spriteext[iActor].tspr->lotag);
@ -3098,12 +3150,30 @@ static void __fastcall VM_AccessTsprite(int32_t iSet, int32_t lVar1, int32_t lLa
case ACTOR_HITAG: case ACTOR_HITAG:
if (iSet) if (iSet)
{ {
spriteext[iActor].tspr->hitag=lValue; spriteext[iActor].tspr->hitag=(int16_t)lValue;
return; return;
} }
Gv_SetVarX(lVar2, (int16_t)spriteext[iActor].tspr->hitag); Gv_SetVarX(lVar2, (int16_t)spriteext[iActor].tspr->hitag);
return; return;
case ACTOR_ULOTAG:
if (iSet)
{
spriteext[iActor].tspr->lotag=lValue;
return;
}
Gv_SetVarX(lVar2, spriteext[iActor].tspr->lotag);
return;
case ACTOR_UHITAG:
if (iSet)
{
spriteext[iActor].tspr->hitag=lValue;
return;
}
Gv_SetVarX(lVar2, spriteext[iActor].tspr->hitag);
return;
case ACTOR_EXTRA: case ACTOR_EXTRA:
if (iSet) if (iSet)
{ {
@ -3431,6 +3501,8 @@ static int32_t __fastcall VM_AccessSpriteX(int32_t iActor, int32_t lLabelID, int
case ACTOR_ZVEL: return sprite[iActor].zvel; case ACTOR_ZVEL: return sprite[iActor].zvel;
case ACTOR_LOTAG: return (int16_t)sprite[iActor].lotag; case ACTOR_LOTAG: return (int16_t)sprite[iActor].lotag;
case ACTOR_HITAG: return (int16_t)sprite[iActor].hitag; case ACTOR_HITAG: return (int16_t)sprite[iActor].hitag;
case ACTOR_ULOTAG: return sprite[iActor].lotag;
case ACTOR_UHITAG: return sprite[iActor].hitag;
case ACTOR_EXTRA: return sprite[iActor].extra; case ACTOR_EXTRA: return sprite[iActor].extra;
case ACTOR_HTCGG: return actor[iActor].cgg; case ACTOR_HTCGG: return actor[iActor].cgg;
case ACTOR_HTPICNUM : return actor[iActor].picnum; case ACTOR_HTPICNUM : return actor[iActor].picnum;
@ -3496,6 +3568,8 @@ static int32_t __fastcall VM_AccessSectorX(int32_t iSector, int32_t lLabelID)
case SECTOR_ALIGNTO: return sector[iSector].filler; case SECTOR_ALIGNTO: return sector[iSector].filler;
case SECTOR_LOTAG: return (int16_t)sector[iSector].lotag; case SECTOR_LOTAG: return (int16_t)sector[iSector].lotag;
case SECTOR_HITAG: return (int16_t)sector[iSector].hitag; case SECTOR_HITAG: return (int16_t)sector[iSector].hitag;
case SECTOR_ULOTAG: return sector[iSector].lotag;
case SECTOR_UHITAG: return sector[iSector].hitag;
case SECTOR_EXTRA: return sector[iSector].extra; case SECTOR_EXTRA: return sector[iSector].extra;
case SECTOR_CEILINGBUNCH: case SECTOR_CEILINGBUNCH:
case SECTOR_FLOORBUNCH: case SECTOR_FLOORBUNCH:
@ -3864,6 +3938,10 @@ static int32_t __fastcall VM_AccessWallX(int32_t iWall, int32_t lLabelID)
return (int16_t)wall[iWall].lotag; return (int16_t)wall[iWall].lotag;
case WALL_HITAG: case WALL_HITAG:
return (int16_t)wall[iWall].hitag; return (int16_t)wall[iWall].hitag;
case WALL_ULOTAG:
return wall[iWall].lotag;
case WALL_UHITAG:
return wall[iWall].hitag;
case WALL_EXTRA: case WALL_EXTRA:
return wall[iWall].extra; return wall[iWall].extra;
default: default: