Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 11, 2005, 5:43:37 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: implemented aim

Location:
orxonox/trunk/src/lib/graphics
Files:
3 edited

Legend:

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

    r4817 r4830  
    6767}
    6868
     69/**
     70 * initializes the GraphicsEngine with default settings.
     71 */
    6972int GraphicsEngine::init()
    7073{
    71   this->initVideo(640,480,16);
    72 }
     74  if (this->isInit)
     75    return -1;
     76  this->initVideo(640, 480, 16);
     77  this->isInit = true;
     78}
     79
     80/**
     81 * loads the GraphicsEngine's settings from a given ini-file and section
     82 * @param iniParser the iniParser to load from
     83 * @param section the Section in the ini-file to load from
     84 * @returns nothing usefull
     85 */
     86int GraphicsEngine::initFromIniFile(IniParser* iniParser)
     87{
     88
     89  // looking if we are in fullscreen-mode
     90  const char* fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0");
     91  if (strchr(fullscreen, '1'))
     92    this->fullscreenFlag = SDL_FULLSCREEN;
     93
     94
     95
     96  // looking if we are in fullscreen-mode
     97  const char* textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0");
     98  if (strchr(textures, '1'))
     99    this->texturesEnabled = true;
     100  else
     101    this->texturesEnabled = false;
     102
     103  // searching for a usefull resolution
     104  SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480"), 'x');
     105  this->initVideo(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16);
     106}
     107
     108
    73109
    74110/**
     
    123159
    124160/**
    125  * loads the GraphicsEngine's settings from a given ini-file and section
    126  * @param iniParser the iniParser to load from
    127  * @param section the Section in the ini-file to load from
    128  * @returns nothing usefull
    129  */
    130 int GraphicsEngine::initFromIniFile(IniParser* iniParser)
    131 {
    132   // searching for a usefull resolution
    133   SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480"), 'x');
    134   this->initVideo(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16);
    135 
    136   // looking if we are in fullscreen-mode
    137   const char* fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0");
    138   if (strchr(fullscreen, '1'))
    139     this->setFullscreen(true);
    140 
    141   // looking if we are in fullscreen-mode
    142   const char* textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0");
    143   if (strchr(textures, '1'))
    144     this->texturesEnabled = true;
    145   else
    146     this->texturesEnabled = false;
    147 
    148 }
    149 
    150 
    151 
    152 /**
    153161 * sets the Window Captions and the Name of the icon.
    154162 * @param windowName The name of the Window
  • orxonox/trunk/src/lib/graphics/importer/model.h

    r4806 r4830  
    2626 * \todo implement this stuff
    2727*/
    28 typedef enum MODEL_TYPE {MODEL_DISPLAY_LIST,
    29                          MODEL_VERTEX_ARRAY};
     28typedef enum MODEL_TYPE {
     29  MODEL_DISPLAY_LIST,
     30  MODEL_VERTEX_ARRAY
     31};
    3032
    3133
     
    3638
    3739//! an enumerator for VERTEX_FORMAT
    38 typedef enum VERTEX_FORMAT { VERTEX_ONLY = VERTEX,
    39                              VERTEX_NORMAL = NORMAL,
    40                              VERTEX_TEXCOORD = TEXCOORD,
    41                              VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD };
     40typedef enum VERTEX_FORMAT {
     41  VERTEX_ONLY = VERTEX,
     42  VERTEX_NORMAL = NORMAL,
     43  VERTEX_TEXCOORD = TEXCOORD,
     44  VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD
     45};
    4246
    4347////////////////////
  • orxonox/trunk/src/lib/graphics/text_engine.cc

    r4746 r4830  
    254254      glTranslatef(pos.x, pos.y, 0);
    255255
    256       char* tmpText = this->text;
     256      const char* tmpText = this->text;
    257257      while (*tmpText != '\0')
    258258        {
     
    921921  // drawing all the texts
    922922  tIterator<Text>* textIterator = textList->getIterator();
    923   Text* text = textIterator->nextElement();
    924   while( text != NULL)
    925     {
    926       text->draw();
    927       text = textIterator->nextElement();
     923  Text* drawText = textIterator->nextElement();
     924  while( drawText != NULL)
     925    {
     926      drawText->draw();
     927      drawText = textIterator->nextElement();
    928928    }
    929929  delete textIterator;
Note: See TracChangeset for help on using the changeset viewer.