mirror of https://github.com/AxioDL/metaforce.git
Work on HUD interfaces
This commit is contained in:
parent
dc781f5c67
commit
d3c4f69e6f
|
@ -28,6 +28,9 @@ struct ITweakGui : ITweak
|
|||
};
|
||||
|
||||
virtual float GetMapAlphaInterpolant() const=0;
|
||||
virtual float GetRadarXYRadius() const=0;
|
||||
virtual float GetRadarZRadius() const=0;
|
||||
virtual float GetRadarZCloseRadius() const=0;
|
||||
virtual float GetEnergyBarFilledSpeed() const=0;
|
||||
virtual float GetEnergyBarShadowSpeed() const=0;
|
||||
virtual float GetEnergyBarDrainDelay() const=0;
|
||||
|
@ -35,12 +38,17 @@ struct ITweakGui : ITweak
|
|||
virtual atUint32 GetHudCamFovTweak() const=0;
|
||||
virtual atUint32 GetHudCamYTweak() const=0;
|
||||
virtual atUint32 GetHudCamZTweak() const=0;
|
||||
virtual float GetMaxThreatEnergy() const=0;
|
||||
virtual float GetRadarScopeCoordRadius() const=0;
|
||||
virtual float GetRadarPlayerPaintRadius() const=0;
|
||||
virtual float GetRadarEnemyPaintRadius() const=0;
|
||||
virtual float GetMissileArrowVisTime() const=0;
|
||||
virtual EHudVisMode GetHudVisMode() const=0;
|
||||
virtual EHelmetVisMode GetHelmetVisMode() const=0;
|
||||
virtual atUint32 GetEnableAutoMapper() const=0;
|
||||
virtual atUint32 GetEnableTargetingManager() const=0;
|
||||
virtual atUint32 GetEnablePlayerVisor() const=0;
|
||||
virtual float GetThreatWarningFraction() const=0;
|
||||
virtual float GetMissileWarningFraction() const=0;
|
||||
virtual float GetMissileWarningPulseTime() const=0;
|
||||
virtual float GetScanAppearanceOffset() const=0;
|
||||
|
|
|
@ -22,6 +22,9 @@ struct ITweakGuiColors : BigYAML
|
|||
zeus::CColor shadow;
|
||||
};
|
||||
|
||||
virtual zeus::CColor GetRadarStuffColor() const=0;
|
||||
virtual zeus::CColor GetRadarPlayerPaintColor() const=0;
|
||||
virtual zeus::CColor GetRadarEnemyPaintColor() const=0;
|
||||
virtual zeus::CColor GetHudMessageFill() const=0;
|
||||
virtual zeus::CColor GetHudMessageOutline() const=0;
|
||||
virtual zeus::CColor GetHudFrameColor() const=0;
|
||||
|
@ -30,22 +33,42 @@ struct ITweakGuiColors : BigYAML
|
|||
virtual zeus::CColor GetEnergyBarShadowLowEnergy() const=0;
|
||||
virtual zeus::CColor GetEnergyBarEmptyLowEnergy() const=0;
|
||||
virtual zeus::CColor GetEnergyWarningFont() const=0;
|
||||
virtual zeus::CColor GetThreatWarningFont() const=0;
|
||||
virtual zeus::CColor GetMissileWarningFont() const=0;
|
||||
virtual zeus::CColor GetThreatBarFilled() const=0;
|
||||
virtual zeus::CColor GetThreatBarShadow() const=0;
|
||||
virtual zeus::CColor GetThreatBarEmpty() const=0;
|
||||
virtual zeus::CColor GetMissileBarFilled() const=0;
|
||||
virtual zeus::CColor GetMissileBarShadow() const=0;
|
||||
virtual zeus::CColor GetMissileBarEmpty() const=0;
|
||||
virtual zeus::CColor GetThreatIconColor() const=0;
|
||||
virtual zeus::CColor GetTickDecoColor() const=0;
|
||||
virtual zeus::CColor GetHelmetLightColor() const=0;
|
||||
virtual zeus::CColor GetThreatIconSafeColor() const=0;
|
||||
virtual zeus::CColor GetMissileIconColorInactive() const=0;
|
||||
virtual zeus::CColor GetMissileIconColorChargedCanAlt() const=0;
|
||||
virtual zeus::CColor GetMissileIconColorChargedNoAlt() const=0;
|
||||
virtual zeus::CColor GetMissileIconColorDepleteAlt() const=0;
|
||||
virtual zeus::CColor GetEnergyWarningOutline() const=0;
|
||||
virtual zeus::CColor GetThreatWarningOutline() const=0;
|
||||
virtual zeus::CColor GetMissileWarningOutline() const=0;
|
||||
virtual zeus::CColor GetEnergyBarFlashColor() const=0;
|
||||
virtual zeus::CColor GetXRayEnergyDecoColor() const=0;
|
||||
virtual zeus::CColor GetPowerBombDigitAvailableFont() const=0;
|
||||
virtual zeus::CColor GetPowerBombDigitAvailableOutline() const=0;
|
||||
virtual zeus::CColor GetBallBombFilledColor() const=0;
|
||||
virtual zeus::CColor GetBallBombEmptyColor() const=0;
|
||||
virtual zeus::CColor GetPowerBombIconAvailableColor() const=0;
|
||||
virtual zeus::CColor GetBallBombEnergyColor() const=0;
|
||||
virtual zeus::CColor GetBallBombDecoColor() const=0;
|
||||
virtual zeus::CColor GetPowerBombDigitDelpetedFont() const=0;
|
||||
virtual zeus::CColor GetPowerBombDigitDelpetedOutline() const=0;
|
||||
virtual zeus::CColor GetPowerBombIconDepletedColor() const=0;
|
||||
virtual zeus::CColor GetThreatIconWarningColor() const=0;
|
||||
virtual zeus::CColor GetHudCounterFill() const=0;
|
||||
virtual zeus::CColor GetHudCounterOutline() const=0;
|
||||
virtual zeus::CColor GetThreatDigitsFont() const=0;
|
||||
virtual zeus::CColor GetThreatDigitsOutline() const=0;
|
||||
virtual zeus::CColor GetMissileDigitsFont() const=0;
|
||||
virtual zeus::CColor GetMissileDigitsOutline() const=0;
|
||||
virtual zeus::CColor GetThermalDecoColor() const=0;
|
||||
|
|
|
@ -13,13 +13,13 @@ struct CTweakGui : ITweakGui
|
|||
Value<bool> x4_;
|
||||
Value<float> x8_mapAlphaInterp;
|
||||
Value<float> xc_;
|
||||
Value<float> x10_;
|
||||
Value<float> x10_radarXYRadius;
|
||||
Value<float> x14_;
|
||||
Value<float> x18_;
|
||||
Value<float> x1c_;
|
||||
Value<float> x20_;
|
||||
Value<float> x24_;
|
||||
Value<float> x28_;
|
||||
Value<float> x24_radarZRadius;
|
||||
Value<float> x28_radarZCloseRadius;
|
||||
atUint32 x2c_ = 0;
|
||||
Value<float> x30_;
|
||||
Value<float> x34_energyBarFilledSpeed;
|
||||
|
@ -62,10 +62,10 @@ struct CTweakGui : ITweakGui
|
|||
Value<float> xd8_;
|
||||
Value<float> xdc_;
|
||||
Value<float> xe0_;
|
||||
Value<float> xe4_;
|
||||
Value<float> xe8_;
|
||||
Value<float> xec_;
|
||||
Value<float> xf0_;
|
||||
Value<float> xe4_maxThreatEnergy;
|
||||
Value<float> xe8_radarScopeCoordRadius;
|
||||
Value<float> xec_radarPlayerPaintRadius;
|
||||
Value<float> xf0_radarEnemyPaintRadius;
|
||||
Value<float> xf4_missileArrowVisTime;
|
||||
Value<EHudVisMode> xf8_hudVisMode;
|
||||
Value<EHelmetVisMode> xfc_helmetVisMode;
|
||||
|
@ -73,7 +73,7 @@ struct CTweakGui : ITweakGui
|
|||
Value<atUint32> x104_;
|
||||
Value<atUint32> x108_enableTargetingManager;
|
||||
Value<atUint32> x10c_enablePlayerVisor;
|
||||
Value<float> x110_;
|
||||
Value<float> x110_threatWarningFraction;
|
||||
Value<float> x114_missileWarningFraction;
|
||||
Value<float> x118_;
|
||||
Value<float> x11c_;
|
||||
|
@ -196,6 +196,9 @@ struct CTweakGui : ITweakGui
|
|||
CTweakGui(athena::io::IStreamReader& r) { this->read(r); }
|
||||
|
||||
float GetMapAlphaInterpolant() const { return x8_mapAlphaInterp; }
|
||||
float GetRadarXYRadius() const { return x10_radarXYRadius; }
|
||||
float GetRadarZRadius() const { return x24_radarZRadius; }
|
||||
float GetRadarZCloseRadius() const { return x28_radarZCloseRadius; }
|
||||
float GetEnergyBarFilledSpeed() const { return x34_energyBarFilledSpeed; }
|
||||
float GetEnergyBarShadowSpeed() const { return x38_energyBarShadowSpeed; }
|
||||
float GetEnergyBarDrainDelay() const { return x3c_energyBarDrainDelay; }
|
||||
|
@ -203,12 +206,17 @@ struct CTweakGui : ITweakGui
|
|||
atUint32 GetHudCamFovTweak() const { return xa8_hudCamFovTweak; }
|
||||
atUint32 GetHudCamYTweak() const { return xac_hudCamYTweak; }
|
||||
atUint32 GetHudCamZTweak() const { return xb0_hudCamZTweak; }
|
||||
float GetMaxThreatEnergy() const { return xe4_maxThreatEnergy; }
|
||||
float GetRadarScopeCoordRadius() const { return xe8_radarScopeCoordRadius; }
|
||||
float GetRadarPlayerPaintRadius() const { return xec_radarPlayerPaintRadius; }
|
||||
float GetRadarEnemyPaintRadius() const { return xf0_radarEnemyPaintRadius; }
|
||||
float GetMissileArrowVisTime() const { return xf4_missileArrowVisTime; }
|
||||
EHudVisMode GetHudVisMode() const { return xf8_hudVisMode; }
|
||||
EHelmetVisMode GetHelmetVisMode() const { return xfc_helmetVisMode; }
|
||||
atUint32 GetEnableAutoMapper() const { return x100_enableAutoMapper; }
|
||||
atUint32 GetEnableTargetingManager() const { return x108_enableTargetingManager; }
|
||||
atUint32 GetEnablePlayerVisor() const { return x10c_enablePlayerVisor; }
|
||||
float GetThreatWarningFraction() const { return x110_threatWarningFraction; }
|
||||
float GetMissileWarningFraction() const { return x114_missileWarningFraction; }
|
||||
float GetMissileWarningPulseTime() const { return x1a0_missileWarningPulseTime; }
|
||||
float GetScanAppearanceOffset() const { return x244_scanAppearanceOffset; }
|
||||
|
|
|
@ -11,9 +11,9 @@ struct CTweakGuiColors : public ITweakGuiColors
|
|||
{
|
||||
DECL_YAML
|
||||
DNAColor x4_;
|
||||
DNAColor x8_;
|
||||
DNAColor xc_;
|
||||
DNAColor x10_;
|
||||
DNAColor x8_radarStuffColor;
|
||||
DNAColor xc_radarPlayerPaintColor;
|
||||
DNAColor x10_radarEnemyPaintColor;
|
||||
DNAColor x14_hudMessageFill;
|
||||
DNAColor x18_hudMessageOutline;
|
||||
DNAColor x1c_hudFrameColor;
|
||||
|
@ -33,19 +33,19 @@ struct CTweakGuiColors : public ITweakGuiColors
|
|||
DNAColor x54_;
|
||||
DNAColor x58_;
|
||||
DNAColor x5c_energyWarningFont;
|
||||
DNAColor x60_;
|
||||
DNAColor x60_threatWarningFont;
|
||||
DNAColor x64_missileWarningFont;
|
||||
DNAColor x68_;
|
||||
DNAColor x6c_;
|
||||
DNAColor x70_;
|
||||
DNAColor x68_threatBarFilled;
|
||||
DNAColor x6c_threatBarShadow;
|
||||
DNAColor x70_threatBarEmpty;
|
||||
DNAColor x74_missileBarFilled;
|
||||
DNAColor x78_missileBarShadow;
|
||||
DNAColor x7c_missileBarEmpty;
|
||||
DNAColor x80_;
|
||||
DNAColor x80_threatIconColor;
|
||||
DNAColor x84_;
|
||||
DNAColor x88_tickDecoColor;
|
||||
DNAColor x8c_helmetLightColor;
|
||||
DNAColor x90_;
|
||||
DNAColor x90_threatIconSafeColor;
|
||||
DNAColor x94_missileIconColorInactive;
|
||||
DNAColor x98_missileIconColorChargedCanAlt;
|
||||
DNAColor x9c_missileIconColorChargedNoAlt;
|
||||
|
@ -55,7 +55,7 @@ struct CTweakGuiColors : public ITweakGuiColors
|
|||
DNAColor xac_;
|
||||
DNAColor xb0_;
|
||||
DNAColor xb4_energyWarningOutline;
|
||||
DNAColor xb8_;
|
||||
DNAColor xb8_threatWarningOutline;
|
||||
DNAColor xbc_missileWarningOutline;
|
||||
DNAColor xc0_;
|
||||
DNAColor xc4_;
|
||||
|
@ -88,23 +88,23 @@ struct CTweakGuiColors : public ITweakGuiColors
|
|||
DNAColor x130_;
|
||||
DNAColor x134_;
|
||||
DNAColor x138_;
|
||||
DNAColor x13c_;
|
||||
DNAColor x140_;
|
||||
DNAColor x13c_powerBombDigitAvailableFont;
|
||||
DNAColor x140_powerBombDigitAvailableOutline;
|
||||
DNAColor x144_;
|
||||
DNAColor x148_;
|
||||
DNAColor x14c_;
|
||||
DNAColor x150_;
|
||||
DNAColor x148_ballBombFilled;
|
||||
DNAColor x14c_ballBombEmpty;
|
||||
DNAColor x150_powerBombIconAvailable;
|
||||
DNAColor x154_;
|
||||
DNAColor x158_;
|
||||
DNAColor x15c_;
|
||||
DNAColor x160_;
|
||||
DNAColor x164_;
|
||||
DNAColor x168_;
|
||||
DNAColor x158_ballEnergyDeco;
|
||||
DNAColor x15c_ballBombDeco;
|
||||
DNAColor x160_powerBombDigitDepletedFont;
|
||||
DNAColor x164_powerBombDigitDepletedOutline;
|
||||
DNAColor x168_powerBombIconUnavailable;
|
||||
DNAColor x16c_;
|
||||
DNAColor x170_;
|
||||
DNAColor x174_;
|
||||
DNAColor x178_;
|
||||
DNAColor x17c_;
|
||||
DNAColor x17c_threatIconWarningColor;
|
||||
DNAColor x180_hudCounterFill;
|
||||
DNAColor x184_hudCounterOutline;
|
||||
DNAColor x188_;
|
||||
|
@ -112,8 +112,8 @@ struct CTweakGuiColors : public ITweakGuiColors
|
|||
DNAColor x190_;
|
||||
DNAColor x194_;
|
||||
DNAColor x198_;
|
||||
DNAColor x19c_;
|
||||
DNAColor x1a0_;
|
||||
DNAColor x19c_threatDigitsFont;
|
||||
DNAColor x1a0_threatDigitsOutline;
|
||||
DNAColor x1a4_missileDigitsFont;
|
||||
DNAColor x1a8_missileDigitsOutline;
|
||||
DNAColor x1ac_thermalDecoColor;
|
||||
|
@ -140,6 +140,9 @@ struct CTweakGuiColors : public ITweakGuiColors
|
|||
CTweakGuiColors() = default;
|
||||
CTweakGuiColors(athena::io::IStreamReader& r) { this->read(r); }
|
||||
|
||||
zeus::CColor GetRadarStuffColor() const { return x8_radarStuffColor; }
|
||||
zeus::CColor GetRadarPlayerPaintColor() const { return xc_radarPlayerPaintColor; }
|
||||
zeus::CColor GetRadarEnemyPaintColor() const { return x10_radarEnemyPaintColor; }
|
||||
zeus::CColor GetHudMessageFill() const { return x14_hudMessageFill; }
|
||||
zeus::CColor GetHudMessageOutline() const { return x18_hudMessageOutline; }
|
||||
zeus::CColor GetHudFrameColor() const { return x1c_hudFrameColor; }
|
||||
|
@ -148,22 +151,42 @@ struct CTweakGuiColors : public ITweakGuiColors
|
|||
zeus::CColor GetEnergyBarShadowLowEnergy() const { return x38_energyBarShadowLowEnergy; }
|
||||
zeus::CColor GetEnergyBarEmptyLowEnergy() const { return x3c_energyBarEmptyLowEnergy; }
|
||||
zeus::CColor GetEnergyWarningFont() const { return x5c_energyWarningFont; }
|
||||
zeus::CColor GetThreatWarningFont() const { return x60_threatWarningFont; }
|
||||
zeus::CColor GetMissileWarningFont() const { return x64_missileWarningFont; }
|
||||
zeus::CColor GetThreatBarFilled() const { return x68_threatBarFilled; }
|
||||
zeus::CColor GetThreatBarShadow() const { return x6c_threatBarShadow; }
|
||||
zeus::CColor GetThreatBarEmpty() const { return x70_threatBarEmpty; }
|
||||
zeus::CColor GetMissileBarFilled() const { return x74_missileBarFilled; }
|
||||
zeus::CColor GetMissileBarShadow() const { return x78_missileBarShadow; }
|
||||
zeus::CColor GetMissileBarEmpty() const { return x7c_missileBarEmpty; }
|
||||
zeus::CColor GetThreatIconColor() const { return x80_threatIconColor; }
|
||||
zeus::CColor GetTickDecoColor() const { return x88_tickDecoColor; }
|
||||
zeus::CColor GetHelmetLightColor() const { return x8c_helmetLightColor; }
|
||||
zeus::CColor GetThreatIconSafeColor() const { return x90_threatIconSafeColor; }
|
||||
zeus::CColor GetMissileIconColorInactive() const { return x94_missileIconColorInactive; }
|
||||
zeus::CColor GetMissileIconColorChargedCanAlt() const { return x98_missileIconColorChargedCanAlt; }
|
||||
zeus::CColor GetMissileIconColorChargedNoAlt() const { return x9c_missileIconColorChargedNoAlt; }
|
||||
zeus::CColor GetMissileIconColorDepleteAlt() const { return xa0_missileIconColorDepleteAlt; }
|
||||
zeus::CColor GetEnergyWarningOutline() const { return xb4_energyWarningOutline; }
|
||||
zeus::CColor GetThreatWarningOutline() const { return xb8_threatWarningOutline; }
|
||||
zeus::CColor GetMissileWarningOutline() const { return xbc_missileWarningOutline; }
|
||||
zeus::CColor GetEnergyBarFlashColor() const { return xe8_energyBarFlashColor; }
|
||||
zeus::CColor GetXRayEnergyDecoColor() const { return x100_xrayEnergyDecoColor; }
|
||||
zeus::CColor GetPowerBombDigitAvailableFont() const { return x13c_powerBombDigitAvailableFont; }
|
||||
zeus::CColor GetPowerBombDigitAvailableOutline() const { return x140_powerBombDigitAvailableOutline; }
|
||||
zeus::CColor GetBallBombFilledColor() const { return x148_ballBombFilled; }
|
||||
zeus::CColor GetBallBombEmptyColor() const { return x14c_ballBombEmpty; }
|
||||
zeus::CColor GetPowerBombIconAvailableColor() const { return x150_powerBombIconAvailable; }
|
||||
zeus::CColor GetBallBombEnergyColor() const { return x158_ballEnergyDeco; }
|
||||
zeus::CColor GetBallBombDecoColor() const { return x15c_ballBombDeco; }
|
||||
zeus::CColor GetPowerBombDigitDelpetedFont() const { return x160_powerBombDigitDepletedFont; }
|
||||
zeus::CColor GetPowerBombDigitDelpetedOutline() const { return x164_powerBombDigitDepletedOutline; }
|
||||
zeus::CColor GetPowerBombIconDepletedColor() const { return x168_powerBombIconUnavailable; }
|
||||
zeus::CColor GetThreatIconWarningColor() const { return x17c_threatIconWarningColor; }
|
||||
zeus::CColor GetHudCounterFill() const { return x180_hudCounterFill; }
|
||||
zeus::CColor GetHudCounterOutline() const { return x184_hudCounterOutline; }
|
||||
zeus::CColor GetThreatDigitsFont() const { return x19c_threatDigitsFont; }
|
||||
zeus::CColor GetThreatDigitsOutline() const { return x1a0_threatDigitsOutline; }
|
||||
zeus::CColor GetMissileDigitsFont() const { return x1a4_missileDigitsFont; }
|
||||
zeus::CColor GetMissileDigitsOutline() const { return x1a8_missileDigitsOutline; }
|
||||
zeus::CColor GetThermalDecoColor() const { return x1ac_thermalDecoColor; }
|
||||
|
|
|
@ -86,7 +86,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
|
|||
zeus::CTransform playerXf = player->GetTransform();
|
||||
zeus::CVector3f rVec =
|
||||
playerXf.rotate({0.f, std::min(std::fabs(std::cos(x1c0_)), 1.0f), std::min(std::fabs(std::sin(x1c0_)), 1.0f)});
|
||||
if (player->x3dc_)
|
||||
if (player->x3dc_inFreeLook)
|
||||
{
|
||||
float angle = player->x3ec_;
|
||||
if (std::fabs(player->x3ec_) > (g_tweakPlayer->GetX124() - std::fabs(x1c0_)))
|
||||
|
@ -124,7 +124,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
|
|||
}
|
||||
else if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Zero &&
|
||||
player->GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphed &&
|
||||
player->x3dc_ && x1c4_pitchId == kInvalidUniqueId)
|
||||
player->x3dc_inFreeLook && x1c4_pitchId == kInvalidUniqueId)
|
||||
{
|
||||
if (player->x294_ > 0.f)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
|
|||
zeus::CTransform gunXf = x190_gunFollowXf;
|
||||
zeus::CQuaternion qGun = zeus::CQuaternion::skNoRotation;
|
||||
|
||||
if (player->x3dc_)
|
||||
if (player->x3dc_inFreeLook)
|
||||
{
|
||||
if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Four ||
|
||||
player->GetOrbitState() == CPlayer::EPlayerOrbitState::One)
|
||||
|
|
|
@ -57,10 +57,12 @@ enum class EMaterialTypes
|
|||
AIBlock = 48,
|
||||
Platform = 49,
|
||||
NonSolidDamageable = 50,
|
||||
RadarObject = 51,
|
||||
PlatformSlave = 52,
|
||||
Unknown54 = 54,
|
||||
Unknown55 = 55,
|
||||
ExcludeFromLineOfSightTest = 56,
|
||||
ExcludeFromRadar = 57,
|
||||
SixtyThree = 63
|
||||
};
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@ if(WIN32)
|
|||
Shaders/CTextSupportShaderHLSL.cpp
|
||||
Shaders/CFogVolumePlaneShaderHLSL.cpp
|
||||
Shaders/CFogVolumeFilterHLSL.cpp
|
||||
Shaders/CEnergyBarShaderHLSL.cpp)
|
||||
Shaders/CEnergyBarShaderHLSL.cpp
|
||||
Shaders/CRadarPaintShaderHLSL.cpp)
|
||||
elseif(BOO_HAS_METAL)
|
||||
set(PLAT_SRCS
|
||||
Shaders/CLineRendererShadersMetal.cpp
|
||||
|
@ -27,7 +28,8 @@ elseif(BOO_HAS_METAL)
|
|||
Shaders/CTextSupportShaderMetal.cpp
|
||||
Shaders/CFogVolumePlaneShaderMetal.cpp
|
||||
Shaders/CFogVolumeFilterMetal.cpp
|
||||
Shaders/CEnergyBarShaderMetal.cpp)
|
||||
Shaders/CEnergyBarShaderMetal.cpp
|
||||
Shaders/CRadarPaintShaderMetal.cpp)
|
||||
endif()
|
||||
|
||||
set(GRAPHICS_SOURCES
|
||||
|
@ -64,6 +66,7 @@ set(GRAPHICS_SOURCES
|
|||
Shaders/CFogVolumePlaneShader.hpp Shaders/CFogVolumePlaneShader.cpp Shaders/CFogVolumePlaneShaderGLSL.cpp
|
||||
Shaders/CFogVolumeFilter.hpp Shaders/CFogVolumeFilter.cpp Shaders/CFogVolumeFilterGLSL.cpp
|
||||
Shaders/CEnergyBarShader.hpp Shaders/CEnergyBarShader.cpp Shaders/CEnergyBarShaderGLSL.cpp
|
||||
Shaders/CRadarPaintShader.hpp Shaders/CRadarPaintShader.cpp Shaders/CRadarPaintShaderGLSL.cpp
|
||||
${PLAT_SRCS})
|
||||
|
||||
runtime_add_list(Graphics GRAPHICS_SOURCES)
|
||||
|
|
|
@ -9,7 +9,7 @@ static const char* VS =
|
|||
"#version 330\n"
|
||||
BOO_GLSL_BINDING_HEAD
|
||||
"layout(location=0) in vec4 posIn;\n"
|
||||
"layout(location=0) in vec4 uvIn;\n"
|
||||
"layout(location=1) in vec4 uvIn;\n"
|
||||
"\n"
|
||||
"UBINDING0 uniform EnergyBarUniform\n"
|
||||
"{\n"
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
#include "CRadarPaintShader.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
void CRadarPaintShader::draw(const std::vector<Instance>& instances, const CTexture* tex)
|
||||
{
|
||||
if (!instances.size())
|
||||
return;
|
||||
|
||||
if (instances.size() > m_maxInsts)
|
||||
{
|
||||
m_maxInsts = instances.size();
|
||||
m_tex = tex;
|
||||
m_token = CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx)
|
||||
{
|
||||
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(Instance), m_maxInsts);
|
||||
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(zeus::CMatrix4f), 1);
|
||||
TShader<CRadarPaintShader>::BuildShaderDataBinding(ctx, *this);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
zeus::CMatrix4f uniMtx = CGraphics::GetPerspectiveProjectionMatrix(true) * CGraphics::g_GXModelView.toMatrix4f();
|
||||
m_uniBuf->load(&uniMtx, sizeof(zeus::CMatrix4f));
|
||||
|
||||
size_t mapSz = sizeof(Instance) * instances.size();
|
||||
Instance* insts = reinterpret_cast<Instance*>(m_vbo->map(mapSz));
|
||||
memmove(insts, instances.data(), mapSz);
|
||||
m_vbo->unmap();
|
||||
|
||||
CGraphics::SetShaderDataBinding(m_dataBind);
|
||||
CGraphics::DrawInstances(0, 4, instances.size());
|
||||
}
|
||||
|
||||
URDE_SPECIALIZE_SHADER(CRadarPaintShader)
|
||||
|
||||
void CRadarPaintShader::Shutdown() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef __URDE_CRADARPAINTSHADER_HPP__
|
||||
#define __URDE_CRADARPAINTSHADER_HPP__
|
||||
|
||||
#include "TShader.hpp"
|
||||
#include "zeus/CMatrix4f.hpp"
|
||||
#include "zeus/CColor.hpp"
|
||||
#include "zeus/CRectangle.hpp"
|
||||
#include "Camera/CCameraFilter.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
class CRadarPaintShader
|
||||
{
|
||||
friend struct CRadarPaintShaderGLDataBindingFactory;
|
||||
friend struct CRadarPaintShaderVulkanDataBindingFactory;
|
||||
friend struct CRadarPaintShaderMetalDataBindingFactory;
|
||||
friend struct CRadarPaintShaderD3DDataBindingFactory;
|
||||
|
||||
public:
|
||||
struct Instance
|
||||
{
|
||||
zeus::CVector3f pos[4];
|
||||
zeus::CVector2f uv[4];
|
||||
zeus::CColor color;
|
||||
};
|
||||
|
||||
private:
|
||||
boo::GraphicsDataToken m_token;
|
||||
boo::IGraphicsBufferD* m_vbo;
|
||||
boo::IGraphicsBufferD* m_uniBuf;
|
||||
boo::IShaderDataBinding* m_dataBind;
|
||||
const CTexture* m_tex = nullptr;
|
||||
size_t m_maxInsts = 0;
|
||||
|
||||
public:
|
||||
void draw(const std::vector<Instance>& instances, const CTexture* tex);
|
||||
|
||||
using _CLS = CRadarPaintShader;
|
||||
#include "TShaderDecl.hpp"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __URDE_CRADARPAINTSHADER_HPP__
|
|
@ -0,0 +1,137 @@
|
|||
#include "CRadarPaintShader.hpp"
|
||||
#include "TShader.hpp"
|
||||
#include "Graphics/CTexture.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
static const char* VS =
|
||||
"#version 330\n"
|
||||
BOO_GLSL_BINDING_HEAD
|
||||
"layout(location=0) in vec4 posIn[4];\n"
|
||||
"layout(location=4) in vec4 uvIn[4];\n"
|
||||
"layout(location=8) in vec4 colorIn;\n"
|
||||
"\n"
|
||||
"UBINDING0 uniform RadarPaintUniform\n"
|
||||
"{\n"
|
||||
" mat4 xf;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"struct VertToFrag\n"
|
||||
"{\n"
|
||||
" vec4 color;\n"
|
||||
" vec2 uv;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"SBINDING(0) out VertToFrag vtf;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" vtf.color = colorIn;\n"
|
||||
" vtf.uv = uvIn[gl_VertexID].xy;\n"
|
||||
" gl_Position = xf * vec4(posIn[gl_VertexID].xyz, 1.0);\n"
|
||||
"}\n";
|
||||
|
||||
static const char* FS =
|
||||
"#version 330\n"
|
||||
BOO_GLSL_BINDING_HEAD
|
||||
"struct VertToFrag\n"
|
||||
"{\n"
|
||||
" vec4 color;\n"
|
||||
" vec2 uv;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"SBINDING(0) in VertToFrag vtf;\n"
|
||||
"layout(location=0) out vec4 colorOut;\n"
|
||||
"TBINDING0 uniform sampler2D tex;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" colorOut = vtf.color * texture(tex, vtf.uv);\n"
|
||||
"}\n";
|
||||
|
||||
URDE_DECL_SPECIALIZE_SHADER(CRadarPaintShader)
|
||||
|
||||
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||
|
||||
struct CRadarPaintShaderGLDataBindingFactory : TShader<CRadarPaintShader>::IDataBindingFactory
|
||||
{
|
||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||
CRadarPaintShader& filter)
|
||||
{
|
||||
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
|
||||
|
||||
const boo::VertexElementDescriptor VtxVmt[] =
|
||||
{
|
||||
{filter.m_vbo, nullptr, boo::VertexSemantic::Position4, 0},
|
||||
{filter.m_vbo, nullptr, boo::VertexSemantic::Position4, 1},
|
||||
{filter.m_vbo, nullptr, boo::VertexSemantic::Position4, 2},
|
||||
{filter.m_vbo, nullptr, boo::VertexSemantic::Position4, 3},
|
||||
{filter.m_vbo, nullptr, boo::VertexSemantic::UV4, 0},
|
||||
{filter.m_vbo, nullptr, boo::VertexSemantic::UV4, 1},
|
||||
{filter.m_vbo, nullptr, boo::VertexSemantic::UV4, 2},
|
||||
{filter.m_vbo, nullptr, boo::VertexSemantic::UV4, 3},
|
||||
{filter.m_vbo, nullptr, boo::VertexSemantic::Color}
|
||||
};
|
||||
boo::IVertexFormat* vtxFmt = ctx.newVertexFormat(9, VtxVmt);
|
||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||
boo::ITexture* texs[] = {filter.m_tex->GetBooTexture()};
|
||||
return cctx.newShaderDataBinding(s_Pipeline,
|
||||
vtxFmt, nullptr, filter.m_vbo, nullptr,
|
||||
1, bufs, stages, nullptr, nullptr, 1, texs, nullptr, nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
#if BOO_HAS_VULKAN
|
||||
struct CRadarPaintShaderVulkanDataBindingFactory : TShader<CRadarPaintShader>::IDataBindingFactory
|
||||
{
|
||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||
CEnergyBarShader& filter)
|
||||
{
|
||||
boo::VulkanDataFactory::Context& cctx = static_cast<boo::VulkanDataFactory::Context&>(ctx);
|
||||
|
||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||
boo::ITexture* texs[] = {filter.m_tex->GetBooTexture()};
|
||||
return cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
|
||||
nullptr, filter.m_vbo, nullptr, 1, bufs,
|
||||
nullptr, nullptr, nullptr, 1, texs, nullptr, nullptr);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
TShader<CRadarPaintShader>::IDataBindingFactory*
|
||||
CRadarPaintShader::Initialize(boo::GLDataFactory::Context& ctx)
|
||||
{
|
||||
const char* uniNames[] = {"RadarPaintUniform"};
|
||||
const char* texNames[] = {"tex"};
|
||||
s_Pipeline = ctx.newShaderPipeline(VS, FS, 1, texNames, 1, uniNames, boo::BlendFactor::SrcAlpha,
|
||||
boo::BlendFactor::One, boo::Primitive::TriStrips,
|
||||
boo::ZTest::None, false, true, false, boo::CullMode::None);
|
||||
return new CRadarPaintShaderGLDataBindingFactory;
|
||||
}
|
||||
|
||||
#if BOO_HAS_VULKAN
|
||||
TShader<CRadarPaintShader>::IDataBindingFactory*
|
||||
CRadarPaintShader::Initialize(boo::VulkanDataFactory::Context& ctx)
|
||||
{
|
||||
const boo::VertexElementDescriptor VtxVmt[] =
|
||||
{
|
||||
{nullptr, nullptr, boo::VertexSemantic::Position4, 0},
|
||||
{nullptr, nullptr, boo::VertexSemantic::Position4, 1},
|
||||
{nullptr, nullptr, boo::VertexSemantic::Position4, 2},
|
||||
{nullptr, nullptr, boo::VertexSemantic::Position4, 3},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4, 0},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4, 1},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4, 2},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4, 3},
|
||||
{nullptr, nullptr, boo::VertexSemantic::Color}
|
||||
};
|
||||
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||
s_Pipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, boo::BlendFactor::SrcAlpha,
|
||||
boo::BlendFactor::One, boo::Primitive::TriStrips,
|
||||
boo::ZTest::None, false, true, false, boo::CullMode::None);
|
||||
return new CRadarPaintShaderVulkanDataBindingFactory;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
#include "CRadarPaintShader.hpp"
|
||||
#include "TShader.hpp"
|
||||
#include "Graphics/CTexture.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
static const char* VS =
|
||||
"#include <metal_stdlib>\n"
|
||||
"using namespace metal;\n"
|
||||
"struct VertData\n"
|
||||
"{\n"
|
||||
" float4 posIn[4];\n"
|
||||
" float4 uvIn[4];\n"
|
||||
" float4 colorIn;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"struct RadarPaintUniform\n"
|
||||
"{\n"
|
||||
" float4x4 xf;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"struct VertToFrag\n"
|
||||
"{\n"
|
||||
" float4 position [[ position ]];\n"
|
||||
" float4 color;\n"
|
||||
" float2 uv;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"vertex VertToFrag vmain(constant VertData* va [[ buffer(1) ]],\n"
|
||||
" uint vertId [[ vertex_id ]], uint instId [[ instance_id ]],\n"
|
||||
" constant RadarPaintUniform& rpu [[ buffer(2) ]])\n"
|
||||
"{\n"
|
||||
" VertToFrag vtf;\n"
|
||||
" constant VertData& v = va[instId];\n"
|
||||
" vtf.color = v.colorIn;\n"
|
||||
" vtf.uv = v.uvIn[vertId].xy;\n"
|
||||
" vtf.position = rpu.xf * vec4(v.posIn[vertId].xyz, 1.0);\n"
|
||||
" return vtf;\n"
|
||||
"}\n";
|
||||
|
||||
static const char* FS =
|
||||
"#include <metal_stdlib>\n"
|
||||
"using namespace metal;\n"
|
||||
"constexpr sampler samp(address::repeat, filter::linear, mip_filter::linear);\n"
|
||||
"struct VertToFrag\n"
|
||||
"{\n"
|
||||
" float4 position [[ position ]];\n"
|
||||
" float4 color;\n"
|
||||
" float2 uv;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]],\n"
|
||||
" texture2d<float> tex [[ texture(0) ]])\n"
|
||||
"{\n"
|
||||
" return vtf.color * tex.sample(samp, vtf.uv);\n"
|
||||
"}\n";
|
||||
|
||||
URDE_DECL_SPECIALIZE_SHADER(CRadarPaintShader)
|
||||
|
||||
static boo::IVertexFormat* s_VtxFmt = nullptr;
|
||||
static boo::IShaderPipeline* s_Pipeline = nullptr;
|
||||
|
||||
struct CRadarPaintShaderMetalDataBindingFactory : TShader<CRadarPaintShader>::IDataBindingFactory
|
||||
{
|
||||
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||
CRadarPaintShader& filter)
|
||||
{
|
||||
boo::MetalDataFactory::Context& cctx = static_cast<boo::MetalDataFactory::Context&>(ctx);
|
||||
|
||||
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
|
||||
boo::ITexture* texs[] = {filter.m_tex->GetBooTexture()};
|
||||
return cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
|
||||
nullptr, filter.m_vbo, nullptr, 1, bufs,
|
||||
nullptr, nullptr, nullptr, 1, texs, nullptr, nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
TShader<CRadarPaintShader>::IDataBindingFactory*
|
||||
CRadarPaintShader::Initialize(boo::MetalDataFactory::Context& ctx)
|
||||
{
|
||||
const boo::VertexElementDescriptor VtxVmt[] =
|
||||
{
|
||||
{nullptr, nullptr, boo::VertexSemantic::Position4, 0},
|
||||
{nullptr, nullptr, boo::VertexSemantic::Position4, 1},
|
||||
{nullptr, nullptr, boo::VertexSemantic::Position4, 2},
|
||||
{nullptr, nullptr, boo::VertexSemantic::Position4, 3},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4, 0},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4, 1},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4, 2},
|
||||
{nullptr, nullptr, boo::VertexSemantic::UV4, 3},
|
||||
{nullptr, nullptr, boo::VertexSemantic::Color}
|
||||
};
|
||||
s_VtxFmt = ctx.newVertexFormat(2, VtxVmt);
|
||||
s_Pipeline = ctx.newShaderPipeline(VS, FS, s_VtxFmt, CGraphics::g_ViewportSamples,
|
||||
boo::BlendFactor::SrcAlpha,
|
||||
boo::BlendFactor::One, boo::Primitive::TriStrips,
|
||||
boo::ZTest::None, false, true, false, boo::CullMode::None);
|
||||
return new CRadarPaintShaderMetalDataBindingFactory;
|
||||
}
|
||||
|
||||
}
|
|
@ -48,6 +48,7 @@ public:
|
|||
void Draw(const CGuiWidgetDrawParms& drawParms) const;
|
||||
float GetActualFraction() const { return xe0_maxEnergy == 0.f ? 0.f : xf4_setEnergy / xe0_maxEnergy; }
|
||||
float GetSetEnergy() const { return xf4_setEnergy; }
|
||||
float GetMaxEnergy() const { return xe0_maxEnergy; }
|
||||
float GetFilledEnergy() const { return xf8_filledEnergy; }
|
||||
void SetCurrEnergy(float e, ESetMode mode);
|
||||
void SetCoordFunc(FCoordFunc func) { xd8_coordFunc = func; }
|
||||
|
|
|
@ -1,11 +1,115 @@
|
|||
#include "CHudBallInterface.hpp"
|
||||
#include "CGuiFrame.hpp"
|
||||
#include "CGuiGroup.hpp"
|
||||
#include "CGuiCamera.hpp"
|
||||
#include "CGuiTextPane.hpp"
|
||||
#include "CGuiModel.hpp"
|
||||
#include "GameGlobalObjects.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
CHudBallInterface::CHudBallInterface(CGuiFrame& selHud, int bombAmount, int bombCapacity,
|
||||
int availableBombs, bool hasBombs, bool hasPb)
|
||||
: x40_bombAmount(bombAmount), x44_bombCapacity(bombCapacity),
|
||||
x48_availableBombs(availableBombs), x4c_hasPb(hasPb)
|
||||
{
|
||||
x0_camera = selHud.GetFrameCamera();
|
||||
x4_basewidget_bombstuff = selHud.FindWidget("basewidget_bombstuff");
|
||||
x8_basewidget_bombdeco = selHud.FindWidget("basewidget_bombdeco");
|
||||
xc_model_bombicon = static_cast<CGuiModel*>(selHud.FindWidget("model_bombicon"));
|
||||
x10_textpane_bombdigits = static_cast<CGuiTextPane*>(selHud.FindWidget("textpane_bombdigits"));
|
||||
for (int i=0 ; i<3 ; ++i)
|
||||
{
|
||||
CGuiGroup* grp = static_cast<CGuiGroup*>(selHud.FindWidget(hecl::Format("group_bombcount%d", i).c_str()));
|
||||
CGuiWidget* filled = grp->GetWorkerWidget(1);
|
||||
CGuiWidget* empty = grp->GetWorkerWidget(0);
|
||||
x14_group_bombfilled.push_back(filled);
|
||||
x24_group_bombempty.push_back(empty);
|
||||
if (filled)
|
||||
filled->SetColor(g_tweakGuiColors->GetBallBombFilledColor());
|
||||
if (empty)
|
||||
empty->SetColor(g_tweakGuiColors->GetBallBombEmptyColor());
|
||||
}
|
||||
x8_basewidget_bombdeco->SetColor(g_tweakGuiColors->GetBallBombDecoColor());
|
||||
x34_camPos = x0_camera->GetLocalPosition();
|
||||
if (CGuiWidget* w = selHud.FindWidget("basewidget_energydeco"))
|
||||
w->SetColor(g_tweakGuiColors->GetBallBombEnergyColor());
|
||||
SetBombParams(bombAmount, bombCapacity, availableBombs, hasBombs, hasPb, true);
|
||||
}
|
||||
|
||||
void CHudBallInterface::UpdatePowerBombReadoutColors()
|
||||
{
|
||||
zeus::CColor fontColor;
|
||||
zeus::CColor outlineColor;
|
||||
if (x40_bombAmount > 0)
|
||||
{
|
||||
fontColor = g_tweakGuiColors->GetPowerBombDigitAvailableFont();
|
||||
outlineColor = g_tweakGuiColors->GetPowerBombDigitAvailableOutline();
|
||||
}
|
||||
else if (x44_bombCapacity > 0)
|
||||
{
|
||||
fontColor = g_tweakGuiColors->GetPowerBombDigitDelpetedFont();
|
||||
outlineColor = g_tweakGuiColors->GetPowerBombDigitDelpetedOutline();
|
||||
}
|
||||
else
|
||||
{
|
||||
fontColor = zeus::CColor::skClear;
|
||||
outlineColor = zeus::CColor::skClear;
|
||||
}
|
||||
x10_textpane_bombdigits->TextSupport()->SetFontColor(fontColor);
|
||||
x10_textpane_bombdigits->TextSupport()->SetOutlineColor(outlineColor);
|
||||
|
||||
zeus::CColor iconColor;
|
||||
if (x40_bombAmount > 0 && x4c_hasPb)
|
||||
iconColor = g_tweakGuiColors->GetPowerBombIconAvailableColor();
|
||||
else if (x44_bombCapacity > 0)
|
||||
iconColor = g_tweakGuiColors->GetPowerBombIconDepletedColor();
|
||||
else
|
||||
iconColor = zeus::CColor::skClear;
|
||||
|
||||
xc_model_bombicon->SetColor(iconColor);
|
||||
}
|
||||
|
||||
void CHudBallInterface::SetBombParams(int bombAmount, int bombCapacity, int availableBombs,
|
||||
bool hasBombs, bool hasPb, bool init)
|
||||
{
|
||||
if (bombAmount != x40_bombAmount || init)
|
||||
{
|
||||
x10_textpane_bombdigits->TextSupport()->SetText(hecl::Format("%02d", bombAmount));
|
||||
x40_bombAmount = bombAmount;
|
||||
UpdatePowerBombReadoutColors();
|
||||
}
|
||||
|
||||
if (x44_bombCapacity != bombCapacity || init)
|
||||
{
|
||||
x44_bombCapacity = bombCapacity;
|
||||
UpdatePowerBombReadoutColors();
|
||||
}
|
||||
|
||||
if (x4c_hasPb != hasPb)
|
||||
{
|
||||
x4c_hasPb = hasPb;
|
||||
UpdatePowerBombReadoutColors();
|
||||
}
|
||||
|
||||
for (int i=0 ; i<3 ; ++i)
|
||||
{
|
||||
bool lit = i < availableBombs;
|
||||
x14_group_bombfilled[i]->SetVisibility(lit && hasBombs, ETraversalMode::Children);
|
||||
x24_group_bombempty[i]->SetVisibility(!lit && hasBombs, ETraversalMode::Children);
|
||||
}
|
||||
|
||||
x48_availableBombs = availableBombs;
|
||||
|
||||
x8_basewidget_bombdeco->SetVisibility(hasBombs && x44_bombCapacity > 0, ETraversalMode::Children);
|
||||
}
|
||||
|
||||
void CHudBallInterface::SetBallModeFactor(float t)
|
||||
{
|
||||
|
||||
float tmp = 0.5f * 448.f * g_tweakGui->GetBallViewportYReduction();
|
||||
x0_camera->SetLocalTransform(
|
||||
zeus::CTransform::Translate(x34_camPos + zeus::CVector3f(0.f, 0.f, (t * tmp - tmp) * 0.01f)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,37 @@
|
|||
#ifndef __URDE_CHUDBALLINTERFACE_HPP__
|
||||
#define __URDE_CHUDBALLINTERFACE_HPP__
|
||||
|
||||
#include "rstl.hpp"
|
||||
#include "zeus/CVector3f.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
class CGuiFrame;
|
||||
class CGuiWidget;
|
||||
class CGuiCamera;
|
||||
class CGuiModel;
|
||||
class CGuiTextPane;
|
||||
|
||||
class CHudBallInterface
|
||||
{
|
||||
CGuiCamera* x0_camera;
|
||||
CGuiWidget* x4_basewidget_bombstuff;
|
||||
CGuiWidget* x8_basewidget_bombdeco;
|
||||
CGuiModel* xc_model_bombicon;
|
||||
CGuiTextPane* x10_textpane_bombdigits;
|
||||
rstl::reserved_vector<CGuiWidget*, 3> x14_group_bombfilled;
|
||||
rstl::reserved_vector<CGuiWidget*, 3> x24_group_bombempty;
|
||||
zeus::CVector3f x34_camPos;
|
||||
int x40_bombAmount;
|
||||
int x44_bombCapacity;
|
||||
int x48_availableBombs;
|
||||
bool x4c_hasPb;
|
||||
void UpdatePowerBombReadoutColors();
|
||||
public:
|
||||
CHudBallInterface(CGuiFrame& selHud, int bombAmount, int bombCapacity,
|
||||
int availableBombs, bool hasBombs, bool hasPb);
|
||||
void SetBombParams(int bombAmount, int bombCapacity, int availableBombs,
|
||||
bool hasBombs, bool hasPb, bool init);
|
||||
void SetBallModeFactor(float t);
|
||||
};
|
||||
|
||||
|
|
|
@ -3,19 +3,35 @@
|
|||
namespace urde
|
||||
{
|
||||
|
||||
CHudFreeLookInterfaceCombat::CHudFreeLookInterfaceCombat(CGuiFrame& selHud, bool, bool,
|
||||
bool, bool grapplePoint)
|
||||
CHudFreeLookInterface::CHudFreeLookInterface(CGuiFrame& selHud, EHudType hudType, bool inFreeLook,
|
||||
bool lookControlHeld, bool lockedOnObj)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CHudFreeLookInterfaceCombat::Update(float dt)
|
||||
void CHudFreeLookInterface::Update(float dt)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHudFreeLookInterfaceXRay::CHudFreeLookInterfaceXRay(CGuiFrame& selHud, bool,
|
||||
bool, bool grapplePoint)
|
||||
void CHudFreeLookInterface::SetIsVisibleDebug(bool v)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CHudFreeLookInterface::SetIsVisibleGame(bool v)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CHudFreeLookInterface::SetFreeLookState(bool inFreeLook, bool lookControlHeld,
|
||||
bool lockedOnObj, float vertLookAngle)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHudFreeLookInterfaceXRay::CHudFreeLookInterfaceXRay(CGuiFrame& selHud, bool inFreeLook,
|
||||
bool lookControlHeld, bool lockedOnObj)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -25,4 +41,20 @@ void CHudFreeLookInterfaceXRay::Update(float dt)
|
|||
|
||||
}
|
||||
|
||||
void CHudFreeLookInterfaceXRay::SetIsVisibleDebug(bool v)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CHudFreeLookInterfaceXRay::SetIsVisibleGame(bool v)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CHudFreeLookInterfaceXRay::SetFreeLookState(bool inFreeLook, bool lookControlHeld,
|
||||
bool lockedOnObj, float vertLookAngle)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,29 +1,86 @@
|
|||
#ifndef __URDE_CHUDFREELOOKINTERFACE_HPP__
|
||||
#define __URDE_CHUDFREELOOKINTERFACE_HPP__
|
||||
|
||||
#include "RetroTypes.hpp"
|
||||
#include "CHudInterface.hpp"
|
||||
#include "zeus/CTransform.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
class CGuiFrame;
|
||||
class CGuiWidget;
|
||||
class CGuiModel;
|
||||
|
||||
class IFreeLookInterface
|
||||
{
|
||||
public:
|
||||
virtual ~IFreeLookInterface() = default;
|
||||
virtual void Update(float dt)=0;
|
||||
virtual void SetIsVisibleDebug(bool v)=0;
|
||||
virtual void SetIsVisibleGame(bool v)=0;
|
||||
virtual void SetFreeLookState(bool inFreeLook, bool lookControlHeld,
|
||||
bool lockedOnObj, float vertLookAngle)=0;
|
||||
};
|
||||
|
||||
class CHudFreeLookInterfaceCombat : public IFreeLookInterface
|
||||
class CHudFreeLookInterface : public IFreeLookInterface
|
||||
{
|
||||
EHudType x4_hudType;
|
||||
zeus::CTransform x8_freeLookLeftXf;
|
||||
zeus::CTransform x38_freeLookRightXf;
|
||||
float x68_freeLookInterp = 0.f;
|
||||
float x6c_lockOnInterp;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
bool x70_24_inFreeLook : 1;
|
||||
bool x70_25_lookControlHeld : 1;
|
||||
bool x70_26_lockedOnObj : 1;
|
||||
bool x70_27_visibleDebug : 1;
|
||||
bool x70_28_visibleGame : 1;
|
||||
};
|
||||
u16 _dummy = 0;
|
||||
};
|
||||
CGuiWidget* x74_basewidget_freelookleft;
|
||||
CGuiModel* x78_model_shieldleft;
|
||||
CGuiModel* x7c_model_freelookleft;
|
||||
CGuiWidget* x80_basewidget_freelookright;
|
||||
CGuiModel* x84_model_shieldright;
|
||||
CGuiModel* x88_model_freelookright;
|
||||
CGuiWidget* x8c_basewidget_outlinesb;
|
||||
void UpdateVisibility();
|
||||
public:
|
||||
CHudFreeLookInterfaceCombat(CGuiFrame& selHud, bool, bool, bool, bool grapplePoint);
|
||||
CHudFreeLookInterface(CGuiFrame& selHud, EHudType hudType, bool inFreeLook,
|
||||
bool lookControlHeld, bool lockedOnObj);
|
||||
void Update(float dt);
|
||||
void SetIsVisibleDebug(bool v);
|
||||
void SetIsVisibleGame(bool v);
|
||||
void SetFreeLookState(bool inFreeLook, bool lookControlHeld,
|
||||
bool lockedOnObj, float vertLookAngle);
|
||||
};
|
||||
|
||||
class CHudFreeLookInterfaceXRay : public IFreeLookInterface
|
||||
{
|
||||
zeus::CVector3f x4_freeLookLeftPos;
|
||||
zeus::CVector3f x10_freeLookRightPos;
|
||||
float x1c_freeLookInterp = 0.f;
|
||||
bool x20_inFreeLook;
|
||||
bool x21_lookControlHeld;
|
||||
bool x22_24_inFreeLook : 1;
|
||||
bool x22_25_lookControlHeld : 1;
|
||||
CGuiWidget* x24_basewidget_freelook;
|
||||
CGuiModel* x28_model_shield;
|
||||
CGuiModel* x2c_model_freelookleft;
|
||||
CGuiModel* x30_model_freelookright;
|
||||
void UpdateVisibility();
|
||||
public:
|
||||
CHudFreeLookInterfaceXRay(CGuiFrame& selHud, bool, bool, bool grapplePoint);
|
||||
CHudFreeLookInterfaceXRay(CGuiFrame& selHud, bool inFreeLook,
|
||||
bool lookControlHeld, bool lockedOnObj);
|
||||
void Update(float dt);
|
||||
void SetIsVisibleDebug(bool v);
|
||||
void SetIsVisibleGame(bool v);
|
||||
void SetFreeLookState(bool inFreeLook, bool lookControlHeld,
|
||||
bool lockedOnObj, float vertLookAngle);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,16 +1,175 @@
|
|||
#include "CHudRadarInterface.hpp"
|
||||
#include "GameGlobalObjects.hpp"
|
||||
#include "CSimplePool.hpp"
|
||||
#include "CGuiFrame.hpp"
|
||||
#include "CGuiCamera.hpp"
|
||||
#include "CStateManager.hpp"
|
||||
#include "CGameState.hpp"
|
||||
#include "World/CPlayer.hpp"
|
||||
#include "Camera/CGameCamera.hpp"
|
||||
#include "zeus/CEulerAngles.hpp"
|
||||
#include "Graphics/CBooRenderer.hpp"
|
||||
#include "World/CWallCrawlerSwarm.hpp"
|
||||
#include "GuiSys/CGuiWidgetDrawParms.hpp"
|
||||
#include "TCastTo.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
CHudRadarInterface::CHudRadarInterface(CGuiFrame& selHud, CStateManager& stateMgr)
|
||||
CHudRadarInterface::CHudRadarInterface(CGuiFrame& baseHud, CStateManager& stateMgr)
|
||||
{
|
||||
x0_txtrRadarPaint = g_SimplePool->GetObj("TXTR_RadarPaint");
|
||||
x3c_24_visibleGame = true;
|
||||
x3c_25_visibleDebug = true;
|
||||
x40_BaseWidget_RadarStuff = baseHud.FindWidget("BaseWidget_RadarStuff");
|
||||
x44_camera = baseHud.GetFrameCamera();
|
||||
xc_radarStuffXf = x40_BaseWidget_RadarStuff->GetLocalTransform();
|
||||
x40_BaseWidget_RadarStuff->SetColor(g_tweakGuiColors->GetRadarStuffColor());
|
||||
}
|
||||
|
||||
void CHudRadarInterface::DoDrawRadarPaint(float radius, const zeus::CColor& color) const
|
||||
{
|
||||
radius *= 4.f;
|
||||
const_cast<CHudRadarInterface&>(*this).m_paintInsts.emplace_back();
|
||||
CRadarPaintShader::Instance& inst =
|
||||
const_cast<CHudRadarInterface&>(*this).m_paintInsts.back();
|
||||
inst.pos[0].assign(-radius, 0.f, radius);
|
||||
inst.uv[0].assign(0.f, 1.f);
|
||||
inst.pos[1].assign(-radius, 0.f, -radius);
|
||||
inst.uv[1].assign(0.f, 0.f);
|
||||
inst.pos[2].assign(radius, 0.f, radius);
|
||||
inst.uv[2].assign(1.f, 1.f);
|
||||
inst.pos[3].assign(radius, 0.f, -radius);
|
||||
inst.uv[3].assign(1.f, 0.f);
|
||||
inst.color = color;
|
||||
}
|
||||
|
||||
void CHudRadarInterface::DrawRadarPaint(const zeus::CVector3f& enemyPos, float radius,
|
||||
float alpha, const SRadarPaintDrawParms& parms) const
|
||||
{
|
||||
zeus::CVector2f playerToEnemy(enemyPos.x - parms.x0_playerPos.x,
|
||||
enemyPos.y - parms.x0_playerPos.y);
|
||||
|
||||
float zDelta = std::fabs(enemyPos.z - parms.x0_playerPos.z);
|
||||
|
||||
if (playerToEnemy.magnitude() <= parms.x78_xyRadius && zDelta <= parms.x7c_zRadius)
|
||||
{
|
||||
if (zDelta > parms.x80_ZCloseRadius)
|
||||
alpha *= 1.f - (zDelta - parms.x80_ZCloseRadius) / (parms.x7c_zRadius - parms.x80_ZCloseRadius);
|
||||
zeus::CVector2f scopeScaled = playerToEnemy * parms.x70_scopeScalar;
|
||||
zeus::CTransform modelMatrix = parms.x3c_postTranslate * zeus::CTransform::Translate(
|
||||
parms.xc_preTranslate * zeus::CVector3f(scopeScaled.x, 0.f, scopeScaled.y));
|
||||
CGraphics::SetModelMatrix(modelMatrix);
|
||||
zeus::CColor color = g_tweakGuiColors->GetRadarEnemyPaintColor();
|
||||
color.a *= alpha;
|
||||
DoDrawRadarPaint(radius, color);
|
||||
}
|
||||
}
|
||||
|
||||
void CHudRadarInterface::SetIsVisibleGame(bool v)
|
||||
{
|
||||
x3c_24_visibleGame = v;
|
||||
x40_BaseWidget_RadarStuff->SetVisibility(x3c_25_visibleDebug && x3c_24_visibleGame,
|
||||
ETraversalMode::Children);
|
||||
}
|
||||
|
||||
void CHudRadarInterface::Update(float dt, const CStateManager& mgr)
|
||||
{
|
||||
CPlayerState& playerState = *mgr.GetPlayerState();
|
||||
float visorTransFactor = (playerState.GetCurrentVisor() == CPlayerState::EPlayerVisor::Combat) ?
|
||||
playerState.GetVisorTransitionFactor() : 0.f;
|
||||
zeus::CColor color = g_tweakGuiColors->GetRadarStuffColor();
|
||||
color.a *= g_GameState->GameOptions().GetHUDAlpha() * visorTransFactor;
|
||||
x40_BaseWidget_RadarStuff->SetColor(color);
|
||||
bool tweakVis = g_tweakGui->GetHudVisMode() >= ITweakGui::EHudVisMode::Three;
|
||||
if (tweakVis != x3c_25_visibleDebug)
|
||||
{
|
||||
x3c_25_visibleDebug = tweakVis;
|
||||
x40_BaseWidget_RadarStuff->SetVisibility(x3c_25_visibleDebug && x3c_24_visibleGame,
|
||||
ETraversalMode::Children);
|
||||
}
|
||||
}
|
||||
|
||||
void CHudRadarInterface::Draw(const CStateManager& mgr, float alpha) const
|
||||
{
|
||||
alpha *= g_GameState->GameOptions().GetHUDAlpha();
|
||||
if (g_tweakGui->GetHudVisMode() == ITweakGui::EHudVisMode::Zero || !x3c_24_visibleGame ||
|
||||
!x0_txtrRadarPaint || !x0_txtrRadarPaint.IsLoaded())
|
||||
return;
|
||||
|
||||
SRadarPaintDrawParms drawParms;
|
||||
|
||||
CPlayer& player = mgr.GetPlayer();
|
||||
if (player.IsOverrideRadarRadius())
|
||||
{
|
||||
drawParms.x78_xyRadius = player.GetRadarXYRadiusOverride();
|
||||
drawParms.x7c_zRadius = player.GetRadarZRadiusOverride();
|
||||
drawParms.x80_ZCloseRadius = 0.667f * drawParms.x7c_zRadius;
|
||||
}
|
||||
else
|
||||
{
|
||||
drawParms.x78_xyRadius = g_tweakGui->GetRadarXYRadius();
|
||||
drawParms.x7c_zRadius = g_tweakGui->GetRadarZRadius();
|
||||
drawParms.x80_ZCloseRadius = g_tweakGui->GetRadarZCloseRadius();
|
||||
}
|
||||
|
||||
drawParms.x6c_scopeRadius = g_tweakGui->GetRadarScopeCoordRadius();
|
||||
drawParms.x70_scopeScalar = drawParms.x6c_scopeRadius / drawParms.x78_xyRadius;
|
||||
|
||||
float camZ = zeus::CEulerAngles(zeus::CQuaternion(
|
||||
mgr.GetCameraManager()->GetCurrentCamera(mgr)->GetTransform().basis)).z;
|
||||
float angleZ = camZ - std::floor(camZ / (2.f * M_PIF)) * 2.f * M_PIF;
|
||||
if (angleZ < 0.f)
|
||||
angleZ += 2.f * M_PIF;
|
||||
drawParms.xc_preTranslate = zeus::CTransform::RotateY(angleZ);
|
||||
drawParms.x3c_postTranslate = x40_BaseWidget_RadarStuff->GetWorldTransform();
|
||||
float enemyRadius = g_tweakGui->GetRadarEnemyPaintRadius();
|
||||
|
||||
const_cast<CHudRadarInterface&>(*this).m_paintInsts.clear();
|
||||
x44_camera->Draw(CGuiWidgetDrawParms{0.f, zeus::CVector3f{}});
|
||||
CGraphics::SetModelMatrix(drawParms.x3c_postTranslate);
|
||||
|
||||
zeus::CColor playerColor = g_tweakGuiColors->GetRadarPlayerPaintColor();
|
||||
playerColor.a *= alpha;
|
||||
DoDrawRadarPaint(g_tweakGui->GetRadarPlayerPaintRadius(), playerColor);
|
||||
|
||||
zeus::CAABox radarBounds(player.GetTranslation().x - drawParms.x78_xyRadius,
|
||||
player.GetTranslation().y - drawParms.x78_xyRadius,
|
||||
player.GetTranslation().z - drawParms.x7c_zRadius,
|
||||
player.GetTranslation().x + drawParms.x78_xyRadius,
|
||||
player.GetTranslation().y + drawParms.x78_xyRadius,
|
||||
player.GetTranslation().z + drawParms.x7c_zRadius);
|
||||
|
||||
rstl::reserved_vector<TUniqueId, 1024> nearList;
|
||||
mgr.BuildNearList(nearList, radarBounds,
|
||||
CMaterialFilter(CMaterialList(EMaterialTypes::Target, EMaterialTypes::RadarObject),
|
||||
CMaterialList(EMaterialTypes::ExcludeFromRadar),
|
||||
CMaterialFilter::EFilterType::IncludeExclude), nullptr);
|
||||
|
||||
for (TUniqueId id : nearList)
|
||||
{
|
||||
if (TCastToConstPtr<CActor> act = mgr.GetObjectById(id))
|
||||
{
|
||||
if (!act->GetActive())
|
||||
continue;
|
||||
if (TCastToConstPtr<CWallCrawlerSwarm> swarm = act.GetPtr())
|
||||
{
|
||||
float radius = enemyRadius * 0.5f;
|
||||
for (const CWallCrawlerSwarm::CBoid& boid : swarm->GetBoids())
|
||||
{
|
||||
if (!boid.GetActive())
|
||||
continue;
|
||||
DrawRadarPaint(boid.GetTranslation(), radius, 0.5f, drawParms);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawRadarPaint(act->GetTranslation(), enemyRadius, 1.f, drawParms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const_cast<CHudRadarInterface&>(*this).m_paintShader.draw(m_paintInsts, x0_txtrRadarPaint.GetObj());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,16 +1,47 @@
|
|||
#ifndef __URDE_CHUDRADARINTERFACE_HPP__
|
||||
#define __URDE_CHUDRADARINTERFACE_HPP__
|
||||
|
||||
#include "CToken.hpp"
|
||||
#include "Graphics/CTexture.hpp"
|
||||
#include "Graphics/Shaders/CRadarPaintShader.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
class CGuiFrame;
|
||||
class CGuiWidget;
|
||||
class CGuiCamera;
|
||||
class CStateManager;
|
||||
|
||||
class CHudRadarInterface
|
||||
{
|
||||
struct SRadarPaintDrawParms
|
||||
{
|
||||
zeus::CVector3f x0_playerPos;
|
||||
zeus::CTransform xc_preTranslate;
|
||||
zeus::CTransform x3c_postTranslate;
|
||||
float x6c_scopeRadius;
|
||||
float x70_scopeScalar;
|
||||
float x74_alpha;
|
||||
float x78_xyRadius;
|
||||
float x7c_zRadius;
|
||||
float x80_ZCloseRadius;
|
||||
};
|
||||
TLockedToken<CTexture> x0_txtrRadarPaint;
|
||||
zeus::CTransform xc_radarStuffXf;
|
||||
bool x3c_24_visibleGame : 1;
|
||||
bool x3c_25_visibleDebug : 1;
|
||||
CGuiWidget* x40_BaseWidget_RadarStuff;
|
||||
CGuiCamera* x44_camera;
|
||||
CRadarPaintShader m_paintShader;
|
||||
std::vector<CRadarPaintShader::Instance> m_paintInsts;
|
||||
void DoDrawRadarPaint(float radius, const zeus::CColor& color) const;
|
||||
void DrawRadarPaint(const zeus::CVector3f& enemyPos, float radius,
|
||||
float alpha, const SRadarPaintDrawParms& parms) const;
|
||||
public:
|
||||
CHudRadarInterface(CGuiFrame& selHud, CStateManager& stateMgr);
|
||||
CHudRadarInterface(CGuiFrame& baseHud, CStateManager& stateMgr);
|
||||
void SetIsVisibleGame(bool v);
|
||||
void Update(float dt, const CStateManager& mgr);
|
||||
void Draw(const CStateManager& mgr, float alpha) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,276 @@
|
|||
#include "CHudThreatInterface.hpp"
|
||||
#include "CGuiFrame.hpp"
|
||||
#include "CGuiModel.hpp"
|
||||
#include "CGuiTextPane.hpp"
|
||||
#include "CAuiEnergyBarT01.hpp"
|
||||
#include "GameGlobalObjects.hpp"
|
||||
#include "CStringTable.hpp"
|
||||
#include "Audio/CSfxManager.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
void CHudThreatInterfaceCombat::Update(float dt)
|
||||
static const CAuiEnergyBarT01::FCoordFunc CoordFuncs[] =
|
||||
{
|
||||
CHudThreatInterface::CombatThreatBarCoordFunc,
|
||||
nullptr,
|
||||
CHudThreatInterface::XRayThreatBarCoordFunc,
|
||||
CHudThreatInterface::ThermalThreatBarCoordFunc,
|
||||
nullptr
|
||||
};
|
||||
|
||||
static const float IconTranslateRanges[] =
|
||||
{
|
||||
6.05f, 0.f, 0.f, 8.4f, 0.f
|
||||
};
|
||||
|
||||
CHudThreatInterface::CHudThreatInterface(CGuiFrame& selHud, EHudType hudType, float threatDist)
|
||||
: x4_hudType(hudType), x10_threatDist(threatDist)
|
||||
{
|
||||
x54_24_visibleDebug = true;
|
||||
x54_25_visibleGame = true;
|
||||
x58_basewidget_threatstuff = selHud.FindWidget("basewidget_threatstuff");
|
||||
x5c_basewidget_threaticon = selHud.FindWidget("basewidget_threaticon");
|
||||
x60_model_threatarrowup = static_cast<CGuiModel*>(selHud.FindWidget("model_threatarrowup"));
|
||||
x64_model_threatarrowdown = static_cast<CGuiModel*>(selHud.FindWidget("model_threatarrowdown"));
|
||||
x68_textpane_threatwarning = static_cast<CGuiTextPane*>(selHud.FindWidget("textpane_threatwarning"));
|
||||
x6c_energybart01_threatbar = static_cast<CAuiEnergyBarT01*>(selHud.FindWidget("energybart01_threatbar"));
|
||||
x70_textpane_threatdigits = static_cast<CGuiTextPane*>(selHud.FindWidget("textpane_threatdigits"));
|
||||
|
||||
if (x70_textpane_threatdigits)
|
||||
{
|
||||
x70_textpane_threatdigits->TextSupport()->SetFontColor(g_tweakGuiColors->GetThreatDigitsFont());
|
||||
x70_textpane_threatdigits->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetThreatDigitsOutline());
|
||||
}
|
||||
|
||||
x54_26_hasArrows = x60_model_threatarrowup && x64_model_threatarrowdown;
|
||||
x54_27_notXRay = hudType != EHudType::XRay;
|
||||
|
||||
x5c_basewidget_threaticon->SetColor(g_tweakGuiColors->GetThreatIconColor());
|
||||
x18_threatIconXf = x5c_basewidget_threaticon->GetLocalTransform();
|
||||
|
||||
x6c_energybart01_threatbar->SetFilledColor(g_tweakGuiColors->GetThreatBarFilled());
|
||||
x6c_energybart01_threatbar->SetShadowColor(g_tweakGuiColors->GetThreatBarShadow());
|
||||
x6c_energybart01_threatbar->SetEmptyColor(g_tweakGuiColors->GetThreatBarEmpty());
|
||||
x6c_energybart01_threatbar->SetCoordFunc(CoordFuncs[int(hudType)]);
|
||||
x6c_energybart01_threatbar->SetTesselation(hudType == EHudType::Combat ? 1.f : 0.1f);
|
||||
x6c_energybart01_threatbar->SetMaxEnergy(g_tweakGui->GetMaxThreatEnergy());
|
||||
x6c_energybart01_threatbar->SetFilledDrainSpeed(9999.f);
|
||||
x6c_energybart01_threatbar->SetShadowDrainSpeed(9999.f);
|
||||
x6c_energybart01_threatbar->SetShadowDrainDelay(0.f);
|
||||
x6c_energybart01_threatbar->SetIsAlwaysResetTimer(false);
|
||||
|
||||
if (x68_textpane_threatwarning)
|
||||
{
|
||||
x68_textpane_threatwarning->TextSupport()->SetFontColor(g_tweakGuiColors->GetThreatWarningFont());
|
||||
x68_textpane_threatwarning->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetThreatWarningOutline());
|
||||
}
|
||||
}
|
||||
|
||||
void CHudThreatInterface::SetThreatDistance(float threatDist)
|
||||
{
|
||||
x10_threatDist = threatDist;
|
||||
}
|
||||
|
||||
void CHudThreatInterface::SetIsVisibleDebug(bool v)
|
||||
{
|
||||
x54_24_visibleDebug = v;
|
||||
UpdateVisibility();
|
||||
}
|
||||
|
||||
void CHudThreatInterface::SetIsVisibleGame(bool v)
|
||||
{
|
||||
x54_25_visibleGame = v;
|
||||
UpdateVisibility();
|
||||
}
|
||||
|
||||
void CHudThreatInterface::UpdateVisibility()
|
||||
{
|
||||
bool vis = x54_24_visibleDebug && x54_25_visibleGame;
|
||||
x58_basewidget_threatstuff->SetVisibility(vis, ETraversalMode::Children);
|
||||
if (vis)
|
||||
SetThreatDistance(0.f);
|
||||
}
|
||||
|
||||
void CHudThreatInterface::Update(float dt)
|
||||
{
|
||||
zeus::CColor warningColor = zeus::CColor::lerp(g_tweakGuiColors->GetThreatIconColor(),
|
||||
g_tweakGuiColors->GetThreatIconWarningColor(),
|
||||
x50_warningColorLerp);
|
||||
|
||||
float maxThreatEnergy = g_tweakGui->GetMaxThreatEnergy();
|
||||
if (x70_textpane_threatdigits)
|
||||
{
|
||||
if (x10_threatDist < maxThreatEnergy)
|
||||
{
|
||||
x70_textpane_threatdigits->SetIsVisible(true);
|
||||
x70_textpane_threatdigits->TextSupport()->SetText(
|
||||
hecl::Format("%01.1f", std::max(0.f, x10_threatDist)));
|
||||
}
|
||||
else
|
||||
{
|
||||
x70_textpane_threatdigits->SetIsVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (x54_26_hasArrows)
|
||||
{
|
||||
if (x14_arrowTimer > 0.f)
|
||||
{
|
||||
x60_model_threatarrowup->SetIsVisible(true);
|
||||
x14_arrowTimer = std::max(0.f, x14_arrowTimer - dt);
|
||||
zeus::CColor color = warningColor;
|
||||
color.a = x14_arrowTimer / g_tweakGui->GetMissileArrowVisTime();
|
||||
x60_model_threatarrowup->SetColor(color);
|
||||
x64_model_threatarrowdown->SetIsVisible(false);
|
||||
}
|
||||
else if (x14_arrowTimer < 0.f)
|
||||
{
|
||||
x64_model_threatarrowdown->SetIsVisible(true);
|
||||
x14_arrowTimer = std::min(0.f, x14_arrowTimer + dt);
|
||||
zeus::CColor color = warningColor;
|
||||
color.a = -x14_arrowTimer / g_tweakGui->GetMissileArrowVisTime();
|
||||
x64_model_threatarrowdown->SetColor(color);
|
||||
x60_model_threatarrowup->SetIsVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
x60_model_threatarrowup->SetIsVisible(false);
|
||||
x64_model_threatarrowdown->SetIsVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (x10_threatDist <= maxThreatEnergy)
|
||||
{
|
||||
float tmp = x10_threatDist - (maxThreatEnergy - x6c_energybart01_threatbar->GetSetEnergy());
|
||||
if (tmp < -0.01f)
|
||||
x14_arrowTimer = g_tweakGui->GetMissileArrowVisTime();
|
||||
else if (tmp > 0.01f)
|
||||
x14_arrowTimer = -g_tweakGui->GetMissileArrowVisTime();
|
||||
}
|
||||
else
|
||||
{
|
||||
x14_arrowTimer = 0.f;
|
||||
}
|
||||
|
||||
if (x10_threatDist <= maxThreatEnergy)
|
||||
{
|
||||
x6c_energybart01_threatbar->SetCurrEnergy(x6c_energybart01_threatbar->GetMaxEnergy() - x10_threatDist,
|
||||
CAuiEnergyBarT01::ESetMode::Normal);
|
||||
x5c_basewidget_threaticon->SetColor(warningColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
x6c_energybart01_threatbar->SetCurrEnergy(0.f, CAuiEnergyBarT01::ESetMode::Normal);
|
||||
x5c_basewidget_threaticon->SetColor(g_tweakGuiColors->GetThreatIconSafeColor());
|
||||
}
|
||||
|
||||
if (x54_27_notXRay)
|
||||
{
|
||||
x5c_basewidget_threaticon->SetLocalTransform(x18_threatIconXf * zeus::CTransform::Translate(0.f, 0.f,
|
||||
std::max(0.f, maxThreatEnergy - x10_threatDist) * IconTranslateRanges[int(x4_hudType)] / maxThreatEnergy));
|
||||
}
|
||||
|
||||
if (x68_textpane_threatwarning)
|
||||
{
|
||||
if (x6c_energybart01_threatbar->GetActualFraction() > g_tweakGui->GetThreatWarningFraction())
|
||||
x68_textpane_threatwarning->SetIsVisible(true);
|
||||
else
|
||||
x68_textpane_threatwarning->SetIsVisible(false);
|
||||
|
||||
EThreatStatus newStatus;
|
||||
if (maxThreatEnergy == x6c_energybart01_threatbar->GetSetEnergy())
|
||||
newStatus = EThreatStatus::Damage;
|
||||
else if (x6c_energybart01_threatbar->GetActualFraction() > g_tweakGui->GetThreatWarningFraction())
|
||||
newStatus = EThreatStatus::Warning;
|
||||
else
|
||||
newStatus = EThreatStatus::Normal;
|
||||
|
||||
if (x4c_threatStatus != newStatus)
|
||||
{
|
||||
std::u16string string;
|
||||
if (newStatus == EThreatStatus::Warning)
|
||||
string = g_MainStringTable->GetString(10);
|
||||
else if (newStatus == EThreatStatus::Damage)
|
||||
string = g_MainStringTable->GetString(11);
|
||||
|
||||
x68_textpane_threatwarning->TextSupport()->SetText(string);
|
||||
|
||||
if (x4c_threatStatus == EThreatStatus::Normal && newStatus == EThreatStatus::Warning)
|
||||
CSfxManager::SfxStart(1396, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||
else if (newStatus == EThreatStatus::Damage)
|
||||
CSfxManager::SfxStart(1399, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||
|
||||
x4c_threatStatus = newStatus;
|
||||
}
|
||||
}
|
||||
|
||||
float oldX8 = x8_damagePulseTimer;
|
||||
x8_damagePulseTimer = std::fmod(x8_damagePulseTimer + dt, 0.5f);
|
||||
if (x8_damagePulseTimer < 0.25f)
|
||||
xc_damagePulse = x8_damagePulseTimer / 0.25f;
|
||||
else
|
||||
xc_damagePulse = (0.5f - x8_damagePulseTimer) / 0.25f;
|
||||
|
||||
if (x4c_threatStatus == EThreatStatus::Damage && x8_damagePulseTimer < oldX8)
|
||||
CSfxManager::SfxStart(1399, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||
|
||||
if (x68_textpane_threatwarning)
|
||||
{
|
||||
if (x4c_threatStatus != EThreatStatus::Normal)
|
||||
{
|
||||
x48_warningLerpAlpha = std::min(x48_warningLerpAlpha + 2.f * dt, 1.f);
|
||||
zeus::CColor color = zeus::CColor::skWhite;
|
||||
color.a = x48_warningLerpAlpha * xc_damagePulse;
|
||||
x68_textpane_threatwarning->SetColor(color);
|
||||
}
|
||||
else
|
||||
{
|
||||
x48_warningLerpAlpha = std::max(0.f, x48_warningLerpAlpha - 2.f * dt);
|
||||
zeus::CColor color = zeus::CColor::skWhite;
|
||||
color.a = x48_warningLerpAlpha * xc_damagePulse;
|
||||
x68_textpane_threatwarning->SetColor(color);
|
||||
}
|
||||
if (x68_textpane_threatwarning->GetGeometryColor().a)
|
||||
x68_textpane_threatwarning->SetIsVisible(true);
|
||||
else
|
||||
x68_textpane_threatwarning->SetIsVisible(false);
|
||||
}
|
||||
|
||||
if (x4c_threatStatus == EThreatStatus::Damage)
|
||||
x50_warningColorLerp = std::min(x50_warningColorLerp + 2.f * dt, 1.f);
|
||||
else
|
||||
x50_warningColorLerp = std::min(x50_warningColorLerp - 2.f * dt, 1.f);
|
||||
}
|
||||
|
||||
std::pair<zeus::CVector3f, zeus::CVector3f> CHudThreatInterface::CombatThreatBarCoordFunc(float t)
|
||||
{
|
||||
float z = IconTranslateRanges[int(EHudType::Combat)] * t;
|
||||
return {zeus::CVector3f(-0.3f, 0.f, z), zeus::CVector3f(0.f, 0.f, z)};
|
||||
}
|
||||
|
||||
std::pair<zeus::CVector3f, zeus::CVector3f> CHudThreatInterface::XRayThreatBarCoordFunc(float t)
|
||||
{
|
||||
float theta = 0.8f * (t - 0.5f);
|
||||
float x = -9.55f * std::cos(theta);
|
||||
float z = 9.55f * std::sin(theta);
|
||||
return {zeus::CVector3f(0.4f + x, 0.f, z), zeus::CVector3f(x, 0.f, z)};
|
||||
}
|
||||
|
||||
std::pair<zeus::CVector3f, zeus::CVector3f> CHudThreatInterface::ThermalThreatBarCoordFunc(float t)
|
||||
{
|
||||
float transRange = IconTranslateRanges[int(EHudType::Thermal)];
|
||||
float a = 0.08f * transRange;
|
||||
float b = t * transRange;
|
||||
float c;
|
||||
if (b < a)
|
||||
c = b / a;
|
||||
else if (b < transRange - a)
|
||||
c = 1.f;
|
||||
else
|
||||
c = 1.f - (b - (transRange - a)) / a;
|
||||
|
||||
return {zeus::CVector3f(0.1f, 0.f, b), zeus::CVector3f(0.5f * c + 0.1f, 0.f, b)};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,22 +1,57 @@
|
|||
#ifndef __URDE_CHUDTHREATINTERFACE_HPP__
|
||||
#define __URDE_CHUDTHREATINTERFACE_HPP__
|
||||
|
||||
#include "CHudInterface.hpp"
|
||||
#include "RetroTypes.hpp"
|
||||
#include "zeus/CTransform.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
class CGuiFrame;
|
||||
class CGuiWidget;
|
||||
class CGuiModel;
|
||||
class CGuiTextPane;
|
||||
class CAuiEnergyBarT01;
|
||||
|
||||
class IHudThreatInterface
|
||||
class CHudThreatInterface
|
||||
{
|
||||
public:
|
||||
virtual ~IHudThreatInterface() = default;
|
||||
virtual void Update(float dt)=0;
|
||||
};
|
||||
enum class EThreatStatus
|
||||
{
|
||||
Normal,
|
||||
Warning,
|
||||
Damage
|
||||
};
|
||||
|
||||
class CHudThreatInterfaceCombat : public IHudThreatInterface
|
||||
{
|
||||
EHudType x4_hudType;
|
||||
float x8_damagePulseTimer = 0.f;
|
||||
float xc_damagePulse = 0.f;
|
||||
float x10_threatDist;
|
||||
float x14_arrowTimer = 0.f;
|
||||
zeus::CTransform x18_threatIconXf;
|
||||
float x48_warningLerpAlpha = 0.f;
|
||||
EThreatStatus x4c_threatStatus = EThreatStatus::Normal;
|
||||
float x50_warningColorLerp = 0.f;
|
||||
bool x54_24_visibleDebug : 1;
|
||||
bool x54_25_visibleGame : 1;
|
||||
bool x54_26_hasArrows : 1;
|
||||
bool x54_27_notXRay : 1;
|
||||
CGuiWidget* x58_basewidget_threatstuff;
|
||||
CGuiWidget* x5c_basewidget_threaticon;
|
||||
CGuiModel* x60_model_threatarrowup;
|
||||
CGuiModel* x64_model_threatarrowdown;
|
||||
CGuiTextPane* x68_textpane_threatwarning;
|
||||
CAuiEnergyBarT01* x6c_energybart01_threatbar;
|
||||
CGuiTextPane* x70_textpane_threatdigits;
|
||||
void UpdateVisibility();
|
||||
public:
|
||||
CHudThreatInterfaceCombat(CGuiFrame& selHud, float);
|
||||
CHudThreatInterface(CGuiFrame& selHud, EHudType hudType, float threatDist);
|
||||
void SetThreatDistance(float threatDist);
|
||||
void SetIsVisibleDebug(bool v);
|
||||
void SetIsVisibleGame(bool v);
|
||||
void Update(float dt);
|
||||
static std::pair<zeus::CVector3f, zeus::CVector3f> CombatThreatBarCoordFunc(float t);
|
||||
static std::pair<zeus::CVector3f, zeus::CVector3f> XRayThreatBarCoordFunc(float t);
|
||||
static std::pair<zeus::CVector3f, zeus::CVector3f> ThermalThreatBarCoordFunc(float t);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ class CSamusHud
|
|||
TLockedToken<CGuiFrame> x278_selectedHud; // used to be optional
|
||||
CGuiFrame* x288_loadedSelectedHud = nullptr;
|
||||
std::unique_ptr<CHudEnergyInterface> x28c_ballEnergyIntf;
|
||||
std::unique_ptr<IHudThreatInterface> x290_threatIntf;
|
||||
std::unique_ptr<CHudThreatInterface> x290_threatIntf;
|
||||
std::unique_ptr<CHudMissileInterface> x294_missileIntf;
|
||||
std::unique_ptr<IFreeLookInterface> x298_freeLookIntf;
|
||||
std::unique_ptr<IHudDecoInterface> x29c_decoIntf;
|
||||
|
@ -131,8 +131,8 @@ class CSamusHud
|
|||
{
|
||||
struct
|
||||
{
|
||||
bool x2e0_24_ : 1;
|
||||
bool x2e0_25_ : 1;
|
||||
bool x2e0_24_inFreeLook : 1;
|
||||
bool x2e0_25_lookControlHeld : 1;
|
||||
bool x2e0_26_latestFirstPerson : 1;
|
||||
bool x2e0_27_energyLow : 1;
|
||||
};
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "Graphics/Shaders/CXRayBlurFilter.hpp"
|
||||
#include "Graphics/Shaders/CTextSupportShader.hpp"
|
||||
#include "Graphics/Shaders/CEnergyBarShader.hpp"
|
||||
#include "Graphics/Shaders/CRadarPaintShader.hpp"
|
||||
#include "Character/CCharLayoutInfo.hpp"
|
||||
#include "Audio/CStreamAudioManager.hpp"
|
||||
#include "CGBASupport.hpp"
|
||||
|
@ -25,6 +26,7 @@ URDE_DECL_SPECIALIZE_SHADER(CXRayBlurFilter)
|
|||
URDE_DECL_SPECIALIZE_SHADER(CFogVolumePlaneShader)
|
||||
URDE_DECL_SPECIALIZE_SHADER(CFogVolumeFilter)
|
||||
URDE_DECL_SPECIALIZE_SHADER(CEnergyBarShader)
|
||||
URDE_DECL_SPECIALIZE_SHADER(CRadarPaintShader)
|
||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CColoredQuadFilter)
|
||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilter)
|
||||
URDE_DECL_SPECIALIZE_MULTI_BLEND_SHADER(CTexturedQuadFilterAlpha)
|
||||
|
@ -216,6 +218,7 @@ CMain::BooSetter::BooSetter(boo::IGraphicsDataFactory* factory,
|
|||
TShader<CFogVolumePlaneShader>::Initialize();
|
||||
TShader<CFogVolumeFilter>::Initialize();
|
||||
TShader<CEnergyBarShader>::Initialize();
|
||||
TShader<CRadarPaintShader>::Initialize();
|
||||
TMultiBlendShader<CColoredQuadFilter>::Initialize();
|
||||
TMultiBlendShader<CTexturedQuadFilter>::Initialize();
|
||||
TMultiBlendShader<CTexturedQuadFilterAlpha>::Initialize();
|
||||
|
@ -335,6 +338,7 @@ void CMain::Shutdown()
|
|||
TShader<CFogVolumePlaneShader>::Shutdown();
|
||||
TShader<CFogVolumeFilter>::Shutdown();
|
||||
TShader<CEnergyBarShader>::Shutdown();
|
||||
TShader<CRadarPaintShader>::Shutdown();
|
||||
TMultiBlendShader<CColoredQuadFilter>::Shutdown();
|
||||
TMultiBlendShader<CTexturedQuadFilter>::Shutdown();
|
||||
TMultiBlendShader<CTexturedQuadFilterAlpha>::Shutdown();
|
||||
|
|
|
@ -167,9 +167,9 @@ private:
|
|||
float x3d0_ = 0.f;
|
||||
float x3d4_ = 0.f;
|
||||
float x3d8_ = 0.f;
|
||||
bool x3dc_ = 0;
|
||||
bool x3dc_inFreeLook = 0;
|
||||
bool x3dd_ = 0;
|
||||
bool x3de_ = 0;
|
||||
bool x3de_lookControlHeld = 0;
|
||||
float x3e4_ = 0.f;
|
||||
float x3e8_ = 0.f;
|
||||
float x3ec_ = 0.f;
|
||||
|
@ -268,7 +268,7 @@ private:
|
|||
bool x9c6_28_ : 1;
|
||||
bool x9c6_29_disableInput : 1;
|
||||
bool x9c6_30_newScanScanning : 1;
|
||||
bool x9c6_31_ : 1;
|
||||
bool x9c6_31_overrideRadarRadius : 1;
|
||||
bool x9c7_24_ : 1;
|
||||
bool x9c7_25_ : 1;
|
||||
};
|
||||
|
@ -295,8 +295,8 @@ private:
|
|||
float xa14_ = 0.f;
|
||||
float xa18_ = 0.f;
|
||||
float xa1c_ = 0.f;
|
||||
float xa20_ = 1.f;
|
||||
float xa24_ = 1.f;
|
||||
float xa20_radarXYRadiusOverride = 1.f;
|
||||
float xa24_radarZRadiusOverride = 1.f;
|
||||
float xa28_ = 0.f;
|
||||
u32 xa2c_ = 2;
|
||||
float xa30_ = 4.f;
|
||||
|
@ -443,9 +443,14 @@ public:
|
|||
TUniqueId GetLockonObjectId() const { return x310_lockonObjectId; }
|
||||
TUniqueId GetScanningObjectId() const { return x3b4_scanningObject; }
|
||||
bool IsNewScanScanning() const { return x9c6_30_newScanScanning; }
|
||||
bool IsOverrideRadarRadius() const { return x9c6_31_overrideRadarRadius; }
|
||||
float GetRadarXYRadiusOverride() const { return xa20_radarXYRadiusOverride; }
|
||||
float GetRadarZRadiusOverride() const { return xa24_radarZRadiusOverride; }
|
||||
bool ObjectInScanningRange(TUniqueId id, const CStateManager& mgr) const;
|
||||
float GetMorphTime() const { return x574_morphTime; }
|
||||
float GetMorphDuration() const { return x578_morphDuration; }
|
||||
bool IsInFreeLook() const { return x3dc_inFreeLook; }
|
||||
bool IsLookControlHeld() const { return x3de_lookControlHeld; }
|
||||
CPlayerGun* GetPlayerGun() const { return x490_gun.get(); }
|
||||
CMorphBall* GetMorphBall() const { return x768_morphball.get(); }
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
{
|
||||
struct
|
||||
{
|
||||
bool x80_24_ : 1;
|
||||
bool x80_24_active : 1;
|
||||
bool x80_25_ : 1;
|
||||
bool x80_26_ : 1;
|
||||
bool x80_27_ : 1;
|
||||
|
@ -44,10 +44,18 @@ public:
|
|||
};
|
||||
u32 x80_;
|
||||
};
|
||||
|
||||
public:
|
||||
const zeus::CTransform& GetTransform() const { return x0_; }
|
||||
const zeus::CVector3f& GetTranslation() const { return x0_.origin; }
|
||||
bool GetActive() const { return x80_24_active; }
|
||||
};
|
||||
|
||||
private:
|
||||
zeus::CAABox xe8_aabox = zeus::CAABox::skNullBox;
|
||||
std::vector<CBoid> x108_boids;
|
||||
zeus::CVector3f x130_lastKilledOffset;
|
||||
|
||||
public:
|
||||
CWallCrawlerSwarm(TUniqueId, bool, const std::string&, const CEntityInfo&, const zeus::CVector3f&,
|
||||
const zeus::CTransform&, u32, const CAnimRes&, u32, u32, u32, u32, u32, u32, const CDamageInfo&,
|
||||
|
@ -59,6 +67,7 @@ public:
|
|||
zeus::CVector3f GetLastKilledOffset() const { return x130_lastKilledOffset; }
|
||||
void ApplyRadiusDamage(const zeus::CVector3f& pos, const CDamageInfo& info,
|
||||
CStateManager& stateMgr) {}
|
||||
const std::vector<CBoid>& GetBoids() const { return x108_boids; }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue