Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Oct 2, 2024
1 parent 4ad5859 commit 5bd7422
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/c_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -2220,7 +2220,7 @@ static void cmdlist_func2(char *cmd, char *parms)
// condump CCMD
//

static int indentation(char *string)
static int indentation(const char *string)
{
const int len = (int)strlen(string);
int count = 0;
Expand Down Expand Up @@ -11721,7 +11721,7 @@ static void vid_showfps_func2(char *cmd, char *parms)
else
{
framespersecond = 0;
frames = -1;
framecount = -1;
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,18 +713,18 @@ static void nullfunc(void) {}
uint64_t performancecounter;
uint64_t performancefrequency;
uint64_t starttime;
int frames = -1;
int framecount = -1;

static void CalculateFPS(void)
{
const uint64_t currenttime = SDL_GetPerformanceCounter();

frames++;
framecount++;

if (starttime < currenttime - performancefrequency)
{
framespersecond = frames;
frames = 0;
framespersecond = framecount;
framecount = 0;
starttime = currenttime;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/i_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ extern int refreshrate;
extern uint64_t starttime;
extern uint64_t performancecounter;
extern uint64_t performancefrequency;
extern int frames;
extern int framecount;
2 changes: 0 additions & 2 deletions src/v_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,6 @@ void V_DrawAltHUDWeaponPatch(int x, int y, patch_t *patch, int color, const byte
// step through the posts in a column
while (column->topdelta != 0xFF)
{
byte *source = (byte *)column + 3;
byte *dest = &desttop[column->topdelta * SCREENWIDTH];
const byte length = column->length;
byte count = length;
Expand Down Expand Up @@ -1211,7 +1210,6 @@ void V_DrawTranslucentAltHUDWeaponPatch(int x, int y, patch_t *patch, int color,
// step through the posts in a column
while (column->topdelta != 0xFF)
{
byte *source = (byte *)column + 3;
byte *dest = &desttop[column->topdelta * SCREENWIDTH];
const byte length = column->length;
byte count = length;
Expand Down

0 comments on commit 5bd7422

Please sign in to comment.