X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgameconfig.cpp;h=eedc884b9b68f35a636569479621a574f5d6427b;hb=c174dfb2a675b039e915e01549950c7a5b554492;hp=43f2ce0a0932ff8851be67f73f1d595990a13354;hpb=b3df78c0b5dcf53a730bd4372aa11e3f5636606f;p=supertux.git diff --git a/src/gameconfig.cpp b/src/gameconfig.cpp index 43f2ce0a0..eedc884b9 100644 --- a/src/gameconfig.cpp +++ b/src/gameconfig.cpp @@ -20,7 +20,7 @@ #include "gameconfig.hpp" -#include +#include #include #include @@ -44,8 +44,7 @@ Config::Config() screenwidth = 800; screenheight = 600; - aspectwidth = 4; - aspectheight = 3; + aspect_ratio = -1; // autodetect enable_script_debugger = false; } @@ -57,7 +56,7 @@ void Config::load() { lisp::Parser parser; - std::auto_ptr root (parser.parse("config")); + const lisp::Lisp* root = parser.parse("config"); const lisp::Lisp* config_lisp = root->get_lisp("supertux-config"); if(!config_lisp) @@ -72,8 +71,7 @@ Config::load() config_video_lisp->get("fullscreen", use_fullscreen); config_video_lisp->get("width", screenwidth); config_video_lisp->get("height", screenheight); - config_video_lisp->get("aspectwidth", aspectwidth); - config_video_lisp->get("aspectheight", aspectheight); + config_video_lisp->get("aspect_ratio", aspect_ratio); } const lisp::Lisp* config_audio_lisp = config_lisp->get_lisp("audio"); @@ -102,8 +100,7 @@ Config::save() writer.write_bool("fullscreen", use_fullscreen); writer.write_int("width", screenwidth); writer.write_int("height", screenheight); - writer.write_int("aspectwidth", aspectwidth); - writer.write_int("aspectheight", aspectheight); + writer.write_float("aspect_ratio", aspect_ratio); writer.end_list("video"); writer.start_list("audio");