Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 30, 2009, 2:10:44 PM (15 years ago)
Author:
rgrieder
Message:

Merged resource branch back to the trunk. Changes:

  • Automated graphics loading by evaluating whether a GameState requires it
  • Using native Tcl library (x3n)

Windows users: Update your dependency package!

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/Language.h

    r3280 r3370  
    3737    Usage:
    3838     - Set the entry with the default string:
    39        Language::getLanguage()->addEntry("label of the entry", "the string to translate");
     39       Language::getInstance()->addEntry("label of the entry", "the string to translate");
    4040
    4141     - Get the localisation of the entry in the configured language:
    42        std::cout << Language::getLanguage()->getLocalisation("name of the entry") << std::endl;
     42       std::cout << Language::getInstance()->getLocalisation("name of the entry") << std::endl;
    4343*/
    4444
     
    5151#include <string>
    5252#include <cassert>
     53#include "util/Singleton.h"
    5354
    5455#define AddLanguageEntry(label, fallbackstring) \
    55     orxonox::Language::getLanguage().addEntry(label, fallbackstring)
     56    orxonox::Language::getInstance().addEntry(label, fallbackstring)
    5657
    5758#define GetLocalisation(label) \
    58     orxonox::Language::getLanguage().getLocalisation(label)
     59    orxonox::Language::getInstance().getLocalisation(label)
    5960
    6061
     
    112113    // ###############################
    113114    //! The Language class manges the language files and entries and stores the LanguageEntry objects in a map.
    114     class _CoreExport Language
     115    class _CoreExport Language : public Singleton<Language>
    115116    {
     117        friend class Singleton<Language>;
    116118        friend class CoreConfiguration;
    117119
     
    120122            ~Language();
    121123
    122             static Language& getLanguage() { assert(singletonRef_s); return *singletonRef_s; }
    123124            void addEntry(const LanguageEntryLabel& label, const std::string& entry);
    124125            const std::string& getLocalisation(const LanguageEntryLabel& label) const;
     
    137138            std::map<std::string, LanguageEntry*> languageEntries_; //!< A map to store all LanguageEntry objects and their labels
    138139
    139             static Language* singletonRef_s;
     140            static Language* singletonPtr_s;
    140141    };
    141142}
Note: See TracChangeset for help on using the changeset viewer.