Skip to content

Commit

Permalink
Added textures bugfix method for this Mod
Browse files Browse the repository at this point in the history
  • Loading branch information
tx00100xt committed Oct 22, 2023
1 parent 56c373d commit 2d1234e
Show file tree
Hide file tree
Showing 9 changed files with 1,222 additions and 582 deletions.
34 changes: 21 additions & 13 deletions Sources/Entities/Common/HUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#define TOP_HEALTH 100

#ifdef PLATFORM_UNIX
extern "C" __attribute__ ((visibility("default"))) FLOAT _fArmorHeightAdjuster = 1.0f;
extern "C" __attribute__ ((visibility("default"))) FLOAT _fFragScorerHeightAdjuster = 1.0f;
extern "C" __attribute__ ((visibility("default"))) FLOAT _fArmorHeightAdjuster;
extern "C" __attribute__ ((visibility("default"))) FLOAT _fFragScorerHeightAdjuster;
#else
extern __declspec(dllimport) FLOAT _fArmorHeightAdjuster;
extern __declspec(dllimport) FLOAT _fFragScorerHeightAdjuster;
Expand All @@ -26,6 +26,7 @@ extern __declspec(dllimport) FLOAT _fFragScorerHeightAdjuster;
//
extern INDEX hud_bShowPing;
extern INDEX hud_bShowKills;
extern INDEX hud_bShowScore;

// cheats
extern INDEX cht_bEnable;
Expand All @@ -44,6 +45,7 @@ extern INDEX hud_iSortPlayers;
extern FLOAT hud_fOpacity;
extern FLOAT hud_fScaling;
extern FLOAT hud_tmWeaponsOnScreen;
extern INDEX hud_bWeaponsIconScale; // HUD weapons icons scale: 0 - small, 1 - big


// player statistics sorting keys
Expand Down Expand Up @@ -815,7 +817,11 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
if( ptoWantedWeapon == _awiWeapons[i].wi_ptoWeapon) colIcon = C_WHITE;
_fCustomScalingAdjustment = 1.0f;
HUD_DrawBorder( fCol, fRow, fOneUnit, fOneUnit, colIcon);
_fCustomScalingAdjustment = 0.5f;
if (hud_bWeaponsIconScale) {
_fCustomScalingAdjustment = 0.75f;
} else {
_fCustomScalingAdjustment = 0.5f;
}
HUD_DrawIcon( fCol, fRow, *_awiWeapons[i].wi_ptoWeapon, colIcon, 1.0f, FALSE);
// advance to next position
fCol += fAdvUnit;
Expand Down Expand Up @@ -1047,15 +1053,17 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
iScore = iScoreSum;
}

// prepare and draw score or frags info
strValue.PrintF( "%d", iScore);
fRow = pixTopBound +fHalfUnit;
fCol = pixLeftBound +fHalfUnit;
fAdv = fAdvUnit+ fChrUnit*fWidthAdj/2 -fHalfUnit;
HUD_DrawBorder( fCol, fRow, fOneUnit, fOneUnit, colBorder);
HUD_DrawBorder( fCol+fAdv, fRow, fChrUnit*fWidthAdj, fOneUnit, colBorder);
HUD_DrawText( fCol+fAdv, fRow, strValue, colScore, 1.0f);
HUD_DrawIcon( fCol, fRow, _toFrags, colScore, 1.0f, FALSE);
if( hud_bShowScore ) {
// prepare and draw score or frags info
strValue.PrintF( "%d", iScore);
fRow = pixTopBound +fHalfUnit;
fCol = pixLeftBound +fHalfUnit;
fAdv = fAdvUnit+ fChrUnit*fWidthAdj/2 -fHalfUnit;
HUD_DrawBorder( fCol, fRow, fOneUnit, fOneUnit, colBorder);
HUD_DrawBorder( fCol+fAdv, fRow, fChrUnit*fWidthAdj, fOneUnit, colBorder);
HUD_DrawText( fCol+fAdv, fRow, strValue, colScore, 1.0f);
HUD_DrawIcon( fCol, fRow, _toFrags, colScore, 1.0f, FALSE);
}

// eventually draw mana info
if( bScoreMatch || bFragMatch) {
Expand All @@ -1070,7 +1078,7 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
}

