Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3262


Ignore:
Timestamp:
Jul 1, 2009, 10:04:54 AM (15 years ago)
Author:
rgrieder
Message:

Replaced orxonox::min and orxonox::max with std version (which do exactly the same).
The std version are in the <algorithm> header.

Location:
code/branches/core4/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/core/CommandLine.cc

    r3257 r3262  
    2929#include "CommandLine.h"
    3030
     31#include <algorithm>
    3132#include <sstream>
    3233#include <boost/filesystem.hpp>
  • code/branches/core4/src/core/Executor.cc

    r3196 r3262  
    9999
    100100            // assign all given arguments to the multitypes
    101             for (unsigned int i = 0; i < min(tokens.size(), (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)
     101            for (unsigned int i = 0; i < std::min(tokens.size(), (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)
    102102                param[i] = tokens[i];
    103103
    104104            // fill the remaining multitypes with default values
    105             for (unsigned int i = tokens.size(); i < min(paramCount, (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)
     105            for (unsigned int i = tokens.size(); i < std::min(paramCount, (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)
    106106                param[i] = this->defaultValue_[i];
    107107
    108108            // evaluate the param types through the functor
    109             for (unsigned int i = 0; i < min(paramCount, (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)
     109            for (unsigned int i = 0; i < std::min(paramCount, (unsigned int)MAX_FUNCTOR_ARGUMENTS); i++)
    110110                this->functor_->evaluateParam(i, param[i]);
    111111
  • code/branches/core4/src/core/Executor.h

    r3257 r3262  
    3232
    3333#include "CorePrereqs.h"
     34
     35#include <algorithm>
     36#include <string>
    3437
    3538#include "util/Debug.h"
     
    101104            COUT(5) << tokens[i]; \
    102105        } \
    103         COUT(5) << ") and " << max((int)paramCount - (int)tokens.size(), 0) << " default values ("; \
     106        COUT(5) << ") and " << std::max((int)paramCount - (int)tokens.size(), 0) << " default values ("; \
    104107        for (unsigned int i = tokens.size(); i < paramCount; i++) \
    105108        { \
  • code/branches/core4/src/orxonox/objects/worldentities/Backlight.cc

    r3257 r3262  
    2929#include "Backlight.h"
    3030
     31#include <algorithm>
    3132#include <OgreRibbonTrail.h>
    3233#include <OgreSceneManager.h>
     
    175176    void Backlight::stopturnonoff()
    176177    {
    177         this->postprocessingtime_ = max(0.0f, this->lifetime_ - this->turnofftime_);
     178        this->postprocessingtime_ = std::max(0.0f, this->lifetime_ - this->turnofftime_);
    178179
    179180        FadingBillboard::stopturnonoff();
  • code/branches/core4/src/orxonox/objects/worldentities/Camera.cc

    r3250 r3262  
    2929#include "Camera.h"
    3030
     31#include <algorithm>
    3132#include <OgreCamera.h>
    3233#include <OgreSceneManager.h>
     
    104105        {
    105106            // this stuff here may need some adjustments
    106             float coeff = min(1.0f, 15.0f * dt);
     107            float coeff = std::min(1.0f, 15.0f * dt);
    107108
    108109            Vector3 offset = this->getWorldPosition() - this->cameraNode_->_getDerivedPosition();
  • code/branches/core4/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r3257 r3262  
    2828
    2929#include "Pawn.h"
     30
     31#include <algorithm>
    3032
    3133#include "core/CoreIncludes.h"
     
    152154    void Pawn::setHealth(float health)
    153155    {
    154         this->health_ = min(health, this->maxHealth_);
     156        this->health_ = std::min(health, this->maxHealth_);
    155157    }
    156158
  • code/branches/core4/src/orxonox/overlays/console/InGameConsole.cc

    r3196 r3262  
    3030#include "InGameConsole.h"
    3131
     32#include <algorithm>
    3233#include <string>
    3334#include <OgreOverlay.h>
     
    425426
    426427        if (LINES > 0)
    427             this->maxCharsPerLine_ = max((unsigned int)10, (unsigned int) ((float)this->desiredTextWidth_ / CHAR_WIDTH));
     428            this->maxCharsPerLine_ = std::max((unsigned int)10, (unsigned int) ((float)this->desiredTextWidth_ / CHAR_WIDTH));
    428429        else
    429430            this->maxCharsPerLine_ = 10;
  • code/branches/core4/src/util/Math.h

    r3214 r3262  
    7878    {
    7979        return (x >= 0) ? 1 : -1;
    80     }
    81 
    82     /**
    83         @brief Returns the smaller of two values.
    84     */
    85     template <typename T>
    86     inline T min(T a, T b)
    87     {
    88         return (a <= b) ? a : b;
    89     }
    90 
    91     /**
    92         @brief Returns the greater of two values.
    93     */
    94     template <typename T>
    95     inline T max(T a, T b)
    96     {
    97         return (a >= b) ? a : b;
    9880    }
    9981
Note: See TracChangeset for help on using the changeset viewer.