From 7fbad1ef859d78626b6080a2813d8dbfc49a6dfc Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Wed, 19 May 2021 07:03:54 +0300 Subject: [PATCH] dos: stop logger and write fps to the console before exiting --- src/dos/logger.c | 5 +++++ src/dos/logger.h | 1 + src/dos/main.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/dos/logger.c b/src/dos/logger.c index 70489ad..14c36e4 100644 --- a/src/dos/logger.c +++ b/src/dos/logger.c @@ -19,3 +19,8 @@ int init_logger(const char *fname) dup(fd); return 0; } + +void stop_logger(void) +{ + init_logger("CON"); +} diff --git a/src/dos/logger.h b/src/dos/logger.h index 9ef9a85..171c175 100644 --- a/src/dos/logger.h +++ b/src/dos/logger.h @@ -6,6 +6,7 @@ extern "C" { #endif int init_logger(const char *fname); +void stop_logger(void); #ifdef __cplusplus } diff --git a/src/dos/main.c b/src/dos/main.c index f048366..048aa9d 100644 --- a/src/dos/main.c +++ b/src/dos/main.c @@ -67,8 +67,10 @@ int main(int argc, char **argv) end: set_text_mode(); cleanup_video(); + stop_logger(); if(num_frames) { + printf("%d frames in %d msec\n", num_frames, time_msec); printf("avg framerate: %.1f fps\n", (10000 * num_frames / time_msec) / 10.0f); } return 0; -- 1.7.10.4