- 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)
This commit is contained in:
parent
6b9f3c8247
commit
1acc3d00c4
35 changed files with 1101 additions and 738 deletions
|
|
@ -86,7 +86,7 @@ struct FSaveGameNode : public Node
|
|||
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
|
||||
|
||||
void M_DrawSlider (int x, int y, float min, float max, float cur);
|
||||
void R_GetPlayerTranslation (int color, FPlayerSkin *skin, BYTE *table);
|
||||
void R_GetPlayerTranslation (int color, FPlayerSkin *skin, FRemapTable *table);
|
||||
|
||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||
|
||||
|
|
@ -1984,7 +1984,7 @@ void M_PlayerSetup (void)
|
|||
PlayerClass = &PlayerClasses[players[consoleplayer].CurrentPlayerClass];
|
||||
}
|
||||
PlayerSkin = players[consoleplayer].userinfo.skin;
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color, &skins[PlayerSkin], translationtables[TRANSLATION_Players] + 256 * MAXPLAYERS);
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color, &skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
PlayerState = GetDefaultByType (PlayerClass->Type)->SeeState;
|
||||
PlayerTics = PlayerState->GetTics();
|
||||
if (FireScreen == NULL)
|
||||
|
|
@ -2019,7 +2019,7 @@ static void M_PlayerSetupTicker (void)
|
|||
|
||||
PlayerSkin = R_FindSkin (skins[PlayerSkin].name, PlayerClass - &PlayerClasses[0]);
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color,
|
||||
&skins[PlayerSkin], translationtables[TRANSLATION_Players] + 256 * MAXPLAYERS);
|
||||
&skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
}
|
||||
|
||||
if (PlayerState->GetTics () != -1 && PlayerState->GetNextState () != NULL)
|
||||
|
|
@ -2133,7 +2133,7 @@ static void M_PlayerSetupDrawer ()
|
|||
(PSetupDef.y + LINEHEIGHT*3 + 57 - 104)*CleanYfac + (SCREENHEIGHT/2),
|
||||
DTA_DestWidth, MulScale16 (tex->GetWidth() * CleanXfac, Scale),
|
||||
DTA_DestHeight, MulScale16 (tex->GetHeight() * CleanYfac, Scale),
|
||||
DTA_Translation, TRANSLATION(TRANSLATION_Players, 0),
|
||||
DTA_Translation, translationtables[TRANSLATION_Players][MAXPLAYERS],
|
||||
TAG_DONE);
|
||||
}
|
||||
}
|
||||
|
|
@ -2410,7 +2410,7 @@ static void M_ChangeSkin (int choice)
|
|||
PlayerSkin = (PlayerSkin < (int)numskins - 1) ? PlayerSkin + 1 : 0;
|
||||
} while (!PlayerClass->CheckSkin (PlayerSkin));
|
||||
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color, &skins[PlayerSkin], translationtables[TRANSLATION_Players] + 256 * MAXPLAYERS);
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color, &skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
|
||||
cvar_set ("skin", skins[PlayerSkin].name);
|
||||
}
|
||||
|
|
@ -2534,7 +2534,7 @@ static void SendNewColor (int red, int green, int blue)
|
|||
sprintf (command, "color \"%02x %02x %02x\"", red, green, blue);
|
||||
C_DoCommand (command);
|
||||
|
||||
R_GetPlayerTranslation (MAKERGB (red, green, blue), &skins[PlayerSkin], translationtables[TRANSLATION_Players] + 256 * MAXPLAYERS);
|
||||
R_GetPlayerTranslation (MAKERGB (red, green, blue), &skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
}
|
||||
|
||||
static void M_SlidePlayerRed (int choice)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue