- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be loaded without listing them after -file. - Fonts that are created by the ACS setfont command to wrap a texture now support animated textures. - FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn with the hardware 2D path instead of being restricted to the game palette. - Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1 on a Radeon 9000. - Added back the off-by-one palette handling, but in a much more limited scope than before. The skipped entry is assumed to always be at 248, and it is assumed that all Shader Model 1.4 cards suffer from this. That's because all SM1.4 cards are based on variants of the ATI R200 core, and the RV250 in a Radeon 9000 craps up like this. I see no reason to assume that other flavors of the R200 are any different. (Interesting note: With the Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the debug Direct3D 9 runtime, but it works perfectly fine with the retail Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its math inside pixel shaders. That would explain perfectly why I can't use constants greater than 1 with PS1.4 and why it can't do an exact mapping to every entry in the color palette. - Fixed: The software shaded drawer did not work for 2D, because its selected "color"map was replaced with the identitymap before being used. - Fixed: I cannot use Printf to output messages before the framebuffer was completely setup, meaning that Shader Model 1.4 cards could not change resolution. - I have decided to let remap palettes specify variable alpha values for their colors. D3DFB no longer forces them to 255. - Updated re2c to version 0.12.3. - Fixed: A_Wander used threshold as a timer, when it should have used reactiontime. - Fixed: A_CustomRailgun would not fire at all for actors without a target when the aim parameter was disabled. - Made the warp command work in multiplayer, again courtesy of Karate Chris. - Fixed: Trying to spawn a bot while not in a game made for a crashing time. (Patch courtesy of Karate Chris.) - Removed some floating point math from hu_scores.cpp that somebody's GCC gave warnings for (not mine, though). - Fixed: The SBarInfo drawbar command crashed if the sprite image was unavailable. - Fixed: FString::operator=(const char *) did not release its old buffer when being assigned to the null string. - The scanner no longer has an upper limit on the length of strings it accepts, though short strings will be faster than long ones. - Moved all the text scanning functions into a class. Mainly, this means that multiple script scanner states can be stored without being forced to do so recursively. I think I might be taking advantage of that in the near future. Possibly. Maybe. - Removed some potential buffer overflows from the decal parser. - Applied Blzut3's SBARINFO update #9: * Fixed: When using even length values in drawnumber it would cap to a 98 value instead of a 99 as intended. * The SBarInfo parser can now accept negatives for coordinates. This doesn't allow much right now, but later I plan to add better fullscreen hud support in which the negatives will be more useful. This also cleans up the source a bit since all calls for (x, y) coordinates are with the function getCoordinates(). - Added support for stencilling actors. - Added support for non-black colors specified with DTA_ColorOverlay to the software renderer. - Fixed: The inverse, gold, red, and green fixed colormaps each allocated space for 32 different colormaps, even though each only used the first one. - Added two new blending flags to make reverse subtract blending more useful: STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that gets blended with the background, since that seems like a good idea for reverse subtraction. They also work with the other two blending operations. - Added subtract and reverse subtract blending operations to the renderer. Since the ERenderStyle enumeration was getting rather unwieldy, I converted it into a new FRenderStyle structure that lets each parameter of the blending equation be set separately. This simplified the set up for the blend quite a bit, and it means a number of new combinations are available by setting the parameters properly. SVN r710 (trunk)
This commit is contained in:
parent
67afc9d4fc
commit
e5572a1c4e
111 changed files with 10435 additions and 7770 deletions
101
src/p_switch.cpp
101
src/p_switch.cpp
|
|
@ -107,7 +107,7 @@ struct FSwitchDef
|
|||
};
|
||||
|
||||
static int STACK_ARGS SortSwitchDefs (const void *a, const void *b);
|
||||
static FSwitchDef *ParseSwitchDef (bool ignoreBad);
|
||||
static FSwitchDef *ParseSwitchDef (FScanner &sc, bool ignoreBad);
|
||||
static WORD AddSwitchDef (FSwitchDef *def);
|
||||
|
||||
//
|
||||
|
|
@ -211,84 +211,83 @@ static int STACK_ARGS SortSwitchDefs (const void *a, const void *b)
|
|||
}
|
||||
|
||||
// Parse a switch block in ANIMDEFS and add the definitions to SwitchList
|
||||
void P_ProcessSwitchDef ()
|
||||
void P_ProcessSwitchDef (FScanner &sc)
|
||||
{
|
||||
const BITFIELD texflags = FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny;
|
||||
char *picname;
|
||||
FString picname;
|
||||
FSwitchDef *def1, *def2;
|
||||
SWORD picnum;
|
||||
BYTE max;
|
||||
bool quest = false;
|
||||
|
||||
def1 = def2 = NULL;
|
||||
SC_MustGetString ();
|
||||
if (SC_Compare ("doom"))
|
||||
sc.MustGetString ();
|
||||
if (sc.Compare ("doom"))
|
||||
{
|
||||
max = 0;
|
||||
}
|
||||
else if (SC_Compare ("heretic"))
|
||||
else if (sc.Compare ("heretic"))
|
||||
{
|
||||
max = 17;
|
||||
}
|
||||
else if (SC_Compare ("hexen"))
|
||||
else if (sc.Compare ("hexen"))
|
||||
{
|
||||
max = 33;
|
||||
}
|
||||
else if (SC_Compare ("strife"))
|
||||
else if (sc.Compare ("strife"))
|
||||
{
|
||||
max = 49;
|
||||
}
|
||||
else if (SC_Compare ("any"))
|
||||
else if (sc.Compare ("any"))
|
||||
{
|
||||
max = 240;
|
||||
}
|
||||
else
|
||||
{
|
||||
//SC_ScriptError ("Unknown game");
|
||||
// There is no game specified; just treat as any
|
||||
max = 240;
|
||||
SC_UnGet ();
|
||||
sc.UnGet ();
|
||||
}
|
||||
if (max == 0)
|
||||
{
|
||||
SC_MustGetNumber ();
|
||||
max |= sc_Number & 15;
|
||||
sc.MustGetNumber ();
|
||||
max |= sc.Number & 15;
|
||||
}
|
||||
SC_MustGetString ();
|
||||
picnum = TexMan.CheckForTexture (sc_String, FTexture::TEX_Wall, texflags);
|
||||
picname = copystring (sc_String);
|
||||
while (SC_GetString ())
|
||||
sc.MustGetString ();
|
||||
picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Wall, texflags);
|
||||
picname = sc.String;
|
||||
while (sc.GetString ())
|
||||
{
|
||||
if (SC_Compare ("quest"))
|
||||
if (sc.Compare ("quest"))
|
||||
{
|
||||
quest = true;
|
||||
}
|
||||
else if (SC_Compare ("on"))
|
||||
else if (sc.Compare ("on"))
|
||||
{
|
||||
if (def1 != NULL)
|
||||
{
|
||||
SC_ScriptError ("Switch already has an on state");
|
||||
sc.ScriptError ("Switch already has an on state");
|
||||
}
|
||||
def1 = ParseSwitchDef (picnum == -1);
|
||||
def1 = ParseSwitchDef (sc, picnum == -1);
|
||||
}
|
||||
else if (SC_Compare ("off"))
|
||||
else if (sc.Compare ("off"))
|
||||
{
|
||||
if (def2 != NULL)
|
||||
{
|
||||
SC_ScriptError ("Switch already has an off state");
|
||||
sc.ScriptError ("Switch already has an off state");
|
||||
}
|
||||
def2 = ParseSwitchDef (picnum == -1);
|
||||
def2 = ParseSwitchDef (sc, picnum == -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
SC_UnGet ();
|
||||
sc.UnGet ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (def1 == NULL)
|
||||
{
|
||||
SC_ScriptError ("Switch must have an on state");
|
||||
sc.ScriptError ("Switch must have an on state");
|
||||
}
|
||||
*/
|
||||
if (def1 == NULL || picnum == -1 ||
|
||||
|
|
@ -304,7 +303,6 @@ void P_ProcessSwitchDef ()
|
|||
{
|
||||
free (def1);
|
||||
}
|
||||
delete [] picname;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -323,15 +321,14 @@ void P_ProcessSwitchDef ()
|
|||
def2->PreTexture = def1->u.Textures[def1->NumFrames*2+def1->NumFrames-1];
|
||||
if (def1->PreTexture == def2->PreTexture)
|
||||
{
|
||||
SC_ScriptError ("The on state for switch %s must end with a texture other than %s", picname, picname);
|
||||
sc.ScriptError ("The on state for switch %s must end with a texture other than %s", picname.GetChars(), picname.GetChars());
|
||||
}
|
||||
def2->PairIndex = AddSwitchDef (def1);
|
||||
def1->PairIndex = AddSwitchDef (def2);
|
||||
def1->QuestPanel = def2->QuestPanel = quest;
|
||||
delete [] picname;
|
||||
}
|
||||
|
||||
FSwitchDef *ParseSwitchDef (bool ignoreBad)
|
||||
FSwitchDef *ParseSwitchDef (FScanner &sc, bool ignoreBad)
|
||||
{
|
||||
const BITFIELD texflags = FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny;
|
||||
FSwitchDef *def;
|
||||
|
|
@ -346,45 +343,45 @@ FSwitchDef *ParseSwitchDef (bool ignoreBad)
|
|||
sound = 0;
|
||||
bad = false;
|
||||
|
||||
while (SC_GetString ())
|
||||
while (sc.GetString ())
|
||||
{
|
||||
if (SC_Compare ("sound"))
|
||||
if (sc.Compare ("sound"))
|
||||
{
|
||||
if (sound != 0)
|
||||
{
|
||||
SC_ScriptError ("Switch state already has a sound");
|
||||
sc.ScriptError ("Switch state already has a sound");
|
||||
}
|
||||
SC_MustGetString ();
|
||||
sound = S_FindSound (sc_String);
|
||||
sc.MustGetString ();
|
||||
sound = S_FindSound (sc.String);
|
||||
}
|
||||
else if (SC_Compare ("pic"))
|
||||
else if (sc.Compare ("pic"))
|
||||
{
|
||||
if (numframes == MAX_FRAMES)
|
||||
{
|
||||
SC_ScriptError ("Switch has too many frames");
|
||||
sc.ScriptError ("Switch has too many frames");
|
||||
}
|
||||
SC_MustGetString ();
|
||||
picnum = TexMan.CheckForTexture (sc_String, FTexture::TEX_Wall, texflags);
|
||||
sc.MustGetString ();
|
||||
picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Wall, texflags);
|
||||
if (picnum < 0 && !ignoreBad)
|
||||
{
|
||||
//Printf ("Unknown switch texture %s\n", sc_String);
|
||||
//Printf ("Unknown switch texture %s\n", sc.String);
|
||||
bad = true;
|
||||
}
|
||||
pics[numframes] = picnum;
|
||||
SC_MustGetString ();
|
||||
if (SC_Compare ("tics"))
|
||||
sc.MustGetString ();
|
||||
if (sc.Compare ("tics"))
|
||||
{
|
||||
SC_MustGetNumber ();
|
||||
times[numframes] = sc_Number & 65535;
|
||||
sc.MustGetNumber ();
|
||||
times[numframes] = sc.Number & 65535;
|
||||
}
|
||||
else if (SC_Compare ("rand"))
|
||||
else if (sc.Compare ("rand"))
|
||||
{
|
||||
int min, max;
|
||||
|
||||
SC_MustGetNumber ();
|
||||
min = sc_Number & 65535;
|
||||
SC_MustGetNumber ();
|
||||
max = sc_Number & 65535;
|
||||
sc.MustGetNumber ();
|
||||
min = sc.Number & 65535;
|
||||
sc.MustGetNumber ();
|
||||
max = sc.Number & 65535;
|
||||
if (min > max)
|
||||
{
|
||||
swap (min, max);
|
||||
|
|
@ -393,19 +390,19 @@ FSwitchDef *ParseSwitchDef (bool ignoreBad)
|
|||
}
|
||||
else
|
||||
{
|
||||
SC_ScriptError ("Must specify a duration for switch frame");
|
||||
sc.ScriptError ("Must specify a duration for switch frame");
|
||||
}
|
||||
numframes++;
|
||||
}
|
||||
else
|
||||
{
|
||||
SC_UnGet ();
|
||||
sc.UnGet ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (numframes == 0)
|
||||
{
|
||||
SC_ScriptError ("Switch state needs at least one frame");
|
||||
sc.ScriptError ("Switch state needs at least one frame");
|
||||
}
|
||||
if (bad)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue