mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 03:09:53 +02:00
Fix some warnings
This commit is contained in:
@@ -22,7 +22,7 @@ void SetFpsLimit(FpsLimit newFpsLimit)
|
||||
emscripten_set_main_loop(MainLoopBody, 0, 0);
|
||||
mainLoopSet = true;
|
||||
}
|
||||
if (auto *fpsLimitVsync = std::get_if<FpsLimitVsync>(&newFpsLimit))
|
||||
if (std::get_if<FpsLimitVsync>(&newFpsLimit))
|
||||
{
|
||||
emscripten_set_main_loop_timing(EM_TIMING_RAF, 1);
|
||||
std::cerr << "implicit fps limit via vsync" << std::endl;
|
||||
|
@@ -359,7 +359,7 @@ OptionsView::OptionsView() : ui::Window(ui::Point(-1, -1), ui::Point(320, 340))
|
||||
addSeparator();
|
||||
|
||||
auto *creditsButton = new ui::Button(ui::Point(10, currentY), ui::Point(90, 16), "Credits");
|
||||
creditsButton->SetActionCallback({ [this] {
|
||||
creditsButton->SetActionCallback({ [] {
|
||||
auto *credits = new Credits();
|
||||
ui::Engine::Ref().ShowWindow(credits);
|
||||
} });
|
||||
|
@@ -49,7 +49,7 @@ RenderView::RenderView():
|
||||
renderModes.push_back(renderModeCheckbox);
|
||||
renderModeCheckbox->mode = mode;
|
||||
renderModeCheckbox->SetIcon(icon);
|
||||
renderModeCheckbox->SetActionCallback({ [this, renderModeCheckbox] {
|
||||
renderModeCheckbox->SetActionCallback({ [this] {
|
||||
auto renderMode = CalculateRenderMode();
|
||||
c->SetRenderMode(renderMode);
|
||||
} });
|
||||
|
@@ -364,11 +364,11 @@ AnyType CommandInterface::tptS_set(std::deque<String> * words)
|
||||
// assume that value can be anything
|
||||
if (value.GetType() == TypeNumber && propInfo.Type == StructProperty::Float)
|
||||
{
|
||||
value = FloatType(NumberType(value).Value());
|
||||
value = FloatType(float(NumberType(value).Value()));
|
||||
}
|
||||
if (value.GetType() == TypeFloat && propInfo.Type != StructProperty::Float)
|
||||
{
|
||||
value = NumberType(FloatType(value).Value());
|
||||
value = NumberType(int(FloatType(value).Value()));
|
||||
}
|
||||
// value can still be almost anything, but if it was NumberType or FloatType,
|
||||
// at least it now matches the float-ness, if not the signedness, of prop
|
||||
|
Reference in New Issue
Block a user