Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 14, 2008, 9:39:57 PM (17 years ago)
Author:
rgrieder
Message:
  • replaced all String2Number with ConvertValue
  • replaced all tokenize with SubString
  • dealt with warnings under msvc
  • removed some warnings by placing casts
  • bugfix in audio: local variable pushed into member variable std::vector
  • updated StableHeaders.h
Location:
code/trunk/src/orxonox/objects
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/Ambient.cc

    r1056 r1064  
    3636
    3737#include "util/tinyxml/tinyxml.h"
    38 #include "util/Tokenizer.h"
    39 #include "util/String2Number.h"
     38#include "util/SubString.h"
     39#include "util/Convert.h"
    4040#include "util/Math.h"
    4141#include "core/Debug.h"
     
    6767        if (xmlElem->Attribute("colourvalue"))
    6868        {
     69        SubString colourvalues(xmlElem->Attribute("colourvalue"), ',');
    6970
    70                 std::vector<std::string> colourvalues = tokenize(xmlElem->Attribute("colourvalue"),",");
    7171                float r, g, b;
    72                 String2Number<float>(r, colourvalues[0]);
    73                 String2Number<float>(g, colourvalues[1]);
    74                 String2Number<float>(b, colourvalues[2]);
     72        convertValue<std::string, float>(&r, colourvalues[0]);
     73        convertValue<std::string, float>(&g, colourvalues[1]);
     74        convertValue<std::string, float>(&b, colourvalues[2]);
    7575
    7676                this->setAmbientLight(ColourValue(r, g, b));
  • code/trunk/src/orxonox/objects/Camera.cc

    r1056 r1064  
    3838
    3939#include "util/tinyxml/tinyxml.h"
    40 #include "util/Tokenizer.h"
    41 #include "util/String2Number.h"
     40#include "util/Substring.h"
     41#include "util/Convert.h"
    4242#include "util/Math.h"
    4343#include "core/Debug.h"
     
    7373
    7474        float x, y, z;
    75         std::vector<std::string> posVec = tokenize(xmlElem->Attribute("pos"),",");
    76         String2Number<float>(x, posVec[0]);
    77         String2Number<float>(y, posVec[1]);
    78         String2Number<float>(z, posVec[2]);
     75        SubString posVec(xmlElem->Attribute("pos"), ',');
     76        convertValue<std::string, float>(&x, posVec[0]);
     77        convertValue<std::string, float>(&y, posVec[1]);
     78        convertValue<std::string, float>(&z, posVec[2]);
    7979
    8080        cam->setPosition(Vector3(x,y,z));
    8181
    82         posVec = tokenize(xmlElem->Attribute("lookat"),",");
    83         String2Number<float>(x, posVec[0]);
    84         String2Number<float>(y, posVec[1]);
    85         String2Number<float>(z, posVec[2]);
     82        posVec = SubString(xmlElem->Attribute("lookat"), ',');
     83        convertValue<std::string, float>(&x, posVec[0]);
     84        convertValue<std::string, float>(&y, posVec[1]);
     85        convertValue<std::string, float>(&z, posVec[2]);
    8686
    8787        cam->lookAt(Vector3(x,y,z));
     
    9393
    9494        // FIXME: unused var
    95         Ogre::Viewport* vp = GraphicsEngine::getSingleton().getRenderWindow()->addViewport(cam);
     95        //Ogre::Viewport* vp =
     96        GraphicsEngine::getSingleton().getRenderWindow()->addViewport(cam);
    9697
    9798
  • code/trunk/src/orxonox/objects/Model.cc

    r1056 r1064  
    3131
    3232#include "util/tinyxml/tinyxml.h"
    33 #include "util/Tokenizer.h"
    34 #include "util/String2Number.h"
    3533#include "core/CoreIncludes.h"
    3634#include "GraphicsEngine.h"
  • code/trunk/src/orxonox/objects/Skybox.cc

    r1056 r1064  
    3535
    3636#include "util/tinyxml/tinyxml.h"
    37 //#include "util/Tokenizer.h"
    38 //#include "util/String2Number.h"
    3937#include "GraphicsEngine.h"
    4038#include "core/CoreIncludes.h"
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1056 r1064  
    3939
    4040#include "util/tinyxml/tinyxml.h"
    41 #include "util/String2Number.h"
     41#include "util/Convert.h"
    4242#include "util/Math.h"
    4343#include "core/CoreIncludes.h"
     
    259259            std::string rdStr = xmlElem->Attribute("rotDamp");
    260260
    261             String2Number<float>(this->maxSpeed_, msStr);
    262             String2Number<float>(this->maxSideAndBackSpeed_, msabsStr);
    263             String2Number<float>(this->maxRotation_, mrStr);
    264             String2Number<float>(this->translationAcceleration_, taStr);
    265             String2Number<float>(this->rotationAcceleration_, raStr);
    266             String2Number<float>(this->translationDamping_, tdStr);
    267             String2Number<float>(this->rotationDamping_, rdStr);
     261            convertValue<std::string, float>(&this->maxSpeed_, msStr);
     262            convertValue<std::string, float>(&this->maxSideAndBackSpeed_, msabsStr);
     263            convertValue<std::string, float>(&this->maxRotation_, mrStr);
     264            convertValue<std::string, float>(&this->translationAcceleration_, taStr);
     265            convertValue<std::string, float>(&this->rotationAcceleration_, raStr);
     266            convertValue<std::string, float>(&this->translationDamping_, tdStr);
     267            convertValue<std::string, float>(&this->rotationDamping_, rdStr);
    268268
    269269            this->maxRotationRadian_ = Radian(this->maxRotation_);
     
    458458
    459459        OIS::Keyboard* mKeyboard = InputManager::getSingleton().getKeyboard();
    460         OIS::Mouse* mMouse = InputManager::getSingleton().getMouse();
     460        //FIXME: variable never used
     461        //OIS::Mouse* mMouse = InputManager::getSingleton().getMouse();
    461462
    462463
  • code/trunk/src/orxonox/objects/WorldEntity.cc

    r1056 r1064  
    3434
    3535#include "util/tinyxml/tinyxml.h"
    36 #include "util/Tokenizer.h"
    37 #include "util/String2Number.h"
     36#include "util/SubString.h"
    3837#include "core/CoreIncludes.h"
    3938#include "GraphicsEngine.h"
Note: See TracChangeset for help on using the changeset viewer.