From 110f1715ea9ab511bd8e32496b2bfe12986b67ba Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 29 Mar 2020 13:54:09 +0300 Subject: [PATCH 1/5] Fixed: Hide 'sound disabled' warning on startup --- ryzom/client/src/interface_v3/music_player.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ryzom/client/src/interface_v3/music_player.cpp b/ryzom/client/src/interface_v3/music_player.cpp index 2deaa965b..f4d8b7db9 100644 --- a/ryzom/client/src/interface_v3/music_player.cpp +++ b/ryzom/client/src/interface_v3/music_player.cpp @@ -379,7 +379,10 @@ public: { if(!SoundMngr) { - CInterfaceManager::getInstance()->messageBox (CI18N::get ("uiSoundDisabled")); + // Do not show warning on volume change as its restored at startup + if (Params.find("volume") == std::string::npos) + CInterfaceManager::getInstance()->messageBox (CI18N::get ("uiMP3SoundDisabled")); + return; } From ddd16d485194407e534745b21c25d664d0e71734 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 29 Mar 2020 16:33:53 +0300 Subject: [PATCH 2/5] Fixed: Animal marker invalidates map on each frame --- ryzom/client/src/interface_v3/group_map.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ryzom/client/src/interface_v3/group_map.cpp b/ryzom/client/src/interface_v3/group_map.cpp index 5245ca304..24e1d14cc 100644 --- a/ryzom/client/src/interface_v3/group_map.cpp +++ b/ryzom/client/src/interface_v3/group_map.cpp @@ -1333,15 +1333,18 @@ void CGroupMap::checkCoords() { if( _AnimalLM[i] ) { + // update pos + sint32 px, py; + _AnimalPosStates[i]->getPos(px, py); + updateLMPosFromDBPos(_AnimalLM[i], px, py); + if (_IsIsland) { _AnimalLM[i]->setActive(false); } - else + else if (_AnimalLM[i]->getActive()) { - _AnimalLM[i]->setActive(true); // update texture from animal status - CInterfaceManager *pIM= CInterfaceManager::getInstance(); CCDBNodeLeaf *statusNode = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:PACK_ANIMAL:BEAST%d", i) + ":STATUS", false); if (statusNode && ANIMAL_STATUS::isInStable((ANIMAL_STATUS::EAnimalStatus)statusNode->getValue32()) ) { @@ -1372,11 +1375,6 @@ void CGroupMap::checkCoords() case ANIMAL_TYPE::Demon: sPrefix = "uiPATitleDemon"; break; } _AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(sPrefix+toString(i+1))); - - // update pos - sint32 px, py; - _AnimalPosStates[i]->getPos(px, py); - updateLMPosFromDBPos(_AnimalLM[i], px, py); } } } From 67b74ad2b74b808ac4ba53bbd44bcbca0d0415d6 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 30 Mar 2020 10:11:17 +0300 Subject: [PATCH 3/5] Added: Ingame config options for window snap. --- ryzom/client/client_default.cfg | 3 +++ ryzom/client/src/main_loop_utilities.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ryzom/client/client_default.cfg b/ryzom/client/client_default.cfg index 7d134ad01..f18cd06a2 100644 --- a/ryzom/client/client_default.cfg +++ b/ryzom/client/client_default.cfg @@ -338,6 +338,9 @@ R2EDMaxMapScale = 8.0; WindowSnapInvert = 0; WindowSnapDistance = 10; +WindowSnapDistance_min = 0; +WindowSnapDistance_max = 50; +WindowSnapDistance_step = 1; ////////////////// // SOUND CONFIG // diff --git a/ryzom/client/src/main_loop_utilities.cpp b/ryzom/client/src/main_loop_utilities.cpp index 4243e15b0..4a4b2bc38 100644 --- a/ryzom/client/src/main_loop_utilities.cpp +++ b/ryzom/client/src/main_loop_utilities.cpp @@ -110,6 +110,9 @@ void updateFromClientCfg() if (ClientCfg.BilinearUI != LastClientCfg.BilinearUI) CViewRenderer::getInstance()->setBilinearFiltering(ClientCfg.BilinearUI); + CWidgetManager::getInstance()->setWindowSnapInvert(ClientCfg.WindowSnapInvert); + CWidgetManager::getInstance()->setWindowSnapDistance(ClientCfg.WindowSnapDistance); + //--------------------------------------------------- if (ClientCfg.WaitVBL != LastClientCfg.WaitVBL) { From e020c9f0d0e0049958e60d7a3a01550742be943f Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 31 Mar 2020 14:33:31 +0800 Subject: [PATCH 4/5] Avoid bad memory access in LOD texture failure case, ref ryzom/ryzomcore_graphics#22 --- nel/src/3d/lod_character_manager.cpp | 3 +++ nel/tools/3d/build_clodtex/lod_texture_builder.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nel/src/3d/lod_character_manager.cpp b/nel/src/3d/lod_character_manager.cpp index 92dee846a..f5d6a23c5 100644 --- a/nel/src/3d/lod_character_manager.cpp +++ b/nel/src/3d/lod_character_manager.cpp @@ -979,6 +979,9 @@ void CLodCharacterManager::addTextureCompute(CLodCharacterInstance &instance, // get lookup ptr. nlassert(lodTexture.Texture.size()==NL3D_CLOD_TEXT_SIZE); + if (lodTexture.Texture.size() < NL3D_CLOD_TEXT_SIZE) + return; + const CLodCharacterTexture::CTUVQ *lookUpPtr= &lodTexture.Texture[0]; // apply the lodTexture, taking only better quality (ie nearer 0) diff --git a/nel/tools/3d/build_clodtex/lod_texture_builder.cpp b/nel/tools/3d/build_clodtex/lod_texture_builder.cpp index d7ca00e9f..b0ff316df 100644 --- a/nel/tools/3d/build_clodtex/lod_texture_builder.cpp +++ b/nel/tools/3d/build_clodtex/lod_texture_builder.cpp @@ -135,6 +135,9 @@ bool CLodTextureBuilder::computeTexture(const CMeshMRM &meshMRM, NL3D::CLodCha const uint8 *srcPos= (const uint8*)vba.getVertexCoordPointer(); const uint8 *srcNormal= (const uint8*)vba.getNormalCoordPointer(); const uint8 *srcUV= (const uint8*)vba.getTexCoordPointer(); + nlassert(srcPos); + nlassert(srcNormal); + nlassert(srcUV); uint vertexSize = VB.getVertexSize(); // For the more precise lod uint lodId= meshMRM.getNbLod()-1; From 75777b34971fff17666a0d60e3c7ee71e73d57b3 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 Apr 2020 10:09:47 +0800 Subject: [PATCH 5/5] Fix R2 input handling. Probably broken by GUI refactoring. Fix kaetemi/ryzomclassic#81 --- .../interface_v3/input_handler_manager.cpp | 103 +++++++++++++++--- .../src/interface_v3/input_handler_manager.h | 2 +- 2 files changed, 86 insertions(+), 19 deletions(-) diff --git a/ryzom/client/src/interface_v3/input_handler_manager.cpp b/ryzom/client/src/interface_v3/input_handler_manager.cpp index 9d1e9292d..67a1b2350 100644 --- a/ryzom/client/src/interface_v3/input_handler_manager.cpp +++ b/ryzom/client/src/interface_v3/input_handler_manager.cpp @@ -271,16 +271,16 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) { - CViewPointer &rIP = *static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); + CViewPointer &rIP = *static_cast(CWidgetManager::getInstance()->getPointer()); NLGUI::CEventDescriptorMouse eventDesc; - sint32 x,y; - rIP.getPointerDispPos (x, y); - eventDesc.setX (x); - eventDesc.setY (y); + sint32 x, y; + rIP.getPointerDispPos(x, y); + eventDesc.setX(x); + eventDesc.setY(y); - bool handled= false; + bool handled = false; // button down ? static volatile bool doTest = false; @@ -291,7 +291,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) { if (_RecoverFocusLost) { - handled |= updateMousePos((CEventMouse&)event, eventDesc); // must update mouse pos here, + handled |= updateMousePos((CEventMouse&)event); // must update mouse pos here, // because when app window focus is gained by a mouse click, this is // the only place where we can retrieve mouse pos before a mouse move _RecoverFocusLost = false; @@ -299,10 +299,19 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) if (!handled) { if (R2::getEditor().isInitialized() - && (R2::isEditionCurrent() || R2::getEditor().getCurrentTool()) - ) + && (R2::isEditionCurrent() || R2::getEditor().getCurrentTool())) { - handled |= R2::getEditor().handleEvent(eventDesc); + const NLMISC::CEventMouseDown *mouseDownEvent = static_cast(&event); + if (mouseDownEvent->Button & NLMISC::leftButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdown); + handled |= R2::getEditor().handleEvent(eventDesc); + } + if (mouseDownEvent->Button & NLMISC::rightButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdown); + handled |= R2::getEditor().handleEvent(eventDesc); + } } } handled |= inputHandler.handleMouseButtonDownEvent( event ); @@ -321,7 +330,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) // mouse move? else if(event == EventMouseMoveId) { - handled |= updateMousePos((CEventMouse&)event, eventDesc); + handled |= updateMousePos((CEventMouse&)event); } else if (event == EventMouseWheelId) { @@ -330,19 +339,77 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) } // if Event not handled, post to Action Manager - if( !handled ) + if (!handled) { - bool handled = false; if (R2::getEditor().isInitialized() - && (R2::isEditionCurrent() || R2::getEditor().getCurrentTool()) - ) + && (R2::isEditionCurrent() || R2::getEditor().getCurrentTool())) { - handled = R2::getEditor().handleEvent(eventDesc); + if (event == EventMouseDownId) + { + const NLMISC::CEventMouseDown *mouseDownEvent = static_cast(&event); + if (mouseDownEvent->Button & NLMISC::leftButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdown); + handled |= R2::getEditor().handleEvent(eventDesc); + } + if (mouseDownEvent->Button & NLMISC::rightButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdown); + handled |= R2::getEditor().handleEvent(eventDesc); + } + } + else if (event == EventMouseUpId) + { + const NLMISC::CEventMouseUp *mouseUpEvent = static_cast(&event); + if (mouseUpEvent->Button & NLMISC::leftButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftup); + handled |= R2::getEditor().handleEvent(eventDesc); + } + if (mouseUpEvent->Button & NLMISC::rightButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightup); + handled |= R2::getEditor().handleEvent(eventDesc); + } + } + else if (event == EventMouseDblClkId) + { + const NLMISC::CEventMouseDblClk *mouseDblClkEvent = static_cast(&event); + if (mouseDblClkEvent->Button & NLMISC::leftButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdblclk); + handled |= R2::getEditor().handleEvent(eventDesc); + } + if (mouseDblClkEvent->Button & NLMISC::rightButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdblclk); + handled |= R2::getEditor().handleEvent(eventDesc); + } + } + else + { + if (event == EventMouseWheelId) + { + const NLMISC::CEventMouseWheel *wheelEvent = static_cast(&event); + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mousewheel); + eventDesc.setWheel(wheelEvent->Direction ? 1 : -1); + handled = R2::getEditor().handleEvent(eventDesc); + } + else if (event == EventMouseMoveId) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mousemove); + handled = R2::getEditor().handleEvent(eventDesc); + } + else + { + nlwarning("R2 unknown mouse event '%s'", event.toString().c_str()); + } + } } if (!handled) { // post to Action Manager - FilteredEventServer.postEvent( event.clone() ); + FilteredEventServer.postEvent(event.clone()); } } } @@ -355,7 +422,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) // *************************************************************************** -bool CInputHandlerManager::updateMousePos(NLMISC::CEventMouse &event, NLGUI::CEventDescriptorMouse &eventDesc) +bool CInputHandlerManager::updateMousePos(NLMISC::CEventMouse &event) { if (!IsMouseFreeLook()) return inputHandler.handleMouseMoveEvent( event ); diff --git a/ryzom/client/src/interface_v3/input_handler_manager.h b/ryzom/client/src/interface_v3/input_handler_manager.h index 7971ef9a8..4b078ee84 100644 --- a/ryzom/client/src/interface_v3/input_handler_manager.h +++ b/ryzom/client/src/interface_v3/input_handler_manager.h @@ -181,7 +181,7 @@ private: void parseKey(xmlNodePtr cur, std::vector &out); // return true if handled - bool updateMousePos(NLMISC::CEventMouse &event, NLGUI::CEventDescriptorMouse &eventDesc); + bool updateMousePos(NLMISC::CEventMouse &event); NLGUI::CInputHandler inputHandler;