Merge with default

This commit is contained in:
Quitta 2013-07-24 13:14:27 +02:00
commit 501a734f74
35 changed files with 1194 additions and 1019 deletions

View file

@ -111,9 +111,11 @@ FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(Jpeg) FIND_PACKAGE(Jpeg)
IF(WITH_STATIC_LIBXML2)
SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC)
ENDIF(WITH_STATIC_LIBXML2)
IF(WITH_STATIC) IF(WITH_STATIC)
# libxml2 could need winsock2 library # libxml2 could need winsock2 library
SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB}) SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB})
# on Mac OS X libxml2 requires iconv and liblzma # on Mac OS X libxml2 requires iconv and liblzma

View file

@ -247,6 +247,11 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
ELSE(WIN32) ELSE(WIN32)
OPTION(WITH_STATIC "With static libraries." OFF) OPTION(WITH_STATIC "With static libraries." OFF)
ENDIF(WIN32) ENDIF(WIN32)
IF (WITH_STATIC)
OPTION(WITH_STATIC_LIBXML2 "With static libxml2" ON )
ELSE(WITH_STATIC)
OPTION(WITH_STATIC_LIBXML2 "With static libxml2" OFF)
ENDIF(WITH_STATIC)
OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF) OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF)
IF(WIN32) IF(WIN32)
OPTION(WITH_EXTERNAL "With provided external." ON ) OPTION(WITH_EXTERNAL "With provided external." ON )

View file

@ -68,7 +68,11 @@ IF(WITH_NEL_SAMPLES)
ADD_SUBDIRECTORY(samples) ADD_SUBDIRECTORY(samples)
ENDIF(WITH_NEL_SAMPLES) ENDIF(WITH_NEL_SAMPLES)
IF(WITH_NEL_TOOLS) # Allow to compile only max plugins without other tools.
IF(WITH_NEL_TOOLS OR WITH_NEL_MAXPLUGIN)
IF(WITH_NEL_TOOLS)
FIND_PACKAGE(Squish) FIND_PACKAGE(Squish)
ENDIF(WITH_NEL_TOOLS)
ADD_SUBDIRECTORY(tools) ADD_SUBDIRECTORY(tools)
ENDIF(WITH_NEL_TOOLS) ENDIF(WITH_NEL_TOOLS OR WITH_NEL_MAXPLUGIN)

View file

@ -217,6 +217,7 @@ namespace NLGUI
void clear() { setTop(0); } void clear() { setTop(0); }
int getTop(); int getTop();
bool empty() { return getTop() == 0; } bool empty() { return getTop() == 0; }
void pushGlobalTable();
void pushValue(int index); // copie nth element of stack to the top of the stack void pushValue(int index); // copie nth element of stack to the top of the stack
void remove(int index); // remove nth element of stack void remove(int index); // remove nth element of stack
void insert(int index); // insert last element of the stack before the given position void insert(int index); // insert last element of the stack before the given position
@ -301,7 +302,8 @@ namespace NLGUI
/** Helper : Execute a function by name. Lookup for the function is done in the table at the index 'funcTableIndex' /** Helper : Execute a function by name. Lookup for the function is done in the table at the index 'funcTableIndex'
* the behaviour is the same than with call of pcall. * the behaviour is the same than with call of pcall.
*/ */
int pcallByName(const char *functionName, int nargs, int nresults, int funcTableIndex = LUA_GLOBALSINDEX, int errfunc = 0); int pcallByNameGlobal(const char *functionName, int nargs, int nresults, int errfunc = 0);
int pcallByName(const char *functionName, int nargs, int nresults, int funcTableIndex, int errfunc = 0);
// push a C closure (pop n element from the stack and associate with the function) // push a C closure (pop n element from the stack and associate with the function)
void pushCClosure(lua_CFunction function, int n); void pushCClosure(lua_CFunction function, int n);
@ -367,6 +369,7 @@ namespace NLGUI
CLuaState &operator=(const CLuaState &/* other */) { nlassert(0); return *this; } CLuaState &operator=(const CLuaState &/* other */) { nlassert(0); return *this; }
void executeScriptInternal(const std::string &code, const std::string &dbgSrc, int numRet = 0); void executeScriptInternal(const std::string &code, const std::string &dbgSrc, int numRet = 0);
int pcallByNameInternal(const char *functionName, int nargs, int nresults, int errfunc, int initialStackSize);
}; };

View file

@ -42,10 +42,16 @@ inline void CLuaState::checkIndex(int index)
//H_AUTO(Lua_CLuaState_checkIndex) //H_AUTO(Lua_CLuaState_checkIndex)
// NB : more restrictive test that in the documentation there, because // NB : more restrictive test that in the documentation there, because
// we don't expose the check stack function // we don't expose the check stack function
#if LUA_VERSION_NUM >= 502
nlassert( (index!=0 && abs(index) <= getTop())
|| index == LUA_REGISTRYINDEX
);
#else
nlassert( (index!=0 && abs(index) <= getTop()) nlassert( (index!=0 && abs(index) <= getTop())
|| index == LUA_REGISTRYINDEX || index == LUA_REGISTRYINDEX
|| index == LUA_GLOBALSINDEX || index == LUA_GLOBALSINDEX
); );
#endif
} }
//================================================================================ //================================================================================
@ -75,6 +81,18 @@ inline void CLuaState::setTop(int index)
lua_settop(_State, index); lua_settop(_State, index);
} }
//================================================================================
inline void CLuaState::pushGlobalTable()
{
//H_AUTO(Lua_CLuaState_pushGlobalTable)
#if LUA_VERSION_NUM >= 502
lua_pushglobaltable(_State);
#else
checkIndex(LUA_GLOBALSINDEX);
lua_pushvalue(_State, LUA_GLOBALSINDEX);
#endif
}
//================================================================================ //================================================================================
inline void CLuaState::pushValue(int index) inline void CLuaState::pushValue(int index)
{ {
@ -243,7 +261,11 @@ inline size_t CLuaState::strlen(int index)
{ {
//H_AUTO(Lua_CLuaState_strlen) //H_AUTO(Lua_CLuaState_strlen)
checkIndex(index); checkIndex(index);
#if LUA_VERSION_NUM >= 502
return lua_rawlen(_State, index);
#else
return lua_strlen(_State, index); return lua_strlen(_State, index);
#endif
} }
//================================================================================ //================================================================================
@ -342,7 +364,11 @@ inline bool CLuaState::equal(int index1, int index2)
//H_AUTO(Lua_CLuaState_equal) //H_AUTO(Lua_CLuaState_equal)
checkIndex(index1); checkIndex(index1);
checkIndex(index2); checkIndex(index2);
#if LUA_VERSION_NUM >= 502
return lua_compare(_State, index1, index2, LUA_OPEQ) != 0;
#else
return lua_equal(_State, index1, index2) != 0; return lua_equal(_State, index1, index2) != 0;
#endif
} }
//================================================================================ //================================================================================
@ -376,7 +402,11 @@ inline bool CLuaState::lessThan(int index1, int index2)
//H_AUTO(Lua_CLuaState_lessThan) //H_AUTO(Lua_CLuaState_lessThan)
checkIndex(index1); checkIndex(index1);
checkIndex(index2); checkIndex(index2);
#if LUA_VERSION_NUM >= 502
return lua_compare(_State, index1, index2, LUA_OPLT) != 0;
#else
return lua_lessthan(_State, index1, index2) != 0; return lua_lessthan(_State, index1, index2) != 0;
#endif
} }

