Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6815 in orxonox.OLD for trunk/src/lib/graphics/graphics_engine.cc


Ignore:
Timestamp:
Jan 28, 2006, 5:11:51 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged branches/network back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/network . -r6774:HEAD

no conflicts…
thats what i call orthogonal work

File:
1 edited

Legend:

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

    r6780 r6815  
    4141#include "shell_command.h"
    4242
     43
     44#include "parser/tinyxml/tinyxml.h"
     45#include "load_param.h"
     46#include "factory.h"
     47
    4348#ifdef __WIN32__
    4449 #include "class_list.h"
     
    113118  GraphicsEngine::singletonRef = NULL;
    114119}
     120
     121
     122/**
     123 * loads the GraphicsEngine Specific Parameters.
     124 * @param root: the XML-Element to load the Data From
     125 */
     126void GraphicsEngine::loadParams(const TiXmlElement* root)
     127{
     128  LoadParamXML(root, "load-effect", this, GraphicsEngine, loadGraphicsEffectXML)
     129      .describe("loads a graphics effect");
     130}
     131
    115132
    116133/**
     
    150167  this->initVideo(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16);
    151168
    152   GraphicsEffect* fe = new FogEffect(NULL);
    153   this->loadGraphicsEffect(fe);
    154   fe->activate();
    155   PRINTF(0)("--------------------------------------------------------------\n");
     169//   GraphicsEffect* fe = new FogEffect(NULL);
     170//   this->loadGraphicsEffect(fe);
     171//   fe->activate();
     172//   PRINTF(0)("--------------------------------------------------------------\n");
    156173}
    157174
     
    571588#endif /* NO_TEXT */
    572589
    573 
    574   }
     590  }
     591
    575592  Render2D::getInstance()->tick(dt);
     593
     594  // tick the graphics effects
     595  list<GraphicsEffect*>::iterator it;
     596  for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++)
     597    (*it)->tick(dt);
    576598}
    577599
     
    587609  Render2D::getInstance()->draw(E2D_LAYER_ALL);
    588610  Shader::restoreShader();
     611
     612  //draw the graphics
     613  list<GraphicsEffect*>::const_iterator it;
     614  for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++)
     615    (*it)->draw();
    589616}
    590617
     
    661688
    662689/**
     690 * @param root The XML-element to load GraphicsEffects from
     691 */
     692void GraphicsEngine::loadGraphicsEffectXML(const TiXmlElement* root)
     693{
     694  const TiXmlElement* element = root->FirstChildElement();
     695
     696  while (element != NULL)
     697  {
     698    Factory::fabricate(element);
     699
     700    element = element->NextSiblingElement();
     701  }
     702}
     703
     704
     705/**
    663706 * loads a GraphicsEffect into the engine
    664707 * @param effect the GraphicsEffect to add
Note: See TracChangeset for help on using the changeset viewer.