Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 10:23:58 PM (14 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/Loader.cc

    r5929 r6417  
    8080        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
    8181        {
    82             if ((*it).first == file)
     82            if (it->first == file)
    8383            {
    8484                Loader::files_s.erase(it);
     
    9292        bool success = true;
    9393        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
    94             if (!Loader::load((*it).first, (*it).second * mask))
     94            if (!Loader::load(it->first, it->second * mask))
    9595                success = false;
    9696
     
    128128            scoped_ptr<LuaState> luaState(new LuaState());
    129129            luaState->setIncludeParser(&Loader::replaceLuaTags);
    130             luaState->includeFile(file->getFilename(), file->getResourceGroup(), false);
     130            luaState->includeFile(file->getFilename());
    131131            xmlInput = luaState->getOutput().str();
    132132        }
    133133        else
    134134        {
    135             shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename(), file->getResourceGroup());
     135            shared_ptr<ResourceInfo> info = Resource::getInfo(file->getFilename());
    136136            if (info == NULL)
    137137            {
     
    139139                return false;
    140140            }
    141             xmlInput = Resource::open(file->getFilename(), file->getResourceGroup())->getAsString();
     141            xmlInput = Resource::open(file->getFilename())->getAsString();
    142142        }
    143143
     
    165165            rootNamespace->XMLPort(rootElement, XMLPort::LoadObject);
    166166
    167             COUT(0) << "Finished loading " << file->getFilename() << "." << std::endl;
     167            COUT(0) << "Finished loading " << file->getFilename() << '.' << std::endl;
    168168
    169169            COUT(4) << "Namespace-tree:" << std::endl << rootNamespace->toString("  ") << std::endl;
     
    174174        {
    175175            COUT(1) << std::endl;
    176             COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl;
     176            COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
    177177            COUT(1) << ex.what() << std::endl;
    178178            COUT(1) << "Loading aborted." << std::endl;
     
    182182        {
    183183            COUT(1) << std::endl;
    184             COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl;
     184            COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
    185185            COUT(1) << ex.what() << std::endl;
    186186            COUT(1) << "Loading aborted." << std::endl;
     
    190190        {
    191191            COUT(1) << std::endl;
    192             COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl;
     192            COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ':' << std::endl;
    193193            COUT(1) << Exception::handleMessage() << std::endl;
    194194            COUT(1) << "Loading aborted." << std::endl;
     
    218218    std::string Loader::replaceLuaTags(const std::string& text)
    219219    {
    220         // chreate map with all Lua tags
     220        // create map with all Lua tags
    221221        std::map<size_t, bool> luaTags;
    222222        {
     
    291291            {
    292292                if (it != luaTags.end())
    293                     end = (*(it++)).first;
     293                    end = (it++)->first;
    294294                else
    295295                    end = std::string::npos;
     
    300300                {
    301301                    // count ['='[ and ]'='] and replace tags with print([[ and ]])
    302                     std::string temp = text.substr(start, end - start);
     302                    const std::string& temp = text.substr(start, end - start);
    303303                    {
    304304                    size_t pos = 0;
     
    345345                        }
    346346                    }
    347                     std::string equalSigns = "";
     347                    std::string equalSigns;
    348348                    for(unsigned int i = 0; i < equalSignCounter; i++)
    349349                    {
    350                         equalSigns += "=";
     350                        equalSigns += '=';
    351351                    }
    352                     output << "print([" + equalSigns + "[" + temp + "]" + equalSigns +"])";
     352                    output << "print([" + equalSigns + '[' + temp + ']' + equalSigns +"])";
    353353                    start = end + 5;
    354354                }
Note: See TracChangeset for help on using the changeset viewer.