some ptr type conversions fixed

This commit is contained in:
d1str4ught
2025-08-27 12:56:02 +02:00
parent 67cabc3c89
commit 4e6a7f1b08
6 changed files with 16 additions and 16 deletions

View File

@@ -662,14 +662,14 @@ void CDXTCImage::DecompressDXT1(int miplevel, DWORD * pdwDest)
for (y = 0; y < yblocks; ++y)
{
// 8 bytes per block
pBlock = (DXTColBlock *) ((DWORD) pPos + y * xblocks * 8);
pBlock = (DXTColBlock *) ((uintptr_t) pPos + y * xblocks * 8);
for (x = 0; x < xblocks; ++x, ++pBlock)
{
// inline func:
GetColorBlockColors(pBlock, &col_0, &col_1, &col_2, &col_3, wrd);
pImPos = (DWORD *) ((DWORD) pBase + x*16 + (y*4) * nWidth * 4);
pImPos = (DWORD *) ((uintptr_t) pBase + x*16 + (y*4) * nWidth * 4);
DecodeColorBlock(pImPos, pBlock, nWidth, (DWORD *)&col_0, (DWORD *)&col_1, (DWORD *)&col_2, (DWORD *)&col_3);
// Set to RGB test pattern
// pImPos = (DWORD*) ((DWORD) pBase + i * 4 + j * m_nWidth * 4);
@@ -716,7 +716,7 @@ void CDXTCImage::DecompressDXT3(int miplevel, DWORD* pdwDest)
{
// 8 bytes per block
// 1 block for alpha, 1 block for color
pBlock = (DXTColBlock *) ((DWORD) (pPos + y * xblocks * 16));
pBlock = (DXTColBlock *) ((uintptr_t) (pPos + y * xblocks * 16));
for (x = 0; x < xblocks; ++x, ++pBlock)
{
@@ -731,7 +731,7 @@ void CDXTCImage::DecompressDXT3(int miplevel, DWORD* pdwDest)
// Decode the color block into the bitmap bits
// inline func:
pImPos = (DWORD *) ((DWORD) (pBase + x * 16 + (y * 4) * nWidth * 4));
pImPos = (DWORD *) ((uintptr_t) (pBase + x * 16 + (y * 4) * nWidth * 4));
DecodeColorBlock(pImPos,
pBlock,
@@ -780,7 +780,7 @@ void CDXTCImage::DecompressDXT5(int level, DWORD * pdwDest)
{
// 8 bytes per block
// 1 block for alpha, 1 block for color
pBlock = (DXTColBlock*) ((DWORD) (pPos + y * xblocks * 16));
pBlock = (DXTColBlock*) ((uintptr_t) (pPos + y * xblocks * 16));
for (x = 0; x < xblocks; ++x, ++pBlock)
{
@@ -797,7 +797,7 @@ void CDXTCImage::DecompressDXT5(int level, DWORD * pdwDest)
// Decode the color block into the bitmap bits
// inline func:
pImPos = (DWORD *) ((DWORD) (pBase + x * 16 + (y * 4) * nWidth * 4));
pImPos = (DWORD *) ((uintptr_t) (pBase + x * 16 + (y * 4) * nWidth * 4));
//DecodeColorBlock(pImPos, pBlock, nWidth, (DWORD *)&col_0, (DWORD *)&col_1, (DWORD *)&col_2, (DWORD *)&col_3);
DecodeColorBlock(pImPos, pBlock, nWidth, (DWORD *)&col_0, (DWORD *)&col_1, (DWORD *)&col_2, (DWORD *)&col_3);

View File

@@ -82,8 +82,8 @@ PyObject* grpImageGenerateExpanded(PyObject* poSelf, PyObject* poArgs)
PyObject* grpImageGenerateFromHandle(PyObject * poSelf, PyObject* poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BadArgument();
CGraphicImageInstance * pImageInstance = CGraphicImageInstance::New();

View File

@@ -2,8 +2,8 @@
bool PyTuple_GetTextInstance(PyObject* poArgs, int pos, CGraphicTextInstance** ppTextInstance)
{
int handle;
if (!PyTuple_GetInteger(poArgs, pos, &handle))
unsigned long long handle;
if (!PyTuple_GetUnsignedLongLong(poArgs, pos, &handle))
return false;
if (!handle)

View File

@@ -2,8 +2,8 @@
bool PyTuple_GetThingInstance(PyObject* poArgs, int pos, CGraphicThingInstance** ppRetThingInstance)
{
int handle;
if (!PyTuple_GetInteger(poArgs, pos, &handle))
unsigned long long handle;
if (!PyTuple_GetUnsignedLongLong(poArgs, pos, &handle))
return false;
if (!handle)

View File

@@ -287,8 +287,8 @@ PyObject * itemGetIconInstance(PyObject * poSelf, PyObject * poArgs)
PyObject * itemDeleteIconInstance(PyObject * poSelf, PyObject * poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BadArgument();
CGraphicImageInstance::Delete((CGraphicImageInstance *) iHandle);

View File

@@ -2092,8 +2092,8 @@ PyObject * skillGetIconInstanceNew(PyObject * poSelf, PyObject * poArgs)
PyObject * skillDeleteIconInstance(PyObject * poSelf, PyObject * poArgs)
{
int iHandle;
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
unsigned long long iHandle;
if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle))
return Py_BadArgument();
CGraphicImageInstance::Delete((CGraphicImageInstance *) iHandle);