mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-19 16:18:45 +00:00
IPHONE: Move event fetching implementation to iPhoneView.
This commit is contained in:
parent
6626258e0f
commit
a92c54454f
@ -111,6 +111,8 @@ struct InternalEvent {
|
||||
|
||||
- (void)applicationResume;
|
||||
|
||||
- (bool)fetchEvent:(int *)outEvent value1:(int *)v1 value2:(int *)v2;
|
||||
|
||||
@end
|
||||
|
||||
extern iPhoneView *g_iPhoneViewInstance;
|
||||
|
@ -66,20 +66,7 @@ void iPhone_updateScreen() {
|
||||
}
|
||||
|
||||
bool iPhone_fetchEvent(int *outEvent, int *outX, int *outY) {
|
||||
[g_iPhoneViewInstance->_eventLock lock];
|
||||
Common::List<InternalEvent> &events = g_iPhoneViewInstance->_events;
|
||||
if (events.empty()) {
|
||||
[g_iPhoneViewInstance->_eventLock unlock];
|
||||
return false;
|
||||
}
|
||||
|
||||
const InternalEvent &front = *events.begin();
|
||||
*outEvent = front.type;
|
||||
*outX = front.value1;
|
||||
*outY = front.value2;
|
||||
events.pop_front();
|
||||
[g_iPhoneViewInstance->_eventLock unlock];
|
||||
return true;
|
||||
return [g_iPhoneViewInstance fetchEvent:outEvent value1:outX value2:outY];
|
||||
}
|
||||
|
||||
uint getSizeNextPOT(uint size) {
|
||||
@ -582,6 +569,22 @@ const char *iPhone_getDocumentsDir() {
|
||||
[_eventLock unlock];
|
||||
}
|
||||
|
||||
- (bool)fetchEvent:(int *)outEvent value1:(int *)v1 value2:(int *)v2 {
|
||||
[_eventLock lock];
|
||||
if (_events.empty()) {
|
||||
[_eventLock unlock];
|
||||
return false;
|
||||
}
|
||||
|
||||
const InternalEvent &front = *_events.begin();
|
||||
*outEvent = front.type;
|
||||
*v1 = front.value1;
|
||||
*v2 = front.value2;
|
||||
_events.pop_front();
|
||||
[_eventLock unlock];
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts portrait mode coordinates into rotated mode coordinates.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user