mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 00:44:21 +00:00
implement RegistrationBook::ReadyWorld(), impl/match MxDisplaySurface::CopySurface() (#678)
* implement RegistrationBook::ReadyWorld() * don't fix the size of letterBuffer * Fix crash in MxStillPresenter::Clone * Implement MxDisplaySurface::CopySurface 100% match * improve accuracy * invert HasRegistered check * fix legogamestate structure, documentation tweaks * this might be cleaner actually * Update mxdisplaysurface.cpp * Update legogamestate.h * don't hardcode action ids in VTable0x64 * Match ~98% --------- Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com> Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
@@ -701,11 +701,30 @@ done:
|
||||
return surface;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100bbfb0
|
||||
LPDIRECTDRAWSURFACE MxDisplaySurface::FUN_100bbfb0(LPDIRECTDRAWSURFACE p_und)
|
||||
// FUNCTION: LEGO1 0x100bbfb0
|
||||
LPDIRECTDRAWSURFACE MxDisplaySurface::CopySurface(LPDIRECTDRAWSURFACE p_src)
|
||||
{
|
||||
// TODO
|
||||
return NULL;
|
||||
LPDIRECTDRAWSURFACE newSurface = NULL;
|
||||
IDirectDraw* draw = MVideoManager()->GetDirectDraw();
|
||||
|
||||
DDSURFACEDESC ddsd;
|
||||
memset(&ddsd, 0, sizeof(ddsd));
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
|
||||
p_src->GetSurfaceDesc(&ddsd);
|
||||
|
||||
if (draw->CreateSurface(&ddsd, &newSurface, NULL) != DD_OK) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RECT rect = {0, 0, (LONG) ddsd.dwWidth, (LONG) ddsd.dwHeight};
|
||||
|
||||
if (newSurface->BltFast(0, 0, p_src, &rect, 16) != DD_OK) {
|
||||
newSurface->Release();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return newSurface;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100bc070
|
||||
|
||||
@@ -231,7 +231,7 @@ MxStillPresenter* MxStillPresenter::Clone()
|
||||
|
||||
if (presenter) {
|
||||
if (presenter->AddToManager() == SUCCESS) {
|
||||
MxDSAction* action = presenter->GetAction()->Clone();
|
||||
MxDSAction* action = GetAction()->Clone();
|
||||
|
||||
if (action && presenter->StartAction(NULL, action) == SUCCESS) {
|
||||
presenter->SetBit0(GetBit0());
|
||||
@@ -249,7 +249,7 @@ MxStillPresenter* MxStillPresenter::Clone()
|
||||
}
|
||||
|
||||
if (m_unk0x58) {
|
||||
presenter->m_unk0x58 = MxDisplaySurface::FUN_100bbfb0(m_unk0x58);
|
||||
presenter->m_unk0x58 = MxDisplaySurface::CopySurface(m_unk0x58);
|
||||
}
|
||||
|
||||
if (m_alpha) {
|
||||
|
||||
Reference in New Issue
Block a user