6 Instrument(prmX, prmY, prmXScale, prmYScale, prmBus, prmLogger, prmDevice, prmFonts)
17 auto nextRows=
Rows(data.request,
Objective(data.request,data.snapshot.targetKind),data.snapshot.plan.entry.active,data.snapshot.plan.ascent,data.recordingAllowed);
18 const bool rowsChanged=nextRows!=
rows;
19 rows=std::move(nextRows);
20 auto found=std::find(
rows.begin(),
rows.end(),selected);
26 readouts.push_back({label.x,label.y,label.text,label.color});
30 const auto picture=
Plot(data.snapshot,data.request.view);
31 lines.clear();
lines.reserve(picture.lines.size()*2);
32 for(
const auto& line:picture.lines) {
33 lines.push_back({float(
x+line.a.x),float(
y+line.a.y),0,1,line.color});
34 lines.push_back({float(
x+line.b.x),float(
y+line.b.y),0,1,line.color});
37 for(
const auto& label:picture.labels)
labels.push_back({label.x,label.y,label.text,label.color});
50 if(SUCCEEDED(device->CreateStateBlock(0,&saved))) {
53 device->SetVertexShader(
nullptr); device->SetPixelShader(
nullptr);
63 for(
const auto& label:
labels)
64 DrawTextW(label.text.c_str(),label.x,label.y,0,DT_NOCLIP,label.color);
67 DrawTextW(label.text.c_str(),label.x,label.y,0,DT_NOCLIP,label.color);
74 if(
rows.empty())
return false;
75 if(key==DIK_UP||key==DIK_NUMPAD8) {
uiRow=(std::max)(0,
uiRow-1);
return true; }
76 if(key==DIK_DOWN||key==DIK_NUMPAD2) {
uiRow=(std::min)(
int(
rows.size())-1,
uiRow+1);
return true; }
77 const bool right=key==DIK_RIGHT||key==DIK_NUMPAD6;
78 const bool left=key==DIK_LEFT||key==DIK_NUMPAD4;
80 if(!left&&!right&&!circular)
return false;
82 Edit(data.request,
rows[
uiRow],right?1:-1,data.snapshot,data.clock,circular,data.recordingAllowed);
93 UINT delay=1;
DWORD speed=31;
94 SystemParametersInfoW(SPI_GETKEYBOARDDELAY,0,&delay,0);
95 SystemParametersInfoW(SPI_GETKEYBOARDSPEED,0,&speed,0);
SCRIPT_CONTROL SCRIPT_STATE const void int
SCRIPT_CONTROL SCRIPT_STATE const void DWORD
Rendering::RenderSprite * pSprite
HRESULT BeginSprites() const
Rendering::RenderDevice * GetD3DDevice()
Instrument(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font * > prmFonts)
std::vector< PlotLabel > readouts
Orbital::View plottedView
std::vector< PlotLabel > labels
std::vector< RiseScreenVertex > lines
std::vector< Orbital::Row > rows
std::uint64_t textRevision
bool HandleKeyPress(short key, bool shift) override
Orbit(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font * > prmFonts)
void FrameMove(float fElapsed) override
bool UpdateKeyRepeat(const unsigned char *keys, bool shift, float elapsed) override
std::uint64_t plottedRevision
Mode Objective(const Request &r, TargetKind target)
std::vector< Row > Rows(const Request &r, Mode mode, bool entry=false, bool ascent=false, bool recordingAllowed=false)
std::vector< Label > Readouts(const BusState &data, const std::vector< Row > &rows, int uiRow, bool dorActive, bool showKeys=true)
Picture Plot(const Snapshot &s, View view)
void Edit(Request &r, Row row, int direction, const Snapshot &s, double now, bool circularize=false, bool recordingAllowed=false)
constexpr uint32_t ALPHABLENDENABLE
constexpr uint32_t ZENABLE
constexpr uint32_t DIFFUSE
constexpr uint32_t DISABLE
constexpr uint32_t SELECTARG2
constexpr uint32_t COLOROP
constexpr uint32_t COLORARG2