Changeset 4770 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Jul 2, 2005, 1:20:56 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4769 r4770 21 21 #include "debug.h" 22 22 #include "text_engine.h" 23 24 #include "ini_parser.h" 25 #include "substring.h" 23 26 24 27 using namespace std; … … 102 105 glEnable(GL_DEPTH_TEST); 103 106 } 107 108 /** 109 * loads the GraphicsEngine's settings from a given ini-file and section 110 * @param iniParser the iniParser to load from 111 * @param section the Section in the ini-file to load from 112 * @returns nothing usefull 113 */ 114 int GraphicsEngine::loadFromIniFile(IniParser* iniParser, const char* section) 115 { 116 // searching for a usefull resolution 117 SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, section, "640x480"), 'x'); 118 this->setResolution(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16); 119 120 // looking if we are in fullscreen-mode 121 const char* fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, section, "0"); 122 if (strchr(fullscreen, '1')) 123 this->setFullscreen(true); 124 } 125 104 126 105 127 -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r4768 r4770 17 17 // Forward Declaration 18 18 class Text; 19 class IniParser; 19 20 20 21 //! class to handle graphics … … 30 31 31 32 int initVideo(); 33 int loadFromIniFile(IniParser* iniParser, const char* section); 32 34 33 35 void setWindowName(const char* windowName, const char* icon); -
orxonox/trunk/src/orxonox.cc
r4769 r4770 153 153 GraphicsEngine::getInstance()->setWindowName(PACKAGE_NAME " " PACKAGE_VERSION, PACKAGE_NAME " " PACKAGE_VERSION); 154 154 155 156 SubString resolution(this->iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480"), 'x'); 157 GraphicsEngine::getInstance()->setResolution(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16); 158 159 const char* fullscreen = this->iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0"); 160 printf("%s\n", fullscreen); 161 if (strchr(fullscreen, '1')) 162 GraphicsEngine::getInstance()->setFullscreen(true); 155 GraphicsEngine::getInstance()->loadFromIniFile(this->iniParser, CONFIG_SECTION_VIDEO); 163 156 164 157 return 0; -
orxonox/trunk/src/subprojects/gui/Makefile.am
r4751 r4770 24 24 $(MAINSRCDIR)/util/resource_manager.cc \ 25 25 $(MAINSRCDIR)/lib/util/substring.cc \ 26 $(MAINSRCDIR)/util/loading/load_param.cc 26 $(MAINSRCDIR)/util/loading/load_param.cc \ 27 $(MAINSRCDIR)/lib/util/ini_parser.cc 27 28 28 29 noinst_HEADERS= -
orxonox/trunk/src/subprojects/gui/Makefile.in
r4751 r4770 56 56 gui-base_object.$(OBJEXT) gui-class_list.$(OBJEXT) \ 57 57 gui-vector.$(OBJEXT) gui-resource_manager.$(OBJEXT) \ 58 gui-substring.$(OBJEXT) gui-load_param.$(OBJEXT) 58 gui-substring.$(OBJEXT) gui-load_param.$(OBJEXT) \ 59 gui-ini_parser.$(OBJEXT) 59 60 gui_OBJECTS = $(am_gui_OBJECTS) 60 61 am__DEPENDENCIES_1 = … … 66 67 @AMDEP_TRUE@ ./$(DEPDIR)/gui-graphics_engine.Po \ 67 68 @AMDEP_TRUE@ ./$(DEPDIR)/gui-gui_main.Po \ 69 @AMDEP_TRUE@ ./$(DEPDIR)/gui-ini_parser.Po \ 68 70 @AMDEP_TRUE@ ./$(DEPDIR)/gui-load_param.Po \ 69 71 @AMDEP_TRUE@ ./$(DEPDIR)/gui-resource_manager.Po \ … … 206 208 $(MAINSRCDIR)/util/resource_manager.cc \ 207 209 $(MAINSRCDIR)/lib/util/substring.cc \ 208 $(MAINSRCDIR)/util/loading/load_param.cc 210 $(MAINSRCDIR)/util/loading/load_param.cc \ 211 $(MAINSRCDIR)/lib/util/ini_parser.cc 209 212 210 213 noinst_HEADERS = … … 279 282 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui-graphics_engine.Po@am__quote@ 280 283 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui-gui_main.Po@am__quote@ 284 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui-ini_parser.Po@am__quote@ 281 285 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui-load_param.Po@am__quote@ 282 286 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui-resource_manager.Po@am__quote@ … … 427 431 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 428 432 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gui_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gui-load_param.obj `if test -f '$(MAINSRCDIR)/util/loading/load_param.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/loading/load_param.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/loading/load_param.cc'; fi` 433 434 gui-ini_parser.o: $(MAINSRCDIR)/lib/util/ini_parser.cc 435 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gui_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gui-ini_parser.o -MD -MP -MF "$(DEPDIR)/gui-ini_parser.Tpo" -c -o gui-ini_parser.o `test -f '$(MAINSRCDIR)/lib/util/ini_parser.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/ini_parser.cc; \ 436 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/gui-ini_parser.Tpo" "$(DEPDIR)/gui-ini_parser.Po"; else rm -f "$(DEPDIR)/gui-ini_parser.Tpo"; exit 1; fi 437 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/ini_parser.cc' object='gui-ini_parser.o' libtool=no @AMDEPBACKSLASH@ 438 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/gui-ini_parser.Po' tmpdepfile='$(DEPDIR)/gui-ini_parser.TPo' @AMDEPBACKSLASH@ 439 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 440 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gui_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gui-ini_parser.o `test -f '$(MAINSRCDIR)/lib/util/ini_parser.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/ini_parser.cc 441 442 gui-ini_parser.obj: $(MAINSRCDIR)/lib/util/ini_parser.cc 443 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gui_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gui-ini_parser.obj -MD -MP -MF "$(DEPDIR)/gui-ini_parser.Tpo" -c -o gui-ini_parser.obj `if test -f '$(MAINSRCDIR)/lib/util/ini_parser.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/ini_parser.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/ini_parser.cc'; fi`; \ 444 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/gui-ini_parser.Tpo" "$(DEPDIR)/gui-ini_parser.Po"; else rm -f "$(DEPDIR)/gui-ini_parser.Tpo"; exit 1; fi 445 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/ini_parser.cc' object='gui-ini_parser.obj' libtool=no @AMDEPBACKSLASH@ 446 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/gui-ini_parser.Po' tmpdepfile='$(DEPDIR)/gui-ini_parser.TPo' @AMDEPBACKSLASH@ 447 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 448 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gui_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gui-ini_parser.obj `if test -f '$(MAINSRCDIR)/lib/util/ini_parser.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/ini_parser.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/ini_parser.cc'; fi` 429 449 uninstall-info-am: 430 450
Note: See TracChangeset
for help on using the changeset viewer.