Merge branch 'develop' into ryzomclassic-develop

ryzomclassic-develop
kaetemi 5 years ago
commit 0f50806927

@ -979,6 +979,9 @@ void CLodCharacterManager::addTextureCompute(CLodCharacterInstance &instance,
// get lookup ptr. // get lookup ptr.
nlassert(lodTexture.Texture.size()==NL3D_CLOD_TEXT_SIZE); nlassert(lodTexture.Texture.size()==NL3D_CLOD_TEXT_SIZE);
if (lodTexture.Texture.size() < NL3D_CLOD_TEXT_SIZE)
return;
const CLodCharacterTexture::CTUVQ *lookUpPtr= &lodTexture.Texture[0]; const CLodCharacterTexture::CTUVQ *lookUpPtr= &lodTexture.Texture[0];
// apply the lodTexture, taking only better quality (ie nearer 0) // apply the lodTexture, taking only better quality (ie nearer 0)

@ -135,6 +135,9 @@ bool CLodTextureBuilder::computeTexture(const CMeshMRM &meshMRM, NL3D::CLodCha
const uint8 *srcPos= (const uint8*)vba.getVertexCoordPointer(); const uint8 *srcPos= (const uint8*)vba.getVertexCoordPointer();
const uint8 *srcNormal= (const uint8*)vba.getNormalCoordPointer(); const uint8 *srcNormal= (const uint8*)vba.getNormalCoordPointer();
const uint8 *srcUV= (const uint8*)vba.getTexCoordPointer(); const uint8 *srcUV= (const uint8*)vba.getTexCoordPointer();
nlassert(srcPos);
nlassert(srcNormal);
nlassert(srcUV);
uint vertexSize = VB.getVertexSize(); uint vertexSize = VB.getVertexSize();
// For the more precise lod // For the more precise lod
uint lodId= meshMRM.getNbLod()-1; uint lodId= meshMRM.getNbLod()-1;

@ -340,6 +340,9 @@ R2EDMaxMapScale = 8.0;
WindowSnapInvert = 0; WindowSnapInvert = 0;
WindowSnapDistance = 10; WindowSnapDistance = 10;
WindowSnapDistance_min = 0;
WindowSnapDistance_max = 50;
WindowSnapDistance_step = 1;
////////////////// //////////////////
// SOUND CONFIG // // SOUND CONFIG //

@ -1293,15 +1293,18 @@ void CGroupMap::checkCoords()
{ {
if( _AnimalLM[i] ) if( _AnimalLM[i] )
{ {
// update pos
sint32 px, py;
_AnimalPosStates[i]->getPos(px, py);
updateLMPosFromDBPos(_AnimalLM[i], px, py);
if (_IsIsland) if (_IsIsland)
{ {
_AnimalLM[i]->setActive(false); _AnimalLM[i]->setActive(false);
} }
else else if (_AnimalLM[i]->getActive())
{ {
_AnimalLM[i]->setActive(true);
// update texture from animal status // update texture from animal status
CInterfaceManager *pIM= CInterfaceManager::getInstance();
CCDBNodeLeaf *statusNode = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:PACK_ANIMAL:BEAST%d", i) + ":STATUS", false); 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()) ) if (statusNode && ANIMAL_STATUS::isInStable((ANIMAL_STATUS::EAnimalStatus)statusNode->getValue32()) )
{ {
@ -1332,11 +1335,6 @@ void CGroupMap::checkCoords()
case ANIMAL_TYPE::Demon: sPrefix = "uiPATitleDemon"; break; case ANIMAL_TYPE::Demon: sPrefix = "uiPATitleDemon"; break;
} }
_AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(sPrefix+toString(i+1))); _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);
} }
} }
} }

@ -271,16 +271,16 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
{ {
CViewPointer &rIP = *static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); CViewPointer &rIP = *static_cast<CViewPointer *>(CWidgetManager::getInstance()->getPointer());
NLGUI::CEventDescriptorMouse eventDesc; NLGUI::CEventDescriptorMouse eventDesc;
sint32 x,y; sint32 x, y;
rIP.getPointerDispPos (x, y); rIP.getPointerDispPos(x, y);
eventDesc.setX (x); eventDesc.setX(x);
eventDesc.setY (y); eventDesc.setY(y);
bool handled= false; bool handled = false;
// button down ? // button down ?
static volatile bool doTest = false; static volatile bool doTest = false;
@ -291,7 +291,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
{ {
if (_RecoverFocusLost) 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 // 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 // the only place where we can retrieve mouse pos before a mouse move
_RecoverFocusLost = false; _RecoverFocusLost = false;
@ -299,10 +299,19 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
if (!handled) if (!handled)
{ {
if (R2::getEditor().isInitialized() 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<const NLMISC::CEventMouseDown *>(&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 ); handled |= inputHandler.handleMouseButtonDownEvent( event );
@ -321,7 +330,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
// mouse move? // mouse move?
else if(event == EventMouseMoveId) else if(event == EventMouseMoveId)
{ {
handled |= updateMousePos((CEventMouse&)event, eventDesc); handled |= updateMousePos((CEventMouse&)event);
} }
else if (event == EventMouseWheelId) else if (event == EventMouseWheelId)
{ {
@ -330,19 +339,77 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
} }
// if Event not handled, post to Action Manager // if Event not handled, post to Action Manager
if( !handled ) if (!handled)
{ {
bool handled = false;
if (R2::getEditor().isInitialized() 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<const NLMISC::CEventMouseDown *>(&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<const NLMISC::CEventMouseUp *>(&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<const NLMISC::CEventMouseDblClk *>(&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<const NLMISC::CEventMouseWheel *>(&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) if (!handled)
{ {
// post to Action Manager // 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()) if (!IsMouseFreeLook())
return inputHandler.handleMouseMoveEvent( event ); return inputHandler.handleMouseMoveEvent( event );

@ -181,7 +181,7 @@ private:
void parseKey(xmlNodePtr cur, std::vector<CComboKey> &out); void parseKey(xmlNodePtr cur, std::vector<CComboKey> &out);
// return true if handled // return true if handled
bool updateMousePos(NLMISC::CEventMouse &event, NLGUI::CEventDescriptorMouse &eventDesc); bool updateMousePos(NLMISC::CEventMouse &event);
NLGUI::CInputHandler inputHandler; NLGUI::CInputHandler inputHandler;

@ -379,7 +379,10 @@ public:
{ {
if(!SoundMngr) 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; return;
} }

@ -110,6 +110,9 @@ void updateFromClientCfg()
if (ClientCfg.BilinearUI != LastClientCfg.BilinearUI) if (ClientCfg.BilinearUI != LastClientCfg.BilinearUI)
CViewRenderer::getInstance()->setBilinearFiltering(ClientCfg.BilinearUI); CViewRenderer::getInstance()->setBilinearFiltering(ClientCfg.BilinearUI);
CWidgetManager::getInstance()->setWindowSnapInvert(ClientCfg.WindowSnapInvert);
CWidgetManager::getInstance()->setWindowSnapDistance(ClientCfg.WindowSnapDistance);
//--------------------------------------------------- //---------------------------------------------------
if (ClientCfg.WaitVBL != LastClientCfg.WaitVBL) if (ClientCfg.WaitVBL != LastClientCfg.WaitVBL)
{ {

Loading…
Cancel
Save