From 17c0a1fa47b24b7cefd9ce2aa347f2854619795d Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sun, 5 Feb 2017 09:47:01 +0100 Subject: [PATCH] Cosmetic --- pixmap.cpp | 81 ++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/pixmap.cpp b/pixmap.cpp index b44c9ae..b324f6a 100644 --- a/pixmap.cpp +++ b/pixmap.cpp @@ -232,37 +232,34 @@ HRESULT CPixmap::BltFast(int chDst, int channel, if ( rcRect.left >= rcRect.right || rcRect.top >= rcRect.bottom ) return DD_OK; - if ( chDst < 0 ) - { - SDL_Rect srcRect, dstRect; - srcRect.x = rcRect.left; - srcRect.y = rcRect.top; - srcRect.w = rcRect.right - rcRect.left; - srcRect.h = rcRect.bottom - rcRect.top; - dstRect = srcRect; - dstRect.x = dst.x; - dstRect.y = dst.y; - //SDL_BlitSurface (m_lpSDLSurface[channel], &srcRect, m_lpSDLBack, &dstRect); - SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect); - } - else - { - SDL_Rect srcRect, dstRect; - srcRect.x = rcRect.left; - srcRect.y = rcRect.top; - srcRect.w = rcRect.right - rcRect.left; - srcRect.h = rcRect.bottom - rcRect.top; - dstRect = srcRect; - dstRect.x = dst.x; - dstRect.y = dst.y; - //SDL_BlitSurface (m_lpSDLSurface[channel], &srcRect, m_lpSDLSurface[chDst], &dstRect); + if ( chDst < 0 ) + { + SDL_Rect srcRect, dstRect; + srcRect.x = rcRect.left; + srcRect.y = rcRect.top; + srcRect.w = rcRect.right - rcRect.left; + srcRect.h = rcRect.bottom - rcRect.top; + dstRect = srcRect; + dstRect.x = dst.x; + dstRect.y = dst.y; - //SDL_SetTextureBlendMode (m_lpSDLTexture[chDst], SDL_BLENDMODE_BLEND); - SDL_SetRenderTarget (g_renderer, m_lpSDLTexture[chDst]); - SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect); - SDL_SetRenderTarget (g_renderer, nullptr); - //SDL_RenderCopy (g_renderer, m_lpSDLTexture[chDst], NULL, NULL); - } + SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect); + } + else + { + SDL_Rect srcRect, dstRect; + srcRect.x = rcRect.left; + srcRect.y = rcRect.top; + srcRect.w = rcRect.right - rcRect.left; + srcRect.h = rcRect.bottom - rcRect.top; + dstRect = srcRect; + dstRect.x = dst.x; + dstRect.y = dst.y; + + SDL_SetRenderTarget (g_renderer, m_lpSDLTexture[chDst]); + SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect); + SDL_SetRenderTarget (g_renderer, nullptr); + } return ddrval; } @@ -279,18 +276,18 @@ HRESULT CPixmap::BltFast(SDL_Texture *lpSDL, if ( mode == 0 ) dwTrans = DDBLTFAST_SRCCOLORKEY; else dwTrans = DDBLTFAST_NOCOLORKEY; - SDL_Rect srcRect, dstRect; - srcRect.x = rcRect.left; - srcRect.y = rcRect.top; - srcRect.w = rcRect.right - rcRect.left; - srcRect.h = rcRect.bottom - rcRect.top; - dstRect = srcRect; - dstRect.x = dst.x; - dstRect.y = dst.y; - //SDL_BlitSurface (m_lpSDLSurface[channel], &srcRect, lpSDL, &dstRect); - SDL_SetRenderTarget (g_renderer, lpSDL); - SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect); - SDL_SetRenderTarget (g_renderer, nullptr); + SDL_Rect srcRect, dstRect; + srcRect.x = rcRect.left; + srcRect.y = rcRect.top; + srcRect.w = rcRect.right - rcRect.left; + srcRect.h = rcRect.bottom - rcRect.top; + dstRect = srcRect; + dstRect.x = dst.x; + dstRect.y = dst.y; + + SDL_SetRenderTarget (g_renderer, lpSDL); + SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect); + SDL_SetRenderTarget (g_renderer, nullptr); return ddrval; }