Rise
The Vieneo Province
BiometerDialog.cpp
Go to the documentation of this file.
1 #include "BiometerDialog.h"
2 
4 {
5  logger->AddToCallStack("BiometerDialog::ctor");
6  normalinterlace = false;
7  tabs = 0;
8  windowdefaultlocation = D3DXVECTOR3(133, 16, 0);
9  //gui->height
10  defaultwidth = 176 - 6;
11  defaultheight = 7 * 16;
12  icon = 9;
14  allowresize = false;
15  allowscroll = false;
16  active = false;
17 }
18 
20 {
21 }
22 
23 void BiometerDialog::Draw(D3DXVECTOR3* tracked)
24 {
25  logger->AddToCallStack("BiometerDialog::Draw");
26  // tempvec.x=spacing+15.0f; tempvec.y=11.0f; tempvec.z=0.0f;
27  // heart should be 70x70 not 64x64?
28  DWORD tempcolor;
29  if (ourcockpit.hitpoints < 64 && !playerships[0].simulator)
30  {
31  if ((flasher > 0.0f && oldflasher <= 0.0f) || (flasher > 0.2f && oldflasher <= 0.2f))
32  tempcolor = 0xFFFF0000;
33  else
34  tempcolor = 0xFFA00000;
35  msgbarcolor = 3;
36  }
37  else if (ourcockpit.hitpoints < 128 && !playerships[0].simulator)
38  {
39  if ((flasher > 0.0f && oldflasher <= 0.0f) || (flasher > 0.2f && oldflasher <= 0.2f))
40  tempcolor = 0xFFFFFF00;
41  else
42  tempcolor = 0xFFA0A000;
43  msgbarcolor = 2;
44  }
45  else
46  {
47  tempcolor = 0xFFB2D9F0;
48  msgbarcolor = 0;
49  }
50  gui->g_pTextSprite->Draw(gui->game->viewscreen->m_pddsHeart[gui->game->viewscreen->heartloop], nullptr, nullptr, tracked, tempcolor);
51 
52  swprintf_s(msgbartext, HELP_SIZE, L"%.0f%%", ourcockpit.hitpoints / 255.0f*100.0f);
53 }
54 
55 void BiometerDialog::DragDropItem(short destTab)
56 {
57 }
Scockpit ourcockpit
Definition: globals.cpp:176
short heartloop
Definition: Viewscreen.h:265
float oldflasher
Definition: globals.cpp:66
void Draw(D3DXVECTOR3 *tracked)
GameClass * game
Definition: gui.h:857
s_network_objects playerships[MAX_SCAN]
Definition: globals.cpp:174
short tabs
Definition: DialogBase.h:62
short defaultwidth
Definition: DialogBase.h:51
short text
Definition: DialogBase.h:69
void DragDropItem(short destTab)
WCHAR msgbartext[HELP_SIZE]
Definition: DialogBase.h:82
Viewscreen * viewscreen
Definition: GameClass.h:111
char msgbarcolor
Definition: DialogBase.h:81
static Logger * logger
Definition: DialogBase.h:41
short defaultheight
Definition: DialogBase.h:51
bool allowscroll
Definition: DialogBase.h:45
float flasher
Definition: globals.cpp:65
bool active
Definition: DialogBase.h:71
unsigned char hitpoints
Definition: globals.h:663
short icon
Definition: DialogBase.h:53
static HMI * gui
Definition: DialogBase.h:40
bool allowresize
Definition: DialogBase.h:45
ID3DXSprite * g_pTextSprite
Definition: gui.h:726
#define HELP_SIZE
Definition: gui.h:17
D3DXVECTOR3 windowdefaultlocation
Definition: DialogBase.h:52
bool normalinterlace
Definition: DialogBase.h:54
BiometerDialog(short id)
LPDIRECT3DTEXTURE9 m_pddsHeart[heartanimateC]
Definition: Viewscreen.h:149
void AddToCallStack(const char *msg)
Definition: Logger.cpp:86