From 93155b8a1eb2f047438108e111b4aaea64e027c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 14 Jan 2014 11:01:45 +0100 Subject: [PATCH] Warning fixes --- ui/view.cpp | 2 -- ui/virtual_input.cpp | 7 +------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ui/view.cpp b/ui/view.cpp index 1b4e23f036..06e7b36e1a 100644 --- a/ui/view.cpp +++ b/ui/view.cpp @@ -111,7 +111,6 @@ void Event::Trigger(EventParams &e) { // Call this from UI thread EventReturn Event::Dispatch(EventParams &e) { - bool eventHandled = false; for (auto iter = handlers_.begin(); iter != handlers_.end(); ++iter) { if ((iter->func)(e) == UI::EVENT_DONE) { // Event is handled, stop looping immediately. This event might even have gotten deleted. @@ -404,7 +403,6 @@ EventReturn CheckBox::OnClicked(EventParams &e) { void CheckBox::Draw(UIContext &dc) { ClickableItem::Draw(dc); int paddingX = 12; - int paddingY = 8; int image = *toggle_ ? dc.theme->checkOn : dc.theme->checkOff; diff --git a/ui/virtual_input.cpp b/ui/virtual_input.cpp index cf1ff447b9..f27a81993e 100644 --- a/ui/virtual_input.cpp +++ b/ui/virtual_input.cpp @@ -57,7 +57,6 @@ void TouchCrossPad::update(InputState &input_state) float stick_size_ = radius_ * 2; float inv_stick_size = 1.0f / (stick_size_ * scale_); const float deadzone = 0.17f; - bool all_up = true; for (int i = 0; i < MAX_POINTERS; i++) { if (input_state.pointer_down[i]) { @@ -67,13 +66,11 @@ void TouchCrossPad::update(InputState &input_state) if (rad < deadzone || rad > 1.0f) continue; - all_up = false; - if (dx == 0 && dy == 0) continue; int direction = (int)(floorf((atan2f(dy, dx) / (2 * M_PI) * 8) + 0.5f)) & 7; - + input_state.pad_buttons &= ~(PAD_BUTTON_LEFT | PAD_BUTTON_RIGHT | PAD_BUTTON_UP | PAD_BUTTON_DOWN); switch (direction) { case 0: input_state.pad_buttons |= PAD_BUTTON_RIGHT; break; @@ -117,10 +114,8 @@ TouchStick::TouchStick(const Atlas *atlas, int bgImageIndex, int stickImageIndex void TouchStick::update(InputState &input_state) { float inv_stick_size = 1.0f / (stick_size_ * scale_); - bool all_up = true; for (int i = 0; i < MAX_POINTERS; i++) { if (input_state.pointer_down[i]) { - all_up = false; float dx = (input_state.pointer_x[i] - stick_x_) * inv_stick_size; float dy = (input_state.pointer_y[i] - stick_y_) * inv_stick_size; // Ignore outside box