- The DSimpleCanvas constructor now fills MemBuffer with zeros.
- Fixed: If the FBTexture wasn't exactly the same size as the screen, D3DFB::PaintToWindow() would still lock it with D3DLOCK_DISCARD. Alas, I saw no speedup for using a dirty region. (Side note: The Radeons are apparently slower compared to DirectDraw because they must do power-of-2 textures. If they ever add non-power-of-2 support like nvidia, I assume they will also see a speed gain.) - Changed fb_d3d9.cpp so that instead of trying to compensate for Geforce off-by-one errors in the pixel shader, it automatically detects where the error occurs and modifies the way the palette is uploaded to compensate. Palette color 255 is then represented using the texture border color instead of actually being part of the palette. This should work correctly with all cards, since I had a report of an FX where the off-by-one occurred in a different spot from the place where I observed it on a 6 and 7 series cards. Since the shader now has one fewer instruction, I notice a very marginal speedup. (Interestingly, removing the flash blending from the shader had no perceivable performance gain.) SVN r399 (trunk)
This commit is contained in:
parent
37e8533773
commit
2dcc70dd31
5 changed files with 321 additions and 96 deletions
144
src/thingdef.cpp
144
src/thingdef.cpp
|
|
@ -2598,88 +2598,90 @@ static void ActorActionDef (AActor *defaults, Baggage &bag)
|
|||
SC_MustGetToken(TK_Identifier);
|
||||
funcname = sc_Name;
|
||||
SC_MustGetToken('(');
|
||||
while (sc_TokenType != ')')
|
||||
if (!SC_CheckToken(')'))
|
||||
{
|
||||
int flags = 0;
|
||||
char type = '@';
|
||||
|
||||
// Retrieve flags before type name
|
||||
for (;;)
|
||||
while (sc_TokenType != ')')
|
||||
{
|
||||
if (SC_CheckToken(TK_Optional))
|
||||
int flags = 0;
|
||||
char type = '@';
|
||||
|
||||
// Retrieve flags before type name
|
||||
for (;;)
|
||||
{
|
||||
flags |= OPTIONAL;
|
||||
if (SC_CheckToken(TK_Optional))
|
||||
{
|
||||
flags |= OPTIONAL;
|
||||
}
|
||||
else if (SC_CheckToken(TK_Eval))
|
||||
{
|
||||
flags |= EVAL;
|
||||
}
|
||||
else if (SC_CheckToken(TK_EvalNot))
|
||||
{
|
||||
flags |= EVALNOT;
|
||||
}
|
||||
else if (SC_CheckToken(TK_Coerce) || SC_CheckToken(TK_Native))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (SC_CheckToken(TK_Eval))
|
||||
{
|
||||
flags |= EVAL;
|
||||
}
|
||||
else if (SC_CheckToken(TK_EvalNot))
|
||||
{
|
||||
flags |= EVALNOT;
|
||||
}
|
||||
else if (SC_CheckToken(TK_Coerce) || SC_CheckToken(TK_Native))
|
||||
{
|
||||
}
|
||||
else
|
||||
switch (sc_TokenType)
|
||||
{
|
||||
case TK_Bool: type = 'i'; break;
|
||||
case TK_Int: type = 'i'; break;
|
||||
case TK_Float: type = 'f'; break;
|
||||
case TK_Sound: type = 's'; break;
|
||||
case TK_String: type = 't'; break;
|
||||
case TK_Name: type = 't'; break;
|
||||
case TK_State: type = 'l'; break;
|
||||
case TK_Color: type = 'c'; break;
|
||||
case TK_Class:
|
||||
SC_MustGetToken('<');
|
||||
SC_MustGetToken(TK_Identifier);
|
||||
if (sc_Name != NAME_Actor)
|
||||
{
|
||||
SC_ScriptError ("Sorry, you can only use class<actor>");
|
||||
}
|
||||
SC_MustGetToken('>');
|
||||
type = 'm';
|
||||
break;
|
||||
case TK_Ellipsis:
|
||||
type = '+';
|
||||
SC_MustGetToken(')');
|
||||
SC_UnGet();
|
||||
break;
|
||||
default:
|
||||
SC_ScriptError ("Unknown variable type %s", SC_TokenName(sc_TokenType, sc_String).GetChars());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flags != 0)
|
||||
{
|
||||
SC_MustGetAnyToken();
|
||||
}
|
||||
switch (sc_TokenType)
|
||||
{
|
||||
case TK_Int: type = 'i'; break;
|
||||
case TK_Float: type = 'f'; break;
|
||||
case TK_Sound: type = 's'; break;
|
||||
case TK_String: type = 't'; break;
|
||||
case TK_State: type = 'l'; break;
|
||||
case TK_Color: type = 'c'; break;
|
||||
case TK_Class:
|
||||
SC_MustGetToken('<');
|
||||
SC_MustGetToken(TK_Identifier);
|
||||
if (sc_Name != NAME_Actor)
|
||||
if (flags & EVALNOT)
|
||||
{
|
||||
SC_ScriptError ("Sorry, you can only use class<actor>");
|
||||
type = 'y';
|
||||
}
|
||||
else if (flags & EVAL)
|
||||
{
|
||||
type = 'x';
|
||||
}
|
||||
if (!(flags & OPTIONAL))
|
||||
{
|
||||
type -= 'a' - 'A';
|
||||
break;
|
||||
}
|
||||
#undef OPTIONAL
|
||||
#undef EVAL
|
||||
#undef EVALNOT
|
||||
args += type;
|
||||
SC_MustGetAnyToken();
|
||||
if (sc_TokenType != ',' && sc_TokenType != ')')
|
||||
{
|
||||
SC_ScriptError ("Expected ',' or ')' but got %s instead", SC_TokenName(sc_TokenType, sc_String).GetChars());
|
||||
}
|
||||
SC_MustGetToken('>');
|
||||
type = 'm';
|
||||
break;
|
||||
case TK_Ellipsis:
|
||||
type = '+';
|
||||
SC_MustGetToken(')');
|
||||
SC_UnGet();
|
||||
break;
|
||||
default:
|
||||
SC_ScriptError ("Unknown variable type %s", SC_TokenName(sc_TokenType, sc_String).GetChars());
|
||||
break;
|
||||
}
|
||||
if (flags & EVALNOT)
|
||||
{
|
||||
type = 'y';
|
||||
}
|
||||
else if (flags & EVAL)
|
||||
{
|
||||
type = 'x';
|
||||
}
|
||||
if (!(flags & OPTIONAL))
|
||||
{
|
||||
type -= 'a' - 'A';
|
||||
break;
|
||||
}
|
||||
#undef OPTIONAL
|
||||
#undef EVAL
|
||||
#undef EVALNOT
|
||||
args += type;
|
||||
SC_MustGetAnyToken();
|
||||
if (sc_TokenType != ',' && sc_TokenType != ')')
|
||||
{
|
||||
SC_ScriptError ("Expected ',' or ')' but got %s instead", SC_TokenName(sc_TokenType, sc_String).GetChars());
|
||||
}
|
||||
}
|
||||
SC_MustGetToken(';');
|
||||
PSymbolActionFunction *sym = new PSymbolActionFunction;
|
||||
sym->SymbolName = funcname;
|
||||
sym->SymbolType = SYM_ActionFunction;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue