From fcda9456081ba71282d2ddb12aad47df5940b813 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:08:15 +0100 Subject: [PATCH 1/9] Fixed: Wrong default shape names --HG-- branch : develop --- code/ryzom/client/src/interface_v3/character_3d.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/character_3d.cpp b/code/ryzom/client/src/interface_v3/character_3d.cpp index f711fb764..291ab763d 100644 --- a/code/ryzom/client/src/interface_v3/character_3d.cpp +++ b/code/ryzom/client/src/interface_v3/character_3d.cpp @@ -55,11 +55,11 @@ SCharacter3DSetup::SCharacter3DSetup () Male = true; Skeleton = "fy_hom_skel.skel"; 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_Arms].Name = "FY_HOM_underwear_armpad.shape"; - Parts[Char3DPart_Feet].Name = "FY_HOM_underwear_bottes.shape"; - Parts[Char3DPart_Face].Name = "FY_HOM_visage.shape"; + Parts[Char3DPart_Arms].Name = "TR_HOM_underwear_armpad.shape"; + Parts[Char3DPart_Feet].Name = "TR_HOM_underwear_bottes.shape"; + Parts[Char3DPart_Face].Name = "TR_HOM_visage.shape"; Parts[Char3DPart_Head].Name = "FY_HOM_cheveux_medium01.shape"; Parts[Char3DPart_Hands].Name = "TR_HOM_underwear_hand.shape"; Parts[Char3DPart_HandRightItem].Name = ""; From f51b33cc3b2974ed11988d3ea1f676b2f23ddefb Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:09:41 +0100 Subject: [PATCH 2/9] Fixed: Use correct shape for boots when caster dress is equipped --HG-- branch : develop --- .../client/src/interface_v3/character_3d.cpp | 44 +++++++++++++ code/ryzom/client/src/player_cl.cpp | 63 +++++++++++++++++-- 2 files changed, 101 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/character_3d.cpp b/code/ryzom/client/src/interface_v3/character_3d.cpp index 291ab763d..0773a1a77 100644 --- a/code/ryzom/client/src/interface_v3/character_3d.cpp +++ b/code/ryzom/client/src/interface_v3/character_3d.cpp @@ -440,6 +440,50 @@ void SCharacter3DSetup::setupFromCS_ModelCol (SLOTTYPE::EVisualSlot s, sint32 mo else 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 { Parts[part].AdvFx = item->FX.getAdvantageFX(); diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index a050ac197..1052f0742 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -542,12 +542,63 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color) { const CItemSheet *item = _Items[slot].Sheet; - // If the gender is a female get the right shape. - if(_Gender == GSGENDER::female) - equip(slot, item->getShapeFemale(), item); - // Else get the default shape. - else - equip(slot, item->getShape(), item); + std::string shapeName = _Gender == GSGENDER::female ? item->getShapeFemale():item->getShape(); + + // use the right type of boots if wearing a caster dress + 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 + { + 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. UInstance pInst = _Instances[slot].createLoadingFromCurrent(); From d67d831afe2a9ad40499b0a6fe2e3fa47a196f6d Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:12:01 +0100 Subject: [PATCH 3/9] Fixed: Use white color for underwears everywhere (even if it's a bug in EGS...) Changed: Don't call applyColorSlot twice if item exists --HG-- branch : develop --- code/ryzom/client/src/interface_v3/character_3d.cpp | 3 +++ code/ryzom/client/src/player_cl.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/character_3d.cpp b/code/ryzom/client/src/interface_v3/character_3d.cpp index 0773a1a77..b9d289be9 100644 --- a/code/ryzom/client/src/interface_v3/character_3d.cpp +++ b/code/ryzom/client/src/interface_v3/character_3d.cpp @@ -508,6 +508,9 @@ void SCharacter3DSetup::setupFromCS_ModelCol (SLOTTYPE::EVisualSlot s, sint32 mo } else { + // fix underwears color + if (model == 0) col = 6; // white + if ((part == Char3DPart_HandLeftItem) || (part == Char3DPart_HandRightItem)) Parts[part].Name = "none.shape"; } diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index 1052f0742..7a91f4480 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -525,8 +525,8 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, const std::string &shapeName, else 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)) - applyColorSlot(_Instances[s], skin(), 0, _HairColor, _EyesColor); + if (!item && (slot != SLOTTYPE::RIGHT_HAND_SLOT) && (slot != SLOTTYPE::LEFT_HAND_SLOT)) + applyColorSlot(_Instances[s], skin(), 6, _HairColor, _EyesColor); }// equip // From 08205daaccb04eaf450e8c77a95d5baec66c4338 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:12:44 +0100 Subject: [PATCH 4/9] Changed: Remove old equivalent code --HG-- branch : develop --- code/ryzom/client/src/player_cl.cpp | 34 ----------------------------- 1 file changed, 34 deletions(-) diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index 7a91f4480..c4dc5b85f 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -642,40 +642,6 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color) 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: - nlwarning("PL::equip(2):%d: default equipement used for an unknown slot.", _Slot); - break; - } -*/ } }// equip // From ad981b15c7abe0533499922eab61db51880decd8 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:13:08 +0100 Subject: [PATCH 5/9] Changed: Translate comment in english --HG-- branch : develop --- code/ryzom/client/src/player_cl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index c4dc5b85f..b95ee429c 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -734,7 +734,7 @@ void CPlayerCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycle * // To re-link the skeleton to the mount if needed. parent(parent()); // 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 // Get Lod Character Id from the sheet. sint clodId= getLodCharacterId(*Scene, _PlayerSheet->GenderInfos[_Gender].LodCharacterName); From 935809b40f692ad73ef95ffe285a3da4d3165eaf Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:14:13 +0100 Subject: [PATCH 6/9] Changed: There is no client_default.cfg.in anymore --HG-- branch : develop --- code/ryzom/client/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 29ec33d09..43249b54d 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -12,7 +12,7 @@ IF(WITH_RYZOM_PATCH) ADD_DEFINITIONS(-DRZ_USE_PATCH) 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_INTERFACE interface_v3/*.h interface_v3/*.cpp) FILE(GLOB SRC_MODE motion/modes/*.cpp motion/modes/*.h) From f04ebac4831787bd72ac1af2d1d0ced6cf190a30 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:18:01 +0100 Subject: [PATCH 7/9] Changed: Only display this warning in debug, because occurs when underwears are equipped --HG-- branch : develop --- code/ryzom/client/src/player_cl.cpp | 2 +- code/ryzom/client/src/player_r2_cl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index b95ee429c..8ecaaaaef 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -628,7 +628,7 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color) // Default equipment. 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); if(idx != -1) { diff --git a/code/ryzom/client/src/player_r2_cl.cpp b/code/ryzom/client/src/player_r2_cl.cpp index 39d6ffac3..b4269dd54 100644 --- a/code/ryzom/client/src/player_r2_cl.cpp +++ b/code/ryzom/client/src/player_r2_cl.cpp @@ -403,7 +403,7 @@ void CPlayerR2CL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color) // Default equipment. 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(getGenderInfo()->Items[slot], slot); From c0a3345c838cc13c362ffb7e86f6595a0431f4d8 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:18:53 +0100 Subject: [PATCH 8/9] Changed: Simplified code --HG-- branch : develop --- code/ryzom/client/src/player_cl.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index 8ecaaaaef..97e378c2b 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -634,12 +634,10 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color) { if(SheetMngr.getItem(slot, (uint)idx)) { - // If the gender is a female get the right shape. - 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()); + const CItemSheet *itemSheet = SheetMngr.getItem(slot, (uint)idx); + + // If the gender is a female get the right shape else get the default shape. + equip(slot, _Gender == GSGENDER::female ? itemSheet->getShapeFemale():itemSheet->getShape()); } } } From 08671a2c57fa042c8c4818b1c0187a126db34ac0 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:19:51 +0100 Subject: [PATCH 9/9] Changed: Minor changes --HG-- branch : develop --- code/ryzom/client/src/init_main_loop.cpp | 7 ++++--- code/ryzom/client/src/player_cl.cpp | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index 63bad66c4..b7383e308 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -741,7 +741,7 @@ void initMainLoop() nmsg = "Creating Landscape ..."; ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); Landscape = Scene->createLandscape(); - if(Landscape == 0) + if(Landscape == NULL) nlerror("initMainLoop : Cannot create a Landscape."); if (!ClientCfg.Light) @@ -829,7 +829,7 @@ void initMainLoop() H_AUTO(InitRZWorld) // Initialize World and select the right continent. - nmsg = "Loading World ..."; + nmsg = "Loading World ..."; ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); ContinentMngr.load(); ContinentMngr.select(UserEntity->pos(), ProgressBar); @@ -880,8 +880,9 @@ void initMainLoop() { nlwarning("Can't load HLSBank: %s", e.what()); } + // setup according to client - if(ClientCfg.HDTextureInstalled) + if (ClientCfg.HDTextureInstalled) { if(ClientCfg.HDEntityTexture) { diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index 97e378c2b..f94fb5e78 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -469,8 +469,6 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, const std::string &shapeName, return; } - - // Attach to the skeleton. string stickPoint; if(!_Skeleton.empty())