mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 07:11:16 +00:00
Texture pixel data is passed through as const data
This commit is contained in:
parent
1136cfce92
commit
b2e1ca737d
@ -19,7 +19,7 @@ class LegoTextureInfo {
|
|||||||
static BOOL SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo);
|
static BOOL SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo);
|
||||||
static BOOL GetGroupTexture(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:
|
// private:
|
||||||
char* m_name; // 0x00
|
char* m_name; // 0x00
|
||||||
|
|||||||
@ -71,7 +71,7 @@ LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_text
|
|||||||
desc.ddpfPixelFormat.dwRGBBitCount = 8;
|
desc.ddpfPixelFormat.dwRGBBitCount = 8;
|
||||||
|
|
||||||
MxS32 i;
|
MxS32 i;
|
||||||
LegoU8* bits;
|
const LegoU8* bits;
|
||||||
MxU8* surface;
|
MxU8* surface;
|
||||||
|
|
||||||
if (pDirectDraw->CreateSurface(&desc, &textureInfo->m_surface, NULL) != DD_OK) {
|
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
|
// 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) {
|
if (m_surface != NULL && m_texture != NULL) {
|
||||||
DDSURFACEDESC desc;
|
DDSURFACEDESC desc;
|
||||||
@ -195,7 +195,7 @@ LegoResult LegoTextureInfo::FUN_10066010(LegoU8* p_bits)
|
|||||||
|
|
||||||
if (m_surface->Lock(NULL, &desc, 0, NULL) == DD_OK) {
|
if (m_surface->Lock(NULL, &desc, 0, NULL) == DD_OK) {
|
||||||
MxU8* surface = (MxU8*) desc.lpSurface;
|
MxU8* surface = (MxU8*) desc.lpSurface;
|
||||||
LegoU8* bits = p_bits;
|
const LegoU8* bits = p_bits;
|
||||||
|
|
||||||
if (desc.dwWidth == desc.lPitch) {
|
if (desc.dwWidth == desc.lPitch) {
|
||||||
memcpy(desc.lpSurface, p_bits, desc.dwWidth * desc.dwHeight);
|
memcpy(desc.lpSurface, p_bits, desc.dwWidth * desc.dwHeight);
|
||||||
|
|||||||
@ -709,7 +709,7 @@ void WriteDefaultTexture(LegoFile* p_file, const char* p_name)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MxU8* surface = (MxU8*) desc.lpSurface;
|
MxU8* surface = (MxU8*) desc.lpSurface;
|
||||||
LegoU8* bits = image->GetBits();
|
const LegoU8* bits = image->GetBits();
|
||||||
|
|
||||||
for (MxS32 i = 0; i < desc.dwHeight; i++) {
|
for (MxS32 i = 0; i < desc.dwHeight; i++) {
|
||||||
memcpy(surface, bits, desc.dwWidth);
|
memcpy(surface, bits, desc.dwWidth);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user