Skip to content

Commit

Permalink
Remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
schellingb committed Dec 12, 2024
1 parent 3de7f88 commit 3a7f9f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 4 additions & 0 deletions include/render.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,18 @@ typedef struct {
#endif
} frameskip;
struct {
#ifdef C_DBP_ENABLE_SCALERS
Bitu size;
#endif
scalerMode_t inMode;
scalerMode_t outMode;
#ifdef C_DBP_ENABLE_SCALERS
scalerOperation_t op;
#ifdef C_DBP_ENABLE_SCALERCACHE
bool clearCache;
#endif
bool forced;
#endif
ScalerLineHandler_t lineHandler;
ScalerLineHandler_t linePalHandler;
ScalerComplexHandler_t complexHandler;
Expand Down
18 changes: 11 additions & 7 deletions src/gui/render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,11 @@ void RENDER_Init(Section * sec) {
//For restarting the renderer.
static bool running = false;
bool aspect = render.aspect;
#ifdef C_DBP_ENABLE_SCALERS
Bitu scalersize = render.scale.size;
bool scalerforced = render.scale.forced;
scalerOperation_t scaleOp = render.scale.op;
#endif

render.pal.first=256;
render.pal.last=0;
Expand Down Expand Up @@ -764,9 +766,6 @@ void RENDER_Init(Section * sec) {
else if (scaler == "scan2x"){ render.scale.op = scalerOpScan;render.scale.size = 2; }
else if (scaler == "scan3x"){ render.scale.op = scalerOpScan;render.scale.size = 3; }
#endif
#else // C_DBP_ENABLE_SCALERS
render.scale.op = scalerOpNormal;
render.scale.size = 1;
#endif
#if C_OPENGL
char* shader_src = render.shader_src;
Expand All @@ -787,12 +786,17 @@ void RENDER_Init(Section * sec) {

//If something changed that needs a ReInit
// Only ReInit when there is a src.bpp (fixes crashes on startup and directly changing the scaler without a screen specified yet)
if(running && render.src.bpp && ((render.aspect != aspect) || (render.scale.op != scaleOp) ||
(render.scale.size != scalersize) || (render.scale.forced != scalerforced) ||
if(running && render.src.bpp && ((render.aspect != aspect)
#ifdef C_DBP_ENABLE_SCALERS
|| (render.scale.op != scaleOp) || (render.scale.size != scalersize) || (render.scale.forced != scalerforced)
#endif
#if C_OPENGL
(render.shader_src != shader_src) ||
|| (render.shader_src != shader_src)
#endif
#ifdef C_DBP_ENABLE_SCALERS
|| render.scale.forced
#endif
render.scale.forced))
))
RENDER_CallBack( GFX_CallBackReset );

if(!running) render.updating=true;
Expand Down
2 changes: 2 additions & 0 deletions src/gui/render_scalers.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef enum {
scalerMode8, scalerMode15, scalerMode16, scalerMode32
} scalerMode_t;

#ifdef C_DBP_ENABLE_SCALERS
typedef enum scalerOperation {
scalerOpNormal,
#if RENDER_USE_ADVANCED_SCALERS>2
Expand All @@ -78,6 +79,7 @@ typedef enum scalerOperation {
#endif
scalerLast
} scalerOperation_t;
#endif

typedef void (*ScalerLineHandler_t)(const void *src);
typedef void (*ScalerComplexHandler_t)(void);
Expand Down

0 comments on commit 3a7f9f2

Please sign in to comment.