mirror of
https://github.com/ZDoom/acc.git
synced 2025-03-13 03:42:17 +00:00
- Added desaturation translation support to ACC. This is the same as the % syntax introduced
by DECORATE. Note that the values in the color range are fixed point numbers. i.e. You must use 1.0 and not 1. This is in keeping with the existing convention. SVN r3879 (trunk)
This commit is contained in:
parent
14d9aee65c
commit
9af2df3096
3 changed files with 16 additions and 2 deletions
16
parse.c
16
parse.c
|
@ -2473,6 +2473,7 @@ static void LeadingHudMessage(void)
|
||||||
// replacement: palrep | colorrep
|
// replacement: palrep | colorrep
|
||||||
// palrep: exp : exp
|
// palrep: exp : exp
|
||||||
// colorrep: [exp,exp,exp]:[exp,exp,exp]
|
// colorrep: [exp,exp,exp]:[exp,exp,exp]
|
||||||
|
// desatrep: %colorrep
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
static void LeadingCreateTranslation(void)
|
static void LeadingCreateTranslation(void)
|
||||||
|
@ -2484,6 +2485,8 @@ static void LeadingCreateTranslation(void)
|
||||||
PC_AppendCmd(PCD_STARTTRANSLATION);
|
PC_AppendCmd(PCD_STARTTRANSLATION);
|
||||||
while (tk_Token == TK_COMMA)
|
while (tk_Token == TK_COMMA)
|
||||||
{
|
{
|
||||||
|
pcd_t translationcode;
|
||||||
|
|
||||||
TK_NextToken();
|
TK_NextToken();
|
||||||
EvalExpression(); // Get first palette entry in range
|
EvalExpression(); // Get first palette entry in range
|
||||||
TK_TokenMustBe(TK_COLON, ERR_MISSING_COLON);
|
TK_TokenMustBe(TK_COLON, ERR_MISSING_COLON);
|
||||||
|
@ -2492,6 +2495,15 @@ static void LeadingCreateTranslation(void)
|
||||||
TK_TokenMustBe(TK_ASSIGN, ERR_MISSING_ASSIGN);
|
TK_TokenMustBe(TK_ASSIGN, ERR_MISSING_ASSIGN);
|
||||||
|
|
||||||
TK_NextToken();
|
TK_NextToken();
|
||||||
|
if(tk_Token == TK_PERCENT)
|
||||||
|
{
|
||||||
|
translationcode = PCD_TRANSLATIONRANGE3;
|
||||||
|
TK_NextTokenMustBe(TK_LBRACKET, ERR_MISSING_LBRACKET);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
translationcode = PCD_TRANSLATIONRANGE2;
|
||||||
|
}
|
||||||
if(tk_Token == TK_LBRACKET)
|
if(tk_Token == TK_LBRACKET)
|
||||||
{ // Replacement is color range
|
{ // Replacement is color range
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -2520,7 +2532,6 @@ static void LeadingCreateTranslation(void)
|
||||||
TK_NextToken();
|
TK_NextToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PC_AppendCmd(PCD_TRANSLATIONRANGE2);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Replacement is palette range
|
{ // Replacement is palette range
|
||||||
|
@ -2528,8 +2539,9 @@ static void LeadingCreateTranslation(void)
|
||||||
TK_TokenMustBe(TK_COLON, ERR_MISSING_COLON);
|
TK_TokenMustBe(TK_COLON, ERR_MISSING_COLON);
|
||||||
TK_NextToken();
|
TK_NextToken();
|
||||||
EvalExpression();
|
EvalExpression();
|
||||||
PC_AppendCmd(PCD_TRANSLATIONRANGE1);
|
translationcode = PCD_TRANSLATIONRANGE1;
|
||||||
}
|
}
|
||||||
|
PC_AppendCmd(translationcode);
|
||||||
}
|
}
|
||||||
PC_AppendCmd(PCD_ENDTRANSLATION);
|
PC_AppendCmd(PCD_ENDTRANSLATION);
|
||||||
TK_TokenMustBe(TK_RPAREN, ERR_MISSING_RPAREN);
|
TK_TokenMustBe(TK_RPAREN, ERR_MISSING_RPAREN);
|
||||||
|
|
1
pcode.c
1
pcode.c
|
@ -475,6 +475,7 @@ static char *PCDNames[PCODE_COMMAND_COUNT] =
|
||||||
"PCD_PUSHFUNCTION", // from Eternity
|
"PCD_PUSHFUNCTION", // from Eternity
|
||||||
"PCD_CALLSTACK", // from Eternity
|
"PCD_CALLSTACK", // from Eternity
|
||||||
"PCD_SCRIPTWAITNAMED",
|
"PCD_SCRIPTWAITNAMED",
|
||||||
|
"PCD_TRANSLATIONRANGE3",
|
||||||
};
|
};
|
||||||
|
|
||||||
// CODE --------------------------------------------------------------------
|
// CODE --------------------------------------------------------------------
|
||||||
|
|
1
pcode.h
1
pcode.h
|
@ -424,6 +424,7 @@ typedef enum
|
||||||
PCD_PUSHFUNCTION, // from Eternity
|
PCD_PUSHFUNCTION, // from Eternity
|
||||||
PCD_CALLSTACK, // from Eternity
|
PCD_CALLSTACK, // from Eternity
|
||||||
PCD_SCRIPTWAITNAMED,
|
PCD_SCRIPTWAITNAMED,
|
||||||
|
PCD_TRANSLATIONRANGE3,
|
||||||
|
|
||||||
PCODE_COMMAND_COUNT
|
PCODE_COMMAND_COUNT
|
||||||
} pcd_t;
|
} pcd_t;
|
||||||
|
|
Loading…
Reference in a new issue