Readability improvements for gamestructures.cpp

git-svn-id: https://svn.eduke32.com/eduke32@6854 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-04-23 06:36:08 +00:00
parent 21c9f6dd7e
commit e682986e69

View file

@ -159,16 +159,14 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int32_t const lParm2)
case USERDEFS_USEVOXELS: labelNum = usevoxels; break;
case USERDEFS_USEHIGHTILE:
#ifdef USE_OPENGL
labelNum = usehightile;
break;
labelNum = usehightile; break;
#endif
case USERDEFS_USEMODELS:
#ifdef USE_OPENGL
labelNum = usemodels;
labelNum = usemodels; break;
#else
labelNum = 0;
labelNum = 0; break;
#endif
break;
case USERDEFS_GAMETYPEFLAGS: labelNum = g_gametypeFlags[ud.coop]; break;
case USERDEFS_M_GAMETYPEFLAGS: labelNum = g_gametypeFlags[ud.m_coop]; break;
case USERDEFS_GLOBALFLAGS: labelNum = globalflags; break;
@ -354,8 +352,16 @@ void __fastcall VM_SetUserdef(int32_t const labelNum, int32_t const lParm2, int3
case USERDEFS_M_ORIGIN_Y: ud.returnvar[1] = iSet; break;
case USERDEFS_GLOBALFLAGS: globalflags = iSet; break;
case USERDEFS_GLOBALGAMEFLAGS: duke3d_globalflags = iSet; break;
case USERDEFS_VM_PLAYER: vm.playerNum = iSet; vm.pPlayer = g_player[iSet].ps; break;
case USERDEFS_VM_SPRITE: vm.spriteNum = iSet; vm.pSprite = &sprite[iSet]; vm.pActor = &actor[iSet]; vm.pData = &actor[iSet].t_data[0]; break;
case USERDEFS_VM_PLAYER:
vm.playerNum = iSet;
vm.pPlayer = g_player[iSet].ps;
break;
case USERDEFS_VM_SPRITE:
vm.spriteNum = iSet;
vm.pSprite = &sprite[iSet];
vm.pActor = &actor[iSet];
vm.pData = &actor[iSet].t_data[0];
break;
case USERDEFS_VM_DISTANCE: vm.playerDist = iSet; break;
case USERDEFS_GAMETEXT_TRACKING: MF_Bluefont.between.x = iSet; break;
case USERDEFS_MENUTEXT_TRACKING: MF_Redfont.between.x = iSet; break;
@ -851,8 +857,10 @@ void __fastcall VM_SetPlayer(int32_t const playerNum, int32_t const labelNum, in
case PLAYER_HOLSTER_WEAPON: ps->holster_weapon = iSet; break;
case PLAYER_FALLING_COUNTER: ps->falling_counter = iSet; break;
case PLAYER_GOTWEAPON:
if (iSet) ps->gotweapon |= (1 << lParm2);
else ps->gotweapon &= ~(1 << lParm2);
if (iSet)
ps->gotweapon |= (1 << lParm2);
else
ps->gotweapon &= ~(1 << lParm2);
break;
case PLAYER_REFRESH_INVENTORY: ps->refresh_inventory = iSet; break;
case PLAYER_PALETTE: P_SetGamePalette(ps, iSet, 2+16); break;
@ -1116,16 +1124,12 @@ void __fastcall VM_SetSector(int32_t const sectNum, int32_t const labelNum, int3
case SECTOR_CEILINGZVEL: pSector->extra = iSet;
if ((iSet = GetAnimationGoal(&pSector->ceilingz)) != -1)
case SECTOR_CEILINGZGOAL:
SetAnimation(sectNum, &pSector->ceilingz, iSet, pSector->extra);
break;
SetAnimation(sectNum, &pSector->ceilingz, iSet, pSector->extra); break;
case SECTOR_FLOORZ: pSector->floorz = iSet; break;
case SECTOR_FLOORZVEL: pSector->extra = iSet;
if ((iSet = GetAnimationGoal(&pSector->floorz)) != -1)
case SECTOR_FLOORZGOAL:
SetAnimation(sectNum, &pSector->floorz, iSet, pSector->extra);
break;
SetAnimation(sectNum, &pSector->floorz, iSet, pSector->extra); break;
case SECTOR_CEILINGSTAT: pSector->ceilingstat = iSet; break;
case SECTOR_FLOORSTAT: pSector->floorstat = iSet; break;
case SECTOR_CEILINGPICNUM: pSector->ceilingpicnum = iSet; break;
@ -1503,15 +1507,12 @@ int32_t __fastcall VM_GetTileData(int32_t const tileNum, int32_t labelNum)
{
case TILEDATA_XSIZE: labelNum = tilesiz[tileNum].x; break;
case TILEDATA_YSIZE: labelNum = tilesiz[tileNum].y; break;
case TILEDATA_ANIMFRAMES: labelNum = picanm[tileNum].num; break;
case TILEDATA_XOFFSET: labelNum = picanm[tileNum].xofs; break;
case TILEDATA_YOFFSET: labelNum = picanm[tileNum].yofs; break;
case TILEDATA_ANIMSPEED: labelNum = picanm[tileNum].sf & PICANM_ANIMSPEED_MASK; break;
case TILEDATA_ANIMTYPE: labelNum = (picanm[tileNum].sf & PICANM_ANIMTYPE_MASK) >> PICANM_ANIMTYPE_SHIFT; break;
case TILEDATA_GAMEFLAGS: labelNum = g_tile[tileNum].flags; break;
default: labelNum = -1; break;
}
@ -1536,7 +1537,6 @@ void __fastcall VM_SetTileData(int32_t const tileNum, int32_t labelNum, int32_t
case TILEDATA_YOFFSET: picanm[tileNum].yofs = iSet; break;
case TILEDATA_ANIMSPEED: picanm[tileNum].sf = (picanm[tileNum].sf & ~PICANM_ANIMSPEED_MASK) | (iSet & PICANM_ANIMSPEED_MASK); break;
case TILEDATA_ANIMTYPE: picanm[tileNum].sf = (picanm[tileNum].sf & ~PICANM_ANIMTYPE_MASK) | ((iSet << PICANM_ANIMTYPE_SHIFT) & PICANM_ANIMTYPE_MASK); break;
case TILEDATA_GAMEFLAGS: g_tile[tileNum].flags = iSet; break;
}
}