Skip to content

Commit a5e3cb0

Browse files
committed
Remove #203 core code before a cleaner implementation
1 parent 95d4d0a commit a5e3cb0

File tree

2 files changed

+3
-88
lines changed

2 files changed

+3
-88
lines changed

Minecraft.Client/Windows64/Windows64_Minecraft.cpp

Lines changed: 2 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -431,90 +431,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
431431
return TRUE;
432432
}
433433
return DefWindowProc(hWnd, message, wParam, lParam);
434-
case WM_SIZE:
435-
{
436-
if (wParam == SIZE_MINIMIZED)
437-
return 0;
438-
439-
UINT width = LOWORD(lParam);
440-
UINT height = HIWORD(lParam);
441-
442-
if (width == 0 || height == 0)
443-
return 0;
444-
445-
g_ScreenWidth = width;
446-
g_ScreenHeight = height;
447-
448-
if (g_pSwapChain)
449-
{
450-
g_pImmediateContext->OMSetRenderTargets(0, 0, 0);
451-
g_pImmediateContext->ClearState();
452-
g_pImmediateContext->Flush();
453-
454-
if (g_pRenderTargetView)
455-
{
456-
g_pRenderTargetView->Release();
457-
g_pRenderTargetView = nullptr;
458-
}
459-
460-
if (g_pDepthStencilView)
461-
{
462-
g_pDepthStencilView->Release();
463-
g_pDepthStencilView = nullptr;
464-
}
465-
466-
if (g_pDepthStencilBuffer)
467-
{
468-
g_pDepthStencilBuffer->Release();
469-
g_pDepthStencilBuffer = nullptr;
470-
}
471-
472-
HRESULT hr = g_pSwapChain->ResizeBuffers(
473-
0,
474-
width,
475-
height,
476-
DXGI_FORMAT_UNKNOWN,
477-
0
478-
);
479-
480-
if (FAILED(hr))
481-
{
482-
app.DebugPrintf("ResizeBuffers Failed! HRESULT: 0x%X\n", hr);
483-
return 0;
484-
}
485-
486-
ID3D11Texture2D* pBackBuffer = nullptr;
487-
g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void**)&pBackBuffer);
488-
489-
g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, &g_pRenderTargetView);
490-
pBackBuffer->Release();
491-
492-
D3D11_TEXTURE2D_DESC descDepth = {};
493-
descDepth.Width = width;
494-
descDepth.Height = height;
495-
descDepth.MipLevels = 1;
496-
descDepth.ArraySize = 1;
497-
descDepth.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
498-
descDepth.SampleDesc.Count = 1;
499-
descDepth.BindFlags = D3D11_BIND_DEPTH_STENCIL;
500-
501-
g_pd3dDevice->CreateTexture2D(&descDepth, NULL, &g_pDepthStencilBuffer);
502-
g_pd3dDevice->CreateDepthStencilView(g_pDepthStencilBuffer, NULL, &g_pDepthStencilView);
503-
504-
g_pImmediateContext->OMSetRenderTargets(1, &g_pRenderTargetView, g_pDepthStencilView);
505-
506-
D3D11_VIEWPORT vp = {};
507-
vp.Width = (FLOAT)width;
508-
vp.Height = (FLOAT)height;
509-
vp.MinDepth = 0.0f;
510-
vp.MaxDepth = 1.0f;
511-
vp.TopLeftX = 0;
512-
vp.TopLeftY = 0;
513-
514-
g_pImmediateContext->RSSetViewports(1, &vp);
515-
}
516-
}
517-
break;
518434
default:
519435
return DefWindowProc(hWnd, message, wParam, lParam);
520436
}
@@ -1383,7 +1299,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
13831299
{
13841300
{
13851301
ui.NavigateToScene(0, eUIScene_InGameInfoMenu);
1386-
1302+
13871303
}
13881304
}
13891305
}
@@ -1406,7 +1322,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
14061322
{
14071323
if (Minecraft* pMinecraft = Minecraft::GetInstance())
14081324
{
1409-
if (pMinecraft->options && app.DebugSettingsOn() &&
1325+
if (pMinecraft->options && app.DebugSettingsOn() &&
14101326
app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL)
14111327
{
14121328
ui.NavigateToScene(0, eUIScene_DebugOverlay, NULL, eUILayer_Debug);

Minecraft.Client/glWrapper.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ extern UINT g_ScreenHeight;
5353

5454
void gluPerspective(float fovy, float aspect, float zNear, float zFar)
5555
{
56-
float dynamicAspect = (float)g_ScreenWidth / (float)g_ScreenHeight;
57-
RenderManager.MatrixPerspective(fovy, dynamicAspect, zNear, zFar);
56+
RenderManager.MatrixPerspective(fovy,aspect,zNear,zFar);
5857
}
5958

6059
void glOrtho(float left,float right,float bottom,float top,float zNear,float zFar)

0 commit comments

Comments
 (0)