Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6777 in orxonox.OLD for branches/network/src/lib


Ignore:
Timestamp:
Jan 26, 2006, 4:46:39 PM (19 years ago)
Author:
patrick
Message:

network: work flush

Location:
branches/network/src/lib/graphics
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/graphics/effects/fog_effect.cc

    r6772 r6777  
    6262void FogEffect::loadParams(const TiXmlElement* root)
    6363{
     64  printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.loadParms\n\n");
    6465  GraphicsEffect::loadParams(root);
    6566
    66    LoadParam(root, "fog-effect", this, FogEffect, setFogMode)
     67   LoadParam(root, "fog-mode", this, FogEffect, setFogMode)
    6768       .describe("sets the the fog mode {GL_LINEAR, GL_EXP, GL_EXP2}");
    6869
     
    8788bool FogEffect::activate()
    8889{
     90  printf("fog==============================================>>>>>>>>>>>>>>>>>>>>>>>>...\n\n");
    8991  PRINTF(4)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f\n", this->fogMode, this->fogDensity,
    9092             this->fogStart, this->fogEnd);
     
    9294  glEnable(GL_FOG);
    9395  {
    94     GLfloat fogColor[4] = {0.5, 0.5, 0.5, 1.0};
     96    GLfloat fogColor[4] = {0.6, 0.6, 0.6, 1.0};
    9597
    9698    glFogi(GL_FOG_MODE, this->fogMode);
  • branches/network/src/lib/graphics/effects/graphics_effect.h

    r6776 r6777  
    2525    virtual bool deactivate() = 0;
    2626
    27     virtual bool draw() const;
     27    virtual void draw() const;
    2828
    2929    inline bool isActivated() const { return this->bActivated; }
  • branches/network/src/lib/graphics/graphics_engine.cc

    r6772 r6777  
    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
     
    665682
    666683/**
     684 * @param root The XML-element to load GraphicsEffects from
     685 */
     686void GraphicsEngine::loadGraphicsEffectXML(const TiXmlElement* root)
     687{
     688  const TiXmlElement* element = root->FirstChildElement();
     689
     690  while (element != NULL)
     691  {
     692    Factory::fabricate(element);
     693
     694    element = element->NextSiblingElement();
     695  }
     696}
     697
     698
     699/**
    667700 * loads a GraphicsEffect into the engine
    668701 * @param effect the GraphicsEffect to add
  • branches/network/src/lib/graphics/graphics_engine.h

    r6753 r6777  
    2323class WorldEntity;
    2424class GraphicsEffect;
     25class TiXmlElement;
    2526
    2627//! class to handle graphics
     
    3435    /** @returns a Pointer to the only object of this Class */
    3536    inline static GraphicsEngine* getInstance() { if (!GraphicsEngine::singletonRef) GraphicsEngine::singletonRef = new GraphicsEngine();  return GraphicsEngine::singletonRef; };
     37
     38    virtual void loadParams(const TiXmlElement* root);
    3639
    3740    int init();
     
    8386    void process(const Event  &event);
    8487
     88    void loadGraphicsEffectXML(const TiXmlElement* root);
    8589    bool loadGraphicsEffect(GraphicsEffect* effect);
    8690    bool unloadGraphicsEffect(GraphicsEffect* effect);
Note: See TracChangeset for help on using the changeset viewer.