1112
This commit is contained in:
@@ -190,3 +190,21 @@ float2 Get_MovedUV(float2 vOriginalUV, float fDeltaU, float fDeltaV, uint iIndex
|
||||
float2 vOffset = float2(iIndexU * fDeltaU, iIndexV * fDeltaV);
|
||||
return vOriginalUV * vDelta + vOffset;
|
||||
}
|
||||
|
||||
float2 UV_Cutting(float2 vUV, float2 vUVCutting, int iCurrentFrame)
|
||||
{
|
||||
float2 UV = vUV; // 이미지의 UV값
|
||||
|
||||
int iTotalFrame = vUVCutting.x * vUVCutting.y; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
|
||||
|
||||
int iFrameX = iCurrentFrame % (int) vUVCutting.x; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
|
||||
int iFrameY = iCurrentFrame / (int) vUVCutting.x; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
|
||||
|
||||
float fFreamWidth = 1.0 / vUVCutting.x; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
|
||||
float fFreamHeight = 1.0 / vUVCutting.y; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다.
|
||||
|
||||
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 먼저 uv를 0~1이 아닌 0~fFrameWidth로 만든 다음에 한칸씩 옆으로 밀어준다.
|
||||
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 먼저 uv를 0~1이 아닌 0~fFrameHeight로 만든 다음에 한줄씩 밑으로 내려준다.
|
||||
|
||||
return UV;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,20 @@ _bool CTexture::Compare_GroupName(_wstring wstrGroupName)
|
||||
return m_wstrPrototypeName == wstrGroupName;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CTexture::HoverName()
|
||||
{
|
||||
if (ImGui::IsItemHovered()) {
|
||||
|
||||
ImGui::BeginTooltip(); // 툴팁 창 시작
|
||||
|
||||
ImGui::TextUnformatted(CMyTools::ToString(m_wstrPrototypeName).c_str()); // 텍스트 출력 (Text 대신 Unformatted 추천)
|
||||
|
||||
ImGui::EndTooltip(); // 툴팁 창 종료
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
HRESULT CTexture::Initialize_Prototype(TEXTURE_LOAD_TYPE eType, const _tchar* pTextureFilePath, _uint iNumTextures, _wstring wstrPrototypeName)
|
||||
{
|
||||
switch (eType)
|
||||
|
||||
@@ -116,8 +116,12 @@ class CPrototype_Manager final : public CBase
|
||||
|
||||
|
||||
*ppOut = iter->second->Clone(pDesc, pOwner);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
pTexture->HoverName();
|
||||
|
||||
if ((iIndex++ + 1) % 4 != 0)
|
||||
GUI::SameLine(); // 같은 줄에 이어서
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ class ENGINE_DLL CTexture final :
|
||||
_uint Get_Size();
|
||||
_bool Compare_GroupName(_wstring wstrGroupName);
|
||||
|
||||
#ifdef _DEBUG
|
||||
void HoverName();
|
||||
#endif
|
||||
private:
|
||||
HRESULT Initialize_Prototype(TEXTURE_LOAD_TYPE eType, const _tchar* pTextureFilePath, _uint iNumTextures, _wstring wstrPrototypeName);
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
Reference in New Issue
Block a user