mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-27 21:13:51 +00:00
Merge branch 'smartcmd:main' into feat/middle-click-grab-block
This commit is contained in:
commit
69e460c0af
1537 changed files with 62761 additions and 22167 deletions
|
|
@ -367,7 +367,7 @@ HRESULT InitD3D( IDirect3DDevice9 **ppDevice,
|
|||
return pD3D->CreateDevice(
|
||||
0,
|
||||
D3DDEVTYPE_HAL,
|
||||
NULL,
|
||||
nullptr,
|
||||
D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_BUFFER_2_FRAMES,
|
||||
pd3dPP,
|
||||
ppDevice );
|
||||
|
|
@ -386,16 +386,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)
|
||||
|
|
@ -460,7 +460,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";
|
||||
|
|
@ -484,7 +484,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)
|
||||
{
|
||||
|
|
@ -548,7 +548,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;
|
||||
|
|
@ -557,7 +557,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;
|
||||
|
|
@ -576,7 +576,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;
|
||||
|
|
@ -585,7 +585,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;
|
||||
|
|
@ -778,7 +778,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 );
|
||||
|
|
@ -924,7 +924,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();
|
||||
|
||||
|
|
@ -944,7 +944,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 );
|
||||
|
|
@ -1094,7 +1094,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
|
||||
{
|
||||
|
|
@ -1199,7 +1199,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)
|
||||
{
|
||||
|
|
@ -1254,7 +1254,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();
|
||||
|
|
@ -1495,7 +1495,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);
|
||||
}
|
||||
|
|
@ -1505,7 +1505,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue