1
0
Fork 0

Remove ugly hack

Now 10% more platform independent
This commit is contained in:
Myst33d 2020-10-03 23:33:20 +06:00 committed by purringChaos
parent 37cd8494f1
commit bc69303cc3

View file

@ -89,21 +89,30 @@ int main(int argc, char* argv[])
pinephone = false; pinephone = false;
#endif #endif
// WARNING, THIS IS A BIG HACK // There once was a hacky piece of a code, now its gone.
// this is only to make it so KittehPlayer works first try on pinephone.
// TODO: launch a opengl window or use offscreen to see if GL_ARB_framebuffer_object // TODO: launch a opengl window or use offscreen to see if GL_ARB_framebuffer_object
// can be found // can be found
if (!(settings.value("Backend/disableSunxiCheck", false).toBool() || ranFirstTimeSetup) || pinephone ) { if (!(settings.value("Backend/disableSunxiCheck", false).toBool() || ranFirstTimeSetup) || pinephone ) {
FILE* fd = popen("grep sun[x8]i /proc/modules", "r"); std::string buf;
char buf[16]; std::ifstream modulesFd;
if (fread(buf, 1, sizeof(buf), fd) > 0 || pinephone) {
launcherLogger->info("Running on sunxi, switching to NoFBO."); modulesFd.open("/proc/modules");
settings.setValue("Appearance/clickToPause", false);
settings.setValue("Appearance/doubleTapToSeek", true); if(modulesFd.is_open()) {
settings.setValue("Appearance/scaleFactor", 2.2); while(!modulesFd.eof()) {
settings.setValue("Appearance/subtitlesFontSize", 38); std::getline(modulesFd, buf);
settings.setValue("Appearance/uiFadeTimer", 0); if(buf.find("sunxi") != std::string::npos || buf.find("sun8i") != std::string::npos) {
settings.setValue("Backend/fbo", false); launcherLogger->info("Running on sunxi, switching to NoFBO.");
settings.setValue("Appearance/clickToPause", false);
settings.setValue("Appearance/doubleTapToSeek", true);
settings.setValue("Appearance/scaleFactor", 2.2);
settings.setValue("Appearance/subtitlesFontSize", 38);
settings.setValue("Appearance/uiFadeTimer", 0);
settings.setValue("Backend/fbo", false);
}
}
} else {
launcherLogger->info("(THIS IS NOT AN ERROR) Cant open /proc/modules.");
} }
} }
#endif #endif