Merge remote-tracking branch 'refs/remotes/Cxbx-Reloaded/master'

This commit is contained in:
PatrickvL 2017-01-26 15:08:16 +01:00
commit ad36a98ec4
4 changed files with 26 additions and 13 deletions

View File

@ -259,11 +259,21 @@
<ClInclude Include="..\..\src\CxbxKrnl\EmuD3D8\PixelShader.h">
<Filter>EmuD3D8</Filter>
</ClInclude>
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\D3D8.1.0.5788.h" />
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\DSound.1.0.5788.h" />
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\Xapi.1.0.5788.h" />
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\XG.1.0.5788.h" />
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\XOnline.1.0.5788.h" />
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\Xapi.1.0.5788.h">
<Filter>HLEDatabase</Filter>
</ClInclude>
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\XOnline.1.0.5788.h">
<Filter>HLEDatabase</Filter>
</ClInclude>
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\XG.1.0.5788.h">
<Filter>HLEDatabase</Filter>
</ClInclude>
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\D3D8.1.0.5788.h">
<Filter>HLEDatabase</Filter>
</ClInclude>
<ClInclude Include="..\..\src\CxbxKrnl\HLEDataBase\DSound.1.0.5788.h">
<Filter>HLEDatabase</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\resource\CxbxDll.rc" />
@ -402,7 +412,9 @@
<None Include="..\..\src\CxbxKrnl\HLEDataBase\XOnline.1.0.5558.inl">
<Filter>HLEDatabase</Filter>
</None>
<None Include="..\..\src\CxbxKrnl\HLEDataBase\D3D8.1.0.5788.inl" />
<None Include="..\..\src\CxbxKrnl\HLEDataBase\D3D8.1.0.5788.inl">
<Filter>HLEDatabase</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Filter Include="HLEDatabase">

View File

@ -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)

View File

@ -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;

View File

@ -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 ) )