1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-11 02:50:24 +00:00
freebsd-ports/games/motogt/files/patch-src-Config.cpp
Dmitry Marakasov 3a5765ec14 - Support staging
- Fix crash on first start (e.g. when no config is found)
- Fix crash when changing resolutions with no XRender extension (e.g. with nvidia blob)
2014-02-02 18:07:42 +00:00

23 lines
730 B
C++

--- src/Config.cpp.orig 2011-01-18 06:52:35.000000000 +0300
+++ src/Config.cpp 2014-02-02 21:13:04.124154052 +0400
@@ -139,6 +139,9 @@
}
void Config::ChangeResolution(bool up) {
+ if (num_modes == 0)
+ return;
+
if (cur_mode!=num_modes) cur_mode+=up?1:num_modes-1;
cur_mode=cur_mode%num_modes;
real_w=modes_w[cur_mode];
@@ -226,7 +229,8 @@
old_fullscreen=fullscreen;
changed=false;
ofstream fil((home_dir+"settings.lst").c_str(),ios::trunc);
- fil<<"version="<<(config->version=VERSION)<<endl;
+ fil<<"version="<<VERSION<<endl;
+ if (config) config->version = VERSION;
fil<<"fullscreen="<<(fullscreen?1:0)<<endl;
fil<<"low_textures="<<(low_textures?1:0)<<endl;
fil<<"sound="<<(sound_on?1:0)<<endl;