View file

@ -361,7 +361,11 @@ namespace NLGUI
rd.Str = &code; rd.Str = &code;
rd.Done = false; rd.Done = false;
int result = lua_load(_State, CHelper::luaChunkReaderFromString, (void *) &rd, dbgSrc.c_str()); int result = lua_load(_State, CHelper::luaChunkReaderFromString, (void *) &rd, dbgSrc.c_str()
#if LUA_VERSION_NUM >= 502
, NULL
#endif
);
if (result !=0) if (result !=0)
{ {
// pop the error code // pop the error code
@ -569,9 +573,17 @@ namespace NLGUI
//H_AUTO(Lua_CLuaState_registerFunc) //H_AUTO(Lua_CLuaState_registerFunc)
nlassert(function); nlassert(function);
CLuaStackChecker lsc(this); CLuaStackChecker lsc(this);
#if LUA_VERSION_NUM >= 502
pushGlobalTable();
#endif
push(name); push(name);
push(function); push(function);
#if LUA_VERSION_NUM >= 502
setTable(-3); // -3 is the pushGlobalTable
pop(1); // pop the pushGlobalTable value (setTable popped the 2 pushes)
#else
setTable(LUA_GLOBALSINDEX); setTable(LUA_GLOBALSINDEX);
#endif
} }
@ -643,13 +655,31 @@ namespace NLGUI
} }
// *************************************************************************** // ***************************************************************************
int CLuaState::pcallByName(const char *functionName, int nargs, int nresults, int funcTableIndex /*=LUA_GLOBALSINDEX*/, int errfunc /*= 0*/) int CLuaState::pcallByNameGlobal(const char *functionName, int nargs, int nresults, int errfunc /*= 0*/)
{
int initialStackSize = getTop();
nlassert(functionName);
#if LUA_VERSION_NUM >= 502
pushGlobalTable();
#else
nlassert(isTable(LUA_GLOBALSINDEX));
pushValue(LUA_GLOBALSINDEX);
#endif
return pcallByNameInternal(functionName, nargs, nresults, errfunc, initialStackSize);
}
int CLuaState::pcallByName(const char *functionName, int nargs, int nresults, int funcTableIndex, int errfunc /*= 0*/)
{ {
//H_AUTO(Lua_CLuaState_pcallByName)
int initialStackSize = getTop(); int initialStackSize = getTop();
nlassert(functionName); nlassert(functionName);
nlassert(isTable(funcTableIndex)); nlassert(isTable(funcTableIndex));
pushValue(funcTableIndex); pushValue(funcTableIndex);
return pcallByNameInternal(functionName, nargs, nresults, errfunc, initialStackSize);
}
int CLuaState::pcallByNameInternal(const char *functionName, int nargs, int nresults, int errfunc /*= 0*/, int initialStackSize)
{
//H_AUTO(Lua_CLuaState_pcallByName)
push(functionName); push(functionName);
getTable(-2); getTable(-2);
remove(-2); // get rid of the table remove(-2); // get rid of the table
@ -782,7 +812,12 @@ namespace NLGUI
int CLuaState::getGCCount() int CLuaState::getGCCount()
{ {
//H_AUTO(Lua_CLuaState_getGCCount) //H_AUTO(Lua_CLuaState_getGCCount)
#if LUA_VERSION_NUM >= 502
// deprecated
return 0;
#else
return lua_getgccount(_State); return lua_getgccount(_State);
#endif
} }
//================================================================================ //================================================================================

View file

@ -474,7 +474,11 @@ namespace NLGUI
CLuaState *luaState = table.getLuaState(); CLuaState *luaState = table.getLuaState();
CLuaStackChecker lsc(luaState); CLuaStackChecker lsc(luaState);
// get pointer to the 'next' function // get pointer to the 'next' function
#if LUA_VERSION_NUM >= 502
luaState->pushGlobalTable();
#else
luaState->pushValue(LUA_GLOBALSINDEX); luaState->pushValue(LUA_GLOBALSINDEX);
#endif
_NextFunction = CLuaObject(*luaState)["next"]; _NextFunction = CLuaObject(*luaState)["next"];
// //
nlassert(luaState); nlassert(luaState);

View file

@ -1,4 +1,7 @@
SUBDIRS(
IF(WITH_NEL_TOOLS)
SUBDIRS(
build_coarse_mesh build_coarse_mesh
build_far_bank build_far_bank
build_smallbank build_smallbank
@ -21,41 +24,52 @@ SUBDIRS(
shapes_exporter shapes_exporter
tga_cut tga_cut
tga_resize tga_resize
shape2obj
zone_check_bind zone_check_bind
zone_dump zone_dump
zviewer) zviewer)
IF(WIN32) ENDIF(WITH_NEL_TOOLS)
ADD_SUBDIRECTORY(ig_elevation)
ADD_SUBDIRECTORY(lightmap_optimizer)
# For tools selection of only max plugins
IF(WIN32)
IF(MFC_FOUND) IF(MFC_FOUND)
ADD_SUBDIRECTORY(object_viewer) ADD_SUBDIRECTORY(object_viewer)
ADD_SUBDIRECTORY(object_viewer_exe)
ADD_SUBDIRECTORY(tile_edit)
ENDIF(MFC_FOUND)
IF(WITH_NEL_MAXPLUGIN) IF(WITH_NEL_MAXPLUGIN)
IF(MAXSDK_FOUND) IF(MAXSDK_FOUND)
ADD_SUBDIRECTORY(plugin_max) ADD_SUBDIRECTORY(plugin_max)
ADD_SUBDIRECTORY(ligo) ADD_SUBDIRECTORY(ligo)
ENDIF(MAXSDK_FOUND) ENDIF(MAXSDK_FOUND)
ENDIF(WITH_NEL_MAXPLUGIN) ENDIF(WITH_NEL_MAXPLUGIN)
ENDIF(MFC_FOUND)
ENDIF(WIN32) ENDIF(WIN32)
IF(WITH_QT) IF(WITH_NEL_TOOLS)
IF(WIN32)
ADD_SUBDIRECTORY(ig_elevation)
ADD_SUBDIRECTORY(lightmap_optimizer)
IF(MFC_FOUND)
ADD_SUBDIRECTORY(object_viewer_exe)
ADD_SUBDIRECTORY(tile_edit)
ENDIF(MFC_FOUND)
ENDIF(WIN32)
IF(WITH_QT)
ADD_SUBDIRECTORY(tile_edit_qt) ADD_SUBDIRECTORY(tile_edit_qt)
ADD_SUBDIRECTORY(object_viewer_qt) ADD_SUBDIRECTORY(object_viewer_qt)
ADD_SUBDIRECTORY(object_viewer_widget) ADD_SUBDIRECTORY(object_viewer_widget)
ENDIF(WITH_QT) ENDIF(WITH_QT)
IF(SQUISH_FOUND) IF(SQUISH_FOUND)
ADD_SUBDIRECTORY(s3tc_compressor_lib) ADD_SUBDIRECTORY(s3tc_compressor_lib)
ADD_SUBDIRECTORY(panoply_maker) ADD_SUBDIRECTORY(panoply_maker)
ADD_SUBDIRECTORY(tga_2_dds) ADD_SUBDIRECTORY(tga_2_dds)
ADD_SUBDIRECTORY(hls_bank_maker) ADD_SUBDIRECTORY(hls_bank_maker)
ENDIF(SQUISH_FOUND) ENDIF(SQUISH_FOUND)
#crash_log_analyser
#shapes_exporter
ENDIF(WITH_NEL_TOOLS)
#crash_log_analyser
#shapes_exporter

View file

@ -1271,7 +1271,8 @@ void CObjectViewer::go ()
// Calc FPS // Calc FPS
static sint64 lastTime=NLMISC::CTime::getPerformanceTime (); static sint64 lastTime=NLMISC::CTime::getPerformanceTime ();
sint64 newTime=NLMISC::CTime::getPerformanceTime (); sint64 newTime=NLMISC::CTime::getPerformanceTime ();
float fps = (float)(1.0 / NLMISC::CTime::ticksToSecond (newTime-lastTime)); sint64 timeDiff = newTime - lastTime;
float fps = timeDiff > 0 ? (float)(1.0 / NLMISC::CTime::ticksToSecond (newTime-lastTime)) : 1000.0f;
lastTime=newTime; lastTime=newTime;
char msgBar[1024]; char msgBar[1024];
uint nbPlayingSources, nbSources; uint nbPlayingSources, nbSources;

View file

@ -574,36 +574,6 @@ plugin material NelMaterial
CheckBox cbUseSelfIllumColor "Use Color" checked:false align:#right CheckBox cbUseSelfIllumColor "Use Color" checked:false align:#right
) )
on cbTwoSided changed bval do
updateUI false
on cpAmbient changed cval do
updateUI false
on cpDiffuse changed cval do
updateUI false
on spOpacity changed pval do
updateUI false
on cpSpecular changed cval do
updateUI false
on spSpecularLevel changed pval do
updateUI false
on spGlossiness changed pval do
updateUI false
on cpSelfIllumColor changed cval do
updateUI false
on spSelfIllumAmount changed bval do
updateUI false
on cbUseSelfIllumColor changed bval do
updateUI false
Fn updateUI update = Fn updateUI update =
( (
if (version >= 14) then if (version >= 14) then
@ -655,6 +625,36 @@ plugin material NelMaterial
) )
) )
on cbTwoSided changed bval do
updateUI false
on cpAmbient changed cval do
updateUI false
on cpDiffuse changed cval do
updateUI false
on spOpacity changed pval do
updateUI false
on cpSpecular changed cval do
updateUI false
on spSpecularLevel changed pval do
updateUI false
on spGlossiness changed pval do
updateUI false
on cpSelfIllumColor changed cval do
updateUI false
on spSelfIllumAmount changed bval do
updateUI false
on cbUseSelfIllumColor changed bval do
updateUI false
on nelBasicParameters open do on nelBasicParameters open do
( (
updateUI true updateUI true

View file

@ -0,0 +1,9 @@
FILE(GLOB SRC *.cpp)
ADD_EXECUTABLE(shape2obj ${SRC})
TARGET_LINK_LIBRARIES(shape2obj nelmisc nel3d)
NL_DEFAULT_PROPS(shape2obj "NeL, Tools, 3D: shape2obj")
NL_ADD_RUNTIME_FLAGS(shape2obj)
INSTALL(TARGETS shape2obj RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d)

View file

@ -66,7 +66,7 @@ const CIndexBuffer *getRdrPassPrimitiveBlock(const CMeshMRMSkinnedGeom *mesh, ui
bool ProcessMeshMRMSkinned(const std::string &filename, IShape *shapeMesh); bool ProcessMeshMRMSkinned(const std::string &filename, IShape *shapeMesh);
bool ProcessMeshMRM(const std::string &filename, IShape *shapeMesh); bool ProcessMeshMRM(const std::string &filename, IShape *shapeMesh);
bool ProcessMesh(const std::string &filename, IShape *shapeMesh); //bool ProcessMesh(const std::string &filename, IShape *shapeMesh);
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
@ -110,7 +110,7 @@ int main(int argc, char* argv[])
if (ProcessMeshMRMSkinned(filename, shapeMesh)) return 0; if (ProcessMeshMRMSkinned(filename, shapeMesh)) return 0;
if (ProcessMeshMRM(filename, shapeMesh)) return 0; if (ProcessMeshMRM(filename, shapeMesh)) return 0;
if (ProcessMesh(filename, shapeMesh)) return 0; // if (ProcessMesh(filename, shapeMesh)) return 0;
return 0; return 0;
} }
@ -519,6 +519,10 @@ bool ProcessMeshMRM(const std::string &filename, IShape *shapeMesh)
return true; return true;
} }
/*
TODO: implement this
bool ProcessMesh(const std::string &filename, IShape *shapeMesh) bool ProcessMesh(const std::string &filename, IShape *shapeMesh)
{ {
CMesh *mesh = dynamic_cast<CMesh*>(shapeMesh); CMesh *mesh = dynamic_cast<CMesh*>(shapeMesh);
@ -666,3 +670,5 @@ bool ProcessMesh(const std::string &filename, IShape *shapeMesh)
return true; return true;
} }
*/

