Precalculated renderer specific surface data, better management of multiple renderers...
[supertux.git] / src / gameconfig.cpp
index 80f27c0..61ca19e 100644 (file)
@@ -36,11 +36,7 @@ Config* config = 0;
 Config::Config()
 {
   use_fullscreen = true;
-#ifdef HAVE_OPENGL
-  video = "opengl";
-#else
-  video = "sdl";
-#endif
+  video = OPENGL;
   try_vsync = true;
   show_fps = false;
   sound_enabled = true;
@@ -78,7 +74,9 @@ Config::load()
   const lisp::Lisp* config_video_lisp = config_lisp->get_lisp("video");
   if(config_video_lisp) {
     config_video_lisp->get("fullscreen", use_fullscreen);
-    config_video_lisp->get("video", video);
+    std::string video_string;
+    config_video_lisp->get("video", video_string);
+    video = get_video_system(video_string);
     config_video_lisp->get("vsync", try_vsync);
     config_video_lisp->get("width", screenwidth);
     config_video_lisp->get("height", screenheight);
@@ -110,7 +108,7 @@ Config::save()
 
   writer.start_list("video");
   writer.write_bool("fullscreen", use_fullscreen);
-  writer.write_string("video", video);
+  writer.write_string("video", get_video_string(video));
   writer.write_bool("vsync", try_vsync);
   writer.write_int("width", screenwidth);
   writer.write_int("height", screenheight);