Skip to content

Commit 131d1e8

Browse files
author
Sebastian Pape
committed
fixing warnings and adapting to parameter changes
1 parent 2a22a90 commit 131d1e8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

DasherCore

src/DasherUIScreen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ DasherUIScreen::DasherUIScreen(): Dasher::CDasherScreen(100,100), CScreenCoordIn
1010

1111
std::pair<Dasher::screenint, Dasher::screenint> DasherUIScreen::TextSize(Label* Label, unsigned iFontSize)
1212
{
13-
const ImVec2 Size = Font->CalcTextSizeA(iFontSize, FLT_MAX, -1, Label->m_strText.c_str());
14-
return {Size.x, Size.y};
13+
const ImVec2 Size = Font->CalcTextSizeA(static_cast<float>(iFontSize), FLT_MAX, -1, Label->m_strText.c_str());
14+
return {static_cast<Dasher::screenint>(Size.x), static_cast<Dasher::screenint>(Size.y)};
1515
}
1616

1717
void DasherUIScreen::DrawString(Label* label, Dasher::screenint x, Dasher::screenint y, unsigned iFontSize, int iColour)

src/MainWindow.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ MainWindow::MainWindow()
1717
Controller = make_unique<DasherController>(Settings.get());
1818
Controller->Initialize();
1919

20-
Controller->GetPermittedValues(SP_ALPHABET_ID, Alphabets);
20+
Controller->GetPermittedValues(Dasher::SP_ALPHABET_ID, Alphabets);
2121

2222
}
2323

@@ -61,16 +61,16 @@ bool MainWindow::render(float DeltaTime)
6161
{
6262
ClearBuffer();
6363
}
64-
int speed = Controller->GetLongParameter(LP_MAX_BITRATE);
64+
int speed = Controller->GetLongParameter(Dasher::LP_MAX_BITRATE);
6565
if(ImGui::SliderInt ("Speed", &speed, 1, 2000))
6666
{
67-
Controller->SetLongParameter(LP_MAX_BITRATE, speed);
67+
Controller->SetLongParameter(Dasher::LP_MAX_BITRATE, speed);
6868
}
6969

7070
static int item_current = 0;
7171
if(ImGui::Combo("Alphabet", &item_current, [](void* data, int idx, const char** out_text) { *out_text = static_cast<const std::vector<std::string>*>(data)->at(idx).c_str(); return true; }, (void*)&Alphabets, static_cast<int>(Alphabets.size()), 10))
7272
{
73-
Controller->SetStringParameter(SP_ALPHABET_ID, Alphabets[item_current]);
73+
Controller->SetStringParameter(Dasher::SP_ALPHABET_ID, Alphabets[item_current]);
7474
}
7575

7676
ImGui::EndMenu();
@@ -117,7 +117,7 @@ bool MainWindow::render(float DeltaTime)
117117
ImGui::ColorConvertFloat4ToU32({0,1,0,1})
118118
);
119119

120-
Controller->Render(DeltaTime * 1000.0f, canvasPos, canvasSize); //convert to millis
120+
Controller->Render(static_cast<long>(DeltaTime * 1000.0f), canvasPos, canvasSize); //convert to millis
121121

122122
ImGui::PopClipRect();
123123
}

0 commit comments

Comments
 (0)