Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7256 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Mar 30, 2006, 11:45:31 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the preferences back to the trunk
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/preferences . -r7233:HEAD
no conflicts… nice work

Location:
trunk/src/lib/graphics
Files:
2 edited

Legend:

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

    r7221 r7256  
    2929#include "debug.h"
    3030
    31 #include "parser/ini_parser/ini_parser.h"
     31#include "util/preferences.h"
    3232#include "substring.h"
    3333#include "text.h"
     
    150150/**
    151151 * loads the GraphicsEngine's settings from a given ini-file and section
    152  * @param iniParser the iniParser to load from
    153  * @param section the Section in the ini-file to load from
    154152 * @returns nothing usefull
    155153 */
    156 int GraphicsEngine::initFromIniFile(IniParser* iniParser)
     154int GraphicsEngine::initFromPreferences()
    157155{
    158156  // looking if we are in fullscreen-mode
    159   const std::string fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0");
     157  const std::string fullscreen = Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO, CONFIG_NAME_FULLSCREEN, "0");
     158
    160159  if (fullscreen[0] == '1' || fullscreen == "true")
    161160    this->fullscreenFlag = SDL_FULLSCREEN;
    162161
    163162  // looking if we are in fullscreen-mode
    164   const std::string textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0");
     163  const std::string textures = Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO_ADVANCED, CONFIG_NAME_TEXTURES, "0");
    165164  if (textures[0] == '1' || textures == "true")
    166165    Texture::setTextureEnableState(true);
     
    169168
    170169  // searching for a usefull resolution
    171   SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480").c_str(), 'x'); ///FIXME
     170  SubString resolution(Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO, CONFIG_NAME_RESOLUTION, "640x480").c_str(), 'x'); ///FIXME
    172171  //resolution.debug();
    173172  MultiType x = resolution.getString(0), y = resolution.getString(1);
  • trunk/src/lib/graphics/graphics_engine.h

    r7221 r7256  
    2020// Forward Declaration
    2121class Text;
    22 class IniParser;
    2322class WorldEntity;
    2423class GraphicsEffect;
     
    3938
    4039    int init();
    41     int initFromIniFile(IniParser* iniParser);
     40    int initFromPreferences();
    4241
    4342    void setWindowName(const std::string& windowName, const std::string& icon);
Note: See TracChangeset for help on using the changeset viewer.