[fix] 심각한 누수 고침

This commit is contained in:
fbtk
2025-11-12 21:19:57 +09:00
parent 63ac80f0ce
commit 5dd409b984
9 changed files with 51 additions and 49 deletions
@@ -20,6 +20,7 @@ uint g_iIndexV;
uint g_iQuestType;
Texture2D g_Texture;
Texture2D g_Texture1;
Texture2D g_Texture2;
Texture2D g_DiffuseTexture;
Texture2D g_MaskingTexture;
@@ -63,7 +64,7 @@ struct PS_OUT
float4 vColor : SV_Target0;
};
PS_OUT PS_MAIN(PS_IN In) // 일반 UI
PS_OUT PS_MAIN(PS_IN In) // ?쇰컲 UI
{
PS_OUT Out;
@@ -98,47 +99,47 @@ PS_OUT PS_Clamp(PS_IN In)
return Out;
}
PS_OUT PS_Cursor(PS_IN In) // 마우스 커서
PS_OUT PS_Cursor(PS_IN In) // 留덉슦??而ㅼ꽌
{
PS_OUT Out;
float4 Color = float4(0.f, 0.f, 0.f, 0.f); // Out에 출력하기 위한 값
float4 White = float4(1.f, 1.f, 1.f, 1.f); // 마지막에 하얀색으로 바꿔주기 위한 값
float4 Color = float4(0.f, 0.f, 0.f, 0.f); // Out??異쒕젰?섍린 ?꾪븳 媛?
float4 White = float4(1.f, 1.f, 1.f, 1.f); // 留덉?留됱뿉 ?섏??됱쑝濡?諛붽퓭二쇨린 ?꾪븳 媛?
float2 UV = In.vTexcoord; // UV를 돌리기 위해서 받아옴
float2 Center = float2(0.5f, 0.5f); // 이미지를 회전 하기 전에 중심으로 옮길 값
float2 UV = In.vTexcoord; // UV瑜??뚮━湲??꾪빐??諛쏆븘??
float2 Center = float2(0.5f, 0.5f); // ?대?吏€瑜??뚯쟾 ?섍린 ?꾩뿉 以묒떖?쇰줈 ??만 媛?
float CW = -g_fTime; // 시계 방향
float CCW = g_fTime; // 반시계 방향
float CW = -g_fTime; // ?쒓퀎 諛⑺뼢
float CCW = g_fTime; // 諛섏떆怨?諛⑺뼢
float2 RedCircle = UV; // 빨간 원을 반시계 방향으로 돌려주기 위한 준비
float2 RedUV = UV - Center; // 중심으로 옮겨줌
// 값을 돌리기 위해서 회전 행렬을 만들어 준다.
RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW); // x축은 x*cos(각도) - y*sin(각도)
RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW); // y축은 x*sin(각도) + y*cos(각도)
RedCircle = RedCircle + Center; // 이제 위에서 다 돌려주면 다시 중심에서 원점으로 옮겨준다.
float2 RedCircle = UV; // 鍮④컙 ?먯쓣 諛섏떆怨?諛⑺뼢?쇰줈 ?뚮젮二쇨린 ?꾪븳 以€鍮?
float2 RedUV = UV - Center; // 以묒떖?쇰줈 ??꺼以?
// 媛믪쓣 ?뚮━湲??꾪빐???뚯쟾 ?됰젹??留뚮뱾??以€??
RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW); // x異뺤? x*cos(媛곷룄) - y*sin(媛곷룄)
RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW); // y異뺤? x*sin(媛곷룄) + y*cos(媛곷룄)
RedCircle = RedCircle + Center; // ?댁젣 ?꾩뿉?????뚮젮二쇰㈃ ?ㅼ떆 以묒떖?먯꽌 ?먯젏?쇰줈 ??꺼以€??
float2 BlueCircle = UV; // 파란색은 시계 방향으로 돌려준다
float2 BlueUV = UV - Center; // 중심으로 옮겨줌
// 값을 돌리기 위해서 회전 행렬을 만들어 준다.
BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW); // x축은 x*cos(각도) - y*sin(각도)
BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW); // y축은 x*sin(각도) + y*cos(각도)
BlueCircle = BlueCircle + Center; // 이제 위에서 다 돌려주면 다시 중심에서 원점으로 옮겨준다.
float2 BlueCircle = UV; // ?뚮??됱? ?쒓퀎 諛⑺뼢?쇰줈 ?뚮젮以€??
float2 BlueUV = UV - Center; // 以묒떖?쇰줈 ??꺼以?
// 媛믪쓣 ?뚮━湲??꾪빐???뚯쟾 ?됰젹??留뚮뱾??以€??
BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW); // x異뺤? x*cos(媛곷룄) - y*sin(媛곷룄)
BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW); // y異뺤? x*sin(媛곷룄) + y*cos(媛곷룄)
BlueCircle = BlueCircle + Center; // ?댁젣 ?꾩뿉?????뚮젮二쇰㈃ ?ㅼ떆 以묒떖?먯꽌 ?먯젏?쇰줈 ??꺼以€??
// 두개 다 같은 이미지 인데 원의 색상이 2개임
float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle); // 큰 원은 빨간색임
float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle); // 작은 원은 파란색임
// ?먭컻 ??媛숈? ?대?吏€ ?몃뜲 ?먯쓽 ?됱긽??2媛쒖엫
float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle); // ???먯? 鍮④컙?됱엫
float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle); // ?묒? ?먯? ?뚮??됱엫
if (Texture1.r >= 0.7f) // 우선 빨간 원을 먼저 그려준다.
if (Texture1.r >= 0.7f) // ?곗꽑 鍮④컙 ?먯쓣 癒쇱? 洹몃젮以€??
Color = Texture1;
if (Texture2.b >= 0.7f) // 다음으로 파란 원을 그려준다.
if (Texture2.b >= 0.7f) // ?ㅼ쓬?쇰줈 ?뚮? ?먯쓣 洹몃젮以€??
Color = Texture2;
if (all(Color.rgb <= 0.5f)) // 이제 혹시 모를 색상이 들어갈 수 있어서 한번 정리 해준다.
if (all(Color.rgb <= 0.5f)) // ?댁젣 ?뱀떆 紐⑤? ?됱긽???ㅼ뼱媛????덉뼱???쒕쾲 ?뺣━ ?댁???
discard;
Color = White; // 하얀색으로 바꿔줌
Color = White; // ?섏??됱쑝濡?諛붽퓭以?
Out.vColor = Color;
@@ -149,22 +150,22 @@ PS_OUT PS_Sptire_Sheet(PS_IN In)
{
PS_OUT Out;
float4 Color = float4(0.f, 0.f, 0.f, 0.f); // 최종 이미지 출력
float4 Color = float4(0.f, 0.f, 0.f, 0.f); // 理쒖쥌 ?대?吏€ 異쒕젰
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float2 UV = In.vTexcoord; // 이미지의 UV값
float2 UV = In.vTexcoord; // ?대?吏€??UV媛?
int iTotalFrame = g_iImageCountX * g_iImageCountY; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
int iTotalFrame = g_iImageCountX * g_iImageCountY; // ?대?吏€??理쒕? ?꾨젅??(紐?怨깊븯湲?紐뉗씤吏€)
int iCurrentFrame = int(floor(g_fTime / g_fFrame)) % iTotalFrame; // 현재 프레임이 어디 위치인지
int iCurrentFrame = int(floor(g_fTime / g_fFrame)) % iTotalFrame; // ?꾩옱 ?꾨젅?꾩씠 ?대뵒 ?꾩튂?몄?
int iFrameX = iCurrentFrame % g_iImageCountX; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
int iFrameY = iCurrentFrame / g_iImageCountX; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
int iFrameX = iCurrentFrame % g_iImageCountX; // ?꾩옱 x異뺤쓽 ?꾩튂(?꾩옱 ?대?吏€??紐뉖쾲吏?移몄쓣 蹂댁뿬以?吏€)
int iFrameY = iCurrentFrame / g_iImageCountX; // ?꾩옱 y異뺤쓽 ?꾩튂(?꾩옱 ?대?吏€??紐뉖쾲吏?以꾩쓣 蹂댁뿬以?吏€)
float fFreamWidth = 1.0 / g_iImageCountX; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
float fFreamHeight = 1.0 / g_iImageCountY; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다.
float fFreamWidth = 1.0 / g_iImageCountX; // 1.0 ?섎늻湲??대?吏€ 媛?닔瑜??댁꽌 ?쒖뭏???쇰쭏??媛덉? ?뺥빐以€??
float fFreamHeight = 1.0 / g_iImageCountY; // 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로 만든 다음에 한줄씩 밑으로 내려준다.
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 癒쇱? uv瑜?0~1???꾨땶 0~fFrameWidth濡?留뚮뱺 ?ㅼ쓬???쒖뭏???놁쑝濡?諛€?댁???
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 癒쇱? uv瑜?0~1???꾨땶 0~fFrameHeight濡?留뚮뱺 ?ㅼ쓬???쒖쨪??諛묒쑝濡??대젮以€??
float4 Texture = g_Texture.Sample(DefaultSampler, UV);
@@ -219,10 +220,13 @@ PS_OUT PS_UVMult(PS_IN In)
float2 UV = In.vTexcoord;
float4 Color = float4(0.f, 0.f, 0.f, 0.f);
float4 Texture1 = g_Texture.Sample(ClampSampler, float2(UV.x * g_fDeltaU, UV.y * g_fDeltaV));
Color = Texture1;
Out.vColor = Texture1;
Out.vColor = Color;
return Out;
}
@@ -148,6 +148,7 @@ void CGamePlay_Canvas::Free()
{
__super::Free();
SAFE_RELEASE(m_pLoading_Panel);
SAFE_RELEASE(m_pVIBufferCom);
}
@@ -23,8 +23,8 @@ HRESULT CMissionBanner_Border::Initialize(void* pArg)
Desc.fX = -248.f;
Desc.fY = 100.f;
Desc.fSizeX = 512.f;
Desc.fSizeY = 128.f;
Desc.fSizeX = 480.f;
Desc.fSizeY = 240.f;
m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) };
@@ -144,10 +144,6 @@ HRESULT CMissionBanner_Border::Bind_ShaderResources()
{
return E_FAIL;
}
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0)))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float))))
{
return E_FAIL;
@@ -143,4 +143,6 @@ void CCanvasObject::Free()
__super::Free();
m_Panels.clear();
m_PanelNames.clear();
m_Panels_map.clear(); // map 비우기
}
@@ -22,10 +22,6 @@ HRESULT CElementObject::Initialize(void* pArg)
{
return E_FAIL;
}
if (FAILED(Ready_Components(pArg)))
{
return E_FAIL;
}
return S_OK;
}
@@ -85,7 +81,6 @@ _bool CElementObject::Chack_Visible()
HRESULT CElementObject::Ready_Components(void* pArg)
{
__super::Ready_Components(pArg);
return S_OK;
}
@@ -173,4 +173,8 @@ CGameObject* CPanelObject::Find_Element(const wstring& Name)
void CPanelObject::Free()
{
__super::Free();
m_Elements.clear();
m_ElementName.clear();
m_Elements_map.clear(); // map 비우기
}