mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-01 16:35:20 +00:00
Fix ItemAction
svn-id: r12627
This commit is contained in:
parent
a5aba18abf
commit
511e8ded4e
@ -129,7 +129,7 @@ bool CEActions::perform(ActionType action) {
|
||||
case ACTION_PAUSE:
|
||||
case ACTION_SAVE:
|
||||
case ACTION_SKIP:
|
||||
KeysBuffer::Instance()->add(&_key_action[action]);
|
||||
KeysBuffer::Instance()->simulate(&_key_action[action]);
|
||||
return true;
|
||||
case ACTION_KEYBOARD:
|
||||
_mainSystem->swap_panel();
|
||||
|
@ -37,7 +37,7 @@ namespace CEGUI {
|
||||
|
||||
bool ItemAction::action(int x, int y, bool pushed) {
|
||||
|
||||
if (checkInside(x, y) && _visible) {
|
||||
if (checkInside(x, y) && _visible && pushed) {
|
||||
CEActions::Instance()->perform(_action);
|
||||
return true;
|
||||
}
|
||||
|
@ -38,6 +38,19 @@ namespace CEKEYS {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool KeysBuffer::simulate(const Key *key) {
|
||||
if (_currentAdd == _capacity - 2)
|
||||
return false;
|
||||
|
||||
_currentGet = _currentAdd;
|
||||
_buffer[_currentAdd] = *key;
|
||||
_buffer[_currentAdd++].setPushed(true);
|
||||
_buffer[_currentAdd] = *key;
|
||||
_buffer[_currentAdd++].setPushed(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
KeysBuffer* KeysBuffer::Instance(int capacity) {
|
||||
if (!_instance)
|
||||
_instance = new KeysBuffer(capacity);
|
||||
|
@ -35,6 +35,7 @@ namespace CEKEYS {
|
||||
public:
|
||||
static KeysBuffer* Instance(int capacity = 5);
|
||||
bool add(const Key *key);
|
||||
bool simulate(const Key *key);
|
||||
Key* get();
|
||||
~KeysBuffer();
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user