projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial integration, lots of broken stuff
[supertux.git]
/
src
/
gameconfig.cpp
diff --git
a/src/gameconfig.cpp
b/src/gameconfig.cpp
index
43f2ce0
..
4972804
100644
(file)
--- a/
src/gameconfig.cpp
+++ b/
src/gameconfig.cpp
@@
-20,7
+20,7
@@
#include "gameconfig.hpp"
#include "gameconfig.hpp"
-#include <
cstdlib
>
+#include <
stdlib.h
>
#include <string>
#include <stdexcept>
#include <string>
#include <stdexcept>
@@
-36,6
+36,9
@@
Config* config = 0;
Config::Config()
{
use_fullscreen = true;
Config::Config()
{
use_fullscreen = true;
+ //video = AUTO_VIDEO;
+ video = "auto";
+ try_vsync = true;
show_fps = false;
sound_enabled = true;
music_enabled = true;
show_fps = false;
sound_enabled = true;
music_enabled = true;
@@
-44,10
+47,11
@@
Config::Config()
screenwidth = 800;
screenheight = 600;
screenwidth = 800;
screenheight = 600;
- aspectwidth = 4;
- aspectheight = 3;
+ aspect_ratio = -1; // autodetect
enable_script_debugger = false;
enable_script_debugger = false;
+
+ locale = ""; // autodetect
}
Config::~Config()
}
Config::~Config()
@@
-57,7
+61,7
@@
void
Config::load()
{
lisp::Parser parser;
Config::load()
{
lisp::Parser parser;
-
std::auto_ptr<lisp::Lisp> root (parser.parse("config")
);
+
const lisp::Lisp* root = parser.parse("config"
);
const lisp::Lisp* config_lisp = root->get_lisp("supertux-config");
if(!config_lisp)
const lisp::Lisp* config_lisp = root->get_lisp("supertux-config");
if(!config_lisp)
@@
-65,15
+69,20
@@
Config::load()
config_lisp->get("show_fps", show_fps);
config_lisp->get("console", console_enabled);
config_lisp->get("show_fps", show_fps);
config_lisp->get("console", console_enabled);
+ config_lisp->get("locale", locale);
config_lisp->get("random_seed", random_seed);
const lisp::Lisp* config_video_lisp = config_lisp->get_lisp("video");
if(config_video_lisp) {
config_video_lisp->get("fullscreen", use_fullscreen);
config_lisp->get("random_seed", random_seed);
const lisp::Lisp* config_video_lisp = config_lisp->get_lisp("video");
if(config_video_lisp) {
config_video_lisp->get("fullscreen", use_fullscreen);
+ //std::string video_string;
+ //config_video_lisp->get("video", video_string);
+ //video = get_video_system(video_string);
+ config_video_lisp->get("video", video);
+ config_video_lisp->get("vsync", try_vsync);
config_video_lisp->get("width", screenwidth);
config_video_lisp->get("height", screenheight);
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");
}
const lisp::Lisp* config_audio_lisp = config_lisp->get_lisp("audio");
@@
-97,13
+106,16
@@
Config::save()
writer.write_bool("show_fps", show_fps);
writer.write_bool("console", console_enabled);
writer.write_bool("show_fps", show_fps);
writer.write_bool("console", console_enabled);
+ writer.write_string("locale", locale);
writer.start_list("video");
writer.write_bool("fullscreen", use_fullscreen);
writer.start_list("video");
writer.write_bool("fullscreen", use_fullscreen);
+ //writer.write_string("video", get_video_string(video));
+ writer.write_string("video", video);
+ writer.write_bool("vsync", try_vsync);
writer.write_int("width", screenwidth);
writer.write_int("height", screenheight);
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");
writer.end_list("video");
writer.start_list("audio");