- Fixed: R_CreatePlayerTranslation() only initialized the first truecolor

palette entry.


SVN r1795 (trunk)
This commit is contained in:
Randy Heit 2009-09-05 03:55:29 +00:00
parent 7da43069d7
commit f27b7209e8
4 changed files with 63 additions and 57 deletions

View file

@ -2,6 +2,10 @@ September 5, 2009 (Changes by Graf Zahl)
- made menu dimming a mapping option but kept the CVARS as user override. - made menu dimming a mapping option but kept the CVARS as user override.
September 4, 2009 September 4, 2009
- Fixed: R_CreatePlayerTranslation() only initialized the first truecolor
palette entry.
- Fixed: D3DPal::Update() used BorderColor == 0 as the condition for skipping
an entry. It should be SM14 as in UploadPalette().
- Fixed: The aliasing of CPUInfo was still wrong. (Yarr! The things I do - Fixed: The aliasing of CPUInfo was still wrong. (Yarr! The things I do
for you, GCC!) The AMD feature flags weren't stored anywhere, either; not for you, GCC!) The AMD feature flags weren't stored anywhere, either; not
that it really matters. that it really matters.

View file

@ -816,18 +816,18 @@ static void R_CreatePlayerTranslation (float h, float s, float v, FPlayerSkin *s
// the current one. // the current one.
if (skin->othergame) if (skin->othergame)
{ {
memcpy (table->Remap, OtherGameSkinRemap, 256); memcpy (table->Remap, OtherGameSkinRemap, table->NumEntries);
memcpy (table->Palette, OtherGameSkinPalette, sizeof(table->Palette)); memcpy (table->Palette, OtherGameSkinPalette, sizeof(*table->Palette) * table->NumEntries);
} }
else else
{ {
for (i = 0; i < 256; ++i) for (i = 0; i < table->NumEntries; ++i)
{ {
table->Remap[i] = i; table->Remap[i] = i;
} }
memcpy(table->Palette, GPalette.BaseColors, sizeof(table->Palette)); memcpy(table->Palette, GPalette.BaseColors, sizeof(*table->Palette) * table->NumEntries);
} }
for (i = 1; i < 256; ++i) for (i = 1; i < table->NumEntries; ++i)
{ {
table->Palette[i].a = 255; table->Palette[i].a = 255;
} }

View file

@ -150,6 +150,7 @@ public:
IDirect3DTexture9 *Tex; IDirect3DTexture9 *Tex;
D3DCOLOR BorderColor; D3DCOLOR BorderColor;
bool DoColorSkip;
bool Update(); bool Update();
@ -2033,7 +2034,7 @@ D3DPal::D3DPal(FRemapTable *remap, D3DFB *fb)
count = 256; count = 256;
// If the palette isn't big enough, then we don't need to // If the palette isn't big enough, then we don't need to
// worry about setting the gamma ramp. // worry about setting the gamma ramp.
BorderColor = (remap->NumEntries >= 256 - 8) ? ~0 : 0; DoColorSkip = (remap->NumEntries >= 256 - 8);
} }
else else
{ {
@ -2043,8 +2044,9 @@ D3DPal::D3DPal(FRemapTable *remap, D3DFB *fb)
for (pow2count = 1; pow2count < remap->NumEntries; pow2count <<= 1) for (pow2count = 1; pow2count < remap->NumEntries; pow2count <<= 1)
{ } { }
count = pow2count; count = pow2count;
BorderColor = 0; DoColorSkip = false;
} }
BorderColor = 0;
RoundedPaletteSize = count; RoundedPaletteSize = count;
if (SUCCEEDED(fb->D3DDevice->CreateTexture(count, 1, 1, 0, if (SUCCEEDED(fb->D3DDevice->CreateTexture(count, 1, 1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &Tex, NULL))) D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &Tex, NULL)))
@ -2104,7 +2106,7 @@ bool D3DPal::Update()
pal = Remap->Palette; pal = Remap->Palette;
// See explanation in UploadPalette() for skipat rationale. // See explanation in UploadPalette() for skipat rationale.
skipat = MIN(Remap->NumEntries, BorderColor != 0 ? 256 - 8 : 256); skipat = MIN(Remap->NumEntries, DoColorSkip ? 256 - 8 : 256);
for (i = 0; i < skipat; ++i) for (i = 0; i < skipat; ++i)
{ {

View file

@ -8,12 +8,12 @@ struct CPUInfo // 92 bytes
union union
{ {
char VendorID[16]; char VendorID[16];
DWORD dwVendorID[4]; uint32 dwVendorID[4];
}; };
union union
{ {
char CPUString[48]; char CPUString[48];
DWORD dwCPUString[12]; uint32 dwCPUString[12];
}; };
BYTE Stepping; BYTE Stepping;
@ -30,55 +30,55 @@ struct CPUInfo // 92 bytes
BYTE CPUCount; BYTE CPUCount;
BYTE APICID; BYTE APICID;
DWORD bSSE3:1; uint32 bSSE3:1;
DWORD DontCare1:8; uint32 DontCare1:8;
DWORD bSSSE3:1; uint32 bSSSE3:1;
DWORD DontCare1a:9; uint32 DontCare1a:9;
DWORD bSSE41:1; uint32 bSSE41:1;
DWORD bSSE42:1; uint32 bSSE42:1;
DWORD DontCare2a:11; uint32 DontCare2a:11;
DWORD bFPU:1; uint32 bFPU:1;
DWORD bVME:1; uint32 bVME:1;
DWORD bDE:1; uint32 bDE:1;
DWORD bPSE:1; uint32 bPSE:1;
DWORD bRDTSC:1; uint32 bRDTSC:1;
DWORD bMSR:1; uint32 bMSR:1;
DWORD bPAE:1; uint32 bPAE:1;
DWORD bMCE:1; uint32 bMCE:1;
DWORD bCX8:1; uint32 bCX8:1;
DWORD bAPIC:1; uint32 bAPIC:1;
DWORD bReserved1:1; uint32 bReserved1:1;
DWORD bSEP:1; uint32 bSEP:1;
DWORD bMTRR:1; uint32 bMTRR:1;
DWORD bPGE:1; uint32 bPGE:1;
DWORD bMCA:1; uint32 bMCA:1;
DWORD bCMOV:1; uint32 bCMOV:1;
DWORD bPAT:1; uint32 bPAT:1;
DWORD bPSE36:1; uint32 bPSE36:1;
DWORD bPSN:1; uint32 bPSN:1;
DWORD bCFLUSH:1; uint32 bCFLUSH:1;
DWORD bReserved2:1; uint32 bReserved2:1;
DWORD bDS:1; uint32 bDS:1;
DWORD bACPI:1; uint32 bACPI:1;
DWORD bMMX:1; uint32 bMMX:1;
DWORD bFXSR:1; uint32 bFXSR:1;
DWORD bSSE:1; uint32 bSSE:1;
DWORD bSSE2:1; uint32 bSSE2:1;
DWORD bSS:1; uint32 bSS:1;
DWORD bHTT:1; uint32 bHTT:1;
DWORD bTM:1; uint32 bTM:1;
DWORD bReserved3:1; uint32 bReserved3:1;
DWORD bPBE:1; uint32 bPBE:1;
DWORD DontCare2:22; uint32 DontCare2:22;
DWORD bMMXPlus:1; // AMD's MMX extensions uint32 bMMXPlus:1; // AMD's MMX extensions
DWORD bMMXAgain:1; // Just a copy of bMMX above uint32 bMMXAgain:1; // Just a copy of bMMX above
DWORD DontCare3:6; uint32 DontCare3:6;
DWORD b3DNowPlus:1; uint32 b3DNowPlus:1;
DWORD b3DNow:1; uint32 b3DNow:1;
}; };
DWORD FeatureFlags[4]; uint32 FeatureFlags[4];
}; };
BYTE AMDStepping; BYTE AMDStepping;
@ -95,7 +95,7 @@ struct CPUInfo // 92 bytes
BYTE DataL1Associativity; BYTE DataL1Associativity;
BYTE DataL1SizeKB; BYTE DataL1SizeKB;
}; };
DWORD AMD_DataL1Info; uint32 AMD_DataL1Info;
}; };
}; };