Jump to content

Change specular on hair


Recommended Posts

Hello, can someone explain to me, how can i make this system to read item_vnum instead of ShapeIndex from root/msm ?

I m new in this and i don t know much in c++ for change it myself -_-

Can someone help ?

InstanceBase.cpp

void CInstanceBase::SetHair(DWORD eHair )
{
    if (!HAIR_COLOR_ENABLE)
        return;

    if (IsPC()==false)
        return;

    m_awPart[CRaceData::PART_HAIR] = eHair;


    CItemData* pItemData;
    {

        float fSpecular = 0.028f;
        if (CItemManager::Instance().GetItemDataPointer(eHair, &pItemData))
            float fSpecularPower = pItemData->GetSpecularPowerf();

        m_GraphicThingInstance.SetHair(eHair, fSpecular);

    }

}

ActorInstanceData.cpp

if (pkRes)
            {
                if (fSpecular > 0.0f)
                {
                    SMaterialData kMaterialData;
                    kMaterialData.pImage = dynamic_cast<CGraphicImage*>(pkRes);
                    kMaterialData.isSpecularEnable = TRUE;
                    kMaterialData.fSpecularPower = fSpecular;
                    kMaterialData.bSphereMapIndex = 0;
                    SetMaterialData(CRaceData::PART_HAIR, c_rkSkinItem.m_stSrcFileName.c_str(), kMaterialData);
                }
                else
                    SetMaterialImagePointer(CRaceData::PART_HAIR, c_rkSkinItem.m_stSrcFileName.c_str(), dynamic_cast<CGraphicImage*>(pkRes));
            }

AcrtorInstance.h

void SetHair(DWORD eHair, float fSpecular = 0.0f);

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.