Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 2, 2005, 1:20:56 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: GraphicsEngine now parses the INI-file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4769 r4770  
    2121#include "debug.h"
    2222#include "text_engine.h"
     23
     24#include "ini_parser.h"
     25#include "substring.h"
    2326
    2427using namespace std;
     
    102105  glEnable(GL_DEPTH_TEST);
    103106}
     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 */
     114int 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
    104126
    105127
Note: See TracChangeset for help on using the changeset viewer.