1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 10:22:52 +01:00
openrw/rwgame/HUDDrawer.hpp

65 lines
2.1 KiB
C++
Raw Normal View History

2018-10-29 14:52:18 +01:00
#ifndef _RWGAME_HUDDRAWER_HPP_
#define _RWGAME_HUDDRAWER_HPP_
2018-12-10 01:51:05 +01:00
namespace ai {
class PlayerController;
} // namespace ai
2018-12-09 22:43:42 +01:00
class GameWorld;
class GameRenderer;
class ViewCamera;
#include <glm/gtc/type_precision.hpp>
#include <glm/vec3.hpp>
2018-10-29 14:52:18 +01:00
class HUDDrawer {
public:
struct HUDParameters {
float hudScale = 1.f;
float uiTextSize = 25.f;
float uiTextHeight = 22.f;
float uiElementMargin = 3.f;
float uiOuterMargin = 20.f;
float uiInfoMargin = 10.f;
float uiWeaponSize = 64.f;
float uiAmmoSize = 14.f;
float uiAmmoHeight = 16.f;
float uiWantedLevelHeight =
uiOuterMargin + uiWeaponSize + uiElementMargin;
float uiScriptTimerHeight =
uiWantedLevelHeight + uiTextHeight + uiElementMargin;
float uiArmourOffset = uiTextSize * 3.f;
float uiMaxWantedLevel = 6.f;
float uiLowHealth = 9.f;
glm::u8vec3 uiTimeColour = glm::u8vec3(196, 165, 119);
glm::u8vec3 uiMoneyColour = glm::u8vec3(89, 113, 147);
glm::u8vec3 uiHealthColour = glm::u8vec3(187, 102, 47);
glm::u8vec3 uiArmourColour = glm::u8vec3(123, 136, 93);
glm::u8vec3 uiScriptTimerColour = glm::u8vec3(186, 101, 50);
glm::u8vec3 uiShadowColour = glm::u8vec3(0, 0, 0);
float uiMapSize = 150.f;
float uiWorldSizeMin = 200.f;
float uiWorldSizeMax = 300.f;
};
HUDDrawer() = default;
~HUDDrawer() = default;
2018-10-29 16:54:13 +01:00
void applyHUDScale(float scale);
2018-10-29 14:52:18 +01:00
HUDParameters getHUDParameters();
2018-12-10 01:51:05 +01:00
void drawHUD(ViewCamera& currentView, ai::PlayerController* player,
2018-12-01 18:57:06 +01:00
GameWorld* world, GameRenderer& render);
void drawOnScreenText(GameWorld* world, GameRenderer& renderer);
2018-10-29 14:52:18 +01:00
private:
HUDParameters hudParameters;
2018-12-01 18:57:06 +01:00
void drawScriptTimer(GameWorld* world, GameRenderer& render);
2018-12-10 01:51:05 +01:00
void drawMap(ViewCamera& currentView, ai::PlayerController* player,
2018-12-01 18:57:06 +01:00
GameWorld* world, GameRenderer& render);
2018-12-10 01:51:05 +01:00
void drawPlayerInfo(ai::PlayerController* player, GameWorld* world,
2018-12-01 18:57:06 +01:00
GameRenderer& render);
2018-10-29 14:52:18 +01:00
};
#endif