Revert "Merge pull request #243 from OdyX/dev-fix-textures-loading"
Looks like it doesn't work on all platformsdev-ui
parent
75871cc9ca
commit
70af33e45d
|
@ -276,7 +276,7 @@ bool CEngine::Create()
|
||||||
Math::LoadOrthoProjectionMatrix(m_matProjInterface, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f);
|
Math::LoadOrthoProjectionMatrix(m_matProjInterface, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f);
|
||||||
|
|
||||||
TextureCreateParams params;
|
TextureCreateParams params;
|
||||||
params.format = TEX_IMG_AUTO;
|
params.format = TEX_IMG_RGB;
|
||||||
params.minFilter = TEX_MIN_FILTER_NEAREST;
|
params.minFilter = TEX_MIN_FILTER_NEAREST;
|
||||||
params.magFilter = TEX_MAG_FILTER_NEAREST;
|
params.magFilter = TEX_MAG_FILTER_NEAREST;
|
||||||
params.mipmap = false;
|
params.mipmap = false;
|
||||||
|
|
|
@ -606,7 +606,7 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
|
||||||
}
|
}
|
||||||
else if (params.format == TEX_IMG_AUTO)
|
else if (params.format == TEX_IMG_AUTO)
|
||||||
{
|
{
|
||||||
if (data->surface->format->BytesPerPixel == 4)
|
if (data->surface->format->Amask != 0)
|
||||||
{
|
{
|
||||||
if ((data->surface->format->Amask == 0xFF000000) &&
|
if ((data->surface->format->Amask == 0xFF000000) &&
|
||||||
(data->surface->format->Rmask == 0x00FF0000) &&
|
(data->surface->format->Rmask == 0x00FF0000) &&
|
||||||
|
@ -630,7 +630,7 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
|
||||||
convert = true;
|
convert = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (data->surface->format->BytesPerPixel == 3)
|
else
|
||||||
{
|
{
|
||||||
if ((data->surface->format->Rmask == 0xFF0000) &&
|
if ((data->surface->format->Rmask == 0xFF0000) &&
|
||||||
(data->surface->format->Gmask == 0x00FF00) &&
|
(data->surface->format->Gmask == 0x00FF00) &&
|
||||||
|
@ -652,10 +652,6 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
|
||||||
convert = true;
|
convert = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
GetLogger()->Error("Unknown data surface format");
|
|
||||||
assert(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
assert(false);
|
assert(false);
|
||||||
|
|
Loading…
Reference in New Issue