Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6439


Ignore:
Timestamp:
Jan 3, 2010, 3:54:34 PM (15 years ago)
Author:
rgrieder
Message:

Found two macros that can be replaced by simple inline functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestate/src/libraries/core/Language.h

    r6417 r6439  
    5252#include <cassert>
    5353#include "util/Singleton.h"
    54 
    55 #define AddLanguageEntry(label, fallbackstring) \
    56     orxonox::Language::getInstance().addEntry(label, fallbackstring)
    57 
    58 #define GetLocalisation(label) \
    59     orxonox::Language::getInstance().getLocalisation(label)
    60 
    6154
    6255namespace orxonox
     
    140133            static Language* singletonPtr_s;
    141134    };
     135
     136    //! Shortcut function for Language::addEntry
     137    inline void AddLanguageEntry(const LanguageEntryLabel& label, const std::string& fallbackString)
     138    {
     139        Language::getInstance().addEntry(label, fallbackString);
     140    }
     141
     142    //! Shortcut function for Language::getLocalisation
     143    inline const std::string& GetLocalisation(const LanguageEntryLabel& label)
     144    {
     145        return Language::getInstance().getLocalisation(label);
     146    }
    142147}
    143148
Note: See TracChangeset for help on using the changeset viewer.