mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-04 12:37:08 +00:00
Warning fixes
This commit is contained in:
parent
1d1ee54982
commit
93155b8a1e
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user