View file

@ -1,28 +1,34 @@
ADD_SUBDIRECTORY(misc)
ADD_SUBDIRECTORY(memory)
# Don't add other subdirectories if only max plugins are selected.
IF(WITH_NEL_TOOLS)
ADD_SUBDIRECTORY(misc)
ADD_SUBDIRECTORY(memory)
ENDIF(WITH_NEL_TOOLS)
# Max plugins are under the 3d directory as well.
IF(WITH_3D) IF(WITH_3D)
ADD_SUBDIRECTORY(3d) ADD_SUBDIRECTORY(3d)
ENDIF(WITH_3D) ENDIF(WITH_3D)
IF(WITH_PACS) # Don't add other subdirectories if only max plugins are selected.
IF(WITH_NEL_TOOLS)
IF(WITH_PACS)
ADD_SUBDIRECTORY(pacs) ADD_SUBDIRECTORY(pacs)
ENDIF(WITH_PACS) ENDIF(WITH_PACS)
IF(WITH_LOGIC) IF(WITH_LOGIC)
ADD_SUBDIRECTORY(logic) ADD_SUBDIRECTORY(logic)
ENDIF(WITH_LOGIC) ENDIF(WITH_LOGIC)
IF(WITH_GEORGES) IF(WITH_GEORGES)
ADD_SUBDIRECTORY(georges) ADD_SUBDIRECTORY(georges)
ENDIF(WITH_GEORGES) ENDIF(WITH_GEORGES)
IF(WITH_SOUND) IF(WITH_SOUND)
ADD_SUBDIRECTORY(sound) ADD_SUBDIRECTORY(sound)
ENDIF(WITH_SOUND) ENDIF(WITH_SOUND)
IF(WITH_NEL_TESTS) IF(WITH_NEL_TESTS)
ADD_SUBDIRECTORY(nel_unit_test) ADD_SUBDIRECTORY(nel_unit_test)
ENDIF(WITH_NEL_TESTS) ENDIF(WITH_NEL_TESTS)
ENDIF(WITH_NEL_TOOLS)
#build_gamedata

