mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 21:31:03 +00:00
Duke3D: Promote look_ang to Q16.16.
This commit is contained in:
parent
ac4b33a770
commit
de0cc8f164
8 changed files with 63 additions and 58 deletions
|
@ -732,13 +732,13 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
|
|||
{
|
||||
CAMERA(q16ang) = pPlayer->oq16ang
|
||||
+ mulscale16(((pPlayer->q16ang + F16(1024) - pPlayer->oq16ang) & 0x7FFFFFF) - F16(1024), smoothRatio)
|
||||
+ fix16_from_int(pPlayer->look_ang);
|
||||
+ pPlayer->q16look_ang;
|
||||
CAMERA(q16horiz) = pPlayer->oq16horiz + pPlayer->oq16horizoff
|
||||
+ mulscale16((pPlayer->q16horiz + pPlayer->q16horizoff - pPlayer->oq16horiz - pPlayer->oq16horizoff), smoothRatio);
|
||||
}
|
||||
else
|
||||
{
|
||||
CAMERA(q16ang) = pPlayer->q16ang + fix16_from_int(pPlayer->look_ang);
|
||||
CAMERA(q16ang) = pPlayer->q16ang + pPlayer->q16look_ang;
|
||||
CAMERA(q16horiz) = pPlayer->q16horiz + pPlayer->q16horizoff;
|
||||
}
|
||||
|
||||
|
@ -769,7 +769,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
|
|||
|
||||
// looking through viewscreen
|
||||
CAMERA(pos) = camVect;
|
||||
CAMERA(q16ang) = pPlayer->q16ang + fix16_from_int(pPlayer->look_ang);
|
||||
CAMERA(q16ang) = pPlayer->q16ang + pPlayer->q16look_ang;
|
||||
CAMERA(q16horiz) = fix16_from_int(100 + sprite[pPlayer->newowner].shade);
|
||||
CAMERA(sect) = sprite[pPlayer->newowner].sectnum;
|
||||
}
|
||||
|
|
|
@ -288,6 +288,7 @@ enum PlayerLabel_t
|
|||
PLAYER_Q16ANGVEL,
|
||||
PLAYER_CURSECTNUM,
|
||||
PLAYER_LOOK_ANG,
|
||||
PLAYER_Q16LOOK_ANG,
|
||||
PLAYER_LAST_EXTRA,
|
||||
PLAYER_SUBWEAPON,
|
||||
PLAYER_AMMO_AMOUNT,
|
||||
|
|
|
@ -296,7 +296,7 @@ GAMEEXEC_STATIC GAMEEXEC_INLINE void P_ForceAngle(DukePlayer_t *pPlayer)
|
|||
pPlayer->q16horiz += F16(64);
|
||||
pPlayer->return_to_center = 9;
|
||||
pPlayer->q16rotscrnang = fix16_from_int(nAngle >> 1);
|
||||
pPlayer->look_ang = fix16_to_int(pPlayer->q16rotscrnang);
|
||||
pPlayer->q16look_ang = pPlayer->q16rotscrnang;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -420,6 +420,7 @@ memberlabel_t const PlayerLabels[]=
|
|||
{ "q16angvel", PLAYER_Q16ANGVEL, 0, 0, -1 },
|
||||
{ "cursectnum", PLAYER_CURSECTNUM, 0, 0, -1 },
|
||||
{ "look_ang", PLAYER_LOOK_ANG, 0, 0, -1 },
|
||||
{ "q16look_ang", PLAYER_Q16LOOK_ANG, 0, 0, -1 },
|
||||
{ "last_extra", PLAYER_LAST_EXTRA, 0, 0, -1 },
|
||||
{ "subweapon", PLAYER_SUBWEAPON, 0, 0, -1 },
|
||||
{ "ammo_amount", PLAYER_AMMO_AMOUNT, LABEL_HASPARM2, MAX_WEAPONS, -1 },
|
||||
|
@ -561,6 +562,7 @@ int32_t __fastcall VM_GetPlayer(int const playerNum, int32_t labelNum, int const
|
|||
case PLAYER_OHORIZOFF: labelNum = fix16_to_int(ps.oq16horizoff); break;
|
||||
case PLAYER_ROTSCRNANG: labelNum = fix16_to_int(ps.q16rotscrnang); break;
|
||||
case PLAYER_OROTSCRNANG: labelNum = fix16_to_int(ps.oq16rotscrnang); break;
|
||||
case PLAYER_LOOK_ANG: labelNum = fix16_to_int(ps.q16look_ang); break;
|
||||
|
||||
case PLAYER_Q16ANG: labelNum = ps.q16ang; break;
|
||||
case PLAYER_OQ16ANG: labelNum = ps.oq16ang; break;
|
||||
|
@ -571,6 +573,7 @@ int32_t __fastcall VM_GetPlayer(int const playerNum, int32_t labelNum, int const
|
|||
case PLAYER_OQ16HORIZOFF: labelNum = ps.oq16horizoff; break;
|
||||
case PLAYER_Q16ROTSCRNANG: labelNum = ps.q16rotscrnang; break;
|
||||
case PLAYER_OQ16ROTSCRNANG: labelNum = ps.oq16rotscrnang; break;
|
||||
case PLAYER_Q16LOOK_ANG: labelNum = ps.q16look_ang; break;
|
||||
|
||||
case PLAYER_ACCESS_INCS: labelNum = ps.access_incs; break;
|
||||
case PLAYER_ACCESS_SPRITENUM: labelNum = ps.access_spritenum; break;
|
||||
|
@ -636,7 +639,6 @@ int32_t __fastcall VM_GetPlayer(int const playerNum, int32_t labelNum, int const
|
|||
case PLAYER_LOOGCNT: labelNum = ps.loogcnt; break;
|
||||
case PLAYER_LOOGIEX: labelNum = ps.loogiex[lParm2]; break;
|
||||
case PLAYER_LOOGIEY: labelNum = ps.loogiey[lParm2]; break;
|
||||
case PLAYER_LOOK_ANG: labelNum = ps.look_ang; break;
|
||||
case PLAYER_MAX_ACTORS_KILLED: labelNum = ps.max_actors_killed; break;
|
||||
case PLAYER_MAX_PLAYER_HEALTH: labelNum = ps.max_player_health; break;
|
||||
case PLAYER_MAX_SECRET_ROOMS: labelNum = ps.max_secret_rooms; break;
|
||||
|
@ -758,6 +760,7 @@ void __fastcall VM_SetPlayer(int const playerNum, int const labelNum, int const
|
|||
case PLAYER_HORIZOFF: ps.q16horizoff = fix16_from_int(newValue); break;
|
||||
case PLAYER_ROTSCRNANG: ps.q16rotscrnang = fix16_from_int(newValue); break;
|
||||
case PLAYER_OROTSCRNANG: ps.oq16rotscrnang = fix16_from_int(newValue); break;
|
||||
case PLAYER_LOOK_ANG: ps.q16look_ang = fix16_from_int(newValue); break;
|
||||
|
||||
case PLAYER_Q16HORIZ: ps.q16horiz = newValue; break;
|
||||
case PLAYER_OQ16HORIZ: ps.oq16horiz = newValue; break;
|
||||
|
@ -768,6 +771,7 @@ void __fastcall VM_SetPlayer(int const playerNum, int const labelNum, int const
|
|||
case PLAYER_Q16HORIZOFF: ps.q16horizoff = newValue; break;
|
||||
case PLAYER_Q16ROTSCRNANG: ps.q16rotscrnang = newValue; break;
|
||||
case PLAYER_OQ16ROTSCRNANG: ps.oq16rotscrnang = newValue; break;
|
||||
case PLAYER_Q16LOOK_ANG: ps.q16look_ang = newValue; break;
|
||||
|
||||
case PLAYER_ACCESS_INCS: ps.access_incs = newValue; break;
|
||||
case PLAYER_ACCESS_SPRITENUM: ps.access_spritenum = newValue; break;
|
||||
|
@ -829,7 +833,6 @@ void __fastcall VM_SetPlayer(int const playerNum, int const labelNum, int const
|
|||
case PLAYER_LOOGCNT: ps.loogcnt = newValue; break;
|
||||
case PLAYER_LOOGIEX: ps.loogiex[lParm2] = newValue; break;
|
||||
case PLAYER_LOOGIEY: ps.loogiey[lParm2] = newValue; break;
|
||||
case PLAYER_LOOK_ANG: ps.look_ang = newValue; break;
|
||||
case PLAYER_MAX_ACTORS_KILLED: ps.max_actors_killed = newValue; break;
|
||||
case PLAYER_MAX_PLAYER_HEALTH: ps.max_player_health = newValue; break;
|
||||
case PLAYER_MAX_SECRET_ROOMS: ps.max_secret_rooms = newValue; break;
|
||||
|
|
|
@ -1841,7 +1841,7 @@ static int P_DisplayFist(int const fistShade)
|
|||
case -1: return 0;
|
||||
}
|
||||
|
||||
int const fistY = klabs(pPlayer->look_ang) / 9;
|
||||
int const fistY = klabs(fix16_to_int(pPlayer->q16look_ang)) / 9;
|
||||
int const fistZoom = clamp(65536 - (sintable[(512 + (fistInc << 6)) & 2047] << 2), 40920, 90612);
|
||||
int const fistYOffset = 194 + (sintable[((6 + fistInc) << 7) & 2047] >> 9);
|
||||
int const fistPal = P_GetHudPal(pPlayer);
|
||||
|
@ -2000,10 +2000,10 @@ static int P_DisplayKnee(int kneeShade)
|
|||
if (ps->knee_incs >= ARRAY_SIZE(knee_y) || sprite[ps->i].extra <= 0)
|
||||
return 0;
|
||||
|
||||
int const kneeY = knee_y[ps->knee_incs] + (klabs(ps->look_ang) / 9) - (ps->hard_landing << 3);
|
||||
int const kneeY = knee_y[ps->knee_incs] + (klabs(fix16_to_int(ps->q16look_ang)) / 9) - (ps->hard_landing << 3);
|
||||
int const kneePal = P_GetKneePal(ps);
|
||||
|
||||
G_DrawTileScaled(105+(fix16_to_int(g_player[screenpeek].input->q16avel)>>5)-(ps->look_ang>>1)+(knee_y[ps->knee_incs]>>2),
|
||||
G_DrawTileScaled(105+(fix16_to_int(g_player[screenpeek].input->q16avel)>>5)-(fix16_to_int(ps->q16look_ang)>>1)+(knee_y[ps->knee_incs]>>2),
|
||||
kneeY+280-(fix16_to_int(ps->q16horiz-ps->q16horizoff)>>4),KNEE,kneeShade,4+DRAWEAP_CENTER,kneePal);
|
||||
|
||||
return 1;
|
||||
|
@ -2030,10 +2030,10 @@ static int P_DisplayKnuckles(int knuckleShade)
|
|||
if ((unsigned) (pPlayer->knuckle_incs>>1) >= ARRAY_SIZE(knuckleFrames) || sprite[pPlayer->i].extra <= 0)
|
||||
return 0;
|
||||
|
||||
int const knuckleY = (klabs(pPlayer->look_ang) / 9) - (pPlayer->hard_landing << 3);
|
||||
int const knuckleY = (klabs(fix16_to_int(pPlayer->q16look_ang)) / 9) - (pPlayer->hard_landing << 3);
|
||||
int const knucklePal = P_GetHudPal(pPlayer);
|
||||
|
||||
G_DrawTileScaled(160 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (pPlayer->look_ang >> 1),
|
||||
G_DrawTileScaled(160 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (fix16_to_int(pPlayer->q16look_ang) >> 1),
|
||||
knuckleY + 180 - (fix16_to_int(pPlayer->q16horiz - pPlayer->q16horizoff) >> 4),
|
||||
CRACKKNUCKLES + knuckleFrames[pPlayer->knuckle_incs >> 1], knuckleShade, 4 + DRAWEAP_CENTER,
|
||||
knucklePal);
|
||||
|
@ -2199,13 +2199,13 @@ static int P_DisplayTip(int tipShade)
|
|||
if ((unsigned)pPlayer->tipincs >= ARRAY_SIZE(access_tip_y))
|
||||
return 1;
|
||||
|
||||
int const tipY = (klabs(pPlayer->look_ang) / 9) - (pPlayer->hard_landing << 3);
|
||||
int const tipY = (klabs(fix16_to_int(pPlayer->q16look_ang)) / 9) - (pPlayer->hard_landing << 3);
|
||||
int const tipPal = P_GetHudPal(pPlayer);
|
||||
int const tipYOffset = access_tip_y[pPlayer->tipincs] >> 1;
|
||||
|
||||
guniqhudid = 201;
|
||||
|
||||
G_DrawTileScaled(170 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (pPlayer->look_ang >> 1),
|
||||
G_DrawTileScaled(170 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (fix16_to_int(pPlayer->q16look_ang) >> 1),
|
||||
tipYOffset + tipY + 240 - (fix16_to_int(pPlayer->q16horiz - pPlayer->q16horizoff) >> 4),
|
||||
TIP + ((26 - pPlayer->tipincs) >> 4), tipShade, DRAWEAP_CENTER, tipPal);
|
||||
|
||||
|
@ -2231,20 +2231,20 @@ static int P_DisplayAccess(int accessShade)
|
|||
return 1;
|
||||
|
||||
int const accessX = access_tip_y[pSprite->access_incs] >> 2;
|
||||
int const accessY = access_tip_y[pSprite->access_incs] + (klabs(pSprite->look_ang) / 9) - (pSprite->hard_landing << 3);
|
||||
int const accessY = access_tip_y[pSprite->access_incs] + (klabs(fix16_to_int(pSprite->q16look_ang)) / 9) - (pSprite->hard_landing << 3);
|
||||
int const accessPal = (pSprite->access_spritenum >= 0) ? sprite[pSprite->access_spritenum].pal : 0;
|
||||
|
||||
guniqhudid = 200;
|
||||
|
||||
if ((pSprite->access_incs - 3) > 0 && (pSprite->access_incs - 3) >> 3)
|
||||
{
|
||||
G_DrawTileScaled(170 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (pSprite->look_ang >> 1) + accessX,
|
||||
G_DrawTileScaled(170 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (fix16_to_int(pSprite->q16look_ang) >> 1) + accessX,
|
||||
accessY + 266 - (fix16_to_int(pSprite->q16horiz - pSprite->q16horizoff) >> 4),
|
||||
HANDHOLDINGLASER + (pSprite->access_incs >> 3), accessShade, DRAWEAP_CENTER, accessPal);
|
||||
}
|
||||
else
|
||||
{
|
||||
G_DrawTileScaled(170 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (pSprite->look_ang >> 1) + accessX,
|
||||
G_DrawTileScaled(170 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (fix16_to_int(pSprite->q16look_ang) >> 1) + accessX,
|
||||
accessY + 266 - (fix16_to_int(pSprite->q16horiz - pSprite->q16horizoff) >> 4), HANDHOLDINGACCESS, accessShade,
|
||||
4 + DRAWEAP_CENTER, accessPal);
|
||||
}
|
||||
|
@ -2270,7 +2270,7 @@ void P_DisplayWeapon(void)
|
|||
return;
|
||||
|
||||
int weaponX = (160) - 90;
|
||||
int weaponY = klabs(pPlayer->look_ang) / 9;
|
||||
int weaponY = klabs(fix16_to_int(pPlayer->q16look_ang)) / 9;
|
||||
int weaponYOffset = 80 - (pPlayer->weapon_pos * pPlayer->weapon_pos);
|
||||
int weaponShade = sprite[pPlayer->i].shade <= 24 ? sprite[pPlayer->i].shade : 24;
|
||||
|
||||
|
@ -2300,7 +2300,7 @@ void P_DisplayWeapon(void)
|
|||
hudweap.gunposx = weaponX;
|
||||
hudweap.shade = weaponShade;
|
||||
hudweap.count = *weaponFrame;
|
||||
hudweap.lookhalfang = pPlayer->look_ang >> 1;
|
||||
hudweap.lookhalfang = fix16_to_int(pPlayer->q16look_ang) >> 1;
|
||||
|
||||
if (VM_OnEvent(EVENT_DISPLAYWEAPON, pPlayer->i, screenpeek) == 0)
|
||||
{
|
||||
|
@ -2314,10 +2314,10 @@ void P_DisplayWeapon(void)
|
|||
guniqhudid = 100;
|
||||
|
||||
if (quickKickFrame < 6 || quickKickFrame > 12)
|
||||
G_DrawTileScaled(weaponX + 80 - (pPlayer->look_ang >> 1), weaponY + 250 - weaponYOffset, KNEE, weaponShade,
|
||||
G_DrawTileScaled(weaponX + 80 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 250 - weaponYOffset, KNEE, weaponShade,
|
||||
weaponBits | 4 | DRAWEAP_CENTER, weaponPal);
|
||||
else
|
||||
G_DrawTileScaled(weaponX + 160 - 16 - (pPlayer->look_ang >> 1), weaponY + 214 - weaponYOffset, KNEE + 1,
|
||||
G_DrawTileScaled(weaponX + 160 - 16 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 214 - weaponYOffset, KNEE + 1,
|
||||
weaponShade, weaponBits | 4 | DRAWEAP_CENTER, weaponPal);
|
||||
guniqhudid = 0;
|
||||
}
|
||||
|
@ -2337,10 +2337,10 @@ void P_DisplayWeapon(void)
|
|||
|
||||
currentWeapon = weaponX;
|
||||
weaponX += sintable[(fistPos)&2047] >> 10;
|
||||
G_DrawTileScaled(weaponX + 250 - (pPlayer->look_ang >> 1), weaponY + 258 - (klabs(sintable[(fistPos)&2047] >> 8)),
|
||||
G_DrawTileScaled(weaponX + 250 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 258 - (klabs(sintable[(fistPos)&2047] >> 8)),
|
||||
FIST, weaponShade, weaponBits, weaponPal);
|
||||
weaponX = currentWeapon - (sintable[(fistPos)&2047] >> 10);
|
||||
G_DrawTileScaled(weaponX + 40 - (pPlayer->look_ang >> 1), weaponY + 200 + (klabs(sintable[(fistPos)&2047] >> 8)), FIST,
|
||||
G_DrawTileScaled(weaponX + 40 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 200 + (klabs(sintable[(fistPos)&2047] >> 8)), FIST,
|
||||
weaponShade, weaponBits | 4, weaponPal);
|
||||
}
|
||||
else
|
||||
|
@ -2364,7 +2364,7 @@ void P_DisplayWeapon(void)
|
|||
|
||||
#ifndef EDUKE32_STANDALONE
|
||||
int const doAnim = !(sprite[pPlayer->i].pal == 1 || ud.pause_on || g_player[myconnectindex].ps->gm & MODE_MENU);
|
||||
int const halfLookAng = pPlayer->look_ang >> 1;
|
||||
int const halfLookAng = fix16_to_int(pPlayer->q16look_ang) >> 1;
|
||||
|
||||
int const weaponPal = P_GetHudPal(pPlayer);
|
||||
|
||||
|
@ -2628,7 +2628,7 @@ void P_DisplayWeapon(void)
|
|||
switch (*weaponFrame)
|
||||
{
|
||||
case 0:
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (pPlayer->look_ang >> 1), weaponY + 233 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 233 - weaponYOffset,
|
||||
CHAINGUN + 1, weaponShade, weaponBits, weaponPal);
|
||||
break;
|
||||
|
||||
|
@ -2637,11 +2637,11 @@ void P_DisplayWeapon(void)
|
|||
*weaponFrame < PWEAPON(screenpeek, CHAINGUN_WEAPON, TotalTime))
|
||||
{
|
||||
int randomOffset = doAnim ? rand()&7 : 0;
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, randomOffset + weaponX - 4 + 140 - (pPlayer->look_ang >> 1),
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, randomOffset + weaponX - 4 + 140 - (fix16_to_int(pPlayer->q16look_ang) >> 1),
|
||||
randomOffset + weaponY - ((*weaponFrame) >> 1) + 208 - weaponYOffset,
|
||||
CHAINGUN + 5 + ((*weaponFrame - 4) / 5), weaponShade, weaponBits, weaponPal);
|
||||
if (doAnim) randomOffset = rand()&7;
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, randomOffset + weaponX - 4 + 184 - (pPlayer->look_ang >> 1),
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, randomOffset + weaponX - 4 + 184 - (fix16_to_int(pPlayer->q16look_ang) >> 1),
|
||||
randomOffset + weaponY - ((*weaponFrame) >> 1) + 208 - weaponYOffset,
|
||||
CHAINGUN + 5 + ((*weaponFrame - 4) / 5), weaponShade, weaponBits, weaponPal);
|
||||
}
|
||||
|
@ -2649,20 +2649,20 @@ void P_DisplayWeapon(void)
|
|||
if (*weaponFrame < PWEAPON(screenpeek, CHAINGUN_WEAPON, TotalTime)-4)
|
||||
{
|
||||
int const randomOffset = doAnim ? rand()&7 : 0;
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, randomOffset + weaponX - 4 + 162 - (pPlayer->look_ang >> 1),
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, randomOffset + weaponX - 4 + 162 - (fix16_to_int(pPlayer->q16look_ang) >> 1),
|
||||
randomOffset + weaponY - ((*weaponFrame) >> 1) + 208 - weaponYOffset,
|
||||
CHAINGUN + 5 + ((*weaponFrame - 2) / 5), weaponShade, weaponBits, weaponPal);
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (pPlayer->look_ang >> 1), weaponY + 233 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 233 - weaponYOffset,
|
||||
CHAINGUN + 1 + ((*weaponFrame) >> 1), weaponShade, weaponBits, weaponPal);
|
||||
}
|
||||
else
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (pPlayer->look_ang >> 1), weaponY + 233 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 233 - weaponYOffset,
|
||||
CHAINGUN + 1, weaponShade, weaponBits, weaponPal);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 168 - (pPlayer->look_ang >> 1), weaponY + 260 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 168 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 260 - weaponYOffset,
|
||||
CHAINGUN, weaponShade, weaponBits, weaponPal);
|
||||
break;
|
||||
|
||||
|
@ -2676,7 +2676,7 @@ void P_DisplayWeapon(void)
|
|||
if ((*weaponFrame) == PWEAPON(screenpeek, PISTOL_WEAPON, FireDelay))
|
||||
pistolOffset -= 3;
|
||||
|
||||
G_DrawWeaponTileWithID(currentWeapon, (pistolOffset - (pPlayer->look_ang >> 1)), (weaponY + 244 - weaponYOffset),
|
||||
G_DrawWeaponTileWithID(currentWeapon, (pistolOffset - (fix16_to_int(pPlayer->q16look_ang) >> 1)), (weaponY + 244 - weaponYOffset),
|
||||
FIRSTGUN + pistolFrames[*weaponFrame > 2 ? 0 : *weaponFrame], weaponShade, 2,
|
||||
weaponPal);
|
||||
|
||||
|
@ -2689,41 +2689,41 @@ void P_DisplayWeapon(void)
|
|||
int32_t const FIRSTGUN_5 = WORLDTOUR ? FIRSTGUNRELOADWIDE : FIRSTGUN + 5;
|
||||
|
||||
if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - (NAM_WW2GI ? 40 : 17))
|
||||
G_DrawWeaponTileWithID(currentWeapon, 194 - (pPlayer->look_ang >> 1), weaponY + 230 - weaponYOffset, FIRSTGUN + 4,
|
||||
G_DrawWeaponTileWithID(currentWeapon, 194 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 230 - weaponYOffset, FIRSTGUN + 4,
|
||||
weaponShade, weaponBits, weaponPal);
|
||||
else if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - (NAM_WW2GI ? 35 : 12))
|
||||
{
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, 244 - ((*weaponFrame) << 3) - (pPlayer->look_ang >> 1),
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, 244 - ((*weaponFrame) << 3) - (fix16_to_int(pPlayer->q16look_ang) >> 1),
|
||||
weaponY + 130 - weaponYOffset + ((*weaponFrame) << 4), FIRSTGUN + 6, weaponShade,
|
||||
weaponBits, weaponPal);
|
||||
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN_5,
|
||||
G_DrawWeaponTileWithID(currentWeapon, 224 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN_5,
|
||||
weaponShade, weaponBits, weaponPal);
|
||||
}
|
||||
else if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - (NAM_WW2GI ? 30 : 7))
|
||||
{
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, 124 + ((*weaponFrame) << 1) - (pPlayer->look_ang >> 1),
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, 124 + ((*weaponFrame) << 1) - (fix16_to_int(pPlayer->q16look_ang) >> 1),
|
||||
weaponY + 430 - weaponYOffset - ((*weaponFrame) << 3), FIRSTGUN + 6, weaponShade,
|
||||
weaponBits, weaponPal);
|
||||
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN_5,
|
||||
G_DrawWeaponTileWithID(currentWeapon, 224 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN_5,
|
||||
weaponShade, weaponBits, weaponPal);
|
||||
}
|
||||
|
||||
else if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - (NAM_WW2GI ? 12 : 4))
|
||||
{
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, 184 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, 184 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 235 - weaponYOffset,
|
||||
FIRSTGUN + 8, weaponShade, weaponBits, weaponPal);
|
||||
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 210 - weaponYOffset, FIRSTGUN_5,
|
||||
G_DrawWeaponTileWithID(currentWeapon, 224 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 210 - weaponYOffset, FIRSTGUN_5,
|
||||
weaponShade, weaponBits, weaponPal);
|
||||
}
|
||||
else if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - (NAM_WW2GI ? 6 : 2))
|
||||
{
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, 164 - (pPlayer->look_ang >> 1), weaponY + 245 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon << 2, 164 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 245 - weaponYOffset,
|
||||
FIRSTGUN + 8, weaponShade, weaponBits, weaponPal);
|
||||
G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN_5,
|
||||
G_DrawWeaponTileWithID(currentWeapon, 224 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 220 - weaponYOffset, FIRSTGUN_5,
|
||||
weaponShade, weaponBits, weaponPal);
|
||||
}
|
||||
else if ((*weaponFrame) < PWEAPON(screenpeek, PISTOL_WEAPON, Reload))
|
||||
G_DrawWeaponTileWithID(currentWeapon, 194 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset, FIRSTGUN_5,
|
||||
G_DrawWeaponTileWithID(currentWeapon, 194 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 235 - weaponYOffset, FIRSTGUN_5,
|
||||
weaponShade, weaponBits, weaponPal);
|
||||
|
||||
break;
|
||||
|
@ -2891,13 +2891,13 @@ void P_DisplayWeapon(void)
|
|||
weaponY += rand() & 3;
|
||||
}
|
||||
weaponYOffset -= 16;
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 261 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 210 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 261 - weaponYOffset,
|
||||
WORLDTOUR ? FREEZEFIREWIDE : FREEZE + 2, -32, weaponBits, weaponPal);
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 235 - weaponYOffset,
|
||||
FREEZE + 3 + freezerFrames[*weaponFrame % 6], -32, weaponBits, weaponPal);
|
||||
}
|
||||
else
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 261 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 261 - weaponYOffset,
|
||||
WT_WIDE(FREEZE), weaponShade, weaponBits, weaponPal);
|
||||
break;
|
||||
|
||||
|
@ -2912,16 +2912,16 @@ void P_DisplayWeapon(void)
|
|||
weaponY += rand() & 1;
|
||||
}
|
||||
weaponYOffset -= 16;
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 261 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 210 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 261 - weaponYOffset,
|
||||
FLAMETHROWERFIRE, -32, weaponBits, weaponPal);
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 235 - weaponYOffset,
|
||||
FLAMETHROWERFIRE + 1 + freezerFrames[*weaponFrame % 6], -32, weaponBits, weaponPal);
|
||||
}
|
||||
else
|
||||
{
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 261 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 261 - weaponYOffset,
|
||||
FLAMETHROWER, weaponShade, weaponBits, weaponPal);
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 261 - weaponYOffset,
|
||||
G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (fix16_to_int(pPlayer->q16look_ang) >> 1), weaponY + 261 - weaponYOffset,
|
||||
FLAMETHROWERPILOT, weaponShade, weaponBits, weaponPal);
|
||||
}
|
||||
break;
|
||||
|
@ -4683,7 +4683,7 @@ void P_UpdatePosWhenViewingCam(DukePlayer_t *pPlayer)
|
|||
pPlayer->vel.x = 0;
|
||||
pPlayer->vel.y = 0;
|
||||
sprite[pPlayer->i].xvel = 0;
|
||||
pPlayer->look_ang = 0;
|
||||
pPlayer->q16look_ang = 0;
|
||||
pPlayer->q16rotscrnang = 0;
|
||||
}
|
||||
|
||||
|
@ -5108,17 +5108,17 @@ void P_ProcessInput(int playerNum)
|
|||
if (pPlayer->q16rotscrnang && !fix16_sdiv(pPlayer->q16rotscrnang, fix16_from_int(2)))
|
||||
pPlayer->q16rotscrnang = fix16_ssub(pPlayer->q16rotscrnang, fix16_from_int(ksgn(fix16_to_int(pPlayer->q16rotscrnang))));
|
||||
|
||||
pPlayer->look_ang -= (pPlayer->look_ang >> 2);
|
||||
pPlayer->q16look_ang = fix16_ssub(pPlayer->q16look_ang, fix16_sdiv(pPlayer->q16look_ang, fix16_from_int(4)));
|
||||
|
||||
if (pPlayer->look_ang && !(pPlayer->look_ang >> 2))
|
||||
pPlayer->look_ang -= ksgn(pPlayer->look_ang);
|
||||
if (pPlayer->q16look_ang && !fix16_sdiv(pPlayer->q16look_ang, fix16_from_int(4)))
|
||||
pPlayer->q16look_ang = fix16_ssub(pPlayer->q16look_ang, fix16_from_int(ksgn(fix16_to_int(pPlayer->q16look_ang))));
|
||||
|
||||
if (TEST_SYNC_KEY(playerBits, SK_LOOK_LEFT))
|
||||
{
|
||||
// look_left
|
||||
if (VM_OnEvent(EVENT_LOOKLEFT,pPlayer->i,playerNum) == 0)
|
||||
{
|
||||
pPlayer->look_ang -= 152;
|
||||
pPlayer->q16look_ang = fix16_ssub(pPlayer->q16look_ang, F16(152));
|
||||
pPlayer->q16rotscrnang = fix16_sadd(pPlayer->q16rotscrnang, fix16_from_int(24));
|
||||
}
|
||||
}
|
||||
|
@ -5128,7 +5128,7 @@ void P_ProcessInput(int playerNum)
|
|||
// look_right
|
||||
if (VM_OnEvent(EVENT_LOOKRIGHT,pPlayer->i,playerNum) == 0)
|
||||
{
|
||||
pPlayer->look_ang += 152;
|
||||
pPlayer->q16look_ang = fix16_sadd(pPlayer->q16look_ang, F16(152));
|
||||
pPlayer->q16rotscrnang = fix16_ssub(pPlayer->q16rotscrnang, fix16_from_int(24));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,9 +164,10 @@ typedef struct {
|
|||
|
||||
int16_t loogiex[64], loogiey[64], sbs, sound_pitch;
|
||||
|
||||
int16_t cursectnum, look_ang, last_extra, subweapon;
|
||||
int16_t cursectnum, last_extra, subweapon;
|
||||
int16_t max_ammo_amount[MAX_WEAPONS], ammo_amount[MAX_WEAPONS], inv_amount[GET_MAX];
|
||||
int16_t wackedbyactor, pyoff, opyoff;
|
||||
fix16_t q16look_ang;
|
||||
|
||||
int16_t newowner, jumping_counter, airleft;
|
||||
int16_t fta, ftq, access_wallnum, access_spritenum;
|
||||
|
@ -220,7 +221,7 @@ typedef struct {
|
|||
#endif
|
||||
|
||||
int8_t crouch_toggle;
|
||||
int8_t padding_[3];
|
||||
int8_t padding_[1];
|
||||
} DukePlayer_t;
|
||||
|
||||
// KEEPINSYNC lunatic/_defs_game.lua
|
||||
|
|
|
@ -722,7 +722,7 @@ void P_ResetPlayer(int playerNum)
|
|||
p.last_full_weapon = 0;
|
||||
p.last_pissed_time = 0;
|
||||
p.loogcnt = 0;
|
||||
p.look_ang = 512 - ((ud.level_number&1)<<10);
|
||||
p.q16look_ang = fix16_from_int(512 - ((ud.level_number&1)<<10));
|
||||
p.movement_lock = 0;
|
||||
p.newowner = -1;
|
||||
p.on_crane = -1;
|
||||
|
|
|
@ -864,7 +864,7 @@ void G_DisplayRest(int32_t smoothratio)
|
|||
|
||||
if (g_player[myconnectindex].ps->newowner == -1 && ud.overhead_on == 0 && cl_crosshair && ud.camerasprite == -1)
|
||||
{
|
||||
ud.returnvar[0] = (160<<16) - (g_player[myconnectindex].ps->look_ang<<15);
|
||||
ud.returnvar[0] = (160<<16) - (fix16_to_int(g_player[myconnectindex].ps->q16look_ang)<<15);
|
||||
ud.returnvar[1] = 100<<16;
|
||||
int32_t a = VM_OnEventWithReturn(EVENT_DISPLAYCROSSHAIR, g_player[screenpeek].ps->i, screenpeek, CROSSHAIR);
|
||||
if ((unsigned) a < MAXTILES)
|
||||
|
|
Loading…
Reference in a new issue