From c2797e4b112123530359e5ca1d43c1e3276df1ef Mon Sep 17 00:00:00 2001 From: helixhorned Date: Mon, 28 Oct 2013 21:26:25 +0000 Subject: [PATCH] Mapster32: take initial map file name from ExtPreInit()->G_CheckCommandLine(). Instead of directly in build.c:app_main(). Previously, it was possible that an argument to an option, e.g. "WGR2" with "-game_dir WGR2", would get interpreted as the initial map to load. This in turn would attempt to execute WGR2.cfg as sequence of OSD commands -- where that file is an EDuke32 config file instead! Now: maps are passed without any options, e.g. "mapster32 [opts...] debug.map". The map file name is not added to the "additional parameters" for map testing. git-svn-id: https://svn.eduke32.com/eduke32@4121 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/editor.h | 1 + polymer/eduke32/build/src/build.c | 9 +++++---- polymer/eduke32/source/astub.c | 7 ++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index 30bed4364..5e1c1c7f5 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -177,6 +177,7 @@ extern void ExtEditWallData(int16_t wallnum); extern void ExtEditSpriteData(int16_t spritenum); extern const char *ExtGetSectorType(int32_t lotag); +extern void B_SetBoardFileName(const char *fn); extern int32_t LoadBoard(const char *filename, uint32_t flags); extern const char *SaveBoard(const char *fn, uint32_t flags); extern const char *GetSaveBoardFilename(const char *fn); diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 24fca89d9..0f797fa88 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -131,6 +131,11 @@ char *testplay_addparam = 0; static char boardfilename[BMAX_PATH], selectedboardfilename[BMAX_PATH]; //extern char levelname[BMAX_PATH]; // in astub.c XXX: clean up this mess!!! +void B_SetBoardFileName(const char *fn) +{ + Bstrncpyz(boardfilename, fn, BMAX_PATH); +} + static fnlist_t fnlist; static CACHE1D_FIND_REC *finddirshigh=NULL, *findfileshigh=NULL; static int32_t currentlist=0; @@ -523,7 +528,6 @@ int32_t app_main(int32_t argc, const char **argv) backgroundidle = 1; #endif - boardfilename[0] = 0; for (i=1; i