View file

@ -46,6 +46,12 @@ IF(WITH_RYZOM_CLIENT)
ENDIF(CURL_STATIC) ENDIF(CURL_STATIC)
ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(client)
ELSEIF(WITH_RYZOM_TOOLS)
# Need clientsheets lib for sheets packer tool
ADD_SUBDIRECTORY(client)
ENDIF(WITH_RYZOM_CLIENT) ENDIF(WITH_RYZOM_CLIENT)
IF(WITH_RYZOM_TOOLS) IF(WITH_RYZOM_TOOLS)
@ -53,6 +59,14 @@ IF(WITH_RYZOM_TOOLS)
ENDIF(WITH_RYZOM_TOOLS) ENDIF(WITH_RYZOM_TOOLS)
IF(WITH_RYZOM_SERVER) IF(WITH_RYZOM_SERVER)
FIND_PACKAGE(MySQL REQUIRED) FIND_PACKAGE(MySQL REQUIRED)
ADD_SUBDIRECTORY(server) ADD_SUBDIRECTORY(server)
ELSEIF(WITH_RYZOM_TOOLS)
# Need servershare for build packed collision tool
# Need aishare for build wmap tool
ADD_SUBDIRECTORY(server)
ENDIF(WITH_RYZOM_SERVER) ENDIF(WITH_RYZOM_SERVER)

View file

@ -1,4 +1,9 @@
# Need clientsheets lib for sheets packer tool
ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(src)
IF(WITH_RYZOM_CLIENT)
#ADD_SUBDIRECTORY(data) #ADD_SUBDIRECTORY(data)
#ADD_SUBDIRECTORY(patcher) #ADD_SUBDIRECTORY(patcher)
@ -12,3 +17,5 @@ IF(RYZOM_ETC_PREFIX)
ELSE(RYZOM_ETC_PREFIX) ELSE(RYZOM_ETC_PREFIX)
INSTALL(FILES client_default.cfg DESTINATION etc/ryzom) INSTALL(FILES client_default.cfg DESTINATION etc/ryzom)
ENDIF(RYZOM_ETC_PREFIX) ENDIF(RYZOM_ETC_PREFIX)
ENDIF(WITH_RYZOM_CLIENT)

View file

@ -126,24 +126,24 @@ AutoEquipTool = 1;
// *** LANDSCAPE // *** LANDSCAPE
LandscapeTileNear = 150.000000; LandscapeTileNear = 50.000000;
LandscapeTileNear_min = 20.000000; LandscapeTileNear_min = 20.000000;
LandscapeTileNear_max = 250.000000; LandscapeTileNear_max = 100.000000;
LandscapeTileNear_step = 10.0; LandscapeTileNear_step = 10.0;
LandscapeTileNear_ps0 = 20.0; LandscapeTileNear_ps0 = 20.0;
LandscapeTileNear_ps1 = 100.0; LandscapeTileNear_ps1 = 40.0;
LandscapeTileNear_ps2 = 150.0; LandscapeTileNear_ps2 = 50.0;
LandscapeTileNear_ps3 = 200.0; LandscapeTileNear_ps3 = 80.0;
// NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible // NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible
LandscapeThreshold = 2000.0; LandscapeThreshold = 1000.0;
LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold
LandscapeThreshold_max = 4000.0; // High quality => 0.0005 threshold LandscapeThreshold_max = 2000.0; // High quality => 0.0005 threshold
LandscapeThreshold_step = 100.0; LandscapeThreshold_step = 100.0;
LandscapeThreshold_ps0 = 100.0; LandscapeThreshold_ps0 = 100.0;
LandscapeThreshold_ps1 = 1000.0; LandscapeThreshold_ps1 = 500.0;
LandscapeThreshold_ps2 = 2000.0; LandscapeThreshold_ps2 = 1000.0;
LandscapeThreshold_ps3 = 3000.0; LandscapeThreshold_ps3 = 2000.0;
Vision = 500.000000; Vision = 500.000000;
Vision_min = 200.000000; Vision_min = 200.000000;

View file

@ -126,24 +126,24 @@ AutoEquipTool = 1;
// *** LANDSCAPE // *** LANDSCAPE
LandscapeTileNear = 150.000000; LandscapeTileNear = 50.000000;
LandscapeTileNear_min = 20.000000; LandscapeTileNear_min = 20.000000;
LandscapeTileNear_max = 250.000000; LandscapeTileNear_max = 100.000000;
LandscapeTileNear_step = 10.0; LandscapeTileNear_step = 10.0;
LandscapeTileNear_ps0 = 20.0; LandscapeTileNear_ps0 = 20.0;
LandscapeTileNear_ps1 = 100.0; LandscapeTileNear_ps1 = 40.0;
LandscapeTileNear_ps2 = 150.0; LandscapeTileNear_ps2 = 50.0;
LandscapeTileNear_ps3 = 200.0; LandscapeTileNear_ps3 = 80.0;
// NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible // NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible
LandscapeThreshold = 2000.0; LandscapeThreshold = 1000.0;
LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold LandscapeThreshold_min = 100.0; // Low quality => 0.01 threshold
LandscapeThreshold_max = 4000.0; // High quality => 0.0005 threshold LandscapeThreshold_max = 2000.0; // High quality => 0.0005 threshold
LandscapeThreshold_step = 100.0; LandscapeThreshold_step = 100.0;
LandscapeThreshold_ps0 = 100.0; LandscapeThreshold_ps0 = 100.0;
LandscapeThreshold_ps1 = 1000.0; LandscapeThreshold_ps1 = 500.0;
LandscapeThreshold_ps2 = 2000.0; LandscapeThreshold_ps2 = 1000.0;
LandscapeThreshold_ps3 = 3000.0; LandscapeThreshold_ps3 = 2000.0;
Vision = 500.000000; Vision = 500.000000;
Vision_min = 200.000000; Vision_min = 200.000000;

