Commit 605a39aa authored by reassembler's avatar reassembler
Browse files

Controls to adjust horizon

parent 8759fb71
......@@ -657,6 +657,15 @@ void Outrun::controls()
oinputs.simulate_analog();
else
oinputs.analog();
if (input.is_pressed(Input::HORIZON_DOWN))
{
oroad.horizon_base += -20;
}
else if (input.is_pressed(Input::HORIZON_UP))
{
oroad.horizon_base += 20;
}
}
// -------------------------------------------------------------------------------
......
......@@ -127,11 +127,17 @@ void Input::handle_key(const int key, const bool is_pressed)
case SDLK_F5:
keys[MENU] = is_pressed;
break;
case SDLK_F7:
keys[HORIZON_DOWN] = is_pressed;
break;
case SDLK_F8:
keys[HORIZON_UP] = is_pressed;
break;
}
}
#include <iostream>
void Input::handle_joy_axis(SDL_JoyAxisEvent* evt)
{
int16_t value = evt->value;
......
......@@ -32,10 +32,13 @@ public:
STEP = 10,
TIMER = 11,
MENU = 12,
HORIZON_DOWN = 13,
HORIZON_UP = 14
};
bool keys[13];
bool keys_old[13];
bool keys[15];
bool keys_old[15];
// Has gamepad been found?
bool gamepad;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment