From 99214b98b9baefef63c8472f6ba01aae27f7bf6e Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 13 Feb 2024 11:15:14 +0100 Subject: [PATCH] set this to 1440p also made a new define for use in the png limits so that can stay at 4k. but having both maxvids allocate things for 4k is not a good thing for software renderer, not that anyone would ever want to run it at 4k anyways --- src/m_misc.c | 4 ++-- src/screen.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/m_misc.c b/src/m_misc.c index d20ada5d5..c489208fb 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -998,7 +998,7 @@ static boolean M_SetupaPNG(png_const_charp filename, png_bytep pal) png_init_io(apng_ptr, apng_FILE); #ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_set_user_limits(apng_ptr, MAXVIDWIDTH, MAXVIDHEIGHT); + png_set_user_limits(apng_ptr, MAXPNGWIDTH, MAXPNGHEIGHT); #endif //png_set_filter(apng_ptr, 0, PNG_ALL_FILTERS); @@ -1307,7 +1307,7 @@ boolean M_SavePNG(const char *filename, void *data, int width, int height, const png_init_io(png_ptr, png_FILE); #ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_set_user_limits(png_ptr, MAXVIDWIDTH, MAXVIDHEIGHT); + png_set_user_limits(png_ptr, MAXPNGWIDTH, MAXPNGHEIGHT); #endif //png_set_filter(png_ptr, 0, PNG_ALL_FILTERS); diff --git a/src/screen.h b/src/screen.h index 478890c49..f57ceb31b 100644 --- a/src/screen.h +++ b/src/screen.h @@ -39,11 +39,15 @@ // we try to re-allocate a minimum of buffers for stability of the memory, // so all the small-enough tables based on screen size, are allocated once // and for all at the maximum size. -#define MAXVIDWIDTH 3840 // don't set this too high because actually -#define MAXVIDHEIGHT 2160 // lots of tables are allocated with the MAX size. +#define MAXVIDWIDTH 2560 // don't set this too high because actually +#define MAXVIDHEIGHT 1440 // lots of tables are allocated with the MAX size. #define BASEVIDWIDTH 320 // NEVER CHANGE THIS! This is the original #define BASEVIDHEIGHT 200 // resolution of the graphics. +// max res for png capture; seperated it so both MAXVID values can be lower +#define MAXPNGWIDTH 3840 +#define MAXPNGHEIGHT 2160 + // global video state typedef struct viddef_s {