Skip to content

Commit

Permalink
properly clear screen stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Paril committed Oct 17, 2023
1 parent 46f342f commit fe3cada
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ void SCR_AddToChatHUD(const char *text);
void SCR_AddToDamageDisplay(int damage, const vec3_t color, const vec3_t dir);
void SCR_RemovePOI(int id);
void SCR_AddPOI(int id, int time, const vec3_t p, int image, int color, int flags);
void SCR_Clear(void);

//
// cin.c
Expand Down
1 change: 1 addition & 0 deletions src/client/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ void CL_ClearState(void)
CL_ClearTEnts();
LOC_FreeLocations();
CL_FreeDemoSnapshots();
SCR_Clear();

// wipe the entire cl structure
BSP_Free(cl.bsp);
Expand Down
13 changes: 11 additions & 2 deletions src/client/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,17 @@ void SCR_ModeChanged(void)
scr.hud_scale = R_ClampScale(scr_scale);
}

/*
==================
SCR_Clear
==================
*/
void SCR_Clear(void)
{
memset(scr.damage_entries, 0, sizeof(scr.damage_entries));
memset(scr.pois, 0, sizeof(scr.pois));
}

/*
==================
SCR_RegisterMedia
Expand Down Expand Up @@ -1234,8 +1245,6 @@ void SCR_RegisterMedia(void)
scr.net_pic = R_RegisterPic("net");
scr.font_pic = R_RegisterFont(scr_font->string);

memset(scr.damage_entries, 0, sizeof(scr.damage_entries));

scr_crosshair_changed(scr_crosshair);
}

Expand Down

0 comments on commit fe3cada

Please sign in to comment.