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/LuaBind.h

    r3196 r3370  
    4040#include <cassert>
    4141#include <string>
     42#include <vector>
    4243extern "C" {
    4344#include <lua.h>
    4445}
    4546
     47#include "util/Singleton.h"
     48
    4649// tolua_begin
    4750namespace orxonox
    4851{
    49   class _CoreExport LuaBind
     52  class _CoreExport LuaBind : public Singleton<LuaBind>
    5053  {
     54// tolua_end
     55    friend class Singleton<LuaBind>;
    5156
    52 // tolua_end
    5357    struct LoadS {
    5458      const char *s;
     
    5862    public:
    5963      LuaBind();
    60       inline ~LuaBind() { assert(singletonRef_s); LuaBind::singletonRef_s = NULL; };
     64      ~LuaBind();
    6165
    62       inline static LuaBind& getInstance() { assert(singletonRef_s); return *LuaBind::singletonRef_s; } // tolua_export
     66      static LuaBind& getInstance() { return Singleton<LuaBind>::getInstance(); } // tolua_export
    6367
    6468    void loadFile(const std::string& filename, bool luaTags);
     
    8387        { this->includePath_ = includepath; }
    8488
     89    void addToluaInterface(int (*function)(lua_State*), const std::string& name);
     90    void openToluaInterfaces(lua_State* state);
     91    void closeToluaInterfaces(lua_State* state);
     92
    8593    private:
    86       static LuaBind* singletonRef_s;
     94      static LuaBind* singletonPtr_s;
    8795
    8896      std::string luaSource_;
     
    9199      bool isRunning_;
    92100      std::string includePath_;
     101      std::vector<std::pair<std::string, int (*)(lua_State *L)> > toluaInterfaces_;
    93102
    94103  }; // tolua_export
Note: See TracChangeset for help on using the changeset viewer.