aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Orbis/Orbis_Minecraft.cpp
diff options
context:
space:
mode:
authorqwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com>2026-03-16 21:44:26 -0500
committerGitHub <noreply@github.com>2026-03-16 21:44:26 -0500
commitce739f6045ec72127491286ea3f3f21e537c1b55 (patch)
treef33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.Client/Orbis/Orbis_Minecraft.cpp
parent255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff)
parent5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff)
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.Client/Orbis/Orbis_Minecraft.cpp')
-rw-r--r--Minecraft.Client/Orbis/Orbis_Minecraft.cpp50
1 files changed, 27 insertions, 23 deletions
diff --git a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp
index 64616565..7531b25d 100644
--- a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp
+++ b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp
@@ -32,6 +32,7 @@
//#include "NetworkManager.h"
#include "..\..\Minecraft.Client\Tesselator.h"
#include "..\..\Minecraft.Client\Options.h"
+#include "..\GameRenderer.h"
#include "Sentient\SentientManager.h"
#include "..\..\Minecraft.World\IntCache.h"
#include "..\Textures.h"
@@ -362,7 +363,7 @@ HRESULT InitD3D( IDirect3DDevice9 **ppDevice,
return pD3D->CreateDevice(
0,
D3DDEVTYPE_HAL,
- NULL,
+ nullptr,
D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_BUFFER_2_FRAMES,
pd3dPP,
ppDevice );
@@ -381,16 +382,16 @@ void MemSect(int sect)
#endif
#ifndef __ORBIS__
-HINSTANCE g_hInst = NULL;
-HWND g_hWnd = NULL;
+HINSTANCE g_hInst = nullptr;
+HWND g_hWnd = nullptr;
D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL;
D3D_FEATURE_LEVEL g_featureLevel = D3D_FEATURE_LEVEL_11_0;
-ID3D11Device* g_pd3dDevice = NULL;
-ID3D11DeviceContext* g_pImmediateContext = NULL;
-IDXGISwapChain* g_pSwapChain = NULL;
-ID3D11RenderTargetView* g_pRenderTargetView = NULL;
-ID3D11DepthStencilView* g_pDepthStencilView = NULL;
-ID3D11Texture2D* g_pDepthStencilBuffer = NULL;
+ID3D11Device* g_pd3dDevice = nullptr;
+ID3D11DeviceContext* g_pImmediateContext = nullptr;
+IDXGISwapChain* g_pSwapChain = nullptr;
+ID3D11RenderTargetView* g_pRenderTargetView = nullptr;
+ID3D11DepthStencilView* g_pDepthStencilView = nullptr;
+ID3D11Texture2D* g_pDepthStencilBuffer = nullptr;
//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
@@ -455,7 +456,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance)
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, "Minecraft");
- wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = "Minecraft";
wcex.lpszClassName = "MinecraftClass";
@@ -479,7 +480,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
g_hInst = hInstance; // Store instance handle in our global variable
g_hWnd = CreateWindow("MinecraftClass", "Minecraft", WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
if (!g_hWnd)
{
@@ -543,7 +544,7 @@ HRESULT InitDevice()
for( UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++ )
{
g_driverType = driverTypes[driverTypeIndex];
- hr = D3D11CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, featureLevels, numFeatureLevels,
+ hr = D3D11CreateDeviceAndSwapChain( nullptr, g_driverType, nullptr, createDeviceFlags, featureLevels, numFeatureLevels,
D3D11_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice, &g_featureLevel, &g_pImmediateContext );
if( HRESULT_SUCCEEDED( hr ) )
break;
@@ -552,7 +553,7 @@ HRESULT InitDevice()
return hr;
// Create a render target view
- ID3D11Texture2D* pBackBuffer = NULL;
+ ID3D11Texture2D* pBackBuffer = nullptr;
hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), ( LPVOID* )&pBackBuffer );
if( FAILED( hr ) )
return hr;
@@ -571,7 +572,7 @@ HRESULT InitDevice()
descDepth.BindFlags = D3D11_BIND_DEPTH_STENCIL;
descDepth.CPUAccessFlags = 0;
descDepth.MiscFlags = 0;
- hr = g_pd3dDevice->CreateTexture2D(&descDepth, NULL, &g_pDepthStencilBuffer);
+ hr = g_pd3dDevice->CreateTexture2D(&descDepth, nullptr, &g_pDepthStencilBuffer);
D3D11_DEPTH_STENCIL_VIEW_DESC descDSView;
descDSView.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
@@ -580,7 +581,7 @@ HRESULT InitDevice()
hr = g_pd3dDevice->CreateDepthStencilView(g_pDepthStencilBuffer, &descDSView, &g_pDepthStencilView);
- hr = g_pd3dDevice->CreateRenderTargetView( pBackBuffer, NULL, &g_pRenderTargetView );
+ hr = g_pd3dDevice->CreateRenderTargetView( pBackBuffer, nullptr, &g_pRenderTargetView );
pBackBuffer->Release();
if( FAILED( hr ) )
return hr;
@@ -773,7 +774,7 @@ int main(int argc, const char *argv[] )
MSG msg = {0};
while( WM_QUIT != msg.message )
{
- if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
+ if( PeekMessage( &msg, nullptr, 0, 0, PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
@@ -919,7 +920,7 @@ int main(int argc, const char *argv[] )
StorageManager.Init(0,app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app,"");
StorageManager.SetSaveTitleExtraFileSuffix(app.GetString(IDS_SAVE_SUBTITLE_SUFFIX));
StorageManager.SetDLCInfoMap(app.GetSonyDLCMap());
- app.CommerceInit(); // MGH - moved this here so GetCommerce isn't NULL
+ app.CommerceInit(); // MGH - moved this here so GetCommerce isn't nullptr
// 4J-PB - Kick of the check for trial or full version - requires ui to be initialised
app.GetCommerce()->CheckForTrialUpgradeKey();
@@ -939,7 +940,7 @@ int main(int argc, const char *argv[] )
}
// Create an XAudio2 mastering voice (utilized by XHV2 when voice data is mixed to main speakers)
- hr = g_pXAudio2->CreateMasteringVoice(&g_pXAudio2MasteringVoice, XAUDIO2_DEFAULT_CHANNELS, XAUDIO2_DEFAULT_SAMPLERATE, 0, 0, NULL);
+ hr = g_pXAudio2->CreateMasteringVoice(&g_pXAudio2MasteringVoice, XAUDIO2_DEFAULT_CHANNELS, XAUDIO2_DEFAULT_SAMPLERATE, 0, 0, nullptr);
if ( FAILED( hr ) )
{
app.DebugPrintf( "Creating XAudio2 mastering voice failed (err = 0x%08x)!\n", hr );
@@ -1089,7 +1090,7 @@ int main(int argc, const char *argv[] )
// Minecraft::main () used to call Minecraft::Start, but this takes ~2.5 seconds, so now running this in another thread
// so we can do some basic renderer calls whilst it is happening. This is at attempt to stop getting TRC failure on SubmitDone taking > 5 seconds on boot
- C4JThread *minecraftThread = new C4JThread(&StartMinecraftThreadProc, NULL, "Running minecraft start");
+ C4JThread *minecraftThread = new C4JThread(&StartMinecraftThreadProc, nullptr, "Running minecraft start");
minecraftThread->Run();
do
{
@@ -1194,7 +1195,7 @@ int main(int argc, const char *argv[] )
// We should track down why though...
app.DebugPrintf("---init sound engine()\n");
- pMinecraft->soundEngine->init(NULL);
+ pMinecraft->soundEngine->init(nullptr);
while (TRUE)
{
@@ -1249,7 +1250,7 @@ int main(int argc, const char *argv[] )
else
{
MemSect(28);
- pMinecraft->soundEngine->tick(NULL, 0.0f);
+ pMinecraft->soundEngine->tick(nullptr, 0.0f);
MemSect(0);
pMinecraft->textures->tick(true,false);
IntCache::Reset();
@@ -1302,6 +1303,9 @@ int main(int argc, const char *argv[] )
#endif
ui.tick();
ui.render();
+
+ pMinecraft->gameRenderer->ApplyGammaPostProcess();
+
#if 0
app.HandleButtonPresses();
@@ -1487,7 +1491,7 @@ uint8_t *mallocAndCreateUTF8ArrayFromString(int iID)
uint8_t * AddRichPresenceString(int iID)
{
uint8_t *strUtf8 = mallocAndCreateUTF8ArrayFromString(iID);
- if( strUtf8 != NULL )
+ if( strUtf8 != nullptr )
{
vRichPresenceStrings.push_back(strUtf8);
}
@@ -1497,7 +1501,7 @@ uint8_t * AddRichPresenceString(int iID)
void FreeRichPresenceStrings()
{
uint8_t *strUtf8;
- for(int i=0;i<vRichPresenceStrings.size();i++)
+ for(size_t i=0;i<vRichPresenceStrings.size();i++)
{
strUtf8=vRichPresenceStrings.at(i);
free(strUtf8);