Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 10:23:58 PM (15 years ago)
Author:
rgrieder
Message:

Merged presentation2 branch back to trunk.
Major new features:

  • Actual GUI with settings, etc.
  • Improved space ship steering (human interaction)
  • Rocket fire and more particle effects
  • Advanced sound framework
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/Language.cc

    r5929 r6417  
    6262    {
    6363        // Check if the translation is more than just an empty string
    64         if ((localisation != "") && (localisation.size() > 0))
     64        if (!localisation.empty())
    6565        {
    6666            this->localisedEntry_ = localisation;
     
    130130        }
    131131
    132         COUT(2) << "Warning: Language entry " << label << " is duplicate in " << getFilename(this->defaultLanguage_) << "!" << std::endl;
     132        COUT(2) << "Warning: Language entry " << label << " is duplicate in " << getFilename(this->defaultLanguage_) << '!' << std::endl;
    133133        return it->second;
    134134    }
     
    199199        COUT(4) << "Read default language file." << std::endl;
    200200
    201         std::string filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
     201        const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
    202202
    203203        // This creates the file if it's not existing
     
    224224
    225225            // Check if the line is empty
    226             if ((lineString != "") && (lineString.size() > 0))
     226            if (!lineString.empty())
    227227            {
    228228                size_t pos = lineString.find('=');
     
    246246    void Language::readTranslatedLanguageFile()
    247247    {
    248         COUT(4) << "Read translated language file (" << Core::getLanguage() << ")." << std::endl;
    249 
    250         std::string filepath = PathConfig::getConfigPathString() + getFilename(Core::getLanguage());
     248        COUT(4) << "Read translated language file (" << Core::getInstance().getLanguage() << ")." << std::endl;
     249
     250        const std::string& filepath = PathConfig::getConfigPathString() + getFilename(Core::getInstance().getLanguage());
    251251
    252252        // Open the file
     
    257257        {
    258258            COUT(1) << "An error occurred in Language.cc:" << std::endl;
    259             COUT(1) << "Error: Couldn't open file " << getFilename(Core::getLanguage()) << " to read the translated language entries!" << std::endl;
    260             Core::resetLanguage();
    261             COUT(3) << "Info: Reset language to " << this->defaultLanguage_ << "." << std::endl;
     259            COUT(1) << "Error: Couldn't open file " << getFilename(Core::getInstance().getLanguage()) << " to read the translated language entries!" << std::endl;
     260            Core::getInstance().resetLanguage();
     261            COUT(3) << "Info: Reset language to " << this->defaultLanguage_ << '.' << std::endl;
    262262            return;
    263263        }
     
    270270
    271271            // Check if the line is empty
    272             if ((lineString != "") && (lineString.size() > 0))
     272            if (!lineString.empty())
    273273            {
    274274                size_t pos = lineString.find('=');
     
    287287                else
    288288                {
    289                     COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(Core::getLanguage()) << std::endl;
     289                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(Core::getInstance().getLanguage()) << std::endl;
    290290                }
    291291            }
     
    302302        COUT(4) << "Language: Write default language file." << std::endl;
    303303
    304         std::string filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
     304        const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
    305305
    306306        // Open the file
     
    318318        for (std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it)
    319319        {
    320             file << (*it).second->getLabel() << "=" << (*it).second->getDefault() << std::endl;
     320            file << it->second->getLabel() << '=' << it->second->getDefault() << std::endl;
    321321        }
    322322
Note: See TracChangeset for help on using the changeset viewer.