Compare commits

..

1 Commits

@ -41,8 +41,8 @@ OPTION(HUNTER_ENABLED "Enable Hunter package manager" OFF)
IF(HUNTER_ENABLED)
INCLUDE("CMakeModules/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.321.tar.gz"
SHA1 "5e53cbb0429037ea8e2592bfd92704b8ff3ab492"
URL "https://github.com/cpp-pm/hunter/archive/v0.23.317.tar.gz"
SHA1 "fbdd94b1966d351384e27b02c8d134915b1131d6"
FILEPATH "${CMAKE_CURRENT_LIST_DIR}/CMakeModules/HunterConfig.cmake"
)

@ -380,7 +380,7 @@ extern bool _assertex_stop_1(bool &ignoreNextTime);
#define nlassume(exp) do { } while (0)
#endif
#ifdef NL_NO_ASSERT
#ifdef NL_NO_DEBUG
# define nlassert(exp) nlassume(exp)
# define nlassertonce(exp) nlassume(exp)
# define nlassertex(exp, str) nlassume(exp)

@ -274,7 +274,7 @@
//#define NL_NO_DEBUG
#undef NL_NO_DEBUG
#define NL_NO_ASSERT
// Standard types

@ -377,6 +377,9 @@ CCharacterCL::CCharacterCL()
_CustomScale = 1.f;
_OldCustomScale = 0.f;
_StepCustomScale = 0.f;
_StartCustomScale = ryzomGetLocalTime();
}// CCharacterCL //
//-----------------------------------------------
@ -1690,13 +1693,38 @@ void CCharacterCL::updateVisualPropertyVpb(const NLMISC::TGameCycle &/* gameCycl
nlinfo("(%05d,%03d) CH:updtVPVpb:%d: Scale(%d)", sint32(T1%100000), NetMngr.getCurrentServerTick(), _Slot,
(uint)altLookProp.PropertySubData.Scale);
}
// Save old scale
float oldCustomScale = _CustomScale;
float customScale;
// Set new scale
if (altLookProp.PropertySubData.Scale==0)
_CustomScale = 1.f;
customScale = 1.f;
else
_CustomScale = (float)altLookProp.PropertySubData.Scale/100.f;
customScale = ((float)altLookProp.PropertySubData.Scale/100.f);
nlinfo("customScale = %f", customScale);
_StartCustomScale = ryzomGetLocalTime();
if (_OldCustomScale == 0) // first time
{
_StartCustomScale -= 1001.f;
_OldCustomScale = 1.f;
_CustomScale = 1.f;
}
_StepCustomScale = customScale - _CustomScale;
_OldCustomScale = _CustomScale;
}
void CCharacterCL::scale(bool calculate)
{
// Save old scale
float oldCustomScale = _CustomScale;
_CustomScale = _OldCustomScale + (float(ryzomGetLocalTime() - _StartCustomScale) / 1000.f) * _StepCustomScale;
if ((_StepCustomScale >= 0 && _CustomScale > _OldCustomScale+_StepCustomScale)
|| (_StepCustomScale < 0 && _CustomScale < _OldCustomScale+_StepCustomScale))
{
_CustomScale = _OldCustomScale+_StepCustomScale;
_StepCustomScale = 0;
}
// Apply modification
_CustomScalePos /= oldCustomScale;
_CustomScalePos *= _CustomScale;
@ -2121,6 +2149,7 @@ double CCharacterCL::computeSpeed()
//-----------------------------------------------
double CCharacterCL::computeSpeedFactor(double speedToDest)
{
double speedFactor = 1.0;
// \todo GUIGUI : optimize emotes, currently it's badly designed.
@ -6047,6 +6076,9 @@ void CCharacterCL::updateAttachedFX()
//-----------------------------------------------
void CCharacterCL::updateVisible (const TTime &currentTimeInMs, CEntityCL *target)
{
if (_StepCustomScale)
scale();
// Changes the skeleton state
if(!_Skeleton.empty())
{
@ -6274,11 +6306,6 @@ void CCharacterCL::updateVisiblePostPos(const NLMISC::TTime &currentTimeInMs, CE
pos = (box().getMin() + box().getMax())/2;
pos.z = box().getMax().z;
}
CRaceStatsSheet *sheet = const_cast<CRaceStatsSheet*>(UserEntity->playerSheet());
float namePosZ = sheet->GenderInfos[UserEntity->getGender()].NamePosZNormal;
if (pos.z > box().getMin().z + namePosZ)
pos.z = box().getMin().z + namePosZ;
nlassert(isValidDouble(pos.x) && isValidDouble(pos.y) && isValidDouble(pos.z));
_CurrentBubble->Position = pos;
}
@ -6567,6 +6594,7 @@ ADD_METHOD(void CCharacterCL::updatePos(const TTime &currentTimeInMs, CEntityCL
_OldAutomaton = _CurrentAutomaton;
// Compute the Time Step.
double frameTimeRemaining = computeTimeStep(((double)currentTimeInMs)*0.001);
// Update the LodCharacter Animation.
if(_LodCharacterAnimEnabled)
{

@ -712,6 +712,9 @@ protected:
sint64 _LastSelectBoxComputeTime;
float _CustomScale;
float _OldCustomScale;
float _StepCustomScale;
NLMISC::TTime _StartCustomScale;
/// Pointer on the Sheet with basic parameters.
const CCharacterSheet *_Sheet;
@ -872,6 +875,8 @@ protected:
/// Method to Flag the character as alive and do everything needed.
virtual void setAlive();
void scale(bool calculate = true);
///
double computeTimeStep(const double &currentTime);

@ -747,10 +747,6 @@ public:
CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src);
CDBCtrlSheet *pCSSrc = dynamic_cast<CDBCtrlSheet*>(pElt);
CDBCtrlSheet *pCSDst = dynamic_cast<CDBCtrlSheet*>(pCaller);
// end drag
getInventory().endDrag();
if ((pCSSrc == NULL) || (pCSDst == NULL)) return;
if (pCSSrc->getType() == CCtrlSheetInfo::SheetType_Item)

@ -309,6 +309,7 @@ CCtrlSheetInfo::CCtrlSheetInfo()
_InterfaceColor= true;
_SheetSelectionGroup = -1;
_UseQuality = true;
_DisplayItemQuality = true;
_UseQuantity = true;
_DuplicateOnDrag = false;
_ItemSlot= SLOTTYPE::UNDEFINED;
@ -1276,9 +1277,6 @@ void CDBCtrlSheet::setupItem ()
sint32 sheet = _SheetId.getSInt32();
_DispQuality = -1;
_DispQuantity = -1;
// If this is the same sheet, need to resetup
if (_LastSheetId != sheet || _NeedSetup)
{
@ -1292,6 +1290,13 @@ void CDBCtrlSheet::setupItem ()
{
_ItemSheet = (CItemSheet*)pES;
// Display the item quality?
_DisplayItemQuality= _UseQuality &&
_ItemSheet->Family != ITEMFAMILY::COSMETIC &&
_ItemSheet->Family != ITEMFAMILY::TELEPORT &&
_ItemSheet->Family != ITEMFAMILY::SERVICE
;
_DispSheetBmpId = rVR.getTextureIdFromName (_ItemSheet->getIconMain());
// if file not found or empty, replace by default icon
if( _DispSheetBmpId == -1)
@ -1345,11 +1350,21 @@ void CDBCtrlSheet::setupItem ()
_DispQuantity = _Quantity.getSInt32();
}
}
else
// do not display any number
_DispQuantity = -1;
}
else _DispQuantity = -1;
// Setup quality
if(_UseQuality)
if(_DisplayItemQuality)
{
_DispQuality= _Quality.getSInt32();
}
else
{
_DispQuality= -1;
}
// special icon text
if( _NeedSetup || _ItemSheet->getIconText() != _OptString )
@ -1388,7 +1403,7 @@ void CDBCtrlSheet::setupItem ()
}
// update quality. NB: if quality change, the must updateItemCharacRequirement
if(_UseQuality)
if(_DisplayItemQuality)
{
sint32 newQuality= _Quality.getSInt32();
if(newQuality!=_DispQuality)
@ -1397,6 +1412,10 @@ void CDBCtrlSheet::setupItem ()
updateItemCharacRequirement(_LastSheetId);
}
}
else
{
_DispQuality= -1;
}
// update armour color (if USER_COLOR db change comes after SHEET change)
if(_ArmourColorFromDB && _UserColor)
@ -1409,31 +1428,6 @@ void CDBCtrlSheet::setupItem ()
}
}
if (_ItemSheet != NULL)
{
switch(_ItemSheet->Family)
{
case ITEMFAMILY::ARMOR:
case ITEMFAMILY::MELEE_WEAPON:
case ITEMFAMILY::RANGE_WEAPON:
case ITEMFAMILY::SHIELD:
case ITEMFAMILY::JEWELRY:
case ITEMFAMILY::CRAFTING_TOOL:
case ITEMFAMILY::HARVEST_TOOL:
case ITEMFAMILY::TAMING_TOOL:
case ITEMFAMILY::TRAINING_TOOL:
// hide 'x0' and 'x1' stack count for equipable items
if (_DispQuantity < 2)
_DispQuantity = -1;
break;
default:
// hide 'q0'and 'q1' quality for every other item
if (_DispQuality < 2)
_DispQuality = -1;
break;
}
}
// at each frame, must test for grayed.
if(_AutoGrayed)
{
@ -1899,6 +1893,8 @@ void CDBCtrlSheet::setupOutpostBuilding()
{
COutpostBuildingSheet *pOBSheet = (COutpostBuildingSheet*)pES;
_DisplayItemQuality = false;
_DispSheetBmpId = rVR.getTextureIdFromName (pOBSheet->getIconMain());
// if file not found or empty, replace by default icon
if( _DispSheetBmpId == -1)
@ -2539,7 +2535,7 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
sint32 hArea = (hSheet / 4);
sint32 xIcon = x;
// move buff icons up a row, quantity text is displayed on bottom-left corner
sint32 yIcon = y + (_DispQuantity > 0 ? hArea : 0);
sint32 yIcon = y + hArea;
for (uint i = 0; i < _BuffIcons.size(); ++i)
{
sint32 wIcon = _BuffIcons[i].IconW;

@ -164,6 +164,7 @@ public:
bool _UseQuantity : 1; // is the quantity read and displayed ?
bool _ReadQuantityFromSheet : 1; // Read quantity from sheet rather than from database
bool _UseQuality : 1; // is the quality read and displayed ?
bool _DisplayItemQuality : 1; // Do we have to display the quality for the item (false for Cosmetics and Teleport and if _UseQuality==fasle)?
bool _DuplicateOnDrag : 1; // when dragged, the item is shown twice : one version at the mouse position.
// and another in the source slot. Useful for items to buy that are in infinite quantity.
bool _AutoGrayed : 1; // if true then gray the ctrlSheeet if: 1/ Items: Is the Item Locked. 2/ Bricks: is the brick Latent.

@ -1437,34 +1437,6 @@ void CInterface3DShape::setName (const std::string &ht)
}
}
std::string CInterface3DShape::getTextures() const
{
return _Textures;
}
void CInterface3DShape::setTextures(const std::string &textures)
{
if (textures.empty())
return;
_Textures = textures;
vector<string> texList;
splitString(textures, " ", texList);
for(uint j=0;j<_Instance.getNumMaterials();j++)
{
sint numStages = _Instance.getMaterial(j).getLastTextureStage() + 1;
for(sint l = 0; l < numStages; l++)
{
if (_Instance.getMaterial(j).isTextureFile((uint) l))
{
_Instance.getMaterial(j).setTextureFileName(texList[std::min((int)j, (int)texList.size()-1)], (uint) l);
}
}
}
}
// ----------------------------------------------------------------------------
// CInterface3DCamera
// ----------------------------------------------------------------------------

@ -265,15 +265,11 @@ public:
std::string getName() const;
void setName (const std::string &ht);
std::string getTextures() const;
void setTextures (const std::string &textures);
float getBBoxSizeX () const;
float getBBoxSizeY () const;
float getBBoxSizeZ () const;
REFLECT_EXPORT_START(CInterface3DShape, CInterfaceElement)
REFLECT_FLOAT("getBBoxSizeX", getBBoxSizeX, setPosX);
REFLECT_FLOAT("getBBoxSizeY", getBBoxSizeY, setPosX);
@ -285,7 +281,6 @@ public:
REFLECT_FLOAT ("roty", getRotY, setRotY);
REFLECT_FLOAT ("rotz", getRotZ, setRotZ);
REFLECT_STRING ("name", getName, setName);
REFLECT_STRING("textures", getTextures, setTextures);
REFLECT_EXPORT_END
protected:
@ -294,7 +289,6 @@ protected:
NLMISC::CVector _Pos;
NLMISC::CVector _Rot;
std::string _Name;
std::string _Textures;
};
/**
@ -403,15 +397,6 @@ public:
float getTgtY() const { return _Target.y; }
float getTgtZ() const { return _Target.z; }
float getRotZ() const { return _Rot.z; }
void setRotZ(float f) { _Rot.z = f; }
float getRotY() const { return _Rot.y; }
void setRotY(float f) { _Rot.y = f; }
float getDist() const { return _Dist; }
void setDist(float f) { _Dist = f; }
REFLECT_EXPORT_START(CInterface3DCamera, CInterfaceElement)
REFLECT_FLOAT ("posx", getPosX, setPosX);
REFLECT_FLOAT ("posy", getPosY, setPosY);
@ -419,13 +404,19 @@ public:
REFLECT_FLOAT ("tgtx", getTgtX, setTgtX);
REFLECT_FLOAT ("tgty", getTgtY, setTgtY);
REFLECT_FLOAT ("tgtz", getTgtZ, setTgtZ);
REFLECT_FLOAT ("rotz", getRotZ, setRotZ);
REFLECT_FLOAT ("roty", getRotY, setRotY);
REFLECT_FLOAT ("dist", getDist, setDist);
REFLECT_FLOAT ("fov", getFOV, setFOV);
REFLECT_FLOAT ("roll", getRoll, setRoll);
REFLECT_EXPORT_END
float getRotZ() const { return _Rot.z; }
void setRotZ(float f) { _Rot.z = f; }
float getRotY() const { return _Rot.y; }
void setRotY(float f) { _Rot.y = f; }
float getDist() const { return _Dist; }
void setDist(float f) { _Dist = f; }
void reset(); // Reset user interaction
protected:

@ -2420,13 +2420,15 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
texture = "";
}
std::vector<string>texList;
if (!texture.empty())
splitString(texture, " ", texList);
for(uint j=0;j<instance.getNumMaterials();j++)
{
if (highlight)
if (!highlight)
{
/*instance.getMaterial(j).setAmbient(CRGBA(0,0,0,255));
instance.getMaterial(j).setEmissive(CRGBA(255,255,255,255));
instance.getMaterial(j).setShininess(10.0f);*/
}
else
{
instance.getMaterial(j).setAmbient(CRGBA(0,0,0,255));
instance.getMaterial(j).setEmissive(CRGBA(255,0,0,255));
@ -2439,7 +2441,9 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
for(sint l = 0; l < numStages; l++)
{
if (instance.getMaterial(j).isTextureFile((uint) l))
instance.getMaterial(j).setTextureFileName(texList[std::min((int)j, (int)texList.size()-1)], (uint) l);
{
instance.getMaterial(j).setTextureFileName(texture, (uint) l);
}
}
}
}

Loading…
Cancel
Save