mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-31 20:21:15 +00:00
Fix
This commit is contained in:
parent
b4c4888b47
commit
fd14350173
@ -16,7 +16,7 @@ LegoTextureContainer::~LegoTextureContainer()
|
|||||||
// FUNCTION: LEGO1 0x100998e0
|
// FUNCTION: LEGO1 0x100998e0
|
||||||
LegoTextureInfo* LegoTextureContainer::Insert(LegoTextureInfo* p_textureInfo)
|
LegoTextureInfo* LegoTextureContainer::Insert(LegoTextureInfo* p_textureInfo)
|
||||||
{
|
{
|
||||||
DDSURFACEDESC desc;
|
DDSURFACEDESC desc, newDesc;
|
||||||
DWORD width, height;
|
DWORD width, height;
|
||||||
memset(&desc, 0, sizeof(desc));
|
memset(&desc, 0, sizeof(desc));
|
||||||
desc.dwSize = sizeof(desc);
|
desc.dwSize = sizeof(desc);
|
||||||
@ -38,17 +38,16 @@ LegoTextureInfo* LegoTextureContainer::Insert(LegoTextureInfo* p_textureInfo)
|
|||||||
|
|
||||||
if (textureInfo->m_texture->AddRef() != 0 && textureInfo->m_texture->Release() == 1) {
|
if (textureInfo->m_texture->AddRef() != 0 && textureInfo->m_texture->Release() == 1) {
|
||||||
if (!strcmp(textureInfo->m_name, p_textureInfo->m_name)) {
|
if (!strcmp(textureInfo->m_name, p_textureInfo->m_name)) {
|
||||||
DDSURFACEDESC desc;
|
memset(&newDesc, 0, sizeof(newDesc));
|
||||||
memset(&desc, 0, sizeof(desc));
|
newDesc.dwSize = sizeof(newDesc);
|
||||||
desc.dwSize = sizeof(desc);
|
|
||||||
|
|
||||||
if (textureInfo->m_surface->Lock(NULL, &desc, DDLOCK_SURFACEMEMORYPTR, NULL) == DD_OK) {
|
if (textureInfo->m_surface->Lock(NULL, &newDesc, DDLOCK_SURFACEMEMORYPTR, NULL) == DD_OK) {
|
||||||
BOOL und = FALSE;
|
BOOL und = FALSE;
|
||||||
if (desc.dwWidth == width && desc.dwHeight == height) {
|
if (newDesc.dwWidth == width && newDesc.dwHeight == height) {
|
||||||
und = TRUE;
|
und = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
textureInfo->m_surface->Unlock(desc.lpSurface);
|
textureInfo->m_surface->Unlock(newDesc.lpSurface);
|
||||||
|
|
||||||
if (und) {
|
if (und) {
|
||||||
(*it).second = TRUE;
|
(*it).second = TRUE;
|
||||||
@ -66,7 +65,6 @@ LegoTextureInfo* LegoTextureContainer::Insert(LegoTextureInfo* p_textureInfo)
|
|||||||
textureInfo->m_palette = p_textureInfo->m_palette;
|
textureInfo->m_palette = p_textureInfo->m_palette;
|
||||||
p_textureInfo->m_palette->Release();
|
p_textureInfo->m_palette->Release();
|
||||||
|
|
||||||
DDSURFACEDESC newDesc;
|
|
||||||
memset(&newDesc, 0, sizeof(newDesc));
|
memset(&newDesc, 0, sizeof(newDesc));
|
||||||
newDesc.dwWidth = desc.dwWidth;
|
newDesc.dwWidth = desc.dwWidth;
|
||||||
newDesc.dwHeight = desc.dwHeight;
|
newDesc.dwHeight = desc.dwHeight;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user