Merge with develop

This commit is contained in:
kervala 2015-12-20 11:21:40 +01:00
parent b789361919
commit a7f0b854d2
5 changed files with 122 additions and 61 deletions

View file

@ -12,7 +12,7 @@ IF(WITH_RYZOM_PATCH)
ADD_DEFINITIONS(-DRZ_USE_PATCH) ADD_DEFINITIONS(-DRZ_USE_PATCH)
ENDIF() ENDIF()
FILE(GLOB CFG ../*.cfg ../*.cfg.in) FILE(GLOB CFG ../*.cfg)
FILE(GLOB SRC *.cpp *.h motion/*.cpp motion/*.h client.rc) FILE(GLOB SRC *.cpp *.h motion/*.cpp motion/*.h client.rc)
FILE(GLOB SRC_INTERFACE interface_v3/*.h interface_v3/*.cpp) FILE(GLOB SRC_INTERFACE interface_v3/*.h interface_v3/*.cpp)
FILE(GLOB SRC_MODE motion/modes/*.cpp motion/modes/*.h) FILE(GLOB SRC_MODE motion/modes/*.cpp motion/modes/*.h)

View file

@ -741,7 +741,7 @@ void initMainLoop()
nmsg = "Creating Landscape ..."; nmsg = "Creating Landscape ...";
ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) );
Landscape = Scene->createLandscape(); Landscape = Scene->createLandscape();
if(Landscape == 0) if(Landscape == NULL)
nlerror("initMainLoop : Cannot create a Landscape."); nlerror("initMainLoop : Cannot create a Landscape.");
if (!ClientCfg.Light) if (!ClientCfg.Light)
@ -880,6 +880,7 @@ void initMainLoop()
{ {
nlwarning("Can't load HLSBank: %s", e.what()); nlwarning("Can't load HLSBank: %s", e.what());
} }
// setup according to client // setup according to client
if (ClientCfg.HDTextureInstalled) if (ClientCfg.HDTextureInstalled)
{ {

View file

@ -55,11 +55,11 @@ SCharacter3DSetup::SCharacter3DSetup ()
Male = true; Male = true;
Skeleton = "fy_hom_skel.skel"; Skeleton = "fy_hom_skel.skel";
AnimPlayed = 0; AnimPlayed = 0;
Parts[Char3DPart_Chest].Name = "FY_HOM_underwear_gilet.shape"; Parts[Char3DPart_Chest].Name = "TR_HOM_underwear_gilet.shape";
Parts[Char3DPart_Legs].Name = "FY_HOM_underwear_pantabottes.shape"; Parts[Char3DPart_Legs].Name = "FY_HOM_underwear_pantabottes.shape";
Parts[Char3DPart_Arms].Name = "FY_HOM_underwear_armpad.shape"; Parts[Char3DPart_Arms].Name = "TR_HOM_underwear_armpad.shape";
Parts[Char3DPart_Feet].Name = "FY_HOM_underwear_bottes.shape"; Parts[Char3DPart_Feet].Name = "TR_HOM_underwear_bottes.shape";
Parts[Char3DPart_Face].Name = "FY_HOM_visage.shape"; Parts[Char3DPart_Face].Name = "TR_HOM_visage.shape";
Parts[Char3DPart_Head].Name = "FY_HOM_cheveux_medium01.shape"; Parts[Char3DPart_Head].Name = "FY_HOM_cheveux_medium01.shape";
Parts[Char3DPart_Hands].Name = "TR_HOM_underwear_hand.shape"; Parts[Char3DPart_Hands].Name = "TR_HOM_underwear_hand.shape";
Parts[Char3DPart_HandRightItem].Name = ""; Parts[Char3DPart_HandRightItem].Name = "";
@ -440,6 +440,50 @@ void SCharacter3DSetup::setupFromCS_ModelCol (SLOTTYPE::EVisualSlot s, sint32 mo
else else
Parts[part].Name = item->getShapeFemale(); Parts[part].Name = item->getShapeFemale();
// use the right type of boots if wearing a caster dress
if ((s == SLOTTYPE::FEET_SLOT) && (item->ItemType == ITEM_TYPE::LIGHT_BOOTS))
{
std::string shapeLegs = Parts[Char3DPart_Legs].Name;
if (shapeLegs.find("_caster01_") != std::string::npos)
{
std::string tmpName = toLower(Parts[part].Name);
std::string::size_type posBottes = tmpName.find("_bottes");
if (posBottes != std::string::npos)
{
std::string orgType = tmpName.substr(7, posBottes-7); // underwear, caster01, armor00 or armor01
tmpName.replace(posBottes+7, 0, "_" + orgType);
tmpName.replace(7, orgType.length(), "caster01");
// temporary hack because Fyros boots don't respect conventions
if (tmpName[0] == 'f')
{
if (tmpName[5] == 'f')
{
tmpName = "fy_hof_caster01_bottes_civil.shape";
}
else
{
tmpName = "fy_hom_caster01_civil01_bottes.shape";
}
}
// use fixed shape name only if file is present
if (CPath::exists(tmpName))
{
Parts[part].Name = tmpName;
}
else
{
nlwarning("File %s doesn't exist, use %s", tmpName.c_str(), Parts[part].Name.c_str());
}
}
}
}
// FX // FX
{ {
Parts[part].AdvFx = item->FX.getAdvantageFX(); Parts[part].AdvFx = item->FX.getAdvantageFX();
@ -464,6 +508,9 @@ void SCharacter3DSetup::setupFromCS_ModelCol (SLOTTYPE::EVisualSlot s, sint32 mo
} }
else else
{ {
// fix underwears color
if (model == 0) col = 6; // white
if ((part == Char3DPart_HandLeftItem) || (part == Char3DPart_HandRightItem)) if ((part == Char3DPart_HandLeftItem) || (part == Char3DPart_HandRightItem))
Parts[part].Name = "none.shape"; Parts[part].Name = "none.shape";
} }

View file

@ -469,8 +469,6 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, const std::string &shapeName,
return; return;
} }
// Attach to the skeleton. // Attach to the skeleton.
string stickPoint; string stickPoint;
if(!_Skeleton.empty()) if(!_Skeleton.empty())
@ -525,8 +523,8 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, const std::string &shapeName,
else else
nlwarning("PL::equip(1):%d: cannot create the instance '%s'.", _Slot, shapeName.c_str()); nlwarning("PL::equip(1):%d: cannot create the instance '%s'.", _Slot, shapeName.c_str());
if ((slot != SLOTTYPE::RIGHT_HAND_SLOT) && (slot != SLOTTYPE::LEFT_HAND_SLOT)) if (!item && (slot != SLOTTYPE::RIGHT_HAND_SLOT) && (slot != SLOTTYPE::LEFT_HAND_SLOT))
applyColorSlot(_Instances[s], skin(), 0, _HairColor, _EyesColor); applyColorSlot(_Instances[s], skin(), 6, _HairColor, _EyesColor);
}// equip // }// equip //
@ -542,12 +540,63 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color)
{ {
const CItemSheet *item = _Items[slot].Sheet; const CItemSheet *item = _Items[slot].Sheet;
// If the gender is a female get the right shape. std::string shapeName = _Gender == GSGENDER::female ? item->getShapeFemale():item->getShape();
if(_Gender == GSGENDER::female)
equip(slot, item->getShapeFemale(), item); // use the right type of boots if wearing a caster dress
// Else get the default shape. if ((slot == SLOTTYPE::FEET_SLOT) && (item->ItemType == ITEM_TYPE::LIGHT_BOOTS))
{
std::string shapeLegs;
if (!_Instances[SLOTTYPE::LEGS_SLOT].Loading.empty())
{
shapeLegs = _Instances[SLOTTYPE::LEGS_SLOT].LoadingName;
}
else if (!_Instances[SLOTTYPE::LEGS_SLOT].Current.empty())
{
shapeLegs = _Instances[SLOTTYPE::LEGS_SLOT].CurrentName;
}
if (!shapeLegs.empty() && shapeLegs.find("_caster01_") != std::string::npos)
{
std::string tmpName = toLower(shapeName);
std::string::size_type posBottes = tmpName.find("_bottes");
if (posBottes != std::string::npos)
{
std::string orgType = tmpName.substr(7, posBottes-7); // underwear, caster01, armor00 or armor01
tmpName.replace(posBottes+7, 0, "_" + orgType);
tmpName.replace(7, orgType.length(), "caster01");
// temporary hack because Fyros boots don't respect conventions
if (tmpName[0] == 'f')
{
if (tmpName[5] == 'f')
{
tmpName = "fy_hof_caster01_bottes_civil.shape";
}
else else
equip(slot, item->getShape(), item); {
tmpName = "fy_hom_caster01_civil01_bottes.shape";
}
}
// use fixed shape name only if file is present
if (CPath::exists(tmpName))
{
shapeName = tmpName;
}
else
{
nlwarning("File %s doesn't exist, use %s", tmpName.c_str(), shapeName.c_str());
}
}
}
}
// If the gender is a female get the right shape else get the default shape.
equip(slot, shapeName, item);
// Check there is a shape. // Check there is a shape.
UInstance pInst = _Instances[slot].createLoadingFromCurrent(); UInstance pInst = _Instances[slot].createLoadingFromCurrent();
@ -577,54 +626,18 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color)
// Default equipment. // Default equipment.
else else
{ {
nlwarning("PL:equip(2):%d: VS '%d' default equipement used.", _Slot, slot); nldebug("PL:equip(2):%d: VS '%d' default equipement used.", _Slot, slot);
sint idx = SheetMngr.getVSIndex(_PlayerSheet->GenderInfos[_Gender].Items[slot], slot); sint idx = SheetMngr.getVSIndex(_PlayerSheet->GenderInfos[_Gender].Items[slot], slot);
if(idx != -1) if(idx != -1)
{ {
if(SheetMngr.getItem(slot, (uint)idx)) if(SheetMngr.getItem(slot, (uint)idx))
{ {
// If the gender is a female get the right shape. const CItemSheet *itemSheet = SheetMngr.getItem(slot, (uint)idx);
if(_Gender == GSGENDER::female)
equip(slot, SheetMngr.getItem(slot, (uint)idx)->getShapeFemale());
// Else get the default shape.
else
equip(slot, SheetMngr.getItem(slot, (uint)idx)->getShape());
}
}
/*
//
switch(slot)
{
case SLOTTYPE::CHEST_SLOT:
nlwarning("PL::equip(2):%d: default equipement used for the Chest.", _Slot);
equip(slot, _DefaultChest);
break;
case SLOTTYPE::LEGS_SLOT:
nlwarning("PL::equip(2):%d: default equipement used for the Legs.", _Slot);
equip(slot, _DefaultLegs);
break;
case SLOTTYPE::ARMS_SLOT:
nlwarning("PL::equip(2):%d: default equipement used for the Arms.", _Slot);
equip(slot, _DefaultArms);
break;
case SLOTTYPE::HANDS_SLOT:
nlwarning("PL::equip(2):%d: default equipement used for the Hands.", _Slot);
equip(slot, _DefaultHands);
break;
case SLOTTYPE::FEET_SLOT:
nlwarning("PL::equip(2):%d: default equipement used for the Feet.", _Slot);
equip(slot, _DefaultFeet);
break;
case SLOTTYPE::HEAD_SLOT:
nlwarning("PL::equip(2):%d: default equipement used for the Head.", _Slot);
equip(slot, _DefaultHair);
break;
default: // If the gender is a female get the right shape else get the default shape.
nlwarning("PL::equip(2):%d: default equipement used for an unknown slot.", _Slot); equip(slot, _Gender == GSGENDER::female ? itemSheet->getShapeFemale():itemSheet->getShape());
break; }
} }
*/
} }
}// equip // }// equip //
@ -717,7 +730,7 @@ void CPlayerCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycle *
// To re-link the skeleton to the mount if needed. // To re-link the skeleton to the mount if needed.
parent(parent()); parent(parent());
// Set the skeleton scale. // Set the skeleton scale.
// \todo GUIGUI: mettre le scale aussi dans race_stats. // \todo GUIGUI: put scale too in race_stats.
// Setup Lod Character skeleton, if skeleton exist // Setup Lod Character skeleton, if skeleton exist
// Get Lod Character Id from the sheet. // Get Lod Character Id from the sheet.
sint clodId= getLodCharacterId(*Scene, _PlayerSheet->GenderInfos[_Gender].LodCharacterName); sint clodId= getLodCharacterId(*Scene, _PlayerSheet->GenderInfos[_Gender].LodCharacterName);

View file

@ -403,7 +403,7 @@ void CPlayerR2CL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color)
// Default equipment. // Default equipment.
else else
{ {
nlwarning("PL:equip(2):%d: VS '%d' default equipement used.", _Slot, slot); nldebug("PL:equip(2):%d: VS '%d' default equipement used.", _Slot, slot);
//sint idx = SheetMngr.getVSIndex(_PlayerSheet->GenderInfos[_Gender].Items[slot], slot); //sint idx = SheetMngr.getVSIndex(_PlayerSheet->GenderInfos[_Gender].Items[slot], slot);
sint idx = SheetMngr.getVSIndex(getGenderInfo()->Items[slot], slot); sint idx = SheetMngr.getVSIndex(getGenderInfo()->Items[slot], slot);