강의

멘토링

커뮤니티

Inflearn Community Q&A

lsh9611017167's profile image
lsh9611017167

asked

[Game Programmer Jump-Start Class] Introduction to DirectX11

Run model

Model.cpp에서 ReadMaterial()의 SpecularTexture 부분 질문입니다.

Written on

·

46

·

Edited

0

node = node->NextSiblingElement();
if (node->GetText())
{
    wstring texture = Utils::ToWString(node->GetText());
    if (texture.length() > 0)
    {
        wstring textureStr = Utils::ToWString(node->GetText());
	if (textureStr.length() > 0)
	{
	    auto texture = RESOURCES->GetOrAddTexture(textureStr, (parentPath / textureStr).wstring());
	    material->SetSpecularMap(texture);
	}
    }
}

이렇게 강의에서 코드가 되어있습니다. 중간에 texture랑 textureStr를 if문으로 체크하는 부분이 중복으로 들어가는거 같아서 질문드립니다.

node = node->NextSiblingElement();
if (node->GetText())
{
    wstring textureStr = Utils::ToWString(node->GetText());
    if (textureStr.length() > 0)
    {
        auto texture = RESOURCES->GetOrAddTexture(textureStr, (parentPath / textureStr).wstring());
        material->SetSpecularMap(texture);
    }
}

위 코드처럼 Diffuse Texture와 Normal Texture과 동일하게 하나를 지우고 작성해도 상관없는 부분인가요??

c++directx

Answer

This question is waiting for answers
Be the first to answer!
lsh9611017167's profile image
lsh9611017167

asked

Ask a question