Attempt to address some auto-reported crashes on Android

Still confused about the SignalSema/WaitSema ones.. they are still getting reported at high frequency
This commit is contained in:
Henrik Rydgard 2015-11-25 12:05:32 +01:00
parent a0cff13efa
commit ee4261cf5c
3 changed files with 11 additions and 5 deletions

View file

@ -124,7 +124,6 @@ void hleCheat(u64 userdata, int cyclesLate) {
}
CWCheatEngine::CWCheatEngine() {
}
void CWCheatEngine::Exit() {
@ -139,7 +138,7 @@ static inline std::vector<std::string> makeCodeParts(const std::vector<std::stri
char empty = ' ';
for (size_t i = 0; i < CodesList.size(); i++) {
currentcode = CodesList[i];
for (size_t j=0; j < currentcode.length(); j++) {
for (size_t j = 0; j < currentcode.length(); j++) {
if (currentcode[j] == empty) {
currentcode[j] = '\n';
}
@ -201,7 +200,8 @@ std::vector<int> CWCheatEngine::GetNextCode() { // Feeds a size-2 vector of ints
std::vector<int> finalCode;
std::string modifier2 = "0";
while (true) {
if (currentCode >= parts.size()) {
// Shouldn't splitCode be cleared here? Otherwise var1 and var2 will always be set to the first two codes.. I don't get it
if (currentCode >= parts.size() - 1) {
code1.clear();
code2.clear();
break;

View file

@ -360,6 +360,12 @@ public class NativeActivity extends Activity {
if (Build.MANUFACTURER == "OUYA") {
mGLSurfaceView.getHolder().setFormat(PixelFormat.RGBX_8888);
mGLSurfaceView.setEGLConfigChooser(new NativeEGLConfigChooser());
} else {
// Many devices require that we set a config chooser, despite the documentation
// explicitly stating: "If no setEGLConfigChooser method is called, then by default the view will choose an RGB_888 surface with a depth buffer depth of at least 16 bits."
// On these devices, I get these crashes: http://stackoverflow.com/questions/14167319/android-opengl-demo-no-config-chosen
// So let's try it...
mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 8);
}
mGLSurfaceView.setRenderer(nativeRenderer);

View file

@ -144,7 +144,7 @@ public class NativeEGLConfigChooser implements EGLConfigChooser {
}
if (chosen == null) {
// Third, accept one with alpha but with stencil.
// Third, accept one with alpha but with stencil, 24-bit depth.
for (int i = 0; i < configs.length; i++) {
ConfigAttribs c = configs[i];
if (c.red == 8 && c.green == 8 && c.blue == 8 && c.alpha == 8 && c.stencil >= 8 && c.depth >= 24) {
@ -155,7 +155,7 @@ public class NativeEGLConfigChooser implements EGLConfigChooser {
}
if (chosen == null) {
// Third, accept one with alpha but with stencil.
// Third, accept one with alpha but with stencil, 16-bit depth.
for (int i = 0; i < configs.length; i++) {
ConfigAttribs c = configs[i];
if (c.red == 8 && c.green == 8 && c.blue == 8 && c.alpha == 8 && c.stencil >= 8 && c.depth >= 16) {