diff --git a/build/win32/CxbxKrnl.vcxproj.filters b/build/win32/CxbxKrnl.vcxproj.filters index 7a605c689..63761dbc7 100644 --- a/build/win32/CxbxKrnl.vcxproj.filters +++ b/build/win32/CxbxKrnl.vcxproj.filters @@ -259,11 +259,21 @@ EmuD3D8 - - - - - + + HLEDatabase + + + HLEDatabase + + + HLEDatabase + + + HLEDatabase + + + HLEDatabase + @@ -402,7 +412,9 @@ HLEDatabase - + + HLEDatabase + diff --git a/src/CxbxKrnl/CxbxKrnl.cpp b/src/CxbxKrnl/CxbxKrnl.cpp index 8eda3c0ed..b6d76f2ef 100644 --- a/src/CxbxKrnl/CxbxKrnl.cpp +++ b/src/CxbxKrnl/CxbxKrnl.cpp @@ -455,7 +455,7 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit // Strip out the path, leaving only the XBE file name // NOTE: we assume that the XBE is always on the root of the D: drive // This is a safe assumption as the Xbox kernel ALWAYS mounts D: as the Xbe Path - if (fileName.rfind('\\') >= 0) + if (fileName.rfind('\\') != std::string::npos) fileName = fileName.substr(fileName.rfind('\\') + 1); if (xboxkrnl::XeImageFileName.Buffer != NULL) diff --git a/src/CxbxKrnl/EmuD3D8.cpp b/src/CxbxKrnl/EmuD3D8.cpp index 3fee374a1..f33eaf92c 100644 --- a/src/CxbxKrnl/EmuD3D8.cpp +++ b/src/CxbxKrnl/EmuD3D8.cpp @@ -2467,10 +2467,11 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader) &Handle, g_dwVertexShaderUsage // TODO: HACK: Xbox has extensions! ); - if(pRecompiledBuffer) + + if(pRecompiledBuffer != nullptr) { pRecompiledBuffer->Release(); - pRecompiledBuffer = NULL; + pRecompiledBuffer = nullptr; } //* Fallback to dummy shader. @@ -2808,7 +2809,7 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreatePixelShader) ); } - if (pRecompiledBuffer) + if (pRecompiledBuffer != nullptr) { pRecompiledBuffer->Release(); } @@ -5621,7 +5622,7 @@ HRESULT WINAPI XTL::EMUPATCH(D3DTexture_LockRect) EmuVerifyResourceIsRegistered(pThis); // check if we have an unregistered YUV2 resource - if( (pThis != 0) && IsSpecialResource(pThis->Data) && (pThis->Data & X_D3DRESOURCE_DATA_FLAG_YUVSURF)) + if( (pThis != nullptr) && IsSpecialResource(pThis->Data) && (pThis->Data & X_D3DRESOURCE_DATA_FLAG_YUVSURF)) { pLockedRect->Pitch = g_dwOverlayP; pLockedRect->pBits = (PVOID)pThis->Lock; diff --git a/src/CxbxKrnl/EmuDSound.cpp b/src/CxbxKrnl/EmuDSound.cpp index 016829f1b..20e81f9fa 100644 --- a/src/CxbxKrnl/EmuDSound.cpp +++ b/src/CxbxKrnl/EmuDSound.cpp @@ -3636,14 +3636,14 @@ HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer8_SetNotificationPositions) // the pointer. Any buffer that uses this *MUST* be created with the // DSBCAPS_CTRLPOSITIONNOTIFY flag! - IDirectSoundNotify* pNotify = NULL; + IDirectSoundNotify* pNotify = nullptr; if( pThis ) { if( pThis->EmuDirectSoundBuffer8 ) { hr = pThis->EmuDirectSoundBuffer8->QueryInterface( IID_IDirectSoundNotify, (LPVOID*) pNotify ); - if( SUCCEEDED( hr ) ) + if( SUCCEEDED( hr ) && pNotify != nullptr ) { hr = pNotify->SetNotificationPositions( dwNotifyCount, paNotifies ); if( FAILED( hr ) )