mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-02 18:21:02 +00:00
* Updated to ZDoom r3038 (IWAD selection dialog already fixed in previous commit):
- Added DavidPH's submission for specifying vertex heights directly in UDMF. - Move static AM color initialization into the AM_StaticInit function. - Move D_LoadWadSettings to keysections.cpp. - Made some more data reloadable. - Data structures filled by P_SetupLevel should be cleared before loading the level. They can remain non-empty in case of an error. There's probably more to fix here... - Fixed: MidiDevices and MusicAliases were not cleared before reloading local SNDINFOs. - Fixed signed/unsigned warnings in AddSwitchPair for real (GCC really allows -1u? MSVC prints a warning for that.) - Fixed: GCC compiler warnings. - Zipdir will no longer store files ending in '~' on Linux. - Added st_oldouch which restores the old ouch face behavior of only showing when health increases by 20 while taking damage. - Changed some data init code to delete the data it wants to initialize first. - The 'savebuffer' variable still existed? - Changed AInventory::Destroy to NULL SendItemUse and SendItemDrop if they point to the destroyed object. Although unlikely it can't be ruled out completely that this can happen with delayed CCMDs. - Fixed: Starting a new game did not clear the hub statistics array. - Cleaned up D_DoomMain a little. It's still far too large though. - Added explicit initialization of console background texture instead of letting C_InitConsole doing it as needed. - Added 'clearaliases' CCMD. - Init bot specific actor properties right after parsing DECORATE, not when spawning the first bot (which is too late.) - Changed automap initialization so that static data only gets initialized once upon startup instead of each time a level starts. - Initialize AUTOPAGE only once when the level starts, not each time the automap is switched on. - Cleaned up switch code and fixed several problems: * savegames stored an index in the switch table and performed no validation when loading a savegame. * setting of a random switch animation duration was broken. * separated the 2 values stored in the Time variable into 2 separate variables. * defining a switch with one texture already belonging to another switch could leave broken definitions in the switch table. - Added function for serializing switch and door animation pointers. - Bumped min. savegame versions due to changes to DButtonThinker and removed all current savegame compatibility code. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1128 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
d0338ea7a0
commit
e6750550a5
63 changed files with 668 additions and 630 deletions
103
src/am_map.cpp
103
src/am_map.cpp
|
@ -64,6 +64,12 @@
|
|||
#include "po_man.h"
|
||||
#include "a_keys.h"
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Automap colors
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
struct AMColor
|
||||
{
|
||||
int Index;
|
||||
|
@ -119,6 +125,12 @@ static BYTE RavenPaletteVals[11*3] =
|
|||
0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// globals
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#define MAPBITS 12
|
||||
#define MapDiv SafeDivScale12
|
||||
#define MapMul MulScale12
|
||||
|
@ -287,28 +299,28 @@ struct islope_t
|
|||
// A line drawing of the player pointing right,
|
||||
// starting from the middle.
|
||||
//
|
||||
TArray<mline_t> MapArrow;
|
||||
TArray<mline_t> CheatMapArrow;
|
||||
TArray<mline_t> CheatKey;
|
||||
static TArray<mline_t> MapArrow;
|
||||
static TArray<mline_t> CheatMapArrow;
|
||||
static TArray<mline_t> CheatKey;
|
||||
|
||||
#define R (MAPUNIT)
|
||||
// [RH] Avoid lots of warnings without compiler-specific #pragmas
|
||||
#define L(a,b,c,d) { {(fixed_t)((a)*R),(fixed_t)((b)*R)}, {(fixed_t)((c)*R),(fixed_t)((d)*R)} }
|
||||
mline_t triangle_guy[] = {
|
||||
static mline_t triangle_guy[] = {
|
||||
L (-.867,-.5, .867,-.5),
|
||||
L (.867,-.5, 0,1),
|
||||
L (0,1, -.867,-.5)
|
||||
};
|
||||
#define NUMTRIANGLEGUYLINES (sizeof(triangle_guy)/sizeof(mline_t))
|
||||
|
||||
mline_t thintriangle_guy[] = {
|
||||
static mline_t thintriangle_guy[] = {
|
||||
L (-.5,-.7, 1,0),
|
||||
L (1,0, -.5,.7),
|
||||
L (-.5,.7, -.5,-.7)
|
||||
};
|
||||
#define NUMTHINTRIANGLEGUYLINES (sizeof(thintriangle_guy)/sizeof(mline_t))
|
||||
|
||||
mline_t square_guy[] = {
|
||||
static mline_t square_guy[] = {
|
||||
L (0,1,1,0),
|
||||
L (1,0,0,-1),
|
||||
L (0,-1,-1,0),
|
||||
|
@ -332,8 +344,6 @@ CUSTOM_CVAR (Int, am_cheat, 0, 0)
|
|||
|
||||
static int grid = 0;
|
||||
|
||||
static int leveljuststarted = 1; // kluge until AM_LevelInit() is called
|
||||
|
||||
bool automapactive = false;
|
||||
|
||||
// location of window on screen
|
||||
|
@ -515,16 +525,41 @@ void AM_ParseArrow(TArray<mline_t> &Arrow, const char *lumpname)
|
|||
}
|
||||
}
|
||||
|
||||
void AM_InitArrows()
|
||||
void AM_StaticInit()
|
||||
{
|
||||
|
||||
MapArrow.Clear();
|
||||
CheatMapArrow.Clear();
|
||||
CheatKey.Clear();
|
||||
|
||||
if (gameinfo.mMapArrow.IsNotEmpty()) AM_ParseArrow(MapArrow, gameinfo.mMapArrow);
|
||||
if (gameinfo.mCheatMapArrow.IsNotEmpty()) AM_ParseArrow(CheatMapArrow, gameinfo.mCheatMapArrow);
|
||||
AM_ParseArrow(CheatKey, "maparrows/key.txt");
|
||||
if (MapArrow.Size() == 0) I_FatalError("No automap arrow defined");
|
||||
|
||||
char namebuf[9];
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
mysnprintf (namebuf, countof(namebuf), "AMMNUM%d", i);
|
||||
marknums[i] = TexMan.CheckForTexture (namebuf, FTexture::TEX_MiscPatch);
|
||||
}
|
||||
markpointnum = 0;
|
||||
mapback.SetInvalid();
|
||||
|
||||
static DWORD *lastpal = NULL;
|
||||
//static int lastback = -1;
|
||||
DWORD *palette;
|
||||
|
||||
palette = (DWORD *)GPalette.BaseColors;
|
||||
|
||||
int i, j;
|
||||
|
||||
for (i = j = 0; i < 11; i++, j += 3)
|
||||
{
|
||||
DoomColors[i].FromRGB(DoomPaletteVals[j], DoomPaletteVals[j+1], DoomPaletteVals[j+2]);
|
||||
StrifeColors[i].FromRGB(StrifePaletteVals[j], StrifePaletteVals[j+1], StrifePaletteVals[j+2]);
|
||||
RavenColors[i].FromRGB(RavenPaletteVals[j], RavenPaletteVals[j+1], RavenPaletteVals[j+2]);
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
@ -858,24 +893,6 @@ void AM_initVariables ()
|
|||
|
||||
static void AM_initColors (bool overlayed)
|
||||
{
|
||||
static DWORD *lastpal = NULL;
|
||||
//static int lastback = -1;
|
||||
DWORD *palette;
|
||||
|
||||
palette = (DWORD *)GPalette.BaseColors;
|
||||
|
||||
if (lastpal != palette)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = j = 0; i < 11; i++, j += 3)
|
||||
{
|
||||
DoomColors[i].FromRGB(DoomPaletteVals[j], DoomPaletteVals[j+1], DoomPaletteVals[j+2]);
|
||||
StrifeColors[i].FromRGB(StrifePaletteVals[j], StrifePaletteVals[j+1], StrifePaletteVals[j+2]);
|
||||
RavenColors[i].FromRGB(RavenPaletteVals[j], RavenPaletteVals[j+1], RavenPaletteVals[j+2]);
|
||||
}
|
||||
}
|
||||
|
||||
if (overlayed)
|
||||
{
|
||||
YourColor.FromCVar (am_ovyourcolor);
|
||||
|
@ -1000,30 +1017,6 @@ static void AM_initColors (bool overlayed)
|
|||
break;
|
||||
|
||||
}
|
||||
|
||||
lastpal = palette;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
void AM_loadPics ()
|
||||
{
|
||||
int i;
|
||||
char namebuf[9];
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
mysnprintf (namebuf, countof(namebuf), "AMMNUM%d", i);
|
||||
marknums[i] = TexMan.CheckForTexture (namebuf, FTexture::TEX_MiscPatch);
|
||||
}
|
||||
|
||||
const char *autopage = level.info->mapbg[0] == 0? "AUTOPAGE" : (const char*)&level.info->mapbg[0];
|
||||
|
||||
mapback = TexMan.CheckForTexture(autopage, FTexture::TEX_MiscPatch);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
@ -1048,9 +1041,8 @@ bool AM_clearMarks ()
|
|||
|
||||
void AM_LevelInit ()
|
||||
{
|
||||
if (MapArrow.Size() == 0) AM_InitArrows();
|
||||
|
||||
leveljuststarted = 0;
|
||||
const char *autopage = level.info->mapbg[0] == 0? "AUTOPAGE" : (const char*)&level.info->mapbg[0];
|
||||
mapback = TexMan.CheckForTexture(autopage, FTexture::TEX_MiscPatch);
|
||||
|
||||
AM_clearMarks();
|
||||
|
||||
|
@ -1088,7 +1080,6 @@ void AM_Start ()
|
|||
if (!stopped) AM_Stop();
|
||||
stopped = false;
|
||||
AM_initVariables();
|
||||
AM_loadPics();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue