Add assert if font loading fails during rendering

This commit is contained in:
Francesco Abbate
2021-04-27 11:56:02 +02:00
parent 8b9fbecd74
commit 0fe8415bb4
2 changed files with 10 additions and 1 deletions
+2 -1
View File
@@ -74,7 +74,8 @@ static int get_surface_scale() {
int w_points, h_points;
SDL_GL_GetDrawableSize(renderer.window, &w_pixels, &h_pixels);
SDL_GetWindowSize(renderer.window, &w_points, &h_points);
// FIXME: this assert is too harsh.
/* We consider that the ratio pixel/point will always be an integer and
it is the same along the x and the y axis. */
assert(w_pixels % w_points == 0 && h_pixels % h_points == 0 && w_pixels / w_points == h_pixels / h_points);
return w_pixels / w_points;
}