Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Sources/Engine/Graphics/GfxLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ extern BOOL CVA_bModels;
static FLOAT _fLastBrightness, _fLastContrast, _fLastGamma;
static FLOAT _fLastBiasR, _fLastBiasG, _fLastBiasB;
static INDEX _iLastLevels;
#ifdef PLATFORM_WIN32 // DG: not used on other platforms
#ifndef PLATFORM_PANDORA // DG: not used on other platforms
static UWORD _auwGammaTable[256*3];
#endif

Expand Down Expand Up @@ -1799,7 +1799,7 @@ INDEX _ctProbeShdU = 0;
INDEX _ctProbeShdB = 0;
INDEX _ctFullShdU = 0;
SLONG _slFullShdUBytes = 0;
#ifdef PLATFORM_WIN32 // only used there
#ifndef PLATFORM_PANDORA // only used there
static BOOL GenerateGammaTable(void);
#endif

Expand Down Expand Up @@ -2003,6 +2003,18 @@ void CGfxLibrary::SwapBuffers(CViewPort *pvp)
}
}
else
#else
if( gl_ulFlags & GLF_ADJUSTABLEGAMMA) {
// ... and required
const BOOL bTableSet = GenerateGammaTable();
if( bTableSet) {
Uint16 *rampR = &_auwGammaTable[0];
Uint16 *rampG = &_auwGammaTable[256];
Uint16 *rampB = &_auwGammaTable[512];
SDL_SetWindowGammaRamp((SDL_Window *) pvp->vp_hWnd, rampR, rampG, rampB);
}
}
else
#endif
// if not supported
{
Expand Down Expand Up @@ -2063,7 +2075,7 @@ void CGfxLibrary::UnlockRaster( CRaster *praToUnlock)
}


#ifdef PLATFORM_WIN32 // DG: only used on windows
#ifndef PLATFORM_PANDORA // DG: only used on windows
// generates gamma table and returns true if gamma table has been changed
static BOOL GenerateGammaTable(void)
{
Expand Down
5 changes: 5 additions & 0 deletions Sources/SeriousSam/SeriousSam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,14 +696,19 @@ void End(void)
pdpNormal = NULL;
}

#ifdef PLATFORM_WIN32
CloseMainWindow();
#endif
MainWindow_End();
DestroyMenus();
_pGame->End();
_pGame->LCDEnd();
// unlock the directory
DirectoryLockOff();
SE_EndEngine();
#ifndef PLATFORM_WIN32
CloseMainWindow();
#endif

#if PLATFORM_UNIX
SDL_Quit();
Expand Down