2006-02-24 04:48:15 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// $Id:$
|
|
|
|
//
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
//
|
|
|
|
// This source is available for distribution and/or modification
|
|
|
|
// only under the terms of the DOOM Source Code License as
|
|
|
|
// published by id Software. All rights reserved.
|
|
|
|
//
|
|
|
|
// The source is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
// DESCRIPTION:
|
|
|
|
// Refresh/render internal state variables (global).
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __R_STATE_H__
|
|
|
|
#define __R_STATE_H__
|
|
|
|
|
|
|
|
// Need data structure definitions.
|
|
|
|
#include "d_player.h"
|
|
|
|
#include "r_data.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// Refresh internal data structures,
|
|
|
|
// for rendering.
|
|
|
|
//
|
|
|
|
|
|
|
|
extern "C" int viewwidth;
|
|
|
|
extern "C" int viewheight;
|
|
|
|
|
|
|
|
// Sprite....
|
|
|
|
extern int firstspritelump;
|
|
|
|
extern int lastspritelump;
|
|
|
|
extern int numspritelumps;
|
|
|
|
|
|
|
|
extern size_t numskins; // [RH]
|
|
|
|
extern FPlayerSkin * skins; // [RH]
|
|
|
|
|
|
|
|
extern BYTE OtherGameSkinRemap[256];
|
- Discovered that Shader Model 1.4 clamps my constants, so I can't use
palettes smaller than 256 entries with the shader I wrote for it. Is there
a list of gotchas like this listed some where? I'd really like to see it.
Well, when compiled with SM2.0, the PalTex shader seems to be every-so-
slightly faster on my GF7950GT than the SM1.4 version, so I guess it's a
minor win for cards that support it.
- Fixed: ST_Endoom() failed to free the bitmap it used.
- Added the DTA_ColorOverlay attribute to blend a color with the texture
being drawn. For software, this (currently) only works with black. For
hardware, it works with any color. The motiviation for this was so I could
rewrite the status bar calls that passed DIM_MAP to DTA_Translation to
draw darker icons into something that didn't require making a whole new
remap table.
- After having an "OMG! How could I have been so stupid?" moment, I have
removed the off-by-one check from D3DFB. I had thought the off-by-one error
was caused by rounding errors by the shader hardware. Not so. Rather, I
wasn't sampling what I thought I was sampling. A texture that uses palette
index 255 passes the value 1.0 to the shader. The shader needs to adjust the
range of its palette indexes, or it will end up trying to read color 256
from the palette texture when it should be reading color 255. Doh!
- The TranslationToTable() function has been added to map from translation
numbers used by actors to the tables those numbers represent. This function
performs validation for the input and returns NULL if the input value
is invalid.
- Major changes to the way translation tables work: No longer are they each a
256-byte array. Instead, the FRemapTable structure is used to represent each
one. It includes a remap array for the software renderer, a palette array
for a hardware renderer, and a native texture pointer for D3DFB. The
translationtables array itself is now an array of TArrays that point to the
real tables. The DTA_Translation attribute must also be passed a pointer
to a FRemapTable, not a byte array as previously.
- Modified DFrameBuffer::DrawRateStuff() so that it can do its thing properly
for D3DFB's 2D mode. Before, any fullscreen graphics (like help images)
covered it up.
SVN r640 (trunk)
2007-12-26 04:42:15 +00:00
|
|
|
extern PalEntry OtherGameSkinPalette[256];
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Lookup tables for map data.
|
|
|
|
//
|
|
|
|
extern TArray<spritedef_t> sprites;
|
|
|
|
extern DWORD NumStdSprites;
|
|
|
|
|
|
|
|
extern int numvertexes;
|
|
|
|
extern vertex_t* vertexes;
|
2010-12-14 00:56:44 +00:00
|
|
|
extern int numvertexdatas;
|
|
|
|
extern vertexdata_t* vertexdatas;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
extern int numsegs;
|
|
|
|
extern seg_t* segs;
|
|
|
|
|
|
|
|
extern int numsectors;
|
|
|
|
extern sector_t* sectors;
|
|
|
|
|
|
|
|
extern int numsubsectors;
|
|
|
|
extern subsector_t* subsectors;
|
|
|
|
|
|
|
|
extern int numnodes;
|
|
|
|
extern node_t* nodes;
|
|
|
|
|
|
|
|
extern int numlines;
|
|
|
|
extern line_t* lines;
|
|
|
|
|
|
|
|
extern int numsides;
|
|
|
|
extern side_t* sides;
|
|
|
|
|
|
|
|
extern int numzones;
|
|
|
|
extern zone_t* zones;
|
|
|
|
|
2010-08-27 15:20:05 +00:00
|
|
|
extern node_t * gamenodes;
|
|
|
|
extern int numgamenodes;
|
|
|
|
|
|
|
|
extern subsector_t * gamesubsectors;
|
|
|
|
extern int numgamesubsectors;
|
|
|
|
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
extern FExtraLight* ExtraLights;
|
|
|
|
extern FLightStack* LightStacks;
|
|
|
|
|
|
|
|
inline FArchive &operator<< (FArchive &arc, sector_t *&sec)
|
|
|
|
{
|
|
|
|
return arc.SerializePointer (sectors, (BYTE **)&sec, sizeof(*sectors));
|
|
|
|
}
|
|
|
|
|
2008-07-01 04:06:56 +00:00
|
|
|
inline FArchive &operator<< (FArchive &arc, const sector_t *&sec)
|
|
|
|
{
|
|
|
|
return arc.SerializePointer (sectors, (BYTE **)&sec, sizeof(*sectors));
|
|
|
|
}
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
inline FArchive &operator<< (FArchive &arc, line_t *&line)
|
|
|
|
{
|
|
|
|
return arc.SerializePointer (lines, (BYTE **)&line, sizeof(*lines));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline FArchive &operator<< (FArchive &arc, vertex_t *&vert)
|
|
|
|
{
|
|
|
|
return arc.SerializePointer (vertexes, (BYTE **)&vert, sizeof(*vertexes));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline FArchive &operator<< (FArchive &arc, side_t *&side)
|
|
|
|
{
|
|
|
|
return arc.SerializePointer (sides, (BYTE **)&side, sizeof(*sides));
|
|
|
|
}
|
|
|
|
|
2008-03-20 21:12:03 +00:00
|
|
|
inline FArchive &operator<< (FArchive &arc, FLinkedSector &link)
|
|
|
|
{
|
|
|
|
arc << link.Sector << link.Type;
|
|
|
|
return arc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
//
|
|
|
|
// POV data.
|
|
|
|
//
|
|
|
|
extern fixed_t viewz;
|
|
|
|
extern angle_t viewangle;
|
|
|
|
|
|
|
|
extern AActor* camera; // [RH] camera instead of viewplayer
|
|
|
|
extern sector_t* viewsector; // [RH] keep track of sector viewing from
|
|
|
|
|
|
|
|
extern angle_t xtoviewangle[MAXWIDTH+1];
|
|
|
|
extern int FieldOfView;
|
|
|
|
|
|
|
|
#endif // __R_STATE_H__
|