Rise
The Vieneo Province
Loading...
Searching...
No Matches
BiometerDialog.cpp
Go to the documentation of this file.
1#include "BiometerDialog.h"
2
3#include "../MathUtilities.h"
4
6{
7 logger->AddToCallStack("BiometerDialog::ctor");
8 normalinterlace = false;
9 tabs = 0;
11 defaultwidth = 176 - 6;
12 defaultheight = 7 * 16;
13 icon = 9;
15 allowresize = false;
16 allowscroll = false;
17 active = false;
18}
19
21{
23 {
24 if ((flasher > 0.0f && oldflasher <= 0.0f) || (flasher > 0.2f && oldflasher <= 0.2f))
25 tempcolor = 0xFFFF0000;
26 else
27 tempcolor = 0xFFA00000;
28 msgbarcolor = 3;
29 }
30 else if (ourcockpit.hitpoints < 128 && !playerships[0].isSimulator)
31 {
32 if ((flasher > 0.0f && oldflasher <= 0.0f) || (flasher > 0.2f && oldflasher <= 0.2f))
33 tempcolor = 0xFFFFFF00;
34 else
35 tempcolor = 0xFFA0A000;
36 msgbarcolor = 2;
37 }
38 else
39 {
40 tempcolor = 0xFFB2D9F0;
41 msgbarcolor = 0;
42 }
43
44 heartloop = static_cast<short>(gui->game->viewscreen->heartloop);
45 // for security
47
48 if (gui->IsAdmin)
49 swprintf_s(msgbartext, HELP_SIZE, L"%.0f%% (%.0f BPM) %i", ourcockpit.hitpoints / 255.0f * 100.0f, gui->game->viewscreen->currentBPM, heartloop);
50 else
51 swprintf_s(msgbartext, HELP_SIZE, L"%.0f%% (%.0f BPM)", ourcockpit.hitpoints / 255.0f * 100.0f, gui->game->viewscreen->currentBPM);
52}
53
55{
56 logger->AddToCallStack("BiometerDialog::Draw");
57
58 RiseMath::Matrix mat, oldMat;
60 RiseMath::MatrixScaling(&mat, 112.0f / 64.0f * gui->game->displayscale, 112.0f / 64.0f * gui->game->displayscale, 1.0f);
61 RiseMath::Vector3 newTracked = *tracked;
62 newTracked.x /= 112.0f / 64.0f;// *gui->game->displayscale;
63 newTracked.y /= 112.0f / 64.0f;// *gui->game->displayscale;
65 gui->g_pTextSprite->Draw(gui->game->viewscreen->m_pddsHeart[heartloop], nullptr, nullptr, &newTracked, tempcolor);
67
68 logger->AddToCallStack("BiometerDialog::Draw DONE");
69}
70
72{
73}
constexpr auto Clamp(T1 val, T2 min, T3 max)
void Draw(RiseMath::Vector3 *tracked)
BiometerDialog(short id)
void DragDropItem(short destTab)
static HMI * gui
Definition DialogBase.h:42
short icon
Definition DialogBase.h:55
bool active
Definition DialogBase.h:73
short text
Definition DialogBase.h:71
static Logger * logger
Definition DialogBase.h:43
short tabs
Definition DialogBase.h:64
short defaultwidth
Definition DialogBase.h:53
WCHAR msgbartext[HELP_SIZE]
Definition DialogBase.h:84
RiseMath::Vector3 windowdefaultlocation
Definition DialogBase.h:54
bool allowresize
Definition DialogBase.h:47
bool normalinterlace
Definition DialogBase.h:56
bool allowscroll
Definition DialogBase.h:47
DialogBase(short id)
char msgbarcolor
Definition DialogBase.h:83
short defaultheight
Definition DialogBase.h:53
std::unique_ptr< Viewscreen > viewscreen
Definition GameClass.h:107
float displayscale
Definition GameClass.h:130
GameClass * game
Definition gui.h:1213
bool IsAdmin
Definition gui.h:1108
Rendering::RenderSprite * g_pTextSprite
Definition gui.h:1051
void AddToCallStack(const char *msg)
Definition Logger.cpp:355
HRESULT SetTransform(const RiseMath::Matrix *value)
HRESULT GetTransform(RiseMath::Matrix *value) const
HRESULT Draw(RenderTexture *image, const RECT *rectangle, const RiseMath::Vector3 *center, const RiseMath::Vector3 *position, PackedColor color)
Rendering::RenderTexture * m_pddsHeart[heartanimateC]
Definition Viewscreen.h:262
float currentBPM
Definition Viewscreen.h:121
float heartloop
Definition Viewscreen.h:418
float flasher
Definition globals.cpp:49
s_network_objects playerships[MAX_SCAN]
Definition globals.cpp:112
Scockpit ourcockpit
Definition globals.cpp:114
float oldflasher
Definition globals.cpp:50
#define heartanimateC
Definition globals.h:64
@ L_DIALOG_BIOMETER
Definition gui.h:74
#define HELP_SIZE
Definition gui.h:21
Matrix * MatrixScaling(Matrix *out, float x, float y, float z)
Definition ClientMath.h:124
unsigned char hitpoints
Definition globals.h:686