diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 97dc2b7f7..a8efd9dfa 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -2,7 +2,7 @@ # # NeL # Authors: Nevrax and the NeL Community -# Version: 0.7.0 +# Version: 0.8.0 # # Notes: # * Changing install location: add -DCMAKE_INSTALL_PREFIX:PATH=/my/new/path @@ -48,7 +48,7 @@ NL_SETUP_BUILD_FLAGS() CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(RyzomCore CXX C) SET(NL_VERSION_MAJOR 0) -SET(NL_VERSION_MINOR 7) +SET(NL_VERSION_MINOR 8) SET(NL_VERSION_PATCH 0) SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}") diff --git a/code/nel/configure.ac b/code/nel/configure.ac index 86e511f9c..84edccc05 100644 --- a/code/nel/configure.ac +++ b/code/nel/configure.ac @@ -13,7 +13,7 @@ # *and* AC_SUBST(LIBTOOL_VERSION) AC_PREREQ(2.57) -AC_INIT([nel],[0.7.0],[nel-all@nevrax.org]) +AC_INIT([nel],[0.8.0],[nel-all@nevrax.org]) AM_INIT_AUTOMAKE([tar-ustar]) AC_CONFIG_SRCDIR(include/nel/misc/types_nl.h) diff --git a/code/nel/src/3d/coarse_mesh_build.cpp b/code/nel/src/3d/coarse_mesh_build.cpp index 14c2da789..e196b3f99 100644 --- a/code/nel/src/3d/coarse_mesh_build.cpp +++ b/code/nel/src/3d/coarse_mesh_build.cpp @@ -117,7 +117,7 @@ bool CCoarseMeshBuild::buildBitmap (const std::vector& coarseMe else { // Build a name - name+=toString ("%d",(ptrdiff_t)texture); + name+=toString ("%p", texture); } } @@ -477,7 +477,7 @@ void CCoarseMeshBuild::remapCoordinates (const std::vector& coa else { // Build a name - name+=toString ("%d",(ptrdiff_t)texture); + name+=toString ("%p", texture); } } diff --git a/code/nel/src/3d/particle_system.cpp b/code/nel/src/3d/particle_system.cpp index 0e22f5c94..a26a2c307 100644 --- a/code/nel/src/3d/particle_system.cpp +++ b/code/nel/src/3d/particle_system.cpp @@ -2305,13 +2305,13 @@ void CParticleSystem::dumpHierarchy() CPSLocated *loc = dynamic_cast(_ProcessVect[k]); if (loc) { - nlinfo("Located k : %s @%x", loc->getName().c_str(), (ptrdiff_t) loc); + nlinfo("Located k : %s @%p", loc->getName().c_str(), loc); for(uint l = 0; l < loc->getNbBoundObjects(); ++l) { CPSEmitter *emitter = dynamic_cast(loc->getBoundObject(l)); if (emitter) { - nlinfo(" emitter %s : emit %s @%x", emitter->getName().c_str(), emitter->getEmittedType() ? emitter->getEmittedType()->getName().c_str() : "none", (ptrdiff_t) emitter->getEmittedType()); + nlinfo(" emitter %s : emit %s @%p", emitter->getName().c_str(), emitter->getEmittedType() ? emitter->getEmittedType()->getName().c_str() : "none", emitter->getEmittedType()); } } } diff --git a/code/nel/src/3d/render_trav.cpp b/code/nel/src/3d/render_trav.cpp index 33ca5f499..c509ca945 100644 --- a/code/nel/src/3d/render_trav.cpp +++ b/code/nel/src/3d/render_trav.cpp @@ -1300,12 +1300,12 @@ void CRenderTrav::debugWaterModelMemory(const char *tag, bool dumpList) { // Before crash, do some log nlwarning("******* WaterModelList crash after %s", tag); - nlwarning("Current: Ptr:%x. List:%x/%x", (ptrdiff_t)dmp.Address, (ptrdiff_t)dmp.ClippedPolyBegin, (ptrdiff_t)dmp.ClippedPolyEnd); + nlwarning("Current: Ptr:%p. List:%p/%p", dmp.Address, dmp.ClippedPolyBegin, dmp.ClippedPolyEnd); // Log also the list bkuped (to do comparisons) for(uint i=0;i<_DebugWaterModelList.size();i++) { CWaterModelDump &bkup= _DebugWaterModelList[i]; - nlwarning("List%02d: Ptr:%x. Array:%x/%x", i, (ptrdiff_t)bkup.Address, (ptrdiff_t)bkup.ClippedPolyBegin, (ptrdiff_t)bkup.ClippedPolyEnd); + nlwarning("List%02d: Ptr:%p. Array:%p/%p", i, bkup.Address, bkup.ClippedPolyBegin, bkup.ClippedPolyEnd); } // crash (assert not stop for clearness) diff --git a/code/nel/src/georges/form.cpp b/code/nel/src/georges/form.cpp index 29a4b04dd..ebadc1d13 100644 --- a/code/nel/src/georges/form.cpp +++ b/code/nel/src/georges/form.cpp @@ -188,8 +188,8 @@ void CForm::read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const cha if ( ((const char*)node->name == NULL) || (strcmp ((const char*)node->name, "FORM") != 0) ) { // Make an error message - warning (true, "read", "XML Syntax error in block line %d, node (%s) should be FORM.", - (ptrdiff_t)node->content, node->name); + warning (true, "read", "XML Syntax error in block line %p, node (%s) should be FORM.", + node->content, node->name); } // Get first struct node @@ -197,8 +197,8 @@ void CForm::read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const cha if (child == NULL) { // Throw exception - warning (true, "read", "Syntax error in block line %d, node (%s) should have a STRUCT child node.", - (ptrdiff_t)node->content, node->name); + warning (true, "read", "Syntax error in block line %p, node (%s) should have a STRUCT child node.", + node->content, node->name); } // Read the struct diff --git a/code/nel/src/georges/form_dfn.cpp b/code/nel/src/georges/form_dfn.cpp index 316a7b403..ee7bbcb0d 100644 --- a/code/nel/src/georges/form_dfn.cpp +++ b/code/nel/src/georges/form_dfn.cpp @@ -115,7 +115,7 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const if ( ((const char*)root->name == NULL) || (strcmp ((const char*)root->name, "DFN") != 0) ) { // Throw exception - warning (true, "read", "XML Syntax error in block line %d, node (%s) should be DFN.", (ptrdiff_t)root->content, root->name); + warning (true, "read", "XML Syntax error in block line %p, node (%s) should be DFN.", root->content, root->name); } // Count the parent @@ -147,8 +147,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const else { // Throw exception - warning (true, "read", "XML Syntax error in block (%s) line %d, aguments Name not found.", - parent->name, (ptrdiff_t)parent->content); + warning (true, "read", "XML Syntax error in block (%s) line %p, aguments Name not found.", + parent->name, parent->content); } // Next parent @@ -230,8 +230,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const if ((Entries[childNumber].Type == NULL) && !forceLoad) { // Throw exception - warning (true, "read", "In XML block (%s) line %d, file not found %s.", - child->name, (ptrdiff_t)child->content, Entries[childNumber].Filename.c_str ()); + warning (true, "read", "In XML block (%s) line %p, file not found %s.", + child->name, child->content, Entries[childNumber].Filename.c_str ()); } // Read the default value @@ -247,8 +247,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const else { // Throw exception - warning (true, "read", "XML In block (%s) line %d, no filename found for the .typ file.", - child->name, (ptrdiff_t)child->content, Entries[childNumber].Filename.c_str ()); + warning (true, "read", "XML In block (%s) line %p, no filename found for the .typ file.", + child->name, child->content); } } else if (stricmp (typeName, "Dfn") == 0) @@ -264,15 +264,15 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const if ((Entries[childNumber].Dfn == NULL) && !forceLoad) { // Throw exception - warning (true, "read", "XML In block (%s) line %d, file not found %s.", - child->name, (ptrdiff_t)child->content, Entries[childNumber].Filename.c_str ()); + warning (true, "read", "XML In block (%s) line %p, file not found %s.", + child->name, child->content, Entries[childNumber].Filename.c_str ()); } } else { // Throw exception - warning (true, "read", "XML In block (%s) line %d, no filename found for the .typ file.", - child->name, (ptrdiff_t)child->content, Entries[childNumber].Filename.c_str ()); + warning (true, "read", "XML In block (%s) line %p, no filename found for the .typ file.", + child->name, child->content); } } else if (stricmp (typeName, "DfnPointer") == 0) @@ -282,8 +282,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const else { // Throw exception - warning (true, "read", "XML Syntax error in block (%s) line %d, element has not a valid type name attribut \"Type = %s\".", - child->name, (ptrdiff_t)child->content, typeName); + warning (true, "read", "XML Syntax error in block (%s) line %p, element has not a valid type name attribut \"Type = %s\".", + child->name, child->content, typeName); } // Delete the value @@ -292,8 +292,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const else { // Throw exception - warning (true, "read", "XML Syntax error in block (%s) line %d, element has no type name attribut \"Type = [Type][Dfn][DfnPointer]\".", - child->name, (ptrdiff_t)child->content); + warning (true, "read", "XML Syntax error in block (%s) line %p, element has no type name attribut \"Type = [Type][Dfn][DfnPointer]\".", + child->name, child->content); } // Get the array attrib @@ -310,8 +310,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const else { // Throw exception - warning (true, "read", "XML Syntax error in block (%s) line %d, aguments Name not found.", - root->name, (ptrdiff_t)root->content); + warning (true, "read", "XML Syntax error in block (%s) line %p, aguments Name not found.", + root->name, root->content); } // Next child diff --git a/code/nel/src/georges/form_elm.cpp b/code/nel/src/georges/form_elm.cpp index a0ca4b505..528f6eec9 100644 --- a/code/nel/src/georges/form_elm.cpp +++ b/code/nel/src/georges/form_elm.cpp @@ -1904,8 +1904,8 @@ void CFormElmStruct::read (xmlNodePtr node, CFormLoader &loader, const CFormDfn else { // Make a warning message - warning (false, "read", "In block line %d, node (%s) type in DFN have changed.", - (ptrdiff_t)child->content, child->name); + warning (false, "read", "In block line %p, node (%s) type in DFN have changed.", + child->content, child->name); } } else @@ -1917,8 +1917,8 @@ void CFormElmStruct::read (xmlNodePtr node, CFormLoader &loader, const CFormDfn } // Throw exception - warning (true, "read", "XML Syntax error in block line %d, node (%s) name should be STRUCT, ATOM or ARRAY.", - (ptrdiff_t)child->content, child->name); + warning (true, "read", "XML Syntax error in block line %p, node (%s) name should be STRUCT, ATOM or ARRAY.", + child->content, child->name); } } @@ -2199,8 +2199,8 @@ void CFormElmVirtualStruct::read (xmlNodePtr node, CFormLoader &loader, CForm *f else { // Throw exception - warning (true, "read", "XML Syntax error in virtual struct in block line %d, should have a DfnName property.", - (ptrdiff_t)node->content, node->name); + warning (true, "read", "XML Syntax error in virtual struct in block line %p, should have a DfnName property.", + node->content); } // Read the parent diff --git a/code/nel/src/georges/header.cpp b/code/nel/src/georges/header.cpp index 8b2fa2c14..6a881d8b4 100644 --- a/code/nel/src/georges/header.cpp +++ b/code/nel/src/georges/header.cpp @@ -123,8 +123,8 @@ void CFileHeader::read (xmlNodePtr root) xmlFree ((void*)value); // Throw exception - warning (true, "read", "XML Syntax error in TYPE block line %d, the Version argument is invalid.", - (ptrdiff_t)root->content); + warning (true, "read", "XML Syntax error in TYPE block line %p, the Version argument is invalid.", + root->content); } // Delete the value @@ -173,8 +173,8 @@ void CFileHeader::read (xmlNodePtr root) xmlFree ((void*)value); // Throw exception - warning (true, "read", "XML Syntax error in TYPE block line %d, the State argument is invalid.", - (ptrdiff_t)root->content); + warning (true, "read", "XML Syntax error in TYPE block line %p, the State argument is invalid.", + root->content); } // Delete the value diff --git a/code/nel/src/georges/type.cpp b/code/nel/src/georges/type.cpp index 6b4a20c3a..3075efc79 100644 --- a/code/nel/src/georges/type.cpp +++ b/code/nel/src/georges/type.cpp @@ -110,8 +110,8 @@ void CType::read (xmlNodePtr root) if ( ((const char*)root->name == NULL) || (strcmp ((const char*)root->name, "TYPE") != 0) ) { // Throw exception - warning2 (true, "read", "XML Syntax error in block line %d, node (%s) should be TYPE.", - (ptrdiff_t)root->content, root->name); + warning2 (true, "read", "XML Syntax error in block line %p, node (%s) should be TYPE.", + root->content, root->name); } // Read the type @@ -138,8 +138,8 @@ void CType::read (xmlNodePtr root) xmlFree ((void*)value); // Throw exception - warning2 (true, "read", "XML Syntax error in TYPE block line %d, the Type value is unknown (%s).", - (ptrdiff_t)root->content, valueStr.c_str ()); + warning2 (true, "read", "XML Syntax error in TYPE block line %p, the Type value is unknown (%s).", + root->content, valueStr.c_str ()); } // Delete the value @@ -148,8 +148,8 @@ void CType::read (xmlNodePtr root) else { // Throw exception - warning2 (true, "read", "XML Syntax error in TYPE block line %d, the Type argument was not found.", - (ptrdiff_t)root->content); + warning2 (true, "read", "XML Syntax error in TYPE block line %p, the Type argument was not found.", + root->content); } // Read the UI @@ -256,8 +256,8 @@ void CType::read (xmlNodePtr root) xmlFree ((void*)label); // Throw exception - warning2 (true, "read", "XML Syntax error in DEFINITION block line %d, the Value argument was not found.", - (ptrdiff_t)childPtr->content); + warning2 (true, "read", "XML Syntax error in DEFINITION block line %p, the Value argument was not found.", + childPtr->content); } // Delete the value @@ -266,8 +266,8 @@ void CType::read (xmlNodePtr root) else { // Throw exception - warning2 (true, "read", "XML Syntax error in DEFINITION block line %d, the Label argument was not found.", - (ptrdiff_t)childPtr->content); + warning2 (true, "read", "XML Syntax error in DEFINITION block line %p, the Label argument was not found.", + childPtr->content); } // One more diff --git a/code/nel/src/ligo/ligo_config.cpp b/code/nel/src/ligo/ligo_config.cpp index 8d4b730f0..c61b03d03 100644 --- a/code/nel/src/ligo/ligo_config.cpp +++ b/code/nel/src/ligo/ligo_config.cpp @@ -530,7 +530,7 @@ void CLigoConfig::syntaxError (const char *filename, xmlNodePtr xmlNode, const c vsnprintf( buffer, 1024, format, args ); va_end( args ); - errorMessage ("(%s), node (%s), line (%d) :\n%s", filename, xmlNode->name, (ptrdiff_t)xmlNode->content, buffer); + errorMessage ("(%s), node (%s), line (%p) :\n%s", filename, xmlNode->name, xmlNode->content, buffer); } // *************************************************************************** diff --git a/code/nel/src/ligo/primitive.cpp b/code/nel/src/ligo/primitive.cpp index 4c1b3f9dd..ff8c71c18 100644 --- a/code/nel/src/ligo/primitive.cpp +++ b/code/nel/src/ligo/primitive.cpp @@ -59,7 +59,7 @@ void XMLError (xmlNodePtr xmlNode, const char *filename, const char *format, ... vsnprintf( buffer, 1024, format, args ); va_end( args ); - Error (filename, "node (%s), line (%d) : %s", xmlNode->name, (ptrdiff_t)xmlNode->content, buffer); + Error (filename, "node (%s), line (%p) : %s", xmlNode->name, xmlNode->content, buffer); } diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index 9284217d6..472e2cd35 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -734,10 +734,10 @@ public: str = ""; } char tmp[32]; - sprintf (tmp, "!0x%X", addr); + sprintf (tmp, "!0x%p", addr); str += tmp; //} - str +=" DEBUG:"+toString("0x%08X", addr); + str +=" DEBUG:"+toString("0x%p", addr); // @@ -925,7 +925,7 @@ public: if(*addr == NULL) sprintf (tmp, ""); else - sprintf (tmp, "0x%X", *addr); + sprintf (tmp, "0x%p", *addr); } } diff --git a/code/nel/src/misc/mem_displayer.cpp b/code/nel/src/misc/mem_displayer.cpp index f7220cb2a..f97da783c 100644 --- a/code/nel/src/misc/mem_displayer.cpp +++ b/code/nel/src/misc/mem_displayer.cpp @@ -97,7 +97,7 @@ static string getFuncInfo (DWORD_TYPE funcAddr, DWORD_TYPE stackAddr) if (stop==0 && (parse[i] == ',' || parse[i] == ')')) { char tmp[32]; - sprintf (tmp, "=0x%X", *((ULONG*)(stackAddr) + 2 + pos++)); + sprintf (tmp, "=0x%p", *((ULONG*)(stackAddr) + 2 + pos++)); str += tmp; } str += parse[i]; diff --git a/code/nel/tools/3d/object_viewer_qt/data/object_viewer.cfg b/code/nel/tools/3d/object_viewer_qt/data/object_viewer.cfg deleted file mode 100644 index ae0c72e4b..000000000 --- a/code/nel/tools/3d/object_viewer_qt/data/object_viewer.cfg +++ /dev/null @@ -1,29 +0,0 @@ -RootConfigFilename = "object_viewer_default.cfg"; -SearchPaths = { - "/mnt/disk_d/NEL3D/texture", "/mnt/disk_d/NEL3D/SFX/maps", "/mnt/disk_d/NEL3D/Database_proto/Stuff/fyros/agent/actors/_textures" -}; -GraphicsEnabled = 1; -SoundEnabled = 1; -GraphicsDriver = "OpenGL"; -SoundDriver = "OpenAL"; -SoundDevice = ""; -LanguageCode = "en"; -QtStyle = ""; -FontName = "andbasr.ttf"; -FontShadow = 1; -BackgroundColor = { - 98, 98, 98 -}; -FogStart = 0.0000000000; -FogEnd = 10.0000000000; -FogColor = { - 88, 88, 88 -}; -SoundAutoLoadSample = 1; -SoundMaxTrack = 48; -SoundEnableOccludeObstruct = 1; -SoundEnableReverb = 1; -SoundManualRolloff = 1; -SoundUseADPCM = 0; -SoundForceSoftware = 0; -CameraFocal = 75.0000000000; diff --git a/code/nel/tools/3d/object_viewer_qt/data/object_viewer_default.cfg b/code/nel/tools/3d/object_viewer_qt/data/object_viewer_default.cfg deleted file mode 100644 index 350001aeb..000000000 --- a/code/nel/tools/3d/object_viewer_qt/data/object_viewer_default.cfg +++ /dev/null @@ -1,156 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// Config file for Object Viewer Qt //////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -// -// This file is used to setup the Object Viewer tool. -// - - -////////////////////////////////////////////////////////////////////////////// -// NeL Qt //////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -// Root directory where we can find the client datas (zones, tiles, maps, ...) -// You must uncomment this line on GNU/Linux and comment the next one -//SearchPaths = { "/usr/local/share/games/nel_qt/" }; -SearchPaths = { "data" }; - -// Which extensions to remap to what if needed (pairs of 2) -RemapExtensions = { "png", "tga", "dds", "tga"}; - - -// The language code of the client -LanguageCode = "en"; - -// If changes to the config should be saved on exit -SaveConfig = 1; - - -////////////////////////////////////////////////////////////////////////////// -// Qt //////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -QtStyle = "Cleanlooks"; -QtPalette = 0; -QtWindowState = ""; -QtWindowGeometry = ""; - -////////////////////////////////////////////////////////////////////////////// -// Graphics ////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -// Use OpenGL or Direct3D (Windows) -GraphicsEnabled = 1; -GraphicsDrivers = { "OpenGL", "Direct3D" }; -GraphicsDriver = "OpenGL"; - -// Resolution of the screen -// ScreenWidth = 1360; -// ScreenHeight = 768; -// ScreenDepth = 32; - -// If 1, run in fullscreen mode, 0 for windowed -// Fullscreen = 0; - -// Font name used for all text in the client (it can be a .ttf, .fon, .pfb) -FontName = "andbasr.ttf"; -FontShadow = 1; - -// Background color -BackgroundColor = { 151, 156, 182 }; - -// Bloom effect -BloomEffect = 1; -BloomSquare = 1; -BloomDensity = 120; - -// Path where screenshots are saved -ScreenshotName = "nel_qt"; -ScreenshotJPG = 1; -ScreenshotPNG = 1; -ScreenshotTGA = 0; -ScreenshotPath = "screenshots"; - - -////////////////////////////////////////////////////////////////////////////// -// Environment /////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -CameraFocal = 75.0; - -SunDirection = { -2.935, +0.107, -1.22 }; -SunAmbient = { 190, 170, 150 }; -SunDiffuse = { 255, 248, 255 }; -SunSpecular = { 255, 255, 255}; - -// 1 if you want to see the fog -FogEnable = 1; -FogStart = 100.0; // in meter -FogEnd = 250.0; // in meter -FogColor = { 129, 136, 205 }; // { 147, 125, 114 }; - -///////////////////////////////////////////////////////////// -//// Vegetable Landscape Setup (for vegetable edition) ////// -///////////////////////////////////////////////////////////// - -VegetTileBank = ""; // this is optional, but obligatory for Vegetable Edit to work properly -VegetTileFarBank = ""; // this is optional, but obligatory for Vegetable Edit to work properly -VegetLandscapeZones = // this is optional, but obligatory for Vegetable Edit to work properly -{ -"WARNING: Delete this string" // NOT DELETE -}; - -VegetLandscapeThreshold = 0.01; // this is optional -VegetLandscapeTileNear = 50.0; // this is optional -VegetLandscapeAmbient = {17, 54, 100, 255} ; // this is optional -VegetLandscapeDiffuse = {241, 226, 244, 255} ; // this is optional -VegetLandscapeSnapHeight = 1.70; // this is optional -VegetLandscapeMultiply = 1.5; - -// veget setup -VegetTexture = ""; // this is optional, but important for Vegetable Edit to behave properly -VegetAmbient = {80, 80, 80}; // this is optional -VegetDiffuse = {255, 255, 255}; // this is optional. NB: works like veget_landscape_diffuse (ie maxLightFactor possible) -VegetLightDir = {0.0, 1.0, -1.0}; // this is optional -VegetWindDir = {1.0, 1.0, 0.0}; // this is optional -VegetWindFreq = 0.5; // this is optional -VegetWindPower = 5.0; // this is optional -VegetWindBendMin = 0.5; // this is optional - -////////////////////////////////////////////////////////////////////////////// -// Time ////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -FpsSmoothing = 64; - - -////////////////////////////////////////////////////////////////////////////// -// Sound ///////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -// The sound driver, choose between "Auto", "FMod", "DSound" and "OpenAl" -SoundEnabled = 1; -SoundDrivers = { "Auto", "OpenAL", "XAudio2", "FMod", "DSound" }; -SoundDriver = "OpenAL"; -SoundDevice = ""; -SoundMaxTrack = 48; -SoundEnableOccludeObstruct = 1; -SoundEnableReverb = 1; -SoundManualRolloff = 1; -SoundUseADPCM = 0; -SoundForceSoftware = 0; -SoundAutoLoadSample = 1; - -SoundPackedSheetPath = "/home/timon/sound"; -SoundSamplePath = "/home/timon/sound"; - -////////////////////////////////////////////////////////////////////////////// -// Interface ///////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -// Debug HUD ///////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -// end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h index 8b85d58a7..fc2e0736b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h @@ -71,7 +71,7 @@ public: virtual void extensionsInitialized() = 0; /** - @\brief Called during a shutdown sequence in the same order as initialization + @brief Called during a shutdown sequence in the same order as initialization before the plugins get deleted in reverse order. @details This method should be used to disconnect from other plugins, @@ -80,7 +80,7 @@ public: virtual void shutdown() { } /** - @\brief This method should be implemented to work properly NeL singletons. + @brief This method should be implemented to work properly NeL singletons. Called immediately after loading the plugin. @code void Plugin::setNelContext(NLMISC::INelContext *nelContext) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp index dbd738b28..4bd80a616 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp @@ -54,7 +54,7 @@ void MenuManager::registerAction(QAction *action, const QString &id) QMenu *MenuManager::menu(const QString &id) const { QMenu *result = 0; - if (_menuMap.count(id) == 0) + if (!_menuMap.contains(id)) nlwarning("QMenu %s not found", id.toStdString().c_str()); else result = _menuMap.value(id); @@ -64,7 +64,7 @@ QMenu *MenuManager::menu(const QString &id) const QAction *MenuManager::action(const QString &id) const { QAction *result = 0; - if (_actionMap.count(id) == 0) + if (!_actionMap.contains(id)) nlwarning("QAction %s not found", id.toStdString().c_str()); else result = _actionMap.value(id); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp index ead8451f0..7f85a17df 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp @@ -31,6 +31,8 @@ namespace Core { +QString lastDir = "."; + CSearchPathsSettingsPage::CSearchPathsSettingsPage(QObject *parent) : IOptionsPage(parent), m_page(0) @@ -104,13 +106,14 @@ void CSearchPathsSettingsPage::applySearchPaths() void CSearchPathsSettingsPage::addPath() { - QString newPath = QFileDialog::getExistingDirectory(m_page); + QString newPath = QFileDialog::getExistingDirectory(m_page, "", lastDir); if (!newPath.isEmpty()) { QListWidgetItem *newItem = new QListWidgetItem; newItem->setText(newPath); newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); m_ui.pathsListWidget->addItem(newItem); + lastDir = newPath; } checkEnabledButton(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.cpp deleted file mode 100644 index a8d50dfa8..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2010 by authors - * - * This file is part of NEL QT. - * NEL QT is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * NEL QT is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with NEL QT; see the file COPYING. If not, see - * . - */ - -#include "stdpch.h" -#include "callback.h" - -namespace NLQT -{ - -} /* namespace NLQT */ - -/* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.h deleted file mode 100644 index 85c4d1c6e..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.h +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright (C) 2010 by authors - * - * This file is part of NEL QT. - * NEL QT is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * NEL QT is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with NEL QT; see the file COPYING. If not, see - * . - */ - -#ifndef NLQT_CALLBACK_H -#define NLQT_CALLBACK_H -#include - -// STL includes - -// NeL includes -#ifdef NL_COMP_GCC -// temporary fix for GCC 4.4 segmentation fault -# undef nlassert -# define nlassert(x) -#else -# include -#endif // NL_COMP_GCC - -// Project includes - -namespace NLQT -{ - -#define NLQT_CALLBACK_TEMPLATE \ -/** \ - * \brief NLQT_CALLBACK_ARGS_CLASS \ - * \date 2009-03-03 18:09GMT \ - * \author Jan Boon (Kaetemi) \ - * Awesome callback template \ - */ \ -template \ -class NLQT_CALLBACK_ARGS_CLASS \ -{ \ - /* Very simple reference counting callback base */ \ - class CCallbackBase \ - { \ - public: \ - CCallbackBase() : m_RefCount(0) \ - { \ - \ - } \ - \ - virtual ~CCallbackBase() \ - { \ - nlassert(!m_RefCount); \ - } \ - \ - void refAdd() \ - { \ - ++m_RefCount; \ - } \ - \ - void refRemove() \ - { \ - --m_RefCount; \ - if (!m_RefCount) \ - delete this; \ - } \ - \ - virtual TReturn callback(NLQT_CALLBACK_ARGS_DECL) = 0; \ - \ - virtual bool equals(const CCallbackBase *callbackBase) = 0; \ - \ - /* disable copy */ \ - CCallbackBase(const CCallbackBase &); \ - CCallbackBase &operator=(const CCallbackBase &); \ - \ - private: \ - uint m_RefCount; \ - }; \ - \ - typedef TReturn TCallbackFunction(NLQT_CALLBACK_ARGS_DECL); \ - class CCallbackFunction : public CCallbackBase \ - { \ - public: \ - CCallbackFunction(TCallbackFunction *callbackFunction) : m_CallbackFunction(callbackFunction) \ - { \ - nlassert(m_CallbackFunction); \ - } \ - \ - virtual ~CCallbackFunction() \ - { \ - m_CallbackFunction = NULL; \ - } \ - \ - virtual TReturn callback(NLQT_CALLBACK_ARGS_DECL) \ - { \ - return m_CallbackFunction(NLQT_CALLBACK_ARGS_IMPL); \ - } \ - \ - virtual bool equals(const CCallbackBase *callbackBase) \ - { \ - const CCallbackFunction *callbackFunction = \ - dynamic_cast(callbackBase); \ - if (!callbackFunction) return false; \ - return m_CallbackFunction == callbackFunction->m_CallbackFunction; \ - } \ - \ - private: \ - TCallbackFunction *m_CallbackFunction; \ - }; \ - \ - template \ - class CCallbackMethod : public CCallbackBase \ - { \ - typedef TReturn (TClass::*TCallbackMethod)(NLQT_CALLBACK_ARGS_DECL); \ - public: \ - CCallbackMethod(TClass *callbackObject, TCallbackMethod callbackMethod) : m_CallbackObject(callbackObject), m_CallbackMethod(callbackMethod) \ - { \ - nlassert(m_CallbackObject); \ - nlassert(m_CallbackMethod); \ - } \ - \ - virtual ~CCallbackMethod() \ - { \ - m_CallbackObject = NULL; \ - m_CallbackMethod = NULL; \ - } \ - \ - virtual TReturn callback(NLQT_CALLBACK_ARGS_DECL) \ - { \ - return (m_CallbackObject->*m_CallbackMethod)(NLQT_CALLBACK_ARGS_IMPL); \ - } \ - \ - virtual bool equals(const CCallbackBase *callbackBase) \ - { \ - const CCallbackMethod *callbackMethod = \ - dynamic_cast(callbackBase); \ - if (!callbackMethod) return false; \ - return m_CallbackObject == callbackMethod->m_CallbackObject \ - && m_CallbackMethod == callbackMethod->m_CallbackMethod; \ - } \ - \ - private: \ - TClass *m_CallbackObject; \ - TCallbackMethod m_CallbackMethod; \ - }; \ - \ -public: \ - CCallback() : m_CallbackBase(NULL) \ - { \ - \ - } \ - \ - CCallback(TCallbackFunction *callbackFunction) : m_CallbackBase(new CCallbackFunction(callbackFunction)) \ - { \ - nlassert(m_CallbackBase); \ - m_CallbackBase->refAdd(); \ - } \ - \ - template \ - CCallback(TClass *callbackObject, TReturn (TClass::*callbackMethod)(NLQT_CALLBACK_ARGS_DECL)) : m_CallbackBase(new CCallbackMethod(callbackObject, callbackMethod)) \ - { \ - nlassert(m_CallbackBase); \ - m_CallbackBase->refAdd(); \ - } \ - \ - CCallback(const CCallback &callback) \ - { \ - m_CallbackBase = callback.m_CallbackBase; \ - if (m_CallbackBase) \ - m_CallbackBase->refAdd(); \ - } \ - \ - CCallback &operator=(const CCallback &callback) \ - { \ - if (m_CallbackBase != callback.m_CallbackBase) \ - { \ - if (m_CallbackBase) \ - m_CallbackBase->refRemove(); \ - m_CallbackBase = callback.m_CallbackBase; \ - if (m_CallbackBase) \ - m_CallbackBase->refAdd(); \ - } \ - return *this; \ - } \ - \ - ~CCallback() \ - { \ - if (m_CallbackBase) \ - { \ - m_CallbackBase->refRemove(); \ - m_CallbackBase = NULL; \ - } \ - } \ - \ - TReturn callback(NLQT_CALLBACK_ARGS_DECL) \ - { \ - nlassert(m_CallbackBase); \ - return m_CallbackBase->callback(NLQT_CALLBACK_ARGS_IMPL); \ - } \ - \ - TReturn operator()(NLQT_CALLBACK_ARGS_DECL) \ - { \ - nlassert(m_CallbackBase); \ - return m_CallbackBase->callback(NLQT_CALLBACK_ARGS_IMPL); \ - } \ - \ - bool valid() const \ - { \ - return m_CallbackBase != NULL; \ - } \ - \ - operator bool() const \ - { \ - return m_CallbackBase != NULL; \ - } \ - \ - bool operator==(const CCallback &callback) \ - { \ - return m_CallbackBase->equals(callback.m_CallbackBase); \ - } \ - \ -private: \ - CCallbackBase *m_CallbackBase; \ - \ -}; /* class CCallback */ \ - -template -class CCallback; - -#define NLQT_CALLBACK_ARGS_CLASS CCallback -#define NLQT_CALLBACK_ARGS_TYPENAME -#define NLQT_CALLBACK_ARGS_DECL -#define NLQT_CALLBACK_ARGS_IMPL -NLQT_CALLBACK_TEMPLATE -#undef NLQT_CALLBACK_ARGS_CLASS -#undef NLQT_CALLBACK_ARGS_TYPENAME -#undef NLQT_CALLBACK_ARGS_DECL -#undef NLQT_CALLBACK_ARGS_IMPL - -#define NLQT_CALLBACK_ARGS_CLASS CCallback -#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA -#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA -#define NLQT_CALLBACK_ARGS_IMPL argsA -NLQT_CALLBACK_TEMPLATE -#undef NLQT_CALLBACK_ARGS_CLASS -#undef NLQT_CALLBACK_ARGS_TYPENAME -#undef NLQT_CALLBACK_ARGS_DECL -#undef NLQT_CALLBACK_ARGS_IMPL - -#define NLQT_CALLBACK_ARGS_CLASS CCallback -#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB -#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB -#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB -NLQT_CALLBACK_TEMPLATE -#undef NLQT_CALLBACK_ARGS_CLASS -#undef NLQT_CALLBACK_ARGS_TYPENAME -#undef NLQT_CALLBACK_ARGS_DECL -#undef NLQT_CALLBACK_ARGS_IMPL - -#define NLQT_CALLBACK_ARGS_CLASS CCallback -#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC -#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC -#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC -NLQT_CALLBACK_TEMPLATE -#undef NLQT_CALLBACK_ARGS_CLASS -#undef NLQT_CALLBACK_ARGS_TYPENAME -#undef NLQT_CALLBACK_ARGS_DECL -#undef NLQT_CALLBACK_ARGS_IMPL - -#define NLQT_CALLBACK_ARGS_CLASS CCallback -#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD -#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD -#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD -NLQT_CALLBACK_TEMPLATE -#undef NLQT_CALLBACK_ARGS_CLASS -#undef NLQT_CALLBACK_ARGS_TYPENAME -#undef NLQT_CALLBACK_ARGS_DECL -#undef NLQT_CALLBACK_ARGS_IMPL - -#define NLQT_CALLBACK_ARGS_CLASS CCallback -#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE -#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE -#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE -NLQT_CALLBACK_TEMPLATE -#undef NLQT_CALLBACK_ARGS_CLASS -#undef NLQT_CALLBACK_ARGS_TYPENAME -#undef NLQT_CALLBACK_ARGS_DECL -#undef NLQT_CALLBACK_ARGS_IMPL - -#define NLQT_CALLBACK_ARGS_CLASS CCallback -#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF -#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF -#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF -NLQT_CALLBACK_TEMPLATE -#undef NLQT_CALLBACK_ARGS_CLASS -#undef NLQT_CALLBACK_ARGS_TYPENAME -#undef NLQT_CALLBACK_ARGS_DECL -#undef NLQT_CALLBACK_ARGS_IMPL - -#define NLQT_CALLBACK_ARGS_CLASS CCallback -#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF, typename TArgsG -#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF, TArgsG argsG -#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF, argsG -NLQT_CALLBACK_TEMPLATE -#undef NLQT_CALLBACK_ARGS_CLASS -#undef NLQT_CALLBACK_ARGS_TYPENAME -#undef NLQT_CALLBACK_ARGS_DECL -#undef NLQT_CALLBACK_ARGS_IMPL -#undef NLQT_CALLBACK_ARGS_CLASSNAME - -#undef NLQT_CALLBACK_TEMPLATE - -typedef CCallback CEmptyCallback; - -} /* namespace NLQT */ - -#endif /* #ifndef NLQT_CALLBACK_H */ - -/* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.cpp deleted file mode 100644 index 8fd118252..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/* - Object Viewer Qt - Copyright (C) 2010 Dzmitry Kamiahin - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -*/ - -#include "stdpch.h" -#include "configuration.h" - -// NeL includes -#include -#include -#include -#include - -#include "modules.h" - -using namespace std; -using namespace NLMISC; - -namespace NLQT -{ - -CConfiguration::CConfiguration() -{ - -} - -CConfiguration::~CConfiguration() -{ - -} - -void CConfiguration::init() -{ - nldebug("CConfiguration::init"); - - // verify data - nlassert(!ConfigCallbacks.size()); - - // load config - try - { - ConfigFile.load(NLQT_CONFIG_FILE); - } - catch(...) - { - nlerror("Error opening files object_viewer.cfg or object_viewer_default.cfg. Check this files"); - } - // setup config file callback - Modules::config().setCallback("SearchPaths", CConfigCallback(this, &CConfiguration::cfcbSearchPaths)); - -} - -void CConfiguration::release() -{ - nldebug("CConfiguration::release"); - - Modules::config().dropCallback("SearchPaths"); - - // save and release the config file - if (ConfigFile.exists("SaveConfig") && ConfigFile.getVarPtr("SaveConfig")->asBool()) - { - ConfigFile.save(); - } - ConfigFile.clear(); - - // release the search paths etc - CPath::releaseInstance(); - - // verify data - nlassert(!ConfigCallbacks.size()); -} - -void CConfiguration::updateUtilities() -{ - //H_AUTO2 - CConfigFile::checkConfigFiles(); -} - -void CConfiguration::configSearchPaths() -{ - cfcbSearchPaths(Modules::config().getConfigFile().getVar("SearchPaths")); -} - -void CConfiguration::configRemapExtensions() -{ - CConfigFile::CVar *var; - var = ConfigFile.getVarPtr("RemapExtensions"); - uint varsize = var->size(); - for (uint i = 0; i < varsize; i += 2) - CPath::remapExtension(var->asString(i), var->asString(i + 1), true); -} - -void CConfiguration::setAndCallback(const std::string &varName, CConfigCallback configCallback) -{ - ConfigCallbacks[varName] = configCallback; - ConfigFile.setCallback(varName, cbConfigCallback); - configCallback(*ConfigFile.getVarPtr(varName)); -} - -void CConfiguration::setCallback(const std::string &varName, CConfigCallback configCallback) -{ - ConfigCallbacks[varName] = configCallback; - ConfigFile.setCallback(varName, cbConfigCallback); -} - -void CConfiguration::dropCallback(const std::string &varName) -{ - ConfigFile.setCallback(varName, NULL); - ConfigCallbacks.erase(varName); -} - -float CConfiguration::getValue(const string &varName, float defaultValue) -{ - if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asFloat(); - CConfigFile::CVar varToCopy; - varToCopy.forceAsDouble((double)defaultValue); - ConfigFile.insertVar(varName, varToCopy); - return defaultValue; -} - -double CConfiguration::getValue(const string &varName, double defaultValue) -{ - if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asDouble(); - CConfigFile::CVar varToCopy; - varToCopy.forceAsDouble(defaultValue); - ConfigFile.insertVar(varName, varToCopy); - return defaultValue; -} - -int CConfiguration::getValue(const string &varName, int defaultValue) -{ - if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asInt(); - CConfigFile::CVar varToCopy; - varToCopy.forceAsInt(defaultValue); - ConfigFile.insertVar(varName, varToCopy); - return defaultValue; -} - -string CConfiguration::getValue(const string &varName, const string &defaultValue) -{ - if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asString(); - CConfigFile::CVar varToCopy; - varToCopy.forceAsString(defaultValue); - ConfigFile.insertVar(varName, varToCopy); - return defaultValue; -} - -ucstring CConfiguration::getValue(const string &varName, const ucstring &defaultValue) -{ - if (ConfigFile.exists(varName)) return ucstring::makeFromUtf8(ConfigFile.getVar(varName).asString()); - CConfigFile::CVar varToCopy; - varToCopy.forceAsString(defaultValue.toUtf8()); - ConfigFile.insertVar(varName, varToCopy); - return defaultValue; -} - -bool CConfiguration::getValue(const string &varName, bool defaultValue) -{ - if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asBool(); - CConfigFile::CVar varToCopy; - varToCopy.forceAsInt(defaultValue ? 1 : 0); - ConfigFile.insertVar(varName, varToCopy); - return defaultValue; -} - -CRGBA CConfiguration::getValue(const string &varName, const CRGBA &defaultValue) -{ - if (ConfigFile.exists(varName)) - { - return getValue(ConfigFile.getVar(varName), defaultValue); - } - else - { - // create a new value only if one doesn't exist - CConfigFile::CVar varToCopy; - varToCopy.forceAsInt(defaultValue.R); - varToCopy.setAsInt(defaultValue.G, 1); - varToCopy.setAsInt(defaultValue.B, 2); - varToCopy.setAsInt(defaultValue.A, 3); - ConfigFile.insertVar(varName, varToCopy); - } - return defaultValue; -} - -CRGBA CConfiguration::getValue(const CConfigFile::CVar &var, const CRGBA &defaultValue) -{ - if (var.size() >= 3) - { - if (var.size() > 4) - nlwarning("RGBA value in config value '%s' is too long, ignoring unused values"); - return CRGBA((uint8)var.asInt(0), (uint8)var.asInt(1), (uint8)var.asInt(2), var.size() >= 4 ? (uint8)var.asInt(3) : 255); - } - nlwarning("Invalid RGBA value in config value '%s', reverting to default { %i, %i, %i, %i }", var.Name.c_str(), (sint)defaultValue.R, (sint)defaultValue.G, (sint)defaultValue.B, (sint)defaultValue.A); - return defaultValue; -} - -void CConfiguration::cbConfigCallback(NLMISC::CConfigFile::CVar &var) -{ - Modules::config().ConfigCallbacks[var.Name](var); -} - -void CConfiguration::cfcbSearchPaths(NLMISC::CConfigFile::CVar &var) -{ - uint varsize = var.size(); - for (uint i = 0; i < varsize; ++i) - CPath::addSearchPath(var.asString(i), false, false); -} - -} /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.h deleted file mode 100644 index 985bc6630..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - Object Viewer Qt - Copyright (C) 2010 Dzmitry Kamiahin - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -*/ - -#ifndef CONFIGURATION_H -#define CONFIGURATION_H - -#include - -// STL includes -#include - -// NeL includes -#include -#include -#include - -// Project includes -#include "callback.h" - -#define NLQT_CONFIG_FILE "object_viewer.cfg" - -namespace NLQT -{ - -typedef CCallback CConfigCallback; - -/** -@class CConfiguration -@date 2010-02-05 15:44GMT -@author Jan Boon (Kaetemi) -@brief Read / write settings from the configuration file -@details Load the configuration file, and then read/write settings. -As well as automatic reading of the search paths and their sets. -*/ -class CConfiguration -{ -public: - CConfiguration(); - virtual ~CConfiguration(); - - void init(); - void release(); - - void updateUtilities(); - void configSearchPaths(); - void configRemapExtensions(); - - void setAndCallback(const std::string &varName, CConfigCallback configCallback); - void setCallback(const std::string &varName, CConfigCallback configCallback); - void dropCallback(const std::string &varName); - - float getValue(const std::string &varName, float defaultValue); - double getValue(const std::string &varName, double defaultValue); - int getValue(const std::string &varName, int defaultValue); - std::string getValue(const std::string &varName, const std::string &defaultValue); - ucstring getValue(const std::string &varName, const ucstring &defaultValue); - bool getValue(const std::string &varName, bool defaultValue); - NLMISC::CRGBA getValue(const std::string &varName, const NLMISC::CRGBA &defaultValue); - NLMISC::CRGBA getValue(const NLMISC::CConfigFile::CVar &var, const NLMISC::CRGBA &defaultValue); - - inline NLMISC::CConfigFile &getConfigFile() - { - return ConfigFile; - } - -private: - static void cbConfigCallback(NLMISC::CConfigFile::CVar &var); - - void cfcbSearchPaths(NLMISC::CConfigFile::CVar &var); - - CConfiguration(const CConfiguration &); - CConfiguration &operator=(const CConfiguration &); - - NLMISC::CConfigFile ConfigFile; - std::map ConfigCallbacks; - -};/* class CConfiguration */ - -} /* namespace NLQT */ - -#endif // CONFIGURATION_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp index 72ee5ee32..f541d850b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/entity.cpp @@ -391,6 +391,7 @@ void CEntity::animatePlayList(NL3D::TAnimationTime time) // If a skeleton model if(!_Skeleton.empty()) { + _Skeleton.setTransformMode(NL3D::UTransformable::RotQuat); // scale animated pos value with the CFG scale pos *= _CharacterScalePos; _Skeleton.setPos(pos); @@ -398,6 +399,7 @@ void CEntity::animatePlayList(NL3D::TAnimationTime time) } else { + _Instance.setTransformMode(NL3D::UTransformable::RotQuat); _Instance.setPos(pos); _Instance.setRotQuat(current.getRot()); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp index a495f866a..4e11ee15c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp @@ -18,9 +18,12 @@ // Project includes #include "stdpch.h" #include "graphics_settings_page.h" +#include "object_viewer_constants.h" +#include "../core/icore.h" #include "modules.h" // Qt includes +#include #include #include #include @@ -49,7 +52,7 @@ QString GraphicsSettingsPage::trName() const QString GraphicsSettingsPage::category() const { - return QLatin1String("ObjectViewer"); + return QLatin1String(Constants::OBJECT_VIEWER_SECTION); } QString GraphicsSettingsPage::trCategory() const @@ -62,13 +65,22 @@ QWidget *GraphicsSettingsPage::createPage(QWidget *parent) m_page = new QWidget(parent); m_ui.setupUi(m_page); - Modules::config().setAndCallback("GraphicsDrivers", CConfigCallback(this, &GraphicsSettingsPage::cfcbGraphicsDrivers)); - m_ui.enableBloomCheckBox->setChecked(Modules::objView().getBloomEffect()); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + + QString graphicsDriver = settings->value(Constants::GRAPHICS_DRIVER, "OpenGL").toString(); + m_ui.driverGraphComboBox->setCurrentIndex(m_ui.driverGraphComboBox->findText(graphicsDriver)); + + m_ui.enableBloomCheckBox->setChecked(settings->value(Constants::ENABLE_BLOOM, false).toBool()); m_ui.squareBloomCheckBox->setChecked(NL3D::CBloomEffect::instance().getSquareBloom()); m_ui.bloomDensityHorizontalSlider->setValue(NL3D::CBloomEffect::instance().getDensityBloom()); + m_ui.styleComboBox->addItems(QStyleFactory::keys()); - m_ui.styleComboBox->setCurrentIndex(m_ui.styleComboBox->findText(Modules::config().getValue("QtStyle", std::string("")).c_str())); - m_ui.paletteCheckBox->setChecked(Modules::config().getValue("QtPalette", false)); + QString style = settings->value(Constants::QT_STYLE, "").toString(); + m_ui.styleComboBox->setCurrentIndex(m_ui.styleComboBox->findText(style)); + m_ui.paletteCheckBox->setChecked(settings->value(Constants::QT_PALETTE, true).toBool()); + + settings->endGroup(); connect(m_ui.enableBloomCheckBox, SIGNAL(toggled(bool)), this, SLOT(setEnableBloom(bool))); connect(m_ui.squareBloomCheckBox, SIGNAL(toggled(bool)), this, SLOT(setEnableSquareBloon(bool))); @@ -82,16 +94,19 @@ QWidget *GraphicsSettingsPage::createPage(QWidget *parent) void GraphicsSettingsPage::apply() { - // save graphics settings to config file - Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString(m_ui.driverGraphComboBox->currentText().toStdString()); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - Modules::config().getConfigFile().getVar("BloomEffect").setAsInt(m_ui.enableBloomCheckBox->isChecked()); - Modules::config().getConfigFile().getVar("BloomSquare").setAsInt(m_ui.squareBloomCheckBox->isChecked()); - Modules::config().getConfigFile().getVar("BloomDensity").setAsInt(m_ui.bloomDensityHorizontalSlider->value()); + settings->setValue(Constants::GRAPHICS_DRIVER, m_ui.driverGraphComboBox->currentText()); - Modules::config().getConfigFile().getVar("QtStyle").setAsString(m_ui.styleComboBox->currentText().toStdString()); - Modules::config().getConfigFile().getVar("QtPalette").setAsInt(m_ui.paletteCheckBox->isChecked()); + // save settings + settings->setValue(Constants::ENABLE_BLOOM, m_ui.enableBloomCheckBox->isChecked()); + settings->setValue(Constants::ENABLE_SQUARE_BLOOM, m_ui.squareBloomCheckBox->isChecked()); + settings->setValue(Constants::BLOOM_DENSITY, m_ui.bloomDensityHorizontalSlider->value()); + settings->setValue(Constants::QT_STYLE, m_ui.styleComboBox->currentText()); + settings->setValue(Constants::QT_PALETTE, m_ui.paletteCheckBox->isChecked()); + // apply qt style and palette QApplication::setStyle(QStyleFactory::create(m_ui.styleComboBox->currentText())); if (m_ui.paletteCheckBox->isChecked()) @@ -99,12 +114,12 @@ void GraphicsSettingsPage::apply() else QApplication::setPalette(Modules::mainWin().getOriginalPalette()); - // save config file - Modules::config().getConfigFile().save(); + settings->endGroup(); + settings->sync(); } + void GraphicsSettingsPage::finish() { - Modules::config().dropCallback("GraphicsDrivers"); } void GraphicsSettingsPage::setEnableBloom(bool state) @@ -122,26 +137,4 @@ void GraphicsSettingsPage::setDensityBloom(int density) NL3D::CBloomEffect::instance().setDensityBloom(density); } -void GraphicsSettingsPage::cfcbGraphicsDrivers(NLMISC::CConfigFile::CVar &var) -{ - while (m_ui.driverGraphComboBox->count()) - m_ui.driverGraphComboBox->removeItem(0); - - // load types graphics driver from the config file - for (uint i = 0; i < var.size(); ++i) - m_ui.driverGraphComboBox->addItem(var.asString(i).c_str()); - - // set graphics driver from the config file - QString value = Modules::config().getValue("GraphicsDriver", std::string("OpenGL")).c_str(); - QString dn = value.toLower(); - for (sint i = 0; i < m_ui.driverGraphComboBox->count(); ++i) - { - if (dn == m_ui.driverGraphComboBox->itemText(i).toLower()) - { - m_ui.driverGraphComboBox->setCurrentIndex(i); - return; - } - } -} - } /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h index 2eeadb3b0..e1402939f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h @@ -24,8 +24,6 @@ #include -#include - class QWidget; namespace NLQT @@ -55,8 +53,6 @@ private Q_SLOTS: void setDensityBloom(int density); private: - void cfcbGraphicsDrivers(NLMISC::CConfigFile::CVar &var); - QWidget *m_page; Ui::GraphicsSettingsPage m_ui; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui index b804b36c8..24058d3d3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui @@ -6,129 +6,21 @@ 0 0 - 540 - 326 + 274 + 277 Form - - + + 6 - - 6 - - - 6 - - - 0 - 3 - - - - Qt::Vertical - - - - 20 - 283 - - - - - - - - Qt Style - - - - - - - - Style - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - Use style's standard palette - - - - - - - - - - Graphics settings - - - - - - - - Driver - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - - - - - - + Bloom effect @@ -172,6 +64,142 @@ + + + + Graphics settings + + + + + + + + Driver + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + OpenGL + + + + + Direct3D + + + + + + + + + + + + + Qt Style + + + + + + + + Style + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Use style's standard palette + + + + + + + + + + false + + + Font + + + + + + + false + + + + + + + false + + + ... + + + + + + + Qt::Vertical + + + + 20 + 283 + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp index 52c2de83f..efb6d2a9e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp @@ -49,6 +49,7 @@ #include "tune_mrm_dialog.h" #include "tune_timer_dialog.h" #include "camera_control.h" +#include "object_viewer_constants.h" #include "../core/icore.h" #include "../core/imenu_manager.h" @@ -79,11 +80,18 @@ CMainWindow::CMainWindow(QWidget *parent) setDockNestingEnabled(true); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + // setup Qt style and palette from config file _originalPalette = QApplication::palette(); - Modules::config().setAndCallback("QtStyle", CConfigCallback(this, &CMainWindow::cfcbQtStyle)); - Modules::config().setAndCallback("QtPalette", CConfigCallback(this, &CMainWindow::cfcbQtPalette)); - Modules::config().setAndCallback("SoundEnabled", CConfigCallback(this, &CMainWindow::cfcbSoundEnabled)); + + QApplication::setStyle(QStyleFactory::create(settings->value(Constants::QT_STYLE, "").toString())); + + if (settings->value(Constants::QT_PALETTE, true).toBool()) + QApplication::setPalette(QApplication::style()->standardPalette()); + else + QApplication::setPalette(_originalPalette); _GraphicsViewport->init(); _isGraphicsInitialized = true; @@ -103,18 +111,16 @@ CMainWindow::CMainWindow(QWidget *parent) setWindowIcon(QIcon(":/images/nel.png")); - QSettings settings("object_viewer_qt.ini", QSettings::IniFormat); - settings.beginGroup("WindowSettings"); - restoreState(settings.value("QtWindowState").toByteArray()); - restoreGeometry(settings.value("QtWindowGeometry").toByteArray()); - settings.endGroup(); + restoreState(settings->value("QtWindowState").toByteArray()); + restoreGeometry(settings->value("QtWindowGeometry").toByteArray()); // As a special case, a QTimer with a timeout of 0 will time out as soon as all the events in the window system's event queue have been processed. // This can be used to do heavy work while providing a snappy user interface. _mainTimer = new QTimer(this); connect(_mainTimer, SIGNAL(timeout()), this, SLOT(updateRender())); connect(_TuneTimerDialog, SIGNAL(changeInterval(int)), this, SLOT(setInterval(int))); - _TuneTimerDialog->setInterval(settings.value("TimerInterval", 25).toInt()); + _TuneTimerDialog->setInterval(settings->value("TimerInterval", 25).toInt()); + settings->endGroup(); _statusBarTimer = new QTimer(this); connect(_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar())); @@ -129,16 +135,13 @@ CMainWindow::~CMainWindow() nldebug("CMainWindow::~CMainWindow:"); // save state & geometry of window and widgets - QSettings settings("object_viewer_qt.ini", QSettings::IniFormat); - settings.beginGroup("WindowSettings"); - settings.setValue("QtWindowState", saveState()); - settings.setValue("QtWindowGeometry", saveGeometry()); - settings.endGroup(); - settings.setValue("TimerInterval", _mainTimer->interval()); - - Modules::config().dropCallback("SoundEnabled"); - Modules::config().dropCallback("QtPalette"); - Modules::config().dropCallback("QtStyle"); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + settings->setValue("QtWindowState", saveState()); + settings->setValue("QtWindowGeometry", saveGeometry()); + settings->setValue("TimerInterval", _mainTimer->interval()); + settings->endGroup(); + settings->sync(); delete _AnimationDialog; delete _AnimationSetDialog; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp index 76504eb27..76afed779 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp @@ -20,7 +20,6 @@ #include "stdpch.h" #include "modules.h" -NLQT::CConfiguration *Modules::_configuration = NULL; NLQT::CObjectViewer *Modules::_objectViewer = NULL; NLQT::CMainWindow *Modules::_mainWindow = NULL; NLQT::CParticleEditor *Modules::_particleEditor = NULL; @@ -29,9 +28,6 @@ NLQT::CVegetableEditor *Modules::_vegetableEditor = NULL; void Modules::init() { - if (_configuration == NULL) _configuration = new NLQT::CConfiguration; - config().init(); - if (_objectViewer == NULL) _objectViewer = new NLQT::CObjectViewer; if (_soundSystem == NULL) _soundSystem = new NLQT::CSoundSystem; if (_particleEditor == NULL) _particleEditor = new NLQT::CParticleEditor; @@ -51,8 +47,4 @@ void Modules::release() _soundSystem = NULL; delete _objectViewer; _objectViewer = NULL; - - config().release(); - delete _configuration; - _configuration = NULL; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.h index 4b2394b77..682f7a186 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.h @@ -20,7 +20,6 @@ #ifndef MODULES_H #define MODULES_H -#include "configuration.h" #include "object_viewer.h" #include "particle_editor.h" #include "main_window.h" @@ -37,10 +36,6 @@ public: static void init(); static void release(); - static NLQT::CConfiguration &config() - { - return *_configuration; - } static NLQT::CObjectViewer &objView() { return *_objectViewer; @@ -63,7 +58,6 @@ public: } private: - static NLQT::CConfiguration *_configuration; static NLQT::CObjectViewer *_objectViewer; static NLQT::CMainWindow *_mainWindow; static NLQT::CParticleEditor *_particleEditor; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp index 07882f14a..dc248e563 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp @@ -16,11 +16,15 @@ along with this program. If not, see . */ - +// Project includes +#include "modules.h" #include "stdpch.h" #include "object_viewer.h" +#include "object_viewer_constants.h" +#include "../core/icore.h" -// STL includes +// Qt includes +#include // NeL includes #include @@ -45,14 +49,6 @@ #include #include -// Project includes -#include "modules.h" -#include "configuration.h" - -using namespace std; -using namespace NLMISC; -using namespace NL3D; - namespace NLQT { @@ -66,11 +62,12 @@ CObjectViewer::CObjectViewer() _CurrentInstance(""), _BloomEffect(false) { - + loadConfig(); } CObjectViewer::~CObjectViewer() { + saveConfig(); } void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h) @@ -78,12 +75,10 @@ void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h) //H_AUTO2 nldebug("CObjectViewert::init"); - loadConfig(); - // create the driver nlassert(!_Driver); - _Driver = UDriver::createDriver(0, _Direct3D, 0); + _Driver = NL3D::UDriver::createDriver(0, _Direct3D, 0); nlassert(_Driver); // initialize the window with config file values @@ -95,16 +90,16 @@ void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h) _Driver->enableUsedTextureMemorySum(); - _Light = ULight::createLight(); + _Light = NL3D::ULight::createLight(); // set mode of the light - _Light->setMode(ULight::DirectionalLight); + _Light->setMode(NL3D::ULight::DirectionalLight); // set position of the light - _Light->setPosition(CVector(-20.f, 30.f, 10.f)); + _Light->setPosition(NLMISC::CVector(-20.f, 30.f, 10.f)); // white light - _Light->setAmbiant(CRGBA(255, 255, 255)); + _Light->setAmbiant(NLMISC::CRGBA(255, 255, 255)); // set and enable the light _Driver->setLight(0, *_Light); @@ -117,7 +112,7 @@ void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h) NLMISC::CVector hotSpot=NLMISC::CVector(0,0,0); _MouseListener = _Driver->create3dMouseListener(); - _MouseListener->setMouseMode(U3dMouseListener::edit3d); + _MouseListener->setMouseMode(NL3D::U3dMouseListener::edit3d); // set the cache size for the font manager(in bytes) _Driver->setFontManagerMaxMemory(2097152); @@ -130,8 +125,8 @@ void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h) NL3D::CBloomEffect::instance().setDriver(_Driver); NL3D::CBloomEffect::instance().setScene(_Scene); NL3D::CBloomEffect::instance().init(!_Direct3D); - NL3D::CBloomEffect::instance().setDensityBloom(Modules::config().getConfigFile().getVar("BloomDensity").asInt()); - NL3D::CBloomEffect::instance().setSquareBloom(Modules::config().getConfigFile().getVar("BloomSquare").asBool()); + NL3D::CBloomEffect::instance().setDensityBloom(uint8(_BloomDensity)); + NL3D::CBloomEffect::instance().setSquareBloom(_BloomSquare); NL3D::CDriverUser *driver = dynamic_cast(Modules::objView().getDriver()); _IDriver = driver->getDriver(); @@ -145,8 +140,6 @@ void CObjectViewer::release() //H_AUTO2 nldebug("CObjectViewer::release"); - saveConfig(); - // release text context nlassert(_TextContext); _Driver->deleteTextContext(_TextContext); @@ -232,7 +225,7 @@ void CObjectViewer::reloadTextures() int tex; for (tex = 0; tex < NL3D::IDRV_MAT_MAXTEXTURES; tex++) { - ITexture *texture = material->getTexture(tex); + NL3D::ITexture *texture = material->getTexture(tex); // Touch it! if (texture) @@ -250,30 +243,30 @@ void CObjectViewer::saveScreenshot(const std::string &nameFile, bool jpg, bool p // FIXME: create screenshot path if it doesn't exist! // empty bitmap - CBitmap bitmap; + NLMISC::CBitmap bitmap; // copy the driver buffer to the bitmap _Driver->getBuffer(bitmap); // create the file name - string filename = std::string("./") + nameFile; + std::string filename = std::string("./") + nameFile; // write the bitmap as a jpg, png or tga to the file if (jpg) { - string newfilename = CFile::findNewFile(filename + ".jpg"); - COFile outputFile(newfilename); + std::string newfilename = NLMISC::CFile::findNewFile(filename + ".jpg"); + NLMISC::COFile outputFile(newfilename); bitmap.writeJPG(outputFile, 100); nlinfo("Screenshot '%s' saved", newfilename.c_str()); } if (png) { - string newfilename = CFile::findNewFile(filename + ".png"); - COFile outputFile(newfilename); + std::string newfilename = NLMISC::CFile::findNewFile(filename + ".png"); + NLMISC::COFile outputFile(newfilename); bitmap.writePNG(outputFile, 24); nlinfo("Screenshot '%s' saved", newfilename.c_str()); } if (tga) { - string newfilename = CFile::findNewFile(filename + ".tga"); - COFile outputFile(newfilename); + std::string newfilename = NLMISC::CFile::findNewFile(filename + ".tga"); + NLMISC::COFile outputFile(newfilename); bitmap.writeTGA(outputFile, 24, false); nlinfo("Screenshot '%s' saved", newfilename.c_str()); } @@ -281,25 +274,25 @@ void CObjectViewer::saveScreenshot(const std::string &nameFile, bool jpg, bool p bool CObjectViewer::loadMesh(const std::string &meshFileName, const std::string &skelFileName) { - std::string fileName = CFile::getFilenameWithoutExtension(meshFileName); + std::string fileName = NLMISC::CFile::getFilenameWithoutExtension(meshFileName); if (_Entities.count(fileName) != 0) return false; - CPath::addSearchPath(CFile::getPath(meshFileName), false, false); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(meshFileName), false, false); // create instance of the mesh character - UInstance Entity = _Scene->createInstance(meshFileName); + NL3D::UInstance Entity = _Scene->createInstance(meshFileName); // if we can't create entity, skip it if (Entity.empty()) return false; - CAABBox bbox; + NLMISC::CAABBox bbox; Entity.getShapeAABBox(bbox); setCamera(bbox , Entity, true); _MouseListener->setMatrix(_Scene->getCam().getMatrix()); - USkeleton Skeleton = _Scene->createSkeleton(skelFileName); + NL3D::USkeleton Skeleton = _Scene->createSkeleton(skelFileName); // TODO: remade at typedef std::map CEntities; EIT eit = (_Entities.insert (make_pair (fileName, CEntity()))).first; @@ -322,8 +315,8 @@ bool CObjectViewer::loadMesh(const std::string &meshFileName, const std::string bool CObjectViewer::loadInstanceGroup(const std::string &igName) { - CPath::addSearchPath (CFile::getPath(igName)); - UInstanceGroup *ig = UInstanceGroup::createInstanceGroup(igName); + NLMISC::CPath::addSearchPath (NLMISC::CFile::getPath(igName)); + NL3D::UInstanceGroup *ig = NL3D::UInstanceGroup::createInstanceGroup(igName); if (ig == 0) return false; ig->addToScene(*_Scene, _Driver); @@ -334,8 +327,8 @@ bool CObjectViewer::loadInstanceGroup(const std::string &igName) void CObjectViewer::setCamera(NLMISC::CAABBox &bbox, NL3D::UTransform &entity, bool high_z) { - CVector pos(0.f, 0.f, 0.f); - CQuat quat(0.f, 0.f, 0.f, 0.f); + NLMISC::CVector pos(0.f, 0.f, 0.f); + NLMISC::CQuat quat(0.f, 0.f, 0.f, 0.f); NL3D::UInstance inst; inst.cast(entity); if (!inst.empty()) @@ -346,28 +339,28 @@ void CObjectViewer::setCamera(NLMISC::CAABBox &bbox, NL3D::UTransform &entity, b // fix scale (some shapes have a different value) entity.setScale(1.f, 1.f, 1.f); - UCamera Camera = _Scene->getCam(); - CVector max_radius = bbox.getHalfSize(); - CVector center = bbox.getCenter(); + NL3D::UCamera Camera = _Scene->getCam(); + NLMISC::CVector max_radius = bbox.getHalfSize(); + NLMISC::CVector center = bbox.getCenter(); entity.setPivot(center); center += pos; - float fov = float(_CameraFocal * (float)Pi/180.0); - float radius = max(max(max_radius.x, max_radius.y), max_radius.z); + float fov = float(_CameraFocal * (float)NLMISC::Pi/180.0); + float radius = std::max(std::max(max_radius.x, max_radius.y), max_radius.z); if (radius == 0.f) radius = 1.f; float left, right, bottom, top, znear, zfar; Camera.getFrustum(left, right, bottom, top, znear, zfar); float dist = radius / (tan(fov/2)); - CVector eye(center); + NLMISC::CVector eye(center); - CVector ax(quat.getAxis()); + NLMISC::CVector ax(quat.getAxis()); - if (ax.isNull() || ax == CVector::I) + if (ax.isNull() || ax == NLMISC::CVector::I) { - ax = CVector::J; + ax = NLMISC::CVector::J; } - else if (ax == -CVector::K) + else if (ax == -NLMISC::CVector::K) { - ax = -CVector::J; + ax = -NLMISC::CVector::J; } eye -= ax * (dist+radius); @@ -423,24 +416,16 @@ void CObjectViewer::updateAnimation(NL3D::TAnimationTime time) void CObjectViewer::setBackgroundColor(NLMISC::CRGBA backgroundColor) { _BackgroundColor = backgroundColor; - - // config file variable changes - Modules::config().getConfigFile().getVar("BackgroundColor").setAsInt(_BackgroundColor.R, 0); - Modules::config().getConfigFile().getVar("BackgroundColor").setAsInt(_BackgroundColor.G, 1); - Modules::config().getConfigFile().getVar("BackgroundColor").setAsInt(_BackgroundColor.B, 2); } void CObjectViewer::setGraphicsDriver(bool Direct3D) { _Direct3D = Direct3D; - - if (_Direct3D) Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString("Direct3D"); - else Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString("OpenGL"); } void CObjectViewer::setSizeViewport(uint16 w, uint16 h) { - _Scene->getCam().setPerspective(_CameraFocal * (float)Pi/180.f, (float)w/h, 0.1f, 1000); + _Scene->getCam().setPerspective(_CameraFocal * (float)NLMISC::Pi/180.f, (float)w/h, 0.1f, 1000); } void CObjectViewer::setCurrentObject(const std::string &name) @@ -466,26 +451,41 @@ void CObjectViewer::getListObjects(std::vector &listObj) void CObjectViewer::loadConfig() { - // set background color from config - Modules::config().setAndCallback("BackgroundColor", CConfigCallback(this, &CObjectViewer::cfcbBackgroundColor)); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - // set graphics driver from config - Modules::config().setAndCallback("GraphicsDriver",CConfigCallback(this,&CObjectViewer::cfcbGraphicsDriver)); + QColor color; + color = settings->value("BackgroundColor", QColor(80, 80, 80)).value(); + _BackgroundColor = NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha()); - Modules::config().setAndCallback("CameraFocal",CConfigCallback(this,&CObjectViewer::cfcbCameraFocal)); + _Direct3D = false; //_Driver = OpenGL; - Modules::config().setAndCallback("FontName",CConfigCallback(this,&CObjectViewer::cfcbFontName)); +#ifdef NL_OS_WINDOWS + QString driver = settings->value(Constants::GRAPHICS_DRIVER, "OpenGL").toString(); + if (driver == "Direct3D") _Direct3D = true; //m_Driver = Direct3D; + else if (driver == "OpenGL") _Direct3D = false; //m_Driver = OpenGL; + else nlwarning("Invalid driver specified, defaulting to OpenGL"); +#endif - Modules::config().setAndCallback("BloomEffect",CConfigCallback(this,&CObjectViewer::cfcbBloomEffect)); + _CameraFocal = settings->value("CameraFocal", 75).toInt(); + _FontName = settings->value(Constants::FONT, "andbasr.ttf").toString().toStdString(); + _BloomEffect = settings->value(Constants::ENABLE_BLOOM, false).toBool(); + _BloomDensity = settings->value(Constants::BLOOM_DENSITY, 0).toInt(); + _BloomSquare = settings->value(Constants::ENABLE_SQUARE_BLOOM, false).toBool(); + + settings->endGroup(); } void CObjectViewer::saveConfig() { - Modules::config().dropCallback("BackgroundColor"); - Modules::config().dropCallback("GraphicsDriver"); - Modules::config().dropCallback("CameraFocal"); - Modules::config().dropCallback("FontName"); - Modules::config().dropCallback("BloomEffect"); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + + QColor color(_BackgroundColor.R, _BackgroundColor.G, _BackgroundColor.B, _BackgroundColor.A); + settings->setValue("BackgroundColor", color); + + settings->endGroup(); + settings->sync(); } void CObjectViewer::deleteEntities() @@ -500,38 +500,4 @@ void CObjectViewer::deleteEntities() _ListIG.clear(); } -void CObjectViewer::cfcbBackgroundColor(NLMISC::CConfigFile::CVar &var) -{ - // read variable from config file - _BackgroundColor = CRGBA(var.asInt(0), var.asInt(1), var.asInt(2)); -} - -void CObjectViewer::cfcbGraphicsDriver(NLMISC::CConfigFile::CVar &var) -{ - // Choose driver opengl to work correctly under Linux example - _Direct3D = false; //_Driver = OpenGL; - -#ifdef NL_OS_WINDOWS - std::string driver = var.asString(); - if (driver == "Direct3D") _Direct3D = true; //m_Driver = Direct3D; - else if (driver == "OpenGL") _Direct3D = false; //m_Driver = OpenGL; - else nlwarning("Invalid driver specified, defaulting to OpenGL"); -#endif -} - -void CObjectViewer::cfcbCameraFocal(NLMISC::CConfigFile::CVar &var) -{ - _CameraFocal = var.asFloat(); -} - -void CObjectViewer::cfcbFontName(NLMISC::CConfigFile::CVar &var) -{ - _FontName = var.asString(); -} - -void CObjectViewer::cfcbBloomEffect(NLMISC::CConfigFile::CVar &var) -{ - _BloomEffect = var.asBool(); -} - } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.h index a7ea7fdc9..dc96f5cdf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.h @@ -27,7 +27,6 @@ #include // NeL includes -#include #include #include @@ -231,13 +230,6 @@ private: // Delete all entities void deleteEntities(); - // Load background color from config file, intended for CConfiguration. - void cfcbBackgroundColor(NLMISC::CConfigFile::CVar &var); - void cfcbGraphicsDriver(NLMISC::CConfigFile::CVar &var); - void cfcbCameraFocal(NLMISC::CConfigFile::CVar &var); - void cfcbFontName(NLMISC::CConfigFile::CVar &var); - void cfcbBloomEffect(NLMISC::CConfigFile::CVar &var); - NLMISC::CRGBA _BackgroundColor; NL3D::IDriver *_IDriver; NL3D::CScene *_CScene; @@ -260,6 +252,8 @@ private: bool _Direct3D; bool _BloomEffect; + int _BloomDensity; + bool _BloomSquare; std::string _CurrentInstance; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_constants.h new file mode 100644 index 000000000..ba3af1b59 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_constants.h @@ -0,0 +1,62 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef OBJECT_VIEWER_CONSTANTS_H +#define OBJECT_VIEWER_CONSTANTS_H + +namespace NLQT +{ +namespace Constants +{ +const char * const OBJECT_VIEWER_PLUGIN = "ObjectViewer"; + +//mainwindow +const char * const MAIN_WINDOW = "ObjectViewer.MainWindow"; + +//settings +const char * const OBJECT_VIEWER_SECTION = "ObjectViewer"; +const char * const GRAPHICS_DRIVER = "GraphicsDriver"; +const char * const ENABLE_BLOOM = "EnableBloom"; +const char * const ENABLE_SQUARE_BLOOM = "EnableSquareBloom"; +const char * const BLOOM_DENSITY = "BloomDensity"; +const char * const QT_STYLE = "QtStyle"; +const char * const QT_PALETTE = "QtPalette"; +const char * const FONT = "Font"; + +const char * const SOUND_ENABLE = "SoundEnable"; +const char * const SOUND_DRIVER = "SoundDriver"; +const char * const SOUND_DEVICE = "SoundDevice"; +const char * const SOUND_AUTO_LOAD_SAMPLE = "SoundAutoLoadSample"; +const char * const SOUND_ENABLE_OCCLUDE_OBSTRUCT = "SoundEnableOccludeObstruct"; +const char * const SOUND_ENABLE_REVERB = "SoundEnableReverb"; +const char * const SOUND_MANUAL_ROLL_OFF = "SoundManualRolloff"; +const char * const SOUND_FORCE_SOFTWARE = "SoundForceSoftware"; +const char * const SOUND_USE_ADCPM = "SoundUseADPCM"; +const char * const SOUND_MAX_TRACK = "SoundMaxTrack"; +const char * const SOUND_PACKED_SHEET_PATH = "SoundPackedSheetPath"; +const char * const SOUND_SAMPLE_PATH = "SoundSamplePath"; + +const char * const VEGET_TILE_BANK = "VegetTileBank"; +const char * const VEGET_TILE_FAR_BANK = "VegetTileFarBank"; +const char * const VEGET_TEXTURE = "VegetTexture"; +const char * const VEGET_LANDSCAPE_ZONES = "VegetLandscapeZones"; +const char * const COARSE_MESH_TEXTURE = "CoarseMeshTexture"; + +} // namespace Constants +} // namespace NLQT + +#endif // OBJECT_VIEWER_CONSTANTS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp index d782a986c..b48eb82cc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp @@ -22,7 +22,7 @@ ObjectViewerPlugin::~ObjectViewerPlugin() } qDeleteAll(_autoReleaseObjects); _autoReleaseObjects.clear(); - Modules::release(); + //Modules::release(); } bool ObjectViewerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) @@ -41,6 +41,11 @@ void ObjectViewerPlugin::extensionsInitialized() { } +void ObjectViewerPlugin::shutdown() +{ + Modules::release(); +} + void ObjectViewerPlugin::setNelContext(NLMISC::INelContext *nelContext) { #ifdef NL_OS_WINDOWS diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h index 5c4b76afb..dae298fce 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h @@ -35,6 +35,7 @@ public: bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); + void shutdown(); void setNelContext(NLMISC::INelContext *nelContext); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_dialog.cpp index e9ed0fc04..2e3184367 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/setup_fog_dialog.cpp @@ -17,23 +17,22 @@ */ +// Project includes #include "stdpch.h" #include "setup_fog_dialog.h" +#include "object_viewer_constants.h" +#include "../core/icore.h" +#include "modules.h" // Qt includes #include #include +#include // NeL includes #include #include -// Project includes -#include "modules.h" - -using namespace NL3D; -using namespace NLMISC; - namespace NLQT { @@ -42,10 +41,17 @@ CSetupFog::CSetupFog(QWidget *parent) { ui.setupUi(this); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + // load fog value from config file - ui.startDoubleSpinBox->setValue(Modules::config().getValue("FogStart", 0.0)); - ui.endDoubleSpinBox->setValue(Modules::config().getValue("FogEnd", 0.0)); - colorFog = Modules::config().getValue("FogColor",CRGBA(0.0, 0.0, 0.0)); + ui.startDoubleSpinBox->setValue(settings->value("FogStart", 0.0).toDouble()); + ui.endDoubleSpinBox->setValue(settings->value("FogEnd", 0.0).toDouble()); + + QColor color = settings->value("FogColor", QColor(80, 80, 80)).value(); + colorFog = NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha()); + + settings->endGroup(); connect(ui.applyPushButton, SIGNAL(clicked()), this, SLOT(apply())); connect(ui.colorPushButton, SIGNAL(clicked()), this, SLOT(setColor())); @@ -53,13 +59,17 @@ CSetupFog::CSetupFog(QWidget *parent) CSetupFog::~CSetupFog() { - // save fog value from config file - Modules::config().getConfigFile().getVar("FogStart").setAsFloat(ui.startDoubleSpinBox->value()); - Modules::config().getConfigFile().getVar("FogEnd").setAsFloat(ui.endDoubleSpinBox->value()); - Modules::config().getConfigFile().getVar("FogColor").setAsInt(colorFog.R, 0); - Modules::config().getConfigFile().getVar("FogColor").setAsInt(colorFog.G, 1); - Modules::config().getConfigFile().getVar("FogColor").setAsInt(colorFog.B, 2); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + settings->setValue("FogStart", ui.startDoubleSpinBox->value()); + settings->setValue("FogEnd", ui.endDoubleSpinBox->value()); + + QColor color(colorFog.R, colorFog.G, colorFog.B, colorFog.A); + settings->setValue("FogColor", color); + + settings->endGroup(); + settings->sync(); } void CSetupFog::apply() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp index f04e38d55..4c677f4bf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp @@ -18,11 +18,14 @@ // Project includes #include "stdpch.h" #include "sound_settings_page.h" +#include "object_viewer_constants.h" +#include "../core/icore.h" #include "modules.h" // Qt includes +#include #include - +#include namespace NLQT { @@ -45,7 +48,7 @@ QString SoundSettingsPage::trName() const QString SoundSettingsPage::category() const { - return QLatin1String("ObjectViewer"); + return QLatin1String(Constants::OBJECT_VIEWER_SECTION); } QString SoundSettingsPage::trCategory() const @@ -58,61 +61,69 @@ QWidget *SoundSettingsPage::createPage(QWidget *parent) m_page = new QWidget(parent); m_ui.setupUi(m_page); - // setup config file callbacks and initialize values - Modules::config().setAndCallback("SoundDrivers", CConfigCallback(this, &SoundSettingsPage::cfcbSoundDrivers)); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + + QString soundDriver = settings->value(Constants::SOUND_DRIVER, "Auto").toString(); + m_ui.driverSndComboBox->setCurrentIndex(m_ui.driverSndComboBox->findText(soundDriver)); // load settings from the config file - m_ui.autoLoadSampleCheckBox->setChecked(Modules::config().getValue("SoundAutoLoadSample", true)); - m_ui.enableOccludeObstructCheckBox->setChecked(Modules::config().getValue("SoundEnableOccludeObstruct", true)); - m_ui.enableReverbCheckBox->setChecked(Modules::config().getValue("SoundEnableReverb", true)); - m_ui.manualRolloffCheckBox->setChecked(Modules::config().getValue("SoundManualRolloff", true)); - m_ui.forceSoftwareCheckBox->setChecked(Modules::config().getValue("SoundForceSoftware", false)); - m_ui.useADPCMCheckBox->setChecked(Modules::config().getValue("SoundUseADPCM", false)); - m_ui.maxTrackSpinBox->setValue(Modules::config().getValue("SoundMaxTrack", 48)); + m_ui.autoLoadSampleCheckBox->setChecked(settings->value(Constants::SOUND_AUTO_LOAD_SAMPLE, true).toBool()); + m_ui.enableOccludeObstructCheckBox->setChecked(settings->value(Constants::SOUND_ENABLE_OCCLUDE_OBSTRUCT, true).toBool()); + m_ui.enableReverbCheckBox->setChecked(settings->value(Constants::SOUND_ENABLE_REVERB, true).toBool()); + m_ui.manualRolloffCheckBox->setChecked(settings->value(Constants::SOUND_MANUAL_ROLL_OFF, true).toBool()); + m_ui.forceSoftwareCheckBox->setChecked(settings->value(Constants::SOUND_FORCE_SOFTWARE, false).toBool()); + m_ui.useADPCMCheckBox->setChecked(settings->value(Constants::SOUND_USE_ADCPM, false).toBool()); + m_ui.maxTrackSpinBox->setValue(settings->value(Constants::SOUND_MAX_TRACK, 48).toInt()); + m_ui.soundSamplePathLineEdit->setText(settings->value(Constants::SOUND_SAMPLE_PATH, "").toString()); + m_ui.soundSheetPathLineEdit->setText(settings->value(Constants::SOUND_PACKED_SHEET_PATH, "").toString()); + connect(m_ui.soundSamplePathButton, SIGNAL(clicked()), this, SLOT(setSamplePath())); + connect(m_ui.soundSheetPathButton, SIGNAL(clicked()), this, SLOT(setSheetPath())); + + settings->endGroup(); return m_page; } void SoundSettingsPage::apply() { - // save sound settings to config file - Modules::config().getConfigFile().getVar("SoundDriver").setAsString(m_ui.driverSndComboBox->currentText().toStdString()); - Modules::config().getConfigFile().getVar("SoundAutoLoadSample").setAsInt(m_ui.autoLoadSampleCheckBox->isChecked()); - Modules::config().getConfigFile().getVar("SoundEnableOccludeObstruct").setAsInt(m_ui.enableOccludeObstructCheckBox->isChecked()); - Modules::config().getConfigFile().getVar("SoundEnableReverb").setAsInt(m_ui.enableReverbCheckBox->isChecked()); - Modules::config().getConfigFile().getVar("SoundManualRolloff").setAsInt(m_ui.manualRolloffCheckBox->isChecked()); - Modules::config().getConfigFile().getVar("SoundForceSoftware").setAsInt(m_ui.forceSoftwareCheckBox->isChecked()); - Modules::config().getConfigFile().getVar("SoundUseADPCM").setAsInt(m_ui.useADPCMCheckBox->isChecked()); - Modules::config().getConfigFile().getVar("SoundMaxTrack").setAsInt(m_ui.maxTrackSpinBox->value()); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - // save config file - Modules::config().getConfigFile().save(); + settings->setValue(Constants::SOUND_DRIVER, m_ui.driverSndComboBox->currentText()); + settings->setValue(Constants::SOUND_AUTO_LOAD_SAMPLE, m_ui.autoLoadSampleCheckBox->isChecked()); + settings->setValue(Constants::SOUND_ENABLE_OCCLUDE_OBSTRUCT, m_ui.enableOccludeObstructCheckBox->isChecked()); + settings->setValue(Constants::SOUND_ENABLE_REVERB, m_ui.enableReverbCheckBox->isChecked()); + settings->setValue(Constants::SOUND_MANUAL_ROLL_OFF, m_ui.manualRolloffCheckBox->isChecked()); + settings->setValue(Constants::SOUND_FORCE_SOFTWARE, m_ui.forceSoftwareCheckBox->isChecked()); + settings->setValue(Constants::SOUND_USE_ADCPM, m_ui.useADPCMCheckBox->isChecked()); + settings->setValue(Constants::SOUND_MAX_TRACK, m_ui.maxTrackSpinBox->value()); + settings->setValue(Constants::SOUND_SAMPLE_PATH, m_ui.soundSamplePathLineEdit->text()); + settings->setValue(Constants::SOUND_PACKED_SHEET_PATH, m_ui.soundSheetPathLineEdit->text()); + + settings->endGroup(); + settings->sync(); } void SoundSettingsPage::finish() { - Modules::config().dropCallback("SoundDrivers"); } -void SoundSettingsPage::cfcbSoundDrivers(NLMISC::CConfigFile::CVar& var) +void SoundSettingsPage::setSheetPath() { - while (m_ui.driverSndComboBox->count()) - m_ui.driverSndComboBox->removeItem(0); - - // load types sound driver from the config file - for (uint i = 0; i < var.size(); ++i) - m_ui.driverSndComboBox->addItem(var.asString(i).c_str()); - - // set sound driver from the config file - QString value = Modules::config().getValue("SoundDriver",std::string("Auto")).c_str(); - QString dn = value.toLower(); - for (sint i = 0; i < m_ui.driverSndComboBox->count(); ++i) + QString path = QFileDialog::getExistingDirectory(); + if (!path.isEmpty()) { - if (dn == m_ui.driverSndComboBox->itemText(i).toLower()) - { - m_ui.driverSndComboBox->setCurrentIndex(i); - return; - } + m_ui.soundSheetPathLineEdit->setText(path); + } +} + +void SoundSettingsPage::setSamplePath() +{ + QString path = QFileDialog::getExistingDirectory(); + if (!path.isEmpty()) + { + m_ui.soundSamplePathLineEdit->setText(path); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h index 33609f526..c27a82e1f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h @@ -26,9 +26,6 @@ // Qt includes #include -// NeL includes -#include - class QWidget; namespace NLQT @@ -52,9 +49,11 @@ public: virtual void apply(); virtual void finish(); -private: - void cfcbSoundDrivers(NLMISC::CConfigFile::CVar &var); +private Q_SLOTS: + void setSheetPath(); + void setSamplePath(); +private: QWidget *m_page; Ui::SoundSettingsPage m_ui; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.ui index f0bd74642..bcb29b060 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.ui @@ -6,21 +6,15 @@ 0 0 - 326 - 268 + 331 + 278 Form - - 6 - - - 3 - - + @@ -50,53 +44,78 @@ 0 + + + Auto + + + + + OpenAL + + + + + XAudio2 + + + + + FMod + + + + + DSound + + - + SoundAutoLoadSample - + SoundEnableOccludeObstruct - + SoundEnableReverb - + SoundManualRolloff - + SoundForceSoftware - + SoundUseADPCM - + @@ -140,6 +159,40 @@ + + + SoundPackedSheetPath + + + + + + + + + + ... + + + + + + + SoundSamplePath + + + + + + + + + + ... + + + + Qt::Vertical diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp index 45d07673e..ba64d834e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp @@ -18,6 +18,11 @@ #include "stdpch.h" #include "sound_system.h" +// Project includes +#include "modules.h" +#include "object_viewer_constants.h" +#include "../core/icore.h" + // NeL includes #include #include @@ -26,8 +31,8 @@ #include #include -// Project includes -#include "modules.h" +// Qt includes +#include namespace NLQT { @@ -58,7 +63,7 @@ void CSoundSystem::setListenerMatrix(const NLMISC::CMatrix &m) } } -void CSoundSystem::init () +void CSoundSystem::init() { //H_AUTO2 nldebug("CSoundSystem::init"); @@ -73,23 +78,28 @@ void CSoundSystem::init () try { // init audiomixer - _PackedSheetPath = Modules::config().getValue("SoundPackedSheetPath", std::string("")); - _SamplePath = Modules::config().getValue("SoundSamplePath", std::string("")); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + + _PackedSheetPath = settings->value(Constants::SOUND_PACKED_SHEET_PATH, "").toString().toStdString(); + _SamplePath = settings->value(Constants::SOUND_SAMPLE_PATH, "").toString().toStdString(); _AudioMixer->setSamplePath(_SamplePath); _AudioMixer->setPackedSheetOption(_PackedSheetPath, true); std::vector devices; - _AudioMixer->initDriver(Modules::config().getValue("SoundDriver", std::string("Auto"))); + _AudioMixer->initDriver(settings->value(Constants::SOUND_DRIVER, "Auto").toString().toStdString()); _AudioMixer->getDevices(devices); NLSOUND::UAudioMixer::CInitInfo audioInfo; - audioInfo.AutoLoadSample = Modules::config().getValue("SoundAutoLoadSample", true); - audioInfo.EnableOccludeObstruct = Modules::config().getValue("SoundEnableOccludeObstruct", true); - audioInfo.EnableReverb = Modules::config().getValue("SoundEnableReverb", true); - audioInfo.ManualRolloff = Modules::config().getValue("SoundManualRolloff", true); - audioInfo.ForceSoftware = Modules::config().getValue("SoundForceSoftware", false); - audioInfo.MaxTrack = Modules::config().getValue("SoundMaxTrack", 48); - audioInfo.UseADPCM = Modules::config().getValue("SoundUseADPCM", false); - _AudioMixer->initDevice(Modules::config().getValue("SoundDevice", std::string("")), audioInfo, NULL); + audioInfo.AutoLoadSample = settings->value(Constants::SOUND_AUTO_LOAD_SAMPLE, true).toBool(); + audioInfo.EnableOccludeObstruct = settings->value(Constants::SOUND_ENABLE_OCCLUDE_OBSTRUCT, true).toBool(); + audioInfo.EnableReverb = settings->value(Constants::SOUND_ENABLE_REVERB, true).toBool(); + audioInfo.ManualRolloff = settings->value(Constants::SOUND_MANUAL_ROLL_OFF, true).toBool(); + audioInfo.ForceSoftware = settings->value(Constants::SOUND_FORCE_SOFTWARE, false).toBool(); + audioInfo.MaxTrack = settings->value(Constants::SOUND_MAX_TRACK, 48).toInt(); + audioInfo.UseADPCM = settings->value(Constants::SOUND_USE_ADCPM, false).toBool(); + _AudioMixer->initDevice(settings->value(Constants::SOUND_DEVICE, "").toString().toStdString(), audioInfo, NULL); _AudioMixer->setLowWaterMark(1); + + settings->endGroup(); } catch(NLMISC::Exception &e) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp index 5f53b3b12..b6a3b89dc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp @@ -17,12 +17,19 @@ */ +// Project includes #include "stdpch.h" #include "vegetable_editor.h" +#include "modules.h" +#include "object_viewer_constants.h" +#include "../core/icore.h" // Qt includes #include #include +#include +#include +#include // NeL includes #include @@ -31,12 +38,8 @@ #include #include #include - -//#include - -// Project includes -#include "modules.h" #include +//#include namespace NLQT { @@ -258,7 +261,7 @@ bool CVegetableEditor::createVegetableLandscape() return false; } } - + Modules::objView().getScene()->setCoarseMeshManagerTexture(_CoarseMeshTexture.c_str()); return true; } @@ -311,7 +314,7 @@ void CVegetableEditor::refreshVegetableLandscape(const NL3D::CTileVegetableDesc } } -void CVegetableEditor::setVegetableWindPower(float w) +void CVegetableEditor::setVegetableWindPower(double w) { _VegetableWindPower= w; if(_VegetableLandscape) @@ -321,7 +324,7 @@ void CVegetableEditor::setVegetableWindPower(float w) _VegetableWindBendMin); } -void CVegetableEditor::setVegetableWindBendStart(float w) +void CVegetableEditor::setVegetableWindBendStart(double w) { _VegetableWindBendMin= w; if(_VegetableLandscape) @@ -331,7 +334,7 @@ void CVegetableEditor::setVegetableWindBendStart(float w) _VegetableWindBendMin); } -void CVegetableEditor::setVegetableWindFrequency(float w) +void CVegetableEditor::setVegetableWindFrequency(double w) { _VegetableWindFreq= w; if(_VegetableLandscape) @@ -540,222 +543,94 @@ void CVegetableEditor::loadConfig() _VegetableSnapToGround = false; // Load Landscape params. - // -------------- - // threshold - try - { - _VegetableLandscapeThreshold = Modules::config().getConfigFile().getVar("VegetLandscapeThreshold").asFloat(); - // clamp to avoid divide/0. - _VegetableLandscapeThreshold = std::max(_VegetableLandscapeThreshold, 0.001f); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableLandscapeThreshold = 0.003f; - } - // tilenear - try - { - _VegetableLandscapeTileNear = Modules::config().getConfigFile().getVar("VegetLandscapeTileNear").asFloat(); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableLandscapeTileNear= 50; - } - // ambient - try - { - NLMISC::CConfigFile::CVar &color = Modules::config().getConfigFile().getVar("VegetLandscapeAmbient"); - _VegetableLandscapeAmbient.R = color.asInt(0); - _VegetableLandscapeAmbient.G = color.asInt(1); - _VegetableLandscapeAmbient.B = color.asInt(2); - _VegetableLandscapeAmbient.A = color.asInt(3); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableLandscapeAmbient.set(80, 80, 80, 255); - } - // diffuse - try - { - NLMISC::CConfigFile::CVar &color= Modules::config().getConfigFile().getVar("VegetLandscapeDiffuse"); - _VegetableLandscapeDiffuse.R = color.asInt(0); - _VegetableLandscapeDiffuse.G = color.asInt(1); - _VegetableLandscapeDiffuse.B = color.asInt(2); - _VegetableLandscapeDiffuse.A = color.asInt(3); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableLandscapeDiffuse.set(255, 255, 255, 255); - } - // Snapping - try - { - _VegetableSnapHeight = Modules::config().getConfigFile().getVar("VegetLandscapeSnapHeight").asFloat(); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableSnapHeight = 1.70f; - } + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + + _VegetableLandscapeThreshold = std::max(settings->value("VegetLandscapeThreshold", 0.003).toDouble(), 0.001); + _VegetableLandscapeTileNear = settings->value("VegetLandscapeTileNear", 50).toDouble(); + + QColor color; + color = settings->value("VegetLandscapeAmbient", QColor(80, 80, 80)).value(); + _VegetableLandscapeAmbient = NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha()); + + color = settings->value("VegetLandscapeDiffuse", QColor(255, 255, 255)).value(); + _VegetableLandscapeDiffuse = NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha()); + + _VegetableSnapHeight = settings->value("VegetLandscapeSnapHeight", 1.70f).toFloat(); // Load Vegetable params. - // -------------- - // vegetable ambient - try - { - NLMISC::CConfigFile::CVar &color = Modules::config().getConfigFile().getVar("VegetAmbient"); - _VegetableAmbient.R = color.asInt(0); - _VegetableAmbient.G = color.asInt(1); - _VegetableAmbient.B = color.asInt(2); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableAmbient.set(80, 80, 80, 255); - } - // vegetable diffuse - try - { - NLMISC::CConfigFile::CVar &color = Modules::config().getConfigFile().getVar("VegetDiffuse"); - // setup to behave correclty ie as maxLightFactor: - sint R = color.asInt(0) - _VegetableAmbient.R; - NLMISC::clamp(R, 0, 255); - _VegetableDiffuse.R = R; - sint G = color.asInt(1) - _VegetableAmbient.G; - NLMISC::clamp(G, 0, 255); - _VegetableDiffuse.G = G; - sint B = color.asInt(2) - _VegetableAmbient.B; - NLMISC::clamp(B, 0, 255); - _VegetableDiffuse.B = B; - } - catch (NLMISC::EUnknownVar &) - { - sint R = 255 - _VegetableAmbient.R; - NLMISC::clamp(R, 0, 255); - _VegetableDiffuse.R = R; - sint G = 255 - _VegetableAmbient.G; - NLMISC::clamp(G, 0, 255); - _VegetableDiffuse.G = G; - sint B = 255 - _VegetableAmbient.B; - NLMISC::clamp(B, 0, 255); - _VegetableDiffuse.B = B; - } - // vegetable lightDir - try - { - NLMISC::CConfigFile::CVar &var = Modules::config().getConfigFile().getVar("VegetLightDir"); - _VegetableLightDir.x = var.asFloat(0); - _VegetableLightDir.y = var.asFloat(1); - _VegetableLightDir.z = var.asFloat(2); - _VegetableLightDir.normalize(); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableLightDir.set(0, 1, -1); - _VegetableLightDir.normalize(); - } + color = settings->value("VegetAmbient", QColor(80, 80, 80)).value(); + _VegetableAmbient = NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha()); - // windDir - try - { - NLMISC::CConfigFile::CVar &var = Modules::config().getConfigFile().getVar("VegetWindDir"); - _VegetableWindDir.x = var.asFloat(0); - _VegetableWindDir.y = var.asFloat(1); - _VegetableWindDir.z = var.asFloat(2); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableWindDir.x = 0.5f; - _VegetableWindDir.y = 0.5f; - _VegetableWindDir.z = 0; - } - // windFreq - try - { - _VegetableWindFreq = Modules::config().getConfigFile().getVar("VegetWindFreq").asFloat(); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableWindFreq= 0.5; - } - // windPower - try - { - _VegetableWindPower = Modules::config().getConfigFile().getVar("VegetWindPower").asFloat(); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableWindPower= 1; - } - // windBendMin - try - { - _VegetableWindBendMin = Modules::config().getConfigFile().getVar("VegetWindBendMin").asFloat(); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableWindBendMin= 0; - } + color = settings->value("VegetDiffuse", QColor(80, 80, 80)).value(); + + // setup to behave correclty ie as maxLightFactor: + sint R = color.red() - _VegetableAmbient.R; + NLMISC::clamp(R, 0, 255); + _VegetableDiffuse.R = R; + sint G = color.green() - _VegetableAmbient.G; + NLMISC::clamp(G, 0, 255); + _VegetableDiffuse.G = G; + sint B = color.blue() - _VegetableAmbient.B; + NLMISC::clamp(B, 0, 255); + _VegetableDiffuse.B = B; + + QVector3D vec; + vec = settings->value("VegetLightDir", QVector3D(0, 1, -1)).value(); + _VegetableLightDir = NLMISC::CVector(vec.x(), vec.y(), vec.z()); + _VegetableLightDir.normalize(); + + vec = settings->value("VegetWindDir", QVector3D(0.5f, 0.5f, 0)).value(); + _VegetableWindDir = NLMISC::CVector(vec.x(), vec.y(), vec.z()); + + _VegetableWindFreq = settings->value("VegetWindFreq", 0.5).toDouble(); + _VegetableWindPower = settings->value("VegetWindPower", 1).toDouble(); + _VegetableWindBendMin = settings->value("VegetWindBendMin", 0).toDouble(); + settings->endGroup(); } void CVegetableEditor::loadLandscapeSetup() { - // Load landscape setup - // -------------- - try - { - // tileBank setup. - _VegetableLandscapeTileBank = Modules::config().getConfigFile().getVar("VegetTileBank").asString(); - _VegetableLandscapeTileFarBank = Modules::config().getConfigFile().getVar("VegetTileFarBank").asString(); - // zone list. - _VegetableLandscapeZoneNames.clear(); - NLMISC::CConfigFile::CVar &zones = Modules::config().getConfigFile().getVar("VegetLandscapeZones"); - for (uint i=0; i<(uint)zones.size(); i++) - _VegetableLandscapeZoneNames.push_back(zones.asString(i).c_str()); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableLandscapeTileBank.clear(); - _VegetableLandscapeTileFarBank.clear(); - _VegetableLandscapeZoneNames.clear(); - } + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - // Load Vegetable params. - // -------------- + _VegetableLandscapeTileBank = settings->value(Constants::VEGET_TILE_BANK, "").toString().toStdString(); + _VegetableLandscapeTileFarBank = settings->value(Constants::VEGET_TILE_FAR_BANK, "").toString().toStdString(); + _CoarseMeshTexture = settings->value(Constants::COARSE_MESH_TEXTURE, "").toString().toStdString(); + _VegetableTexture = settings->value(Constants::VEGET_TEXTURE, "").toString().toStdString(); - // vegetable texture - try - { - _VegetableTexture = Modules::config().getConfigFile().getVar("VegetTexture").asString(); - } - catch (NLMISC::EUnknownVar &) - { - _VegetableTexture= ""; - } + QStringList list = settings->value(Constants::VEGET_LANDSCAPE_ZONES).toStringList(); + _VegetableLandscapeZoneNames.clear(); + for (int i = 0; i < list.size(); ++i) + _VegetableLandscapeZoneNames.push_back(list[i].toStdString()); + settings->endGroup(); } void CVegetableEditor::saveConfig() { - Modules::config().getConfigFile().getVar("VegetLandscapeThreshold").setAsFloat(_VegetableLandscapeThreshold); - Modules::config().getConfigFile().getVar("VegetLandscapeTileNear").setAsFloat(_VegetableLandscapeTileNear); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - Modules::config().getConfigFile().getVar("VegetLandscapeAmbient").setAsInt(_VegetableLandscapeAmbient.R, 0); - Modules::config().getConfigFile().getVar("VegetLandscapeAmbient").setAsInt(_VegetableLandscapeAmbient.G, 1); - Modules::config().getConfigFile().getVar("VegetLandscapeAmbient").setAsInt(_VegetableLandscapeAmbient.B, 2); - Modules::config().getConfigFile().getVar("VegetLandscapeAmbient").setAsInt(_VegetableLandscapeAmbient.A, 3); + settings->setValue("VegetLandscapeThreshold", _VegetableLandscapeThreshold); + settings->setValue("VegetLandscapeTileNear", _VegetableLandscapeTileNear); - Modules::config().getConfigFile().getVar("VegetLandscapeDiffuse").setAsInt(_VegetableLandscapeDiffuse.R, 0); - Modules::config().getConfigFile().getVar("VegetLandscapeDiffuse").setAsInt(_VegetableLandscapeDiffuse.G, 1); - Modules::config().getConfigFile().getVar("VegetLandscapeDiffuse").setAsInt(_VegetableLandscapeDiffuse.B, 2); - Modules::config().getConfigFile().getVar("VegetLandscapeAmbient").setAsInt(_VegetableLandscapeAmbient.A, 3); + QColor vAmbColor(_VegetableLandscapeAmbient.R, _VegetableLandscapeAmbient.G, _VegetableLandscapeAmbient.B, _VegetableLandscapeAmbient.A); + settings->setValue("VegetLandscapeAmbient", vAmbColor); - Modules::config().getConfigFile().getVar("VegetWindDir").setAsFloat(_VegetableWindDir.x, 0); - Modules::config().getConfigFile().getVar("VegetWindDir").setAsFloat(_VegetableWindDir.y, 1); - Modules::config().getConfigFile().getVar("VegetWindDir").setAsFloat(_VegetableWindDir.z, 2); + QColor vDifColor(_VegetableLandscapeDiffuse.R, _VegetableLandscapeDiffuse.G, _VegetableLandscapeDiffuse.B, _VegetableLandscapeDiffuse.A); + settings->setValue("VegetLandscapeDiffuse", vDifColor); - Modules::config().getConfigFile().getVar("VegetWindPower").setAsFloat(_VegetableWindPower); - Modules::config().getConfigFile().getVar("VegetWindFreq").setAsFloat(_VegetableWindFreq); - Modules::config().getConfigFile().getVar("VegetWindBendMin").setAsFloat(_VegetableWindBendMin); + QVector3D vec(_VegetableWindDir.x, _VegetableWindDir.y, _VegetableWindDir.z); + settings->setValue("VegetWindDir", vec); + + settings->setValue("VegetWindPower", _VegetableWindPower); + settings->setValue("VegetWindFreq", _VegetableWindFreq); + settings->setValue("VegetWindBendMin", _VegetableWindBendMin); + + settings->endGroup(); + settings->sync(); } } /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.h index b36458d20..91f7a1f7b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.h @@ -140,23 +140,23 @@ public: void refreshVegetableLandscape(const NL3D::CTileVegetableDesc &tvdesc); /// Get vegetable Wind wetup. - float getVegetableWindPower() const + double getVegetableWindPower() const { return _VegetableWindPower; } - float getVegetableWindBendStart() const + double getVegetableWindBendStart() const { return _VegetableWindBendMin; } - float getVegetableWindFrequency() const + double getVegetableWindFrequency() const { return _VegetableWindFreq; } /// Set vegetable Wind wetup (updat view if possible) - void setVegetableWindPower(float w); - void setVegetableWindBendStart(float w); - void setVegetableWindFrequency(float w); + void setVegetableWindPower(double w); + void setVegetableWindBendStart(double w); + void setVegetableWindFrequency(double w); void setVegetableAmbientLight(const NLMISC::CRGBA &ambient); void setVegetableDiffuseLight(const NLMISC::CRGBA &diffuse); @@ -236,11 +236,12 @@ private: std::string _VegetableLandscapeTileBank; std::string _VegetableLandscapeTileFarBank; std::vector _VegetableLandscapeZoneNames; + std::string _CoarseMeshTexture; // Misc. - float _VegetableLandscapeThreshold; - float _VegetableLandscapeTileNear; - float _VegetableLandscapeMultiply; + double _VegetableLandscapeThreshold; + double _VegetableLandscapeTileNear; + double _VegetableLandscapeMultiply; NLMISC::CRGBA _VegetableLandscapeAmbient; NLMISC::CRGBA _VegetableLandscapeDiffuse; std::string _VegetableTexture; @@ -249,9 +250,9 @@ private: NLMISC::CVector _VegetableLightDir; // Vegetable wind. NLMISC::CVector _VegetableWindDir; - float _VegetableWindFreq; - float _VegetableWindPower; - float _VegetableWindBendMin; + double _VegetableWindFreq; + double _VegetableWindPower; + double _VegetableWindBendMin; bool _VegetableEnabled; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_page.cpp index 73fba5e09..7fa3347f5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_landscape_page.cpp @@ -23,9 +23,9 @@ // Project includes #include "modules.h" -#define NL_VEGETABLE_EDIT_WIND_MAX_POWER 10.f -#define NL_VEGETABLE_EDIT_WIND_MAX_FREQUENCY 10.f -#define NL_VEGETABLE_EDIT_WIND_MAX_BENDSTART 1.f +#define NL_VEGETABLE_EDIT_WIND_MAX_POWER 10.0 +#define NL_VEGETABLE_EDIT_WIND_MAX_FREQUENCY 10.0 +#define NL_VEGETABLE_EDIT_WIND_MAX_BENDSTART 1.0 namespace NLQT { @@ -43,15 +43,15 @@ CVegetableLandscapePage::CVegetableLandscapePage(QWidget *parent) connect(_ui.diffuseColorWidget, SIGNAL(colorChanged(NLMISC::CRGBA)), this, SLOT(setColorDiffuse(NLMISC::CRGBA))); connect(_ui.ambientColorwidget, SIGNAL(colorChanged(NLMISC::CRGBA)), this, SLOT(setColorAmbient(NLMISC::CRGBA))); - float windPower = Modules::veget().getVegetableWindPower(); + double windPower = Modules::veget().getVegetableWindPower(); NLMISC::clamp(windPower, 0, NL_VEGETABLE_EDIT_WIND_MAX_POWER); _ui.powerHorizontalSlider->setValue(int(windPower * _ui.powerHorizontalSlider->maximum() / NL_VEGETABLE_EDIT_WIND_MAX_POWER)); - float bendStar = Modules::veget().getVegetableWindBendStart(); + double bendStar = Modules::veget().getVegetableWindBendStart(); NLMISC::clamp(bendStar, 0, NL_VEGETABLE_EDIT_WIND_MAX_BENDSTART); _ui.bendStartHorizontalSlider->setValue(int(bendStar * _ui.bendStartHorizontalSlider->maximum() / NL_VEGETABLE_EDIT_WIND_MAX_BENDSTART)); - float frequency = Modules::veget().getVegetableWindFrequency(); + double frequency = Modules::veget().getVegetableWindFrequency(); NLMISC::clamp(frequency, 0, NL_VEGETABLE_EDIT_WIND_MAX_FREQUENCY); _ui.frequencyHorizontalSlider->setValue(int(frequency * _ui.frequencyHorizontalSlider->maximum() / NL_VEGETABLE_EDIT_WIND_MAX_FREQUENCY)); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp index 6974da2fb..f794e0b73 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp @@ -18,19 +18,21 @@ // Project includes #include "stdpch.h" #include "vegetable_settings_page.h" +#include "object_viewer_constants.h" +#include "../core/icore.h" #include "modules.h" // Qt includes #include +#include #include #include -// NeL includes -#include - namespace NLQT { +QString LastDir = "."; + VegetableSettingsPage::VegetableSettingsPage(QObject *parent) : IOptionsPage(parent), m_page(0) @@ -49,7 +51,7 @@ QString VegetableSettingsPage::trName() const QString VegetableSettingsPage::category() const { - return QLatin1String("ObjectViewer"); + return QLatin1String(Constants::OBJECT_VIEWER_SECTION); } QString VegetableSettingsPage::trCategory() const @@ -62,23 +64,21 @@ QWidget *VegetableSettingsPage::createPage(QWidget *parent) m_page = new QWidget(parent); m_ui.setupUi(m_page); - m_ui.tileBankLineEdit->setText(Modules::config().getConfigFile().getVar("VegetTileBank").asString().c_str()); - m_ui.tileFarBankLineEdit->setText(Modules::config().getConfigFile().getVar("VegetTileFarBank").asString().c_str()); - m_ui.vegetTextureLineEdit->setText(Modules::config().getConfigFile().getVar("VegetTexture").asString().c_str()); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - m_ui.zonesListWidget->clear(); + m_ui.tileBankLineEdit->setText(settings->value(Constants::VEGET_TILE_BANK, "").toString()); + m_ui.tileFarBankLineEdit->setText(settings->value(Constants::VEGET_TILE_FAR_BANK, "").toString()); + m_ui.vegetTextureLineEdit->setText(settings->value(Constants::VEGET_TEXTURE, "").toString()); + m_ui.coarseLineEdit->setText(settings->value(Constants::COARSE_MESH_TEXTURE, "").toString()); + m_ui.zonesListWidget->addItems(settings->value(Constants::VEGET_LANDSCAPE_ZONES).toStringList()); - // load vegetable landscape zone paths from config file - NLMISC::CConfigFile::CVar &var = Modules::config().getConfigFile().getVar("VegetLandscapeZones"); - for (uint i = 0; i < var.size(); ++i) - { - m_ui.zonesListWidget->addItem(var.asString(i).c_str()); - m_ui.zonesListWidget->item(i)->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); - } + settings->endGroup(); connect(m_ui.tileBankToolButton, SIGNAL(clicked()), this, SLOT(setTileBank())); connect(m_ui.tileFarBankToolButton, SIGNAL(clicked()), this, SLOT(setTileFarBank())); connect(m_ui.vegetTexToolButton, SIGNAL(clicked()), this, SLOT(setTextureVegetable())); + connect(m_ui.coarseToolButton, SIGNAL(clicked()), this, SLOT(setCoarseMeshTexture())); connect(m_ui.addZoneToolButton, SIGNAL(clicked()), this, SLOT(addZone())); connect(m_ui.removeZoneToolButton, SIGNAL(clicked()), this, SLOT(removeZone())); @@ -87,21 +87,22 @@ QWidget *VegetableSettingsPage::createPage(QWidget *parent) void VegetableSettingsPage::apply() { - Modules::config().getConfigFile().getVar("VegetTileBank").setAsString(m_ui.tileBankLineEdit->text().toStdString()); - Modules::config().getConfigFile().getVar("VegetTileFarBank").setAsString(m_ui.tileFarBankLineEdit->text().toStdString()); - Modules::config().getConfigFile().getVar("VegetTexture").setAsString(m_ui.vegetTextureLineEdit->text().toStdString()); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - std::vector list; + settings->setValue(Constants::VEGET_TILE_BANK, m_ui.tileBankLineEdit->text()); + settings->setValue(Constants::VEGET_TILE_FAR_BANK, m_ui.tileFarBankLineEdit->text()); + settings->setValue(Constants::COARSE_MESH_TEXTURE, m_ui.coarseLineEdit->text()); + settings->setValue(Constants::VEGET_TEXTURE, m_ui.vegetTextureLineEdit->text()); + + QStringList list; for (sint i = 0; i < m_ui.zonesListWidget->count(); ++i) - { - std::string str = m_ui.zonesListWidget->item(i)->text().toStdString(); - list.push_back(str); - } + list.push_back(m_ui.zonesListWidget->item(i)->text()); - Modules::config().getConfigFile().getVar("VegetLandscapeZones").Type = NLMISC::CConfigFile::CVar::T_STRING; - Modules::config().getConfigFile().getVar("VegetLandscapeZones").setAsString(list); + settings->setValue(Constants::VEGET_LANDSCAPE_ZONES, list); - Modules::config().getConfigFile().save(); + settings->endGroup(); + settings->sync(); } void VegetableSettingsPage::finish() @@ -141,10 +142,21 @@ void VegetableSettingsPage::setTextureVegetable() } } +void VegetableSettingsPage::setCoarseMeshTexture() +{ + QString fileName = QFileDialog::getOpenFileName(0, tr("Set Coarse Mesh texture"), + m_ui.vegetTextureLineEdit->text(), + tr("Texture file (*.tga *.png *.jpg *.dds);;")); + if (!fileName.isEmpty()) + { + m_ui.coarseLineEdit->setText(fileName); + } +} + void VegetableSettingsPage::addZone() { QStringList fileNames = QFileDialog::getOpenFileNames(0, - tr("Add zone files"), ".", + tr("Add zone files"), LastDir, tr("Zonel files (*.zonel *.zone);;")); if (!fileNames.isEmpty()) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h index dd83127f9..bf49e2d2c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h @@ -48,10 +48,11 @@ public: virtual void apply(); virtual void finish(); -public Q_SLOTS: +private Q_SLOTS: void setTileBank(); void setTileFarBank(); void setTextureVegetable(); + void setCoarseMeshTexture(); void addZone(); void removeZone(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui index 1502906ce..e36b8bb37 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui @@ -95,7 +95,7 @@ - false + true Coarse mesh texture @@ -105,14 +105,14 @@ - false + true - false + true ... diff --git a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_de.ts b/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_de.ts index 1684e0846..a2c2cb40e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_de.ts +++ b/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_de.ts @@ -1,79 +1,6 @@ - - AnimEditWidget - - - - Form - - - - - - Animation - - - - - Add anim - - - - - Unload all anim and swt files - - - - - Add anim in PlayList - - - - - Delete anim from PlayList - - - - - Set duration of time in Animation control - - - - - In place - - - - - Increment pos - - - - - AnimationControl - - - Form - - - - - Loop - - - - - Play/Pause - - - - - Stop - - - Application @@ -699,35 +626,28 @@ CExampleSettingsPage - Form - GroupBox - - PushButton - - RadioButton - CheckBox @@ -2965,12 +2885,12 @@ Core::CSearchPathsSettingsPage - + Search Paths Verzeichnisse - + General Allgemein @@ -2983,112 +2903,112 @@ Object Viewer Qt - + About Object Viewer Qt Über Object Viewer Qt - + <h2>Object Viewer Qt</h2><p> Ryzom Core team <p>Compiled on %1 %2 - + &Open... &Öffnen... - + Open an existing file Datei öffnen - + E&xit B&eenden - + Ctrl+Q Ctrl+Q - + Exit the application Object Viewer verlassen - + &Settings Ein&stellungen - + Open the settings dialog Öffnet das Konfigurationsmenü - + &About &Über - + Show the application's About box Zeigt Informationen über den Object Viewer - + About &Qt Über &Qt - + Show the Qt library's About box Zeigt Informationen über Qt - + About &Plugins Über &Plugins - + Show the plugin view dialog Zeigt Informationen über Plugins - + &File &Datei - + &Edit &Editieren - + &View &Ansicht - + &Tools &Werkzeuge - + &Sheet - + &Help &Hilfe - + StatusReady Status Fertig @@ -3197,144 +3117,71 @@ Reason: %3 - + + OpenGL + + + + + Direct3D + + + + Qt Style - + Style - + Use style's standard palette - + + Font + + + + + ... + + + + Graphics settings - + Driver - + Bloom effect - + Bloom density - + Square bloom - + Enable bloom effect - - MixerEditWidget - - - Form - - - - - Mixer - - - - - Enable - - - - - Slot - - - - - Start blend - - - - - End blend - - - - - Offset frame - - - - - Speed x - - - - - Start frame - - - - - End frame - - - - - Smooth - - - - - Align blend - - - - - Wrap mode: - - - - - Clamp - - - - - Repeat - - - - - Disable - - - - - Invert skeleton weight - - - - - Skeleton weight template - - - NLQT::CAnimationSetDialog @@ -3808,78 +3655,78 @@ Reason: %3 NLQT::CMainWindow - + Open NeL data file Öffne NeL Daten Dateien - + All NeL files (*.shape *.ps *.ig);;NeL shape files (*.shape);;NeL particle system files (*.ps)NeL Instance Group files (*.ig) Alle NeL Dateien (*.shape *.ps *.ig);;NeL shape (*.shape);;NeL Partikelsystem(*.ps)NeL Instanz Gruppen (*.ig) - + Open skeleton file Öffne Skelett Datei - + NeL skeleton file (*.skel) NeL Skelet (*.skel) - + &Open... &Öffnen... - + Open an existing file Datei öffnen - + Set &background color Hintergrundfar&be setzen - + Set background color Hintergrundfarbe setzen - + &Reset scene Szene zu&rücksetzen - + Reset current scene Aktuelle Szene zurücksetzen - - + + Reload textures Texturen neu laden - + Save &Screenshot Screenshot &Speichern - + Make a screenshot of the current viewport and save Speichert ein Screenshot der aktuellen Szene - + &File &Datei - + &Tools &Werkzeuge @@ -4523,12 +4370,12 @@ Reason: %3 NLQT::GraphicsSettingsPage - + Graphics Video - + Object Viewer @@ -4536,12 +4383,12 @@ Reason: %3 NLQT::SoundSettingsPage - + Sound Audio - + Object Viewer @@ -4549,52 +4396,58 @@ Reason: %3 NLQT::VegetableSettingsPage - + Vegetable Vegetation - + Object Viewer - + Set new tile bank - + Tile Bank file (*.smallbank *.bank);; - + Set new tile far bank - + Tile Far Bank file (*.farbank);; - + Set MicroVegetable texture - + + Texture file (*.tga *.png *.jpg *.dds);; + Set Coarse Mesh texture + + + + Add zone files - + Zonel files (*.zonel *.zone);; @@ -4616,25 +4469,15 @@ Reason: %3 Plugin::CExampleSettingsPage - Example page - General Allgemein - - Plugin::CLogPlugin - - - Not found QMainWindow Object Viewer Qt. - - - Plugin::CLogSettingsPage @@ -4656,101 +4499,6 @@ Reason: %3 - - PointLightEditWidget - - - Form - - - - - PointLight - - - - - Ambient color - Ambient Farbe - - - - Diffuse color - Diffuse Farbe - - - - Specular color - - - - - Attenuation start - - - - - Attenuation end - - - - - Spot angle begin - - - - - Spot angle end - - - - - Influence light map - - - - - SceneViewer::AnimEditWidget - - - Open NeL anim file - - - - - NeL anim files (*.anim);; - - - - - SceneViewer::ViewerWindow - - - - Open NeL data file - Öffne NeL Daten Dateien - - - - All NeL files (*.shape *.ps);;NeL shape files (*.shape);;NeL particle system files (*.ps) - - - - - All NeL files (*.shape *.ps);; - - - - - Open skeleton file - Öffne Skelett Datei - - - - NeL skeleton file (*.skel) - NeL Skelet (*.skel) - - SheetBuilderConfigDialog @@ -4923,94 +4671,86 @@ Reason: %3 - + Driver - + + Auto + + + + + OpenAL + + + + + XAudio2 + + + + + FMod + + + + + DSound + + + + SoundAutoLoadSample - + SoundEnableOccludeObstruct - + SoundEnableReverb - + SoundManualRolloff - + SoundForceSoftware - + SoundUseADPCM - + SoundMaxTrack - - - TransformEditWidget - - Form + + SoundPackedSheetPath - - Transform + + + ... - - Position + + SoundSamplePath - - - - - X - - - - - - - Y - - - - - - - Z - - - - - Rotation - Drehung - - - - Scale - Größe - VegetableSettingsPage @@ -5055,57 +4795,4 @@ Reason: %3 - - ViewerWindow - - - MainWindow - - - - - toolBar - - - - - Object Inspector - - - - - Property Editor - - - - - Control panel animation - - - - - Add_Instance - - - - - Add_Character - - - - - Reset_Scene - - - - - Add_PointLight - - - - - Add_Landscape - - - diff --git a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_en.ts b/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_en.ts index 403d2b104..ac130014d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_en.ts +++ b/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_en.ts @@ -1,79 +1,6 @@ - - AnimEditWidget - - - - Form - - - - - - Animation - - - - - Add anim - - - - - Unload all anim and swt files - - - - - Add anim in PlayList - - - - - Delete anim from PlayList - - - - - Set duration of time in Animation control - - - - - In place - - - - - Increment pos - - - - - AnimationControl - - - Form - - - - - Loop - - - - - Play/Pause - - - - - Stop - - - Application @@ -699,35 +626,28 @@ CExampleSettingsPage - Form - GroupBox - - PushButton - - RadioButton - CheckBox @@ -2965,12 +2885,12 @@ Core::CSearchPathsSettingsPage - + Search Paths - + General @@ -2983,112 +2903,112 @@ - + About Object Viewer Qt - + <h2>Object Viewer Qt</h2><p> Ryzom Core team <p>Compiled on %1 %2 - + &Open... - + Open an existing file - + E&xit - + Ctrl+Q - + Exit the application - + &Settings - + Open the settings dialog - + &About - + Show the application's About box - + About &Qt - + Show the Qt library's About box - + About &Plugins - + Show the plugin view dialog - + &File - + &Edit - + &View - + &Tools - + &Sheet - + &Help - + StatusReady @@ -3197,144 +3117,71 @@ Reason: %3 - + + OpenGL + + + + + Direct3D + + + + Qt Style - + Style - + Use style's standard palette - + + Font + + + + + ... + + + + Graphics settings - + Driver - + Bloom effect - + Bloom density - + Square bloom - + Enable bloom effect - - MixerEditWidget - - - Form - - - - - Mixer - - - - - Enable - - - - - Slot - - - - - Start blend - - - - - End blend - - - - - Offset frame - - - - - Speed x - - - - - Start frame - - - - - End frame - - - - - Smooth - - - - - Align blend - - - - - Wrap mode: - - - - - Clamp - - - - - Repeat - - - - - Disable - - - - - Invert skeleton weight - - - - - Skeleton weight template - - - NLQT::CAnimationSetDialog @@ -3808,78 +3655,78 @@ Reason: %3 NLQT::CMainWindow - + Open NeL data file - + All NeL files (*.shape *.ps *.ig);;NeL shape files (*.shape);;NeL particle system files (*.ps)NeL Instance Group files (*.ig) - + Open skeleton file - + NeL skeleton file (*.skel) - + &Open... - + Open an existing file - + Set &background color - + Set background color - + &Reset scene - + Reset current scene - - + + Reload textures - + Save &Screenshot - + Make a screenshot of the current viewport and save - + &File - + &Tools @@ -4523,12 +4370,12 @@ Reason: %3 NLQT::GraphicsSettingsPage - + Graphics - + Object Viewer @@ -4536,12 +4383,12 @@ Reason: %3 NLQT::SoundSettingsPage - + Sound - + Object Viewer @@ -4549,52 +4396,58 @@ Reason: %3 NLQT::VegetableSettingsPage - + Vegetable - + Object Viewer - + Set new tile bank - + Tile Bank file (*.smallbank *.bank);; - + Set new tile far bank - + Tile Far Bank file (*.farbank);; - + Set MicroVegetable texture - + + Texture file (*.tga *.png *.jpg *.dds);; + Set Coarse Mesh texture + + + + Add zone files - + Zonel files (*.zonel *.zone);; @@ -4616,25 +4469,15 @@ Reason: %3 Plugin::CExampleSettingsPage - Example page - General - - Plugin::CLogPlugin - - - Not found QMainWindow Object Viewer Qt. - - - Plugin::CLogSettingsPage @@ -4656,101 +4499,6 @@ Reason: %3 - - PointLightEditWidget - - - Form - - - - - PointLight - - - - - Ambient color - - - - - Diffuse color - - - - - Specular color - - - - - Attenuation start - - - - - Attenuation end - - - - - Spot angle begin - - - - - Spot angle end - - - - - Influence light map - - - - - SceneViewer::AnimEditWidget - - - Open NeL anim file - - - - - NeL anim files (*.anim);; - - - - - SceneViewer::ViewerWindow - - - - Open NeL data file - - - - - All NeL files (*.shape *.ps);;NeL shape files (*.shape);;NeL particle system files (*.ps) - - - - - All NeL files (*.shape *.ps);; - - - - - Open skeleton file - - - - - NeL skeleton file (*.skel) - - - SheetBuilderConfigDialog @@ -4923,92 +4671,84 @@ Reason: %3 - + Driver - + + Auto + + + + + OpenAL + + + + + XAudio2 + + + + + FMod + + + + + DSound + + + + SoundAutoLoadSample - + SoundEnableOccludeObstruct - + SoundEnableReverb - + SoundManualRolloff - + SoundForceSoftware - + SoundUseADPCM - + SoundMaxTrack - - - TransformEditWidget - - Form + + SoundPackedSheetPath - - Transform + + + ... - - Position - - - - - - - X - - - - - - - Y - - - - - - - Z - - - - - Rotation - - - - - Scale + + SoundSamplePath @@ -5055,57 +4795,4 @@ Reason: %3 - - ViewerWindow - - - MainWindow - - - - - toolBar - - - - - Object Inspector - - - - - Property Editor - - - - - Control panel animation - - - - - Add_Instance - - - - - Add_Character - - - - - Reset_Scene - - - - - Add_PointLight - - - - - Add_Landscape - - - diff --git a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_fr.ts b/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_fr.ts index fd082fbdb..d980a0914 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_fr.ts +++ b/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_fr.ts @@ -1,79 +1,6 @@ - - AnimEditWidget - - - - Form - - - - - - Animation - - - - - Add anim - - - - - Unload all anim and swt files - - - - - Add anim in PlayList - - - - - Delete anim from PlayList - - - - - Set duration of time in Animation control - - - - - In place - - - - - Increment pos - - - - - AnimationControl - - - Form - - - - - Loop - - - - - Play/Pause - - - - - Stop - - - Application @@ -699,35 +626,28 @@ CExampleSettingsPage - Form - GroupBox - - PushButton - - RadioButton - CheckBox @@ -2965,12 +2885,12 @@ Core::CSearchPathsSettingsPage - + Search Paths - + General @@ -2983,112 +2903,112 @@ - + About Object Viewer Qt - + <h2>Object Viewer Qt</h2><p> Ryzom Core team <p>Compiled on %1 %2 - + &Open... - + Open an existing file - + E&xit - + Ctrl+Q - + Exit the application - + &Settings - + Open the settings dialog - + &About - + Show the application's About box - + About &Qt - + Show the Qt library's About box - + About &Plugins - + Show the plugin view dialog - + &File - + &Edit - + &View - + &Tools - + &Sheet - + &Help - + StatusReady @@ -3197,144 +3117,71 @@ Reason: %3 - + + OpenGL + + + + + Direct3D + + + + Qt Style - + Style - + Use style's standard palette - + + Font + + + + + ... + + + + Graphics settings - + Driver - + Bloom effect - + Bloom density - + Square bloom - + Enable bloom effect - - MixerEditWidget - - - Form - - - - - Mixer - - - - - Enable - - - - - Slot - - - - - Start blend - - - - - End blend - - - - - Offset frame - - - - - Speed x - - - - - Start frame - - - - - End frame - - - - - Smooth - - - - - Align blend - - - - - Wrap mode: - - - - - Clamp - - - - - Repeat - - - - - Disable - - - - - Invert skeleton weight - - - - - Skeleton weight template - - - NLQT::CAnimationSetDialog @@ -3808,78 +3655,78 @@ Reason: %3 NLQT::CMainWindow - + Open NeL data file - + All NeL files (*.shape *.ps *.ig);;NeL shape files (*.shape);;NeL particle system files (*.ps)NeL Instance Group files (*.ig) - + Open skeleton file - + NeL skeleton file (*.skel) - + &Open... - + Open an existing file - + Set &background color - + Set background color - + &Reset scene - + Reset current scene - - + + Reload textures - + Save &Screenshot - + Make a screenshot of the current viewport and save - + &File - + &Tools @@ -4523,12 +4370,12 @@ Reason: %3 NLQT::GraphicsSettingsPage - + Graphics - + Object Viewer @@ -4536,12 +4383,12 @@ Reason: %3 NLQT::SoundSettingsPage - + Sound - + Object Viewer @@ -4549,52 +4396,58 @@ Reason: %3 NLQT::VegetableSettingsPage - + Vegetable - + Object Viewer - + Set new tile bank - + Tile Bank file (*.smallbank *.bank);; - + Set new tile far bank - + Tile Far Bank file (*.farbank);; - + Set MicroVegetable texture - + + Texture file (*.tga *.png *.jpg *.dds);; + Set Coarse Mesh texture + + + + Add zone files - + Zonel files (*.zonel *.zone);; @@ -4616,25 +4469,15 @@ Reason: %3 Plugin::CExampleSettingsPage - Example page - General - - Plugin::CLogPlugin - - - Not found QMainWindow Object Viewer Qt. - - - Plugin::CLogSettingsPage @@ -4656,101 +4499,6 @@ Reason: %3 - - PointLightEditWidget - - - Form - - - - - PointLight - - - - - Ambient color - - - - - Diffuse color - - - - - Specular color - - - - - Attenuation start - - - - - Attenuation end - - - - - Spot angle begin - - - - - Spot angle end - - - - - Influence light map - - - - - SceneViewer::AnimEditWidget - - - Open NeL anim file - - - - - NeL anim files (*.anim);; - - - - - SceneViewer::ViewerWindow - - - - Open NeL data file - - - - - All NeL files (*.shape *.ps);;NeL shape files (*.shape);;NeL particle system files (*.ps) - - - - - All NeL files (*.shape *.ps);; - - - - - Open skeleton file - - - - - NeL skeleton file (*.skel) - - - SheetBuilderConfigDialog @@ -4923,92 +4671,84 @@ Reason: %3 - + Driver - + + Auto + + + + + OpenAL + + + + + XAudio2 + + + + + FMod + + + + + DSound + + + + SoundAutoLoadSample - + SoundEnableOccludeObstruct - + SoundEnableReverb - + SoundManualRolloff - + SoundForceSoftware - + SoundUseADPCM - + SoundMaxTrack - - - TransformEditWidget - - Form + + SoundPackedSheetPath - - Transform + + + ... - - Position - - - - - - - X - - - - - - - Y - - - - - - - Z - - - - - Rotation - - - - - Scale + + SoundSamplePath @@ -5055,57 +4795,4 @@ Reason: %3 - - ViewerWindow - - - MainWindow - - - - - toolBar - - - - - Object Inspector - - - - - Property Editor - - - - - Control panel animation - - - - - Add_Instance - - - - - Add_Character - - - - - Reset_Scene - - - - - Add_PointLight - - - - - Add_Landscape - - - diff --git a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_ru.ts b/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_ru.ts index c7f0c1fe1..e67722c12 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_ru.ts +++ b/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_ru.ts @@ -1,79 +1,6 @@ - - AnimEditWidget - - - - Form - Форма - - - - - Animation - - - - - Add anim - Загрузить *.anim файлы - - - - Unload all anim and swt files - Выгрузить все anim и swt файлы - - - - Add anim in PlayList - Добавить анимацию в плейлист - - - - Delete anim from PlayList - Удалить анимацию из плейлиста - - - - Set duration of time in Animation control - Установить продолжительность времени проигрывания - - - - In place - На месте - - - - Increment pos - - - - - AnimationControl - - - Form - Форма - - - - Loop - Повтор - - - - Play/Pause - Играть/Пауза - - - - Stop - Стоп - - Application @@ -699,35 +626,28 @@ CExampleSettingsPage - Form Форма - GroupBox - - PushButton - - RadioButton - CheckBox @@ -1405,7 +1325,7 @@ Display box - + Отображать bbox @@ -1425,7 +1345,7 @@ Link to skeleton - + Присоединить к скелету @@ -1445,7 +1365,7 @@ Clear anim - + Очистить anim @@ -1789,7 +1709,7 @@ s - + сек @@ -2492,7 +2412,7 @@ Browse - Обзор + Обзор @@ -2965,12 +2885,12 @@ Core::CSearchPathsSettingsPage - + Search Paths Пути поиска - + General Основные @@ -2983,112 +2903,112 @@ - + About Object Viewer Qt О Object Viewer Qt - + <h2>Object Viewer Qt</h2><p> Ryzom Core team <p>Compiled on %1 %2 - + &Open... &Открыть... - + Open an existing file Открыть файл - + E&xit В&ыход - + Ctrl+Q - + Exit the application Выйти из приложения - + &Settings &Настройки - + Open the settings dialog Открыть диалог настроек - + &About О программе - + Show the application's About box Открыть диалог О программе - + About &Qt О &Qt - + Show the Qt library's About box Открыть диалог О Qt - + About &Plugins О &модулях - + Show the plugin view dialog Показать диалог списка плагинов - + &File &Файл - + &Edit &Правка - + &View &Вид - + &Tools &Иструменты - + &Sheet - + &Help &Справка - + StatusReady @@ -3197,142 +3117,69 @@ Reason: %3 Форма - + + OpenGL + + + + + Direct3D + + + + Qt Style - Qt стиль + Qt стиль - + Style - Стиль + Стиль - + Use style's standard palette - + + Font + Шрифт + + + + ... + + + + Graphics settings - Графические настройки + Графические настройки - + Driver - Драйвер + Драйвер - + Bloom effect - Блум эффект + Блум эффект - + Bloom density - Плотность блума + Плотность блума - + Square bloom - + Enable bloom effect - Включить блум эффект - - - - MixerEditWidget - - - Form - Форма - - - - Mixer - - - - - Enable - Включить - - - - Slot - - - - - Start blend - Начало смешивания - - - - End blend - Конец смешивания - - - - Offset frame - Смещение кадра - - - - Speed x - Скорость - - - - Start frame - Начальный кадр - - - - End frame - Конечный кадр - - - - Smooth - Плавность - - - - Align blend - - - - - Wrap mode: - Режим: - - - - Clamp - - - - - Repeat - Повтор - - - - Disable - Отключить - - - - Invert skeleton weight - Ивертировать веса скелета - - - - Skeleton weight template - + Включить блум эффект @@ -3811,78 +3658,78 @@ Reason: %3 NLQT::CMainWindow - + Open NeL data file Открыть NeL файлы - + All NeL files (*.shape *.ps *.ig);;NeL shape files (*.shape);;NeL particle system files (*.ps)NeL Instance Group files (*.ig) - + Open skeleton file - + NeL skeleton file (*.skel) файл NeL скелета (*.skel) - + &Open... &Открыть... - + Open an existing file Открыть файл - + Set &background color &Установить фоновый цвет - + Set background color Установить фоновый цвет - + &Reset scene С&бросить сцену - + Reset current scene Сбросить текукщую сцену - - + + Reload textures Перегрузить текстуры - + Save &Screenshot Сохранить с&криншот - + Make a screenshot of the current viewport and save Создать скриншот окна просмотра и сохранить - + &File &Файл - + &Tools &Иструменты @@ -4528,12 +4375,12 @@ Reason: %3 NLQT::GraphicsSettingsPage - + Graphics Графика - + Object Viewer @@ -4541,12 +4388,12 @@ Reason: %3 NLQT::SoundSettingsPage - + Sound Звук - + Object Viewer @@ -4554,52 +4401,58 @@ Reason: %3 NLQT::VegetableSettingsPage - + Vegetable - + Object Viewer - + Set new tile bank - + Tile Bank file (*.smallbank *.bank);; - + Set new tile far bank - + Tile Far Bank file (*.farbank);; - + Set MicroVegetable texture - + + Texture file (*.tga *.png *.jpg *.dds);; + Set Coarse Mesh texture + + + + Add zone files - + Zonel files (*.zonel *.zone);; @@ -4621,25 +4474,15 @@ Reason: %3 Plugin::CExampleSettingsPage - Example page - General Главное - - Plugin::CLogPlugin - - - Not found QMainWindow Object Viewer Qt. - - - Plugin::CLogSettingsPage @@ -4661,101 +4504,6 @@ Reason: %3 - - PointLightEditWidget - - - Form - Форма - - - - PointLight - - - - - Ambient color - - - - - Diffuse color - - - - - Specular color - - - - - Attenuation start - Начало затухания освещенности - - - - Attenuation end - Конец затухания освещенности - - - - Spot angle begin - - - - - Spot angle end - - - - - Influence light map - - - - - SceneViewer::AnimEditWidget - - - Open NeL anim file - - - - - NeL anim files (*.anim);; - - - - - SceneViewer::ViewerWindow - - - - Open NeL data file - Открыть NeL файлы - - - - All NeL files (*.shape *.ps);;NeL shape files (*.shape);;NeL particle system files (*.ps) - - - - - All NeL files (*.shape *.ps);; - - - - - Open skeleton file - - - - - NeL skeleton file (*.skel) - файл NeL скелета (*.skel) - - SheetBuilderConfigDialog @@ -4925,104 +4673,96 @@ Reason: %3 Form - Форма + Форма - + Driver - Драйвер + Драйвер - + + Auto + Авто + + + + OpenAL + + + + + XAudio2 + + + + + FMod + + + + + DSound + + + + SoundAutoLoadSample - + SoundEnableOccludeObstruct - + SoundEnableReverb - + SoundManualRolloff - + SoundForceSoftware - + SoundUseADPCM - + SoundMaxTrack - - - TransformEditWidget - - Form - Форма - - - - Transform + + SoundPackedSheetPath - - Position - Позиция - - - - - - X + + + ... - - - - Y + + SoundSamplePath - - - - - Z - - - - - Rotation - - - - - Scale - Шасштаб - VegetableSettingsPage Form - Форма + Форма @@ -5060,57 +4800,4 @@ Reason: %3 - - ViewerWindow - - - MainWindow - - - - - toolBar - - - - - Object Inspector - - - - - Property Editor - - - - - Control panel animation - - - - - Add_Instance - - - - - Add_Character - - - - - Reset_Scene - - - - - Add_PointLight - - - - - Add_Landscape - - - diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 7ff3fe5a7..43021767c 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -2393,7 +2393,7 @@ void CGroupMap::createContinentLandMarks() static void hideTeleportButtonsInPopupMenuIfNotEnoughPriv() { - bool showTeleport = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG()); + bool showTeleport = (hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeVG() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeEG()); CInterfaceManager *im = CInterfaceManager::getInstance(); CInterfaceElement *ie = im->getElementFromId("ui:interface:map_menu:teleport"); diff --git a/code/ryzom/common/src/game_share/stdpch.h b/code/ryzom/common/src/game_share/stdpch.h index 736a81afd..18f6f00e0 100644 --- a/code/ryzom/common/src/game_share/stdpch.h +++ b/code/ryzom/common/src/game_share/stdpch.h @@ -18,6 +18,7 @@ #include #include +#include #include #include #include