2006-02-24 04:48:15 +00:00
|
|
|
/*
|
|
|
|
** g_level.h
|
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
2006-06-11 01:37:00 +00:00
|
|
|
** Copyright 1998-2006 Randy Heit
|
2006-02-24 04:48:15 +00:00
|
|
|
** All rights reserved.
|
|
|
|
**
|
|
|
|
** Redistribution and use in source and binary forms, with or without
|
|
|
|
** modification, are permitted provided that the following conditions
|
|
|
|
** are met:
|
|
|
|
**
|
|
|
|
** 1. Redistributions of source code must retain the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer.
|
|
|
|
** 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer in the
|
|
|
|
** documentation and/or other materials provided with the distribution.
|
|
|
|
** 3. The name of the author may not be used to endorse or promote products
|
|
|
|
** derived from this software without specific prior written permission.
|
|
|
|
**
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __G_LEVEL_H__
|
|
|
|
#define __G_LEVEL_H__
|
|
|
|
|
|
|
|
#include "doomtype.h"
|
|
|
|
#include "doomdef.h"
|
2009-08-02 03:38:57 +00:00
|
|
|
//#include "autosegs.h"
|
2009-02-03 19:11:43 +00:00
|
|
|
#include "sc_man.h"
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
struct level_info_t;
|
|
|
|
struct cluster_info_t;
|
|
|
|
class FScanner;
|
|
|
|
|
|
|
|
#if defined(_MSC_VER)
|
|
|
|
#pragma data_seg(".yreg$u")
|
|
|
|
#pragma data_seg()
|
|
|
|
|
|
|
|
#define MSVC_YSEG __declspec(allocate(".yreg$u"))
|
|
|
|
#define GCC_YSEG
|
|
|
|
#else
|
|
|
|
#define MSVC_YSEG
|
2009-08-02 03:38:57 +00:00
|
|
|
#define GCC_YSEG __attribute__((section(SECTION_YREG)))
|
2009-02-03 19:11:43 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
struct FMapInfoParser
|
|
|
|
{
|
|
|
|
enum EFormatType
|
|
|
|
{
|
|
|
|
FMT_Unknown,
|
|
|
|
FMT_Old,
|
|
|
|
FMT_New
|
|
|
|
};
|
|
|
|
|
|
|
|
FScanner sc;
|
|
|
|
int format_type;
|
|
|
|
bool HexenHack;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
FMapInfoParser()
|
|
|
|
{
|
|
|
|
format_type = FMT_Unknown;
|
|
|
|
HexenHack = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ParseLookupName(FString &dest);
|
|
|
|
void ParseMusic(FString &name, int &order);
|
|
|
|
void ParseLumpOrTextureName(char *name);
|
|
|
|
|
|
|
|
void ParseCluster();
|
|
|
|
void ParseNextMap(char *mapname);
|
|
|
|
level_info_t *ParseMapHeader(level_info_t &defaultinfo);
|
|
|
|
void ParseMapDefinition(level_info_t &leveldef);
|
2009-03-22 11:37:56 +00:00
|
|
|
void ParseGameInfo();
|
2009-02-03 19:11:43 +00:00
|
|
|
void ParseEpisodeInfo ();
|
|
|
|
void ParseSkill ();
|
2009-03-22 11:37:56 +00:00
|
|
|
void ParseMapInfo (int lump, level_info_t &gamedefaults, level_info_t &defaultinfo);
|
2009-02-03 19:11:43 +00:00
|
|
|
|
|
|
|
void ParseOpenBrace();
|
|
|
|
bool ParseCloseBrace();
|
|
|
|
bool CheckAssign();
|
|
|
|
void ParseAssign();
|
|
|
|
void MustParseAssign();
|
|
|
|
void ParseComma();
|
|
|
|
bool CheckNumber();
|
|
|
|
bool CheckFloat();
|
|
|
|
void SkipToNext();
|
2009-02-19 14:36:37 +00:00
|
|
|
void CheckEndOfFile(const char *block);
|
2009-02-03 19:11:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DEFINE_MAP_OPTION(name, old) \
|
|
|
|
static void MapOptHandler_##name(FMapInfoParser &parse, level_info_t *info); \
|
|
|
|
static FMapOptInfo MapOpt_##name = \
|
|
|
|
{ #name, MapOptHandler_##name, old }; \
|
|
|
|
MSVC_YSEG FMapOptInfo *mapopt_##name GCC_YSEG = &MapOpt_##name; \
|
|
|
|
static void MapOptHandler_##name(FMapInfoParser &parse, level_info_t *info)
|
2006-12-21 04:34:43 +00:00
|
|
|
|
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
struct FMapOptInfo
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
void (*handler) (FMapInfoParser &parse, level_info_t *levelinfo);
|
|
|
|
bool old;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ELevelFlags
|
|
|
|
{
|
|
|
|
LEVEL_NOINTERMISSION = 0x00000001,
|
|
|
|
LEVEL_NOINVENTORYBAR = 0x00000002, // This effects Doom only, since it's the only one without a standard inventory bar.
|
|
|
|
LEVEL_DOUBLESKY = 0x00000004,
|
|
|
|
LEVEL_HASFADETABLE = 0x00000008, // Level uses Hexen's fadetable mapinfo to get fog
|
2006-12-21 04:34:43 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL_MAP07SPECIAL = 0x00000010,
|
|
|
|
LEVEL_BRUISERSPECIAL = 0x00000020,
|
|
|
|
LEVEL_CYBORGSPECIAL = 0x00000040,
|
|
|
|
LEVEL_SPIDERSPECIAL = 0x00000080,
|
2006-12-21 04:34:43 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL_SPECLOWERFLOOR = 0x00000100,
|
|
|
|
LEVEL_SPECOPENDOOR = 0x00000200,
|
|
|
|
LEVEL_SPECACTIONSMASK = 0x00000300,
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL_MONSTERSTELEFRAG = 0x00000400,
|
|
|
|
LEVEL_ACTOWNSPECIAL = 0x00000800,
|
|
|
|
LEVEL_SNDSEQTOTALCTRL = 0x00001000,
|
|
|
|
LEVEL_FORCENOSKYSTRETCH = 0x00002000,
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL_CROUCH_NO = 0x00004000,
|
|
|
|
LEVEL_JUMP_NO = 0x00008000,
|
|
|
|
LEVEL_FREELOOK_NO = 0x00010000,
|
|
|
|
LEVEL_FREELOOK_YES = 0x00020000,
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
// The absence of both of the following bits means that this level does not
|
|
|
|
// use falling damage (though damage can be forced with dmflags,.
|
|
|
|
LEVEL_FALLDMG_ZD = 0x00040000, // Level uses ZDoom's falling damage
|
|
|
|
LEVEL_FALLDMG_HX = 0x00080000, // Level uses Hexen's falling damage
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL_HEADSPECIAL = 0x00100000, // Heretic episode 1/4
|
|
|
|
LEVEL_MINOTAURSPECIAL = 0x00200000, // Heretic episode 2/5
|
|
|
|
LEVEL_SORCERER2SPECIAL = 0x00400000, // Heretic episode 3
|
|
|
|
LEVEL_SPECKILLMONSTERS = 0x00800000,
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL_STARTLIGHTNING = 0x01000000, // Automatically start lightning
|
|
|
|
LEVEL_FILTERSTARTS = 0x02000000, // Apply mapthing filtering to player starts
|
|
|
|
LEVEL_LOOKUPLEVELNAME = 0x04000000, // Level name is the name of a language string
|
|
|
|
LEVEL_HEXENFORMAT = 0x08000000, // Level uses the Hexen map format
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL_SWAPSKIES = 0x10000000, // Used by lightning
|
|
|
|
LEVEL_NOALLIES = 0x20000000, // i.e. Inside Strife's front base
|
|
|
|
LEVEL_CHANGEMAPCHEAT = 0x40000000, // Don't display cluster messages
|
|
|
|
LEVEL_VISITED = 0x80000000, // Used for intermission map
|
2007-02-04 02:12:54 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
// The flags QWORD is now split into 2 DWORDs
|
|
|
|
LEVEL2_DEATHSLIDESHOW = 0x00000001, // Slideshow on death
|
|
|
|
LEVEL2_ALLMAP = 0x00000002, // The player picked up a map on this level
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL2_LAXMONSTERACTIVATION = 0x00000004, // Monsters can open doors depending on the door speed
|
|
|
|
LEVEL2_LAXACTIVATIONMAPINFO = 0x00000008, // LEVEL_LAXMONSTERACTIVATION is not a default.
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL2_MISSILESACTIVATEIMPACT = 0x00000010, // Missiles are the activators of SPAC_IMPACT events, not their shooters
|
|
|
|
LEVEL2_FROZEN = 0x00000020, // Game is frozen by a TimeFreezer
|
2006-04-27 15:12:17 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL2_KEEPFULLINVENTORY = 0x00000040, // doesn't reduce the amount of inventory items to 1
|
2006-05-14 14:30:13 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL2_MUSICDEFINED = 0x00000080, // a marker to disable the $map command in SNDINFO for this map
|
|
|
|
LEVEL2_MONSTERFALLINGDAMAGE = 0x00000100,
|
|
|
|
LEVEL2_CLIPMIDTEX = 0x00000200,
|
|
|
|
LEVEL2_WRAPMIDTEX = 0x00000400,
|
2006-05-21 02:10:16 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL2_CHECKSWITCHRANGE = 0x00000800,
|
2007-11-08 09:22:06 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL2_PAUSE_MUSIC_IN_MENUS = 0x00001000,
|
|
|
|
LEVEL2_TOTALINFIGHTING = 0x00002000,
|
|
|
|
LEVEL2_NOINFIGHTING = 0x00004000,
|
2008-03-18 18:18:18 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL2_NOMONSTERS = 0x00008000,
|
|
|
|
LEVEL2_INFINITE_FLIGHT = 0x00010000,
|
2007-12-06 08:55:17 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL2_ALLOWRESPAWN = 0x00020000,
|
2008-03-29 22:59:41 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
LEVEL2_FORCETEAMPLAYON = 0x00040000,
|
|
|
|
LEVEL2_FORCETEAMPLAYOFF = 0x00080000,
|
|
|
|
|
|
|
|
LEVEL2_CONV_SINGLE_UNFREEZE = 0x00100000,
|
|
|
|
LEVEL2_RAILINGHACK = 0x00200000, // but UDMF requires them to be separate to have more control
|
|
|
|
LEVEL2_DUMMYSWITCHES = 0x00400000,
|
|
|
|
LEVEL2_HEXENHACK = 0x00800000, // Level was defined in a Hexen style MAPINFO
|
|
|
|
|
|
|
|
LEVEL2_SMOOTHLIGHTING = 0x01000000, // Level uses the smooth lighting feature.
|
2009-05-15 17:21:45 +00:00
|
|
|
LEVEL2_POLYGRIND = 0x02000000, // Polyobjects grind corpses to gibs.
|
2009-06-06 12:46:35 +00:00
|
|
|
LEVEL2_RESETINVENTORY = 0x04000000, // Resets player inventory when starting this level (unless in a hub)
|
2009-02-03 19:11:43 +00:00
|
|
|
};
|
2008-08-21 08:04:21 +00:00
|
|
|
|
2008-01-26 16:42:16 +00:00
|
|
|
|
2008-09-15 14:11:05 +00:00
|
|
|
struct acsdefered_t;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
struct FSpecialAction
|
|
|
|
{
|
2006-05-03 22:45:01 +00:00
|
|
|
FName Type; // this is initialized before the actors...
|
2006-02-24 04:48:15 +00:00
|
|
|
BYTE Action;
|
2008-03-23 14:18:27 +00:00
|
|
|
int Args[5]; // must allow 16 bit tags for 666 & 667!
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
2008-06-01 20:43:02 +00:00
|
|
|
class FCompressedMemFile;
|
|
|
|
class DScroller;
|
|
|
|
|
2008-06-22 09:13:19 +00:00
|
|
|
class FScanner;
|
|
|
|
struct level_info_t;
|
|
|
|
|
|
|
|
struct FOptionalMapinfoData
|
|
|
|
{
|
|
|
|
FOptionalMapinfoData *Next;
|
|
|
|
FName identifier;
|
|
|
|
FOptionalMapinfoData() { Next = NULL; identifier = NAME_None; }
|
2008-06-28 12:24:15 +00:00
|
|
|
virtual ~FOptionalMapinfoData() {}
|
2008-06-22 09:13:19 +00:00
|
|
|
virtual FOptionalMapinfoData *Clone() const = 0;
|
|
|
|
};
|
|
|
|
|
2009-02-04 23:45:26 +00:00
|
|
|
struct FOptionalMapinfoDataPtr
|
|
|
|
{
|
|
|
|
FOptionalMapinfoData *Ptr;
|
|
|
|
|
|
|
|
FOptionalMapinfoDataPtr() throw() : Ptr(NULL) {}
|
|
|
|
~FOptionalMapinfoDataPtr() { if (Ptr!=NULL) delete Ptr; }
|
|
|
|
FOptionalMapinfoDataPtr(const FOptionalMapinfoDataPtr &p) throw() : Ptr(p.Ptr->Clone()) {}
|
|
|
|
FOptionalMapinfoDataPtr &operator= (FOptionalMapinfoDataPtr &p) throw() { Ptr = p.Ptr->Clone(); return *this; }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef TMap<FName, FOptionalMapinfoDataPtr> FOptData;
|
|
|
|
|
2008-04-05 12:14:33 +00:00
|
|
|
struct level_info_t
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
int levelnum;
|
2009-08-30 10:43:51 +00:00
|
|
|
|
|
|
|
char mapname[9];
|
2006-02-24 04:48:15 +00:00
|
|
|
char pname[9];
|
2009-08-30 10:43:51 +00:00
|
|
|
char nextmap[11]; // The endsequence string is 10 chars so we need more space here
|
|
|
|
char secretmap[11];
|
2006-02-24 04:48:15 +00:00
|
|
|
char skypic1[9];
|
2009-08-30 10:43:51 +00:00
|
|
|
char skypic2[9];
|
|
|
|
char fadetable[9];
|
|
|
|
char f1[9];
|
|
|
|
char bordertexture[9];
|
|
|
|
char mapbg[9];
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
int cluster;
|
|
|
|
int partime;
|
|
|
|
int sucktime;
|
2009-02-03 19:11:43 +00:00
|
|
|
DWORD flags;
|
|
|
|
DWORD flags2;
|
|
|
|
FString Music;
|
|
|
|
FString LevelName;
|
2006-02-24 04:48:15 +00:00
|
|
|
SBYTE WallVertLight, WallHorizLight;
|
|
|
|
int musicorder;
|
|
|
|
FCompressedMemFile *snapshot;
|
|
|
|
DWORD snapshotVer;
|
2008-09-15 14:11:05 +00:00
|
|
|
struct acsdefered_t *defered;
|
2006-05-18 01:42:50 +00:00
|
|
|
float skyspeed1;
|
|
|
|
float skyspeed2;
|
2006-02-24 04:48:15 +00:00
|
|
|
DWORD fadeto;
|
|
|
|
DWORD outsidefog;
|
|
|
|
int cdtrack;
|
|
|
|
unsigned int cdid;
|
|
|
|
float gravity;
|
|
|
|
float aircontrol;
|
|
|
|
int WarpTrans;
|
|
|
|
int airsupply;
|
2006-06-03 12:30:11 +00:00
|
|
|
DWORD compatflags;
|
|
|
|
DWORD compatmask;
|
2009-02-03 19:11:43 +00:00
|
|
|
FString Translator; // for converting Doom-format linedef and sector types.
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Redirection: If any player is carrying the specified item, then
|
|
|
|
// you go to the RedirectMap instead of this one.
|
2006-05-10 15:07:14 +00:00
|
|
|
FName RedirectType;
|
2006-02-24 04:48:15 +00:00
|
|
|
char RedirectMap[9];
|
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
FString EnterPic;
|
|
|
|
FString ExitPic;
|
|
|
|
FString InterMusic;
|
2006-06-09 08:19:46 +00:00
|
|
|
int intermusicorder;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
FString SoundInfo;
|
|
|
|
FString SndSeq;
|
2007-12-27 11:25:25 +00:00
|
|
|
|
2007-12-22 22:04:20 +00:00
|
|
|
float teamdamage;
|
2008-04-05 12:14:33 +00:00
|
|
|
|
2009-02-04 23:45:26 +00:00
|
|
|
FOptData optdata;
|
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
TArray<FSpecialAction> specialactions;
|
|
|
|
|
|
|
|
level_info_t()
|
|
|
|
{
|
|
|
|
Reset();
|
|
|
|
}
|
|
|
|
~level_info_t()
|
|
|
|
{
|
|
|
|
ClearSnapshot();
|
|
|
|
ClearDefered();
|
|
|
|
}
|
|
|
|
void Reset();
|
|
|
|
bool isValid();
|
|
|
|
FString LookupLevelName ();
|
|
|
|
void ClearSnapshot();
|
|
|
|
void ClearDefered();
|
|
|
|
level_info_t *CheckLevelRedirect ();
|
2008-06-22 09:13:19 +00:00
|
|
|
|
2009-02-04 23:45:26 +00:00
|
|
|
template<class T>
|
|
|
|
T *GetOptData(FName id, bool create = true)
|
|
|
|
{
|
|
|
|
FOptionalMapinfoDataPtr *pdat = optdata.CheckKey(id);
|
|
|
|
|
|
|
|
if (pdat != NULL)
|
|
|
|
{
|
|
|
|
return static_cast<T*>(pdat->Ptr);
|
|
|
|
}
|
|
|
|
else if (create)
|
|
|
|
{
|
|
|
|
T *newobj = new T;
|
|
|
|
optdata[id].Ptr = newobj;
|
|
|
|
return newobj;
|
|
|
|
}
|
|
|
|
else return NULL;
|
|
|
|
}
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// [RH] These get zeroed every tic and are updated by thinkers.
|
|
|
|
struct FSectorScrollValues
|
|
|
|
{
|
|
|
|
fixed_t ScrollX, ScrollY;
|
|
|
|
};
|
|
|
|
|
2008-04-05 12:14:33 +00:00
|
|
|
struct FLevelLocals
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
void Tick ();
|
|
|
|
void AddScroller (DScroller *, int secnum);
|
|
|
|
|
2006-04-11 16:27:41 +00:00
|
|
|
int time; // time in the hub
|
|
|
|
int maptime; // time in the map
|
|
|
|
int totaltime; // time in the game
|
2006-02-24 04:48:15 +00:00
|
|
|
int starttime;
|
|
|
|
int partime;
|
|
|
|
int sucktime;
|
|
|
|
|
|
|
|
level_info_t *info;
|
|
|
|
int cluster;
|
|
|
|
int clusterflags;
|
|
|
|
int levelnum;
|
|
|
|
int lumpnum;
|
2009-02-03 19:11:43 +00:00
|
|
|
FString LevelName;
|
2009-08-30 10:43:51 +00:00
|
|
|
char mapname[256]; // the lump name (E1M1, MAP01, etc)
|
|
|
|
char nextmap[11]; // go here when using the regular exit
|
|
|
|
char secretmap[11]; // map to go to when used secret exit
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
DWORD flags;
|
|
|
|
DWORD flags2;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
DWORD fadeto; // The color the palette fades to (usually black)
|
|
|
|
DWORD outsidefog; // The fog for sectors with sky ceilings
|
|
|
|
|
2009-02-03 19:11:43 +00:00
|
|
|
FString Music;
|
2006-02-24 04:48:15 +00:00
|
|
|
int musicorder;
|
|
|
|
int cdtrack;
|
|
|
|
unsigned int cdid;
|
|
|
|
char skypic1[9];
|
|
|
|
char skypic2[9];
|
|
|
|
|
2006-05-18 01:42:50 +00:00
|
|
|
float skyspeed1; // Scrolling speed of sky textures, in pixels per ms
|
|
|
|
float skyspeed2;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
int total_secrets;
|
|
|
|
int found_secrets;
|
|
|
|
|
|
|
|
int total_items;
|
|
|
|
int found_items;
|
|
|
|
|
|
|
|
int total_monsters;
|
|
|
|
int killed_monsters;
|
|
|
|
|
|
|
|
float gravity;
|
|
|
|
fixed_t aircontrol;
|
|
|
|
fixed_t airfriction;
|
|
|
|
int airsupply;
|
|
|
|
|
|
|
|
FSectorScrollValues *Scrolls; // NULL if no DScrollers in this level
|
|
|
|
|
|
|
|
SBYTE WallVertLight; // Light diffs for vert/horiz walls
|
|
|
|
SBYTE WallHorizLight;
|
2007-05-10 22:22:38 +00:00
|
|
|
|
2008-02-13 02:29:49 +00:00
|
|
|
bool FromSnapshot; // The current map was restored from a snapshot
|
|
|
|
|
2007-12-22 22:04:20 +00:00
|
|
|
float teamdamage;
|
|
|
|
|
2007-12-11 04:03:40 +00:00
|
|
|
bool IsJumpingAllowed() const;
|
|
|
|
bool IsCrouchingAllowed() const;
|
|
|
|
bool IsFreelookAllowed() const;
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum EndTypes
|
|
|
|
{
|
|
|
|
END_Pic,
|
|
|
|
END_Pic1,
|
|
|
|
END_Pic2,
|
|
|
|
END_Pic3,
|
|
|
|
END_Bunny,
|
|
|
|
END_Cast,
|
|
|
|
END_Demon,
|
|
|
|
END_Underwater,
|
|
|
|
END_Chess,
|
|
|
|
END_Strife,
|
2009-05-30 08:56:40 +00:00
|
|
|
END_BuyStrife,
|
|
|
|
END_TitleScreen
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct EndSequence
|
|
|
|
{
|
2006-09-14 00:02:31 +00:00
|
|
|
BYTE EndType;
|
2008-05-30 06:56:50 +00:00
|
|
|
bool Advanced;
|
|
|
|
bool MusicLooping;
|
|
|
|
bool PlayTheEnd;
|
2008-06-05 04:30:18 +00:00
|
|
|
FString PicName;
|
|
|
|
FString PicName2;
|
2008-05-30 06:56:50 +00:00
|
|
|
FString Music;
|
2008-06-05 04:30:18 +00:00
|
|
|
|
|
|
|
EndSequence();
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern TArray<EndSequence> EndSequences;
|
|
|
|
|
2008-09-14 23:54:38 +00:00
|
|
|
struct cluster_info_t
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
int cluster;
|
|
|
|
char finaleflat[9];
|
2009-02-03 19:11:43 +00:00
|
|
|
FString ExitText;
|
|
|
|
FString EnterText;
|
|
|
|
FString MessageMusic;
|
2006-02-24 04:48:15 +00:00
|
|
|
int musicorder;
|
|
|
|
int flags;
|
|
|
|
int cdtrack;
|
2009-02-03 19:11:43 +00:00
|
|
|
FString ClusterName;
|
2006-02-24 04:48:15 +00:00
|
|
|
unsigned int cdid;
|
2009-02-03 19:11:43 +00:00
|
|
|
|
|
|
|
void Reset();
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Cluster flags
|
|
|
|
#define CLUSTER_HUB 0x00000001 // Cluster uses hub behavior
|
|
|
|
#define CLUSTER_EXITTEXTINLUMP 0x00000002 // Exit text is the name of a lump
|
|
|
|
#define CLUSTER_ENTERTEXTINLUMP 0x00000004 // Enter text is the name of a lump
|
|
|
|
#define CLUSTER_FINALEPIC 0x00000008 // Finale "flat" is actually a full-sized image
|
|
|
|
#define CLUSTER_LOOKUPEXITTEXT 0x00000010 // Exit text is the name of a language string
|
|
|
|
#define CLUSTER_LOOKUPENTERTEXT 0x00000020 // Enter text is the name of a language string
|
2008-04-05 16:45:39 +00:00
|
|
|
#define CLUSTER_LOOKUPNAME 0x00000040 // Name is the name of a language string
|
2009-02-03 19:11:43 +00:00
|
|
|
#define CLUSTER_LOOKUPCLUSTERNAME 0x00000080 // Cluster name is the name of a language string
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-04-05 12:14:33 +00:00
|
|
|
extern FLevelLocals level;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-05-04 06:14:52 +00:00
|
|
|
extern TArray<level_info_t> wadlevelinfos;
|
2009-02-03 19:11:43 +00:00
|
|
|
extern TArray<cluster_info_t> wadclusterinfos;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-05-18 04:25:26 +00:00
|
|
|
extern bool savegamerestore;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// mapname will be changed if it is a valid warptrans
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
bool CheckWarpTransMap (FString &mapname, bool substitute);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-12-29 03:38:37 +00:00
|
|
|
void G_InitNew (const char *mapname, bool bTitleLevel);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Can be called by the startup code or M_Responder.
|
|
|
|
// A normal game starts at map 1,
|
|
|
|
// but a warp test can start elsewhere
|
2007-08-09 08:42:15 +00:00
|
|
|
void G_DeferedInitNew (const char *mapname, int skill = -1);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
void G_ExitLevel (int position, bool keepFacing);
|
|
|
|
void G_SecretExitLevel (int position);
|
2008-02-12 05:54:03 +00:00
|
|
|
const char *G_GetExitMap();
|
|
|
|
const char *G_GetSecretExitMap();
|
2006-08-10 15:28:12 +00:00
|
|
|
|
2007-09-06 09:54:57 +00:00
|
|
|
void G_ChangeLevel(const char * levelname, int position, bool keepFacing, int nextSkill=-1,
|
|
|
|
bool nointermission=false, bool resetinventory=false, bool nomonsters=false);
|
2006-08-10 15:28:12 +00:00
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
void G_SetForEndGame (char *nextmap);
|
|
|
|
|
|
|
|
void G_StartTravel ();
|
|
|
|
void G_FinishTravel ();
|
|
|
|
|
|
|
|
void G_DoLoadLevel (int position, bool autosave);
|
|
|
|
|
|
|
|
void G_InitLevelLocals (void);
|
|
|
|
|
|
|
|
void G_AirControlChanged ();
|
|
|
|
|
|
|
|
cluster_info_t *FindClusterInfo (int cluster);
|
2008-02-12 05:54:03 +00:00
|
|
|
level_info_t *FindLevelInfo (const char *mapname);
|
2006-02-24 04:48:15 +00:00
|
|
|
level_info_t *FindLevelByNum (int num);
|
|
|
|
level_info_t *CheckLevelRedirect (level_info_t *info);
|
|
|
|
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
FString CalcMapName (int episode, int level);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-03-22 11:37:56 +00:00
|
|
|
void G_ParseMapInfo (const char *basemapinfo);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
void G_ClearSnapshots (void);
|
2009-02-03 19:11:43 +00:00
|
|
|
void P_RemoveDefereds ();
|
2006-02-24 04:48:15 +00:00
|
|
|
void G_SnapshotLevel (void);
|
|
|
|
void G_UnSnapshotLevel (bool keepPlayers);
|
|
|
|
struct PNGHandle;
|
|
|
|
void G_ReadSnapshots (PNGHandle *png);
|
|
|
|
void G_WriteSnapshots (FILE *file);
|
|
|
|
|
2007-10-29 22:15:46 +00:00
|
|
|
enum ESkillProperty
|
|
|
|
{
|
|
|
|
SKILLP_AmmoFactor,
|
2008-08-07 08:18:48 +00:00
|
|
|
SKILLP_DropAmmoFactor,
|
2007-10-29 22:15:46 +00:00
|
|
|
SKILLP_DamageFactor,
|
|
|
|
SKILLP_FastMonsters,
|
|
|
|
SKILLP_Respawn,
|
2008-01-26 16:42:16 +00:00
|
|
|
SKILLP_RespawnLimit,
|
2007-10-29 22:15:46 +00:00
|
|
|
SKILLP_Aggressiveness,
|
|
|
|
SKILLP_DisableCheats,
|
|
|
|
SKILLP_AutoUseHealth,
|
|
|
|
SKILLP_SpawnFilter,
|
|
|
|
SKILLP_EasyBossBrain,
|
2009-07-04 18:17:44 +00:00
|
|
|
SKILLP_ACSReturn,
|
|
|
|
SKILLP_MonsterHealth,
|
|
|
|
SKILLP_FriendlyHealth,
|
|
|
|
SKILLP_NoPain
|
2007-10-29 22:15:46 +00:00
|
|
|
};
|
|
|
|
int G_SkillProperty(ESkillProperty prop);
|
|
|
|
|
2007-11-02 22:03:03 +00:00
|
|
|
typedef TMap<FName, FString> SkillMenuNames;
|
|
|
|
|
2009-06-26 17:17:52 +00:00
|
|
|
typedef TMap<FName, FName> SkillActorReplacement;
|
|
|
|
|
2007-11-02 22:03:03 +00:00
|
|
|
struct FSkillInfo
|
|
|
|
{
|
2007-12-08 22:57:55 +00:00
|
|
|
FName Name;
|
2008-08-07 08:18:48 +00:00
|
|
|
fixed_t AmmoFactor, DoubleAmmoFactor, DropAmmoFactor;
|
2007-11-02 22:03:03 +00:00
|
|
|
fixed_t DamageFactor;
|
|
|
|
bool FastMonsters;
|
|
|
|
bool DisableCheats;
|
|
|
|
bool AutoUseHealth;
|
|
|
|
bool EasyBossBrain;
|
|
|
|
int RespawnCounter;
|
2008-01-26 16:42:16 +00:00
|
|
|
int RespawnLimit;
|
2007-11-02 22:03:03 +00:00
|
|
|
fixed_t Aggressiveness;
|
|
|
|
int SpawnFilter;
|
|
|
|
int ACSReturn;
|
|
|
|
FString MenuName;
|
|
|
|
SkillMenuNames MenuNamesForPlayerClass;
|
|
|
|
bool MenuNameIsLump;
|
|
|
|
bool MustConfirm;
|
2007-12-06 08:55:17 +00:00
|
|
|
FString MustConfirmText;
|
2007-12-08 22:57:55 +00:00
|
|
|
char Shortcut;
|
|
|
|
FString TextColor;
|
2009-06-26 17:17:52 +00:00
|
|
|
SkillActorReplacement Replace;
|
|
|
|
SkillActorReplacement Replaced;
|
2009-07-04 18:17:44 +00:00
|
|
|
fixed_t MonsterHealth;
|
|
|
|
fixed_t FriendlyHealth;
|
|
|
|
bool NoPain;
|
2007-11-02 22:03:03 +00:00
|
|
|
|
|
|
|
FSkillInfo() {}
|
|
|
|
FSkillInfo(const FSkillInfo &other)
|
|
|
|
{
|
|
|
|
operator=(other);
|
|
|
|
}
|
2007-12-08 22:57:55 +00:00
|
|
|
FSkillInfo &operator=(const FSkillInfo &other);
|
|
|
|
int GetTextColor() const;
|
2009-06-26 17:17:52 +00:00
|
|
|
|
|
|
|
void SetReplacement(FName a, FName b);
|
|
|
|
FName GetReplacement(FName a);
|
|
|
|
void SetReplacedBy(FName b, FName a);
|
|
|
|
FName GetReplacedBy(FName b);
|
2007-11-02 22:03:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern TArray<FSkillInfo> AllSkills;
|
2009-07-23 04:33:07 +00:00
|
|
|
extern int DefaultSkill;
|
2007-11-02 22:03:03 +00:00
|
|
|
|
|
|
|
|
2007-10-29 22:15:46 +00:00
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
#endif //__G_LEVEL_H__
|