mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-09-23 12:03:56 -04:00
Minor palette corrections (#122)
This commit is contained in:
parent
cd047211cf
commit
a19827e10f
@ -17,7 +17,7 @@
|
||||
#define FAR
|
||||
#define WINAPI
|
||||
#define HWND_NOTOPMOST -2
|
||||
#define RGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16))
|
||||
#define RGB(r, g, b) (((BYTE) (r) | ((BYTE) (g) << 8) | ((BYTE) (b) << 16)))
|
||||
#define S_OK ((HRESULT) 0)
|
||||
#define E_NOINTERFACE (0x80004002)
|
||||
#define VOID void
|
||||
@ -49,8 +49,8 @@
|
||||
#define ETO_OPAQUE 0x0002
|
||||
#define FF_DONTCARE 0x00000000
|
||||
#define RASTERCAPS 0x00000000
|
||||
#define RC_PALETTE 0x00000000
|
||||
#define SIZEPALETTE 256
|
||||
#define RC_PALETTE 0x0100
|
||||
#define SIZEPALETTE 104
|
||||
#define FW_NORMAL 400
|
||||
#define OPAQUE 2
|
||||
#define OUT_DEFAULT_PRECIS 0
|
||||
@ -163,6 +163,13 @@ inline int WINAPI ReleaseDC(HWND hWnd, HDC hDC)
|
||||
|
||||
inline int WINAPI GetDeviceCaps(HDC hdc, int index)
|
||||
{
|
||||
|
||||
if (index == RASTERCAPS) {
|
||||
return 0;
|
||||
}
|
||||
if (index == SIZEPALETTE) {
|
||||
return 256;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,14 @@ HRESULT DirectDrawEnumerate(LPDDENUMCALLBACKA cb, void* context);
|
||||
|
||||
inline UINT WINAPI GetSystemPaletteEntries(HDC hdc, UINT iStart, UINT cEntries, LPPALETTEENTRY pPalEntries)
|
||||
{
|
||||
return 0;
|
||||
for (UINT i = 0; i < cEntries; i++) {
|
||||
UINT val = iStart + i;
|
||||
pPalEntries[i].peRed = val;
|
||||
pPalEntries[i].peGreen = val;
|
||||
pPalEntries[i].peBlue = val;
|
||||
pPalEntries[i].peFlags = PC_NONE;
|
||||
}
|
||||
return cEntries;
|
||||
}
|
||||
|
||||
inline HPALETTE CreatePalette(LPLOGPALETTE lpLogPalette)
|
||||
|
@ -16,10 +16,10 @@ DirectDrawPaletteImpl::~DirectDrawPaletteImpl()
|
||||
|
||||
HRESULT DirectDrawPaletteImpl::GetEntries(DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries)
|
||||
{
|
||||
for (int i = dwBase; i < dwNumEntries; i++) {
|
||||
lpEntries[i].peRed = m_palette->colors[i].r;
|
||||
lpEntries[i].peGreen = m_palette->colors[i].g;
|
||||
lpEntries[i].peBlue = m_palette->colors[i].b;
|
||||
for (DWORD i = 0; i < dwNumEntries; i++) {
|
||||
lpEntries[i].peRed = m_palette->colors[dwBase + i].r;
|
||||
lpEntries[i].peGreen = m_palette->colors[dwBase + i].g;
|
||||
lpEntries[i].peBlue = m_palette->colors[dwBase + i].b;
|
||||
lpEntries[i].peFlags = PC_NONE;
|
||||
}
|
||||
return DD_OK;
|
||||
@ -28,10 +28,10 @@ HRESULT DirectDrawPaletteImpl::GetEntries(DWORD dwFlags, DWORD dwBase, DWORD dwN
|
||||
HRESULT DirectDrawPaletteImpl::SetEntries(DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries)
|
||||
{
|
||||
SDL_Color colors[256];
|
||||
for (int i = 0; i < dwCount; i++) {
|
||||
colors[i].r = lpEntries[i].peRed;
|
||||
colors[i].g = lpEntries[i].peGreen;
|
||||
colors[i].b = lpEntries[i].peBlue;
|
||||
for (DWORD i = 0; i < dwCount; i++) {
|
||||
colors[i].r = lpEntries[dwStartingEntry + i].peRed;
|
||||
colors[i].g = lpEntries[dwStartingEntry + i].peGreen;
|
||||
colors[i].b = lpEntries[dwStartingEntry + i].peBlue;
|
||||
colors[i].a = SDL_ALPHA_OPAQUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user