Rise
The Vieneo Province
IndicatedAirSpeed.cpp
Go to the documentation of this file.
1 #include "../Instrument.h"
2 #include "../../Bus.h"
3 
4 IndicatedAirSpeed::IndicatedAirSpeed(int prmX, int prmY, float prmXScale, float prmYScale, Bus* prmBus, Logger* prmLogger, DeviceObject* prmDevice, std::vector<Font*> prmFonts) :
5  Instrument(prmX, prmY, prmXScale, prmYScale, prmBus, prmLogger, prmDevice, prmFonts)
6 {
7  logger->AddToCallStack("IndicatedAirSpeed::ctor");
8  defaultFont = 1;
9 
10  tape = new Sprite(logger, pDevice, "Textures/Instruments/iastape.dds", prmX, prmY, 0.1f, 0, 0, 17, 256, 0xFFFFFFFF);
11  tape->mag = prmXScale;
12 }
13 
15 {
16  tape->Draw();
17 }
18 
19 void IndicatedAirSpeed::FrameMove(float fElapsed)
20 {
21  // ias tape
22  const short offsety = static_cast<short>(bus->IndicatedAirspeedKms * 500.0f); // /20*10*1000
23  tape->SetRectangle(179 - offsety, 0, 17, 256 - offsety);
24  tape->Update();
25 }
float mag
Definition: Sprite.h:31
void FrameMove(float fElapsed) override
void SetRectangle(int top, int left, int right, int bottom)
Definition: Sprite.cpp:96
Definition: Logger.h:9
void Render() override
DeviceObject * pDevice
Definition: Instrument.h:17
void Update()
Definition: Sprite.cpp:41
IndicatedAirSpeed(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font *> prmFonts)
void Draw(D3DXCOLOR prmColor)
Definition: Sprite.cpp:66
Definition: Bus.h:16
Definition: Sprite.h:7
Bus * bus
Definition: Instrument.h:18
float IndicatedAirspeedKms
Definition: Bus.h:27
UINT defaultFont
Definition: Instrument.h:20
Logger * logger
Definition: Instrument.h:19
void AddToCallStack(const char *msg)
Definition: Logger.cpp:86