ANDROID: Add kVirtControls to OSystem_Android

This commit is contained in:
Dries Harnie 2013-05-23 20:54:07 +02:00
parent 35bfb79da8
commit 97a698a554
4 changed files with 12 additions and 3 deletions

View File

@ -134,6 +134,7 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) :
_show_mouse(false), _show_mouse(false),
_show_overlay(false), _show_overlay(false),
_virt_arrowkeys_pressed(false), _virt_arrowkeys_pressed(false),
_virtcontrols_on(false),
_enable_zoning(false), _enable_zoning(false),
_mixer(0), _mixer(0),
_shake_offset(0), _shake_offset(0),
@ -409,6 +410,7 @@ bool OSystem_Android::hasFeature(Feature f) {
f == kFeatureAspectRatioCorrection || f == kFeatureAspectRatioCorrection ||
f == kFeatureCursorPalette || f == kFeatureCursorPalette ||
f == kFeatureVirtualKeyboard || f == kFeatureVirtualKeyboard ||
f == kFeatureVirtControls ||
#ifdef USE_OPENGL #ifdef USE_OPENGL
f == kFeatureOpenGL || f == kFeatureOpenGL ||
#endif #endif
@ -431,6 +433,9 @@ void OSystem_Android::setFeatureState(Feature f, bool enable) {
_virtkeybd_on = enable; _virtkeybd_on = enable;
showVirtualKeyboard(enable); showVirtualKeyboard(enable);
break; break;
case kFeatureVirtControls:
_virtcontrols_on = enable;
break;
case kFeatureCursorPalette: case kFeatureCursorPalette:
_use_mouse_palette = enable; _use_mouse_palette = enable;
if (!enable) if (!enable)
@ -449,6 +454,8 @@ bool OSystem_Android::getFeatureState(Feature f) {
return _ar_correction; return _ar_correction;
case kFeatureVirtualKeyboard: case kFeatureVirtualKeyboard:
return _virtkeybd_on; return _virtkeybd_on;
case kFeatureVirtControls:
return _virtcontrols_on;
case kFeatureCursorPalette: case kFeatureCursorPalette:
return _use_mouse_palette; return _use_mouse_palette;
default: default:

View File

@ -140,6 +140,7 @@ private:
bool _show_mouse; bool _show_mouse;
bool _use_mouse_palette; bool _use_mouse_palette;
bool _virtcontrols_on;
int _virt_arrowkeys_pressed; int _virt_arrowkeys_pressed;
int _graphicsMode; int _graphicsMode;

View File

@ -748,7 +748,7 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
return; return;
} }
if (_show_mouse) { if (!_virtcontrols_on) {
e.type = Common::EVENT_MOUSEMOVE; e.type = Common::EVENT_MOUSEMOVE;
if (_touchpad_mode) { if (_touchpad_mode) {
@ -881,7 +881,7 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
switch (arg2) { switch (arg2) {
case JACTION_DOWN: case JACTION_DOWN:
case JACTION_MULTIPLE: case JACTION_MULTIPLE:
if (!_show_mouse) { if (_virtcontrols_on) {
checkVirtArrowKeys(arg1, arg2, arg3, arg4, arg5, arg6); checkVirtArrowKeys(arg1, arg2, arg3, arg4, arg5, arg6);
} }
return; return;
@ -894,7 +894,7 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
if (arg1 > _fingersDown) if (arg1 > _fingersDown)
_fingersDown = arg1; _fingersDown = arg1;
if (!_show_mouse) { if (_virtcontrols_on) {
checkVirtArrowKeys(arg1, arg2, arg3, arg4, arg5, arg6); checkVirtArrowKeys(arg1, arg2, arg3, arg4, arg5, arg6);
} }

View File

@ -312,6 +312,7 @@ public:
//ResidualVM specific //ResidualVM specific
kFeatureOpenGL, kFeatureOpenGL,
kFeatureVirtControls,
/** /**
* The presence of this feature indicates whether the displayLogFile() * The presence of this feature indicates whether the displayLogFile()