Potential CON performance improvements

git-svn-id: https://svn.eduke32.com/eduke32@6250 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2017-06-24 06:31:21 +00:00
parent e14d7d2786
commit bf944cf27a
4 changed files with 59 additions and 55 deletions

View file

@ -573,7 +573,7 @@ static FORCE_INLINE void yax_setnextwall(int16_t wal, int16_t cf, int16_t thenex
}
#endif
static FORCE_INLINE void sector_tracker_hook(uintptr_t address)
static FORCE_INLINE void sector_tracker_hook(uintptr_t const address)
{
uintptr_t const usector = address - (uintptr_t)sector;
@ -584,7 +584,7 @@ static FORCE_INLINE void sector_tracker_hook(uintptr_t address)
++sectorchanged[usector / sizeof(sectortype)];
}
static FORCE_INLINE void wall_tracker_hook(uintptr_t address)
static FORCE_INLINE void wall_tracker_hook(uintptr_t const address)
{
uintptr_t const uwall = address - (uintptr_t)wall;
@ -595,7 +595,7 @@ static FORCE_INLINE void wall_tracker_hook(uintptr_t address)
++wallchanged[uwall / sizeof(walltype)];
}
static FORCE_INLINE void sprite_tracker_hook(uintptr_t address)
static FORCE_INLINE void sprite_tracker_hook(uintptr_t const address)
{
uintptr_t const usprite = address - (uintptr_t)sprite;

View file

@ -171,7 +171,7 @@ const tokenmap_t altkeyw [] =
const char *keyw[] =
{
"definelevelname", // 0 defines level name
"else", // 0 used with if checks
"actor", // 1 defines an actor
"addammo", // 2 adds ammo to a weapon
"ifrnd", // 3 checks against a randomizer
@ -181,7 +181,7 @@ const char *keyw[] =
"action", // 7 defines an action if used outside a state or actor, otherwise triggers actor to perform action
"ifpdistl", // 8 checks if player distance is less than value
"ifpdistg", // 9 checks if player distance is more than value
"else", // 10 used with if checks
"definelevelname", // 10 defines level name
"strength", // 11 sets health
"break", // 12 stops processing
"shoot", // 13 shoots a projectile

View file

@ -733,7 +733,7 @@ enum IterationTypes_t
enum ScriptKeywords_t
{
CON_DEFINELEVELNAME, // 0
CON_ELSE, // 0
CON_ACTOR, // 1
CON_ADDAMMO, // 2
CON_IFRND, // 3
@ -743,7 +743,7 @@ enum ScriptKeywords_t
CON_ACTION, // 7
CON_IFPDISTL, // 8
CON_IFPDISTG, // 9
CON_ELSE, // 10
CON_DEFINELEVELNAME, // 10
CON_STRENGTH, // 11
CON_BREAK, // 12
CON_SHOOT, // 13

View file

@ -999,33 +999,35 @@ void __fastcall VM_SetSprite(int32_t const spriteNum, int32_t const labelNum, in
return;
}
spritetype * const pSprite = &sprite[spriteNum];
switch (labelNum)
{
case ACTOR_X: sprite[spriteNum].x = iSet; break;
case ACTOR_Y: sprite[spriteNum].y = iSet; break;
case ACTOR_Z: sprite[spriteNum].z = iSet; break;
case ACTOR_CSTAT: sprite[spriteNum].cstat = iSet; break;
case ACTOR_PICNUM: sprite[spriteNum].picnum = iSet; break;
case ACTOR_SHADE: sprite[spriteNum].shade = iSet; break;
case ACTOR_PAL: sprite[spriteNum].pal = iSet; break;
case ACTOR_CLIPDIST: sprite[spriteNum].clipdist = iSet; break;
case ACTOR_DETAIL: sprite[spriteNum].blend = iSet; break;
case ACTOR_XREPEAT: sprite[spriteNum].xrepeat = iSet; break;
case ACTOR_YREPEAT: sprite[spriteNum].yrepeat = iSet; break;
case ACTOR_XOFFSET: sprite[spriteNum].xoffset = iSet; break;
case ACTOR_YOFFSET: sprite[spriteNum].yoffset = iSet; break;
case ACTOR_X: pSprite->x = iSet; break;
case ACTOR_Y: pSprite->y = iSet; break;
case ACTOR_Z: pSprite->z = iSet; break;
case ACTOR_CSTAT: pSprite->cstat = iSet; break;
case ACTOR_PICNUM: pSprite->picnum = iSet; break;
case ACTOR_SHADE: pSprite->shade = iSet; break;
case ACTOR_PAL: pSprite->pal = iSet; break;
case ACTOR_CLIPDIST: pSprite->clipdist = iSet; break;
case ACTOR_DETAIL: pSprite->blend = iSet; break;
case ACTOR_XREPEAT: pSprite->xrepeat = iSet; break;
case ACTOR_YREPEAT: pSprite->yrepeat = iSet; break;
case ACTOR_XOFFSET: pSprite->xoffset = iSet; break;
case ACTOR_YOFFSET: pSprite->yoffset = iSet; break;
case ACTOR_SECTNUM: changespritesect(spriteNum, iSet); break;
case ACTOR_STATNUM: changespritestat(spriteNum, iSet); break;
case ACTOR_ANG: sprite[spriteNum].ang = iSet; break;
case ACTOR_OWNER: sprite[spriteNum].owner = iSet; break;
case ACTOR_XVEL: sprite[spriteNum].xvel = iSet; break;
case ACTOR_YVEL: sprite[spriteNum].yvel = iSet; break;
case ACTOR_ZVEL: sprite[spriteNum].zvel = iSet; break;
case ACTOR_LOTAG: sprite[spriteNum].lotag = (int16_t)iSet; break;
case ACTOR_HITAG: sprite[spriteNum].hitag = (int16_t)iSet; break;
case ACTOR_ULOTAG: sprite[spriteNum].lotag = iSet; break;
case ACTOR_UHITAG: sprite[spriteNum].hitag = iSet; break;
case ACTOR_EXTRA: sprite[spriteNum].extra = iSet; break;
case ACTOR_ANG: pSprite->ang = iSet; break;
case ACTOR_OWNER: pSprite->owner = iSet; break;
case ACTOR_XVEL: pSprite->xvel = iSet; break;
case ACTOR_YVEL: pSprite->yvel = iSet; break;
case ACTOR_ZVEL: pSprite->zvel = iSet; break;
case ACTOR_LOTAG: pSprite->lotag = (int16_t)iSet; break;
case ACTOR_HITAG: pSprite->hitag = (int16_t)iSet; break;
case ACTOR_ULOTAG: pSprite->lotag = iSet; break;
case ACTOR_UHITAG: pSprite->hitag = iSet; break;
case ACTOR_EXTRA: pSprite->extra = iSet; break;
case ACTOR_HTCGG: actor[spriteNum].cgg = iSet; break;
case ACTOR_HTPICNUM: actor[spriteNum].picnum = iSet; break;
case ACTOR_HTANG: actor[spriteNum].ang = iSet; break;
@ -1069,33 +1071,35 @@ int32_t __fastcall VM_GetSprite(int32_t const spriteNum, int32_t labelNum, int32
return -1;
}
uspritetype const * const pSprite = (uspritetype *)&sprite[spriteNum];
switch (labelNum)
{
case ACTOR_X: labelNum = sprite[spriteNum].x; break;
case ACTOR_Y: labelNum = sprite[spriteNum].y; break;
case ACTOR_Z: labelNum = sprite[spriteNum].z; break;
case ACTOR_CSTAT: labelNum = sprite[spriteNum].cstat; break;
case ACTOR_PICNUM: labelNum = sprite[spriteNum].picnum; break;
case ACTOR_SHADE: labelNum = sprite[spriteNum].shade; break;
case ACTOR_PAL: labelNum = sprite[spriteNum].pal; break;
case ACTOR_CLIPDIST: labelNum = sprite[spriteNum].clipdist; break;
case ACTOR_DETAIL: labelNum = sprite[spriteNum].blend; break;
case ACTOR_XREPEAT: labelNum = sprite[spriteNum].xrepeat; break;
case ACTOR_YREPEAT: labelNum = sprite[spriteNum].yrepeat; break;
case ACTOR_XOFFSET: labelNum = sprite[spriteNum].xoffset; break;
case ACTOR_YOFFSET: labelNum = sprite[spriteNum].yoffset; break;
case ACTOR_SECTNUM: labelNum = sprite[spriteNum].sectnum; break;
case ACTOR_STATNUM: labelNum = sprite[spriteNum].statnum; break;
case ACTOR_ANG: labelNum = sprite[spriteNum].ang; break;
case ACTOR_OWNER: labelNum = sprite[spriteNum].owner; break;
case ACTOR_XVEL: labelNum = sprite[spriteNum].xvel; break;
case ACTOR_YVEL: labelNum = sprite[spriteNum].yvel; break;
case ACTOR_ZVEL: labelNum = sprite[spriteNum].zvel; break;
case ACTOR_LOTAG: labelNum = (int16_t)sprite[spriteNum].lotag; break;
case ACTOR_HITAG: labelNum = (int16_t)sprite[spriteNum].hitag; break;
case ACTOR_ULOTAG: labelNum = sprite[spriteNum].lotag; break;
case ACTOR_UHITAG: labelNum = sprite[spriteNum].hitag; break;
case ACTOR_EXTRA: labelNum = sprite[spriteNum].extra; break;
case ACTOR_X: labelNum = pSprite->x; break;
case ACTOR_Y: labelNum = pSprite->y; break;
case ACTOR_Z: labelNum = pSprite->z; break;
case ACTOR_CSTAT: labelNum = pSprite->cstat; break;
case ACTOR_PICNUM: labelNum = pSprite->picnum; break;
case ACTOR_SHADE: labelNum = pSprite->shade; break;
case ACTOR_PAL: labelNum = pSprite->pal; break;
case ACTOR_CLIPDIST: labelNum = pSprite->clipdist; break;
case ACTOR_DETAIL: labelNum = pSprite->blend; break;
case ACTOR_XREPEAT: labelNum = pSprite->xrepeat; break;
case ACTOR_YREPEAT: labelNum = pSprite->yrepeat; break;
case ACTOR_XOFFSET: labelNum = pSprite->xoffset; break;
case ACTOR_YOFFSET: labelNum = pSprite->yoffset; break;
case ACTOR_SECTNUM: labelNum = pSprite->sectnum; break;
case ACTOR_STATNUM: labelNum = pSprite->statnum; break;
case ACTOR_ANG: labelNum = pSprite->ang; break;
case ACTOR_OWNER: labelNum = pSprite->owner; break;
case ACTOR_XVEL: labelNum = pSprite->xvel; break;
case ACTOR_YVEL: labelNum = pSprite->yvel; break;
case ACTOR_ZVEL: labelNum = pSprite->zvel; break;
case ACTOR_LOTAG: labelNum = (int16_t)pSprite->lotag; break;
case ACTOR_HITAG: labelNum = (int16_t)pSprite->hitag; break;
case ACTOR_ULOTAG: labelNum = pSprite->lotag; break;
case ACTOR_UHITAG: labelNum = pSprite->hitag; break;
case ACTOR_EXTRA: labelNum = pSprite->extra; break;
case ACTOR_HTCGG: labelNum = actor[spriteNum].cgg; break;
case ACTOR_HTPICNUM: labelNum = actor[spriteNum].picnum; break;
case ACTOR_HTANG: labelNum = actor[spriteNum].ang; break;