Patch made by Vecais_Dumais_Laacis. No code modifications made by Renaud Lepage.
This patch finally gets Xbox colors and tex. corruption problems out, and a running product in. 1- Only one texture color mode will be allowed. 2- No palletized textures on Xbox. 3- Manually invert colors. Thanks to Andis, the author.
This commit is contained in:
@@ -1373,7 +1373,7 @@ unsigned RageDisplay_D3D::CreateTexture(
|
|||||||
{
|
{
|
||||||
if(!vmem_Manager.DecommitLRU())
|
if(!vmem_Manager.DecommitLRU())
|
||||||
break;
|
break;
|
||||||
hr = g_pd3dDevice->CreateTexture( img->w, img->h, 1, 0, D3DFORMATS[pixfmt], D3DPOOL_MANAGED, &pTex );
|
hr = g_pd3dDevice->CreateTexture( img->w, img->h, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &pTex );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1383,6 +1383,8 @@ unsigned RageDisplay_D3D::CreateTexture(
|
|||||||
|
|
||||||
unsigned uTexHandle = (unsigned)pTex;
|
unsigned uTexHandle = (unsigned)pTex;
|
||||||
|
|
||||||
|
// No palletized textures for the Xbox console
|
||||||
|
#if !defined(XBOX)
|
||||||
if( pixfmt == PixelFormat_PAL )
|
if( pixfmt == PixelFormat_PAL )
|
||||||
{
|
{
|
||||||
// Save palette
|
// Save palette
|
||||||
@@ -1400,7 +1402,7 @@ unsigned RageDisplay_D3D::CreateTexture(
|
|||||||
ASSERT( g_TexResourceToTexturePalette.find(uTexHandle) == g_TexResourceToTexturePalette.end() );
|
ASSERT( g_TexResourceToTexturePalette.find(uTexHandle) == g_TexResourceToTexturePalette.end() );
|
||||||
g_TexResourceToTexturePalette[uTexHandle] = pal;
|
g_TexResourceToTexturePalette[uTexHandle] = pal;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
UpdateTexture( uTexHandle, img, 0, 0, img->w, img->h );
|
UpdateTexture( uTexHandle, img, 0, 0, img->w, img->h );
|
||||||
|
|
||||||
return uTexHandle;
|
return uTexHandle;
|
||||||
@@ -1432,16 +1434,24 @@ void RageDisplay_D3D::UpdateTexture(
|
|||||||
// Copy bits
|
// Copy bits
|
||||||
//
|
//
|
||||||
#if defined(XBOX)
|
#if defined(XBOX)
|
||||||
|
RageSurface *Texture = CreateSurface( width, height, 32,
|
||||||
|
Swap32BE( 0x0000FF00 ),
|
||||||
|
Swap32BE( 0x00FF0000 ),
|
||||||
|
Swap32BE( 0xFF000000 ),
|
||||||
|
Swap32BE( 0x000000FF ) );
|
||||||
|
|
||||||
|
RageSurfaceUtils::Blit( img, Texture, width, height );
|
||||||
|
|
||||||
// Xbox textures need to be swizzled
|
// Xbox textures need to be swizzled
|
||||||
XGSwizzleRect(
|
XGSwizzleRect(
|
||||||
img->pixels, // pSource,
|
Texture->pixels, // pSource,
|
||||||
img->pitch, // Pitch,
|
Texture->pitch, // Pitch,
|
||||||
NULL, // pRect,
|
NULL, // pRect,
|
||||||
lr.pBits, // pDest,
|
lr.pBits, // pDest,
|
||||||
img->w, // Width,
|
Texture->w, // Width,
|
||||||
img->h, // Height,
|
Texture->h, // Height,
|
||||||
NULL, // pPoint,
|
NULL, // pPoint,
|
||||||
img->format->BytesPerPixel ); //BytesPerPixel
|
Texture->format->BytesPerPixel ); //BytesPerPixel
|
||||||
#else
|
#else
|
||||||
int texpixfmt;
|
int texpixfmt;
|
||||||
for(texpixfmt = 0; texpixfmt < NUM_PixelFormat; ++texpixfmt)
|
for(texpixfmt = 0; texpixfmt < NUM_PixelFormat; ++texpixfmt)
|
||||||
|
|||||||
Reference in New Issue
Block a user