Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5655


Ignore:
Timestamp:
Aug 17, 2009, 4:41:03 PM (15 years ago)
Author:
rgrieder
Message:

Added static DeclareToluaInterface macro to ease up tolua intefaces for modules.

Location:
code/branches/resource2/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource2/src/core/Core.cc

    r5654 r5655  
    7878#include "TclBind.h"
    7979#include "TclThreadManager.h"
    80 #include "ToluaBindCore.h"
    8180#include "input/InputManager.h"
    8281
     
    267266            setThreadAffinity(static_cast<unsigned int>(limitToCPU));
    268267#endif
    269         // Add tolua interface
    270         LuaState::addToluaInterface(&tolua_Core_open, "Core");
    271268
    272269        // Manage ini files and set the default settings file (usually orxonox.ini)
  • code/branches/resource2/src/core/LuaState.cc

    r5654 r5655  
    3939#include "Core.h"
    4040#include "Resource.h"
     41#include "ToluaBindCore.h"
    4142
    4243namespace orxonox
     
    4445    LuaState::ToluaInterfaceMap LuaState::toluaInterfaces_s;
    4546    std::vector<LuaState*> LuaState::instances_s;
     47
     48    // Do this after declaring toluaInterfaces_s and instances_s to avoid larger problems
     49    DeclareToluaInterface(Core);
    4650
    4751    LuaState::LuaState()
  • code/branches/resource2/src/core/LuaState.h

    r5654 r5655  
    4040
    4141#include "util/ScopeGuard.h"
     42#include "ToluaInterface.h"
    4243
    4344// tolua_begin
  • code/branches/resource2/src/orxonox/Main.cc

    r3370 r5655  
    4848#include "core/CommandLine.h"
    4949#include "core/Game.h"
     50#include "core/LuaState.h"
     51#include "ToluaBindOrxonox.h"
    5052
    5153SetCommandLineSwitch(console).information("Start in console mode (text IO only)");
     
    5557SetCommandLineSwitch(dedicated).information("Start in dedicated server mode");
    5658SetCommandLineSwitch(standalone).information("Start in standalone mode");
     59
     60DeclareToluaInterface(Orxonox);
    5761
    5862/*
  • code/branches/resource2/src/orxonox/gamestates/GSRoot.cc

    r5654 r5655  
    3333#include "core/Game.h"
    3434#include "core/GameMode.h"
    35 #include "core/LuaState.h"
    3635#include "network/NetworkFunction.h"
    37 #include "ToluaBindOrxonox.h"
    3836#include "tools/Timer.h"
    3937#include "interfaces/TimeFactorListener.h"
     
    5351        this->ccSetTimeFactor_ = 0;
    5452        this->ccPause_ = 0;
    55 
    56         // Tell LuaBind about all tolua interfaces
    57         LuaState::addToluaInterface(&tolua_Orxonox_open, "Orxonox");
    5853    }
    5954
Note: See TracChangeset for help on using the changeset viewer.