Changeset 7973 for code/branches
- Timestamp:
- Feb 26, 2011, 9:12:59 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib/src/libraries/core/GUIManager.cc
r7971 r7973 49 49 # include <CEGUILua.h> 50 50 # include <ogreceguirenderer/OgreCEGUIRenderer.h> 51 extern "C" { 52 # include <lauxlib.h> 53 } 51 54 #else 52 55 # include <ScriptingModules/LuaScriptModule/CEGUILua.h> … … 102 105 }; 103 106 107 #ifdef ORXONOX_OLD_CEGUI 108 /** Class with the same memory layout as CEGUI::LuaScriptModule. <br> 109 We need this to fix a problem with an uninitialised member variable 110 in CEGUI < 0.7 <br> 111 Notice that "public" modifier for the otherwise private variables. 112 */ 113 class CEGUILUA_API LuaScriptModuleWorkaround : public CEGUI::ScriptModule 114 { 115 public: 116 LuaScriptModuleWorkaround(); 117 ~LuaScriptModuleWorkaround(); 118 119 public: 120 bool d_ownsState; 121 lua_State* d_state; 122 CEGUI::String d_errFuncName; 123 int d_errFuncIndex; 124 CEGUI::String d_activeErrFuncName; 125 int d_activeErrFuncIndex; 126 }; 127 #endif 128 104 129 static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button); 105 130 … … 157 182 #ifdef ORXONOX_OLD_CEGUI 158 183 scriptModule_ = new LuaScriptModule(luaState_->getInternalLuaState()); 184 // Ugly workaround: older CEGUILua versions don't initialise the member 185 // d_activeErrFuncIndex at all. That leads to "error in error handling" 186 // problems when a Lua error occurs. 187 // We fix this by setting the member manually. 188 reinterpret_cast<LuaScriptModuleWorkaround*>(scriptModule_)->d_activeErrFuncIndex = LUA_NOREF; 159 189 luaState_->doString("ORXONOX_OLD_CEGUI = true"); 160 190 #else
Note: See TracChangeset
for help on using the changeset viewer.