mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-24 00:31:16 +00:00
More fixes
This commit is contained in:
parent
78c37ada37
commit
13b5d95512
@ -3,7 +3,7 @@
|
||||
DECOMP_SIZE_ASSERT(MxAudioManager, 0x30);
|
||||
|
||||
// GLOBAL: LEGO1 0x10102108
|
||||
MxS32 MxAudioManager::g_count = 0;
|
||||
MxS32 MxAudioManager::s_count = 0;
|
||||
|
||||
// FUNCTION: LEGO1 0x10029910
|
||||
MxS32 MxAudioManager::GetVolume()
|
||||
@ -33,7 +33,7 @@ void MxAudioManager::Init()
|
||||
void MxAudioManager::Destroy(MxBool p_fromDestructor)
|
||||
{
|
||||
this->m_criticalSection.Enter();
|
||||
g_count--;
|
||||
s_count--;
|
||||
Init();
|
||||
this->m_criticalSection.Leave();
|
||||
|
||||
@ -51,7 +51,7 @@ MxResult MxAudioManager::InitPresenters()
|
||||
this->m_criticalSection.Enter();
|
||||
success = TRUE;
|
||||
result = SUCCESS;
|
||||
g_count++;
|
||||
s_count++;
|
||||
}
|
||||
|
||||
if (result)
|
||||
|
||||
@ -18,7 +18,7 @@ class MxAudioManager : public MxMediaManager {
|
||||
private:
|
||||
void Destroy(MxBool p_fromDestructor);
|
||||
|
||||
static MxS32 g_count;
|
||||
static MxS32 s_count;
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
|
||||
@ -378,8 +378,8 @@ MxResult MxBitmap::ImportColorsToPalette(RGBQUAD* p_rgbquad, MxPalette* p_palett
|
||||
goto done;
|
||||
}
|
||||
else {
|
||||
MxPalette local_pal;
|
||||
if (local_pal.GetEntries(entries))
|
||||
MxPalette palette;
|
||||
if (palette.GetEntries(entries))
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ BOOL MxDirect3D::Create(
|
||||
success = TRUE;
|
||||
|
||||
if (!success)
|
||||
FUN_1009D920();
|
||||
FUN_1009d920();
|
||||
|
||||
return success;
|
||||
}
|
||||
@ -164,10 +164,10 @@ void MxDirect3D::BuildErrorString(const char* p_format, ...)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1009c6c0
|
||||
MxResult MxDeviceEnumerate::_DoEnumerate()
|
||||
MxResult MxDeviceEnumerate::DoEnumerate()
|
||||
{
|
||||
// TODO: what does ECX refer to in this context?
|
||||
if (m_unk0x010_flag)
|
||||
if (m_unk0x010)
|
||||
return FAILURE;
|
||||
|
||||
HRESULT ret = DirectDrawEnumerate(EnumerateCallback, this);
|
||||
@ -176,7 +176,7 @@ MxResult MxDeviceEnumerate::_DoEnumerate()
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
m_unk0x010_flag = TRUE;
|
||||
m_unk0x010 = TRUE;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,8 @@ class MxDeviceModeFinder {
|
||||
class MxDeviceEnumerate {
|
||||
public:
|
||||
MxDeviceEnumerate();
|
||||
virtual MxResult _DoEnumerate();
|
||||
virtual MxResult DoEnumerate();
|
||||
|
||||
BOOL FUN_1009c070();
|
||||
|
||||
const char* EnumerateErrorToString(HRESULT p_error);
|
||||
@ -31,9 +32,9 @@ class MxDeviceEnumerate {
|
||||
undefined4 m_unk0x004;
|
||||
undefined4 m_unk0x008;
|
||||
undefined4 m_unk0x00c;
|
||||
MxBool m_unk0x010_flag; // +0x10
|
||||
MxBool m_unk0x010; // +0x10
|
||||
|
||||
undefined4 m_unk0xnown[97];
|
||||
undefined4 m_unk0x014[97];
|
||||
};
|
||||
|
||||
// VTABLE: LEGO1 0x100db800
|
||||
|
||||
@ -10,7 +10,7 @@ DECOMP_SIZE_ASSERT(MxDirectDraw::DeviceModesInfo, 0x17c);
|
||||
#endif
|
||||
|
||||
// GLOBAL: LEGO1 0x10100c68
|
||||
BOOL g_is_PALETTEINDEXED8 = 0;
|
||||
BOOL g_isPaletteIndexed8 = 0;
|
||||
|
||||
// FUNCTION: LEGO1 0x1009d490
|
||||
MxDirectDraw::MxDirectDraw()
|
||||
@ -24,7 +24,7 @@ MxDirectDraw::MxDirectDraw()
|
||||
m_pText1Surface = NULL;
|
||||
m_pText2Surface = NULL;
|
||||
m_hWndMain = NULL;
|
||||
m_bIgnoreWM_SIZE = FALSE;
|
||||
m_bIgnoreWMSIZE = FALSE;
|
||||
m_bPrimaryPalettized = FALSE;
|
||||
m_bOnlySystemMemory = FALSE;
|
||||
m_bFullScreen = FALSE;
|
||||
@ -65,7 +65,7 @@ int MxDirectDraw::GetPrimaryBitDepth()
|
||||
|
||||
pDDraw->GetDisplayMode(&ddsd);
|
||||
dwRGBBitCount = ddsd.ddpfPixelFormat.dwRGBBitCount;
|
||||
g_is_PALETTEINDEXED8 = (ddsd.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) != 0;
|
||||
g_isPaletteIndexed8 = (ddsd.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) != 0;
|
||||
pDDraw->Release();
|
||||
}
|
||||
|
||||
@ -89,13 +89,13 @@ BOOL MxDirectDraw::Create(
|
||||
|
||||
CacheOriginalPaletteEntries();
|
||||
|
||||
if (!RecreateDirectDraw(&m_pCurrentDeviceModesList->p_guid)) {
|
||||
if (!RecreateDirectDraw(&m_pCurrentDeviceModesList->m_guid)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
m_bFlipSurfaces = surface_fullscreen;
|
||||
m_bOnlySystemMemory = onlySystemMemory;
|
||||
m_bIsOnPrimaryDevice = !m_pCurrentDeviceModesList->p_guid;
|
||||
m_bIsOnPrimaryDevice = !m_pCurrentDeviceModesList->m_guid;
|
||||
BOOL fullscreen = 1;
|
||||
|
||||
if (m_bIsOnPrimaryDevice) {
|
||||
@ -131,12 +131,12 @@ BOOL MxDirectDraw::RecreateDirectDraw(GUID** ppGUID)
|
||||
// FUNCTION: LEGO1 0x1009d6c0
|
||||
BOOL MxDirectDraw::CacheOriginalPaletteEntries()
|
||||
{
|
||||
HDC DC;
|
||||
HDC dc;
|
||||
|
||||
if (g_is_PALETTEINDEXED8) {
|
||||
DC = GetDC(0);
|
||||
GetSystemPaletteEntries(DC, 0, _countof(m_originalPaletteEntries), m_originalPaletteEntries);
|
||||
ReleaseDC(0, DC);
|
||||
if (g_isPaletteIndexed8) {
|
||||
dc = GetDC(0);
|
||||
GetSystemPaletteEntries(dc, 0, _countof(m_originalPaletteEntries), m_originalPaletteEntries);
|
||||
ReleaseDC(0, dc);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -150,7 +150,7 @@ BOOL MxDirectDraw::SetPaletteEntries(const PALETTEENTRY* pPaletteEntries, int pa
|
||||
HDC hdc;
|
||||
int i;
|
||||
|
||||
if (g_is_PALETTEINDEXED8) {
|
||||
if (g_isPaletteIndexed8) {
|
||||
hdc = GetDC(NULL);
|
||||
GetSystemPaletteEntries(hdc, 0, arraySize, m_paletteEntries);
|
||||
ReleaseDC(NULL, hdc);
|
||||
@ -197,7 +197,7 @@ void MxDirectDraw::Destroy()
|
||||
{
|
||||
DestroyButNotDirectDraw();
|
||||
|
||||
FUN_1009D920();
|
||||
FUN_1009d920();
|
||||
|
||||
if (m_pDirectDraw != NULL) {
|
||||
m_pDirectDraw->Release();
|
||||
@ -218,9 +218,9 @@ void MxDirectDraw::DestroyButNotDirectDraw()
|
||||
RestoreOriginalPaletteEntries();
|
||||
if (m_bFullScreen) {
|
||||
if (m_pDirectDraw != NULL) {
|
||||
m_bIgnoreWM_SIZE = TRUE;
|
||||
m_bIgnoreWMSIZE = TRUE;
|
||||
m_pDirectDraw->RestoreDisplayMode();
|
||||
m_bIgnoreWM_SIZE = FALSE;
|
||||
m_bIgnoreWMSIZE = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,14 +261,14 @@ void MxDirectDraw::DestroyButNotDirectDraw()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1009d920
|
||||
void MxDirectDraw::FUN_1009D920()
|
||||
void MxDirectDraw::FUN_1009d920()
|
||||
{
|
||||
RestoreOriginalPaletteEntries();
|
||||
if (m_pDirectDraw != NULL) {
|
||||
m_bIgnoreWM_SIZE = TRUE;
|
||||
m_bIgnoreWMSIZE = TRUE;
|
||||
m_pDirectDraw->RestoreDisplayMode();
|
||||
m_pDirectDraw->SetCooperativeLevel(NULL, DDSCL_NORMAL);
|
||||
m_bIgnoreWM_SIZE = FALSE;
|
||||
m_bIgnoreWMSIZE = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -278,9 +278,9 @@ BOOL MxDirectDraw::DDInit(BOOL fullscreen)
|
||||
HRESULT result;
|
||||
|
||||
if (fullscreen) {
|
||||
m_bIgnoreWM_SIZE = 1;
|
||||
m_bIgnoreWMSIZE = TRUE;
|
||||
result = m_pDirectDraw->SetCooperativeLevel(m_hWndMain, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
|
||||
m_bIgnoreWM_SIZE = 0;
|
||||
m_bIgnoreWMSIZE = FALSE;
|
||||
}
|
||||
else {
|
||||
result = m_pDirectDraw->SetCooperativeLevel(m_hWndMain, DDSCL_NORMAL);
|
||||
@ -302,7 +302,7 @@ BOOL MxDirectDraw::IsSupportedMode(int width, int height, int bpp)
|
||||
Mode mode = {width, height, bpp};
|
||||
|
||||
for (int i = 0; i < m_pCurrentDeviceModesList->count; i++) {
|
||||
if (m_pCurrentDeviceModesList->m_mode_ARRAY[i] == mode) {
|
||||
if (m_pCurrentDeviceModesList->m_modeArray[i] == mode) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -311,18 +311,18 @@ BOOL MxDirectDraw::IsSupportedMode(int width, int height, int bpp)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1009da20
|
||||
void EnableResizing(HWND hwnd, BOOL flag)
|
||||
void EnableResizing(HWND p_hwnd, BOOL p_flag)
|
||||
{
|
||||
static DWORD dwStyle;
|
||||
static DWORD s_dwStyle;
|
||||
|
||||
if (!flag) {
|
||||
dwStyle = GetWindowLong(hwnd, GWL_STYLE);
|
||||
if (dwStyle & WS_THICKFRAME) {
|
||||
SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) ^ WS_THICKFRAME);
|
||||
if (!p_flag) {
|
||||
s_dwStyle = GetWindowLong(p_hwnd, GWL_STYLE);
|
||||
if (s_dwStyle & WS_THICKFRAME) {
|
||||
SetWindowLong(p_hwnd, GWL_STYLE, GetWindowLong(p_hwnd, GWL_STYLE) ^ WS_THICKFRAME);
|
||||
}
|
||||
}
|
||||
else {
|
||||
SetWindowLong(hwnd, GWL_STYLE, dwStyle);
|
||||
SetWindowLong(p_hwnd, GWL_STYLE, s_dwStyle);
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,14 +348,14 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp)
|
||||
}
|
||||
|
||||
if (!IsSupportedMode(width, height, bpp)) {
|
||||
width = m_pCurrentDeviceModesList->m_mode_ARRAY[0].width;
|
||||
height = m_pCurrentDeviceModesList->m_mode_ARRAY[0].height;
|
||||
bpp = m_pCurrentDeviceModesList->m_mode_ARRAY[0].bitsPerPixel;
|
||||
width = m_pCurrentDeviceModesList->m_modeArray[0].m_width;
|
||||
height = m_pCurrentDeviceModesList->m_modeArray[0].m_height;
|
||||
bpp = m_pCurrentDeviceModesList->m_modeArray[0].m_bitsPerPixel;
|
||||
}
|
||||
|
||||
m_bIgnoreWM_SIZE = TRUE;
|
||||
m_bIgnoreWMSIZE = TRUE;
|
||||
result = m_pDirectDraw->SetDisplayMode(width, height, bpp);
|
||||
m_bIgnoreWM_SIZE = FALSE;
|
||||
m_bIgnoreWMSIZE = FALSE;
|
||||
if (result != DD_OK) {
|
||||
Error("SetDisplayMode failed", result);
|
||||
return FALSE;
|
||||
@ -370,7 +370,7 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
m_bIgnoreWM_SIZE = TRUE;
|
||||
m_bIgnoreWMSIZE = TRUE;
|
||||
dwStyle = GetWindowLong(m_hWndMain, GWL_STYLE);
|
||||
dwStyle &= ~(WS_POPUP | WS_CAPTION | WS_THICKFRAME | WS_OVERLAPPED);
|
||||
dwStyle |= WS_CAPTION | WS_THICKFRAME | WS_OVERLAPPED;
|
||||
@ -393,12 +393,12 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp)
|
||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE
|
||||
);
|
||||
SetWindowPos(m_hWndMain, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
|
||||
m_bIgnoreWM_SIZE = FALSE;
|
||||
m_bIgnoreWMSIZE = FALSE;
|
||||
}
|
||||
|
||||
m_currentMode.width = width;
|
||||
m_currentMode.height = height;
|
||||
m_currentMode.bitsPerPixel = bpp;
|
||||
m_currentMode.m_width = width;
|
||||
m_currentMode.m_height = height;
|
||||
m_currentMode.m_bitsPerPixel = bpp;
|
||||
|
||||
if (!DDCreateSurfaces()) {
|
||||
return FALSE;
|
||||
@ -406,7 +406,7 @@ BOOL MxDirectDraw::DDSetMode(int width, int height, int bpp)
|
||||
|
||||
DDSURFACEDESC ddsd;
|
||||
|
||||
FUN_1009E020();
|
||||
FUN_1009e020();
|
||||
|
||||
if (!GetDDSurfaceDesc(&ddsd, m_pBackBuffer)) {
|
||||
return FALSE;
|
||||
@ -506,8 +506,8 @@ BOOL MxDirectDraw::DDCreateSurfaces()
|
||||
Error("CreateSurface for window front buffer failed", result);
|
||||
return FALSE;
|
||||
}
|
||||
ddsd.dwHeight = m_currentMode.height;
|
||||
ddsd.dwWidth = m_currentMode.width;
|
||||
ddsd.dwHeight = m_currentMode.m_height;
|
||||
ddsd.dwWidth = m_currentMode.m_width;
|
||||
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
|
||||
if (m_bOnlySystemMemory)
|
||||
@ -543,7 +543,7 @@ BOOL MxDirectDraw::DDCreateSurfaces()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1009e020
|
||||
void MxDirectDraw::FUN_1009E020()
|
||||
void MxDirectDraw::FUN_1009e020()
|
||||
{
|
||||
HRESULT result;
|
||||
byte* line;
|
||||
@ -631,7 +631,7 @@ BOOL MxDirectDraw::CreateTextSurfaces()
|
||||
HRESULT result;
|
||||
DDCOLORKEY ddck;
|
||||
DDSURFACEDESC ddsd;
|
||||
HDC DC;
|
||||
HDC dc;
|
||||
char dummyinfo[] = "000x000x00 (RAMP) 0000";
|
||||
char dummyfps[] = "000.00 fps (000.00 fps (000.00 fps) 00000 tps)";
|
||||
|
||||
@ -640,7 +640,7 @@ BOOL MxDirectDraw::CreateTextSurfaces()
|
||||
}
|
||||
|
||||
m_hFont = CreateFontA(
|
||||
m_currentMode.width <= 600 ? 12 : 24,
|
||||
m_currentMode.m_width <= 600 ? 12 : 24,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
@ -656,11 +656,11 @@ BOOL MxDirectDraw::CreateTextSurfaces()
|
||||
"Arial"
|
||||
);
|
||||
|
||||
DC = GetDC(NULL);
|
||||
SelectObject(DC, m_hFont);
|
||||
GetTextExtentPointA(DC, dummyfps, strlen(dummyfps), &m_text1SizeOnSurface);
|
||||
GetTextExtentPointA(DC, dummyinfo, strlen(dummyinfo), &m_text2SizeOnSurface);
|
||||
ReleaseDC(NULL, DC);
|
||||
dc = GetDC(NULL);
|
||||
SelectObject(dc, m_hFont);
|
||||
GetTextExtentPointA(dc, dummyfps, strlen(dummyfps), &m_text1SizeOnSurface);
|
||||
GetTextExtentPointA(dc, dummyinfo, strlen(dummyinfo), &m_text2SizeOnSurface);
|
||||
ReleaseDC(NULL, dc);
|
||||
|
||||
memset(&ddsd, 0, sizeof(ddsd));
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
@ -774,8 +774,8 @@ BOOL MxDirectDraw::CreateZBuffer(DWORD memorytype, DWORD depth)
|
||||
|
||||
memset(&ddsd, 0, sizeof(ddsd));
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
ddsd.dwHeight = m_currentMode.height;
|
||||
ddsd.dwWidth = m_currentMode.width;
|
||||
ddsd.dwHeight = m_currentMode.m_height;
|
||||
ddsd.dwWidth = m_currentMode.m_width;
|
||||
ddsd.dwZBufferBitDepth = depth;
|
||||
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_ZBUFFERBITDEPTH;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | memorytype;
|
||||
@ -889,17 +889,17 @@ int MxDirectDraw::FlipToGDISurface()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1009e830
|
||||
void MxDirectDraw::Error(const char* message, int error)
|
||||
void MxDirectDraw::Error(const char* p_message, MxS32 p_error)
|
||||
{
|
||||
// GLOBAL: LEGO1 0x10100c70
|
||||
static BOOL isInsideError = FALSE;
|
||||
if (!isInsideError) {
|
||||
isInsideError = TRUE;
|
||||
static BOOL s_isInsideError = FALSE;
|
||||
if (!s_isInsideError) {
|
||||
s_isInsideError = TRUE;
|
||||
Destroy();
|
||||
if (m_pErrorHandler) {
|
||||
m_pErrorHandler(message, error, m_pErrorHandlerArg);
|
||||
m_pErrorHandler(p_message, p_error, m_pErrorHandlerArg);
|
||||
}
|
||||
isInsideError = FALSE;
|
||||
s_isInsideError = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1122,11 +1122,11 @@ MxDirectDraw::DeviceModesInfo::DeviceModesInfo()
|
||||
// FUNCTION: LEGO1 0x1009efd0
|
||||
MxDirectDraw::DeviceModesInfo::~DeviceModesInfo()
|
||||
{
|
||||
if (p_guid != NULL) {
|
||||
delete p_guid;
|
||||
if (m_guid != NULL) {
|
||||
delete m_guid;
|
||||
}
|
||||
|
||||
if (m_mode_ARRAY != NULL) {
|
||||
delete m_mode_ARRAY;
|
||||
if (m_modeArray != NULL) {
|
||||
delete m_modeArray;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
#ifndef MXDIRECTDRAW_H
|
||||
#define MXDIRECTDRAW_H
|
||||
|
||||
#include "mxtypes.h"
|
||||
|
||||
#include <ddraw.h>
|
||||
#include <windows.h>
|
||||
|
||||
extern BOOL g_is_PALETTEINDEXED8;
|
||||
|
||||
// VTABLE: LEGO1 0x100db818
|
||||
// SIZE 0x880
|
||||
class MxDirectDraw {
|
||||
@ -14,23 +14,26 @@ class MxDirectDraw {
|
||||
|
||||
// size 0x0c
|
||||
struct Mode {
|
||||
int width;
|
||||
int height;
|
||||
int bitsPerPixel;
|
||||
MxS32 m_width;
|
||||
MxS32 m_height;
|
||||
MxS32 m_bitsPerPixel;
|
||||
|
||||
int operator==(const Mode& rMode) const
|
||||
MxS32 operator==(const Mode& p_mode) const
|
||||
{
|
||||
return ((width == rMode.width) && (height == rMode.height) && (bitsPerPixel == rMode.bitsPerPixel));
|
||||
return (
|
||||
(m_width == p_mode.m_width) && (m_height == p_mode.m_height) &&
|
||||
(m_bitsPerPixel == p_mode.m_bitsPerPixel)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// size 0x17c
|
||||
// SIZE 0x17c
|
||||
struct DeviceModesInfo {
|
||||
GUID* p_guid;
|
||||
Mode* m_mode_ARRAY;
|
||||
int count;
|
||||
GUID* m_guid;
|
||||
Mode* m_modeArray;
|
||||
MxS32 count;
|
||||
DDCAPS m_ddcaps;
|
||||
void* a_178;
|
||||
void* m_178;
|
||||
|
||||
DeviceModesInfo();
|
||||
~DeviceModesInfo();
|
||||
@ -53,10 +56,10 @@ class MxDirectDraw {
|
||||
SIZE m_text2SizeOnSurface;
|
||||
HWND m_hWndMain;
|
||||
HFONT m_hFont;
|
||||
BOOL m_bIgnoreWM_SIZE;
|
||||
BOOL m_bIgnoreWMSIZE;
|
||||
BOOL m_bPrimaryPalettized;
|
||||
BOOL m_bFullScreen;
|
||||
void* a_850;
|
||||
void* m_850;
|
||||
BOOL m_bOnlySystemMemory;
|
||||
BOOL m_bIsOnPrimaryDevice;
|
||||
ErrorHandler m_pErrorHandler;
|
||||
@ -98,7 +101,7 @@ class MxDirectDraw {
|
||||
BOOL DDCreateSurfaces();
|
||||
BOOL DDInit(BOOL fullscreen);
|
||||
BOOL DDSetMode(int width, int height, int bpp);
|
||||
void Error(const char* message, int error);
|
||||
void Error(const char* p_message, MxS32 p_error);
|
||||
|
||||
BOOL GetDDSurfaceDesc(LPDDSURFACEDESC lpDDSurfDesc, LPDIRECTDRAWSURFACE lpDDSurf);
|
||||
BOOL IsSupportedMode(int width, int height, int bpp);
|
||||
@ -110,8 +113,8 @@ class MxDirectDraw {
|
||||
BOOL TextToTextSurface(const char* text, IDirectDrawSurface* pSurface, SIZE& textSizeOnSurface);
|
||||
BOOL TextToTextSurface1(const char* text);
|
||||
BOOL TextToTextSurface2(const char* lpString);
|
||||
void FUN_1009E020();
|
||||
void FUN_1009D920();
|
||||
void FUN_1009e020();
|
||||
void FUN_1009d920();
|
||||
};
|
||||
|
||||
#endif // MXDIRECTDRAW_H
|
||||
|
||||
@ -58,13 +58,13 @@ MxResult MxDiskStreamController::Open(const char* p_filename)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100c7880
|
||||
MxResult MxDiskStreamController::VTable0x18(undefined4 p_unknown, undefined4 p_unknown2)
|
||||
MxResult MxDiskStreamController::VTable0x18(undefined4, undefined4)
|
||||
{
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100c7960
|
||||
MxResult MxDiskStreamController::VTable0x34(undefined4 p_unknown)
|
||||
MxResult MxDiskStreamController::VTable0x34(undefined4)
|
||||
{
|
||||
return FAILURE;
|
||||
}
|
||||
@ -77,7 +77,7 @@ MxResult MxDiskStreamController::VTable0x28()
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100c7c00
|
||||
MxResult MxDiskStreamController::VTable0x30(undefined4 p_unknown)
|
||||
MxResult MxDiskStreamController::VTable0x30(MxDSAction* p_action)
|
||||
{
|
||||
// TODO
|
||||
return FAILURE;
|
||||
@ -91,7 +91,7 @@ MxResult MxDiskStreamController::VTable0x20(MxDSAction* p_action)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100c8160
|
||||
MxResult MxDiskStreamController::VTable0x24(undefined4 p_unknown)
|
||||
MxResult MxDiskStreamController::VTable0x24(MxDSAction* p_action)
|
||||
{
|
||||
// TODO
|
||||
return FAILURE;
|
||||
|
||||
@ -16,14 +16,14 @@ class MxDiskStreamController : public MxStreamController {
|
||||
MxDiskStreamController();
|
||||
virtual ~MxDiskStreamController() override;
|
||||
|
||||
virtual MxResult Tickle() override; // vtable+0x8
|
||||
virtual MxResult Open(const char* p_filename) override; // vtable+0x14
|
||||
virtual MxResult VTable0x18(undefined4 p_unknown, undefined4 p_unknown2) override; // vtable+0x18
|
||||
virtual MxResult VTable0x20(MxDSAction* p_action) override; // vtable+0x20
|
||||
virtual MxResult VTable0x24(undefined4 p_unknown) override; // vtable+0x24
|
||||
virtual MxResult VTable0x28() override; // vtable+0x28
|
||||
virtual MxResult VTable0x30(undefined4 p_unknown) override; // vtable+0x30
|
||||
virtual MxResult VTable0x34(undefined4 p_unknown); // vtable+0x34
|
||||
virtual MxResult Tickle() override; // vtable+0x8
|
||||
virtual MxResult Open(const char* p_filename) override; // vtable+0x14
|
||||
virtual MxResult VTable0x18(undefined4, undefined4) override; // vtable+0x18
|
||||
virtual MxResult VTable0x20(MxDSAction* p_action) override; // vtable+0x20
|
||||
virtual MxResult VTable0x24(MxDSAction* p_action) override; // vtable+0x24
|
||||
virtual MxResult VTable0x28() override; // vtable+0x28
|
||||
virtual MxResult VTable0x30(MxDSAction* p_action) override; // vtable+0x30
|
||||
virtual MxResult VTable0x34(undefined4); // vtable+0x34
|
||||
|
||||
// FUNCTION: LEGO1 0x100c7360
|
||||
inline virtual const char* ClassName() const override // vtable+0x0c
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
DECOMP_SIZE_ASSERT(MxDSAction, 0x94)
|
||||
|
||||
// GLOBAL: LEGO1 0x10101410
|
||||
MxU16 g_unkSep = TWOCC(',', ' ');
|
||||
MxU16 g_sep = TWOCC(',', ' ');
|
||||
|
||||
// FUNCTION: LEGO1 0x100ad810
|
||||
MxDSAction::MxDSAction()
|
||||
@ -29,7 +29,7 @@ MxDSAction::MxDSAction()
|
||||
this->m_unk0x84 = NULL;
|
||||
this->m_unk0x88 = 0;
|
||||
this->m_origin = NULL;
|
||||
this->m_unk0xTimingField = INT_MIN;
|
||||
this->m_unk0x90 = INT_MIN;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100ad940
|
||||
@ -51,15 +51,15 @@ MxBool MxDSAction::HasId(MxU32 p_objectId)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100ada40
|
||||
void MxDSAction::SetUnkTimingField(MxLong p_unkTimingField)
|
||||
void MxDSAction::SetUnknown90(MxLong p_unk0x90)
|
||||
{
|
||||
this->m_unk0xTimingField = p_unkTimingField;
|
||||
this->m_unk0x90 = p_unk0x90;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100ada50
|
||||
MxLong MxDSAction::GetUnkTimingField()
|
||||
MxLong MxDSAction::GetUnknown90()
|
||||
{
|
||||
return this->m_unk0xTimingField;
|
||||
return this->m_unk0x90;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100ada80
|
||||
@ -85,7 +85,7 @@ void MxDSAction::CopyFrom(MxDSAction& p_dsAction)
|
||||
this->m_unk0x84 = p_dsAction.m_unk0x84;
|
||||
this->m_unk0x88 = p_dsAction.m_unk0x88;
|
||||
this->m_origin = p_dsAction.m_origin;
|
||||
this->m_unk0xTimingField = p_dsAction.m_unk0xTimingField;
|
||||
this->m_unk0x90 = p_dsAction.m_unk0x90;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100adbe0
|
||||
@ -124,7 +124,7 @@ MxDSAction* MxDSAction::Clone()
|
||||
// FUNCTION: LEGO1 0x100adcd0
|
||||
MxLong MxDSAction::GetElapsedTime()
|
||||
{
|
||||
return Timer()->GetTime() - this->m_unk0xTimingField;
|
||||
return Timer()->GetTime() - this->m_unk0x90;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100add00
|
||||
@ -165,8 +165,8 @@ void MxDSAction::MergeFrom(MxDSAction& p_dsAction)
|
||||
|
||||
// Taking those references forces the compiler to move the values onto the stack.
|
||||
// The original code most likely looked different, but this yields a 100% match.
|
||||
MxU16& _extraLength = extraLength;
|
||||
char*& _extraData = extraData;
|
||||
MxU16& extraLengthRef = extraLength;
|
||||
char*& extraDataRef = extraData;
|
||||
if (extraLength && extraData) {
|
||||
if (!this->m_extraData || !strncmp("XXX", this->m_extraData, 3)) {
|
||||
delete[] this->m_extraData;
|
||||
@ -183,13 +183,13 @@ void MxDSAction::AppendData(MxU16 p_extraLength, const char* p_extraData)
|
||||
return;
|
||||
|
||||
if (this->m_extraLength) {
|
||||
char* concat = new char[p_extraLength + this->m_extraLength + sizeof(g_unkSep)];
|
||||
char* concat = new char[p_extraLength + this->m_extraLength + sizeof(g_sep)];
|
||||
memcpy(concat, this->m_extraData, this->m_extraLength);
|
||||
|
||||
*(MxU16*) &concat[this->m_extraLength] = g_unkSep;
|
||||
memcpy(&concat[this->m_extraLength + sizeof(g_unkSep)], p_extraData, p_extraLength);
|
||||
*(MxU16*) &concat[this->m_extraLength] = g_sep;
|
||||
memcpy(&concat[this->m_extraLength + sizeof(g_sep)], p_extraData, p_extraLength);
|
||||
|
||||
this->m_extraLength += p_extraLength + sizeof(g_unkSep);
|
||||
this->m_extraLength += p_extraLength + sizeof(g_sep);
|
||||
delete[] this->m_extraData;
|
||||
this->m_extraData = concat;
|
||||
}
|
||||
|
||||
@ -49,8 +49,8 @@ class MxDSAction : public MxDSObject {
|
||||
virtual MxDSAction* Clone(); // vtable+2c;
|
||||
virtual void MergeFrom(MxDSAction& p_dsAction); // vtable+30;
|
||||
virtual MxBool HasId(MxU32 p_objectId); // vtable+34;
|
||||
virtual void SetUnkTimingField(MxLong p_unkTimingField); // vtable+38;
|
||||
virtual MxLong GetUnkTimingField(); // vtable+3c;
|
||||
virtual void SetUnknown90(MxLong p_unk0x90); // vtable+38;
|
||||
virtual MxLong GetUnknown90(); // vtable+3c;
|
||||
virtual MxLong GetElapsedTime(); // vtable+40;
|
||||
|
||||
void AppendData(MxU16 p_extraLength, const char* p_extraData);
|
||||
@ -79,20 +79,20 @@ class MxDSAction : public MxDSObject {
|
||||
}
|
||||
|
||||
protected:
|
||||
MxU32 m_sizeOnDisk; // 0x2c
|
||||
MxU32 m_flags; // 0x30
|
||||
MxLong m_startTime; // 0x34
|
||||
MxLong m_duration; // 0x38
|
||||
MxS32 m_loopCount; // 0x3c
|
||||
Vector3Data m_location; // 0x40
|
||||
Vector3Data m_direction; // 0x54
|
||||
Vector3Data m_up; // 0x68
|
||||
char* m_extraData; // 0x7c
|
||||
MxU16 m_extraLength; // 0x80
|
||||
MxCore* m_unk0x84; // 0x84
|
||||
undefined4 m_unk0x88; // 0x88
|
||||
MxCore* m_origin; // 0x8c
|
||||
MxLong m_unk0xTimingField; // 0x90
|
||||
MxU32 m_sizeOnDisk; // 0x2c
|
||||
MxU32 m_flags; // 0x30
|
||||
MxLong m_startTime; // 0x34
|
||||
MxLong m_duration; // 0x38
|
||||
MxS32 m_loopCount; // 0x3c
|
||||
Vector3Data m_location; // 0x40
|
||||
Vector3Data m_direction; // 0x54
|
||||
Vector3Data m_up; // 0x68
|
||||
char* m_extraData; // 0x7c
|
||||
MxU16 m_extraLength; // 0x80
|
||||
MxCore* m_unk0x84; // 0x84
|
||||
undefined4 m_unk0x88; // 0x88
|
||||
MxCore* m_origin; // 0x8c
|
||||
MxLong m_unk0x90; // 0x90
|
||||
};
|
||||
|
||||
#endif // MXDSACTION_H
|
||||
|
||||
@ -53,14 +53,14 @@ MxDSMultiAction& MxDSMultiAction::operator=(MxDSMultiAction& p_dsMultiAction)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100ca290
|
||||
void MxDSMultiAction::SetUnkTimingField(MxLong p_unkTimingField)
|
||||
void MxDSMultiAction::SetUnknown90(MxLong p_unkTimingField)
|
||||
{
|
||||
this->m_unk0xTimingField = p_unkTimingField;
|
||||
this->m_unk0x90 = p_unkTimingField;
|
||||
|
||||
MxDSActionListCursor cursor(this->m_actions);
|
||||
MxDSAction* action;
|
||||
while (cursor.Next(action))
|
||||
action->SetUnkTimingField(p_unkTimingField);
|
||||
action->SetUnknown90(p_unkTimingField);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100ca370
|
||||
|
||||
@ -34,7 +34,7 @@ class MxDSMultiAction : public MxDSAction {
|
||||
virtual MxDSAction* Clone() override; // vtable+2c;
|
||||
virtual void MergeFrom(MxDSAction& p_dsAction) override; // vtable+30;
|
||||
virtual MxBool HasId(MxU32 p_objectId) override; // vtable+34;
|
||||
virtual void SetUnkTimingField(MxLong p_unkTimingField) override; // vtable+38;
|
||||
virtual void SetUnknown90(MxLong p_unkTimingField) override; // vtable+38;
|
||||
|
||||
inline MxDSActionList* GetActionList() const { return m_actions; };
|
||||
|
||||
|
||||
@ -268,7 +268,7 @@ void MxMediaPresenter::Enable(MxBool p_enable)
|
||||
|
||||
if (p_enable) {
|
||||
MxLong time = Timer()->GetTime();
|
||||
m_action->SetUnkTimingField(time);
|
||||
m_action->SetUnknown90(time);
|
||||
SetTickleState(TickleState_Repeating);
|
||||
}
|
||||
else {
|
||||
|
||||
@ -9,13 +9,13 @@ DECOMP_SIZE_ASSERT(MxStreamController, 0x64)
|
||||
DECOMP_SIZE_ASSERT(MxNextActionDataStart, 0x14)
|
||||
|
||||
// FUNCTION: LEGO1 0x100b9400
|
||||
MxResult MxStreamController::VTable0x18(undefined4 p_unknown, undefined4 p_unknown2)
|
||||
MxResult MxStreamController::VTable0x18(undefined4, undefined4)
|
||||
{
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b9410
|
||||
MxResult MxStreamController::vtable0x1C(undefined4 p_unknown, undefined4 p_unknown2)
|
||||
MxResult MxStreamController::vtable0x1C(undefined4, undefined4)
|
||||
{
|
||||
return FAILURE;
|
||||
}
|
||||
@ -163,11 +163,11 @@ MxResult MxStreamController::VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100c1ce0
|
||||
MxResult MxStreamController::VTable0x30(MxDSAction* p_unknown)
|
||||
MxResult MxStreamController::VTable0x30(MxDSAction* p_action)
|
||||
{
|
||||
MxAutoLocker locker(&m_criticalSection);
|
||||
MxResult result = FAILURE;
|
||||
MxDSAction* action = m_unk0xList0x3c.Find(p_unknown, TRUE);
|
||||
MxDSAction* action = m_unk0xList0x3c.Find(p_action, TRUE);
|
||||
if (action != NULL) {
|
||||
MxNextActionDataStart* data = m_nextActionList.Find(action->GetObjectId(), action->GetUnknown24());
|
||||
delete action;
|
||||
|
||||
@ -36,12 +36,12 @@ class MxStreamController : public MxCore {
|
||||
virtual MxResult VTable0x18(undefined4 p_unknown, undefined4 p_unknown2); // vtable+0x18
|
||||
virtual MxResult vtable0x1C(undefined4 p_unknown, undefined4 p_unknown2); // vtable+0x1c
|
||||
virtual MxResult VTable0x20(MxDSAction* p_action); // vtable+0x20
|
||||
virtual MxResult VTable0x24(MxDSAction* p_unknown); // vtable+0x24
|
||||
MxResult FUN_100c1800(MxDSAction* p_action, MxU32 p_val);
|
||||
virtual MxResult VTable0x28(); // vtable+0x28
|
||||
virtual MxResult VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c
|
||||
virtual MxResult VTable0x30(MxDSAction* p_unknown); // vtable+0x30
|
||||
virtual MxResult VTable0x24(MxDSAction* p_action); // vtable+0x24
|
||||
virtual MxResult VTable0x28(); // vtable+0x28
|
||||
virtual MxResult VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c
|
||||
virtual MxResult VTable0x30(MxDSAction* p_action); // vtable+0x30
|
||||
|
||||
MxResult FUN_100c1800(MxDSAction* p_action, MxU32 p_val);
|
||||
MxBool FUN_100c20d0(MxDSObject& p_obj);
|
||||
MxResult FUN_100c1a00(MxDSAction* p_action, MxU32 p_bufferval);
|
||||
MxResult FUN_100c1f00(MxDSAction* p_action);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef MXTYPE_H
|
||||
#define MXTYPE_H
|
||||
#ifndef MXTYPES_H
|
||||
#define MXTYPES_H
|
||||
|
||||
typedef unsigned char MxU8;
|
||||
typedef signed char MxS8;
|
||||
@ -70,4 +70,4 @@ typedef union {
|
||||
// BYTE all; // ?
|
||||
} flag_bitfield;
|
||||
|
||||
#endif // MXTYPE_H
|
||||
#endif // MXTYPES_H
|
||||
|
||||
Loading…
Reference in New Issue
Block a user