Changeset 4777 in orxonox.OLD
- Timestamp:
- Jul 2, 2005, 7:21:50 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4770 r4777 112 112 * @returns nothing usefull 113 113 */ 114 int GraphicsEngine::loadFromIniFile(IniParser* iniParser , const char* section)114 int GraphicsEngine::loadFromIniFile(IniParser* iniParser) 115 115 { 116 116 // searching for a usefull resolution 117 SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, section, "640x480"), 'x');117 SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480"), 'x'); 118 118 this->setResolution(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16); 119 119 120 120 // looking if we are in fullscreen-mode 121 const char* fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, section, "0");121 const char* fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0"); 122 122 if (strchr(fullscreen, '1')) 123 123 this->setFullscreen(true); 124 125 // looking if we are in fullscreen-mode 126 const char* textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0"); 127 if (strchr(textures, '1')) 128 this->texturesEnabled = true; 129 else 130 this->texturesEnabled = false; 131 124 132 } 125 133 -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r4770 r4777 31 31 32 32 int initVideo(); 33 int loadFromIniFile(IniParser* iniParser , const char* section);33 int loadFromIniFile(IniParser* iniParser); 34 34 35 35 void setWindowName(const char* windowName, const char* icon); -
orxonox/trunk/src/lib/gui/gui_video.cc
r4746 r4777 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 16 16 You should have received a copy of the GNU General Public License 17 17 along with this program; if not, write to the Free Software Foundation, 18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 19 20 20 … … 118 118 shadows->saveability(); 119 119 advancedBox->fill(shadows); 120 120 121 121 fog = new CheckButton(CONFIG_NAME_FOG); 122 122 fog->saveability(); 123 123 advancedBox->fill(fog); 124 124 125 125 reflections = new CheckButton(CONFIG_NAME_REFLECTIONS); 126 126 reflections->saveability(); 127 127 advancedBox->fill(reflections); 128 128 129 129 textures = new CheckButton(CONFIG_NAME_TEXTURES); 130 textures->setDefaultValue(1); 130 131 textures->saveability(); 131 132 advancedBox->fill(textures); 132 133 133 134 textureDetail = new Menu(CONFIG_NAME_TEXTURE_DETAIL, "low", "medium", "high", "lastItem"); 134 135 textureDetail->setDefaultValue(1); 135 136 textureDetail->saveability(); 136 137 advancedBox->fill(textureDetail); 137 138 138 139 modelDetailLabel = new Label(CONFIG_NAME_MODEL_DETAIL); 139 140 advancedBox->fill(modelDetailLabel); … … 142 143 modelDetail->saveability(); 143 144 advancedBox->fill(modelDetail); 144 145 145 146 particles = new CheckButton(CONFIG_NAME_PARTICLES_ENABLED); 146 147 particles->saveability(); … … 154 155 antiAliasing->saveability(); 155 156 advancedBox->fill(antiAliasing); 156 157 157 158 filterMethodLabel = new Label("Filtering Method:"); 158 159 advancedBox->fill(filterMethodLabel); … … 163 164 164 165 165 166 166 167 closeButton = new Button("close"); 167 168 #ifdef HAVE_GTK2 … … 194 195 int x = 0,y =0; // check for difference 195 196 char tmpChar[100]; 196 197 197 198 /* Get available fullscreen/hardware modes */ 198 199 modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE); 199 200 200 201 /* Check is there are any modes available */ 201 202 if(modes == (SDL_Rect **)0){ … … 203 204 exit(-1); 204 205 } 205 206 206 207 /* Check if our resolution is restricted */ 207 208 if(modes == (SDL_Rect **)-1){ … … 213 214 for(i = 0; modes[i] ;++i) 214 215 { 215 216 { 217 218 219 220 221 216 if (x != modes[i]->w || y != modes[i]->h) 217 { 218 PRINTF(5)(" %d x %d\n", modes[i]->w, modes[i]->h); 219 sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h); 220 menu->addItem(tmpChar); 221 x = modes[i]->w; y = modes[i]->h; 222 } 222 223 } 223 224 } -
orxonox/trunk/src/orxonox.cc
r4770 r4777 153 153 GraphicsEngine::getInstance()->setWindowName(PACKAGE_NAME " " PACKAGE_VERSION, PACKAGE_NAME " " PACKAGE_VERSION); 154 154 155 GraphicsEngine::getInstance()->loadFromIniFile(this->iniParser , CONFIG_SECTION_VIDEO);155 GraphicsEngine::getInstance()->loadFromIniFile(this->iniParser); 156 156 157 157 return 0;
Note: See TracChangeset
for help on using the changeset viewer.