Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 24, 2006, 11:09:47 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy back

merged with commandsvn merge -r9346:HEAD https://svn.orxonox.net/orxonox/branches/proxy .

no conflicts

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

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/effects/atmospheric_engine.cc

    r8495 r9406  
    2525
    2626
    27 using namespace std;
     27
    2828
    2929/**
     
    116116        std::list<BaseObject*>::const_iterator it;
    117117        for (it = weatherEffects->begin(); it != weatherEffects->end(); it++) {
    118             /*      printf("%s::%s \n", (*it)->getClassName(), (*it)->getName());*/
     118            /*      printf("%s::%s \n", (*it)->getClassCName(), (*it)->getName());*/
    119119            dynamic_cast<WeatherEffect*>(*it)->tick(dt);
    120120        }
  • trunk/src/lib/graphics/effects/cloud_effect.cc

    r9235 r9406  
    4040float     CloudEffect::fadeTime;
    4141
    42 using namespace std;
     42
    4343
    4444SHELL_COMMAND(activate, CloudEffect, activateCloud);
  • trunk/src/lib/graphics/effects/fog_effect.cc

    r9235 r9406  
    2828SHELL_COMMAND(fadeout, FogEffect, fadeOutFog);
    2929
    30 using namespace std;
     30
    3131
    3232CREATE_SCRIPTABLE_CLASS(FogEffect, CL_FOG_EFFECT,
  • trunk/src/lib/graphics/effects/graphics_effect.cc

    r8495 r9406  
    2323
    2424
    25 using namespace std;
     25
    2626
    2727
  • trunk/src/lib/graphics/effects/lense_flare.cc

    r9006 r9406  
    3434
    3535
    36 using namespace std;
     36
    3737
    3838
  • trunk/src/lib/graphics/effects/lightning_effect.cc

    r9235 r9406  
    3434SHELL_COMMAND(deactivate, LightningEffect, deactivateLightning);
    3535
    36 using namespace std;
     36
    3737
    3838CREATE_SCRIPTABLE_CLASS(LightningEffect, CL_LIGHTNING_EFFECT,
     
    130130
    131131    //load sound
    132     if (this->thunderBuffer != NULL)
    133         ResourceManager::getInstance()->unload(this->thunderBuffer);
    134132    this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder.wav", WAV);
    135133
  • trunk/src/lib/graphics/effects/rain_effect.cc

    r9235 r9406  
    3939SHELL_COMMAND(stopraining, RainEffect, stopRaining);
    4040
    41 using namespace std;
     41
    4242
    4343CREATE_SCRIPTABLE_CLASS(RainEffect, CL_RAIN_EFFECT,
  • trunk/src/lib/graphics/effects/snow_effect.cc

    r9235 r9406  
    11/*
    2         orxonox - the future of 3D-vertical-scrollers
    3 
    4         Copyright (C) 2004 orx
    5 
    6         This program is free software; you can redistribute it and/or modify
    7         it under the terms of the GNU General Public License as published by
    8         the Free Software Foundation; either version 2, or (at your option)
    9         any later version.
     2        orxonox - the future of 3D-vertical-scrollers
     3
     4        Copyright (C) 2004 orx
     5
     6        This program is free software; you can redistribute it and/or modify
     7        it under the terms of the GNU General Public License as published by
     8        the Free Software Foundation; either version 2, or (at your option)
     9        any later version.
    1010
    1111### File Specific:
    12         main-programmer: hdavid, amaechler
     12        main-programmer: hdavid, amaechler
    1313*/
    1414
     
    3535SHELL_COMMAND(deactivate, SnowEffect, deactivateSnow);
    3636
    37 using namespace std;
    3837
    3938CREATE_SCRIPTABLE_CLASS(SnowEffect, CL_SNOW_EFFECT,
     
    4645SnowEffect::SnowEffect(const TiXmlElement* root)
    4746{
    48         this->setClassID(CL_SNOW_EFFECT, "SnowEffect");
    49 
    50         this->init();
    51 
    52         if (root != NULL)
    53                 this->loadParams(root);
    54 
    55         //load wind sound
    56         if (this->snowWindForce >= 1) {
    57                 if (this->windBuffer != NULL)
    58                         ResourceManager::getInstance()->unload(this->windBuffer);
    59           this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
    60         }
     47        this->setClassID(CL_SNOW_EFFECT, "SnowEffect");
     48
     49        this->init();
     50
     51        if (root != NULL)
     52                this->loadParams(root);
     53
     54        this->windBuffer = NULL;
     55        //load wind sound
     56        if (this->snowWindForce >= 1) {
     57          this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
     58        }
    6159
    6260  if(snowActivate) {
    63                 this->activate();
     61                this->activate();
    6462    SnowEffect::snowParticles->precache((int) this->snowLife);
    6563  }
     
    6967SnowEffect::~SnowEffect()
    7068{
    71         this->deactivate();
     69        this->deactivate();
    7270}
    7371
     
    7674void SnowEffect::loadParams(const TiXmlElement* root)
    7775{
    78         WeatherEffect::loadParams(root);
    79 
    80         LoadParam(root, "numParticles", this, SnowEffect, numParticles);
    81         LoadParam(root, "materialTexture", this, SnowEffect, materialTexture);
    82         LoadParam(root, "lifeSpans", this, SnowEffect, lifeSpan);
    83         LoadParam(root, "radius", this, SnowEffect, radius);
    84         LoadParam(root, "mass", this, SnowEffect, mass);
    85         LoadParam(root, "emissionRate", this, SnowEffect, emissionRate);
    86         LoadParam(root, "emissionVelocity", this, SnowEffect, emissionVelocity);
    87         LoadParam(root, "wind", this, SnowEffect, wind);
    88         LoadParam(root, "size", this, SnowEffect, size);
    89         LoadParam(root, "coord", this, SnowEffect, coord);
     76        WeatherEffect::loadParams(root);
     77
     78        LoadParam(root, "numParticles", this, SnowEffect, numParticles);
     79        LoadParam(root, "materialTexture", this, SnowEffect, materialTexture);
     80        LoadParam(root, "lifeSpans", this, SnowEffect, lifeSpan);
     81        LoadParam(root, "radius", this, SnowEffect, radius);
     82        LoadParam(root, "mass", this, SnowEffect, mass);
     83        LoadParam(root, "emissionRate", this, SnowEffect, emissionRate);
     84        LoadParam(root, "emissionVelocity", this, SnowEffect, emissionVelocity);
     85        LoadParam(root, "wind", this, SnowEffect, wind);
     86        LoadParam(root, "size", this, SnowEffect, size);
     87        LoadParam(root, "coord", this, SnowEffect, coord);
    9088  LoadParam(root, "cloudcolor", this, SnowEffect, setCloudColor);
    9189  LoadParam(root, "skycolor", this, SnowEffect, setSkyColor);
    9290  LoadParam(root, "fadetime", this, SnowEffect, setFadeTime);
    9391
    94         LOAD_PARAM_START_CYCLE(root, element);
    95         {
    96                 LoadParam_CYCLE(element, "option", this, SnowEffect, setSnowOption);
    97         }
    98         LOAD_PARAM_END_CYCLE(element);
     92        LOAD_PARAM_START_CYCLE(root, element);
     93        {
     94                LoadParam_CYCLE(element, "option", this, SnowEffect, setSnowOption);
     95        }
     96        LOAD_PARAM_END_CYCLE(element);
    9997}
    10098
    10199void SnowEffect::init()
    102100{
    103         this->emitter = new PlaneEmitter();
    104 
    105         // Default values
    106         this->snowActivate = false;
    107         this->snowMove = false;
    108         this->particles = 12000;
    109         this->texture = "maps/snow_flake_01_32x32.png";
    110         this->snowLife = 8;
    111         this->randomLife = 2;
    112         this->snowRadius = 3.5;
    113         this->randomRadius = 1;
    114         this->snowMass = 1.0;
    115         this->randomMass = 0.3;
    116         this->rate = 900;
    117         this->velocity = -100;
    118         this->randomVelocity = 5;
    119         this->angle = 0.5;
    120         this->randomAngle = 0.2;
    121         this->alpha = 0.5;
    122         this->snowSize = Vector2D(2500, 2500);
    123         this->snowCoord = Vector(100,450,400);
    124         this->snowWindForce = 1;
    125  
     101        this->emitter = new PlaneEmitter();
     102
     103        // Default values
     104        this->snowActivate = false;
     105        this->snowMove = false;
     106        this->particles = 12000;
     107        this->texture = "maps/snow_flake_01_32x32.png";
     108        this->snowLife = 8;
     109        this->randomLife = 2;
     110        this->snowRadius = 3.5;
     111        this->randomRadius = 1;
     112        this->snowMass = 1.0;
     113        this->randomMass = 0.3;
     114        this->rate = 900;
     115        this->velocity = -100;
     116        this->randomVelocity = 5;
     117        this->angle = 0.5;
     118        this->randomAngle = 0.2;
     119        this->alpha = 0.5;
     120        this->snowSize = Vector2D(2500, 2500);
     121        this->snowCoord = Vector(100,450,400);
     122        this->snowWindForce = 1;
     123
    126124  this->fadeTime = 10;
    127125  this->cloudColor = Vector(0.2f, 0.2f, 0.2f);
     
    131129void SnowEffect::activate()
    132130{
    133         PRINTF(3)("Activating SnowEffect\n");
    134 
    135         this->snowActivate = true;
    136 
    137         SnowEffect::snowParticles = new SpriteParticles(particles);
    138         SnowEffect::snowParticles->setName("SnowEffectTrailParticles");
    139         SnowEffect::snowParticles->setMaterialTexture(texture);
    140         SnowEffect::snowParticles->setLifeSpan(snowLife, randomLife);
    141         SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius);
    142         SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius*0.8);
    143         SnowEffect::snowParticles->setRadius(1.0, snowRadius, randomRadius*0.5);
    144         SnowEffect::snowParticles->setMass(0, snowMass, randomMass);
    145         SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
    146         SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
    147         SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
    148 
    149         this->emitter->setSystem(SnowEffect::snowParticles);
    150 
    151         this->emitter->setRelCoor(snowCoord);
    152         this->emitter->setEmissionRate(rate);
    153         this->emitter->setEmissionVelocity(velocity, randomVelocity);
    154         this->emitter->setSpread(angle * this->snowWindForce , randomAngle * this->snowWindForce);
    155         this->emitter->setSize(snowSize);
     131        PRINTF(3)("Activating SnowEffect\n");
     132
     133        this->snowActivate = true;
     134
     135        SnowEffect::snowParticles = new SpriteParticles(particles);
     136        SnowEffect::snowParticles->setName("SnowEffectTrailParticles");
     137        SnowEffect::snowParticles->setMaterialTexture(texture);
     138        SnowEffect::snowParticles->setLifeSpan(snowLife, randomLife);
     139        SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius);
     140        SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius*0.8);
     141        SnowEffect::snowParticles->setRadius(1.0, snowRadius, randomRadius*0.5);
     142        SnowEffect::snowParticles->setMass(0, snowMass, randomMass);
     143        SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
     144        SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
     145        SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
     146
     147        this->emitter->setSystem(SnowEffect::snowParticles);
     148
     149        this->emitter->setRelCoor(snowCoord);
     150        this->emitter->setEmissionRate(rate);
     151        this->emitter->setEmissionVelocity(velocity, randomVelocity);
     152        this->emitter->setSpread(angle * this->snowWindForce , randomAngle * this->snowWindForce);
     153        this->emitter->setSize(snowSize);
    156154
    157155  if (this->snowWindForce != 0)
    158156    this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true);
    159  
     157
    160158  // Store cloud- and sky color before the snow
    161159  this->oldCloudColor = CloudEffect::cloudColor;
     
    171169void SnowEffect::deactivate()
    172170{
    173         PRINTF(3)("Deactivating SnowEffect\n");
    174 
    175         this->snowActivate = false;
    176         this->emitter->setSystem(NULL);
    177 
    178         if (this->windBuffer != NULL)
    179                 ResourceManager::getInstance()->unload(this->windBuffer);
    180  
     171        PRINTF(3)("Deactivating SnowEffect\n");
     172
     173        this->snowActivate = false;
     174        this->emitter->setSystem(NULL);
     175
     176        if (this->windBuffer != NULL)
     177                ResourceManager::getInstance()->unload(this->windBuffer);
     178
    181179  // Restore the old cloud- and sky color
    182180  CloudEffect::changeCloudColor(this->oldCloudColor, this->fadeTime);
     
    186184void SnowEffect::draw() const
    187185{
    188         if (!this->snowActivate)
    189                 return;
     186        if (!this->snowActivate)
     187                return;
    190188}
    191189
    192190void SnowEffect::tick(float dt)
    193191{
    194         if (!this->snowActivate)
    195                 return;
    196 
    197         /*
    198         float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len();
    199 
    200         if(activated)
    201         {
    202         if(distance > 0.3*snowSize.x || distance > 0.3*snowSize.y)
    203                         this->deactivate();
    204         else if(distance > 0.25*snowSize.x || distance > 0.25*snowSize.y)
    205         this->alpha = 0.15;
    206         else if(distance > 0.2*snowSize.x || distance > 0.2*snowSize.y)
    207         this->alpha = 0.25;
    208         else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y)
    209         this->alpha = 0.4;
    210 
    211         SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
    212         SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
    213         SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
    214         }
    215         else
    216         {
    217         if(distance < 0.3*snowSize.x || distance < 0.3*snowSize.y )
    218         this->activate();
    219         if( distance < 0.25*snowSize.x || distance < 0.25*snowSize.y )
    220         this->alpha = 0.25;
    221         else if( distance < 0.2*snowSize.x || distance < 0.2*snowSize.y )
    222         this->alpha = 0.4;
    223         else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y )
    224         this->alpha = 0.5;
    225 
    226         SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
    227         SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
    228         SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
    229         }*/
    230 
    231         if (this->snowMove) {
    232                 this->snowCoord = State::getCameraNode()->getAbsCoor();
    233                 this->emitter->setRelCoor(this->snowCoord.x , this->snowCoord.y+300, this->snowCoord.z);
    234         }
    235 }
     192        if (!this->snowActivate)
     193                return;
     194
     195        /*
     196        float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len();
     197
     198        if(activated)
     199        {
     200        if(distance > 0.3*snowSize.x || distance > 0.3*snowSize.y)
     201                        this->deactivate();
     202        else if(distance > 0.25*snowSize.x || distance > 0.25*snowSize.y)
     203        this->alpha = 0.15;
     204        else if(distance > 0.2*snowSize.x || distance > 0.2*snowSize.y)
     205        this->alpha = 0.25;
     206        else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y)
     207        this->alpha = 0.4;
     208
     209        SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
     210        SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
     211        SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
     212        }
     213        else
     214        {
     215        if(distance < 0.3*snowSize.x || distance < 0.3*snowSize.y )
     216        this->activate();
     217        if( distance < 0.25*snowSize.x || distance < 0.25*snowSize.y )
     218        this->alpha = 0.25;
     219        else if( distance < 0.2*snowSize.x || distance < 0.2*snowSize.y )
     220        this->alpha = 0.4;
     221        else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y )
     222        this->alpha = 0.5;
     223
     224        SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
     225        SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
     226        SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
     227        }*/
     228
     229        if (this->snowMove) {
     230                this->snowCoord = State::getCameraNode()->getAbsCoor();
     231                this->emitter->setRelCoor(this->snowCoord.x , this->snowCoord.y+300, this->snowCoord.z);
     232        }
     233}
  • trunk/src/lib/graphics/effects/snow_effect.h

    r9235 r9406  
    101101
    102102private:
    103     int         particles;
     103    int               particles;
    104104    std::string       texture;
    105     float       snowLife, randomLife;
    106     float       snowRadius, randomRadius;
    107     float       snowMass, randomMass;
    108     float         rate;
    109     float         velocity, randomVelocity;
    110     float         angle, randomAngle;
    111     float         alpha;
    112     float         fadeTime;
    113     Vector        snowCoord;
    114     Vector2D      snowSize;
    115     int       snowWindForce;
     105    float             snowLife, randomLife;
     106    float             snowRadius, randomRadius;
     107    float             snowMass, randomMass;
     108    float             rate;
     109    float             velocity, randomVelocity;
     110    float             angle, randomAngle;
     111    float             alpha;
     112    float             fadeTime;
     113    Vector            snowCoord;
     114    Vector2D          snowSize;
     115    int               snowWindForce;
    116116
    117     bool        snowMove;
    118     bool        snowActivate;
     117    bool              snowMove;
     118    bool              snowActivate;
    119119
    120120    PlaneEmitter*     emitter;
    121121
    122122    static SpriteParticles*   snowParticles;
    123     OrxSound::SoundSource   soundSource;
     123    OrxSound::SoundSource     soundSource;
    124124    OrxSound::SoundBuffer*    windBuffer;
    125125
    126     Vector oldSkyColor;
    127     Vector oldCloudColor;
    128     Vector skyColor;
    129     Vector cloudColor;
     126    Vector            oldSkyColor;
     127    Vector            oldCloudColor;
     128    Vector            skyColor;
     129    Vector            cloudColor;
    130130};
    131131
  • trunk/src/lib/graphics/effects/sun_effect.cc

    r8793 r9406  
    2121
    2222
    23 using namespace std;
     23
    2424
    2525
  • trunk/src/lib/graphics/effects/volfog_effect.cc

    r9006 r9406  
    4747
    4848
    49 using namespace std;
     49
    5050
    5151CREATE_FACTORY(VolFogEffect, CL_VOLFOG_EFFECT);
  • trunk/src/lib/graphics/effects/weather_effect.cc

    r8495 r9406  
    2121
    2222
    23 using namespace std;
     23
    2424
    2525
  • trunk/src/lib/graphics/graphics_engine.cc

    r8740 r9406  
    5050 #include "static_model.h"
    5151#endif
    52 using namespace std;
    5352
    5453SHELL_COMMAND(wireframe, GraphicsEngine, wireframe);
    55 
     54SHELL_COMMAND(fps, GraphicsEngine, toggleFPSdisplay);
    5655
    5756/**
     
    6766  this->bDisplayFPS = false;
    6867  this->bAntialiasing = false;
     68  this->bDedicated = false;
    6969  this->minFPS = 9999;
    7070  this->maxFPS = 0;
     
    164164  MultiType textures = Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO_ADVANCED, CONFIG_NAME_TEXTURES, "1");
    165165  Texture::setTextureEnableState(textures.getBool());
     166
     167  // check it is a dedicated network node: so no drawings are made
     168  MultiType dedicated = Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO, CONFIG_NAME_NO_RENDER, "0");
     169  this->bDedicated = dedicated.getBool();
    166170
    167171  // searching for a usefull resolution
     
    604608}
    605609
     610/**
     611 * this draws the graphics engines graphics effecs
     612 */
    606613void GraphicsEngine::draw() const
    607614{
    608   //  LightManager::getInstance()->draw();
    609 
    610   if (this->graphicsEffects != NULL)
     615  if( this->graphicsEffects != NULL)
    611616  {
    612617    //draw the graphics effects
    613     list<BaseObject*>::const_iterator it;
     618    std::list<BaseObject*>::const_iterator it;
    614619    for (it = this->graphicsEffects->begin(); it != this->graphicsEffects->end(); it++)
    615620      dynamic_cast<GraphicsEffect*>(*it)->draw();
     
    618623  Render2D::getInstance()->draw(E2D_LAYER_BOTTOM, E2D_LAYER_ABOVE_ALL);
    619624  Shader::restoreShader();
     625}
     626
     627
     628void GraphicsEngine::toggleFPSdisplay()
     629{
     630  this->displayFPS(!this->bDisplayFPS);
    620631}
    621632
  • trunk/src/lib/graphics/graphics_engine.h

    r8518 r9406  
    4646    void toggleFullscreen();
    4747    static void setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha = 1.0);
     48    inline bool isDedicated() { return this->bDedicated; }
    4849
    4950    inline void setAntialiasing(bool flag) { this->bAntialiasing = flag; }
     
    7475    void drawBackgroundElements() const;
    7576    void draw() const;
     77    void toggleFPSdisplay();
    7678    void displayFPS(bool display);
    7779
     
    113115    bool                       particlesEnabled;   //!< If particles should be enabled.
    114116    bool                       bAntialiasing;      //!< true if antialiasing enabled
     117    bool                       bDedicated;         //!< true if this server is a dedicated server and should not render the scene
    115118
    116119    int                        particlesValue;     //!< How many particles
  • trunk/src/lib/graphics/importer/bsp_file.cc

    r9025 r9406  
    4040#include <vector>
    4141
    42 using namespace std;
     42
    4343
    4444
     
    9696  if (stat( name , &results) == 0) {
    9797    PRINTF(0)("BSP FILE: Datei %s gefunden. \n", name);
    98     ifstream bspFile (name, ios::in | ios::binary);
     98    std::ifstream bspFile (name, std::ios::in | std::ios::binary);
    9999    bspFile.read(this->header, 260);
    100100    PRINTF(0)("BSP FILE: BSPVersion: %i. \n", ((int *)(header) )[1]);
  • trunk/src/lib/graphics/importer/grid.cc

    r6467 r9406  
    1818#include "grid.h"
    1919
    20 using namespace std;
     20
    2121
    2222
  • trunk/src/lib/graphics/importer/interactive_model.cc

    r8490 r9406  
    2020#include "glincl.h"
    2121
    22 using namespace std;
     22
    2323
    2424/**
  • trunk/src/lib/graphics/importer/material.cc

    r8761 r9406  
    8888Material::~Material()
    8989{
    90   PRINTF(5)("delete Material %s.\n", this->getName());
     90  PRINTF(5)("delete Material %s.\n", this->getCName());
    9191
    9292  if (this->ambientTexture != NULL)
     
    217217void Material::setIllum (int illum)
    218218{
    219   PRINTF(4)("setting illumModel of Material %s to %i\n", this->getName(), illum);
     219  PRINTF(4)("setting illumModel of Material %s to %i\n", this->getCName(), illum);
    220220  this->illumModel = illum;
    221221}
     
    229229void Material::setDiffuse (float r, float g, float b)
    230230{
    231   PRINTF(4)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->getName(), r, g, b);
     231  PRINTF(4)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->getCName(), r, g, b);
    232232  this->diffuse = Color(r, g, b, this->diffuse.a() );
    233233}
     
    242242void Material::setAmbient (float r, float g, float b)
    243243{
    244   PRINTF(4)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->getName(), r, g, b);
     244  PRINTF(4)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->getCName(), r, g, b);
    245245  this->ambient = Color(r, g, b, 1.0);
    246246}
     
    254254void Material::setSpecular (float r, float g, float b)
    255255{
    256   PRINTF(4)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->getName(), r, g, b);
     256  PRINTF(4)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->getCName(), r, g, b);
    257257  this->specular = Color (r, g, b, 1.0);
    258258}
     
    273273void Material::setTransparency (float trans)
    274274{
    275   PRINTF(4)("setting Transparency of Material %s to %f.\n", this->getName(), trans);
     275  PRINTF(4)("setting Transparency of Material %s to %f.\n", this->getCName(), trans);
    276276  this->diffuse.a() = trans;
    277277}
     
    455455void Material::debug() const
    456456{
    457   PRINT(0)("Debug Material: %s\n", this->getName());
     457  PRINT(0)("Debug Material: %s\n", this->getCName());
    458458  PRINT(0)("illumModel: %d ; ShiniNess %f\n", this->illumModel, shininess);
    459459  PRINT(0)("diffuseColor: "); diffuse.debug();
  • trunk/src/lib/graphics/importer/md2/md2Model.cc

    r9235 r9406  
    2222
    2323
    24 using namespace std;
     24
    2525
    2626//! the model anorms
  • trunk/src/lib/graphics/importer/md3/md3_animation_cfg.cc

    r9391 r9406  
    1919#include "md3_animation.h"
    2020
    21 #include "tokenizer.h"
     21#include "substring.h"
    2222#include "helper_functions.h"
    2323
    2424#include "debug.h"
    2525
    26 #include <stdio.h>
    27 #include <stdlib.h>
    28 
    29 
    30 using namespace std;
     26
     27
     28
    3129
    3230namespace md3
     
    10098        if( inHeader && line.find("sex") == 0) {
    10199          //parse line: sex [m | f | ...]
    102           std::vector<std::string> tokens;
    103           Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
     100          SubString tokens(line, " \t\n\r\f/");
    104101
    105102          std::string sexStr = tokens.back();
     
    117114        else if( inHeader && line.find("headoffset") == 0) {
    118115          // parse line: headoffset X Y Z
    119           std::vector<std::string> tokens;
    120           Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
     116          SubString tokens(line, " \t\n\r\f/");
    121117
    122118          float z = atof(tokens.back().c_str()); tokens.pop_back();
     
    130126        else if( inHeader && line.find("footsteps") == 0) {
    131127          //parse line: footsteps [normal | mech | ...]
    132           std::vector<std::string> tokens;
    133           Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
     128          SubString tokens (line, " \t\n\r\f/");
    134129
    135130          this->footsteps = tokens.back();
     
    190185    // parse the line:
    191186    // first frame, num frames, looping frames, frames per second (fps)
    192     std::vector<std::string> tokens;
    193     Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
     187    SubString tokens(line, " \t\n\r\f/");
    194188
    195189    anim->fps = atoi(tokens.back().c_str()); tokens.pop_back();
  • trunk/src/lib/graphics/importer/model.cc

    r8316 r9406  
    2020#include "glincl.h"
    2121
    22 using namespace std;
     22
    2323
    2424/**
  • trunk/src/lib/graphics/importer/primitive_model.cc

    r9110 r9406  
    2121#include "debug.h"
    2222
    23 using namespace std;
     23
    2424
    2525/**
  • trunk/src/lib/graphics/importer/static_model.cc

    r8362 r9406  
    2323#include <stdarg.h>
    2424
    25 using namespace std;
     25
    2626
    2727
     
    161161{
    162162  PRINTF(4)("Deleting Model ");
    163   if (this->getName())
    164   {
    165     PRINT(4)("%s\n", this->getName());
     163  if (!this->getName().empty())
     164  {
     165    PRINT(4)("%s\n", this->getCName());
    166166  }
    167167  else
     
    178178
    179179  //! @todo do we really have to delete this material??
    180   list<ModelMaterial*>::iterator modMat;
     180  std::list<ModelMaterial*>::iterator modMat;
    181181  for(modMat = this->materialList.begin(); modMat != this->materialList.end(); modMat++)
    182182  {
     
    214214void StaticModel::rebuild()
    215215{
    216   PRINTF(3)("Rebuilding Model '%s'\n", this->getName());
     216  PRINTF(3)("Rebuilding Model '%s'\n", this->getCName());
    217217  this->finalize();
    218218}
     
    266266    tmpGroup = tmpGroup->next;
    267267  }
    268   PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->getName());
     268  PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->getCName());
    269269  return;
    270270}
     
    291291    tmpGroup = tmpGroup->next;
    292292  }
    293   PRINTF(2)("Model Named %s in %s not Found.\n", groupName.c_str(), this->getName());
     293  PRINTF(2)("Model Named %s in %s not Found.\n", groupName.c_str(), this->getCName());
    294294  return;
    295295}
     
    358358Material* StaticModel::findMaterialByName(const std::string& materialName)
    359359{
    360   list<ModelMaterial*>::iterator modMat;
     360  std::list<ModelMaterial*>::iterator modMat;
    361361  for  (modMat = this->materialList.begin(); modMat != this->materialList.end(); modMat++)
    362362    if (materialName == (*modMat)->material->getName())
     
    748748        {
    749749          tmpFace->material->select();
    750           PRINTF(5)("using material %s for coming Faces.\n", tmpFace->material->getName());
     750          PRINTF(5)("using material %s for coming Faces.\n", tmpFace->material->getCName());
    751751        }
    752752      }
     
    840840      else if( tmpFace->vertexCount > 4) {
    841841        if (!warned)        {
    842           PRINTF(2)("This model (%s) got over 4 vertices per face <=> conflicts in the CD engine!\n", this->getName());
     842          PRINTF(2)("This model (%s) got over 4 vertices per face <=> conflicts in the CD engine!\n", this->getCName());
    843843          warned = true;
    844844        }
  • trunk/src/lib/graphics/importer/texture.cc

    r8761 r9406  
    230230  if (this->data->getStoredImage() != NULL)
    231231  {
    232     PRINTF(3)("Reloading Texture of %s '%s'\n", this->getClassName(), this->getName());
     232    PRINTF(3)("Reloading Texture of %s '%s'\n", this->getClassCName(), this->getCName());
    233233    this->setTexture(Texture::loadTexToGL(this->data->getStoredImage()));
    234234  }
  • trunk/src/lib/graphics/importer/texture_sequence.cc

    r8619 r9406  
    225225bool TextureSequence::rebuild()
    226226{
    227   PRINTF(3)("Reloading TextureSequence of %s '%s'\n", this->getClassName(), this->getName());
     227  PRINTF(3)("Reloading TextureSequence of %s '%s'\n", this->getClassCName(), this->getCName());
    228228
    229229  for (unsigned int i = 0; i < this->textures.size(); i++)
  • trunk/src/lib/graphics/importer/vertex_array_model.cc

    r8362 r9406  
    2323#include "tc.h"
    2424
    25 using namespace std;
     25
    2626
    2727/////////////
     
    116116VertexArrayModel::~VertexArrayModel()
    117117{
    118   PRINTF(4)("Deleting VertexArrayModel %s\n", this->getName());
     118  PRINTF(4)("Deleting VertexArrayModel %s\n", this->getCName());
    119119}
    120120
     
    127127void VertexArrayModel::draw() const
    128128{
    129   PRINTF(4)("drawing 3D-VertexArrayModel %s\n", this->getName());
     129  PRINTF(4)("drawing 3D-VertexArrayModel %s\n", this->getCName());
    130130  glEnableClientState(GL_VERTEX_ARRAY );
    131131  glEnableClientState(GL_TEXTURE_COORD_ARRAY );
     
    343343void VertexArrayModel::debug() const
    344344{
    345   PRINT(0)("VertexArrayModel (%s): debug\n", this->getName());
     345  PRINT(0)("VertexArrayModel (%s): debug\n", this->getCName());
    346346  PRINT(0)("Stripes: %d; Indices: %d; Vertices: %d; Normals %d; TextCoords %d; Colors %d\n",
    347347            this->stripes.size(),
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r8989 r9406  
    104104      deleteNode = tmp;
    105105      tmp++;
    106       //      printf("TEST::%s(%s) %s\n", (*deleteNode)->getName(), (*deleteNode)->getClassName(), this->getName());
     106      //      printf("TEST::%s(%s) %s\n", (*deleteNode)->getName(), (*deleteNode)->getClassCName(), this->getName());
    107107      if ((this->parentMode & E2D_PROHIBIT_CHILD_DELETE) ||
    108108          ((*deleteNode)->parentMode & E2D_PROHIBIT_DELETE_WITH_PARENT))
     
    214214  {
    215215    PRINTF(2)("Unable to set %s to layer %s, because it's parent(%s) is of higher layer %s\n",
    216               this->getName(),
     216              this->getCName(),
    217217              Element2D::layer2DToChar(layer),
    218               this->parent->getName(),
     218              this->parent->getCName(),
    219219              Element2D::layer2DToChar(this->parent->getLayer()));
    220220    layer = this->parent->getLayer();
     
    602602      {
    603603        PRINTF(2)("Layer '%s' of Child(%s::%s) lower than parents(%s::%s) layer '%s'. updating...\n",
    604                   Element2D::layer2DToChar(child->getLayer()),child->getClassName(), child->getName(),
    605                   this->getClassName(), this->getName(), Element2D::layer2DToChar(this->layer));
     604                  Element2D::layer2DToChar(child->getLayer()),child->getClassCName(), child->getCName(),
     605                  this->getClassCName(), this->getCName(), Element2D::layer2DToChar(this->layer));
    606606        child->layer = this->layer;
    607607        this->children.push_front(child);
     
    627627    {
    628628      PRINTF(1)("Tried to reparent2D to own child '%s::%s' to '%s::%s'.\n",
    629                 this->getClassName(), this->getName(), child->getClassName(), child->getName());
     629                this->getClassCName(), this->getCName(), child->getClassCName(), child->getCName());
    630630      child->parent = NULL;
    631631    }
     
    701701    {
    702702      (*reparenter)->reparent2D();
    703       PRINTF(5)("REPARENTED TO: %s::%s\n",(*reparenter)->getParent2D()->getClassName(),(*reparenter)->getParent2D()->getName());
     703      PRINTF(5)("REPARENTED TO: %s::%s\n",(*reparenter)->getParent2D()->getClassCName(),(*reparenter)->getParent2D()->getCName());
    704704    }
    705705  }
     
    723723  else
    724724    PRINTF(2)("Not Found Element2D's (%s::%s) new Parent by Name: %s\n",
    725               this->getClassName(), this->getName(), parentName.c_str());
     725              this->getClassCName(), this->getCName(), parentName.c_str());
    726726}
    727727
     
    865865        Vector2D tmp = *this->toCoordinate;
    866866        this->setRelCoor2D(tmp);
    867         PRINTF(5)("SmoothMove of %s finished\n", this->getName());
     867        PRINTF(5)("SmoothMove of %s finished\n", this->getCName());
    868868      }
    869869    }
     
    879879        float tmp = *this->toDirection;
    880880        this->setRelDir2D(tmp);
    881         PRINTF(5)("SmoothRotate of %s finished\n", this->getName());
     881        PRINTF(5)("SmoothRotate of %s finished\n", this->getCName());
    882882      }
    883883    }
     
    893893        delete this->toSize;
    894894        this->toSize = NULL;
    895         PRINTF(5)("SmoothRotate of %s finished\n", this->getName());
     895        PRINTF(5)("SmoothRotate of %s finished\n", this->getCName());
    896896      }
    897897    }
     
    900900    this->lastAbsCoordinate = this->absCoordinate;
    901901
    902     PRINTF(5)("Element2D::update - %s - (%f, %f)\n", this->getName(), this->absCoordinate.x, this->absCoordinate.y);
     902    PRINTF(5)("Element2D::update - %s - (%f, %f)\n", this->getCName(), this->absCoordinate.x, this->absCoordinate.y);
    903903
    904904
     
    937937                 projectPos+1,
    938938                 projectPos+2);
    939       //       printf("%s::%s  == %f %f %f :: %f %f\n", this->getClassName(), this->getName(),
     939      //       printf("%s::%s  == %f %f %f :: %f %f\n", this->getClassCName(), this->getName(),
    940940      //              this->bindNode->getAbsCoor().x,
    941941      //              this->bindNode->getAbsCoor().y,
     
    10261026    PRINT(0)(" -");
    10271027  PRINT(0)("E2D(%s::%s);AC:(%0.2f, %0.2f);RC:(%0.2f, %0.2f);AD(%0.2f)->%s;Layer:(%s)\n",
    1028            this->getClassName(),
    1029            this->getName(),
     1028           this->getClassCName(),
     1029           this->getCName(),
    10301030           this->absCoordinate.x,
    10311031           this->absCoordinate.y,
  • trunk/src/lib/graphics/render2D/image_plane.cc

    r7843 r9406  
    2525
    2626
    27 using namespace std;
     27
    2828
    2929
  • trunk/src/lib/graphics/render2D/render_2d.cc

    r7840 r9406  
    2222#include "element_2d.h"
    2323
    24 using namespace std;
     24
    2525
    2626/**
  • trunk/src/lib/graphics/shader.cc

    r8316 r9406  
    3232#endif
    3333
    34 using namespace std;
     34
    3535
    3636
  • trunk/src/lib/graphics/spatial_separation/quadtree.cc

    r9110 r9406  
    2424#include "debug.h"
    2525
    26 using namespace std;
     26
    2727#define QUADTREE_MATERIAL_COUNT       4
    2828
  • trunk/src/lib/graphics/spatial_separation/quadtree_node.cc

    r9110 r9406  
    2626#include "util/list.h"
    2727
    28 using namespace std;
     28
    2929
    3030
  • trunk/src/lib/graphics/spatial_separation/spatial_separation.cc

    r6022 r9406  
    2323#include "compiler.h"
    2424
    25 using namespace std;
     25
    2626
    2727
  • trunk/src/lib/graphics/text_engine/limited_width_text.cc

    r8981 r9406  
    160160void LimitedWidthText::debug() const
    161161{
    162   printf("Debug %s::%s \n", this->getClassName(), this->getName() );
     162  printf("Debug %s::%s \n", this->getClassCName(), this->getCName() );
    163163}
  • trunk/src/lib/graphics/text_engine/multi_line_text.cc

    r8768 r9406  
    152152void MultiLineText::debug() const
    153153{
    154  printf("Debug %s::%s: %d lines\n", this->getClassName(), this->getName(), this->getLineCount());
     154 printf("Debug %s::%s: %d lines\n", this->getClassCName(), this->getCName(), this->getLineCount());
    155155
    156156 std::string tmpText = this->text();
  • trunk/src/lib/graphics/text_engine/text.cc

    r8769 r9406  
    2828 */
    2929Text::Text(const std::string& fontFile, unsigned int textSize)
    30     : _font(fontFile, FONT_DEFAULT_RENDER_SIZE)
     30    // : _font(fontFile, FONT_DEFAULT_RENDER_SIZE)
    3131{
    3232  this->setClassID(CL_TEXT, "Text");
    3333
    3434  // initialize this Text
     35  this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE);
    3536  this->_size = textSize;
    3637  this->setSizeY2D(textSize);
     
    278279void Text::debug() const
    279280{
    280   PRINT(0)("=== TEXT: %s (with Font:'%s')  displaying %s ===\n", this->getName(), this->_font.getName(), this->_text.c_str());
     281  PRINT(0)("=== TEXT: %s (with Font:'%s')  displaying %s ===\n", this->getCName(), this->_font.getCName(), this->_text.c_str());
    281282  //  PRINT(0)("Color: r=%0.2f g=%0.2f b=%0.2f a=%0.2f\n", this->_color.r(), this->_color.g(), this->_color.b(), this->_color.a());
    282283}
  • trunk/src/lib/graphics/text_engine/text_engine.cc

    r8761 r9406  
    2626#include "font.h"
    2727
    28 using namespace std;
     28
    2929
    3030#include <stdlib.h>
     
    122122void TextEngine::debug() const
    123123{
    124   const list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
     124  const std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
    125125  if (textList != NULL)
    126126  {
     
    130130    PRINT(0)("Reference: %p; Text Counts: %d\n", this, textList->size());
    131131
    132     list<BaseObject*>::const_iterator text;
     132    std::list<BaseObject*>::const_iterator text;
    133133    for ( text = textList->begin(); text != textList->end(); text++)
    134134      dynamic_cast<Text*>(*text)->debug();
Note: See TracChangeset for help on using the changeset viewer.