From 630261aa50b83eeeebd13cbc24707fb6dfb987fe Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 25 Apr 2013 17:48:37 +0000 Subject: [PATCH] Automatically execute mapname.cfg at map load time. This allows different maps in mods to have different rendering settings (shadescale, etc). This is not currently suitable for standalone user maps as there's no functionality to reset such cvars back to default at the next map load (so, if using this in a mod, every map needs to have a cfg). git-svn-id: https://svn.eduke32.com/eduke32@3706 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 50c2885c0..2b89cb920 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -9862,6 +9862,20 @@ int32_t loadboard(char *filename, char flags, vec3_t *dapos, int16_t *daang, int yax_updategrays(dapos->z); #endif + { + char *p, fn[BMAX_PATH]; + + Bstrcpy(fn, filename); + + p = Bstrrchr(fn, '.'); + + if (!p) + { + Bstrcat(fn, ".cfg"); + OSD_Exec(fn); + } + } + return finish_loadboard(dapos, dacursectnum, numsprites, myflags); }