* (bugfix, windows) "Smoothing" no longer incorrectly turns on if you lose/regain focus

git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1477 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
seth 2017-09-13 13:37:55 +00:00
parent 0fe6c06c7d
commit f9d131f431
2 changed files with 17 additions and 12 deletions

View file

@ -57,4 +57,5 @@ www.rtsoft.com
* (bugfix) Fixed issue where 32 bit tilebitmaps would go wonky when reloading the surface * (bugfix) Fixed issue where 32 bit tilebitmaps would go wonky when reloading the surface
* Default color under status bar is now black, fixes issue when transparent colors are used in the stats area, random garbage would show through * Default color under status bar is now black, fixes issue when transparent colors are used in the stats area, random garbage would show through
* (windows) Version # is now shown in title bar * (windows) Version # is now shown in title bar
* (bugfix) Fixed some issues with how default offsets are calculated, it fixed some problems where sprites would be in the wrong place in certain DMODs * (bugfix) Fixed some issues with how default offsets are calculated, it fixed some problems where sprites would be in the wrong place in certain DMODs
* (bugfix, windows) "Smoothing" no longer incorrectly turns on if you lose/regain focus

View file

@ -111,6 +111,7 @@ IDirectDrawSurface * InitOffscreenSurface(int x, int y, IDirectDrawSurface::eMod
{ {
pdds->m_pGLSurf = new Surface; pdds->m_pGLSurf = new Surface;
pdds->m_pGLSurf->SetSmoothing(GetApp()->GetVar("smoothing")->GetUINT32() != 0);
if (GetApp()->GetVar("smoothing")->GetUINT32()) if (GetApp()->GetVar("smoothing")->GetUINT32())
{ {
pdds->m_pGLSurf->SetTextureType(Surface::TYPE_GUI); pdds->m_pGLSurf->SetTextureType(Surface::TYPE_GUI);
@ -247,6 +248,9 @@ void IDirectDrawSurface::UpdateShadowSurface()
if (!m_pGLSurf) if (!m_pGLSurf)
{ {
m_pGLSurf = new Surface; m_pGLSurf = new Surface;
m_pGLSurf->SetSmoothing(GetApp()->GetVar("smoothing")->GetUINT32() != 0);
if (GetApp()->GetVar("smoothing")->GetUINT32()) if (GetApp()->GetVar("smoothing")->GetUINT32())
{ {
m_pGLSurf->SetTextureType(Surface::TYPE_GUI); m_pGLSurf->SetTextureType(Surface::TYPE_GUI);
@ -274,14 +278,14 @@ void IDirectDrawSurface::UpdateShadowSurface()
m_pGLSurf->UpdateSurfaceRect(rtRect(0,0, s.GetWidth(), s.GetHeight()), s.GetPixelData()); m_pGLSurf->UpdateSurfaceRect(rtRect(0,0, s.GetWidth(), s.GetHeight()), s.GetPixelData());
m_pGLSurf->SetUsesAlpha(m_pSurf->GetUsesAlpha()); m_pGLSurf->SetUsesAlpha(m_pSurf->GetUsesAlpha());
if (s.GetHasPremultipliedAlpha()) if (s.GetHasPremultipliedAlpha())
{ {
m_pGLSurf->SetBlendingMode(Surface::BLENDING_PREMULTIPLIED_ALPHA); m_pGLSurf->SetBlendingMode(Surface::BLENDING_PREMULTIPLIED_ALPHA);
} }
// if (m_pSurf) m_pSurf->SetModified(false); //WARNING: Seth changed on 8/21/2017, seems like this fixes issue with constantly re-initting surfaces // if (m_pSurf) m_pSurf->SetModified(false); //WARNING: Seth changed on 8/21/2017, seems like this fixes issue with constantly re-initting surfaces
// SAFE_FREE(m_pSurf); // SAFE_FREE(m_pSurf);
} }
@ -298,10 +302,10 @@ void IDirectDrawSurface::UpdateShadowSurface()
m_pSurf->FlipY(); m_pSurf->FlipY();
m_pGLSurf->SetUsesAlpha(m_pSurf->GetUsesAlpha()); m_pGLSurf->SetUsesAlpha(m_pSurf->GetUsesAlpha());
if (m_pSurf->GetHasPremultipliedAlpha()) if (m_pSurf->GetHasPremultipliedAlpha())
{ {
m_pGLSurf->SetBlendingMode(Surface::BLENDING_PREMULTIPLIED_ALPHA); m_pGLSurf->SetBlendingMode(Surface::BLENDING_PREMULTIPLIED_ALPHA);
} }
} }