mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 18:51:16 +00:00
Match to 100%
This commit is contained in:
parent
b55b3bbafd
commit
6c170e2dbe
@ -703,29 +703,27 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface()
|
|||||||
ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
|
ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
|
||||||
ddsd.ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN;
|
ddsd.ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_OFFSCREENPLAIN;
|
||||||
|
|
||||||
if (draw->CreateSurface(&ddsd, &newSurface, NULL) == S_OK) {
|
if (draw->CreateSurface(&ddsd, &newSurface, NULL) != S_OK) {
|
||||||
ddsd.ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY;
|
ddsd.ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY;
|
||||||
ddsd.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
|
ddsd.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
|
||||||
|
|
||||||
if (draw->CreateSurface(&ddsd, &newSurface, NULL) == S_OK) {
|
if (draw->CreateSurface(&ddsd, &newSurface, NULL) != S_OK)
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
memset(&ddsd, 0, sizeof(ddsd));
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
ddsd.dwSize = sizeof(ddsd);
|
ddsd.dwSize = sizeof(ddsd);
|
||||||
|
|
||||||
if (newSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL) != S_OK) {
|
if (newSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL) != S_OK)
|
||||||
if (newSurface) {
|
goto done;
|
||||||
newSurface->Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
MxU16* surface = (MxU16*) ddsd.lpSurface;
|
MxU16* surface = (MxU16*) ddsd.lpSurface;
|
||||||
|
MxLong pitch = ddsd.lPitch;
|
||||||
|
|
||||||
// draw a simple cursor to the surface
|
// draw a simple cursor to the surface
|
||||||
for (MxS32 x = 0; x < 16; x++) {
|
for (MxS32 x = 0; x < 16; x++) {
|
||||||
MxU16* surface2 = surface;
|
MxU16* surface2 = surface;
|
||||||
for (MxS32 y = 0; y < 16; y++) {
|
for (MxS32 y = 0; y < 16; y++) {
|
||||||
for (y = 0; y < 16; ++y) {
|
|
||||||
if ((y > 10 || x) && (x > 10 || y) && x + y != 10) {
|
if ((y > 10 || x) && (x > 10 || y) && x + y != 10) {
|
||||||
if (x + y > 10)
|
if (x + y > 10)
|
||||||
*surface2 = 31775;
|
*surface2 = 31775;
|
||||||
@ -737,8 +735,7 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface()
|
|||||||
}
|
}
|
||||||
surface2++;
|
surface2++;
|
||||||
}
|
}
|
||||||
}
|
surface = (MxU16*) ((MxU8*) surface + pitch);
|
||||||
surface = (MxU16*) ((MxU8*) surface + ddsd.lPitch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newSurface->Unlock(ddsd.lpSurface);
|
newSurface->Unlock(ddsd.lpSurface);
|
||||||
@ -749,7 +746,10 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface()
|
|||||||
|
|
||||||
return newSurface;
|
return newSurface;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
done:
|
||||||
|
if (newSurface) {
|
||||||
|
newSurface->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user