[add] client MovePatch
This commit is contained in:
@@ -25,10 +25,18 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
//_CrtSetBreakAlloc(1181);
|
||||
//_CrtSetBreakAlloc(1182);
|
||||
//_CrtSetBreakAlloc(1183);
|
||||
//_CrtSetBreakAlloc(1184);
|
||||
//_CrtSetBreakAlloc(1185);
|
||||
//_CrtSetBreakAlloc(1186);
|
||||
//_CrtSetBreakAlloc(1187);
|
||||
#endif
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
|
||||
|
||||
CMainApp* pMainApp = { nullptr };
|
||||
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
@@ -41,8 +49,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
}
|
||||
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_CLIENT));
|
||||
|
||||
MSG msg = {};
|
||||
|
||||
MSG msg;
|
||||
|
||||
pMainApp = CMainApp::Create();
|
||||
if (nullptr == pMainApp)
|
||||
@@ -106,13 +114,13 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
#endif // _DEBUG
|
||||
|
||||
pGameInstance->Compute_TimeDelta(TEXT("Timer_60"));
|
||||
|
||||
#ifdef _DEBUG
|
||||
pMainApp->Update(0.0166f);
|
||||
#endif // _DEBUG
|
||||
pMainApp->Update(1.f / 60.f);
|
||||
#endif // _DEBUG
|
||||
#ifndef _DEBUG
|
||||
pMainApp->Update(pGameInstance->Get_TimeDelta(TEXT("Timer_60")));
|
||||
#endif // !_DEBUG
|
||||
|
||||
#endif
|
||||
pMainApp->Render();
|
||||
|
||||
fTimeAcc = 0.f;
|
||||
@@ -163,7 +171,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
|
||||
RECT rcWindow = { 0, 0, g_iWinSizeX, g_iWinSizeY };
|
||||
|
||||
AdjustWindowRect(&rcWindow, WS_OVERLAPPEDWINDOW, TRUE);
|
||||
AdjustWindowRect(&rcWindow, WS_OVERLAPPEDWINDOW, FALSE);
|
||||
|
||||
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, nullptr, nullptr, hInstance, nullptr);
|
||||
@@ -178,18 +186,20 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
|
||||
g_hWnd = hWnd;
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (ImGui_ImplWin32_WndProcHandler(hWnd, message, wParam, lParam))
|
||||
if (ImGui_ImplWin32_WndProcHandler(hWnd, message, wParam, lParam)) {
|
||||
return true;
|
||||
}
|
||||
switch (message)
|
||||
{
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ PBR_LIGHT_OUT PBR_Lighting(
|
||||
Out.vShade = (kD / PI) * (NdotL * fAttenuation) * vLightColor;
|
||||
|
||||
Out.vSpecular = specularBRDF * vLightColor * fAttenuation * NdotL;
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
float GetBloomCurve(float x, float fThreshold, uint iMethod)
|
||||
|
||||
@@ -150,7 +150,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
fMetallic = vMRO.r;
|
||||
fRoughness = vMRO.g;
|
||||
fOcclusion = vMRO.b;
|
||||
|
||||
|
||||
vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic);
|
||||
}
|
||||
else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular
|
||||
|
||||
@@ -165,7 +165,7 @@ PBR_LIGHT_OUT PBR_Lighting(
|
||||
Out.vShade = (kD / PI) * (NdotL * fAttenuation) * vLightColor;
|
||||
|
||||
Out.vSpecular = specularBRDF * vLightColor * fAttenuation * NdotL;
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
float GetBloomCurve(float x, float fThreshold, uint iMethod)
|
||||
|
||||
@@ -150,7 +150,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
fMetallic = vMRO.r;
|
||||
fRoughness = vMRO.g;
|
||||
fOcclusion = vMRO.b;
|
||||
|
||||
|
||||
vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic);
|
||||
}
|
||||
else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular
|
||||
|
||||
@@ -289,6 +289,11 @@ HRESULT CRenderTarget_Manager::Refit_RenderTarget(CVIBuffer_Rect* pVIBuffer, CSh
|
||||
NewViewport.MinDepth = 0.f;
|
||||
NewViewport.MaxDepth = 1.f;
|
||||
|
||||
_float2 vResolution = { NewViewport.Width, NewViewport.Height };
|
||||
if (FAILED(pShader->Bind_RawValue("g_vResolution", &vResolution, sizeof(_float2)))) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
pOutput->Clear();
|
||||
|
||||
{ // Bind RTVs
|
||||
@@ -354,6 +359,10 @@ HRESULT CRenderTarget_Manager::Refit_RenderTarget(CVIBuffer_Rect* pVIBuffer, CSh
|
||||
m_pContext->OMSetRenderTargets(1, &m_pBackBufferRTV, m_pOriginalDSV);
|
||||
m_pContext->RSSetViewports(iNumViewPorts, &OriginalViewport);
|
||||
|
||||
vResolution = { OriginalViewport.Width, OriginalViewport.Height };
|
||||
if (FAILED(pShader->Bind_RawValue("g_vResolution", &vResolution, sizeof(_float2)))) {
|
||||
assert(false);
|
||||
}
|
||||
SAFE_RELEASE(m_pBackBufferRTV);
|
||||
SAFE_RELEASE(m_pOriginalDSV);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user