Skip to content

Commit e6cdcc6

Browse files
committed
Deliting unnececery FPS counter
1 parent 184fa9e commit e6cdcc6

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/main.cpp

+1-16
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ int position; // Position of sell, which updated
7979
int score; // Number of eaten apples
8080
int preTick; // Previous tick time
8181
char fat; // Flag of setting fat cell
82-
int FPStime=0;
83-
int counter=0;
84-
int precounter=0;
8582

8683
// Texts variables and constants
8784
TTF_Font* Font;
@@ -431,19 +428,7 @@ int main(int argv, char** args){
431428
}
432429
drawText( std::to_string(score), 20 , 15); // Drawing text with score at screen
433430

434-
435-
//preTick = SDL_GetTicks();
436-
if(SDL_GetTicks() - FPStime > 1000){
437-
FPStime = SDL_GetTicks();
438-
precounter = counter;
439-
counter = 0;
440-
}
441-
counter+=1;
442-
drawText( std::to_string( precounter ), SCREEN_WIDTH-80 , 15); // Drawing text with score at screen
443-
SDL_RenderPresent(app.renderer); // Blitting textures on screen
444-
445-
// Delaying time to decrease CPU loading
446-
//SDL_Delay(1000/FPS);
431+
SDL_Delay(1000/FPS); // Delaying time to decrease CPU loading
447432
}
448433
// Exiting program and clearing all data
449434
unloadTextures();

0 commit comments

Comments
 (0)