[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] [pingus] push by address@hidden - Do not show OpenGL in Opt
From: |
pingus |
Subject: |
[Pingus-CVS] [pingus] push by address@hidden - Do not show OpenGL in OptionMenu when not compiled in, use fullscreen_... on 2011-10-20 00:00 GMT |
Date: |
Thu, 20 Oct 2011 00:05:46 +0000 |
Revision: e8c6bf2ef23f
Author: Ingo Ruhnke <address@hidden>
Date: Wed Oct 19 17:00:36 2011
Log: Do not show OpenGL in OptionMenu when not compiled in, use
fullscreen_resolution when --fullscreen is given
Fixes issue 95
http://code.google.com/p/pingus/source/detail?r=e8c6bf2ef23f
Modified:
/src/pingus/pingus_main.cpp
/src/pingus/screens/option_menu.cpp
=======================================
--- /src/pingus/pingus_main.cpp Wed Oct 19 15:54:10 2011
+++ /src/pingus/pingus_main.cpp Wed Oct 19 17:00:36 2011
@@ -599,20 +599,31 @@
print_greeting_message();
+ // init the display
FramebufferType fbtype = SDL_FRAMEBUFFER;
if (cmd_options.framebuffer_type.is_set())
{
fbtype = cmd_options.framebuffer_type.get();
}
+
+ bool fullscreen = cmd_options.fullscreen.is_set() ?
cmd_options.fullscreen.get() : false;
+ bool resizable = cmd_options.resizable.is_set() ?
cmd_options.resizable.get() : true;
Size screen_size(800, 600);
- if (cmd_options.geometry.is_set())
- {
- screen_size = cmd_options.geometry.get();
- }
-
- bool fullscreen = cmd_options.fullscreen.is_set() ?
cmd_options.fullscreen.get() : false;
- bool resizable = cmd_options.resizable.is_set() ?
cmd_options.resizable.get() : true;
+ if (fullscreen)
+ {
+ if (cmd_options.fullscreen_resolution.is_set())
+ {
+ screen_size = cmd_options.fullscreen_resolution.get();
+ }
+ }
+ else
+ {
+ if (cmd_options.geometry.is_set())
+ {
+ screen_size = cmd_options.geometry.get();
+ }
+ }
SDLSystem system;
try
@@ -629,11 +640,15 @@
{
log_error("couldn't create window, falling back to SDL: " <<
err.what());
system.create_window(SDL_FRAMEBUFFER, screen_size, fullscreen,
resizable);
+ config_manager.set_renderer(SDL_FRAMEBUFFER);
}
}
+ // init other components
SavegameManager savegame_manager("savegames/savegames.scm");
StatManager stat_manager("savegames/variables.scm");
+
+ // FIXME: turn these into RAII
Resource::init();
Fonts::init();
Sound::PingusSound::init();
=======================================
--- /src/pingus/screens/option_menu.cpp Sun Oct 9 09:36:28 2011
+++ /src/pingus/screens/option_menu.cpp Wed Oct 19 17:00:36 2011
@@ -126,11 +126,21 @@
}
ChoiceBox* renderer_box = new ChoiceBox(Rect());
- renderer_box->add_choice("delta");
renderer_box->add_choice("sdl");
+ renderer_box->add_choice("delta");
+#ifdef HAVE_OPENGL
renderer_box->add_choice("opengl");
-
renderer_box->set_current_choice(static_cast<int>(config_manager.get_renderer()));
-
+#endif
+
+ switch(config_manager.get_renderer())
+ {
+ case SDL_FRAMEBUFFER: renderer_box->set_current_choice(0); break;
+ case DELTA_FRAMEBUFFER: renderer_box->set_current_choice(1); break;
+#ifdef HAVE_OPENGL
+ case OPENGL_FRAMEBUFFER: renderer_box->set_current_choice(2); break;
+#endif
+ default: assert(!"unknown renderer type");
+ }
m_language = dictionary_manager.get_language();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] [pingus] push by address@hidden - Do not show OpenGL in OptionMenu when not compiled in, use fullscreen_... on 2011-10-20 00:00 GMT,
pingus <=