// if single player or cooperative mode
if( bSinglePlay || bCooperative)
if( (bSinglePlay || bCooperative) && hud_bShowScore)
{
// prepare and draw hiscore info
strValue.PrintF( "%d", Max(_penPlayer->m_iHighScore, _penPlayer->m_psGameStats.ps_iScore));
Expand Down
304 changes: 304 additions & 0 deletions Sources/Entities/Common/LightFixes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,304 @@
#ifndef SE_INCL_LIGHTFIXES_H
#define SE_INCL_LIGHTFIXES_H
// ********************************************************************************************
// ********** Arrays of light source coordinates to correct texture illumination **********
// ********************************************************************************************

// Valley Of The Kings
FLOAT _fValleyOfTheKingsCoordinates[4][3] {
-55.9375f,-16.25f,-231.75,
-40.625f,-15.375f,-232.188f,
-23.0f,-15.0f,-232.0f,
-8.875f,-14.0625f,-231.562f
};

// Dunes
FLOAT _fDunesCoordinates[8][3] {
-284.5f,171.625f,
-495.625f,-285.5f,
170.125f,-534.875f,
-167.875f,170.375f,
-544.875f,-169.25f,
170.375f,-497.25f,
-41.875f,171.125f,
-741.625f,26.375f,
170.625f,-746.125f,
271.75f,170.5f,
-448.5f,224.0f,
169.875f,-440.75f
};

// Suburbs
FLOAT _fSuburbsCoordinates[21][3] {
224.125f,171.125f,887.375f,
270.125f,170.0f,889.0f,
370.125f,172.0f,822.125f,
369.0f,170.375f,811.625f,
370.0f,167.125f,759.25f,
370.25f,172.375f,769.5f,
267.0f,169.125f,720.875f,
268.375f,167.75f,711.375f,
226.75f,170.375f,709.625f,
187.0f,171.0f,492.0f,
181.75f,164.125f,447.125f,
21.125f,166.75f,476.875f,
-41.5f,170.25f,477.0f,
-243.75f,170.375f,569.5f,
-289.5f,170.5f,569.125f,
-170.875f,162.0f,784.125f,
-170.875f,166.25f,830.625f,
-318.25f,170.25f,870.125f,
-314.125f,173.5f,886.875f,
-318.375f,170.0f,908.875f,
-319.0f,169.25f,922.0f
};

// Metropolis
FLOAT _fMetropolisCoordinates[1][3] {
147.125f,64.3125f,26.6875f
};

// Alley Of Sphinxes
FLOAT _fAlleyOfSphinxesCoordinates[37][3] {
1594.0f,125.125f,2162.0f,
1592.25f,128.375f,2181.38f,
1586.0f,122.625f,1926.12f,
1595.25f,124.25f,1914.0f,
1338.88f,121.875f,1916.75f,
1344.38f,128.375f,2162.62f,
920.0f,116.125f,2040.12f,
1038.5f,115.375f,2006.0f,
1030.62f,111.625f,2022.88f,
1041.88f,116.875f,2070.12f,
1030.12f,116.5f,2081.0f,
1618.25f,8.625f,2053.62f,
1589.75f,9.75f,2041.75f,
1590.12f,9.5f,2053.25f,
1513.88f,12.625f,2160.0f,
1497.0f,34.5f,2151.0f,
1420.75f,17.375f,2160.0f,
1282.25f,12.0f,2182.12f,
1264.88f,9.875f,2179.25f,
1265.25f,10.875f,2167.62f,
1281.5f,11.25f,2166.62f,
1075.12f,12.5f,2162.62f,
1074.75f,11.5f,2177.5f,
1091.62f,13.125f,2180.0f,
1092.25f,13.0f,2188.38f,
1094.5f,11.25f,2174.5f,
1100.75f,11.875f,2163.75f,
1101.88f,12.125f,2183.88f,
1073.5f,10.25f,1922.62f,
1072.88f,10.625f,1908.5f,
1088.75f,10.5f,1909.75f,
1089.88f,11.125f,1921.88f,
1287.0f,14.0f,1909.62f,
1287.62f,13.625f,1924.5f,
1266.38f,12.25f,1922.75f,
1267.38f,13.0f,1910.0f,
1593.62f,-2.75f,2049.5f
};

// Karnak
FLOAT _fKarnakCoordinates[42][3] {
-186.938f,168.688f,1516.5f,
-196.5f,171.562f,1493.06f,
-275.062f,86.5f,1440.88f,
-293.0f,87.1875f,1446.62f,
-276.375f,81.1875f,1556.56f,
-293.5f,82.5f,1569.88f,
-219.688f,116.812f,1687.75f,
-212.75f,113.938f,1685.31f,
-177.875f,113.125f,1696.56f,
-158.875f,115.625f,1691.62f,
-92.0f,84.0f,1571.31f,
-104.938f,86.0625f,1555.69f,
-91.125f,86.5f,1437.94f,
-102.5f,87.9375f,1435.44f,
330.0f,127.312f,1455.62f,
315.25f,132.688f,1448.0f,
310.375f,122.375f,1825.19f,
328.125f,117.625f,1815.56f,
610.188f,120.688f,1888.12f,
613.25f,124.375f,1888.69f,
922.625f,92.6875f,2040.06f,
920.0f,92.4375f,2053.69f,
1032.12f,134.25f,2012.25f,
1032.25f,134.75f,2076.75f,
1344.75f,160.25f,1902.31f,
1325.31f,171.375f,1910.81f,
1325.12f,171.0f,2183.0f,
1344.31f,170.188f,2175.75f,
1597.06f,170.812f,1910.0f,
1617.0f,171.188f,1905.06f,
1597.25f,171.188f,2186.81f,
1597.69f,170.938f,2177.69f,
1610.75f,170.625f,2170.44f,
633.0f,123.938f,2809.06f,
647.938f,122.375f,2808.62f,
-590.938f,123.0f,2038.19f,
-595.688f,125.062f,2038.5f,
-97.0625f,108.438f,2457.38f,
-81.4375f,113.25f,2454.75f,
-49.75f,113.625f,2461.0f,
-29.0625f,109.75f,2459.5f,
660.0f,9.1875f,1915.56f
};

// Luxor
FLOAT _fLuxorCoordinates[52][3] {
-85.875f,14.4375f,6.6875f,
-75.3125f,14.8125f,-5.0625f,
-308.562f,116.312f,-7.8125f,
107.75f,123.062f,-144.125f,
124.625f,123.688f,-128.625f,
150.062f,122.562f,-158.875f,
159.875f,122.438f,-169.938f,
105.062f,110.375f,-241.375f,
111.188f,112.625f,-222.125f,
134.438f,108.875f,-238.688f,
144.25f,107.688f,-221.938f,
7.125f,111.938f,-279.438f,
10.1875f,112.875f,-294.25f,
15.0f,109.125f,-314.0f,
-26.5625f,109.125f,-398.125f,
-36.1875f,109.312f,-416.25f,
118.875f,105.188f,-391.562f,
128.625f,106.25f,-374.0f,
103.562f,113.875f,-296.812f,
111.438f,113.125f,-313.875f,
133.812f,100.562f,-335.812f,
145.062f,104.0f,-346.125f,
142.438f,110.0f,-326.0f,
146.0f,106.25f,-314.062f,
133.875f,104.375f,-304.25f,
105.75f,113.438f,-345.625f,
277.5f,106.125f,-539.625f,
272.438f,108.5f,-526.375f,
250.75f,109.375f,-523.125f,
260.688f,108.062f,-506.0f,
247.688f,116.625f,-280.438f,
279.812f,113.125f,-279.75f,
304.875f,117.0f,-137.875f,
375.0f,113.0f,-279.062f,
374.625f,112.562f,-246.75f,
442.438f,122.188f,-153.562f,
447.0f,121.938f,-134.25f,
441.125f,120.562f,-121.25f,
448.688f,121.938f,-102.25f,
438.375f,121.562f,105.875f,
447.938f,119.625f,122.0f,
441.312f,121.125f,134.562f,
447.438f,120.125f,153.938f,
415.625f,113.188f,296.375f,
416.938f,112.625f,326.875f,
281.25f,111.875f,246.562f,
248.625f,112.5f,247.188f,
183.875f,113.75f,292.188f,
152.562f,112.5f,291.25f,
124.562f,119.312f,206.875f,
93.1875f,119.812f,206.562f,
15.0f,14.4375f,-77.1875f // grid texture
};

// Sacred Yards
FLOAT _fSacredYardsCoordinates[27][3] {
71.0f,108.938f,199.562f,
87.75f,108.562f,182.938f,
-150.5f,105.938f,89.0f,
-170.0f,110.062f,94.9375,
188.0f,115.688f,121.188f,
197.812f,115.875f,104.0f,
238.125f,113.188f,113.25f,
247.812f,112.0f,102.0f,
350.188f,113.438f,90.3125f,
367.625f,110.125f,79.125f,
399.875f,108.625f,79.5625f,
417.562f,111.312f,81.125f,
527.5f,113.25f,198.188f,
520.375f,115.375f,214.688f,
401.25f,115.812f,552.625f,
345.625f,116.75f,552.812f,
216.625f,116.938f,482.75f,
-170.0f,111.75f,343.062f,
-158.625f,110.0f,334.0f,
153.188f,111.688f,446.0f,
148.812f,115.625f,446.5f,
95.1875f,113.0f,446.125f,
86.75f,115.375f,455.938f,
26.3125f,112.375f,562.062f,
18.0f,111.375f,570.562f,
-28.0625f,111.062f,562.0f,
-37.625f,114.375f,571.75
};

// Karnak Demo
FLOAT _fKarnakDemoCoordinates[50][3] {
-186.938f,168.688f,1516.5f,
-196.5f,171.562f,1493.06f,
-275.062f,86.5f,1440.88f,
-293.0f,87.1875f,1446.62f,
-276.375f,81.1875f,1556.56f,
-293.5f,82.5f,1569.88f,
-219.688f,116.812f,1687.75f,
-212.75f,113.938f,1685.31f,
-177.875f,113.125f,1696.56f,
-158.875f,115.625f,1691.62f,
-92.0f,84.0f,1571.31f,
-104.938f,86.0625f,1555.69f,
-91.125f,86.5f,1437.94f,
-102.5f,87.9375f,1435.44f,
330.0f,127.312f,1455.62f,
315.25f,132.688f,1448.0f,
310.375f,122.375f,1825.19f,
328.125f,117.625f,1815.56f,
610.188f,120.688f,1888.12f,
613.25f,124.375f,1888.69f,
922.625f,92.6875f,2040.06f,
920.0f,92.4375f,2053.69f,
1032.12f,134.25f,2012.25f,
1032.25f,134.75f,2076.75f,
1344.75f,160.25f,1902.31f,
1325.31f,171.375f,1910.81f,
1325.12f,171.0f,2183.0f,
1344.31f,170.188f,2175.75f,
1597.06f,170.812f,1910.0f,
1617.0f,171.188f,1905.06f,
1597.25f,171.188f,2186.81f,
1597.69f,170.938f,2177.69f,
1610.75f,170.625f,2170.44f,
633.0f,123.938f,2809.06f,
647.938f,122.375f,2808.62f,
-590.938f,123.0f,2038.19f,
-595.688f,125.062f,2038.5f,
-97.0625f,108.438f,2457.38f,
-81.4375f,113.25f,2454.75f,
-49.75f,113.625f,2461.0f,
-29.0625f,109.75f,2459.5f,
361.25f,119.25f,2016.62f,
359.875f,120.5f,2067.88f,
265.75f,120.25f,2064.62f,
268.25f,120.25f,2015.62f,
198.125f,118.375f,2012.25f,
197.5f,118.0f,2068.5f,
172.0f,118.875f,2071.12f,
174.0f,119.0f,2012.62f,
660.0f,9.1875f,1915.56f
};

// Intro
FLOAT _fIntroCoordinates[8][3] {
361.25f,119.25f,2016.62f,
359.875f,120.5f,2067.88f,
265.75f,120.25f,2064.62f,
268.25f,120.25f,2015.62f,
198.125f,118.375f,2012.25f,
197.5f,118.0f,2068.5f,
172.0f,118.875f,2071.12f,
174.0f,119.0f,2012.62f
};

// ********************************************************************************************
// ********************************************************************************************
// ********************************************************************************************
#endif // include once check
Loading

0 comments on commit 2d1234e

Please sign in to comment.