From 962910ce327aa4f119a6a96d3e7d7089287bf6fc Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 4 Sep 2011 19:43:48 +0000 Subject: [PATCH] Move the fixspritesectors call and the start sector updating into ExtPreSaveMap(). This makes the latter also correct when testing a map from the editor. git-svn-id: https://svn.eduke32.com/eduke32@2001 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/editor.h | 2 ++ polymer/eduke32/build/src/build.c | 5 ----- polymer/eduke32/source/astub.c | 5 +++++ polymer/eduke32/source/mapster32.h | 2 -- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index b621a8ae6..da64b2c01 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -149,6 +149,8 @@ extern void AlignWallPoint2(int32_t w0); extern int32_t AutoAlignWalls(int32_t w0, uint32_t flags, int32_t nrecurs); extern void SetFirstWall(int32_t sectnum, int32_t wallnum); +extern void fixspritesectors(void); +extern void clearkeys(void); extern int32_t ExtInit(void); extern int32_t ExtPreInit(int32_t argc,const char **argv); diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index c240adb5e..a32ef5eae 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -6915,10 +6915,6 @@ const char *SaveBoard(const char *fn, uint32_t flags) f++; } - fixspritesectors(); //Do this before saving! - updatesectorz(startposx,startposy,startposz,&startsectnum); - if (startsectnum < 0) - updatesector(startposx,startposy,&startsectnum); ExtPreSaveMap(); ret = saveboard(f,&startposx,&startposy,&startposz,&startang,&startsectnum); if ((flags&1)==0) @@ -9568,7 +9564,6 @@ void test_map(int32_t mode) } Bstrcat(fullparam, param); - fixspritesectors(); //Do this before saving! ExtPreSaveMap(); if (mode) saveboard(PLAYTEST_MAPNAME,&startposx,&startposy,&startposz,&startang,&startsectnum); diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 90d7284bb..364701b50 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -8344,6 +8344,11 @@ static void InitCustomColors(void) void ExtPreSaveMap(void) { + fixspritesectors(); //Do this before saving! + updatesectorz(startposx,startposy,startposz,&startsectnum); + if (startsectnum < 0) + updatesector(startposx,startposy,&startsectnum); + if (fixmapbeforesaving) { int32_t i, startwall, j, endwall; diff --git a/polymer/eduke32/source/mapster32.h b/polymer/eduke32/source/mapster32.h index dfae986ea..f0fc3c126 100644 --- a/polymer/eduke32/source/mapster32.h +++ b/polymer/eduke32/source/mapster32.h @@ -106,7 +106,6 @@ static int32_t acurpalette=0; //void ContextHelp(int16_t spritenum); //void ResetKeys(); -extern void fixspritesectors(void); //#define KEY_PRESSED(sc) KB_KeyPressed((sc)) // This table defines the various zoom levels, the numbers being the pixel width @@ -165,7 +164,6 @@ static int32_t numalphabets = 0; extern int16_t localartfreq[MAXTILES]; extern int16_t localartlookup[MAXTILES], localartlookupnum; extern int32_t lockclock; -extern void clearkeys(void); static int32_t gs_spriteTagValue[3][7]; static char gs_spriteTagInterested[3][7];