Remove ugly hack
Now 10% more platform independent
This commit is contained in:
parent
37cd8494f1
commit
bc69303cc3
19
src/main.cpp
19
src/main.cpp
|
@ -89,14 +89,19 @@ int main(int argc, char* argv[])
|
|||
pinephone = false;
|
||||
#endif
|
||||
|
||||
// WARNING, THIS IS A BIG HACK
|
||||
// this is only to make it so KittehPlayer works first try on pinephone.
|
||||
// There once was a hacky piece of a code, now its gone.
|
||||
// TODO: launch a opengl window or use offscreen to see if GL_ARB_framebuffer_object
|
||||
// can be found
|
||||
if (!(settings.value("Backend/disableSunxiCheck", false).toBool() || ranFirstTimeSetup) || pinephone ) {
|
||||
FILE* fd = popen("grep sun[x8]i /proc/modules", "r");
|
||||
char buf[16];
|
||||
if (fread(buf, 1, sizeof(buf), fd) > 0 || pinephone) {
|
||||
std::string buf;
|
||||
std::ifstream modulesFd;
|
||||
|
||||
modulesFd.open("/proc/modules");
|
||||
|
||||
if(modulesFd.is_open()) {
|
||||
while(!modulesFd.eof()) {
|
||||
std::getline(modulesFd, buf);
|
||||
if(buf.find("sunxi") != std::string::npos || buf.find("sun8i") != std::string::npos) {
|
||||
launcherLogger->info("Running on sunxi, switching to NoFBO.");
|
||||
settings.setValue("Appearance/clickToPause", false);
|
||||
settings.setValue("Appearance/doubleTapToSeek", true);
|
||||
|
@ -106,6 +111,10 @@ int main(int argc, char* argv[])
|
|||
settings.setValue("Backend/fbo", false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
launcherLogger->info("(THIS IS NOT AN ERROR) Cant open /proc/modules.");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
settings.setValue("Setup/ranSetup", true);
|
||||
|
|
Loading…
Reference in a new issue