diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index e8dc98b21d..91cf47b7f9 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -626,9 +626,9 @@ inline void decodebytesARGB8_4(u32 *dst, const u16 *src, const u16 *src2) inline void decodebytesARGB8_4ToRgba(u32 *dst, const u16 *src, const u16 *src2) { - for (int x = 0; x < 4; x++) { - dst[x] = (src2[x] << 8) | src[x] >> 8 | (src[x] & 0xF) << 24; - } + for (int x = 0; x < 4; x++) { + dst[x] = ((src[x] & 0xFF) << 24) | ((src[x] & 0xFF00)>>8) | (src2[x] << 8); + } } inline u32 makecol(int r, int g, int b, int a) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index b67add58ae..a4ffddbfa0 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -914,11 +914,13 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE sirc.right = targetRc.right; sirc.bottom = targetRc.bottom; D3D::dev->SetScissorRect(&sirc); + D3D::ChangeRenderState(D3DRS_ALPHABLENDENABLE, false); if (zEnable) D3D::ChangeRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS); D3D::drawClearQuad(color ,(z & 0xFFFFFF) / float(0xFFFFFF),PixelShaderCache::GetClearProgram(),VertexShaderCache::GetClearVertexShader()); if (zEnable) - D3D::RefreshRenderState(D3DRS_ZFUNC); + D3D::RefreshRenderState(D3DRS_ZFUNC); + D3D::RefreshRenderState(D3DRS_ALPHABLENDENABLE); UpdateViewport(); SetScissorRect(); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 34c5a5acca..900a314531 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -787,13 +787,15 @@ bool Renderer::SetScissorRect() void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable, u32 color, u32 z) { + // Update the view port for clearing the picture - glViewport(0, 0, Renderer::GetTargetWidth(), Renderer::GetTargetHeight()); - TargetRectangle targetRc = Renderer::ConvertEFBRectangle(rc); + glViewport(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight()); + glScissor(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight()); + // Always set the scissor in case it was set by the game and has not been reset - glScissor(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight()); + VertexShaderManager::SetViewportChanged(); @@ -805,7 +807,7 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE ((color >> 16) & 0xFF) / 255.0f, ((color >> 8) & 0xFF) / 255.0f, (color & 0xFF) / 255.0f, - (alphaEnable ? ((color >> 24) & 0xFF) / 255.0f : 1.0f) + ((color >> 24) & 0xFF) / 255.0f ); } if (zEnable) @@ -1242,8 +1244,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight) // Renderer::SetZBufferRender(); // SaveTexture("tex.tga", GL_TEXTURE_RECTANGLE_ARB, s_FakeZTarget, GetTargetWidth(), GetTargetHeight()); XFBWrited = false; - g_VideoInitialize.pCopiedToXFB(true); - + g_VideoInitialize.pCopiedToXFB(XFBWrited); } // Create On-Screen-Messages