@@ -41,6 +41,7 @@ extern __declspec(dllimport) FLOAT _fFragScorerHeightAdjuster;
4141extern INDEX hud_bShowPing;
4242extern INDEX hud_bShowKills;
4343extern INDEX hud_bShowScore;
44+ extern INDEX hud_bLegacyHUD;
4445
4546// cheats
4647extern INDEX cht_bEnable;
@@ -646,16 +647,17 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
646647 }
647648 strValue.PrintF (" %d" , (SLONG)ceil (fValue ));
648649 // ####
649- _fCustomScalingAdjustment = 0 .5f ;
650+ _fCustomScalingAdjustment = 0 .9f ;
651+ if (!hud_bLegacyHUD) {_fCustomScalingAdjustment = 0 .5f ;}
650652 PrepareColorTransitions ( colMax, colTop, colMid, C_RED, 0 .5f , 0 .25f , FALSE );
651653 fRow = pixBottomBound-fHalfUnit ;
652654 fCol = pixLeftBound+fHalfUnit ;
653655 colDefault = AddShaker ( 5 , fValue , penLast->m_iLastHealth , penLast->m_tmHealthChanged , fMoverX , fMoverY );
654- _fCustomScalingAdjustment = 0 .7f ;
656+ if (!hud_bLegacyHUD) { _fCustomScalingAdjustment = 0 .7f ;}
655657 HUD_DrawBorder ( fCol +fMoverX , fRow +fMoverY , fOneUnit , fOneUnit , colBorder);
656658 fCol += fAdvUnit +fChrUnit *3 /2 -fHalfUnit ;
657659 HUD_DrawBorder ( fCol , fRow , fChrUnit *3 , fOneUnit , colBorder);
658- _fCustomScalingAdjustment = 0 .5f ;
660+ if (!hud_bLegacyHUD) { _fCustomScalingAdjustment = 0 .5f ;}
659661 HUD_DrawText ( fCol , fRow , strValue, colDefault, fNormValue );
660662 fCol -= fAdvUnit +fChrUnit *3 /2 -fHalfUnit ;
661663 HUD_DrawIcon ( fCol +fMoverX , fRow +fMoverY , _toHealth, _colHUD, fNormValue , TRUE );
@@ -667,14 +669,18 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
667669 strValue.PrintF ( " %d" , (SLONG)ceil (fValue ));
668670 PrepareColorTransitions ( colMax, colTop, colMid, C_lGRAY, 0 .5f , 0 .25f , FALSE );
669671 // fRow = pixBottomBound- (fNextUnit+fHalfUnit);//*_pDP->dp_fWideAdjustment;
670- fRow = pixBottomBound- (fNextUnit +fHalfUnit ) * _fArmorHeightAdjuster;
672+ if (hud_bLegacyHUD) {
673+ fRow = pixBottomBound - (fNextUnit +fHalfUnit ) * (_fArmorHeightAdjuster + 0 .3f );
674+ } else {
675+ fRow = pixBottomBound - (fNextUnit +fHalfUnit ) * _fArmorHeightAdjuster;
676+ }
671677 fCol = pixLeftBound+ fHalfUnit ;
672678 colDefault = AddShaker ( 3 , fValue , penLast->m_iLastArmor , penLast->m_tmArmorChanged , fMoverX , fMoverY );
673- _fCustomScalingAdjustment = 0 .7f ;
679+ if (!hud_bLegacyHUD) { _fCustomScalingAdjustment = 0 .7f ;}
674680 HUD_DrawBorder ( fCol +fMoverX , fRow +fMoverY , fOneUnit , fOneUnit , colBorder);
675681 fCol += fAdvUnit +fChrUnit *3 /2 -fHalfUnit ;
676682 HUD_DrawBorder ( fCol , fRow , fChrUnit *3 , fOneUnit , colBorder);
677- _fCustomScalingAdjustment = 0 .5f ;
683+ if (!hud_bLegacyHUD) { _fCustomScalingAdjustment = 0 .5f ;}
678684 HUD_DrawText ( fCol , fRow , strValue, NONE, fNormValue );
679685 fCol -= fAdvUnit +fChrUnit *3 /2 -fHalfUnit ;
680686 HUD_DrawIcon ( fCol +fMoverX , fRow +fMoverY , _toArmor, _colHUD, fNormValue , FALSE );
@@ -702,30 +708,48 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
702708 BOOL bDrawAmmoIcon = _fCustomScaling<=1 .0f ;
703709 // draw ammo, value and weapon
704710 fRow = pixBottomBound-fHalfUnit ;
705- fCol = 175 + fHalfUnit ;
711+ FLOAT fColAdjustment = 0 .0f ;
712+ if (hud_bLegacyHUD) {
713+ if (hud_fScaling > 0 .5f ) {
714+ fColAdjustment = 3 .0f ;
715+ } else {
716+ fColAdjustment = 2 .0f ;
717+ }
718+ fCol = 235 + fHalfUnit ;
719+ } else {
720+ fCol = 175 + fHalfUnit ;
721+ }
706722 colDefault = AddShaker ( 4 , fValue , penLast->m_iLastAmmo , penLast->m_tmAmmoChanged , fMoverX , fMoverY );
707- _fCustomScalingAdjustment = 0 .7f ;
723+ if (!hud_bLegacyHUD) { _fCustomScalingAdjustment = 0 .7f ;}
708724 HUD_DrawBorder ( fCol +fMoverX , fRow +fMoverY , fOneUnit *1.5 , fOneUnit , colBorder);
709725 fCol += fAdvUnit +fChrUnit *3 /2 -fHalfUnit ;
726+ fCol += fColAdjustment ;
710727 HUD_DrawBorder ( fCol , fRow , fChrUnit *3 , fOneUnit , colBorder);
728+ fCol -= fColAdjustment ;
711729 if ( bDrawAmmoIcon) {
712730 fCol += fAdvUnit +fChrUnit *3 /2 -fHalfUnit ;
713731 HUD_DrawBorder ( fCol , fRow , fOneUnit , fOneUnit , colBorder);
714- _fCustomScalingAdjustment = 0 .5f ;
732+ if (!hud_bLegacyHUD) { _fCustomScalingAdjustment = 0 .5f ;}
715733 HUD_DrawIcon ( fCol , fRow , *ptoCurrentAmmo, _colHUD, fNormValue , TRUE );
716734 fCol -= fAdvUnit +fChrUnit *3 /2 -fHalfUnit ;
717735 }
718- _fCustomScalingAdjustment = 0 .5f ;
736+ if (!hud_bLegacyHUD) {_fCustomScalingAdjustment = 0 .5f ;}
737+ fCol += fColAdjustment ;
719738 HUD_DrawText ( fCol , fRow , strValue, colDefault, fNormValue );
739+ fCol -= fColAdjustment ;
720740 fCol -= fAdvUnit +fChrUnit *3 /2 -fHalfUnit ;
721741 HUD_DrawIcon ( fCol +fMoverX , fRow +fMoverY , *ptoCurrentWeapon, _colHUD, fNormValue , !bDrawAmmoIcon);
722742 } else if ( ptoCurrentWeapon!=NULL ) {
723743 // draw only knife or colt icons (ammo is irrelevant)
724744 fRow = pixBottomBound-fHalfUnit ;
725- fCol = 205 + fHalfUnit ;
726- _fCustomScalingAdjustment = 0 .7f ;
745+ if (hud_bLegacyHUD) {
746+ fCol = 235 + fHalfUnit ;
747+ } else {
748+ fCol = 205 + fHalfUnit ;
749+ }
750+ if (!hud_bLegacyHUD) {_fCustomScalingAdjustment = 0 .7f ;}
727751 HUD_DrawBorder ( fCol , fRow , fOneUnit * 1.5 , fOneUnit , colBorder);
728- _fCustomScalingAdjustment = 0 .5f ;
752+ if (!hud_bLegacyHUD) { _fCustomScalingAdjustment = 0 .5f ;}
729753 HUD_DrawIcon ( fCol , fRow , *ptoCurrentWeapon, _colHUD, fNormValue , FALSE );
730754 }
731755
@@ -761,9 +785,9 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
761785 if ( ptoCurrentAmmo == ai.ai_ptoAmmo ) colIcon = C_WHITE;
762786 fNormValue = (FLOAT)ai.ai_iAmmoAmmount / ai.ai_iMaxAmmoAmmount ;
763787 colBar = AddShaker ( 4 , ai.ai_iAmmoAmmount , ai.ai_iLastAmmoAmmount , ai.ai_tmAmmoChanged , fMoverX , fMoverY );
764- _fCustomScalingAdjustment = 0 .7f ;
788+ if (!hud_bLegacyHUD) { _fCustomScalingAdjustment = 0 .7f ;}
765789 HUD_DrawBorder ( fCol , fRow +fMoverY , fOneUnitS , fOneUnitS , colBorder);
766- _fCustomScalingAdjustment = 0 .5f ;
790+ if (!hud_bLegacyHUD) { _fCustomScalingAdjustment = 0 .5f ;}
767791 HUD_DrawIcon ( fCol , fRow +fMoverY , *_aaiAmmo[i].ai_ptoAmmo , colIcon, fNormValue , FALSE );
768792 HUD_DrawBar ( fCol +fBarPos , fRow +fMoverY , fOneUnitS /5 , fOneUnitS -2 , BO_DOWN, colBar, fNormValue );
769793 // advance to next position
@@ -784,7 +808,7 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
784808 const BOOL bSinglePlay = GetSP ()->sp_bSinglePlayer ;
785809 COLOR colScore = _colHUD;
786810 if (bSinglePlay) {
787- if (hud_bShowKills)
811+ if (hud_bShowKills && !hud_bLegacyHUD )
788812 {
789813 // set font and prepare font parameters
790814 _pfdDisplayFont->SetVariableWidth ();
@@ -833,7 +857,9 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
833857 if ( ptoWantedWeapon == _awiWeapons[i].wi_ptoWeapon ) colIcon = C_WHITE;
834858 _fCustomScalingAdjustment = 1 .0f ;
835859 HUD_DrawBorder ( fCol , fRow , fOneUnit , fOneUnit , colIcon);
836- if (hud_bWeaponsIconScale) {
860+ if (hud_bLegacyHUD) {
861+ _fCustomScalingAdjustment = 1 .0f ;
862+ } else if (hud_bWeaponsIconScale) {
837863 _fCustomScalingAdjustment = 0 .75f ;
838864 } else {
839865 _fCustomScalingAdjustment = 0 .5f ;
@@ -989,43 +1015,46 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
9891015 const FLOAT fCharWidth = (PIX)((_pfdDisplayFont->GetWidth ()-2 ) *fTextScale );
9901016// ####
9911017 long textoffset = 1 ;
1018+ INDEX j=i;
1019+ if (hud_bLegacyHUD) { j++;}
1020+
9921021 if ( bCooperative)
9931022 {
9941023 if (hud_bShowKills)
9951024 {
9961025 textoffset += (TXT_WIDTH_KILLS /2 );
997- _pDP->PutTextC (strKillsT, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , C_MAGENTA |_ulAlphaHUD); textoffset += (TXT_WIDTH_KILLS/2 );
998- _pDP->PutText (" /" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , C_MAGENTA |_ulAlphaHUD); textoffset += 2 ;
999- _pDP->PutTextC (strKillsC, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , C_MAGENTA |_ulAlphaHUD); textoffset += (TXT_WIDTH_KILLS/2 );
1026+ _pDP->PutTextC (strKillsT, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , C_MAGENTA |_ulAlphaHUD); textoffset += (TXT_WIDTH_KILLS/2 );
1027+ _pDP->PutText (" /" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , C_MAGENTA |_ulAlphaHUD); textoffset += 2 ;
1028+ _pDP->PutTextC (strKillsC, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , C_MAGENTA |_ulAlphaHUD); textoffset += (TXT_WIDTH_KILLS/2 );
10001029 }
10011030 if (hud_bShowPing)
10021031 {
1003- _pDP->PutTextR (" ms" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += 2 ;
1004- _pDP->PutTextR (strPing, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += TXT_WIDTH_PING+1 ;
1032+ _pDP->PutTextR (" ms" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += 2 ;
1033+ _pDP->PutTextR (strPing, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += TXT_WIDTH_PING+1 ;
10051034 }
1006- _pDP->PutTextC (strArmor, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , colArmor |_ulAlphaHUD); textoffset += (TXT_WIDTH_ARMOR/2 );
1007- _pDP->PutText (" /" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , _colHUD |_ulAlphaHUD); textoffset += 2 ;
1008- _pDP->PutTextC (strHealth, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , colHealth|_ulAlphaHUD); textoffset += (TXT_WIDTH_HEALTH/2 );
1035+ _pDP->PutTextC (strArmor, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , colArmor |_ulAlphaHUD); textoffset += (TXT_WIDTH_ARMOR/2 );
1036+ _pDP->PutText (" /" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , _colHUD |_ulAlphaHUD); textoffset += 2 ;
1037+ _pDP->PutTextC (strHealth, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , colHealth|_ulAlphaHUD); textoffset += (TXT_WIDTH_HEALTH/2 );
10091038 }else if ( bScoreMatch) {
10101039 if (hud_bShowPing)
10111040 {
1012- _pDP->PutTextR (" ms" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += 2 ;
1013- _pDP->PutTextR (strPing, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += TXT_WIDTH_PING+1 ;
1041+ _pDP->PutTextR (" ms" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += 2 ;
1042+ _pDP->PutTextR (strPing, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += TXT_WIDTH_PING+1 ;
10141043 }
1015- _pDP->PutTextC (strMana, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , colMana |_ulAlphaHUD); textoffset += (TXT_WIDTH_MANA/2 );
1016- _pDP->PutText (" /" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , _colHUD |_ulAlphaHUD); textoffset += 2 ;
1017- _pDP->PutTextC (strScore, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , colScore|_ulAlphaHUD); textoffset += (TXT_WIDTH_SCORE/2 );
1044+ _pDP->PutTextC (strMana, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , colMana |_ulAlphaHUD); textoffset += (TXT_WIDTH_MANA/2 );
1045+ _pDP->PutText (" /" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , _colHUD |_ulAlphaHUD); textoffset += 2 ;
1046+ _pDP->PutTextC (strScore, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , colScore|_ulAlphaHUD); textoffset += (TXT_WIDTH_SCORE/2 );
10181047 }else { // fragmatch!
10191048 if (hud_bShowPing)
10201049 {
1021- _pDP->PutTextR (" ms" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += 2 ;
1022- _pDP->PutTextR (strPing, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += TXT_WIDTH_PING+1 ;
1050+ _pDP->PutTextR (" ms" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += 2 ;
1051+ _pDP->PutTextR (strPing, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , C_YELLOW |_ulAlphaHUD); textoffset += TXT_WIDTH_PING+1 ;
10231052 }
1024- _pDP->PutTextC (strDeaths, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , colDeaths|_ulAlphaHUD); textoffset += (TXT_WIDTH_DEATHS/2 );
1025- _pDP->PutText (" /" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , _colHUD |_ulAlphaHUD); textoffset += 2 ;
1026- _pDP->PutTextC (strFrags, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , colFrags |_ulAlphaHUD); textoffset += (TXT_WIDTH_FRAGS/2 );
1053+ _pDP->PutTextC (strDeaths, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , colDeaths|_ulAlphaHUD); textoffset += (TXT_WIDTH_DEATHS/2 );
1054+ _pDP->PutText (" /" , _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , _colHUD |_ulAlphaHUD); textoffset += 2 ;
1055+ _pDP->PutTextC (strFrags, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , colFrags |_ulAlphaHUD); textoffset += (TXT_WIDTH_FRAGS/2 );
10271056 }
1028- _pDP->PutTextR (strName, _pixDPWidth - textoffset * fCharWidth , fCharHeight *i +fOneUnit * 2 , colScore |_ulAlphaHUD);
1057+ _pDP->PutTextR (strName, _pixDPWidth - textoffset * fCharWidth , fCharHeight *j +fOneUnit * 2 , colScore |_ulAlphaHUD);
10291058 }
10301059 // calculate summ of scores (for coop mode)
10311060 iScoreSum += iScore;
@@ -1111,7 +1140,11 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
11111140 if ( hud_bShowMessages && _penPlayer->m_ctUnreadMessages >0 ) {
11121141 strValue.PrintF ( " %d" , _penPlayer->m_ctUnreadMessages );
11131142 // fRow = pixTopBound+fHalfUnit;
1114- fRow = pixBottomBound- (fNextUnit +fHalfUnit ) * _fArmorHeightAdjuster - 21 .0f ;
1143+ if (hud_bLegacyHUD) {
1144+ fRow = pixTopBound+fHalfUnit ;
1145+ } else {
1146+ fRow = pixBottomBound- (fNextUnit +fHalfUnit ) * _fArmorHeightAdjuster - 21 .0f ;
1147+ }
11151148 fCol = pixRightBound-fHalfUnit -fAdvUnit -fChrUnit *4 ;
11161149 const FLOAT tmIn = 0 .5f ;
11171150 const FLOAT tmOut = 0 .5f ;
@@ -1127,7 +1160,11 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
11271160 } else {
11281161 fRatio = 1 .0f ;
11291162 }
1130- fRow -=fAdvUnit *5 *fRatio ;
1163+ if (hud_bLegacyHUD) {
1164+ fRow +=fAdvUnit *5 *fRatio ;
1165+ } else {
1166+ fRow -=fAdvUnit *5 *fRatio ;
1167+ }
11311168 fCol -=fAdvUnit *15 *fRatio ;
11321169 col = LerpColor (_colHUD, C_WHITE|0xFF , fRatio );
11331170 }
0 commit comments