Skip to content

Commit c2a6059

Browse files
Robert Alm Nilssonvoidanix
authored andcommitted
Remove variable frameloops
It was hard to understand what it meant and it was only used for determining whether the loop was in the first frame/iteration. Therefore I replaced it with variable `first_frame` which has a clearer purpose.
1 parent 3b03e99 commit c2a6059

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/engine/main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ void resetfps()
808808
fpspos = 0;
809809
}
810810

811-
void updatefps(int frames, int millis)
811+
void updatefps(int millis)
812812
{
813813
fpshistory[fpspos++] = max(1, min(1000, millis));
814814
if(fpspos >= MAXFPSHISTORY) fpspos = 0;
@@ -1120,15 +1120,15 @@ int main(int argc, char **argv)
11201120
blue_nebula_protocol_arg = NULL;
11211121
}
11221122

1123-
for(int frameloops = 0; ; frameloops = frameloops >= INT_MAX-1 ? MAXFPSHISTORY+1 : frameloops+1)
1123+
for (bool first_frame = true; ; first_frame = false)
11241124
{
11251125
curtextscale = textscale;
11261126
int elapsed = updatetimer(true);
1127-
updatefps(frameloops, elapsed);
1127+
updatefps(elapsed);
11281128
checkinput();
11291129
menuprocess();
11301130

1131-
if(frameloops)
1131+
if (!first_frame)
11321132
{
11331133
RUNWORLD("on_update");
11341134
game::updateworld();
@@ -1137,7 +1137,7 @@ int main(int argc, char **argv)
11371137
checksleep(lastmillis);
11381138
serverslice();
11391139
ircslice();
1140-
if(frameloops)
1140+
if (!first_frame)
11411141
{
11421142
game::recomputecamera(screenw, screenh);
11431143
hud::update(screenw, screenh);

0 commit comments

Comments
 (0)