Skip to content

Commit

Permalink
Variable cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrikpowell committed Dec 7, 2024
1 parent bfb2739 commit a5b30b4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion prboom2/src/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -2801,7 +2801,7 @@ void AM_Drawer (dboolean minimap)
if (!automap_overlay) // cph - If not overlay mode, clear background for the automap
V_FillRect(FB, f_x, f_y, f_w, f_h, (byte)mapcolor_p->back); //jff 1/5/98 background default color
if (automap_overlay == 2 && !M_MenuIsShaded())
V_DrawShaded(FB, f_x, f_y, f_w, f_h, screenshade);
V_DrawShaded(FB, f_x, f_y, f_w, f_h, FULLSHADE);

if (map_textured)
{
Expand Down
4 changes: 2 additions & 2 deletions prboom2/src/gl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ void gld_FillBlock(int x, int y, int width, int height, int col)
glsl_PopNullShader();
}

void gld_DrawShaded(int x, int y, int width, int height, int screenshade)
void gld_DrawShaded(int x, int y, int width, int height, int shade)
{
color_rgb_t color = gld_LookupIndexedColor(playpal_black, V_IsAutomapLightmodeIndexed());

Expand All @@ -859,7 +859,7 @@ void gld_DrawShaded(int x, int y, int width, int height, int screenshade)
glColor4f((float)color.r/255.0f,
(float)color.g/255.0f,
(float)color.b/255.0f,
(float)screenshade/30);
(float)shade/30);

glBegin(GL_TRIANGLE_STRIP);
glVertex2i( x, y );
Expand Down
2 changes: 1 addition & 1 deletion prboom2/src/gl_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void gld_DrawLine(int x0, int y0, int x1, int y1, int BaseColor);
void gld_DrawLine_f(float x0, float y0, float x1, float y1, int BaseColor);
void gld_DrawWeapon(int weaponlump, vissprite_t *vis, int lightlevel);
void gld_FillBlock(int x, int y, int width, int height, int col);
void gld_DrawShaded(int x, int y, int width, int height, int screenshade);
void gld_DrawShaded(int x, int y, int width, int height, int shade);
void gld_SetPalette(int palette);
unsigned char *gld_ReadScreen(void);

Expand Down
4 changes: 1 addition & 3 deletions prboom2/src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5835,8 +5835,6 @@ void M_StartControlPanel (void)
//
// This displays a dark overlay under certain screens of the menus

int screenshade = 20;

dboolean fadeBG(void)
{
return dsda_IntConfig(dsda_config_menu_background) == 1;
Expand All @@ -5850,7 +5848,7 @@ dboolean M_MenuIsShaded(void)

static void M_ShadedScreen(int scrn)
{
V_DrawShaded(scrn, 0, 0, SCREENWIDTH, SCREENHEIGHT, screenshade);
V_DrawShaded(scrn, 0, 0, SCREENWIDTH, SCREENHEIGHT, FULLSHADE);
}

//
Expand Down
2 changes: 1 addition & 1 deletion prboom2/src/m_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dboolean M_Responder (event_t *ev);

dboolean fadeBG(void);
dboolean M_MenuIsShaded(void);
extern int screenshade;
#define FULLSHADE 20

// Called by main loop,
// only used for menu (skull cursor) animation.
Expand Down
10 changes: 5 additions & 5 deletions prboom2/src/v_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ static void V_DrawMemPatch(int x, int y, int scrn, const rpatch_t *patch,
// This uses a dark colormap to create
// a dark faded background under menus.
//
static void FUNC_V_DrawShaded(int scrn, int x, int y, int width, int height, int screenshade)
static void FUNC_V_DrawShaded(int scrn, int x, int y, int width, int height, int shade)
{
extern const lighttable_t **colormaps;
byte* dest;
Expand All @@ -636,7 +636,7 @@ static void FUNC_V_DrawShaded(int scrn, int x, int y, int width, int height, int

for (ix = x; ix < x + width; ++ix)
{
*dest = colormaps[scrn][screenshade * 256 + dest[scrn]];
*dest = colormaps[scrn][shade * 256 + dest[scrn]];
dest++;
}
}
Expand Down Expand Up @@ -770,9 +770,9 @@ static void WRAP_gld_DrawLine(fline_t* fl, int color)
{
gld_DrawLine_f(fl->a.fx, fl->a.fy, fl->b.fx, fl->b.fy, color);
}
static void WRAP_gld_DrawShaded(int scrn, int x, int y, int width, int height, int screenshade)
static void WRAP_gld_DrawShaded(int scrn, int x, int y, int width, int height, int shade)
{
gld_DrawShaded(x, y, width, height, screenshade);
gld_DrawShaded(x, y, width, height, shade);
}

static void NULL_BeginUIDraw(void) {}
Expand All @@ -790,7 +790,7 @@ static void NULL_PlotPixel(int scrn, int x, int y, byte color) {}
static void NULL_PlotPixelWu(int scrn, int x, int y, byte color, int weight) {}
static void NULL_DrawLine(fline_t* fl, int color) {}
static void NULL_DrawLineWu(fline_t* fl, int color) {}
static void NULL_DrawShaded(int scrn, int x, int y, int width, int height, int screenshade) {}
static void NULL_DrawShaded(int scrn, int x, int y, int width, int height, int shade) {}

static video_mode_t current_videomode = VID_MODESW;

Expand Down
2 changes: 1 addition & 1 deletion prboom2/src/v_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ extern V_FillPatch_f V_FillPatch;
typedef void (*V_DrawBackground_f)(const char* flatname, int scrn);
extern V_DrawBackground_f V_DrawBackground;

typedef void (*V_DrawShaded_f)(int scrn, int x, int y, int width, int height, int screenshade);
typedef void (*V_DrawShaded_f)(int scrn, int x, int y, int width, int height, int shade);
extern V_DrawShaded_f V_DrawShaded;

// CPhipps - function to set the palette to palette number pal.
Expand Down

0 comments on commit a5b30b4

Please sign in to comment.