View file

@ -84,7 +84,7 @@ function bgdownloader:setPatchProgress(progress)
self:getPrioCB().active = true self:getPrioCB().active = true
local progressPercentText = string.format("%d%%", 100 * progress) local progressPercentText = string.format("%d%%", 100 * progress)
local progressPostfix = math.mod(os.time(), 3) local progressPostfix = math.fmod(os.time(), 3)
local progressDate = nltime.getLocalTime() / 500 local progressDate = nltime.getLocalTime() / 500
local colValue = math.floor(230 + 24 * math.sin(progressDate)) local colValue = math.floor(230 + 24 * math.sin(progressDate))
local color = string.format("%d %d %d %d", colValue, colValue, colValue, 255) local color = string.format("%d %d %d %d", colValue, colValue, colValue, 255)

View file

@ -521,7 +521,7 @@ function GameR2Loading:validateLoading()
local filename = GameR2Loading.CurrentFile local filename = GameR2Loading.CurrentFile
if string.find(filename, '\.r2', -3) == nil then if string.find(filename, '.r2', -3) == nil then
messageBox(i18n.get("uiR2EDLoadScenario_InvalidFileName")) messageBox(i18n.get("uiR2EDLoadScenario_InvalidFileName"))
return return
end end

View file

@ -131,7 +131,7 @@ local function levelToForceRegion(level)
end end
local function levelToLevelForce(level) local function levelToLevelForce(level)
return math.floor(math.mod(level, 50) * 5 / 50) + 1 return math.floor(math.fmod(level, 50) * 5 / 50) + 1
end end

View file

@ -45,7 +45,7 @@
text_ref="BM BM" text_y="-2" text_ref="BM BM" text_y="-2"
reset_focus_on_hide="false" max_historic="0" reset_focus_on_hide="false" max_historic="0"
onenter="set_keyboard_focus" params="target=ui:login:checkpass:content:submit_gr:eb_password:eb|select_all=false" onenter="set_keyboard_focus" params="target=ui:login:checkpass:content:submit_gr:eb_password:eb|select_all=false"
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="20" color="135 243 28 255" /> prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="12" color="135 243 28 255" />
<instance template="edit_box_log" id="eb_password" posparent="txt_pas" posref="BM TM" w="240" h="24" fontsize="14" x="0" y="-4" <instance template="edit_box_log" id="eb_password" posparent="txt_pas" posref="BM TM" w="240" h="24" fontsize="14" x="0" y="-4"
text_ref="BM BM" text_y="-2" text_ref="BM BM" text_y="-2"
@ -660,7 +660,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
text_ref="BM BM" text_y="-2" text_ref="BM BM" text_y="-2"
on_focus="create_account_rules" on_focus_params="rules_password" reset_focus_on_hide="false" max_historic="0" entry_type="password" on_focus="create_account_rules" on_focus_params="rules_password" reset_focus_on_hide="false" max_historic="0" entry_type="password"
onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_confirm_password:eb|select_all=false" onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_confirm_password:eb|select_all=false"
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="8" color="135 243 28 255" /> prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="20" color="135 243 28 255" />
<!-- confirm password --> <!-- confirm password -->
<view type="text" id="txt_confirm_pas" posparent="txt_pas" posref="BL TL" hardtext="uiConfirmPassword" fontsize="10" x="0" y="-30" color="255 255 255 255" /> <view type="text" id="txt_confirm_pas" posparent="txt_pas" posref="BL TL" hardtext="uiConfirmPassword" fontsize="10" x="0" y="-30" color="255 255 255 255" />
@ -669,7 +669,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
text_ref="BM BM" text_y="-2" text_ref="BM BM" text_y="-2"
on_focus="create_account_rules" on_focus_params="rules_password_conf" reset_focus_on_hide="false" max_historic="0" entry_type="password" on_focus="create_account_rules" on_focus_params="rules_password_conf" reset_focus_on_hide="false" max_historic="0" entry_type="password"
onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_email:eb|select_all=false" onenter="set_keyboard_focus" params="target=ui:login:create_account:content:submit_gr:eb_email:eb|select_all=false"
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="8" color="135 243 28 255" /> prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="20" color="135 243 28 255" />
<!-- email --> <!-- email -->
<view type="text" id="txt_email" posparent="txt_confirm_pas" posref="BL TL" hardtext="uiEmail" fontsize="10" x="0" y="-30" color="255 255 255 255" /> <view type="text" id="txt_email" posparent="txt_confirm_pas" posref="BL TL" hardtext="uiEmail" fontsize="10" x="0" y="-30" color="255 255 255 255" />
@ -678,7 +678,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
text_ref="BM BM" text_y="-2" text_ref="BM BM" text_y="-2"
on_focus="create_account_rules" on_focus_params="rules_email" reset_focus_on_hide="false" max_historic="0" on_focus="create_account_rules" on_focus_params="rules_email" reset_focus_on_hide="false" max_historic="0"
onenter="" params="" onenter="" params=""
prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="255" color="135 243 28 255" /> prompt="" enter_loose_focus="true" multi_line="false" max_num_chars="254" color="135 243 28 255" />
<!-- accept conditions --> <!-- accept conditions -->
<ctrl type="button" id="accept_cond" button_type="toggle_button" pushed="true" <ctrl type="button" id="accept_cond" button_type="toggle_button" pushed="true"

View file

@ -135,7 +135,7 @@ end
--function outgame:setPatchProgress(progress) --function outgame:setPatchProgress(progress)
-- --debugInfo("*** 3 ***") -- --debugInfo("*** 3 ***")
-- local progressPercentText = string.format("%d%%", 100 * progress) -- local progressPercentText = string.format("%d%%", 100 * progress)
-- local progressPostfix = math.mod(os.time(), 3) -- local progressPostfix = math.fmod(os.time(), 3)
-- --debugInfo("Patch in progress : " .. tostring(progress)) -- --debugInfo("Patch in progress : " .. tostring(progress))
-- local progressDate = nltime.getLocalTime() / 500 -- local progressDate = nltime.getLocalTime() / 500
-- local colValue = math.floor(230 + 24 * math.sin(progressDate)) -- local colValue = math.floor(230 + 24 * math.sin(progressDate))

View file

