X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvideo%2Fomapdss%2Fconfig.c;h=a1eb5fd2ab5db9af77f8315804060a45fa71cfc4;hb=5f4b1fd346a57d90ffda9eaba68c7b0b0aa8acab;hp=865b80ad4094848955f5f378bf85cac8beb50d29;hpb=0aab059fdffebbbf5af73cc7549adaf58470d0ec;p=sdl_omap.git diff --git a/src/video/omapdss/config.c b/src/video/omapdss/config.c index 865b80a..a1eb5fd 100644 --- a/src/video/omapdss/config.c +++ b/src/video/omapdss/config.c @@ -1,5 +1,5 @@ /* - * (C) notaz, 2010 + * (C) Gražvydas "notaz" Ignotas, 2010 * * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. * See the COPYING file in the top-level directory. @@ -13,8 +13,6 @@ #include "omapsdl.h" -int gcfg_force_vsync; - static char *sskip(char *p) { while (*p && isspace(*p)) @@ -51,7 +49,7 @@ static int check_token_eq(char **p_, const char *token) return ret; } -void omapsdl_config(void) +void omapsdl_config(struct SDL_PrivateVideoData *pdata) { char buff[256]; FILE *f; @@ -65,7 +63,7 @@ void omapsdl_config(void) if (line == NULL) break; p = line = sskip(line); - if (*p == '#') + if (*p == 0 || *p == '#') continue; if (check_token(&p, "bind")) { @@ -86,7 +84,15 @@ void omapsdl_config(void) continue; } else if (check_token_eq(&p, "force_vsync")) { - gcfg_force_vsync = strtol(p, NULL, 0); + pdata->cfg_force_vsync = !!strtol(p, NULL, 0); + continue; + } + else if (check_token_eq(&p, "force_doublebuf")) { + pdata->cfg_force_doublebuf = !!strtol(p, NULL, 0); + continue; + } + else if (check_token_eq(&p, "no_ts_translate")) { + pdata->cfg_no_ts_translate = !!strtol(p, NULL, 0); continue; } @@ -96,4 +102,18 @@ bad: fclose(f); } +void omapsdl_config_from_env(struct SDL_PrivateVideoData *pdata) +{ + const char *tmp; + + tmp = getenv("SDL_OMAP_VSYNC"); + if (tmp != NULL) + pdata->cfg_force_vsync = !!strtol(tmp, NULL, 0); + tmp = getenv("SDL_OMAP_FORCE_DOUBLEBUF"); + if (tmp != NULL) + pdata->cfg_force_doublebuf = !!strtol(tmp, NULL, 0); + tmp = getenv("SDL_OMAP_NO_TS_TRANSLATE"); + if (tmp != NULL) + pdata->cfg_no_ts_translate = !!strtol(tmp, NULL, 0); +}