Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 26, 2011, 6:44:25 AM (13 years ago)
Author:
rgrieder
Message:

Added "replaceLuaTags" function to the Loader. That allows to load files without parsing it as Lua file.
Bottom line:

  • Compiling the level list is about 30 times faster and takes less than half a second now
  • We need to write level files that are XML-valid even if all the Lua stuff is removed. (or: somebody find a better implementation for speeding up that LevelInfo loading)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/libraries/core/Loader.h

    r7648 r7963  
    4242#include "CorePrereqs.h"
    4343
     44#include <map>
    4445#include <vector>
    4546#include "ClassTreeMask.h"
     
    6162            static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
    6263
    63             static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
     64            static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(),
     65                             bool verbose = true, bool bRemoveLuaTags = false);
    6466            static void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
    6567            static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
    6668
    6769            static std::string replaceLuaTags(const std::string& text);
     70            static std::string removeLuaTags(const std::string& text);
    6871
    6972            static ClassTreeMask currentMask_s;
    7073
    7174        private:
     75            static bool getLuaTags(const std::string& text, std::map<size_t, bool>& luaTags);
     76
    7277            static std::vector<std::pair<const XMLFile*, ClassTreeMask> > files_s;
    7378    };
Note: See TracChangeset for help on using the changeset viewer.