Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4777 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jul 2, 2005, 7:21:50 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ability to disable textures

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

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

    r4770 r4777  
    112112 * @returns nothing usefull
    113113 */
    114 int GraphicsEngine::loadFromIniFile(IniParser* iniParser, const char* section)
     114int GraphicsEngine::loadFromIniFile(IniParser* iniParser)
    115115{
    116116  // 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');
    118118  this->setResolution(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16);
    119119
    120120  // 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");
    122122  if (strchr(fullscreen, '1'))
    123123    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
    124132}
    125133
  • orxonox/trunk/src/lib/graphics/graphics_engine.h

    r4770 r4777  
    3131
    3232    int initVideo();
    33     int loadFromIniFile(IniParser* iniParser, const char* section);
     33    int loadFromIniFile(IniParser* iniParser);
    3434
    3535    void setWindowName(const char* windowName, const char* icon);
  • orxonox/trunk/src/lib/gui/gui_video.cc

    r4746 r4777  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    1616   You should have received a copy of the GNU General Public License
    1717   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.
    1919
    2020
     
    118118      shadows->saveability();
    119119      advancedBox->fill(shadows);
    120      
     120
    121121      fog = new CheckButton(CONFIG_NAME_FOG);
    122122      fog->saveability();
    123123      advancedBox->fill(fog);
    124      
     124
    125125      reflections = new CheckButton(CONFIG_NAME_REFLECTIONS);
    126126      reflections->saveability();
    127127      advancedBox->fill(reflections);
    128      
     128
    129129      textures = new CheckButton(CONFIG_NAME_TEXTURES);
     130      textures->setDefaultValue(1);
    130131      textures->saveability();
    131132      advancedBox->fill(textures);
    132      
     133
    133134      textureDetail = new Menu(CONFIG_NAME_TEXTURE_DETAIL, "low", "medium", "high", "lastItem");
    134135      textureDetail->setDefaultValue(1);
    135136      textureDetail->saveability();
    136137      advancedBox->fill(textureDetail);
    137      
     138
    138139      modelDetailLabel = new Label(CONFIG_NAME_MODEL_DETAIL);
    139140      advancedBox->fill(modelDetailLabel);
     
    142143      modelDetail->saveability();
    143144      advancedBox->fill(modelDetail);
    144      
     145
    145146      particles = new CheckButton(CONFIG_NAME_PARTICLES_ENABLED);
    146147      particles->saveability();
     
    154155      antiAliasing->saveability();
    155156      advancedBox->fill(antiAliasing);
    156      
     157
    157158      filterMethodLabel = new Label("Filtering Method:");
    158159      advancedBox->fill(filterMethodLabel);
     
    163164
    164165
    165  
     166
    166167      closeButton = new Button("close");
    167168#ifdef HAVE_GTK2
     
    194195  int x = 0,y =0; // check for difference
    195196  char tmpChar[100];
    196  
     197
    197198  /* Get available fullscreen/hardware modes */
    198199  modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
    199  
     200
    200201  /* Check is there are any modes available */
    201202  if(modes == (SDL_Rect **)0){
     
    203204    exit(-1);
    204205  }
    205  
     206
    206207  /* Check if our resolution is restricted */
    207208  if(modes == (SDL_Rect **)-1){
     
    213214    for(i = 0; modes[i] ;++i)
    214215      {
    215         if (x != modes[i]->w || y != modes[i]->h)
    216           {
    217             PRINTF(5)("  %d x %d\n", modes[i]->w, modes[i]->h);
    218             sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h);
    219             menu->addItem(tmpChar);
    220             x = modes[i]->w; y = modes[i]->h;
    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          }
    222223      }
    223224  }
  • orxonox/trunk/src/orxonox.cc

    r4770 r4777  
    153153  GraphicsEngine::getInstance()->setWindowName(PACKAGE_NAME " " PACKAGE_VERSION, PACKAGE_NAME " " PACKAGE_VERSION);
    154154
    155   GraphicsEngine::getInstance()->loadFromIniFile(this->iniParser, CONFIG_SECTION_VIDEO);
     155  GraphicsEngine::getInstance()->loadFromIniFile(this->iniParser);
    156156
    157157  return 0;
Note: See TracChangeset for help on using the changeset viewer.