Merge pull request #931 from BeamNG/terrain_layer_format

Set correct terrain layer texture format.
This commit is contained in:
LuisAntonRebollo 2014-11-30 02:22:39 +01:00
commit 9c66aa0681
4 changed files with 4 additions and 1 deletions

View file

@ -450,6 +450,7 @@ bool GFXD3D9TextureManager::_loadTexture( GFXTextureObject *inTex, void *raw )
break;
case GFXFormatR8G8B8A8:
case GFXFormatR8G8B8X8:
case GFXFormatB8G8R8A8:
bytesPerPix = 4;
break;
}

View file

@ -87,6 +87,7 @@ void GFXD3D9EnumTranslate::init()
GFXD3D9TextureFormat[GFXFormatR8G8B8] = D3DFMT_R8G8B8;
GFXD3D9TextureFormat[GFXFormatR8G8B8A8] = D3DFMT_A8R8G8B8;
GFXD3D9TextureFormat[GFXFormatR8G8B8X8] = D3DFMT_X8R8G8B8;
GFXD3D9TextureFormat[GFXFormatB8G8R8A8] = D3DFMT_A8R8G8B8;
GFXD3D9TextureFormat[GFXFormatR5G6B5] = D3DFMT_R5G6B5;
GFXD3D9TextureFormat[GFXFormatR5G5B5A1] = D3DFMT_A1R5G5B5;
GFXD3D9TextureFormat[GFXFormatR5G5B5X1] = D3DFMT_X1R5G5B5;

View file

@ -181,6 +181,7 @@ enum GFXFormat
// 32 bit texture formats...
GFXFormatR8G8B8A8,// first in group...
GFXFormatR8G8B8X8,
GFXFormatB8G8R8A8,
GFXFormatR32F,
GFXFormatR16G16,
GFXFormatR16G16F,

View file

@ -113,7 +113,7 @@ void TerrainBlock::_updateLayerTexture()
if ( mLayerTex.isNull() ||
mLayerTex.getWidth() != layerSize ||
mLayerTex.getHeight() != layerSize )
mLayerTex.set( layerSize, layerSize, GFXFormatR8G8B8A8, &TerrainLayerTexProfile, "" );
mLayerTex.set( layerSize, layerSize, GFXFormatB8G8R8A8, &TerrainLayerTexProfile, "" );
AssertFatal( mLayerTex.getWidth() == layerSize &&
mLayerTex.getHeight() == layerSize,