From 6a2ab6378d1afb382addf681493ce213629d0553 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sat, 12 May 2018 20:10:20 +0200 Subject: [PATCH] fix POT texture size --- src/render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/render.c b/src/render.c index 6ffc84e..3371d6f 100644 --- a/src/render.c +++ b/src/render.c @@ -86,8 +86,8 @@ DWORD WINAPI render_main(void) if (ddraw->render.maxfps > 0) frame_len = 1000.0f / ddraw->render.maxfps; - int tex_width = ddraw->width > 1024 ? ddraw->width : 1024; - int tex_height = ddraw->height > 1024 ? ddraw->height : 1024; + int tex_width = ddraw->width <= 512 ? 512 : ddraw->width <= 1024 ? 1024 : ddraw->width > 2048 ? ddraw->width : 2048; + int tex_height = ddraw->height > tex_width ? ddraw->height : tex_width; int tex_size = tex_width * tex_height * sizeof(int); int *tex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, tex_size);