From 558e04cb9919de16857b8b7358bb325e6a2fcd24 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 26 Mar 2016 01:03:02 +0100 Subject: [PATCH] - safety commit. --- src/c_console.cpp | 20 ++++++++++---------- src/d_dehacked.cpp | 2 +- src/d_net.cpp | 16 ++++++---------- src/d_netinfo.cpp | 2 +- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/c_console.cpp b/src/c_console.cpp index 5c4b6e441..b86ea0b2c 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -732,15 +732,15 @@ static void C_DrawNotifyText () if (!show_messages && NotifyStrings[i].PrintLevel != 128) continue; - fixed_t alpha; + double alpha; if (j < NOTIFYFADETIME) { - alpha = OPAQUE * j / NOTIFYFADETIME; + alpha = 1. * j / NOTIFYFADETIME; } else { - alpha = OPAQUE; + alpha = 1; } if (NotifyStrings[i].PrintLevel >= PRINTLEVELS) @@ -752,23 +752,23 @@ static void C_DrawNotifyText () { if (!center) screen->DrawText (SmallFont, color, 0, line, NotifyStrings[i].Text, - DTA_CleanNoMove, true, DTA_Alpha, alpha, TAG_DONE); + DTA_CleanNoMove, true, DTA_AlphaF, alpha, TAG_DONE); else screen->DrawText (SmallFont, color, (SCREENWIDTH - SmallFont->StringWidth (NotifyStrings[i].Text)*CleanXfac)/2, line, NotifyStrings[i].Text, DTA_CleanNoMove, true, - DTA_Alpha, alpha, TAG_DONE); + DTA_AlphaF, alpha, TAG_DONE); } else if (con_scaletext == 0) { if (!center) screen->DrawText (SmallFont, color, 0, line, NotifyStrings[i].Text, - DTA_Alpha, alpha, TAG_DONE); + DTA_AlphaF, alpha, TAG_DONE); else screen->DrawText (SmallFont, color, (SCREENWIDTH - SmallFont->StringWidth (NotifyStrings[i].Text))/2, line, NotifyStrings[i].Text, - DTA_Alpha, alpha, TAG_DONE); + DTA_AlphaF, alpha, TAG_DONE); } else { @@ -777,7 +777,7 @@ static void C_DrawNotifyText () DTA_VirtualWidth, screen->GetWidth() / 2, DTA_VirtualHeight, screen->GetHeight() / 2, DTA_KeepRatio, true, - DTA_Alpha, alpha, TAG_DONE); + DTA_AlphaF, alpha, TAG_DONE); else screen->DrawText (SmallFont, color, (screen->GetWidth() / 2 - SmallFont->StringWidth (NotifyStrings[i].Text))/2, @@ -785,7 +785,7 @@ static void C_DrawNotifyText () DTA_VirtualWidth, screen->GetWidth() / 2, DTA_VirtualHeight, screen->GetHeight() / 2, DTA_KeepRatio, true, - DTA_Alpha, alpha, TAG_DONE); + DTA_AlphaF, alpha, TAG_DONE); } line += lineadv; canskip = false; @@ -865,7 +865,7 @@ void C_DrawConsole (bool hw2d) DTA_DestWidth, screen->GetWidth(), DTA_DestHeight, screen->GetHeight(), DTA_ColorOverlay, conshade, - DTA_Alpha, (hw2d && gamestate != GS_FULLCONSOLE) ? FLOAT2FIXED(con_alpha) : FRACUNIT, + DTA_AlphaF, (hw2d && gamestate != GS_FULLCONSOLE) ? (double)con_alpha : 1., DTA_Masked, false, TAG_DONE); if (conline && visheight < screen->GetHeight()) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 02237944e..5c84532c4 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -1340,7 +1340,7 @@ static int PatchSound (int soundNum) else CHECKKEY ("Zero/One", info->singularity) else CHECKKEY ("Value", info->priority) else CHECKKEY ("Zero 1", info->link) - else CHECKKEY ("Neg. One 1", info->_f_pitch()) + else CHECKKEY ("Neg. One 1", info->pitch) else CHECKKEY ("Neg. One 2", info->volume) else CHECKKEY ("Zero 2", info->data) else CHECKKEY ("Zero 3", info->usefulness) diff --git a/src/d_net.cpp b/src/d_net.cpp index 763b09f22..89f6a28b6 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2366,19 +2366,15 @@ void Net_DoCommand (int type, BYTE **stream, int player) { FTraceResults trace; - angle_t ang = players[player].mo->_f_angle() >> ANGLETOFINESHIFT; - angle_t pitch = (angle_t)(players[player].mo->_f_pitch()) >> ANGLETOFINESHIFT; - fixed_t vx = FixedMul (finecosine[pitch], finecosine[ang]); - fixed_t vy = FixedMul (finecosine[pitch], finesine[ang]); - fixed_t vz = -finesine[pitch]; + DAngle ang = players[player].mo->Angles.Yaw; + DAngle pitch = players[player].mo->Angles.Pitch; + double c = pitch.Cos(); + DVector3 vec(c * ang.Cos(), c * ang.Sin(), -pitch.Sin); s = ReadString (stream); - if (Trace (players[player].mo->_f_X(), players[player].mo->_f_Y(), - players[player].mo->_f_Top() - (players[player].mo->_f_height()>>2), - players[player].mo->Sector, - vx, vy, vz, 172*FRACUNIT, 0, ML_BLOCKEVERYTHING, players[player].mo, - trace, TRACE_NoSky)) + if (Trace (players[player].mo->PosPlusZ(players[player].mo->Height/2), players[player].mo->Sector, + vec, 172., 0, ML_BLOCKEVERYTHING, players[player].mo, trace, TRACE_NoSky)) { if (trace.HitType == TRACE_HitWall) { diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 3cf40e932..012dea399 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -884,7 +884,7 @@ void ReadCompatibleUserInfo(FArchive &arc, userinfo_t &info) BYTE team; int aimdist, color, colorset, skin, gender; bool neverswitch; - //fixed_t movebob, stillbob; These were never serialized! + //fxed_t movebob, stillbob; These were never serialized! //int playerclass; " info.Reset();