ANDROID: Attempt at working around some HTC fail
This commit is contained in:
parent
23ad90b781
commit
bceab2656b
3 changed files with 19 additions and 1 deletions
|
@ -101,6 +101,7 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) :
|
||||||
_screen_changeid(0),
|
_screen_changeid(0),
|
||||||
_egl_surface_width(0),
|
_egl_surface_width(0),
|
||||||
_egl_surface_height(0),
|
_egl_surface_height(0),
|
||||||
|
_htc_fail(false),
|
||||||
_force_redraw(false),
|
_force_redraw(false),
|
||||||
_game_texture(0),
|
_game_texture(0),
|
||||||
_overlay_texture(0),
|
_overlay_texture(0),
|
||||||
|
@ -132,11 +133,19 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) :
|
||||||
_touchpad_scale(66),
|
_touchpad_scale(66),
|
||||||
_dpad_scale(4),
|
_dpad_scale(4),
|
||||||
_trackball_scale(2) {
|
_trackball_scale(2) {
|
||||||
|
Common::String fp = getSystemProperty("ro.build.fingerprint");
|
||||||
|
|
||||||
LOGI("Running on: [%s] [%s] SDK:%s ABI:%s",
|
LOGI("Running on: [%s] [%s] SDK:%s ABI:%s",
|
||||||
getSystemProperty("ro.build.fingerprint").c_str(),
|
fp.c_str(),
|
||||||
getSystemProperty("ro.build.display.id").c_str(),
|
getSystemProperty("ro.build.display.id").c_str(),
|
||||||
getSystemProperty("ro.build.version.sdk").c_str(),
|
getSystemProperty("ro.build.version.sdk").c_str(),
|
||||||
getSystemProperty("ro.product.cpu.abi").c_str());
|
getSystemProperty("ro.product.cpu.abi").c_str());
|
||||||
|
|
||||||
|
fp.toLowercase();
|
||||||
|
_htc_fail = fp.contains("htc");
|
||||||
|
|
||||||
|
if (_htc_fail)
|
||||||
|
LOGI("Enabling HTC workaround");
|
||||||
}
|
}
|
||||||
|
|
||||||
OSystem_Android::~OSystem_Android() {
|
OSystem_Android::~OSystem_Android() {
|
||||||
|
|
|
@ -99,6 +99,7 @@ private:
|
||||||
int _screen_changeid;
|
int _screen_changeid;
|
||||||
int _egl_surface_width;
|
int _egl_surface_width;
|
||||||
int _egl_surface_height;
|
int _egl_surface_height;
|
||||||
|
bool _htc_fail;
|
||||||
|
|
||||||
bool _force_redraw;
|
bool _force_redraw;
|
||||||
|
|
||||||
|
|
|
@ -523,6 +523,14 @@ void OSystem_Android::updateScreen() {
|
||||||
|
|
||||||
if (!JNI::swapBuffers())
|
if (!JNI::swapBuffers())
|
||||||
LOGW("swapBuffers failed: 0x%x", glGetError());
|
LOGW("swapBuffers failed: 0x%x", glGetError());
|
||||||
|
|
||||||
|
// HTC's GLES drivers are made of fail
|
||||||
|
// http://code.google.com/p/android/issues/detail?id=3047
|
||||||
|
if (!_show_overlay && _htc_fail) {
|
||||||
|
const Common::Rect &rect = _game_texture->getDrawRect();
|
||||||
|
|
||||||
|
glScissor(rect.left, rect.top, rect.width(), rect.height());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphics::Surface *OSystem_Android::lockScreen() {
|
Graphics::Surface *OSystem_Android::lockScreen() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue