Fixed some wrong texture projections with convertMapToValve220

This commit is contained in:
Robert Beckebans 2022-01-21 19:38:58 +01:00
parent 92c5cbf758
commit da947328f0

View file

@ -247,8 +247,32 @@ idImage* idMaterial::GetEditorImage() const
else
{
// look for an explicit one
// RB: changed to TD_DIFFUSE because BFG didn't ship the editor images
// RB: changed to TD_DIFFUSE because BFG didn't ship the editor images and
// the qer_editorImage might be the same as the diffusemap
editorImage = globalImages->ImageFromFile( editorImageName, TF_DEFAULT, TR_REPEAT, TD_DIFFUSE );
// look for the diffusemap alternative like TrenchBroom does
// this is required to have the texture dimensions for the convertMapToValve220 cmd
if( editorImage && editorImage->IsLoaded() && editorImage->IsDefaulted() )
{
// _D3XP :: First check for a diffuse image, then use the first
if( numStages && stages )
{
int i;
for( i = 0; i < numStages; i++ )
{
if( stages[i].lighting == SL_DIFFUSE )
{
editorImage = stages[i].texture.image;
break;
}
}
if( !editorImage )
{
editorImage = stages[0].texture.image;
}
}
}
}
if( !editorImage )