mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Fix warnings triggered by isle-portable (#1304)
* Replace computed constant with more readable computed constants * LegoAnim::GetActorUnknown0x04 returns a number, not a pointer * Add macro for creating RGB555 colors * Texture pixel data is passed through as const data * Compare palette index against 0 instead of NULL pointer * warning: deleting 'void*' is undefined [-Wdelete-incomplete] warning Some DirectX sdk's declars D3DRMIMAGE::buffer1 and D3DRMIMAGE::buffer2 as a void pointer. * Don't use floats * Fix wrong op --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:

committed by
GitHub

parent
795d6e144d
commit
c77b5869f5
@@ -13,6 +13,8 @@
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxDisplaySurface, 0xac);
|
||||
|
||||
#define RGB555_CREATE(R, G, B) (((R) << 10) | (G) << 5 | (B) << 0)
|
||||
|
||||
// GLOBAL: LEGO1 0x1010215c
|
||||
MxU32 g_unk0x1010215c = 0;
|
||||
|
||||
@@ -976,8 +978,8 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::VTable0x44(
|
||||
if (p_transparent) {
|
||||
for (MxS32 y = 0; y < heightAbs; y++) {
|
||||
for (MxS32 x = 0; x < widthNormal; x++) {
|
||||
if (*bitmapSrcPtr == NULL) {
|
||||
*surfaceData = 31775;
|
||||
if (*bitmapSrcPtr == 0) {
|
||||
*surfaceData = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||
}
|
||||
else {
|
||||
*surfaceData = m_16bitPal[*bitmapSrcPtr];
|
||||
@@ -992,7 +994,7 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::VTable0x44(
|
||||
}
|
||||
|
||||
DDCOLORKEY key;
|
||||
key.dwColorSpaceLowValue = key.dwColorSpaceHighValue = 31775;
|
||||
key.dwColorSpaceLowValue = key.dwColorSpaceHighValue = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||
surface->SetColorKey(DDCKEY_SRCBLT, &key);
|
||||
}
|
||||
else {
|
||||
@@ -1098,7 +1100,7 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface()
|
||||
for (MxS32 y = 0; y < 16; y++) {
|
||||
if ((y > 10 || x) && (x > 10 || y) && x + y != 10) {
|
||||
if (x + y > 10) {
|
||||
*surface2 = 31775;
|
||||
*surface2 = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||
}
|
||||
else {
|
||||
*surface2 = -1;
|
||||
@@ -1114,8 +1116,8 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface()
|
||||
|
||||
newSurface->Unlock(ddsd.lpSurface);
|
||||
DDCOLORKEY colorkey;
|
||||
colorkey.dwColorSpaceHighValue = 31775;
|
||||
colorkey.dwColorSpaceLowValue = 31775;
|
||||
colorkey.dwColorSpaceHighValue = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||
colorkey.dwColorSpaceLowValue = RGB555_CREATE(0x1f, 0, 0x1f);
|
||||
newSurface->SetColorKey(DDCKEY_SRCBLT, &colorkey);
|
||||
|
||||
return newSurface;
|
||||
|
Reference in New Issue
Block a user