Fixed problems with zero-delay decoders.

This commit is contained in:
Pieter Hulshoff 2020-03-11 14:59:12 +01:00
parent e72c7dbb3a
commit c168496b45
11 changed files with 29 additions and 2 deletions

View File

@ -9,5 +9,5 @@ public:
virtual bool update(SDL_Event &e) = 0;
virtual bool pressed() = 0;
virtual void reset() = 0;
virtual void updateKeystate() = 0;
};

View File

@ -9,6 +9,7 @@ public:
bool update(SDL_Event &e);
bool pressed();
void reset();
void updateKeystate() {};
private:
SDL_JoystickID joyid_;

View File

@ -9,6 +9,7 @@ public:
bool update(SDL_Event &e);
bool pressed();
void reset();
void updateKeystate() {};
private:
SDL_JoystickID joynum_;

View File

@ -9,6 +9,7 @@ public:
bool update(SDL_Event &e);
bool pressed();
void reset();
void updateKeystate() {};
private:
SDL_JoystickID joynum_;

View File

@ -29,3 +29,8 @@ bool KeyboardHandler::pressed()
return pressed_;
}
void KeyboardHandler::updateKeystate()
{
const Uint8 *state = SDL_GetKeyboardState(NULL);
pressed_ = state[scancode_];
}

View File

@ -9,6 +9,7 @@ public:
bool update(SDL_Event &e);
bool pressed();
void reset();
void updateKeystate( );
private:
SDL_Scancode scancode_;

View File

@ -9,6 +9,7 @@ public:
bool update(SDL_Event &e);
bool pressed();
void reset();
void updateKeystate() {};
private:
Uint8 button_;

View File

@ -375,3 +375,17 @@ void UserInput::reconfigure( )
keyHandlers_.clear();
initialize( );
}
void UserInput::updateKeystate( )
{
for ( unsigned int i = 0; i < keyHandlers_.size( ); ++i )
{
InputHandler *h = keyHandlers_[i].first;
if ( h )
{
h->updateKeystate( );
currentKeyState_[keyHandlers_[i].second] |= h->pressed( );
}
}
}

View File

@ -68,6 +68,7 @@ public:
bool newKeyPressed(KeyCode_E code);
void clearJoysticks( );
void reconfigure( );
void updateKeystate( );
private:
bool MapKey(std::string keyDescription, KeyCode_E key);

View File

@ -1213,6 +1213,8 @@ void RetroFE::run( )
attract_.reset( );
}
currentPage_->update( deltaTime );
SDL_PumpEvents( );
input_.updateKeystate( );
if (!splashMode)
{
if ( currentPage_->isAttractIdle( ) )

View File

@ -21,7 +21,7 @@
std::string retrofe_version_major = "0";
std::string retrofe_version_minor = "9";
std::string retrofe_version_build = "21";
std::string retrofe_version_build = "22";
std::string Version::getString( )