Rise
The Vieneo Province
Toggle main menu visibility
Loading...
Searching...
No Matches
BiometerDialog.cpp
Go to the documentation of this file.
1
#include "
BiometerDialog.h
"
2
3
#include "
../MathUtilities.h
"
4
5
BiometerDialog::BiometerDialog
(
short
id
) :
DialogBase
(id)
6
{
7
logger
->
AddToCallStack
(
"BiometerDialog::ctor"
);
8
normalinterlace
=
false
;
9
tabs
= 0;
10
windowdefaultlocation
=
RiseMath::Vector3
(133, 16, 0);
11
defaultwidth
= 176 - 6;
12
defaultheight
= 7 * 16;
13
icon
= 9;
14
text
=
L_DIALOG_BIOMETER
;
15
allowresize
=
false
;
16
allowscroll
=
false
;
17
active
=
false
;
18
}
19
20
void
BiometerDialog::Update
()
21
{
22
if
(
ourcockpit
.
hitpoints
< 64 && !
playerships
[0].
isSimulator
)
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
46
heartloop
=
Clamp
(
heartloop
, 0,
heartanimateC
- 1);
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
54
void
BiometerDialog::Draw
(
RiseMath::Vector3
* tracked)
55
{
56
logger
->
AddToCallStack
(
"BiometerDialog::Draw"
);
57
58
RiseMath::Matrix
mat, oldMat;
59
gui
->
g_pTextSprite
->
GetTransform
(&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;
64
gui
->
g_pTextSprite
->
SetTransform
(&mat);
65
gui
->
g_pTextSprite
->
Draw
(
gui
->
game
->
viewscreen
->
m_pddsHeart
[
heartloop
],
nullptr
,
nullptr
, &newTracked,
tempcolor
);
66
gui
->
g_pTextSprite
->
SetTransform
(&oldMat);
67
68
logger
->
AddToCallStack
(
"BiometerDialog::Draw DONE"
);
69
}
70
71
void
BiometerDialog::DragDropItem
(
short
destTab)
72
{
73
}
BiometerDialog.h
MathUtilities.h
Clamp
constexpr auto Clamp(T1 val, T2 min, T3 max)
Definition
MathUtilities.h:4
BiometerDialog::heartloop
short heartloop
Definition
BiometerDialog.h:9
BiometerDialog::Draw
void Draw(RiseMath::Vector3 *tracked)
Definition
BiometerDialog.cpp:54
BiometerDialog::BiometerDialog
BiometerDialog(short id)
Definition
BiometerDialog.cpp:5
BiometerDialog::tempcolor
DWORD tempcolor
Definition
BiometerDialog.h:8
BiometerDialog::DragDropItem
void DragDropItem(short destTab)
Definition
BiometerDialog.cpp:71
BiometerDialog::Update
void Update()
Definition
BiometerDialog.cpp:20
DialogBase::gui
static HMI * gui
Definition
DialogBase.h:42
DialogBase::icon
short icon
Definition
DialogBase.h:55
DialogBase::active
bool active
Definition
DialogBase.h:73
DialogBase::text
short text
Definition
DialogBase.h:71
DialogBase::logger
static Logger * logger
Definition
DialogBase.h:43
DialogBase::tabs
short tabs
Definition
DialogBase.h:64
DialogBase::defaultwidth
short defaultwidth
Definition
DialogBase.h:53
DialogBase::msgbartext
WCHAR msgbartext[HELP_SIZE]
Definition
DialogBase.h:84
DialogBase::windowdefaultlocation
RiseMath::Vector3 windowdefaultlocation
Definition
DialogBase.h:54
DialogBase::allowresize
bool allowresize
Definition
DialogBase.h:47
DialogBase::normalinterlace
bool normalinterlace
Definition
DialogBase.h:56
DialogBase::allowscroll
bool allowscroll
Definition
DialogBase.h:47
DialogBase::DialogBase
DialogBase(short id)
Definition
DialogBase.cpp:19
DialogBase::msgbarcolor
char msgbarcolor
Definition
DialogBase.h:83
DialogBase::defaultheight
short defaultheight
Definition
DialogBase.h:53
GameClass::viewscreen
std::unique_ptr< Viewscreen > viewscreen
Definition
GameClass.h:107
GameClass::displayscale
float displayscale
Definition
GameClass.h:130
HMI::game
GameClass * game
Definition
gui.h:1213
HMI::IsAdmin
bool IsAdmin
Definition
gui.h:1108
HMI::g_pTextSprite
Rendering::RenderSprite * g_pTextSprite
Definition
gui.h:1051
Logger::AddToCallStack
void AddToCallStack(const char *msg)
Definition
Logger.cpp:355
Rendering::RenderSprite::SetTransform
HRESULT SetTransform(const RiseMath::Matrix *value)
Definition
ClientRenderer11.h:206
Rendering::RenderSprite::GetTransform
HRESULT GetTransform(RiseMath::Matrix *value) const
Definition
ClientRenderer11.h:207
Rendering::RenderSprite::Draw
HRESULT Draw(RenderTexture *image, const RECT *rectangle, const RiseMath::Vector3 *center, const RiseMath::Vector3 *position, PackedColor color)
Definition
ClientRenderer11.h:204
Viewscreen::m_pddsHeart
Rendering::RenderTexture * m_pddsHeart[heartanimateC]
Definition
Viewscreen.h:262
Viewscreen::currentBPM
float currentBPM
Definition
Viewscreen.h:121
Viewscreen::heartloop
float heartloop
Definition
Viewscreen.h:418
flasher
float flasher
Definition
globals.cpp:49
playerships
s_network_objects playerships[MAX_SCAN]
Definition
globals.cpp:112
ourcockpit
Scockpit ourcockpit
Definition
globals.cpp:114
oldflasher
float oldflasher
Definition
globals.cpp:50
heartanimateC
#define heartanimateC
Definition
globals.h:64
L_DIALOG_BIOMETER
@ L_DIALOG_BIOMETER
Definition
gui.h:74
HELP_SIZE
#define HELP_SIZE
Definition
gui.h:21
RiseMath::MatrixScaling
Matrix * MatrixScaling(Matrix *out, float x, float y, float z)
Definition
ClientMath.h:124
RiseMath::Matrix
Definition
ClientMath.h:80
RiseMath::Vector3
Definition
ClientMath.h:38
Scockpit::hitpoints
unsigned char hitpoints
Definition
globals.h:686
s_network_objects::isSimulator
bool isSimulator
Definition
globals.h:541
Dialogs
BiometerDialog.cpp
Generated on
for Rise by
1.18.0