Remove End/UpdateInputState and ButtonTracker.

No longer used for anything.
This commit is contained in:
Unknown W. Brackets 2017-03-13 22:58:38 -07:00
parent 02855e7abb
commit 2812ddcc86
9 changed files with 0 additions and 83 deletions

View file

@ -198,11 +198,6 @@ void UpdateRunLoop(InputState *input_state) {
}
NativeUpdate(*input_state);
{
std::lock_guard<std::mutex> guard(input_state->lock);
EndInputState(input_state);
}
if (GetUIState() != UISTATE_EXIT) {
NativeRender(graphicsContext);
}

View file

@ -932,7 +932,6 @@ bool NativeKey(const KeyInput &key) {
}
}
#endif
g_buttonTracker.Process(key);
bool retval = false;
if (screenManager)
retval = screenManager->key(key);

View file

@ -51,7 +51,6 @@ inline static void ExecuteInputPoll() {
if (host && (focused || !g_Config.bGamepadOnlyFocused)) {
host->PollControllers(input_state);
}
UpdateInputState(&input_state);
}
static void RunInputThread() {

View file

@ -512,8 +512,6 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_init
androidVersion = jAndroidVersion;
deviceType = jdeviceType;
g_buttonTracker.Reset();
left_joystick_x_async = 0;
left_joystick_y_async = 0;
right_joystick_x_async = 0;
@ -682,16 +680,9 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayRender(JNIEnv *env,
input_state.pad_lstick_y = left_joystick_y_async;
input_state.pad_rstick_x = right_joystick_x_async;
input_state.pad_rstick_y = right_joystick_y_async;
UpdateInputState(&input_state);
}
NativeUpdate(input_state);
{
std::lock_guard<std::mutex> guard(input_state.lock);
EndInputState(&input_state);
}
NativeRender(graphicsContext);
time_update();
} else {
@ -1067,16 +1058,9 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J
input_state.pad_lstick_y = left_joystick_y_async;
input_state.pad_rstick_x = right_joystick_x_async;
input_state.pad_rstick_y = right_joystick_y_async;
UpdateInputState(&input_state);
}
NativeUpdate(input_state);
{
std::lock_guard<std::mutex> guard(input_state.lock);
EndInputState(&input_state);
}
NativeRender(graphicsContext);
time_update();

View file

@ -844,7 +844,6 @@ int main(int argc, char *argv[]) {
break;
const uint8_t *keys = SDL_GetKeyboardState(NULL);
SimulateGamepad(keys, &input_state);
UpdateInputState(&input_state, true);
UpdateRunLoop(&input_state);
if (g_QuitRequested)
break;

View file

@ -338,7 +338,6 @@ void MainUI::paintGL()
SDL_PumpEvents();
#endif
updateAccelerometer();
UpdateInputState(&input_state);
time_update();
UpdateRunLoop(&input_state);
}

View file

@ -88,34 +88,3 @@ void SetTabLeftRightKeys(const std::vector<KeyDef> &tabLeft, const std::vector<K
tabLeftKeys = tabLeft;
tabRightKeys = tabRight;
}
uint32_t ButtonTracker::Update() {
pad_buttons_ |= pad_buttons_async_set;
pad_buttons_ &= ~pad_buttons_async_clear;
return pad_buttons_;
}
void ButtonTracker::Process(const KeyInput &input) {
int btn = MapPadButtonFixed(input.keyCode);
if (btn == 0)
return;
// For now, use a fixed mapping. Good enough for the basics on most platforms.
if (input.flags & KEY_DOWN) {
pad_buttons_async_set |= btn;
pad_buttons_async_clear &= ~btn;
}
if (input.flags & KEY_UP) {
pad_buttons_async_set &= ~btn;
pad_buttons_async_clear |= btn;
}
}
ButtonTracker g_buttonTracker;
void UpdateInputState(InputState *input, bool merge) {
}
void EndInputState(InputState *input) {
}

View file

@ -156,9 +156,6 @@ private:
DISALLOW_COPY_AND_ASSIGN(InputState);
};
void UpdateInputState(InputState *input, bool merge = false);
void EndInputState(InputState *input);
enum {
TOUCH_MOVE = 1 << 0,
TOUCH_DOWN = 1 << 1,
@ -214,28 +211,6 @@ struct AxisInput {
int flags;
};
class ButtonTracker {
public:
ButtonTracker() { Reset(); }
void Reset() {
pad_buttons_ = 0;
pad_buttons_async_set = 0;
pad_buttons_async_clear = 0;
}
void Process(const KeyInput &input);
uint32_t Update();
uint32_t GetPadButtons() const { return pad_buttons_; }
private:
uint32_t pad_buttons_;
uint32_t pad_buttons_async_set;
uint32_t pad_buttons_async_clear;
};
// Platforms should call g_buttonTracker.Process().
extern ButtonTracker g_buttonTracker;
// Is there a nicer place for this stuff? It's here to avoid dozens of linking errors in UnitTest..
extern std::vector<KeyDef> dpadKeys;
extern std::vector<KeyDef> confirmKeys;

View file

@ -255,9 +255,7 @@ static GraphicsContext *graphicsContext;
{
{
std::lock_guard<std::mutex> guard(input_state.lock);
UpdateInputState(&input_state);
NativeUpdate(input_state);
EndInputState(&input_state);
}
NativeRender(graphicsContext);