mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Cosmetic
This commit is contained in:
parent
67573c7920
commit
17c0a1fa47
81
pixmap.cpp
81
pixmap.cpp
@ -232,37 +232,34 @@ HRESULT CPixmap::BltFast(int chDst, int channel,
|
|||||||
if ( rcRect.left >= rcRect.right ||
|
if ( rcRect.left >= rcRect.right ||
|
||||||
rcRect.top >= rcRect.bottom ) return DD_OK;
|
rcRect.top >= rcRect.bottom ) return DD_OK;
|
||||||
|
|
||||||
if ( chDst < 0 )
|
if ( chDst < 0 )
|
||||||
{
|
{
|
||||||
SDL_Rect srcRect, dstRect;
|
SDL_Rect srcRect, dstRect;
|
||||||
srcRect.x = rcRect.left;
|
srcRect.x = rcRect.left;
|
||||||
srcRect.y = rcRect.top;
|
srcRect.y = rcRect.top;
|
||||||
srcRect.w = rcRect.right - rcRect.left;
|
srcRect.w = rcRect.right - rcRect.left;
|
||||||
srcRect.h = rcRect.bottom - rcRect.top;
|
srcRect.h = rcRect.bottom - rcRect.top;
|
||||||
dstRect = srcRect;
|
dstRect = srcRect;
|
||||||
dstRect.x = dst.x;
|
dstRect.x = dst.x;
|
||||||
dstRect.y = dst.y;
|
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);
|
|
||||||
|
|
||||||
//SDL_SetTextureBlendMode (m_lpSDLTexture[chDst], SDL_BLENDMODE_BLEND);
|
SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect);
|
||||||
SDL_SetRenderTarget (g_renderer, m_lpSDLTexture[chDst]);
|
}
|
||||||
SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect);
|
else
|
||||||
SDL_SetRenderTarget (g_renderer, nullptr);
|
{
|
||||||
//SDL_RenderCopy (g_renderer, m_lpSDLTexture[chDst], NULL, NULL);
|
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;
|
return ddrval;
|
||||||
}
|
}
|
||||||
@ -279,18 +276,18 @@ HRESULT CPixmap::BltFast(SDL_Texture *lpSDL,
|
|||||||
if ( mode == 0 ) dwTrans = DDBLTFAST_SRCCOLORKEY;
|
if ( mode == 0 ) dwTrans = DDBLTFAST_SRCCOLORKEY;
|
||||||
else dwTrans = DDBLTFAST_NOCOLORKEY;
|
else dwTrans = DDBLTFAST_NOCOLORKEY;
|
||||||
|
|
||||||
SDL_Rect srcRect, dstRect;
|
SDL_Rect srcRect, dstRect;
|
||||||
srcRect.x = rcRect.left;
|
srcRect.x = rcRect.left;
|
||||||
srcRect.y = rcRect.top;
|
srcRect.y = rcRect.top;
|
||||||
srcRect.w = rcRect.right - rcRect.left;
|
srcRect.w = rcRect.right - rcRect.left;
|
||||||
srcRect.h = rcRect.bottom - rcRect.top;
|
srcRect.h = rcRect.bottom - rcRect.top;
|
||||||
dstRect = srcRect;
|
dstRect = srcRect;
|
||||||
dstRect.x = dst.x;
|
dstRect.x = dst.x;
|
||||||
dstRect.y = dst.y;
|
dstRect.y = dst.y;
|
||||||
//SDL_BlitSurface (m_lpSDLSurface[channel], &srcRect, lpSDL, &dstRect);
|
|
||||||
SDL_SetRenderTarget (g_renderer, lpSDL);
|
SDL_SetRenderTarget (g_renderer, lpSDL);
|
||||||
SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect);
|
SDL_RenderCopy (g_renderer, m_lpSDLTexture[channel], &srcRect, &dstRect);
|
||||||
SDL_SetRenderTarget (g_renderer, nullptr);
|
SDL_SetRenderTarget (g_renderer, nullptr);
|
||||||
|
|
||||||
return ddrval;
|
return ddrval;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user