commit 8eb0291e79c709c44aa7b34ffeada097f3829d68
parent 0607c87a7c1228b98c6719949b47deb069da4519
Author: Martin J. Kloeckner <martin.cachari@gmail.com>
Date: Sat, 8 Oct 2022 00:19:59 -0300
Print status if program exits with error & added Victor Mono ttf font
Updated README.md
Included VictorMono-Regular.ttf font file
Updated main function which wasn't printing errors if occured
Disabled Vsync because it was causing specs
Diffstat:
5 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
@@ -8,12 +8,12 @@ Written in C using SDL2 library for graphics
## Dependencies
- [SDL2](https://www.libsdl.org/)
+- [SDL2-ttf](https://github.com/libsdl-org/SDL_ttf/releases)
## Building and running
```console
-$ make
+$ make -j $(nproc)
$ ./sav
-
```
## Keybindings
@@ -23,5 +23,9 @@ $ ./sav
- `S` - change array shuffle method (random, in order, reversed).
- `R` - restart.
+## Font
+
+The font used is [Victor Mono Regular](https://rubjo.github.io/victor-mono/)
+
## License
[MIT](./LICENSE)
diff --git a/VictorMono-Regular.ttf b/VictorMono-Regular.ttf
Binary files differ.
diff --git a/drw.h b/drw.h
@@ -14,7 +14,7 @@
#define NORM_COLOR 0xFF000000
#define FONT_SIZE 12
-#define FONT_NAME "/home/mk/.local/share/fonts/VictorMono-Bold.ttf"
+#define FONT_NAME "VictorMono-Regular.ttf"
#define FONT_COLOR 0xBBBBBB
#define BAR_HEIGHT 15
diff --git a/main.c b/main.c
@@ -9,7 +9,7 @@
#include <pthread.h>
#include <assert.h>
-#define SHOW_FPS true
+#define SHOW_FPS false
#define WELCOME_MSG_TIME 3
void check_events(Drw *, SAV *);
@@ -134,7 +134,9 @@ end:
SAV_destroy(sav);
Drw_destroy(drw);
- return 0;
+
+ if(st != OK) printf("%s\n", status_string[st]);
+ return st;
}
void check_events(Drw *drw, SAV *sav)
diff --git a/sdl_extra.c b/sdl_extra.c
@@ -15,7 +15,7 @@ status_t SDL_setup(SDL_Window **win, SDL_Renderer **rend) {
SDL_WINDOW_RESIZABLE
);
- *rend = SDL_CreateRenderer(*win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
+ *rend = SDL_CreateRenderer(*win, -1, SDL_RENDERER_ACCELERATED);
if ((*win == NULL) || (*rend == NULL))
return ERROR_NULL_POINTER;