diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index f1b963a45..23aacc89e 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -716,59 +716,6 @@ const char *ExtGetVer(void) return s_buildRev; } -static void MultiPskyInit(void) -{ - int32_t i; - - // new-style multi-psky handling - pskymultilist[0] = MOONSKY1; - pskymultilist[1] = BIGORBIT1; - pskymultilist[2] = LA; - - pskymultiyscale[0] = 32768; - pskymultiyscale[1] = 32768; - pskymultiyscale[2] = 16384+1024; - - for (i=0; i<3; i++) - { - pskymultibits[i] = 3; - Bmemset(pskymultioff[i], 0, sizeof(pskymultioff[i])); - } - - // KEEPINSYNC with Polymer MAX OFFSET = 4 - - // MOONSKY1 - // earth mountian mountain sun - pskymultioff[0][6]=1; - pskymultioff[0][1]=2; - pskymultioff[0][4]=2; - pskymultioff[0][2]=3; - - // BIGORBIT1 // orbit - // earth1 2 3 moon/sun - pskymultioff[1][5]=1; - pskymultioff[1][6]=2; - pskymultioff[1][7]=3; - pskymultioff[1][2]=4; - - // LA // la city - // earth1 2 3 moon/sun - pskymultioff[2][0]=1; - pskymultioff[2][1]=2; - pskymultioff[2][2]=1; - pskymultioff[2][3]=3; - pskymultioff[2][4]=4; - pskymultioff[2][5]=0; - pskymultioff[2][6]=2; - pskymultioff[2][7]=3; - - pskynummultis = 3; - - // default in game: - parallaxyscale = 32768; -} - - void ExtSetupMapFilename(const char *mapname) { Bstrcpy(levelname, mapname); @@ -806,7 +753,7 @@ void ExtLoadMap(const char *mapname) switch (sky) { case MOONSKY1 : - // keep in sync with MultiPskyInit + // keep in sync with G_MultiPskyInit // -v- Bmemcpy(pskyoff, pskymultioff[0], sizeof(pskymultioff[0])); break; @@ -10610,7 +10557,7 @@ int32_t ExtInit(void) ReadHelpFile("m32help.hlp"); - MultiPskyInit(); + G_MultiPskyInit(); #ifdef LUNATIC if (Em_CreateState(&g_EmState) == 0) diff --git a/polymer/eduke32/source/common.c b/polymer/eduke32/source/common.c index 04cf1d8a6..6b22242d7 100644 --- a/polymer/eduke32/source/common.c +++ b/polymer/eduke32/source/common.c @@ -8,6 +8,7 @@ #include "cache1d.h" #include "kplib.h" #include "baselayer.h" +#include "names.h" #include "common.h" #include "common_game.h" @@ -140,6 +141,60 @@ const char *G_ConFile(void) ////////// +void G_MultiPskyInit(void) +{ + int32_t i; + + // new-style multi-psky handling + pskymultilist[0] = MOONSKY1; + pskymultilist[1] = BIGORBIT1; + pskymultilist[2] = LA; + + pskymultiyscale[0] = 32768; + pskymultiyscale[1] = 32768; + pskymultiyscale[2] = 16384+1024; + + for (i=0; i<3; ++i) + { + pskymultibits[i] = 3; + Bmemset(pskymultioff[i], 0, sizeof(pskymultioff[i])); + } + + // KEEPINSYNC with Polymer MAX OFFSET = 4 + + // MOONSKY1 + // earth mountain mountain sun + pskymultioff[0][6]=1; + pskymultioff[0][1]=2; + pskymultioff[0][4]=2; + pskymultioff[0][2]=3; + + // BIGORBIT1 // orbit + // earth1 2 3 moon/sun + pskymultioff[1][5]=1; + pskymultioff[1][6]=2; + pskymultioff[1][7]=3; + pskymultioff[1][2]=4; + + // LA // la city + // earth1 2 3 moon/sun + pskymultioff[2][0]=1; + pskymultioff[2][1]=2; + pskymultioff[2][2]=1; + pskymultioff[2][3]=3; + pskymultioff[2][4]=4; + pskymultioff[2][5]=0; + pskymultioff[2][6]=2; + pskymultioff[2][7]=3; + + pskynummultis = 3; + + // default in game: + parallaxyscale = 32768; +} + +////////// + struct strllist *CommandPaths, *CommandGrps; void G_AddGroup(const char *buffer) diff --git a/polymer/eduke32/source/common_game.h b/polymer/eduke32/source/common_game.h index 559b8c258..3502560e6 100644 --- a/polymer/eduke32/source/common_game.h +++ b/polymer/eduke32/source/common_game.h @@ -45,4 +45,8 @@ extern void clearGrpNamePtr(void); extern void clearDefNamePtr(void); extern void clearScriptNamePtr(void); +////////// + +extern void G_MultiPskyInit(void); + #endif diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 884edbeca..b9ff63d47 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "duke3d.h" #include "game.h" +#include "common_game.h" #include "osd.h" #include "gamedef.h" #include "premap.h" @@ -932,53 +933,6 @@ static void resetprestat(int32_t snum,int32_t g) } -static void G_MultiPskyInit(void) -{ - int32_t i; - - // new-style multi-psky handling - pskymultilist[0] = MOONSKY1; - pskymultilist[1] = BIGORBIT1; - pskymultilist[2] = LA; - - pskymultiyscale[0] = 32768; - pskymultiyscale[1] = 32768; - pskymultiyscale[2] = 16384+1024; - - for (i=0; i<3; i++) - { - pskymultibits[i] = 3; - Bmemset(pskymultioff[i], 0, sizeof(pskymultioff[i])); - } - - // MOONSKY1 - // earth mountian mountain sun - pskymultioff[0][6]=1; - pskymultioff[0][1]=2; - pskymultioff[0][4]=2; - pskymultioff[0][2]=3; - - // BIGORBIT1 // orbit - // earth1 2 3 moon/sun - pskymultioff[1][5]=1; - pskymultioff[1][6]=2; - pskymultioff[1][7]=3; - pskymultioff[1][2]=4; - - // LA // la city - // earth1 2 3 moon/sun - pskymultioff[2][0]=1; - pskymultioff[2][1]=2; - pskymultioff[2][2]=1; - pskymultioff[2][3]=3; - pskymultioff[2][4]=4; - pskymultioff[2][5]=0; - pskymultioff[2][6]=2; - pskymultioff[2][7]=3; - - pskynummultis = 3; -} - static inline void G_SetupBackdrop(int16_t sky) { static int32_t multiskiesinited=0;