mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 15:11:51 +00:00
Retire MultiPsky_TileToIdx() in favor of engine-side getpskyidx().
DONT_BUILD, because there have been no significant changes of the non-Lua build. git-svn-id: https://svn.eduke32.com/eduke32@4006 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
af243f1cd6
commit
ff05fb9b5c
4 changed files with 13 additions and 28 deletions
|
@ -774,6 +774,17 @@ EXTERN psky_t multipsky[MAXPSKYMULTIS];
|
|||
// Mapping of multi-sky index to base sky tile number:
|
||||
EXTERN int32_t multipskytile[MAXPSKYMULTIS];
|
||||
|
||||
static inline int32_t getpskyidx(int32_t picnum)
|
||||
{
|
||||
int32_t j;
|
||||
|
||||
for (j=pskynummultis; j>0; j--) // NOTE: j==0 on non-early loop end
|
||||
if (picnum == multipskytile[j])
|
||||
break; // Have a match.
|
||||
|
||||
return j;
|
||||
}
|
||||
|
||||
EXTERN char parallaxtype;
|
||||
|
||||
// last sprite in the freelist, that is the spritenum for which
|
||||
|
|
|
@ -216,12 +216,7 @@ static inline void bricolor(palette_t *wpptr, int32_t dacol)
|
|||
// Returns: pointer to tile offset array. Sets-by-pointer the other two.
|
||||
static inline const int8_t *getpsky(int32_t picnum, int32_t *dapyscale, int32_t *dapskybits)
|
||||
{
|
||||
int32_t j;
|
||||
|
||||
// First, try a multi-sky.
|
||||
for (j=pskynummultis; j>0; j--) // NOTE: j==0 on non-early loop end
|
||||
if (picnum == multipskytile[j])
|
||||
break; // Have a match.
|
||||
int32_t j = getpskyidx(picnum);
|
||||
|
||||
if (dapskybits)
|
||||
*dapskybits = multipsky[j].lognumtiles;
|
||||
|
|
|
@ -157,7 +157,6 @@ EDUKE32_STATIC_ASSERT(NUMPSKYMULTIS <= MAXPSKYMULTIS);
|
|||
EDUKE32_STATIC_ASSERT(PSKYOFF_MAX <= MAXPSKYTILES);
|
||||
|
||||
// Set up new-style multi-psky handling.
|
||||
// KEEPINSYNC MultiPsky_TileToIdx().
|
||||
void G_InitMultiPsky(int32_t CLOUDYOCEAN__DYN, int32_t MOONSKY1__DYN, int32_t BIGORBIT1__DYN, int32_t LA__DYN)
|
||||
{
|
||||
int32_t i;
|
||||
|
@ -243,7 +242,7 @@ void G_SetupGlobalPsky(void)
|
|||
{
|
||||
if (sector[i].ceilingstat & 1)
|
||||
{
|
||||
mskyidx = MultiPsky_TileToIdx(sector[i].ceilingpicnum);
|
||||
mskyidx = getpskyidx(sector[i].ceilingpicnum);
|
||||
if (mskyidx > 0)
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -61,26 +61,6 @@ extern void clearScriptNamePtr(void);
|
|||
extern void G_InitMultiPsky(int32_t CLOUDYOCEAN__DYN, int32_t MOONSKY1__DYN, int32_t BIGORBIT1__DYN, int32_t LA__DYN);
|
||||
extern void G_SetupGlobalPsky(void);
|
||||
|
||||
// Get the multi-psky index corresponding to a base tile number of the sky (for
|
||||
// the game: the *static* value!), or 0 as the catch-all.
|
||||
// KEEPINSYNC G_InitMultiPsky().
|
||||
static inline int32_t MultiPsky_TileToIdx(int32_t tilenum)
|
||||
{
|
||||
switch (tilenum)
|
||||
{
|
||||
default:
|
||||
return 0;
|
||||
case 78: // CLOUDYOCEAN__STATIC
|
||||
return 1;
|
||||
case 80: // MOONSKY1__STATIC:
|
||||
return 2;
|
||||
case 84: // BIGORBIT1__STATIC:
|
||||
return 3;
|
||||
case 89: // LA__STATIC:
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
//////////
|
||||
|
||||
extern void G_ExtPreInit(void);
|
||||
|
|
Loading…
Reference in a new issue