@ -56,7 +56,7 @@ function game:outpostAdjustHour(uiLocal, prop)
local h = runExpr(prop); local h = runExpr(prop);
-- add time zone and clamp hour -- add time zone and clamp hour
h = math.mod(h + tz + 24, 24); h = math.fmod(h + tz + 24, 24);
uiGroup[uiLocal].uc_hardtext = string.format('%02d:00', h); uiGroup[uiLocal].uc_hardtext = string.format('%02d:00', h);
end end
@ -288,8 +288,8 @@ function game:outpostActiveDefenderHourButton()
local timeRangeDef= getDbProp(path .. ':TIME_RANGE_DEF'); local timeRangeDef= getDbProp(path .. ':TIME_RANGE_DEF');
local timeRangeDefWanted= getDbProp(path .. ':TIME_RANGE_DEF_WANTED'); local timeRangeDefWanted= getDbProp(path .. ':TIME_RANGE_DEF_WANTED');
timeRangeDef= secondsSince1970ToHour( timeRangeDef ); timeRangeDef= secondsSince1970ToHour( timeRangeDef );
timeRangeDef= math.mod(timeRangeDef+24, 24); timeRangeDef= math.fmod(timeRangeDef+24, 24);
timeRangeDefWanted= math.mod(timeRangeDefWanted+24, 24); timeRangeDefWanted= math.fmod(timeRangeDefWanted+24, 24);
-- if time required is the one obtained, or if we are in peace -- if time required is the one obtained, or if we are in peace
if( timeRangeDef == timeRangeDefWanted or status<=game.OutpostEnums.Peace ) then if( timeRangeDef == timeRangeDefWanted or status<=game.OutpostEnums.Peace ) then
@ -323,8 +323,8 @@ function game:outpostActiveAttackerHourButton()
local timeRangeAtt= getDbProp('UI:TEMP:OUTPOST:DECLARE_WAR_ACK_TIME_RANGE_ATT'); local timeRangeAtt= getDbProp('UI:TEMP:OUTPOST:DECLARE_WAR_ACK_TIME_RANGE_ATT');
local timeRangeAttWanted= getDbProp('UI:TEMP:OUTPOST:DECLARE_WAR_ATTACK_PERIOD'); local timeRangeAttWanted= getDbProp('UI:TEMP:OUTPOST:DECLARE_WAR_ATTACK_PERIOD');
timeRangeAtt= secondsSince1970ToHour( timeRangeAtt ); timeRangeAtt= secondsSince1970ToHour( timeRangeAtt );
timeRangeAtt= math.mod(timeRangeAtt+24, 24); timeRangeAtt= math.fmod(timeRangeAtt+24, 24);
timeRangeAttWanted= math.mod(timeRangeAttWanted+24, 24); timeRangeAttWanted= math.fmod(timeRangeAttWanted+24, 24);
-- if time required is the one obtained -- if time required is the one obtained
if( timeRangeAtt == timeRangeAttWanted ) then if( timeRangeAtt == timeRangeAttWanted ) then

View file

@ -803,8 +803,8 @@ end
function game:timeInSecondsToReadableTime(regenTime) function game:timeInSecondsToReadableTime(regenTime)
local seconds = math.mod(regenTime, 60) local seconds = math.fmod(regenTime, 60)
local minutes = math.mod(math.floor(regenTime / 60), 60) local minutes = math.fmod(math.floor(regenTime / 60), 60)
local hours = math.floor(regenTime / 3600) local hours = math.floor(regenTime / 3600)
local result = "" local result = ""
if seconds > 0 then result = concatUCString(tostring(seconds), i18n.get("uittSecondsShort")) end if seconds > 0 then result = concatUCString(tostring(seconds), i18n.get("uittSecondsShort")) end

View file

@ -904,7 +904,7 @@ function RingAccessPoint:onDraw()
self.LastRefreshTime = nltime.getLocalTime() / 1000 self.LastRefreshTime = nltime.getLocalTime() / 1000
--self:getWindow():find("refreshText").active = false --self:getWindow():find("refreshText").active = false
else else
local waitText = i18n.get("uiRAP_WaitMsg" .. math.mod(os.time(), 3)) local waitText = i18n.get("uiRAP_WaitMsg" .. math.fmod(os.time(), 3))
self:setInfoMessage(waitText) self:setInfoMessage(waitText)
--local refreshText = self:getWindow():find("refreshText") --local refreshText = self:getWindow():find("refreshText")
--if not self.ListReceived then --if not self.ListReceived then

View file

