mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 10:31:16 +00:00
Merge remote-tracking branch 'isle/master'
This commit is contained in:
commit
68f209b18c
@ -120,7 +120,7 @@ void DetectDirectX(unsigned int* p_version, BOOL* p_found)
|
|||||||
surface_desc.dwSize = sizeof(surface_desc);
|
surface_desc.dwSize = sizeof(surface_desc);
|
||||||
surface_desc.dwFlags = DDSD_CAPS;
|
surface_desc.dwFlags = DDSD_CAPS;
|
||||||
surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
|
surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
|
||||||
if (FAILED(ddraw2->SetCooperativeLevel(NULL, DISCL_BACKGROUND))) {
|
if (FAILED(ddraw2->SetCooperativeLevel(NULL, DDSCL_NORMAL))) {
|
||||||
ddraw2->Release();
|
ddraw2->Release();
|
||||||
FreeLibrary(ddraw_module);
|
FreeLibrary(ddraw_module);
|
||||||
*p_version = 0;
|
*p_version = 0;
|
||||||
|
|||||||
@ -112,7 +112,7 @@ LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_text
|
|||||||
entries[i].peBlue = image->GetPalette()->colors[i].b;
|
entries[i].peBlue = image->GetPalette()->colors[i].b;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
entries[i].peFlags = 0x80;
|
entries[i].peFlags = D3DPAL_RESERVED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ LegoResult LegoTextureInfo::FUN_10066010(const LegoU8* p_bits)
|
|||||||
memset(&desc, 0, sizeof(desc));
|
memset(&desc, 0, sizeof(desc));
|
||||||
desc.dwSize = sizeof(desc);
|
desc.dwSize = sizeof(desc);
|
||||||
|
|
||||||
if (m_surface->Lock(NULL, &desc, 0, NULL) == DD_OK) {
|
if (m_surface->Lock(NULL, &desc, DDLOCK_SURFACEMEMORYPTR, NULL) == DD_OK) {
|
||||||
MxU8* surface = (MxU8*) desc.lpSurface;
|
MxU8* surface = (MxU8*) desc.lpSurface;
|
||||||
const LegoU8* bits = p_bits;
|
const LegoU8* bits = p_bits;
|
||||||
|
|
||||||
|
|||||||
@ -293,10 +293,10 @@ void MxTransitionManager::MosaicTransition()
|
|||||||
memset(&ddsd, 0, sizeof(ddsd));
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
ddsd.dwSize = sizeof(ddsd);
|
ddsd.dwSize = sizeof(ddsd);
|
||||||
|
|
||||||
HRESULT res = m_ddSurface->Lock(NULL, &ddsd, 1, NULL);
|
HRESULT res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
|
||||||
if (res == DDERR_SURFACELOST) {
|
if (res == DDERR_SURFACELOST) {
|
||||||
m_ddSurface->Restore();
|
m_ddSurface->Restore();
|
||||||
res = m_ddSurface->Lock(NULL, &ddsd, 1, NULL);
|
res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == DD_OK) {
|
if (res == DD_OK) {
|
||||||
|
|||||||
@ -659,7 +659,7 @@ void LegoVideoManager::SetSkyColor(float p_red, float p_green, float p_blue)
|
|||||||
colorStrucure.peRed = (p_red * 255.0f);
|
colorStrucure.peRed = (p_red * 255.0f);
|
||||||
colorStrucure.peGreen = (p_green * 255.0f);
|
colorStrucure.peGreen = (p_green * 255.0f);
|
||||||
colorStrucure.peBlue = (p_blue * 255.0f);
|
colorStrucure.peBlue = (p_blue * 255.0f);
|
||||||
colorStrucure.peFlags = -124;
|
colorStrucure.peFlags = D3DPAL_RESERVED | PC_NOCOLLAPSE;
|
||||||
m_videoParam.GetPalette()->SetSkyColor(&colorStrucure);
|
m_videoParam.GetPalette()->SetSkyColor(&colorStrucure);
|
||||||
m_videoParam.GetPalette()->SetOverrideSkyColor(TRUE);
|
m_videoParam.GetPalette()->SetOverrideSkyColor(TRUE);
|
||||||
m_3dManager->GetLego3DView()->GetView()->SetBackgroundColor(p_red, p_green, p_blue);
|
m_3dManager->GetLego3DView()->GetView()->SetBackgroundColor(p_red, p_green, p_blue);
|
||||||
|
|||||||
@ -165,19 +165,19 @@ BOOL MxDirectDraw::SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int pa
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
m_paletteEntries[i].peFlags = 0x80;
|
m_paletteEntries[i].peFlags = D3DPAL_RESERVED;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; i < 142; i++) {
|
for (; i < 142; i++) {
|
||||||
m_paletteEntries[i].peFlags = 0x44;
|
m_paletteEntries[i].peFlags = D3DPAL_READONLY | PC_NOCOLLAPSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; i < 246; i++) {
|
for (; i < 246; i++) {
|
||||||
m_paletteEntries[i].peFlags = 0x84;
|
m_paletteEntries[i].peFlags = D3DPAL_RESERVED | PC_NOCOLLAPSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; i < 256; i++) {
|
for (; i < 256; i++) {
|
||||||
m_paletteEntries[i].peFlags = 0x80;
|
m_paletteEntries[i].peFlags = D3DPAL_RESERVED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (paletteEntryCount != 0) {
|
if (paletteEntryCount != 0) {
|
||||||
@ -562,10 +562,10 @@ void MxDirectDraw::FUN_1009e020()
|
|||||||
memset(&ddsd, 0, sizeof(ddsd));
|
memset(&ddsd, 0, sizeof(ddsd));
|
||||||
ddsd.dwSize = sizeof(ddsd);
|
ddsd.dwSize = sizeof(ddsd);
|
||||||
|
|
||||||
result = m_pBackBuffer->Lock(NULL, &ddsd, 1, NULL);
|
result = m_pBackBuffer->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
|
||||||
if (result == DDERR_SURFACELOST) {
|
if (result == DDERR_SURFACELOST) {
|
||||||
m_pBackBuffer->Restore();
|
m_pBackBuffer->Restore();
|
||||||
result = m_pBackBuffer->Lock(NULL, &ddsd, 1, NULL);
|
result = m_pBackBuffer->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != DD_OK) {
|
if (result != DD_OK) {
|
||||||
|
|||||||
@ -1082,7 +1082,7 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::CopySurface(LPDIRECTDRAWSURFACE p_src)
|
|||||||
|
|
||||||
RECT rect = {0, 0, (LONG) ddsd.dwWidth, (LONG) ddsd.dwHeight};
|
RECT rect = {0, 0, (LONG) ddsd.dwWidth, (LONG) ddsd.dwHeight};
|
||||||
|
|
||||||
if (newSurface->BltFast(0, 0, p_src, &rect, 16) != DD_OK) {
|
if (newSurface->BltFast(0, 0, p_src, &rect, DDBLTFAST_WAIT) != DD_OK) {
|
||||||
newSurface->Release();
|
newSurface->Release();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user