mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-24 08:41:16 +00:00
implement a few functions
This commit is contained in:
parent
e824e321e8
commit
cd9c62ff6e
@ -2,6 +2,7 @@
|
||||
#define LEGO3DVIEW_H
|
||||
|
||||
#include "mxtypes.h"
|
||||
#include "tgl/d3drm/impl.h"
|
||||
#include "viewmanager/viewmanager.h"
|
||||
|
||||
class LegoROI;
|
||||
@ -9,11 +10,18 @@ class LegoROI;
|
||||
class Lego3DView {
|
||||
public:
|
||||
inline ViewManager* GetViewManager() { return this->m_viewManager; }
|
||||
inline TglImpl::ViewImpl* GetViewPort() { return this->m_viewPort; }
|
||||
LegoROI* PickROI(MxLong p_a, MxLong p_b);
|
||||
|
||||
private:
|
||||
char m_pad[0x88];
|
||||
ViewManager* m_viewManager;
|
||||
// TODO: all of these fields are in various base classes
|
||||
undefined4 m_vtable; // 0x0 (TODO: remove once virtual function added)
|
||||
undefined4 m_unk0x4; // 0x4
|
||||
TglImpl::RendererImpl* m_renderImpl; // 0x8
|
||||
TglImpl::DeviceImpl* m_deviceImpl; // 0xc
|
||||
TglImpl::ViewImpl* m_viewPort; // 0x10
|
||||
char m_pad[0x78]; // 0x14
|
||||
ViewManager* m_viewManager; // 0x88
|
||||
};
|
||||
|
||||
#endif // LEGO3DVIEW_H
|
||||
|
||||
@ -69,6 +69,53 @@ void LegoVideoManager::MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY)
|
||||
m_cursorY = 463;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1007b770
|
||||
MxResult LegoVideoManager::Tickle()
|
||||
{
|
||||
// TODO
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1007ac40
|
||||
MxResult LegoVideoManager::Create(MxVideoParam& p_videoParam, MxU32 p_frequencyMS, MxBool p_createThread)
|
||||
{
|
||||
// TODO
|
||||
return MxVideoManager::Create(p_videoParam, p_frequencyMS, p_createThread);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1007c080
|
||||
void LegoVideoManager::VTable0x38(undefined4, undefined4)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1007c290
|
||||
MxResult LegoVideoManager::RealizePalette(MxPalette* p_pallete)
|
||||
{
|
||||
if (p_pallete && m_videoParam.GetPalette()) {
|
||||
p_pallete->GetEntries(m_paletteEntries);
|
||||
m_videoParam.GetPalette()->SetEntries(m_paletteEntries);
|
||||
m_displaySurface->SetPalette(m_videoParam.GetPalette());
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1007c4d0
|
||||
void LegoVideoManager::VTable0x34(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height)
|
||||
{
|
||||
if (p_width == 0) {
|
||||
p_width = m_videoParam.GetRect().GetWidth();
|
||||
}
|
||||
if (p_height == 0) {
|
||||
p_height = m_videoParam.GetRect().GetHeight();
|
||||
}
|
||||
|
||||
if (!m_initialized) {
|
||||
m_3dManager->GetLego3DView()->GetViewPort()->ForceUpdate(p_x, p_y, p_width, p_height);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1007c300
|
||||
void LegoVideoManager::EnableFullScreenMovie(MxBool p_enable)
|
||||
{
|
||||
@ -135,9 +182,7 @@ void LegoVideoManager::SetSkyColor(float p_red, float p_green, float p_blue)
|
||||
colorStrucure.peFlags = -124;
|
||||
m_videoParam.GetPalette()->SetSkyColor(&colorStrucure);
|
||||
m_videoParam.GetPalette()->SetOverrideSkyColor(TRUE);
|
||||
|
||||
// TODO 3d manager
|
||||
// m_3dManager->m_pViewport->VTable0x1c(red, green, blue)
|
||||
m_3dManager->GetLego3DView()->GetViewPort()->SetBackgroundColor(p_red, p_green, p_blue);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1007c4c0
|
||||
|
||||
@ -21,7 +21,15 @@ class LegoVideoManager : public MxVideoManager {
|
||||
__declspec(dllexport) void EnableFullScreenMovie(MxBool p_enable, MxBool p_scale);
|
||||
__declspec(dllexport) void MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY);
|
||||
|
||||
virtual MxResult Tickle() override; // vtable+0x8
|
||||
virtual void Destroy() override; // vtable+0x18
|
||||
virtual MxResult Create(MxVideoParam& p_videoParam, MxU32 p_frequencyMS, MxBool p_createThread)
|
||||
override; // vtable+0x2c
|
||||
virtual MxResult RealizePalette(MxPalette*) override; // vtable+0x30
|
||||
virtual void VTable0x34(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height) override; // vtable+0x34
|
||||
virtual void VTable0x38(undefined4, undefined4);
|
||||
// FUNCTION: LGEO1 0x1007ab10
|
||||
virtual undefined4 VTable0x3c() { return m_unk0x4e8; }
|
||||
|
||||
void SetSkyColor(float p_red, float p_green, float p_blue);
|
||||
void OverrideSkyColor(MxBool p_shouldOverride);
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxDisplaySurface, 0xac);
|
||||
|
||||
MxU32 g_unk0x1010215c = 0;
|
||||
|
||||
// FUNCTION: LEGO1 0x100ba500
|
||||
MxDisplaySurface::MxDisplaySurface()
|
||||
{
|
||||
@ -248,9 +250,61 @@ undefined4 MxDisplaySurface::VTable0x34(undefined4, undefined4, undefined4, unde
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100bba50
|
||||
void MxDisplaySurface::Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
|
||||
// FUNCTION: LEGO1 0x100bba50
|
||||
void MxDisplaySurface::Display(MxS16 left, MxS16 top, MxS16 left2, MxS16 top2, MxS16 width, MxS16 height)
|
||||
{
|
||||
if (m_videoParam.Flags().GetF2bit1()) {
|
||||
if (m_videoParam.Flags().GetFlipSurfaces() != 0) {
|
||||
if (g_unk0x1010215c < 2) {
|
||||
g_unk0x1010215c++;
|
||||
|
||||
DDSURFACEDESC ddsd;
|
||||
memset(&ddsd, 0, sizeof(ddsd));
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
if (m_ddSurface2->Lock(NULL, &ddsd, 1, NULL) == S_OK) {
|
||||
MxU8* surface = (MxU8*) ddsd.lpSurface;
|
||||
MxS32 height = m_videoParam.GetRect().GetHeight();
|
||||
|
||||
for (MxU32 i = 0; i < ddsd.dwHeight; i++)
|
||||
{
|
||||
memset(surface, 0, ddsd.dwWidth * ddsd.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
surface += ddsd.lPitch;
|
||||
}
|
||||
|
||||
m_ddSurface2->Unlock(ddsd.lpSurface);
|
||||
}
|
||||
else {
|
||||
OutputDebugString("MxDisplaySurface::Display error\n");
|
||||
}
|
||||
}
|
||||
m_ddSurface1->Flip(NULL, 1);
|
||||
}
|
||||
else {
|
||||
POINT point = {0, 0};
|
||||
ClientToScreen(MxOmni::GetInstance()->GetWindowHandle(), &point);
|
||||
|
||||
RECT rect1;
|
||||
RECT rect2;
|
||||
rect1.left = left2 + m_videoParam.GetRect().GetLeft() + point.x;
|
||||
rect2.left = left;
|
||||
rect1.top = top2 + m_videoParam.GetRect().GetTop() + point.y;
|
||||
rect2.right = left + width;
|
||||
rect2.top = top;
|
||||
rect2.bottom = top + height;
|
||||
rect1.right = rect1.left + width;
|
||||
rect1.bottom = rect1.top + height;
|
||||
|
||||
DDBLTFX data;
|
||||
memset(&data, 0, sizeof(data));
|
||||
data.dwSize = sizeof(data);
|
||||
data.dwDDFX = 8;
|
||||
|
||||
if (m_ddSurface1->Blt(&rect1, m_ddSurface2, &rect2, 0, &data) == DDERR_SURFACELOST) {
|
||||
m_ddSurface1->Restore();
|
||||
m_ddSurface1->Blt(&rect1, m_ddSurface2, &rect2, 0, &data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100bbc10
|
||||
|
||||
@ -62,7 +62,7 @@ class MxDisplaySurface : public MxCore {
|
||||
MxBool
|
||||
);
|
||||
virtual undefined4 VTable0x34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||
virtual void Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||
virtual void Display(MxS16 left, MxS16 top, MxS16 left2, MxS16 top2, MxS16 width, MxS16 height);
|
||||
virtual void GetDC(HDC* p_hdc);
|
||||
virtual void ReleaseDC(HDC p_hdc);
|
||||
virtual LPDIRECTDRAWSURFACE VTable0x44(MxBitmap*, undefined4*, undefined4, undefined4);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user