@ -1,10 +1,15 @@
# Need clientsheets lib for sheets packer tool
ADD_SUBDIRECTORY(client_sheets)
IF(WITH_RYZOM_CLIENT)
# These are Windows/MFC apps # These are Windows/MFC apps
IF(WIN32) IF(WIN32)
# ADD_SUBDIRECTORY(bug_report) # ADD_SUBDIRECTORY(bug_report)
SET(SEVENZIP_LIBRARY "ryzom_sevenzip") SET(SEVENZIP_LIBRARY "ryzom_sevenzip")
ENDIF(WIN32) ENDIF(WIN32)
ADD_SUBDIRECTORY(client_sheets)
ADD_SUBDIRECTORY(seven_zip) ADD_SUBDIRECTORY(seven_zip)
FILE(GLOB CFG ../*.cfg ../*.cfg.in) FILE(GLOB CFG ../*.cfg ../*.cfg.in)
@ -124,3 +129,5 @@ IF(WITH_PCH)
ENDIF(WITH_PCH) ENDIF(WITH_PCH)
INSTALL(TARGETS ryzom_client RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications) INSTALL(TARGETS ryzom_client RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications)
ENDIF(WITH_RYZOM_CLIENT)

View file

@ -5164,7 +5164,7 @@ NLMISC_COMMAND(luaObject, "Dump the content of a lua object", "<table name> [max
CLuaIHMRyzom::debugInfo(e.what()); CLuaIHMRyzom::debugInfo(e.what());
return false; return false;
} }
luaState->pushValue(LUA_GLOBALSINDEX); luaState->pushGlobalTable();
CLuaObject env; CLuaObject env;
env.pop(*luaState); env.pop(*luaState);
uint maxDepth; uint maxDepth;

View file

@ -108,7 +108,7 @@ ucstring CControlSheetTooltipInfoWaiter::infoValidated(CDBCtrlSheet* ctrlSheet,
CLuaStackRestorer lsr(ls, 0); CLuaStackRestorer lsr(ls, 0);
CLuaIHM::pushReflectableOnStack(*ls, (CReflectableRefPtrTarget *)ctrlSheet); CLuaIHM::pushReflectableOnStack(*ls, (CReflectableRefPtrTarget *)ctrlSheet);
ls->pushValue(LUA_GLOBALSINDEX); ls->pushGlobalTable();
CLuaObject game(*ls); CLuaObject game(*ls);
game = game["game"]; game = game["game"];
game.callMethodByNameNoThrow(luaMethodName.c_str(), 1, 1); game.callMethodByNameNoThrow(luaMethodName.c_str(), 1, 1);
@ -3170,7 +3170,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
_PhraseAdapter = new CSPhraseComAdpater; _PhraseAdapter = new CSPhraseComAdpater;
_PhraseAdapter->Phrase = pPM->getPhrase(phraseId); _PhraseAdapter->Phrase = pPM->getPhrase(phraseId);
CLuaIHM::pushReflectableOnStack(*ls, _PhraseAdapter); CLuaIHM::pushReflectableOnStack(*ls, _PhraseAdapter);
ls->pushValue(LUA_GLOBALSINDEX); ls->pushGlobalTable();
CLuaObject game(*ls); CLuaObject game(*ls);
game = game["game"]; game = game["game"];
game.callMethodByNameNoThrow("updatePhraseTooltip", 1, 1); game.callMethodByNameNoThrow("updatePhraseTooltip", 1, 1);

View file

@ -187,9 +187,11 @@ static DECLARE_INTERFACE_USER_FCT(lua)
// *** clear return value // *** clear return value
const std::string retId= "__ui_internal_ret_"; const std::string retId= "__ui_internal_ret_";
CLuaStackChecker lsc(&ls); CLuaStackChecker lsc(&ls);
ls.pushGlobalTable();
ls.push(retId); ls.push(retId);
ls.pushNil(); ls.pushNil();
ls.setTable(LUA_GLOBALSINDEX); ls.setTable(-3); //pop pop
ls.pop();
// *** execute script // *** execute script
@ -201,8 +203,10 @@ static DECLARE_INTERFACE_USER_FCT(lua)
// *** retrieve and convert return value // *** retrieve and convert return value
ls.pushGlobalTable();
ls.push(retId); ls.push(retId);
ls.getTable(LUA_GLOBALSINDEX); ls.getTable(-2);
ls.remove(-2);
bool ok= false; bool ok= false;
sint type= ls.type(); sint type= ls.type();
if (type==LUA_TBOOLEAN) if (type==LUA_TBOOLEAN)
@ -370,7 +374,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions( NLGUI::CLuaState &ls )
ls.registerFunc("SNode", CUICtor::SNode); ls.registerFunc("SNode", CUICtor::SNode);
// *** Register the metatable for access to client.cfg (nb nico this may be more general later -> access to any config file ...) // *** Register the metatable for access to client.cfg (nb nico this may be more general later -> access to any config file ...)
ls.pushValue(LUA_GLOBALSINDEX); ls.pushGlobalTable();
CLuaObject globals(ls); CLuaObject globals(ls);
CLuaObject clientCfg = globals.newTable("config"); CLuaObject clientCfg = globals.newTable("config");
CLuaObject mt = globals.newTable("__cfmt"); CLuaObject mt = globals.newTable("__cfmt");

View file

@ -3235,7 +3235,7 @@ class CHandlerDebugUiDumpElementUnderMouse : public IActionHandler
if (!lua) return; if (!lua) return;
CLuaStackRestorer lsr(lua, 0); CLuaStackRestorer lsr(lua, 0);
CLuaIHM::pushUIOnStack(*lua, HighlightedDebugUI); CLuaIHM::pushUIOnStack(*lua, HighlightedDebugUI);
lua->pushValue(LUA_GLOBALSINDEX); lua->pushGlobalTable();
CLuaObject env(*lua); CLuaObject env(*lua);
env["inspect"].callNoThrow(1, 0); env["inspect"].callNoThrow(1, 0);
} }

View file

@ -77,7 +77,7 @@ CComLuaModule::CComLuaModule(CDynamicMapClient* client, lua_State *luaState /*=
#ifdef LUA_NEVRAX_VERSION #ifdef LUA_NEVRAX_VERSION
_LuaState = lua_open(NULL, NULL); _LuaState = lua_open(NULL, NULL);
#else #else
_LuaState = lua_open(); _LuaState = luaL_newstate();
#endif #endif
_LuaOwnerShip = false; _LuaOwnerShip = false;
luaopen_base(_LuaState); luaopen_base(_LuaState);
@ -105,7 +105,7 @@ CComLuaModule::CComLuaModule(CDynamicMapClient* client, lua_State *luaState /*=
void CComLuaModule::initLuaLib() void CComLuaModule::initLuaLib()
{ {
//H_AUTO(R2_CComLuaModule_initLuaLib) //H_AUTO(R2_CComLuaModule_initLuaLib)
const luaL_reg methods[] = const luaL_Reg methods[] =
{ {
{"updateScenario", CComLuaModule::luaUpdateScenario}, {"updateScenario", CComLuaModule::luaUpdateScenario},
{"requestUpdateRtScenario", CComLuaModule::luaRequestUpdateRtScenario}, {"requestUpdateRtScenario", CComLuaModule::luaRequestUpdateRtScenario},
@ -237,7 +237,12 @@ void CComLuaModule::initLuaLib()
}; };
int initialStackSize = lua_gettop(_LuaState); int initialStackSize = lua_gettop(_LuaState);
#if LUA_VERSION_NUM >= 502
luaL_newlib(_LuaState, methods);
lua_setglobal(_LuaState, R2_LUA_PATH);
#else
luaL_openlib(_LuaState, R2_LUA_PATH, methods, 0); luaL_openlib(_LuaState, R2_LUA_PATH, methods, 0);
#endif
lua_settop(_LuaState, initialStackSize); lua_settop(_LuaState, initialStackSize);
} }
@ -1046,7 +1051,11 @@ void CComLuaModule::setObjectToLua(lua_State* state, CObject* object)
{ {
int initialStackSize = lua_gettop(state); int initialStackSize = lua_gettop(state);
#if LUA_VERSION_NUM >= 502
lua_pushglobaltable(state); // _G
#else
lua_pushvalue(state, LUA_GLOBALSINDEX); // _G lua_pushvalue(state, LUA_GLOBALSINDEX); // _G
#endif
lua_pushstring(state, "r2"); // _G, "r2" lua_pushstring(state, "r2"); // _G, "r2"
lua_gettable(state, -2); // G, r2 lua_gettable(state, -2); // G, r2
@ -1106,6 +1115,8 @@ void CComLuaModule::setObjectToLua(lua_State* state, CObject* object)
} }
} }
#if 0
// okay!
if (0) if (0)
{ {
@ -1128,6 +1139,7 @@ void CComLuaModule::setObjectToLua(lua_State* state, CObject* object)
} }
} }
} }
#endif
} }
else else
{ {
@ -1147,8 +1159,11 @@ CObject* CComLuaModule::getObjectFromLua(lua_State* state, sint idx)
{ {
if (lua_getmetatable(state, -1)) if (lua_getmetatable(state, -1))
{ {
#if LUA_VERSION_NUM >= 502
lua_pushglobaltable(state); // obj, mt, _G
#else
lua_pushvalue(state, LUA_GLOBALSINDEX); // obj, mt, _G lua_pushvalue(state, LUA_GLOBALSINDEX); // obj, mt, _G
#endif
lua_pushstring(state, "r2"); // obj, mt, _G, "r2" lua_pushstring(state, "r2"); // obj, mt, _G, "r2"

View file

@ -2613,7 +2613,7 @@ void CEditor::init(TMode initialMode, TAccessMode accessMode)
} }
// //
CLuaStackChecker lsc(&getLua()); CLuaStackChecker lsc(&getLua());
getLua().pushValue(LUA_GLOBALSINDEX); getLua().pushGlobalTable();
_Globals.pop(getLua()); _Globals.pop(getLua());
getLua().pushValue(LUA_REGISTRYINDEX); getLua().pushValue(LUA_REGISTRYINDEX);
_Registry.pop(getLua()); _Registry.pop(getLua());
@ -3956,9 +3956,11 @@ void CEditor::release()
// clear the environment // clear the environment
if (CLuaManager::getInstance().getLuaState()) if (CLuaManager::getInstance().getLuaState())
{ {
getLua().pushGlobalTable();
getLua().push(R2_LUA_PATH); getLua().push(R2_LUA_PATH);
getLua().pushNil(); getLua().pushNil();
getLua().setTable(LUA_GLOBALSINDEX); getLua().setTable(-3); // pop pop
getLua().pop();
_Globals.release(); _Globals.release();
_Registry.release(); _Registry.release();
_ObjectProjectionMetatable.release(); // AJM _ObjectProjectionMetatable.release(); // AJM

View file

@ -51,7 +51,7 @@ void CSessionBrowserImpl::init(CLuaState *ls)
{ {
nlassert(ls); nlassert(ls);
_Lua = ls; _Lua = ls;
_Lua->pushValue(LUA_GLOBALSINDEX); _Lua->pushGlobalTable();
CLuaObject game(*_Lua); CLuaObject game(*_Lua);
game = game["game"]; game = game["game"];
game.setValue("getRingSessionList", luaGetRingSessionList); game.setValue("getRingSessionList", luaGetRingSessionList);
@ -759,7 +759,7 @@ void CSessionBrowserImpl::callRingAccessPointMethod(const char *name, int numArg
nlassert(name); nlassert(name);
{ {
CLuaStackRestorer lsr(_Lua, _Lua->getTop() + numResult); CLuaStackRestorer lsr(_Lua, _Lua->getTop() + numResult);
_Lua->pushValue(LUA_GLOBALSINDEX); _Lua->pushGlobalTable();
CLuaObject rap(*_Lua); CLuaObject rap(*_Lua);
rap = rap["RingAccessPoint"]; rap = rap["RingAccessPoint"];
rap.callMethodByNameNoThrow(name, numArg, numResult); rap.callMethodByNameNoThrow(name, numArg, numResult);
@ -774,7 +774,7 @@ void CSessionBrowserImpl::callRingCharTrackingMethod(const char *name, int numAr
nlassert(name); nlassert(name);
{ {
CLuaStackRestorer lsr(_Lua, _Lua->getTop() + numResult); CLuaStackRestorer lsr(_Lua, _Lua->getTop() + numResult);
_Lua->pushValue(LUA_GLOBALSINDEX); _Lua->pushGlobalTable();
CLuaObject rap(*_Lua); CLuaObject rap(*_Lua);
rap = rap["CharTracking"]; rap = rap["CharTracking"];
rap.callMethodByNameNoThrow(name, numArg, numResult); rap.callMethodByNameNoThrow(name, numArg, numResult);
@ -789,7 +789,7 @@ void CSessionBrowserImpl::callRingPlayerInfoMethod(const char *name, int numArg,
nlassert(name); nlassert(name);
{ {
CLuaStackRestorer lsr(_Lua, _Lua->getTop() + numResult); CLuaStackRestorer lsr(_Lua, _Lua->getTop() + numResult);
_Lua->pushValue(LUA_GLOBALSINDEX); _Lua->pushGlobalTable();
CLuaObject rap(*_Lua); CLuaObject rap(*_Lua);
rap = rap["RingPlayerInfo"]; rap = rap["RingPlayerInfo"];
rap.callMethodByNameNoThrow(name, numArg, numResult); rap.callMethodByNameNoThrow(name, numArg, numResult);
@ -804,7 +804,7 @@ void CSessionBrowserImpl::callScenarioScoresMethod(const char *name, int numArg,
nlassert(name); nlassert(name);
{ {
CLuaStackRestorer lsr(_Lua, _Lua->getTop() + numResult); CLuaStackRestorer lsr(_Lua, _Lua->getTop() + numResult);
_Lua->pushValue(LUA_GLOBALSINDEX); _Lua->pushGlobalTable();
CLuaObject rap(*_Lua); CLuaObject rap(*_Lua);
rap = rap["ScenarioScores"]; rap = rap["ScenarioScores"];
rap.callMethodByNameNoThrow(name, numArg, numResult); rap.callMethodByNameNoThrow(name, numArg, numResult);

View file

@ -1,7 +1,14 @@
# Supporting modules and libraries. # Supporting modules and libraries.
ADD_SUBDIRECTORY(admin_modules) # Need servershare for build packed collision tool
# Need aishare for build wmap tool
ADD_SUBDIRECTORY(server_share) ADD_SUBDIRECTORY(server_share)
ADD_SUBDIRECTORY(ai_share) ADD_SUBDIRECTORY(ai_share)
IF(WITH_RYZOM_SERVER)
# Supporting modules and libraries.
ADD_SUBDIRECTORY(admin_modules)
ADD_SUBDIRECTORY(gameplay_module_lib) ADD_SUBDIRECTORY(gameplay_module_lib)
ADD_SUBDIRECTORY(pd_lib) ADD_SUBDIRECTORY(pd_lib)
@ -40,3 +47,5 @@ ADD_SUBDIRECTORY(general_utilities_service)
#sabrina #sabrina
#simulation_service #simulation_service
#testing_tool_service #testing_tool_service
ENDIF(WITH_RYZOM_SERVER)

View file

@ -9,15 +9,13 @@ ADD_SUBDIRECTORY(leveldesign)
ADD_SUBDIRECTORY(patch_gen) ADD_SUBDIRECTORY(patch_gen)
ADD_SUBDIRECTORY(pdr_util) ADD_SUBDIRECTORY(pdr_util)
ADD_SUBDIRECTORY(stats_scan) ADD_SUBDIRECTORY(stats_scan)
ADD_SUBDIRECTORY(sheets_packer)
IF(WITH_RYZOM_CLIENT) IF(WITH_RYZOM_CLIENT)
ADD_SUBDIRECTORY(sheets_packer)
ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(client)
ENDIF(WITH_RYZOM_CLIENT) ENDIF(WITH_RYZOM_CLIENT)
IF(WITH_RYZOM_SERVER) ADD_SUBDIRECTORY(server)
ADD_SUBDIRECTORY(server)
ENDIF(WITH_RYZOM_SERVER)
# Old stuff that doesn't compile anymore. # Old stuff that doesn't compile anymore.
#ADD_SUBDIRECTORY(occ2huff) #ADD_SUBDIRECTORY(occ2huff)