From ab11ddb8055d80b574c4e9fe3e381d824cdbe97a Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 12 Aug 2010 19:42:33 +0200 Subject: [PATCH 1/2] Changed: #825 Remove all warning when compiling Ryzom --- code/nel/samples/3d/cluster_viewer/main.cpp | 29 +++++---- code/nel/src/3d/lighting_manager.cpp | 2 +- code/nel/tools/3d/cluster_viewer/view_cs.cpp | 59 +++++++++---------- code/nel/tools/3d/zone_welder/zone_welder.cpp | 7 +++ 4 files changed, 51 insertions(+), 46 deletions(-) diff --git a/code/nel/samples/3d/cluster_viewer/main.cpp b/code/nel/samples/3d/cluster_viewer/main.cpp index 7ca5b07a1..bc314e43a 100644 --- a/code/nel/samples/3d/cluster_viewer/main.cpp +++ b/code/nel/samples/3d/cluster_viewer/main.cpp @@ -15,20 +15,13 @@ // along with this program. If not, see . -// +// --------------------------------------------------------------------------- // Includes -// +// --------------------------------------------------------------------------- + #include "nel/misc/types_nl.h" -#include - -#ifdef NL_OS_WINDOWS -# include -# undef min -# undef max -#endif - #include "nel/misc/file.h" #include "nel/misc/path.h" #include "nel/misc/bitmap.h" @@ -44,6 +37,11 @@ #include "nel/3d/transform_shape.h" #include "nel/3d/event_mouse_listener.h" +#ifdef NL_OS_WINDOWS +# define NOMINMAX +# include +#endif // NL_OS_WINDOWS + #ifndef CV_DIR # define CV_DIR "." #endif @@ -117,15 +115,17 @@ void LoadSceneScript (const char *ScriptName, CScene* pScene, vector &D FILE *f = fopen (CPath::lookup(ScriptName).c_str(),"rb"); fseek (f, 0, SEEK_END); - int file_size = ftell (f); + uint file_size = ftell (f); fseek (f, 0, SEEK_SET); char *file_buf = (char*)malloc(file_size+1); - fread (file_buf, 1, file_size, f); + if (fread (file_buf, 1, file_size, f) != file_size) + nlwarning("Can't read %d elements", file_size); + file_buf[file_size] = 0; ++file_size; fclose (f); char *buf_ptr = file_buf; - int nLastNbPlus = 0; + sint nLastNbPlus = 0; vector pile; pile.clear (); pile.push_back (pScene->getGlobalInstanceGroup()); @@ -134,7 +134,7 @@ void LoadSceneScript (const char *ScriptName, CScene* pScene, vector &D do { char Line[256], *line_ptr; - int nNbPlus = 0; + sint nNbPlus = 0; line_ptr = &Line[0]; buf_ptr = readLine (line_ptr, buf_ptr); @@ -384,7 +384,6 @@ int main() CNELU::Driver->swapBuffers (); - // Keys management // --------------- diff --git a/code/nel/src/3d/lighting_manager.cpp b/code/nel/src/3d/lighting_manager.cpp index 95e769ee1..ecbf51dcd 100644 --- a/code/nel/src/3d/lighting_manager.cpp +++ b/code/nel/src/3d/lighting_manager.cpp @@ -486,7 +486,7 @@ void CLightingManager::computeModelLightContributions(NLMISC::CRGBA sunAmbient, v= NLMISC::OptFastFloor(mergedAmbient.R); fastClamp8(v); amb.R= v; v= NLMISC::OptFastFloor(mergedAmbient.G); fastClamp8(v); amb.G= v; v= NLMISC::OptFastFloor(mergedAmbient.B); fastClamp8(v); amb.B= v; - amb.R = 255; + amb.A = 255; lightContrib.MergedPointLight= amb; // Indicate we use the merged pointLight => the model must recompute lighting each frame diff --git a/code/nel/tools/3d/cluster_viewer/view_cs.cpp b/code/nel/tools/3d/cluster_viewer/view_cs.cpp index 15b5ebc7d..8db2208fb 100644 --- a/code/nel/tools/3d/cluster_viewer/view_cs.cpp +++ b/code/nel/tools/3d/cluster_viewer/view_cs.cpp @@ -21,26 +21,31 @@ #include "nel/misc/types_nl.h" -#include "nel/misc/file.h" -#include "nel/misc/bitmap.h" +#include "nel/misc/file.h" +#include "nel/misc/path.h" +#include "nel/misc/bitmap.h" +#include "nel/misc/events.h" +#include "nel/misc/time_nl.h" #include "nel/misc/event_server.h" #include "nel/misc/event_listener.h" -#include "nel/misc/events.h" -#include "nel/misc/path.h" -#include "nel/misc/time_nl.h" -#include "nel/3d/driver.h" + #include "nel/3d/nelu.h" +#include "nel/3d/driver.h" #include "nel/3d/scene_group.h" +#include "nel/3d/text_context.h" #include "nel/3d/transform_shape.h" #include "nel/3d/event_mouse_listener.h" -#include "nel/3d/text_context.h" #ifdef NL_OS_WINDOWS # define NOMINMAX # include #endif // NL_OS_WINDOWS +#ifndef CV_DIR +# define CV_DIR "." +#endif + using namespace std; using namespace NL3D; using namespace NLMISC; @@ -109,7 +114,7 @@ void LoadSceneScript (const char *ScriptName, CScene* pScene, vector &D FILE *f = fopen (ScriptName,"rb"); fseek (f, 0, SEEK_END); - sint file_size = ftell (f); + uint file_size = ftell (f); fseek (f, 0, SEEK_SET); char *file_buf = (char*)malloc(file_size+1); if (fread (file_buf, 1, file_size, f) != file_size) @@ -152,7 +157,7 @@ void LoadSceneScript (const char *ScriptName, CScene* pScene, vector &D } else { - if (nLastNbPlus >= nNbPlus) + if (nLastNbPlus >= nNbPlus) for (int i = 0; i < ((nLastNbPlus-nNbPlus)+1); ++i) if (pile.size() > 0) pile.pop_back(); @@ -194,7 +199,6 @@ void LoadSceneScript (const char *ScriptName, CScene* pScene, vector &D // --------------------------------------------------------------------------- // Main // --------------------------------------------------------------------------- - #ifdef NL_OS_WINDOWS int CALLBACK WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) #else // NL_OS_WINDOWS @@ -204,7 +208,6 @@ int main(int argc, char **argv) double rGlobalTime = 0; double rOldGlobalTime = 0; double rDeltaTime = 0; - double rMoveTime = 0; vector DispCS; @@ -217,18 +220,19 @@ int main(int argc, char **argv) CNELU::init (800, 600, CViewport(), 32, true); - CPath::addSearchPath("shapes/"); - CPath::addSearchPath("groups/"); - CPath::addSearchPath("maps/"); - CPath::addSearchPath("lightmaps/"); - CPath::addSearchPath("anims/"); - ///// CPath::addSearchPath("fonts/"); + CNELU::Scene->enableLightingSystem(true); + CNELU::Scene->setAmbientGlobal(CRGBA(128,128,128)); + + CPath::addSearchPath(CV_DIR); + CPath::addSearchPath(CV_DIR"/shapes"); + CPath::addSearchPath(CV_DIR"/groups"); + CPath::addSearchPath(CV_DIR"/fonts"); CFontManager FontManager; CTextContext TextContext; TextContext.init (CNELU::Driver, &FontManager); - TextContext.setFontGenerator ("fonts/n019003l.pfb"); + TextContext.setFontGenerator (NLMISC::CPath::lookup("n019003l.pfb")); TextContext.setHotSpot (CComputedString::TopLeft); TextContext.setColor (CRGBA(255,255,255)); TextContext.setFontSize (20); @@ -242,21 +246,18 @@ int main(int argc, char **argv) // Force to automatically find the cluster system CNELU::Camera->setClusterSystem ((CInstanceGroup*)-1); - CClipTrav *pClipTrav = &CNELU::Scene->getClipTrav(); dcsTemp.Name = "Root"; dcsTemp.pIG = NULL; DispCS.push_back (dcsTemp); - // Add all instance that create the scene // -------------------------------------- - // Begining of script reading + // Beginning of script reading CVector CameraStart; LoadSceneScript ("view_cs.txt", CNELU::Scene, DispCS, CameraStart); - CNELU::Scene->enableLightingSystem(true); CMatrix m = MouseListener.getViewMatrix(); m.setPos (CameraStart); MouseListener.setMatrix (m); @@ -352,9 +353,7 @@ int main(int argc, char **argv) if (j < (vCluster.size()-1)) sAllClusters += ", "; } - TextContext.printfAt (0, 1-0.028f, sAllClusters.c_str()); - - + TextContext.printfAt (0, 1-0.028f, sAllClusters.c_str()); } // ----------------------------------------------------- @@ -362,14 +361,13 @@ int main(int argc, char **argv) CNELU::Driver->swapBuffers (); - // Keys management // --------------- if (CNELU::AsyncListener.isKeyDown (KeySHIFT)) - MouseListener.setSpeed (10.0f); + MouseListener.setSpeed (50.0f); else - MouseListener.setSpeed (2.0f); + MouseListener.setSpeed (10.0f); CNELU::Camera->setMatrix (MouseListener.getViewMatrix()); @@ -419,6 +417,7 @@ int main(int argc, char **argv) } } - while (!CNELU::AsyncListener.isKeyPushed (KeyESCAPE)); - return 0; + while ((!CNELU::AsyncListener.isKeyPushed(KeyESCAPE)) && CNELU::Driver->isActive()); + + return EXIT_SUCCESS; } diff --git a/code/nel/tools/3d/zone_welder/zone_welder.cpp b/code/nel/tools/3d/zone_welder/zone_welder.cpp index 028549cff..31610f68e 100644 --- a/code/nel/tools/3d/zone_welder/zone_welder.cpp +++ b/code/nel/tools/3d/zone_welder/zone_welder.cpp @@ -76,6 +76,13 @@ struct CWeldableVertexInfos sint PatchIndex; // patch uint8 PatchVertex; // 0,1,2,3 + CWeldableVertexInfos() + { + IndexInZone = 0; + PatchIndex = 0; + PatchVertex = 0; + } + bool operator< (const CWeldableVertexInfos& wvinf) const { if(IndexInZone Date: Thu, 12 Aug 2010 20:25:53 +0200 Subject: [PATCH 2/2] Changed: client_default.cfg and patcher translations installation --- code/ryzom/client/CMakeLists.txt | 9 ++++++++- code/ryzom/client/data/CMakeLists.txt | 5 +++++ code/ryzom/client/patcher/CMakeLists.txt | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 code/ryzom/client/data/CMakeLists.txt create mode 100644 code/ryzom/client/patcher/CMakeLists.txt diff --git a/code/ryzom/client/CMakeLists.txt b/code/ryzom/client/CMakeLists.txt index 642244536..14475021e 100644 --- a/code/ryzom/client/CMakeLists.txt +++ b/code/ryzom/client/CMakeLists.txt @@ -1,7 +1,14 @@ ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(data) +ADD_SUBDIRECTORY(patcher) IF(UNIX AND NOT APPLE) ADD_SUBDIRECTORY(unix) ENDIF(UNIX AND NOT APPLE) -INSTALL(FILES client_default.cfg DESTINATION ${RYZOM_ETC_PREFIX}) +IF(RYZOM_SHARE_PREFIX) + CONFIGURE_FILE(client_default.cfg.in "${CMAKE_CURRENT_BINARY_DIR}/client_default.cfg") + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/client_default.cfg" DESTINATION ${RYZOM_ETC_PREFIX}) +ELSE(RYZOM_SHARE_PREFIX) + INSTALL(FILES client_default.cfg DESTINATION ${RYZOM_ETC_PREFIX}) +ENDIF(RYZOM_SHARE_PREFIX) diff --git a/code/ryzom/client/data/CMakeLists.txt b/code/ryzom/client/data/CMakeLists.txt new file mode 100644 index 000000000..ffd3a3267 --- /dev/null +++ b/code/ryzom/client/data/CMakeLists.txt @@ -0,0 +1,5 @@ +# Uncomment next lines if you want to create gamedev.bnp +#ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_BINARY_DIR}/share/gamedev.bnp" +# COMMAND bnp_make -p ${CMAKE_CURRENT_SOURCE_DIR}/gamedev ${CMAKE_BINARY_DIR}/share > /dev/null) + +#ADD_CUSTOM_TARGET(gamedev ALL DEPENDS "${CMAKE_BINARY_DIR}/share/gamedev.bnp") diff --git a/code/ryzom/client/patcher/CMakeLists.txt b/code/ryzom/client/patcher/CMakeLists.txt new file mode 100644 index 000000000..3b8b89a3d --- /dev/null +++ b/code/ryzom/client/patcher/CMakeLists.txt @@ -0,0 +1,3 @@ +FILE(GLOB SRC *.uxt) + +INSTALL(FILES ${SRC} DESTINATION "${RYZOM_SHARE_PREFIX}/patcher")