Factor G_MultiPskyInit into common.c.

git-svn-id: https://svn.eduke32.com/eduke32@3220 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-11-25 04:25:31 +00:00
parent be899ba3af
commit 9a75f0b88c
4 changed files with 62 additions and 102 deletions

View file

@ -716,59 +716,6 @@ const char *ExtGetVer(void)
return s_buildRev; 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) void ExtSetupMapFilename(const char *mapname)
{ {
Bstrcpy(levelname, mapname); Bstrcpy(levelname, mapname);
@ -806,7 +753,7 @@ void ExtLoadMap(const char *mapname)
switch (sky) switch (sky)
{ {
case MOONSKY1 : case MOONSKY1 :
// keep in sync with MultiPskyInit // keep in sync with G_MultiPskyInit
// -v- // -v-
Bmemcpy(pskyoff, pskymultioff[0], sizeof(pskymultioff[0])); Bmemcpy(pskyoff, pskymultioff[0], sizeof(pskymultioff[0]));
break; break;
@ -10610,7 +10557,7 @@ int32_t ExtInit(void)
ReadHelpFile("m32help.hlp"); ReadHelpFile("m32help.hlp");
MultiPskyInit(); G_MultiPskyInit();
#ifdef LUNATIC #ifdef LUNATIC
if (Em_CreateState(&g_EmState) == 0) if (Em_CreateState(&g_EmState) == 0)

View file

@ -8,6 +8,7 @@
#include "cache1d.h" #include "cache1d.h"
#include "kplib.h" #include "kplib.h"
#include "baselayer.h" #include "baselayer.h"
#include "names.h"
#include "common.h" #include "common.h"
#include "common_game.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; struct strllist *CommandPaths, *CommandGrps;
void G_AddGroup(const char *buffer) void G_AddGroup(const char *buffer)

View file

@ -45,4 +45,8 @@ extern void clearGrpNamePtr(void);
extern void clearDefNamePtr(void); extern void clearDefNamePtr(void);
extern void clearScriptNamePtr(void); extern void clearScriptNamePtr(void);
//////////
extern void G_MultiPskyInit(void);
#endif #endif

View file

@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "duke3d.h" #include "duke3d.h"
#include "game.h" #include "game.h"
#include "common_game.h"
#include "osd.h" #include "osd.h"
#include "gamedef.h" #include "gamedef.h"
#include "premap.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 inline void G_SetupBackdrop(int16_t sky)
{ {
static int32_t multiskiesinited=0; static int32_t multiskiesinited=0;