2014-03-15 16:59:03 +00:00
|
|
|
// SONIC ROBO BLAST 2
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
2022-03-03 19:24:46 +00:00
|
|
|
// Copyright (C) 1999-2022 by Sonic Team Junior.
|
2014-03-15 16:59:03 +00:00
|
|
|
//
|
|
|
|
// This program is free software distributed under the
|
|
|
|
// terms of the GNU General Public License, version 2.
|
|
|
|
// See the 'LICENSE' file for more details.
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
/// \file p_setup.h
|
|
|
|
/// \brief Setup a game, startup stuff
|
|
|
|
|
|
|
|
#ifndef __P_SETUP__
|
|
|
|
#define __P_SETUP__
|
|
|
|
|
|
|
|
#include "doomdata.h"
|
|
|
|
#include "doomstat.h"
|
|
|
|
#include "r_defs.h"
|
|
|
|
|
|
|
|
// map md5, sent to players via PT_SERVERINFO
|
|
|
|
extern unsigned char mapmd5[16];
|
|
|
|
|
|
|
|
// Player spawn spots for deathmatch.
|
|
|
|
#define MAX_DM_STARTS 64
|
|
|
|
extern mapthing_t *deathmatchstarts[MAX_DM_STARTS];
|
|
|
|
extern INT32 numdmstarts, numcoopstarts, numredctfstarts, numbluectfstarts;
|
|
|
|
|
|
|
|
extern boolean levelloading;
|
2018-06-14 21:23:20 +00:00
|
|
|
extern UINT8 levelfadecol;
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
extern lumpnum_t lastloadedmaplumpnum; // for comparative savegame
|
2019-10-21 03:21:22 +00:00
|
|
|
|
|
|
|
/* for levelflat type */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
LEVELFLAT_NONE,/* HOM time my friend */
|
|
|
|
LEVELFLAT_FLAT,
|
|
|
|
LEVELFLAT_PATCH,
|
|
|
|
LEVELFLAT_PNG,
|
|
|
|
LEVELFLAT_TEXTURE,
|
|
|
|
};
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
//
|
|
|
|
// MAP used flats lookup table
|
|
|
|
//
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char name[9]; // resource name from wad
|
2019-10-21 03:21:22 +00:00
|
|
|
|
|
|
|
UINT8 type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
lumpnum_t lumpnum; // lump number of the flat
|
|
|
|
// for flat animation
|
|
|
|
lumpnum_t baselumpnum;
|
|
|
|
}
|
|
|
|
flat;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
INT32 num;
|
|
|
|
INT32 lastnum; // texture number of the flat
|
|
|
|
// for flat animation
|
|
|
|
INT32 basenum;
|
|
|
|
}
|
|
|
|
texture;
|
|
|
|
}
|
|
|
|
u;
|
|
|
|
|
2019-05-21 18:24:26 +00:00
|
|
|
UINT16 width, height;
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
// for flat animation
|
|
|
|
INT32 animseq; // start pos. in the anim sequence
|
|
|
|
INT32 numpics;
|
|
|
|
INT32 speed;
|
2019-05-21 03:28:52 +00:00
|
|
|
|
2020-01-07 17:07:14 +00:00
|
|
|
// for textures
|
|
|
|
UINT8 *picture;
|
|
|
|
#ifdef HWRENDER
|
|
|
|
void *mipmap;
|
2020-12-14 05:07:12 +00:00
|
|
|
void *mippic;
|
2020-01-07 17:07:14 +00:00
|
|
|
#endif
|
2014-03-15 16:59:03 +00:00
|
|
|
} levelflat_t;
|
|
|
|
|
|
|
|
extern size_t numlevelflats;
|
|
|
|
extern levelflat_t *levelflats;
|
|
|
|
INT32 P_AddLevelFlat(const char *flatname, levelflat_t *levelflat);
|
2016-12-08 21:45:25 +00:00
|
|
|
INT32 P_AddLevelFlatRuntime(const char *flatname);
|
|
|
|
INT32 P_CheckLevelFlat(const char *flatname);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
extern size_t nummapthings;
|
|
|
|
extern mapthing_t *mapthings;
|
|
|
|
|
|
|
|
void P_SetupLevelSky(INT32 skynum, boolean global);
|
|
|
|
#ifdef SCANTHINGS
|
|
|
|
void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum);
|
|
|
|
#endif
|
2019-12-28 13:13:26 +00:00
|
|
|
void P_RespawnThings(void);
|
2020-01-31 14:57:04 +00:00
|
|
|
boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate);
|
2019-09-08 21:27:35 +00:00
|
|
|
#ifdef HWRENDER
|
2020-08-15 01:27:16 +00:00
|
|
|
void HWR_LoadLevel(void);
|
2019-09-08 21:27:35 +00:00
|
|
|
#endif
|
2018-01-04 20:15:44 +00:00
|
|
|
boolean P_AddWadFile(const char *wadfilename);
|
2021-03-23 02:56:55 +00:00
|
|
|
boolean P_AddFolder(const char *folderpath);
|
2014-03-15 16:59:03 +00:00
|
|
|
boolean P_RunSOC(const char *socfilename);
|
2017-10-07 22:18:25 +00:00
|
|
|
void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num);
|
|
|
|
void P_LoadMusicsRange(UINT16 wadnum, UINT16 first, UINT16 num);
|
2022-01-08 15:58:55 +00:00
|
|
|
//void P_WriteThings(void);
|
2014-03-15 16:59:03 +00:00
|
|
|
size_t P_PrecacheLevelFlats(void);
|
|
|
|
void P_AllocMapHeader(INT16 i);
|
|
|
|
|
2017-01-01 16:24:47 +00:00
|
|
|
void P_SetDemoFlickies(INT16 i);
|
|
|
|
void P_DeleteFlickies(INT16 i);
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
// Needed for NiGHTS
|
|
|
|
void P_ReloadRings(void);
|
2018-06-03 21:41:54 +00:00
|
|
|
void P_SwitchSpheresBonusMode(boolean bonustime);
|
2014-03-15 16:59:03 +00:00
|
|
|
void P_DeleteGrades(INT16 i);
|
|
|
|
void P_AddGradesForMare(INT16 i, UINT8 mare, char *gtext);
|
|
|
|
UINT8 P_GetGrade(UINT32 pscore, INT16 map, UINT8 mare);
|
|
|
|
UINT8 P_HasGrades(INT16 map, UINT8 mare);
|
|
|
|
UINT32 P_GetScoreForGrade(INT16 map, UINT8 mare, UINT8 grade);
|
2022-03-09 02:06:01 +00:00
|
|
|
UINT32 P_GetScoreForGradeOverall(INT16 map, UINT8 grade);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
#endif
|