Browse Source

🚩 Add ini toggle for FPS Limit. Enabled by default. (#1165)

pull/1166/head
Trihedraf 5 years ago committed by Anders Jenbo
parent
commit
a4c34112af
  1. 2
      Source/diablo.cpp
  2. 2
      Source/diablo.h
  3. 2
      SourceX/dx.cpp

2
Source/diablo.cpp

@ -416,6 +416,7 @@ static void SaveOptions()
setIniInt("Graphics", "Blended Transparency", sgOptions.Graphics.bBlendedTransparancy);
setIniInt("Graphics", "Gamma Correction", sgOptions.Graphics.nGammaCorrection);
setIniInt("Graphics", "Color Cycling", sgOptions.Graphics.bColorCycling);
setIniInt("Graphics", "FPS Limiter", sgOptions.Graphics.bFPSLimit);
setIniInt("Game", "Speed", sgOptions.Gameplay.nTickRate);
setIniInt("Game", "Fast Walk", sgOptions.Gameplay.bJogInTown);
@ -469,6 +470,7 @@ static void LoadOptions()
sgOptions.Graphics.bBlendedTransparancy = getIniBool("Graphics", "Blended Transparency", true);
sgOptions.Graphics.nGammaCorrection = getIniInt("Graphics", "Gamma Correction", 100);
sgOptions.Graphics.bColorCycling = getIniBool("Graphics", "Color Cycling", true);
sgOptions.Graphics.bFPSLimit = getIniBool("Graphics", "FPS Limiter", true);
sgOptions.Gameplay.nTickRate = getIniInt("Game", "Speed", 20);
sgOptions.Gameplay.bJogInTown = getIniBool("Game", "Fast Walk", false);

2
Source/diablo.h

@ -57,6 +57,8 @@ typedef struct GraphicsOptions {
Sint32 nGammaCorrection;
/** @brief Enable color cycling animations. */
bool bColorCycling;
/** @brief Enable FPS Limit. */
bool bFPSLimit;
} GraphicsOptions;
typedef struct GameplayOptions {

2
SourceX/dx.cpp

@ -246,6 +246,8 @@ void Blit(SDL_Surface *src, SDL_Rect *src_rect, SDL_Rect *dst_rect)
*/
void LimitFrameRate()
{
if (!sgOptions.Graphics.bFPSLimit)
return;
static uint32_t frameDeadline;
uint32_t tc = SDL_GetTicks() * 1000;
uint32_t v = 0;

Loading…
Cancel
Save