mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-06-04 18:06:47 +02:00
Fixed problems with zero-delay decoders.
This commit is contained in:
@@ -9,5 +9,5 @@ public:
|
|||||||
virtual bool update(SDL_Event &e) = 0;
|
virtual bool update(SDL_Event &e) = 0;
|
||||||
virtual bool pressed() = 0;
|
virtual bool pressed() = 0;
|
||||||
virtual void reset() = 0;
|
virtual void reset() = 0;
|
||||||
|
virtual void updateKeystate() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public:
|
|||||||
bool update(SDL_Event &e);
|
bool update(SDL_Event &e);
|
||||||
bool pressed();
|
bool pressed();
|
||||||
void reset();
|
void reset();
|
||||||
|
void updateKeystate() {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SDL_JoystickID joyid_;
|
SDL_JoystickID joyid_;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public:
|
|||||||
bool update(SDL_Event &e);
|
bool update(SDL_Event &e);
|
||||||
bool pressed();
|
bool pressed();
|
||||||
void reset();
|
void reset();
|
||||||
|
void updateKeystate() {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SDL_JoystickID joynum_;
|
SDL_JoystickID joynum_;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public:
|
|||||||
bool update(SDL_Event &e);
|
bool update(SDL_Event &e);
|
||||||
bool pressed();
|
bool pressed();
|
||||||
void reset();
|
void reset();
|
||||||
|
void updateKeystate() {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SDL_JoystickID joynum_;
|
SDL_JoystickID joynum_;
|
||||||
|
|||||||
@@ -29,3 +29,8 @@ bool KeyboardHandler::pressed()
|
|||||||
return pressed_;
|
return pressed_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KeyboardHandler::updateKeystate()
|
||||||
|
{
|
||||||
|
const Uint8 *state = SDL_GetKeyboardState(NULL);
|
||||||
|
pressed_ = state[scancode_];
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public:
|
|||||||
bool update(SDL_Event &e);
|
bool update(SDL_Event &e);
|
||||||
bool pressed();
|
bool pressed();
|
||||||
void reset();
|
void reset();
|
||||||
|
void updateKeystate( );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SDL_Scancode scancode_;
|
SDL_Scancode scancode_;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public:
|
|||||||
bool update(SDL_Event &e);
|
bool update(SDL_Event &e);
|
||||||
bool pressed();
|
bool pressed();
|
||||||
void reset();
|
void reset();
|
||||||
|
void updateKeystate() {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Uint8 button_;
|
Uint8 button_;
|
||||||
|
|||||||
@@ -375,3 +375,17 @@ void UserInput::reconfigure( )
|
|||||||
keyHandlers_.clear();
|
keyHandlers_.clear();
|
||||||
initialize( );
|
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( );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public:
|
|||||||
bool newKeyPressed(KeyCode_E code);
|
bool newKeyPressed(KeyCode_E code);
|
||||||
void clearJoysticks( );
|
void clearJoysticks( );
|
||||||
void reconfigure( );
|
void reconfigure( );
|
||||||
|
void updateKeystate( );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool MapKey(std::string keyDescription, KeyCode_E key);
|
bool MapKey(std::string keyDescription, KeyCode_E key);
|
||||||
|
|||||||
@@ -1213,6 +1213,8 @@ void RetroFE::run( )
|
|||||||
attract_.reset( );
|
attract_.reset( );
|
||||||
}
|
}
|
||||||
currentPage_->update( deltaTime );
|
currentPage_->update( deltaTime );
|
||||||
|
SDL_PumpEvents( );
|
||||||
|
input_.updateKeystate( );
|
||||||
if (!splashMode)
|
if (!splashMode)
|
||||||
{
|
{
|
||||||
if ( currentPage_->isAttractIdle( ) )
|
if ( currentPage_->isAttractIdle( ) )
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
std::string retrofe_version_major = "0";
|
std::string retrofe_version_major = "0";
|
||||||
std::string retrofe_version_minor = "9";
|
std::string retrofe_version_minor = "9";
|
||||||
std::string retrofe_version_build = "21";
|
std::string retrofe_version_build = "22";
|
||||||
|
|
||||||
|
|
||||||
std::string Version::getString( )
|
std::string Version::getString( )
|
||||||
|
|||||||
Reference in New Issue
Block a user