mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 10:41:15 +00:00
implement EnableFullScreenMovie and FUN_100ba640
This commit is contained in:
parent
afadca953b
commit
2f783c57a1
@ -75,10 +75,52 @@ void LegoVideoManager::EnableFullScreenMovie(MxBool p_enable)
|
||||
EnableFullScreenMovie(p_enable, TRUE);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1007c310
|
||||
// FUNCTION: LEGO1 0x1007c310
|
||||
void LegoVideoManager::EnableFullScreenMovie(MxBool p_enable, MxBool p_scale)
|
||||
{
|
||||
// TODO
|
||||
if (m_isFullscreenMovie != p_enable) {
|
||||
m_isFullscreenMovie = p_enable;
|
||||
|
||||
if (p_enable) {
|
||||
m_palette = m_videoParam.GetPalette()->Clone();
|
||||
OverrideSkyColor(FALSE);
|
||||
|
||||
m_videoParam.Flags().SetF1bit7(p_scale);
|
||||
|
||||
m_unk0xe4 = FALSE;
|
||||
m_unk0x500 = TRUE;
|
||||
}
|
||||
else {
|
||||
m_displaySurface->FUN_100ba640();
|
||||
m_videoParam.Flags().SetF1bit7(p_scale);
|
||||
|
||||
// restore previous pallete
|
||||
RealizePalette(m_palette);
|
||||
delete m_palette;
|
||||
m_palette = NULL;
|
||||
|
||||
// update region where video used to be
|
||||
MxRect32 rect(
|
||||
0,
|
||||
0,
|
||||
m_videoParam.GetRect().GetRight() - m_videoParam.GetRect().GetLeft(),
|
||||
m_videoParam.GetRect().GetBottom() - m_videoParam.GetRect().GetTop()
|
||||
);
|
||||
InvalidateRect(rect);
|
||||
UpdateRegion();
|
||||
|
||||
OverrideSkyColor(TRUE);
|
||||
m_unk0xe4 = TRUE;
|
||||
m_unk0x500 = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_enable) {
|
||||
m_videoParam.Flags().SetF1bit7(p_scale);
|
||||
}
|
||||
else {
|
||||
m_videoParam.Flags().SetF1bit7(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1007c440
|
||||
|
||||
@ -28,10 +28,55 @@ void MxDisplaySurface::Reset()
|
||||
memset(&this->m_surfaceDesc, 0, sizeof(this->m_surfaceDesc));
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100ba640
|
||||
// FUNCTION: LEGO1 0x100ba640
|
||||
void MxDisplaySurface::FUN_100ba640()
|
||||
{
|
||||
// TODO
|
||||
int backbuffers;
|
||||
DDSURFACEDESC desc;
|
||||
HRESULT hr;
|
||||
int height;
|
||||
|
||||
if (!m_videoParam.Flags().GetFlipSurfaces()) {
|
||||
backbuffers = 1;
|
||||
}
|
||||
else {
|
||||
backbuffers = m_videoParam.GetBackBuffers() + 1;
|
||||
}
|
||||
|
||||
for (MxU32 i = 0; i < backbuffers; i++) {
|
||||
memset(&desc, 0, sizeof(DDSURFACEDESC));
|
||||
|
||||
desc.dwSize = sizeof(DDSURFACEDESC);
|
||||
hr = m_ddSurface2->Lock(NULL, &desc, DDLOCK_WAIT, NULL);
|
||||
if (hr == DDERR_SURFACELOST) {
|
||||
m_ddSurface2->Restore();
|
||||
hr = m_ddSurface2->Lock(NULL, &desc, DDLOCK_WAIT, NULL);
|
||||
}
|
||||
|
||||
if (hr != S_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
MxU8* surface = (MxU8*) desc.lpSurface;
|
||||
height = m_videoParam.GetRect().GetBottom() - m_videoParam.GetRect().GetTop();
|
||||
if (height != -1) {
|
||||
do {
|
||||
memset(
|
||||
surface,
|
||||
0,
|
||||
(m_videoParam.GetRect().GetRight() - m_videoParam.GetRect().GetLeft() + 1) *
|
||||
desc.ddpfPixelFormat.dwRGBBitCount
|
||||
);
|
||||
|
||||
surface += desc.lPitch;
|
||||
} while (height--);
|
||||
}
|
||||
|
||||
m_ddSurface2->Unlock(desc.lpSurface);
|
||||
if (m_videoParam.Flags().GetFlipSurfaces()) {
|
||||
m_ddSurface1->Flip(NULL, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100ba790
|
||||
|
||||
Loading…
Reference in New Issue
Block a user