From 09210e43167976d0732fb2b68f5102b3b0b8e679 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 2 Nov 2024 02:16:59 +0300 Subject: [PATCH] wscript: add option to build with extended msurface_t from HL25 --- common/com_model.h | 15 +++++++++++++++ wscript | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/common/com_model.h b/common/com_model.h index 349b6478..550f3a07 100644 --- a/common/com_model.h +++ b/common/com_model.h @@ -240,6 +240,17 @@ typedef struct mextrasurf_s intptr_t reserved[32]; // just for future expansions or mod-makers } mextrasurf_t; +#ifdef SUPPORT_HL25_EXTENDED_STRUCTS +// additional struct at the end of msurface_t for HL25 compatibility +typedef struct mdisplaylist_s +{ + unsigned int gl_displaylist; + int rendermode; + float scrolloffset; + int renderDetailTexture; +} mdisplaylist_t; +#endif + struct msurface_s { int visframe; // should be drawn when node is crossed @@ -272,6 +283,10 @@ struct msurface_s color24 *samples; // note: this is the actual lightmap data for this surface decal_t *pdecals; + +#ifdef SUPPORT_HL25_EXTENDED_STRUCTS + mdisplaylist_t displaylist; +#endif }; typedef struct hull_s diff --git a/wscript b/wscript index acb66a90..987035f2 100644 --- a/wscript +++ b/wscript @@ -135,6 +135,9 @@ def options(opt): grp.add_option('--enable-bsp2', action = 'store_true', dest = 'SUPPORT_BSP2_FORMAT', default = False, help = 'build engine and renderers with BSP2 map support(recommended for Quake, breaks compatibility!) [default: %(default)s]') + grp.add_option('--enable-hl25-extended-structs', action = 'store_true', dest = 'SUPPORT_HL25_EXTENDED_STRUCTS', default = False, + help = 'build engine and renderers with HL25 extended structs compatibility (might be required for some mods) [default: %(default)s]') + grp.add_option('--low-memory-mode', action = 'store', dest = 'LOW_MEMORY', default = 0, type = int, help = 'enable low memory mode (only for devices have <128 ram)') @@ -377,6 +380,7 @@ def configure(conf): conf.env.DEDICATED = conf.options.DEDICATED conf.define_cond('SUPPORT_BSP2_FORMAT', conf.options.SUPPORT_BSP2_FORMAT) + conf.define_cond('SUPPORT_HL25_EXTENDED_STRUCTS', conf.options.SUPPORT_HL25_EXTENDED_STRUCTS) # disable game_launch compiling on platform where it's not needed conf.env.DISABLE_LAUNCHER = conf.env.DEST_OS in ['android', 'nswitch', 'psvita', 'dos'] or conf.env.MAGX or conf.env.DEDICATED or conf.env.STATIC_LINKING