From b2e1ca737dad9f4dfb7f04ad93cedf975811f705 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 29 Dec 2024 21:18:18 +0100 Subject: [PATCH] Texture pixel data is passed through as const data --- LEGO1/lego/legoomni/include/legotextureinfo.h | 2 +- LEGO1/lego/legoomni/src/common/legotextureinfo.cpp | 6 +++--- LEGO1/lego/legoomni/src/common/legoutils.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legotextureinfo.h b/LEGO1/lego/legoomni/include/legotextureinfo.h index e7cd894b..c070bfec 100644 --- a/LEGO1/lego/legoomni/include/legotextureinfo.h +++ b/LEGO1/lego/legoomni/include/legotextureinfo.h @@ -19,7 +19,7 @@ class LegoTextureInfo { static BOOL SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo); static BOOL GetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo*& p_textureInfo); - LegoResult FUN_10066010(LegoU8* p_bits); + LegoResult FUN_10066010(const LegoU8* p_bits); // private: char* m_name; // 0x00 diff --git a/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp b/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp index ea00ad5f..51678ed8 100644 --- a/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp +++ b/LEGO1/lego/legoomni/src/common/legotextureinfo.cpp @@ -71,7 +71,7 @@ LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_text desc.ddpfPixelFormat.dwRGBBitCount = 8; MxS32 i; - LegoU8* bits; + const LegoU8* bits; MxU8* surface; if (pDirectDraw->CreateSurface(&desc, &textureInfo->m_surface, NULL) != DD_OK) { @@ -186,7 +186,7 @@ BOOL LegoTextureInfo::GetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo*& p_text } // FUNCTION: LEGO1 0x10066010 -LegoResult LegoTextureInfo::FUN_10066010(LegoU8* p_bits) +LegoResult LegoTextureInfo::FUN_10066010(const LegoU8* p_bits) { if (m_surface != NULL && m_texture != NULL) { DDSURFACEDESC desc; @@ -195,7 +195,7 @@ LegoResult LegoTextureInfo::FUN_10066010(LegoU8* p_bits) if (m_surface->Lock(NULL, &desc, 0, NULL) == DD_OK) { MxU8* surface = (MxU8*) desc.lpSurface; - LegoU8* bits = p_bits; + const LegoU8* bits = p_bits; if (desc.dwWidth == desc.lPitch) { memcpy(desc.lpSurface, p_bits, desc.dwWidth * desc.dwHeight); diff --git a/LEGO1/lego/legoomni/src/common/legoutils.cpp b/LEGO1/lego/legoomni/src/common/legoutils.cpp index 48d021b0..e1a61a38 100644 --- a/LEGO1/lego/legoomni/src/common/legoutils.cpp +++ b/LEGO1/lego/legoomni/src/common/legoutils.cpp @@ -709,7 +709,7 @@ void WriteDefaultTexture(LegoFile* p_file, const char* p_name) } else { MxU8* surface = (MxU8*) desc.lpSurface; - LegoU8* bits = image->GetBits(); + const LegoU8* bits = image->GetBits(); for (MxS32 i = 0; i < desc.dwHeight; i++) { memcpy(surface, bits, desc.dwWidth);