From a7f0b854d2935a67e4cc243947a341fc2eec2f1d Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 20 Dec 2015 11:21:40 +0100 Subject: [PATCH] Merge with develop --- code/ryzom/client/src/CMakeLists.txt | 2 +- code/ryzom/client/src/init_main_loop.cpp | 7 +- .../client/src/interface_v3/character_3d.cpp | 55 +++++++- code/ryzom/client/src/player_cl.cpp | 117 ++++++++++-------- code/ryzom/client/src/player_r2_cl.cpp | 2 +- 5 files changed, 122 insertions(+), 61 deletions(-) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index c16e36aad..d5b37d048 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) diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index 95e2a9caa..9477497f3 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/interface_v3/character_3d.cpp b/code/ryzom/client/src/interface_v3/character_3d.cpp index f711fb764..b9d289be9 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 = ""; @@ -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(); @@ -464,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 a050ac197..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()) @@ -525,8 +523,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 // @@ -542,12 +540,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(); @@ -577,54 +626,18 @@ 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) { 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()); } } -/* - // - 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 // @@ -717,7 +730,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); 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);