Merge branch 'master' into psp

This commit is contained in:
VoxelTek 2025-07-29 13:55:42 +10:00
commit 8a89c9cfaf
141 changed files with 2266 additions and 1368 deletions

View File

@ -14,7 +14,7 @@ endif()
if (EMSCRIPTEN)
add_compile_options(-pthread)
add_link_options(-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=2gb -sUSE_PTHREADS=1 -sPROXY_TO_PTHREAD=1 -sOFFSCREENCANVAS_SUPPORT=1 -sPTHREAD_POOL_SIZE_STRICT=0 -sFORCE_FILESYSTEM=1 -sWASMFS=1 -sEXIT_RUNTIME=1)
add_link_options(-sUSE_WEBGL2=1 -sMIN_WEBGL_VERSION=2 -sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=2gb -sUSE_PTHREADS=1 -sPROXY_TO_PTHREAD=1 -sOFFSCREENCANVAS_SUPPORT=1 -sPTHREAD_POOL_SIZE_STRICT=0 -sFORCE_FILESYSTEM=1 -sWASMFS=1 -sEXIT_RUNTIME=1)
set(SDL_PTHREADS ON CACHE BOOL "Enable SDL pthreads" FORCE)
endif()
@ -184,6 +184,8 @@ target_include_directories(lego1 PUBLIC "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/L
target_link_libraries(lego1 PRIVATE SDL3::SDL3)
target_link_libraries(lego1 PUBLIC SDL3::Headers)
target_link_libraries(lego1 PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5>)
# Allow unconditional include of miniwin/miniwind3d.h
target_link_libraries(lego1 PRIVATE miniwin-headers)
if(WIN32)
set_property(TARGET lego1 PROPERTY PREFIX "")
endif()
@ -314,10 +316,10 @@ target_sources(lego1 PRIVATE
LEGO1/omni/src/common/mxcompositepresenter.cpp
LEGO1/omni/src/common/mxcore.cpp
LEGO1/omni/src/common/mxdebug.cpp
LEGO1/omni/src/common/mxmediamanager.cpp
LEGO1/omni/src/common/mxmediapresenter.cpp
LEGO1/omni/src/common/mxmisc.cpp
LEGO1/omni/src/common/mxobjectfactory.cpp
LEGO1/omni/src/common/mxpresentationmanager.cpp
LEGO1/omni/src/common/mxpresenter.cpp
LEGO1/omni/src/common/mxstring.cpp
LEGO1/omni/src/common/mxticklemanager.cpp
@ -468,9 +470,6 @@ target_sources(lego1 PRIVATE
LEGO1/lego/legoomni/src/race/raceskel.cpp
LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp
LEGO1/lego/legoomni/src/video/legoflctexturepresenter.cpp
LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp
LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp
LEGO1/lego/legoomni/src/video/legoloopinganimpresenter.cpp
LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp
LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp
LEGO1/lego/legoomni/src/video/legopartpresenter.cpp

View File

@ -13,6 +13,8 @@
#include <QKeyEvent>
#include <QMessageBox>
#include <QProcess>
#include <SDL3/SDL.h>
#include <cmath>
#include <mxdirectx/legodxinfo.h>
#include <ui_maindialog.h>
@ -54,15 +56,18 @@ CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent)
this,
&CMainDialog::OnRadiobuttonTextureHighQuality
);
connect(m_ui->windowedRadioButton, &QRadioButton::toggled, this, &CMainDialog::OnRadioWindowed);
connect(m_ui->fullscreenRadioButton, &QRadioButton::toggled, this, &CMainDialog::OnRadioFullscreen);
connect(m_ui->exFullscreenRadioButton, &QRadioButton::toggled, this, &CMainDialog::OnRadioExclusiveFullscreen);
connect(m_ui->devicesList, &QListWidget::currentRowChanged, this, &CMainDialog::OnList3DevicesSelectionChanged);
connect(m_ui->musicCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxMusic);
connect(m_ui->sound3DCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckbox3DSound);
connect(m_ui->fullscreenCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxFullscreen);
connect(m_ui->exclusiveFullscreenCheckbox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxExclusiveFullscreen);
connect(m_ui->rumbleCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxRumble);
connect(m_ui->textureCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxTexture);
connect(m_ui->touchComboBox, &QComboBox::currentIndexChanged, this, &CMainDialog::TouchControlsChanged);
connect(m_ui->transitionTypeComboBox, &QComboBox::currentIndexChanged, this, &CMainDialog::TransitionTypeChanged);
connect(m_ui->exFullResComboBox, &QComboBox::currentIndexChanged, this, &CMainDialog::ExclusiveResolutionChanged);
connect(m_ui->okButton, &QPushButton::clicked, this, &CMainDialog::accept);
connect(m_ui->cancelButton, &QPushButton::clicked, this, &CMainDialog::reject);
connect(m_ui->launchButton, &QPushButton::clicked, this, &CMainDialog::launch);
@ -81,6 +86,11 @@ CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent)
connect(m_ui->maxActorsSlider, &QSlider::valueChanged, this, &CMainDialog::MaxActorsChanged);
connect(m_ui->maxActorsSlider, &QSlider::sliderMoved, this, &CMainDialog::MaxActorsChanged);
connect(m_ui->msaaSlider, &QSlider::valueChanged, this, &CMainDialog::MSAAChanged);
connect(m_ui->msaaSlider, &QSlider::sliderMoved, this, &CMainDialog::MSAAChanged);
connect(m_ui->AFSlider, &QSlider::valueChanged, this, &CMainDialog::AFChanged);
connect(m_ui->AFSlider, &QSlider::sliderMoved, this, &CMainDialog::AFChanged);
connect(m_ui->aspectRatioComboBox, &QComboBox::currentIndexChanged, this, &CMainDialog::AspectRatioChanged);
connect(m_ui->xResSpinBox, &QSpinBox::valueChanged, this, &CMainDialog::XResChanged);
connect(m_ui->yResSpinBox, &QSpinBox::valueChanged, this, &CMainDialog::YResChanged);
@ -164,6 +174,23 @@ bool CMainDialog::OnInitDialog()
m_ui->maxActorsSlider->setValue(currentConfigApp->m_max_actors);
m_ui->maxActorsNum->setNum(currentConfigApp->m_max_actors);
m_ui->exFullResComboBox->clear();
int displayModeCount;
displayModes = SDL_GetFullscreenDisplayModes(SDL_GetPrimaryDisplay(), &displayModeCount);
for (int i = 0; i < displayModeCount; ++i) {
QString mode =
QString("%1x%2 @ %3Hz").arg(displayModes[i]->w).arg(displayModes[i]->h).arg(displayModes[i]->refresh_rate);
m_ui->exFullResComboBox->addItem(mode);
if ((displayModes[i]->w == currentConfigApp->m_exf_x_res) &&
(displayModes[i]->h == currentConfigApp->m_exf_y_res) &&
(displayModes[i]->refresh_rate == currentConfigApp->m_exf_fps)) {
m_ui->exFullResComboBox->setCurrentIndex(i);
}
}
UpdateInterface();
return true;
}
@ -258,18 +285,30 @@ void CMainDialog::UpdateInterface()
else {
m_ui->textureQualityHighRadioButton->setChecked(true);
}
if (currentConfigApp->m_exclusive_full_screen) {
m_ui->exFullscreenRadioButton->setChecked(true);
m_ui->resolutionBox->setEnabled(false);
m_ui->exFullResContainer->setEnabled(true);
}
else {
m_ui->resolutionBox->setEnabled(true);
m_ui->exFullResContainer->setEnabled(false);
if (currentConfigApp->m_full_screen) {
m_ui->fullscreenRadioButton->setChecked(true);
}
else {
m_ui->windowedRadioButton->setChecked(true);
}
}
m_ui->musicCheckBox->setChecked(currentConfigApp->m_music);
m_ui->fullscreenCheckBox->setChecked(currentConfigApp->m_full_screen);
m_ui->exclusiveFullscreenCheckbox->setEnabled(currentConfigApp->m_full_screen);
m_ui->exclusiveFullscreenCheckbox->setChecked(currentConfigApp->m_exclusive_full_screen);
m_ui->rumbleCheckBox->setChecked(currentConfigApp->m_haptic);
m_ui->touchComboBox->setCurrentIndex(currentConfigApp->m_touch_scheme);
m_ui->transitionTypeComboBox->setCurrentIndex(currentConfigApp->m_transition_type);
m_ui->dataPath->setText(QString::fromStdString(currentConfigApp->m_cd_path));
m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path));
m_ui->textureCheckBox->setChecked(currentConfigApp->m_texture_load);
m_ui->texturePath->setText(QString::fromStdString(currentConfigApp->m_texture_path));
m_ui->texturePath->setEnabled(currentConfigApp->m_texture_load);
m_ui->texturePathOpen->setEnabled(currentConfigApp->m_texture_load);
@ -277,6 +316,15 @@ void CMainDialog::UpdateInterface()
m_ui->xResSpinBox->setValue(currentConfigApp->m_x_res);
m_ui->yResSpinBox->setValue(currentConfigApp->m_y_res);
m_ui->framerateSpinBox->setValue(static_cast<int>(std::round(1000.0f / currentConfigApp->m_frame_delta)));
m_ui->maxLoDSlider->setValue((int) (currentConfigApp->m_max_lod * 10));
m_ui->LoDNum->setNum(currentConfigApp->m_max_lod);
m_ui->maxActorsSlider->setValue(currentConfigApp->m_max_actors);
m_ui->maxActorsNum->setNum(currentConfigApp->m_max_actors);
m_ui->msaaSlider->setValue(log2(currentConfigApp->m_msaa));
m_ui->msaaNum->setNum(currentConfigApp->m_msaa);
m_ui->AFSlider->setValue(log2(currentConfigApp->m_anisotropy));
m_ui->AFNum->setNum(currentConfigApp->m_anisotropy);
}
// FUNCTION: CONFIG 0x004045e0
@ -336,6 +384,42 @@ void CMainDialog::OnRadiobuttonTextureHighQuality(bool checked)
}
}
void CMainDialog::OnRadioWindowed(bool checked)
{
if (checked) {
currentConfigApp->m_full_screen = false;
currentConfigApp->m_exclusive_full_screen = false;
m_ui->resolutionBox->setEnabled(true);
m_ui->exFullResContainer->setEnabled(false);
m_modified = true;
UpdateInterface();
}
}
void CMainDialog::OnRadioFullscreen(bool checked)
{
if (checked) {
currentConfigApp->m_full_screen = true;
currentConfigApp->m_exclusive_full_screen = false;
m_ui->resolutionBox->setEnabled(true);
m_ui->exFullResContainer->setEnabled(false);
m_modified = true;
UpdateInterface();
}
}
void CMainDialog::OnRadioExclusiveFullscreen(bool checked)
{
if (checked) {
currentConfigApp->m_full_screen = true;
currentConfigApp->m_exclusive_full_screen = true;
m_ui->resolutionBox->setEnabled(false);
m_ui->exFullResContainer->setEnabled(true);
m_modified = true;
UpdateInterface();
}
}
// FUNCTION: CONFIG 0x004048c0
void CMainDialog::OnCheckboxMusic(bool checked)
{
@ -344,21 +428,6 @@ void CMainDialog::OnCheckboxMusic(bool checked)
UpdateInterface();
}
void CMainDialog::OnCheckboxFullscreen(bool checked)
{
currentConfigApp->m_full_screen = checked;
m_ui->exclusiveFullscreenCheckbox->setEnabled(checked);
m_modified = true;
UpdateInterface();
}
void CMainDialog::OnCheckboxExclusiveFullscreen(bool checked)
{
currentConfigApp->m_exclusive_full_screen = checked;
m_modified = true;
UpdateInterface();
}
void CMainDialog::OnCheckboxRumble(bool checked)
{
currentConfigApp->m_haptic = checked;
@ -387,6 +456,15 @@ void CMainDialog::TransitionTypeChanged(int index)
UpdateInterface();
}
void CMainDialog::ExclusiveResolutionChanged(int index)
{
currentConfigApp->m_exf_x_res = displayModes[index]->w;
currentConfigApp->m_exf_y_res = displayModes[index]->h;
currentConfigApp->m_exf_fps = displayModes[index]->refresh_rate;
m_modified = true;
UpdateInterface();
}
void CMainDialog::SelectDataPathDialog()
{
QString data_path = QString::fromStdString(currentConfigApp->m_cd_path);
@ -458,15 +536,29 @@ void CMainDialog::SavePathEdited()
void CMainDialog::MaxLoDChanged(int value)
{
currentConfigApp->m_max_lod = static_cast<float>(value) / 10.0f;
m_ui->LoDNum->setNum(value);
m_modified = true;
UpdateInterface();
}
void CMainDialog::MaxActorsChanged(int value)
{
currentConfigApp->m_max_actors = value;
m_ui->maxActorsNum->setNum(value);
m_modified = true;
UpdateInterface();
}
void CMainDialog::MSAAChanged(int value)
{
currentConfigApp->m_msaa = exp2(value);
m_modified = true;
UpdateInterface();
}
void CMainDialog::AFChanged(int value)
{
currentConfigApp->m_anisotropy = exp2(value);
m_modified = true;
UpdateInterface();
}
void CMainDialog::SelectTexturePathDialog()

View File

@ -7,6 +7,7 @@
#include <QDialog>
#include <QFileDialog>
#include <SDL3/SDL.h>
namespace Ui
{
@ -29,6 +30,7 @@ class CMainDialog : public QDialog {
bool m_modified = false;
bool m_advanced = false;
Ui::MainDialog* m_ui = nullptr;
SDL_DisplayMode** displayModes;
void keyReleaseEvent(QKeyEvent* event) override;
bool OnInitDialog();
@ -40,13 +42,15 @@ private slots:
void OnRadiobuttonModelHighQuality(bool checked);
void OnRadiobuttonTextureLowQuality(bool checked);
void OnRadiobuttonTextureHighQuality(bool checked);
void OnRadioWindowed(bool checked);
void OnRadioFullscreen(bool checked);
void OnRadioExclusiveFullscreen(bool checked);
void OnCheckboxMusic(bool checked);
void OnCheckboxFullscreen(bool checked);
void OnCheckboxExclusiveFullscreen(bool checked);
void OnCheckboxRumble(bool checked);
void OnCheckboxTexture(bool checked);
void TouchControlsChanged(int index);
void TransitionTypeChanged(int index);
void ExclusiveResolutionChanged(int index);
void accept() override;
void reject() override;
void launch();
@ -56,6 +60,8 @@ private slots:
void SavePathEdited();
void MaxLoDChanged(int value);
void MaxActorsChanged(int value);
void MSAAChanged(int value);
void AFChanged(int value);
void SelectTexturePathDialog();
void TexturePathEdited();
void XResChanged(int i);

View File

@ -68,8 +68,9 @@ bool CConfigApp::InitInstance()
}
SDL_DestroyWindow(window);
m_aspect_ratio = 0;
m_x_res = 640;
m_y_res = 480;
m_exf_x_res = m_x_res = 640;
m_exf_y_res = m_y_res = 480;
m_exf_fps = 60.00f;
m_frame_delta = 10.0f;
m_driver = NULL;
m_device = NULL;
@ -83,6 +84,8 @@ bool CConfigApp::InitInstance()
m_3d_video_ram = FALSE;
m_joystick_index = -1;
m_display_bit_depth = 16;
m_msaa = 1;
m_anisotropy = 1;
m_haptic = TRUE;
m_touch_scheme = 2;
m_texture_load = TRUE;
@ -181,11 +184,16 @@ bool CConfigApp::ReadRegisterSettings()
m_joystick_index = iniparser_getint(dict, "isle:JoystickIndex", m_joystick_index);
m_max_lod = iniparser_getdouble(dict, "isle:Max LOD", m_max_lod);
m_max_actors = iniparser_getint(dict, "isle:Max Allowed Extras", m_max_actors);
m_msaa = iniparser_getint(dict, "isle:MSAA", m_msaa);
m_anisotropy = iniparser_getint(dict, "isle:Anisotropic", m_anisotropy);
m_texture_load = iniparser_getboolean(dict, "extensions:texture loader", m_texture_load);
m_texture_path = iniparser_getstring(dict, "texture loader:texture path", m_texture_path.c_str());
m_aspect_ratio = iniparser_getint(dict, "isle:Aspect Ratio", m_aspect_ratio);
m_x_res = iniparser_getint(dict, "isle:Horizontal Resolution", m_x_res);
m_y_res = iniparser_getint(dict, "isle:Vertical Resolution", m_y_res);
m_exf_x_res = iniparser_getint(dict, "isle:Exclusive X Resolution", m_exf_x_res);
m_exf_y_res = iniparser_getint(dict, "isle:Exclusive Y Resolution", m_exf_y_res);
m_exf_fps = iniparser_getdouble(dict, "isle:Exclusive Framerate", m_exf_fps);
m_frame_delta = iniparser_getdouble(dict, "isle:Frame Delta", m_frame_delta);
iniparser_freedict(dict);
return true;
@ -259,6 +267,34 @@ bool CConfigApp::ValidateSettings()
m_touch_scheme = 2;
is_modified = TRUE;
}
if (m_exclusive_full_screen && !m_full_screen) {
m_full_screen = TRUE;
is_modified = TRUE;
}
if (!(m_msaa & (m_msaa - 1))) { // Check if MSAA is power of 2 (1, 2, 4, 8, etc)
m_msaa = exp2(round(log2(m_msaa))); // Closest power of 2
is_modified = TRUE;
}
if (m_msaa > 16) {
m_msaa = 16;
is_modified = TRUE;
}
else if (m_msaa < 1) {
m_msaa = 1;
is_modified = TRUE;
}
if (!(m_anisotropy & (m_anisotropy - 1))) { // Check if anisotropy is power of 2 (1, 2, 4, 8, etc)
m_anisotropy = exp2(round(log2(m_anisotropy))); // Closest power of 2
is_modified = TRUE;
}
if (m_anisotropy > 16) {
m_anisotropy = 16;
is_modified = TRUE;
}
else if (m_anisotropy < 1) {
m_anisotropy = 1;
is_modified = TRUE;
}
return is_modified;
}
@ -337,6 +373,8 @@ void CConfigApp::WriteRegisterSettings() const
iniparser_set(dict, "isle:savepath", m_save_path.c_str());
SetIniInt(dict, "isle:Display Bit Depth", m_display_bit_depth);
SetIniInt(dict, "isle:MSAA", m_msaa);
SetIniInt(dict, "isle:Anisotropic", m_anisotropy);
SetIniBool(dict, "isle:Flip Surfaces", m_flip_surfaces);
SetIniBool(dict, "isle:Full Screen", m_full_screen);
SetIniBool(dict, "isle:Exclusive Full Screen", m_exclusive_full_screen);
@ -367,6 +405,9 @@ void CConfigApp::WriteRegisterSettings() const
SetIniInt(dict, "isle:Aspect Ratio", m_aspect_ratio);
SetIniInt(dict, "isle:Horizontal Resolution", m_x_res);
SetIniInt(dict, "isle:Vertical Resolution", m_y_res);
SetIniInt(dict, "isle:Exclusive X Resolution", m_exf_x_res);
SetIniInt(dict, "isle:Exclusive Y Resolution", m_exf_y_res);
iniparser_set(dict, "isle:Exclusive Framerate", std::to_string(m_exf_fps).c_str());
iniparser_set(dict, "isle:Frame Delta", std::to_string(m_frame_delta).c_str());
#undef SetIniBool

View File

@ -62,11 +62,16 @@ class CConfigApp {
int m_aspect_ratio;
int m_x_res;
int m_y_res;
int m_exf_x_res;
int m_exf_y_res;
float m_exf_fps;
float m_frame_delta;
LegoDeviceEnumerate* m_device_enumerator;
MxDriver* m_driver;
Direct3DDeviceInfo* m_device;
int m_display_bit_depth;
int m_msaa;
int m_anisotropy;
bool m_flip_surfaces;
bool m_full_screen;
bool m_exclusive_full_screen;

View File

@ -56,6 +56,9 @@
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>fullscreenRadioContainer_2</cstring>
</property>
</widget>
</item>
<item>
@ -353,12 +356,18 @@ A higher setting will cause higher quality textures to be drawn regardless of di
</property>
<property name="minimumSize">
<size>
<width>15</width>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>35</string>
<string>3.5</string>
</property>
</widget>
</item>
@ -533,10 +542,16 @@ The game will gradually increase the number of actors until this maximum is reac
</property>
<property name="minimumSize">
<size>
<width>15</width>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>20</string>
</property>
@ -602,8 +617,59 @@ The game will gradually increase the number of actors until this maximum is reac
<property name="title">
<string>General</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QWidget" name="fullscreenRadioContainer_2" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Windowed:&lt;/span&gt; Runs in a window, the initial resolution of which is dictated by Windowed Resolution. &lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Fullscreen:&lt;/span&gt; Runs in a borderless window that consumes the entire screen. &lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Exclusive Fullscreen:&lt;/span&gt; Grants the app full control of the display for better performance and lower input lag. May cause slower alt-tabbing.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<layout class="QVBoxLayout" name="fullscreenRadioContainer">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QRadioButton" name="windowedRadioButton">
<property name="text">
<string>Windowed</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="fullscreenRadioButton">
<property name="text">
<string>Fullscreen</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="exFullscreenRadioButton">
<property name="text">
<string>Exclusive Fullscreen</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QSpinBox" name="framerateSpinBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Maximum framerate. Values above 100fps are untested.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@ -622,33 +688,6 @@ The game will gradually increase the number of actors until this maximum is reac
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="fullscreenCheckboxContainer">
<item>
<widget class="QCheckBox" name="fullscreenCheckBox">
<property name="toolTip">
<string>Toggle fullscreen display mode.</string>
</property>
<property name="text">
<string>Fullscreen</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="exclusiveFullscreenCheckbox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Grants the app full control of the display for better performance and lower input lag. May cause slower alt-tabbing.</string>
</property>
<property name="text">
<string>Exclusive Fullscreen</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@ -765,17 +804,135 @@ The game will gradually increase the number of actors until this maximum is reac
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
<widget class="QGroupBox" name="exFullResContainer">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="title">
<string>Exclusive Fullscreen Resolution</string>
</property>
</spacer>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QComboBox" name="exFullResComboBox">
<property name="placeholderText">
<string>Resolution</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="msaaAFBox" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="msaaBox">
<property name="title">
<string>MSAA</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QSlider" name="msaaSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TickPosition::TicksBothSides</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="msaaNum">
<property name="minimumSize">
<size>
<width>16</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="AFBox">
<property name="title">
<string>Anisotropic Filtering</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QSlider" name="AFSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TickPosition::TicksBothSides</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="AFNum">
<property name="minimumSize">
<size>
<width>16</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
@ -860,7 +1017,7 @@ The game will gradually increase the number of actors until this maximum is reac
<string>Settings for Texture Loader extension.</string>
</property>
<property name="title">
<string>Texture Loader Extension</string>
<string>Texture Loader</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
@ -1007,12 +1164,16 @@ The game will gradually increase the number of actors until this maximum is reac
<tabstop>maxLoDSlider</tabstop>
<tabstop>maxActorsSlider</tabstop>
<tabstop>devicesList</tabstop>
<tabstop>fullscreenCheckBox</tabstop>
<tabstop>exclusiveFullscreenCheckbox</tabstop>
<tabstop>windowedRadioButton</tabstop>
<tabstop>fullscreenRadioButton</tabstop>
<tabstop>exFullscreenRadioButton</tabstop>
<tabstop>framerateSpinBox</tabstop>
<tabstop>aspectRatioComboBox</tabstop>
<tabstop>xResSpinBox</tabstop>
<tabstop>yResSpinBox</tabstop>
<tabstop>exFullResComboBox</tabstop>
<tabstop>msaaSlider</tabstop>
<tabstop>AFSlider</tabstop>
<tabstop>touchComboBox</tabstop>
<tabstop>rumbleCheckBox</tabstop>
<tabstop>textureCheckBox</tabstop>

View File

@ -36,3 +36,11 @@ void Emscripten_SendPresenterProgress(MxDSAction* p_action, MxPresenter::TickleS
Emscripten_SendEvent("presenterProgress", buf);
}
void Emscripten_SendExtensionProgress(const char* p_extension, MxU32 p_progress)
{
char buf[128];
SDL_snprintf(buf, sizeof(buf), "{\"name\": \"%s\", \"progress\": %d}", p_extension, p_progress);
Emscripten_SendEvent("extensionProgress", buf);
}

View File

@ -4,5 +4,6 @@
#include "mxpresenter.h"
void Emscripten_SendPresenterProgress(MxDSAction* p_action, MxPresenter::TickleState p_tickleState);
void Emscripten_SendExtensionProgress(const char* p_extension, MxU32 p_progress);
#endif // EMSCRIPTEN_EVENTS_H

View File

@ -1,5 +1,7 @@
#include "filesystem.h"
#include "events.h"
#include "extensions/textureloader.h"
#include "legogamestate.h"
#include "misc.h"
#include "mxomni.h"
@ -13,6 +15,7 @@ static backend_t opfs = nullptr;
static backend_t fetchfs = nullptr;
extern const char* g_files[46];
extern const char* g_textures[120];
bool Emscripten_OPFSDisabled()
{
@ -41,7 +44,7 @@ bool Emscripten_SetupConfig(const char* p_iniConfig)
void Emscripten_SetupFilesystem()
{
fetchfs = wasmfs_create_fetch_backend((MxString(Emscripten_streamHost) + MxString("/LEGO")).GetData(), 512 * 1024);
fetchfs = wasmfs_create_fetch_backend((MxString(Emscripten_streamHost) + "/LEGO").GetData(), 512 * 1024);
wasmfs_create_directory("/LEGO", 0644, fetchfs);
wasmfs_create_directory("/LEGO/Scripts", 0644, fetchfs);
@ -71,10 +74,41 @@ void Emscripten_SetupFilesystem()
}
};
const auto preloadFile = [](const char* p_path) -> bool {
size_t length = 0;
void* data = SDL_LoadFile(p_path, &length);
if (data) {
SDL_free(data);
}
return length > 0;
};
for (const char* file : g_files) {
registerFile(file);
}
#ifdef EXTENSIONS
if (Extensions::TextureLoader::enabled) {
MxString directory =
MxString("/LEGO") + Extensions::TextureLoader::options["texture loader:texture path"].c_str();
Extensions::TextureLoader::options["texture loader:texture path"] = directory.GetData();
wasmfs_create_directory(directory.GetData(), 0644, fetchfs);
MxU32 i = 0;
Emscripten_SendExtensionProgress("HD Textures", 0);
for (const char* file : g_textures) {
MxString path = directory + "/" + file + ".bmp";
registerFile(path.GetData());
if (!preloadFile(path.GetData())) {
Extensions::TextureLoader::excludedFiles.emplace_back(file);
}
Emscripten_SendExtensionProgress("HD Textures", (++i * 100) / sizeOfArray(g_textures));
}
}
#endif
if (GameState()->GetSavePath() && *GameState()->GetSavePath() && !Emscripten_OPFSDisabled()) {
if (!opfs) {
opfs = wasmfs_create_opfs_backend();

View File

@ -84,7 +84,8 @@ void Emscripten_ConvertEventToRenderCoordinates(SDL_Event* event)
}
case SDL_EVENT_FINGER_MOTION:
case SDL_EVENT_FINGER_DOWN:
case SDL_EVENT_FINGER_UP: {
case SDL_EVENT_FINGER_UP:
case SDL_EVENT_FINGER_CANCELED: {
const float scale = std::min(g_fullWidth / g_targetWidth, g_fullHeight / g_targetHeight);
const float widthRatio = (g_targetWidth * scale) / g_fullWidth;
const float heightRatio = (g_targetHeight * scale) / g_fullHeight;

View File

@ -185,8 +185,13 @@ IsleApp::IsleApp()
m_haptic = TRUE;
m_xRes = 640;
m_yRes = 480;
m_exclusiveXRes = m_xRes;
m_exclusiveYRes = m_yRes;
m_exclusiveFrameRate = 60.00f;
m_frameRate = 100.0f;
m_exclusiveFullScreen = FALSE;
m_msaaSamples = 0;
m_anisotropic = 0.0f;
}
// FUNCTION: ISLE 0x4011a0
@ -291,7 +296,7 @@ void IsleApp::SetupVideoFlags(
m_videoParam.Flags().SetLacksLightSupport(!hasLightSupport);
m_videoParam.Flags().SetF1bit7(param_7);
m_videoParam.Flags().SetWideViewAngle(wideViewAngle);
m_videoParam.Flags().SetF2bit1(1);
m_videoParam.Flags().SetEnabled(TRUE);
m_videoParam.SetDeviceName(deviceId);
if (using8bit) {
m_videoParam.Flags().Set16Bit(0);
@ -468,6 +473,7 @@ SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
case SDL_EVENT_FINGER_MOTION:
case SDL_EVENT_FINGER_DOWN:
case SDL_EVENT_FINGER_UP:
case SDL_EVENT_FINGER_CANCELED:
IDirect3DRMMiniwinDevice* device = GetD3DRMMiniwinDevice();
if (device && !device->ConvertEventToRenderCoordinates(event)) {
SDL_Log("Failed to convert event coordinates: %s", SDL_GetError());
@ -762,7 +768,8 @@ SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
);
}
break;
case SDL_EVENT_FINGER_UP: {
case SDL_EVENT_FINGER_UP:
case SDL_EVENT_FINGER_CANCELED: {
g_mousedown = FALSE;
float x = SDL_clamp(event->tfinger.x, 0, 1) * g_targetWidth;
@ -919,11 +926,19 @@ MxResult IsleApp::SetupWindow()
#endif
window = SDL_CreateWindowWithProperties(props);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), ISLE_PROP_WINDOW_CREATE_VIDEO_PARAM, &m_videoParam);
if (m_exclusiveFullScreen && m_fullScreen) {
SDL_DisplayMode closestMode;
SDL_DisplayID displayID = SDL_GetDisplayForWindow(window);
if (SDL_GetClosestFullscreenDisplayMode(displayID, m_xRes, m_yRes, m_frameRate, true, &closestMode)) {
if (SDL_GetClosestFullscreenDisplayMode(
displayID,
m_exclusiveXRes,
m_exclusiveYRes,
m_exclusiveFrameRate,
true,
&closestMode
)) {
SDL_SetWindowFullscreenMode(window, &closestMode);
}
}
@ -1101,6 +1116,9 @@ bool IsleApp::LoadConfig()
iniparser_set(dict, "isle:Haptic", m_haptic ? "true" : "false");
iniparser_set(dict, "isle:Horizontal Resolution", SDL_itoa(m_xRes, buf, 10));
iniparser_set(dict, "isle:Vertical Resolution", SDL_itoa(m_yRes, buf, 10));
iniparser_set(dict, "isle:Exclusive X Resolution", SDL_itoa(m_exclusiveXRes, buf, 10));
iniparser_set(dict, "isle:Exclusive Y Resolution", SDL_itoa(m_exclusiveYRes, buf, 10));
iniparser_set(dict, "isle:Exclusive Framerate", SDL_itoa(m_exclusiveFrameRate, buf, 10));
iniparser_set(dict, "isle:Frame Delta", SDL_itoa(m_frameDelta, buf, 10));
#ifdef EXTENSIONS
@ -1175,11 +1193,16 @@ bool IsleApp::LoadConfig()
m_haptic = iniparser_getboolean(dict, "isle:Haptic", m_haptic);
m_xRes = iniparser_getint(dict, "isle:Horizontal Resolution", m_xRes);
m_yRes = iniparser_getint(dict, "isle:Vertical Resolution", m_yRes);
m_exclusiveXRes = iniparser_getint(dict, "isle:Exclusive X Resolution", m_exclusiveXRes);
m_exclusiveYRes = iniparser_getint(dict, "isle:Exclusive Y Resolution", m_exclusiveXRes);
m_exclusiveFrameRate = iniparser_getdouble(dict, "isle:Exclusive Framerate", m_exclusiveFrameRate);
if (!m_fullScreen) {
m_videoParam.GetRect() = MxRect32(0, 0, (m_xRes - 1), (m_yRes - 1));
}
m_frameRate = (1000.0f / iniparser_getdouble(dict, "isle:Frame Delta", m_frameDelta));
m_frameDelta = static_cast<int>(std::round(iniparser_getdouble(dict, "isle:Frame Delta", m_frameDelta)));
m_videoParam.SetMSAASamples((m_msaaSamples = iniparser_getint(dict, "isle:MSAA", m_msaaSamples)));
m_videoParam.SetAnisotropic((m_anisotropic = iniparser_getdouble(dict, "isle:Anisotropic", m_anisotropic)));
const char* deviceId = iniparser_getstring(dict, "isle:3D Device ID", NULL);
if (deviceId != NULL) {

View File

@ -109,8 +109,13 @@ class IsleApp {
MxBool m_haptic;
MxS32 m_xRes;
MxS32 m_yRes;
MxS32 m_exclusiveXRes;
MxS32 m_exclusiveYRes;
MxFloat m_exclusiveFrameRate;
MxFloat m_frameRate;
MxBool m_exclusiveFullScreen;
MxU32 m_msaaSamples;
MxFloat m_anisotropic;
};
extern IsleApp* g_isle;

View File

@ -46,3 +46,24 @@ const char* g_files[46] = {
"/LEGO/data/WORLD.WDB",
"/LEGO/data/testinf.dta",
};
const char* g_textures[120] = {
"bank01.gif", "beach.gif", "black.gif", "bowtie.gif", "brela_01.gif", "bth1chst.gif", "bth2chst.gif",
"capch.gif", "capdb.gif", "capjs.gif", "capmd.gif", "caprc.gif", "cave_24x.gif", "caverocx.gif",
"caverokx.gif", "cheker01.gif", "construct.gif", "copchest.gif", "dbfrfn.gif", "doctor.gif", "dogface.gif",
"dummy.gif", "e.gif", "flowers.gif", "fruit.gif", "gasroad.gif", "gdface.gif", "g.gif",
"grassx.gif", "infochst.gif", "infoface.gif", "jailpad.gif", "jfrnt.gif", "jsfrnt4.gif", "jsfrnt.gif",
"jside.gif", "jswnsh5.gif", "jswnsh.gif", "l6.gif", "l.gif", "mamachst.gif", "mamaface.gif",
"mamamap.gif", "mech.gif", "medic01.gif", "mitesx.gif", "mustache.gif", "nickchst.gif", "nickface.gif",
"nickmap.gif", "nopizza.gif", "norachst.gif", "noraface.gif", "noramap.gif", "nwcurve.gif", "octan01.gif",
"octsq01.gif", "o.gif", "papachst.gif", "papaface.gif", "papamap.gif", "pebblesx.gif", "pepperha.gif",
"peppizza.gif", "peppmap.gif", "peprchst.gif", "peprface.gif", "pianokys.gif", "pizcurve.gif", "pizza01.gif",
"pizza.gif", "polbar01.gif", "polbla01.gif", "polkadot.gif", "polwhi01.gif", "postchst.gif", "post.gif",
"rac1chst.gif", "rac2chst.gif", "radar.gif", "raddis01.gif", "rcback.gif", "rc-butn.gif", "rcfrnt5.gif",
"rcfrnt6.gif", "rcfrnt7.gif", "rcfrnt.gif", "rcside1.gif", "rcside2.gif", "rcside3.gif", "rctail.gif",
"redskul.gif", "relrel01.gif", "road1way.gif", "road3wa2.gif", "road3wa3.gif", "road3way.gif", "road4way.gif",
"roadstr8.gif", "rockx.gif", "roofpiz.gif", "sandredx.gif", "se_curve.gif", "shftchst.gif", "shftface2.gif",
"shftface.gif", "shldwn02.gif", "skull.gif", "smile.gif", "smileshd.gif", "supr2_01.gif", "tightcrv.gif",
"unkchst.gif", "val_02.gif", "vest.gif", "water2x.gif", "w_curve.gif", "wnbars.gif", "woman.gif",
"womanshd.gif"
};

View File

@ -211,7 +211,7 @@ class Ambulance : public IslePathActor {
MxS16 m_atPoliceTask; // 0x16c
MxS16 m_atBeachTask; // 0x16e
MxS16 m_taskState; // 0x170
MxS16 m_unk0x172; // 0x172
MxS16 m_enableRandomAudio; // 0x172
IsleScript::Script m_lastAction; // 0x174
IsleScript::Script m_lastAnimation; // 0x178
MxFloat m_fuel; // 0x17c

View File

@ -304,4 +304,7 @@ class LegoAnimationManager : public MxCore {
// TEMPLATE: LEGO1 0x10061750
// MxListCursor<LegoTranInfo *>::MxListCursor<LegoTranInfo *>
// TEMPLATE: BETA10 0x1004b5d0
// MxListCursor<LegoTranInfo *>::Next
#endif // LEGOANIMATIONMANAGER_H

View File

@ -2,6 +2,7 @@
#define LEGOANIMPRESENTER_H
#include "legoroilist.h"
#include "legoroimaplist.h"
#include "mxatom.h"
#include "mxvideopresenter.h"
@ -147,14 +148,191 @@ class LegoAnimPresenter : public MxVideoPresenter {
MxS16 m_unk0x9c; // 0x9c
Matrix4* m_unk0xa0; // 0xa0
// SYNTHETIC: LEGO1 0x10068650
// LegoAnimPresenter::`scalar deleting destructor'
public:
float m_unk0xa4; // 0xa4
Mx3DPointFloat m_unk0xa8; // 0xa8
};
// VTABLE: LEGO1 0x100d4900
// SIZE 0xc0
class LegoLoopingAnimPresenter : public LegoAnimPresenter {
public:
// FUNCTION: BETA10 0x1005c6f0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f0700
return "LegoLoopingAnimPresenter";
}
// FUNCTION: LEGO1 0x1000c9a0
// FUNCTION: BETA10 0x1005c6c0
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1000c9b0
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
}
void StreamingTickle() override; // vtable+0x20
void PutFrame() override; // vtable+0x6c
// SYNTHETIC: LEGO1 0x1006d000
// LegoLoopingAnimPresenter::~LegoLoopingAnimPresenter
// SYNTHETIC: LEGO1 0x1000f440
// LegoLoopingAnimPresenter::`scalar deleting destructor'
private:
undefined4 m_unk0xbc; // 0xbc
};
class LegoAnimActor;
// VTABLE: LEGO1 0x100d9170
// SIZE 0xd8
class LegoLocomotionAnimPresenter : public LegoLoopingAnimPresenter {
public:
LegoLocomotionAnimPresenter();
~LegoLocomotionAnimPresenter() override;
// FUNCTION: BETA10 0x1005c4e0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f06e4
return "LegoLocomotionAnimPresenter";
}
// FUNCTION: LEGO1 0x1006ce50
// FUNCTION: BETA10 0x1005c4b0
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1006ce60
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoLoopingAnimPresenter::IsA(p_name);
}
void ReadyTickle() override; // vtable+0x18
void StartingTickle() override; // vtable+0x1c
void StreamingTickle() override; // vtable+0x20
MxResult AddToManager() override; // vtable+0x34
void Destroy() override; // vtable+0x38
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
MxResult CreateAnim(MxStreamChunk* p_chunk) override; // vtable+0x88
void FUN_1006d680(LegoAnimActor* p_actor, MxFloat p_value);
void DecrementUnknown0xd4()
{
if (m_unk0xd4) {
--m_unk0xd4;
}
}
undefined2 GetUnknown0xd4() { return m_unk0xd4; }
// SYNTHETIC: LEGO1 0x1006cfe0
// LegoLocomotionAnimPresenter::`scalar deleting destructor'
private:
void Init();
void Destroy(MxBool p_fromDestructor);
undefined4 m_unk0xc0; // 0xc0
undefined4* m_unk0xc4; // 0xc4
LegoROIMapList* m_roiMapList; // 0xc8
MxS32 m_unk0xcc; // 0xcc
MxS32 m_unk0xd0; // 0xd0
undefined2 m_unk0xd4; // 0xd4
};
class LegoPathBoundary;
struct LegoHideAnimStructComparator {
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmp(p_a, p_b) < 0; }
};
// SIZE 0x08
struct LegoHideAnimStruct {
LegoPathBoundary* m_boundary; // 0x00
MxU32 m_index; // 0x04
};
typedef map<const char*, LegoHideAnimStruct, LegoHideAnimStructComparator> LegoHideAnimStructMap;
// VTABLE: LEGO1 0x100d9278
// SIZE 0xc4
class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
public:
LegoHideAnimPresenter();
~LegoHideAnimPresenter() override;
// FUNCTION: LEGO1 0x1006d860
void VTable0x8c() override {} // vtable+0x8c
// FUNCTION: LEGO1 0x1006d870
void VTable0x90() override {} // vtable+0x90
// FUNCTION: BETA10 0x1005d4a0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f06cc
return "LegoHideAnimPresenter";
}
// FUNCTION: LEGO1 0x1006d880
// FUNCTION: BETA10 0x1005d470
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1006d890
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
}
void ReadyTickle() override; // vtable+0x18
void StartingTickle() override; // vtable+0x18
MxResult AddToManager() override; // vtable+0x34
void Destroy() override; // vtable+0x38
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
void FUN_1006db40(LegoTime p_time);
// SYNTHETIC: LEGO1 0x1006d9d0
// LegoHideAnimPresenter::`scalar deleting destructor'
private:
void Init();
void Destroy(MxBool p_fromDestructor);
void FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time);
void FUN_1006dc10();
void FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node);
void FUN_1006e470(
LegoHideAnimStructMap& p_map,
LegoAnimNodeData* p_data,
const char* p_name,
LegoPathBoundary* p_boundary
);
LegoPathBoundary** m_boundaryMap; // 0xc0
};
// clang-format off
// SYNTHETIC: LEGO1 0x10068650
// LegoAnimPresenter::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x100689c0
// map<char const *,char const *,LegoAnimSubstComparator,allocator<char const *> >::~map<char const *,char const *,LegoAnimSubstComparator,allocator<char const *> >
@ -212,6 +390,33 @@ class LegoAnimPresenter : public MxVideoPresenter {
// GLOBAL: LEGO1 0x100f7688
// _Tree<char const *,pair<char const * const,LegoAnimStruct>,map<char const *,LegoAnimStruct,LegoAnimStructComparator,allocator<LegoAnimStruct> >::_Kfn,LegoAnimStructComparator,allocator<LegoAnimStruct> >::_Nil
// TEMPLATE: LEGO1 0x1006ddb0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~_Tree<char const *,pair<ch
// TEMPLATE: LEGO1 0x1006de80
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Inc
// TEMPLATE: LEGO1 0x1006dec0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::erase
// TEMPLATE: LEGO1 0x1006e310
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Erase
// TEMPLATE: LEGO1 0x1006e350
// Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>::~Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>
// TEMPLATE: LEGO1 0x1006e3a0
// map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >
// TEMPLATE: LEGO1 0x1006e6d0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Dec
// TEMPLATE: LEGO1 0x1006e720
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Insert
// GLOBAL: LEGO1 0x100f768c
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Nil
// clang-format on
#endif // LEGOANIMPRESENTER_H

View File

@ -48,10 +48,13 @@ typedef set<LegoCacheSoundEntry, Set100d6b4cComparator> Set100d6b4c;
typedef list<LegoCacheSoundEntry> List100d6b4c;
// VTABLE: LEGO1 0x100d6b4c
// VTABLE: BETA10 0x101becac
// SIZE 0x20
class LegoCacheSoundManager {
public:
// FUNCTION: BETA10 0x100d0a60
LegoCacheSoundManager() {}
~LegoCacheSoundManager();
virtual MxResult Tickle(); // vtable+0x00
@ -68,6 +71,9 @@ class LegoCacheSoundManager {
List100d6b4c m_list; // 0x14
};
// SYNTHETIC: BETA10 0x100d06b0
// LegoCacheSoundManager::`scalar deleting destructor'
// TODO: Function names subject to change.
// clang-format off

View File

@ -38,17 +38,17 @@ class LegoCameraController : public LegoPointOfViewController {
virtual MxResult Create(); // vtable+0x44
void SetWorldTransform(const Vector3& p_at, const Vector3& p_dir, const Vector3& p_up);
void FUN_10012290(float p_angle);
void FUN_10012320(float p_angle);
MxResult FUN_100123b0(Matrix4& p_matrix);
void FUN_100123e0(const Matrix4& p_transform, MxU32 p_und);
void RotateZ(float p_angle);
void RotateY(float p_angle);
MxResult GetPointOfView(Matrix4& p_matrix);
void TransformPointOfView(const Matrix4& p_transform, MxU32 p_multiply);
Mx3DPointFloat GetWorldUp();
Mx3DPointFloat GetWorldLocation();
Mx3DPointFloat GetWorldDirection();
private:
MxMatrix m_matrix1; // 0x38
MxMatrix m_matrix2; // 0x80
MxMatrix m_currentTransform; // 0x38
MxMatrix m_originalTransform; // 0x80
};
// SYNTHETIC: LEGO1 0x10011f50

View File

@ -48,6 +48,7 @@ struct LegoActorInfo;
typedef map<char*, LegoCharacter*, LegoCharacterComparator> LegoCharacterMap;
// VTABLE: LEGO1 0x100da878
// VTABLE: BETA10 0x101bc028
// SIZE 0x24
class CustomizeAnimFileVariable : public MxVariable {
public:

View File

@ -24,11 +24,11 @@ class LegoControlManagerNotificationParam : public LegoEventNotificationParam {
void SetClickedObjectId(MxS32 p_clickedObjectId) { m_clickedObjectId = p_clickedObjectId; }
void SetClickedAtom(const char* p_clickedAtom) { m_clickedAtom = p_clickedAtom; }
void SetUnknown0x28(MxS16 p_unk0x28) { m_unk0x28 = p_unk0x28; }
void SetEnabledChild(MxS16 p_enabledChild) { m_enabledChild = p_enabledChild; }
MxS32 m_clickedObjectId; // 0x20
const char* m_clickedAtom; // 0x24
MxS16 m_unk0x28; // 0x28
MxS16 m_enabledChild; // 0x28
};
// SYNTHETIC: LEGO1 0x10028bf0

View File

@ -30,6 +30,7 @@ struct InternationalCharacter {
};
// VTABLE: LEGO1 0x100d74a8
// VTABLE: BETA10 0x101bc4f0
// SIZE 0x30
class LegoBackgroundColor : public MxVariable {
public:
@ -50,9 +51,11 @@ class LegoBackgroundColor : public MxVariable {
};
// VTABLE: LEGO1 0x100d74b8
// VTABLE: BETA10 0x101bc500
// SIZE 0x24
class LegoFullScreenMovie : public MxVariable {
public:
LegoFullScreenMovie();
LegoFullScreenMovie(const char* p_key, const char* p_value);
void SetValue(const char* p_option) override; // vtable+0x04
@ -110,19 +113,19 @@ class LegoGameState {
e_dunecarbuild,
e_jetskibuild,
e_racecarbuild,
e_unk40,
e_helicopterSpawn,
e_unk41,
e_unk42,
e_unk43,
e_unk44,
e_unk45,
e_dunebuggySpawn,
e_racecarSpawn,
e_jetskiSpawn,
e_act2main,
e_act3script,
e_unk48,
e_unk49,
e_unk50,
e_unk51,
e_unk52,
e_towTrackHookedUp,
e_jukeboxw,
e_jukeboxExterior,
e_unk55,

View File

@ -1,111 +0,0 @@
#ifndef LEGOHIDEANIMPRESENTER_H
#define LEGOHIDEANIMPRESENTER_H
#include "decomp.h"
#include "legoloopinganimpresenter.h"
class LegoPathBoundary;
struct LegoHideAnimStructComparator {
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmp(p_a, p_b) < 0; }
};
// SIZE 0x08
struct LegoHideAnimStruct {
LegoPathBoundary* m_boundary; // 0x00
MxU32 m_index; // 0x04
};
typedef map<const char*, LegoHideAnimStruct, LegoHideAnimStructComparator> LegoHideAnimStructMap;
// VTABLE: LEGO1 0x100d9278
// SIZE 0xc4
class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
public:
LegoHideAnimPresenter();
~LegoHideAnimPresenter() override;
// FUNCTION: LEGO1 0x1006d860
void VTable0x8c() override {} // vtable+0x8c
// FUNCTION: LEGO1 0x1006d870
void VTable0x90() override {} // vtable+0x90
// FUNCTION: BETA10 0x1005d4a0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f06cc
return "LegoHideAnimPresenter";
}
// FUNCTION: LEGO1 0x1006d880
// FUNCTION: BETA10 0x1005d470
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1006d890
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
}
void ReadyTickle() override; // vtable+0x18
void StartingTickle() override; // vtable+0x18
MxResult AddToManager() override; // vtable+0x34
void Destroy() override; // vtable+0x38
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
void FUN_1006db40(LegoTime p_time);
private:
void Init();
void Destroy(MxBool p_fromDestructor);
void FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time);
void FUN_1006dc10();
void FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node);
void FUN_1006e470(
LegoHideAnimStructMap& p_map,
LegoAnimNodeData* p_data,
const char* p_name,
LegoPathBoundary* p_boundary
);
LegoPathBoundary** m_boundaryMap; // 0xc0
};
// clang-format off
// SYNTHETIC: LEGO1 0x1006d9d0
// LegoHideAnimPresenter::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x1006ddb0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~_Tree<char const *,pair<ch
// TEMPLATE: LEGO1 0x1006de80
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Inc
// TEMPLATE: LEGO1 0x1006dec0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::erase
// TEMPLATE: LEGO1 0x1006e310
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Erase
// TEMPLATE: LEGO1 0x1006e350
// Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>::~Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>
// TEMPLATE: LEGO1 0x1006e3a0
// map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >
// TEMPLATE: LEGO1 0x1006e6d0
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Dec
// TEMPLATE: LEGO1 0x1006e720
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Insert
// GLOBAL: LEGO1 0x100f768c
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Nil
// clang-format on
#endif // LEGOHIDEANIMPRESENTER_H

View File

@ -1,71 +0,0 @@
#ifndef LEGOLOCOMOTIONANIMPRESENTER_H
#define LEGOLOCOMOTIONANIMPRESENTER_H
#include "legoloopinganimpresenter.h"
#include "legoroimaplist.h"
class LegoAnimActor;
// VTABLE: LEGO1 0x100d9170
// SIZE 0xd8
class LegoLocomotionAnimPresenter : public LegoLoopingAnimPresenter {
public:
LegoLocomotionAnimPresenter();
~LegoLocomotionAnimPresenter() override;
// FUNCTION: BETA10 0x1005c4e0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f06e4
return "LegoLocomotionAnimPresenter";
}
// FUNCTION: LEGO1 0x1006ce50
// FUNCTION: BETA10 0x1005c4b0
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1006ce60
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoLoopingAnimPresenter::IsA(p_name);
}
void ReadyTickle() override; // vtable+0x18
void StartingTickle() override; // vtable+0x1c
void StreamingTickle() override; // vtable+0x20
MxResult AddToManager() override; // vtable+0x34
void Destroy() override; // vtable+0x38
void EndAction() override; // vtable+0x40
void PutFrame() override; // vtable+0x6c
MxResult CreateAnim(MxStreamChunk* p_chunk) override; // vtable+0x88
// SYNTHETIC: LEGO1 0x1006cfe0
// LegoLocomotionAnimPresenter::`scalar deleting destructor'
void FUN_1006d680(LegoAnimActor* p_actor, MxFloat p_value);
void DecrementUnknown0xd4()
{
if (m_unk0xd4) {
--m_unk0xd4;
}
}
undefined2 GetUnknown0xd4() { return m_unk0xd4; }
private:
void Init();
void Destroy(MxBool p_fromDestructor);
undefined4 m_unk0xc0; // 0xc0
undefined4* m_unk0xc4; // 0xc4
LegoROIMapList* m_roiMapList; // 0xc8
MxS32 m_unk0xcc; // 0xcc
MxS32 m_unk0xd0; // 0xd0
undefined2 m_unk0xd4; // 0xd4
};
#endif // LEGOLOCOMOTIONANIMPRESENTER_H

View File

@ -1,43 +0,0 @@
#ifndef LEGOLOOPINGANIMPRESENTER_H
#define LEGOLOOPINGANIMPRESENTER_H
#include "legoanimpresenter.h"
// VTABLE: LEGO1 0x100d4900
// SIZE 0xc0
class LegoLoopingAnimPresenter : public LegoAnimPresenter {
public:
// FUNCTION: BETA10 0x1005c6f0
static const char* HandlerClassName()
{
// STRING: LEGO1 0x100f0700
return "LegoLoopingAnimPresenter";
}
// FUNCTION: LEGO1 0x1000c9a0
// FUNCTION: BETA10 0x1005c6c0
const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
// FUNCTION: LEGO1 0x1000c9b0
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
}
void StreamingTickle() override; // vtable+0x20
void PutFrame() override; // vtable+0x6c
private:
undefined4 m_unk0xbc; // 0xbc
};
// SYNTHETIC: LEGO1 0x1006d000
// LegoLoopingAnimPresenter::~LegoLoopingAnimPresenter
// SYNTHETIC: LEGO1 0x1000f440
// LegoLoopingAnimPresenter::`scalar deleting destructor'
#endif // LEGOLOOPINGANIMPRESENTER_H

View File

@ -185,8 +185,8 @@ class LegoOmni : public MxOmni {
// FUNCTION: BETA10 0x100d55c0
void SetExit(MxBool p_exit) { m_exit = p_exit; }
MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction) { return m_unk0x13c ? Start(&p_dsAction) : SUCCESS; }
void SetUnknown13c(MxBool p_unk0x13c) { m_unk0x13c = p_unk0x13c; }
MxResult StartActionIfInitialized(MxDSAction& p_dsAction) { return m_initialized ? Start(&p_dsAction) : SUCCESS; }
void SetInitialized(MxBool p_unk0x13c) { m_initialized = p_unk0x13c; }
void CloseMainWindow()
{
@ -227,7 +227,7 @@ class LegoOmni : public MxOmni {
MxBool m_version10;
public:
MxBool m_unk0x13c; // 0x13c
MxBool m_initialized; // 0x13c
};
#endif // LEGOMAIN_H

View File

@ -17,15 +17,15 @@ class LegoSoundManager : public MxSoundManager {
void Destroy() override; // vtable+0x18
MxResult Create(MxU32 p_frequencyMS, MxBool p_createThread) override; // vtable+0x30
// SYNTHETIC: LEGO1 0x10029920
// SYNTHETIC: BETA10 0x100d0660
// LegoSoundManager::`scalar deleting destructor'
void UpdateListener(const float* p_position, const float* p_direction, const float* p_up, const float* p_velocity);
// FUNCTION: BETA10 0x1000f350
LegoCacheSoundManager* GetCacheSoundManager() { return m_cacheSoundManager; }
// SYNTHETIC: LEGO1 0x10029920
// SYNTHETIC: BETA10 0x100d0660
// LegoSoundManager::`scalar deleting destructor'
private:
void Init();
void Destroy(MxBool p_fromDestructor);

View File

@ -28,9 +28,11 @@ class LegoTranInfoList : public MxPtrList<LegoTranInfo> {
// class MxPtrListCursor<LegoTranInfo>
// VTABLE: LEGO1 0x100d8d20
// VTABLE: BETA10 0x101bad70
// SIZE 0x10
class LegoTranInfoListCursor : public MxPtrListCursor<LegoTranInfo> {
public:
// FUNCTION: BETA10 0x100496d0
LegoTranInfoListCursor(LegoTranInfoList* p_list) : MxPtrListCursor<LegoTranInfo>(p_list) {}
};
@ -62,9 +64,14 @@ class LegoTranInfoListCursor : public MxPtrListCursor<LegoTranInfo> {
// MxPtrList<LegoTranInfo>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100612f0
// SYNTHETIC: BETA10 0x100498c0
// LegoTranInfoListCursor::`scalar deleting destructor'
// SYNTHETIC: BETA10 0x10049770
// MxPtrListCursor<LegoTranInfo>::MxPtrListCursor<LegoTranInfo>
// FUNCTION: LEGO1 0x10061360
// FUNCTION: BETA10 0x10049910
// MxPtrListCursor<LegoTranInfo>::~MxPtrListCursor<LegoTranInfo>
// SYNTHETIC: LEGO1 0x100613b0
@ -77,6 +84,7 @@ class LegoTranInfoListCursor : public MxPtrListCursor<LegoTranInfo> {
// MxListCursor<LegoTranInfo *>::~MxListCursor<LegoTranInfo *>
// FUNCTION: LEGO1 0x100614e0
// FUNCTION: BETA10 0x10049ab0
// LegoTranInfoListCursor::~LegoTranInfoListCursor
#endif // LEGOTRANINFOLIST_H

View File

@ -17,41 +17,60 @@ extern const char* g_varVISIBILITY;
extern const char* g_varCAMERALOCATION;
extern const char* g_varCURSOR;
extern const char* g_varWHOAMI;
extern const char* g_varDEBUG;
// VTABLE: LEGO1 0x100d86c8
// VTABLE: BETA10 0x101bc980
// SIZE 0x24
class VisibilityVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x10093470
VisibilityVariable() { m_key = g_varVISIBILITY; }
void SetValue(const char* p_value) override; // vtable+0x04
};
// VTABLE: LEGO1 0x100d86b8
// VTABLE: BETA10 0x101bc990
// SIZE 0x24
class CameraLocationVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x10093510
CameraLocationVariable() { m_key = g_varCAMERALOCATION; }
void SetValue(const char* p_value) override; // vtable+0x04
};
// VTABLE: LEGO1 0x100d86a8
// VTABLE: BETA10 0x101bc9a0
// SIZE 0x24
class CursorVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x100935b0
CursorVariable() { m_key = g_varCURSOR; }
void SetValue(const char* p_value) override; // vtable+0x04
};
// VTABLE: LEGO1 0x100d8698
// VTABLE: BETA10 0x101bc9b0
// SIZE 0x24
class WhoAmIVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x10093650
WhoAmIVariable() { m_key = g_varWHOAMI; }
void SetValue(const char* p_value) override; // vtable+0x04
};
// VTABLE: BETA10 0x101bc9c0
// SIZE 0x24
class DebugVariable : public MxVariable {
public:
// FUNCTION: BETA10 0x100936f0
DebugVariable() { m_key = g_varDEBUG; }
void SetValue(const char* p_value) override; // vtable+0x04
};
#endif // LEGOVARIABLES_H

View File

@ -53,7 +53,7 @@ void Disable(MxBool p_disable, MxU16 p_flags);
LegoROI* FindROI(const char* p_name);
void SetROIVisible(const char* p_name, MxBool p_visible);
void SetUserActor(LegoPathActor* p_userActor);
MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction);
MxResult StartActionIfInitialized(MxDSAction& p_dsAction);
void DeleteAction();
LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid);
MxDSAction& GetCurrentAction();

View File

@ -4,9 +4,9 @@
#include "act3ammo.h"
#include "anim/legoanim.h"
#include "define.h"
#include "legoanimpresenter.h"
#include "legobuildingmanager.h"
#include "legocachesoundmanager.h"
#include "legolocomotionanimpresenter.h"
#include "legopathedgecontainer.h"
#include "legoplantmanager.h"
#include "legoplants.h"

View File

@ -44,7 +44,7 @@ Ambulance::Ambulance()
m_atBeachTask = 0;
m_taskState = Ambulance::e_none;
m_lastAction = IsleScript::c_noneIsle;
m_unk0x172 = 0;
m_enableRandomAudio = 0;
m_lastAnimation = IsleScript::c_noneIsle;
m_fuel = 1.0;
}
@ -176,7 +176,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
m_state->m_state = AmbulanceMissionState::e_enteredAmbulance;
CurrentWorld()->PlaceActor(UserActor());
HandleClick();
m_unk0x172 = 0;
m_enableRandomAudio = 0;
TickleManager()->RegisterClient(this, 40000);
}
else if (objectId == IsleScript::c_hpz047pe_RunAnim || objectId == IsleScript::c_hpz048pe_RunAnim || objectId == IsleScript::c_hpz049bd_RunAnim || objectId == IsleScript::c_hpz053pa_RunAnim) {
@ -201,7 +201,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
CurrentWorld()->PlaceActor(UserActor());
HandleClick();
SpawnPlayer(LegoGameState::e_pizzeriaExterior, TRUE, 0);
m_unk0x172 = 0;
m_enableRandomAudio = 0;
TickleManager()->RegisterClient(this, 40000);
if (m_atPoliceTask != 0) {
@ -225,7 +225,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
CurrentWorld()->PlaceActor(UserActor());
HandleClick();
SpawnPlayer(LegoGameState::e_policeExited, TRUE, 0);
m_unk0x172 = 0;
m_enableRandomAudio = 0;
TickleManager()->RegisterClient(this, 40000);
if (m_atBeachTask != 0) {
@ -440,7 +440,7 @@ MxLong Ambulance::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_AmbulanceArms_Ctl:
Exit();
@ -457,7 +457,7 @@ MxLong Ambulance::HandleControl(LegoControlManagerNotificationParam& p_param)
case IsleScript::c_AmbulanceHorn_Ctl:
MxSoundPresenter* presenter =
(MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "AmbulanceHorn_Sound");
presenter->Enable(p_param.m_unk0x28);
presenter->Enable(p_param.m_enabledChild);
break;
}
}
@ -516,8 +516,8 @@ void Ambulance::ActivateSceneActions()
// FUNCTION: BETA10 0x100237df
MxResult Ambulance::Tickle()
{
if (m_unk0x172 == 0) {
m_unk0x172 = 1;
if (m_enableRandomAudio == 0) {
m_enableRandomAudio = 1;
}
else if (m_lastAction == IsleScript::c_noneIsle) {
IsleScript::Script objectId;

View File

@ -81,7 +81,7 @@ MxLong Bike::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_BikeArms_Ctl:
Exit();
@ -97,7 +97,7 @@ MxLong Bike::HandleControl(LegoControlManagerNotificationParam& p_param)
case IsleScript::c_BikeHorn_Ctl:
MxSoundPresenter* presenter =
(MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "BikeHorn_Sound");
presenter->Enable(p_param.m_unk0x28);
presenter->Enable(p_param.m_enabledChild);
break;
}
}

View File

@ -124,7 +124,7 @@ MxLong DuneBuggy::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_DuneCarArms_Ctl:
Exit();
@ -140,7 +140,7 @@ MxLong DuneBuggy::HandleControl(LegoControlManagerNotificationParam& p_param)
case IsleScript::c_DuneCarHorn_Ctl:
MxSoundPresenter* presenter =
(MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "DuneCarHorn_Sound");
presenter->Enable(p_param.m_unk0x28);
presenter->Enable(p_param.m_enabledChild);
break;
}
}

View File

@ -82,7 +82,7 @@ void Helicopter::Exit()
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
SpawnPlayer(
LegoGameState::e_unk40,
LegoGameState::e_helicopterSpawn,
TRUE,
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
);
@ -189,7 +189,7 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
break;
}
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
MxU32 isPizza = FALSE;
switch (p_param.m_clickedObjectId) {
@ -426,7 +426,7 @@ void Helicopter::Animate(float p_time)
v2 *= f2;
v2 += v1;
m_world->GetCameraController()->FUN_100123e0(mat, 0);
m_world->GetCameraController()->TransformPointOfView(mat, 0);
}
else {
if (m_state->m_unk0x08 == 4) {
@ -459,7 +459,7 @@ void Helicopter::FUN_100042a0(const Matrix4& p_matrix)
// the typecast makes this function match for unknown reasons
Vector3 vec6((const float*) m_unk0x1a8[3]); // locala0 // esp+0x28
m_world->GetCameraController()->FUN_100123b0(local48);
m_world->GetCameraController()->GetPointOfView(local48);
m_unk0x1a8.SetIdentity();
local90 = p_matrix;

View File

@ -355,7 +355,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_PoliceStation_Music
);
g_spawnLocations[16] = SpawnLocation(
LegoGameState::e_unk40,
LegoGameState::e_helicopterSpawn,
g_isleScript,
0,
"edg02_51",
@ -379,7 +379,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_noneJukebox
);
g_spawnLocations[18] = SpawnLocation(
LegoGameState::e_unk43,
LegoGameState::e_dunebuggySpawn,
g_isleScript,
0,
"edg02_35",
@ -391,7 +391,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_noneJukebox
);
g_spawnLocations[19] = SpawnLocation(
LegoGameState::e_unk44,
LegoGameState::e_racecarSpawn,
g_isleScript,
0,
"EDG03_01",
@ -403,7 +403,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_noneJukebox
);
g_spawnLocations[20] = SpawnLocation(
LegoGameState::e_unk45,
LegoGameState::e_jetskiSpawn,
g_isleScript,
0,
"edg10_70",
@ -475,7 +475,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_noneJukebox
);
g_spawnLocations[26] = SpawnLocation(
LegoGameState::e_unk52,
LegoGameState::e_towTrackHookedUp,
g_isleScript,
0,
"edg02_19",

View File

@ -69,7 +69,7 @@ void Jetski::Animate(float p_time)
// FUNCTION: LEGO1 0x1007e6f0
void Jetski::Exit()
{
SpawnPlayer(LegoGameState::e_unk45, FALSE, c_spawnBit1 | c_playMusic | c_spawnBit3);
SpawnPlayer(LegoGameState::e_jetskiSpawn, FALSE, c_spawnBit1 | c_playMusic | c_spawnBit3);
IslePathActor::Exit();
GameState()->m_currentArea = LegoGameState::e_jetski;
RemoveFromWorld();
@ -139,7 +139,7 @@ void Jetski::RemoveFromWorld()
// FUNCTION: LEGO1 0x1007e8e0
MxLong Jetski::HandleControl(LegoControlManagerNotificationParam& p_param)
{
if (p_param.m_unk0x28 == 1 && CurrentWorld()->IsA("Isle")) {
if (p_param.m_enabledChild == 1 && CurrentWorld()->IsA("Isle")) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_JetskiArms_Ctl:
Exit();

View File

@ -117,7 +117,7 @@ MxLong Motocycle::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_MotoBikeArms_Ctl:
Exit();

View File

@ -110,7 +110,7 @@ MxLong SkateBoard::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxU32 result = 0;
if (p_param.m_unk0x28 == 1 && p_param.m_clickedObjectId == IsleScript::c_SkateArms_Ctl) {
if (p_param.m_enabledChild == 1 && p_param.m_clickedObjectId == IsleScript::c_SkateArms_Ctl) {
Exit();
GameState()->m_currentArea = LegoGameState::Area::e_vehicleExited;
result = 1;

View File

@ -434,7 +434,7 @@ MxLong TowTrack::HandleClick()
}
if (m_state->m_state == TowTrackMissionState::e_hookedUp) {
SpawnPlayer(LegoGameState::e_unk52, TRUE, 0);
SpawnPlayer(LegoGameState::e_towTrackHookedUp, TRUE, 0);
FindROI("rcred")->SetVisibility(FALSE);
}
else {
@ -485,7 +485,7 @@ MxLong TowTrack::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case IsleScript::c_TowTrackArms_Ctl:
Exit();
@ -501,7 +501,7 @@ MxLong TowTrack::HandleControl(LegoControlManagerNotificationParam& p_param)
break;
case IsleScript::c_TowHorn_Ctl:
MxSoundPresenter* presenter = (MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "TowHorn_Sound");
presenter->Enable(p_param.m_unk0x28);
presenter->Enable(p_param.m_enabledChild);
break;
}
}

View File

@ -7,6 +7,7 @@ DECOMP_SIZE_ASSERT(LegoCacheSoundEntry, 0x08)
DECOMP_SIZE_ASSERT(LegoCacheSoundManager, 0x20)
// FUNCTION: LEGO1 0x1003cf20
// STUB: BETA10 0x100d0700
LegoCacheSoundManager::~LegoCacheSoundManager()
{
LegoCacheSound* sound;
@ -28,6 +29,7 @@ LegoCacheSoundManager::~LegoCacheSoundManager()
}
// FUNCTION: LEGO1 0x1003d050
// STUB: BETA10 0x100652f0
MxResult LegoCacheSoundManager::Tickle()
{
#ifdef COMPAT_MODE

View File

@ -98,7 +98,7 @@ void LegoLoadCacheSoundPresenter::DoneTickle()
// FUNCTION: LEGO1 0x10018700
MxResult LegoLoadCacheSoundPresenter::PutData()
{
m_criticalSection.Enter();
ENTER(m_criticalSection);
if (m_currentTickleState == e_done) {
m_cacheSound = SoundManager()->GetCacheSoundManager()->ManageSoundEntry(m_cacheSound);

View File

@ -9,24 +9,28 @@
DECOMP_SIZE_ASSERT(LegoSoundManager, 0x44)
// FUNCTION: LEGO1 0x100298a0
// FUNCTION: BETA10 0x100cffb0
LegoSoundManager::LegoSoundManager()
{
Init();
}
// FUNCTION: LEGO1 0x10029940
// FUNCTION: BETA10 0x100d0027
LegoSoundManager::~LegoSoundManager()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x100299a0
// FUNCTION: BETA10 0x100d0099
void LegoSoundManager::Init()
{
m_cacheSoundManager = NULL;
}
// FUNCTION: LEGO1 0x100299b0
// FUNCTION: BETA10 0x100d00c9
void LegoSoundManager::Destroy(MxBool p_fromDestructor)
{
delete m_cacheSoundManager;
@ -41,17 +45,19 @@ void LegoSoundManager::Destroy(MxBool p_fromDestructor)
// FUNCTION: BETA10 0x100d0129
MxResult LegoSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
{
MxBool locked = FALSE;
MxResult result = FAILURE;
MxBool locked = FALSE;
if (MxSoundManager::Create(10, FALSE) == SUCCESS) {
m_criticalSection.Enter();
locked = TRUE;
m_cacheSoundManager = new LegoCacheSoundManager;
assert(m_cacheSoundManager);
result = SUCCESS;
if (MxSoundManager::Create(10, FALSE) != SUCCESS) {
goto done;
}
ENTER(m_criticalSection);
locked = TRUE;
m_cacheSoundManager = new LegoCacheSoundManager;
assert(m_cacheSoundManager);
result = SUCCESS;
done:
if (result != SUCCESS) {
Destroy();

View File

@ -956,7 +956,7 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param)
LegoControlManagerNotificationParam* param = (LegoControlManagerNotificationParam*) p_param;
assert(m_buildState);
if (param->m_unk0x28) {
if (param->m_enabledChild) {
switch (param->m_clickedObjectId) {
// The enum values are all identical between CopterScript, DunecarScript, JetskiScript, and RacecarScript
case CopterScript::c_Info_Ctl:
@ -1012,7 +1012,7 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param)
case CopterScript::c_Platform_Ctl:
FUN_10024f50();
m_unk0xf8 = c_unknown8;
m_unk0xfc = param->m_unk0x28;
m_unk0xfc = param->m_enabledChild;
result = 1;
break;
default:
@ -1054,7 +1054,7 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param)
LegoControlManagerNotificationParam* param = (LegoControlManagerNotificationParam*) p_param;
assert(m_buildState);
if (param->m_unk0x28) {
if (param->m_enabledChild) {
switch (param->m_clickedObjectId) {
case CopterScript::c_Info_Ctl:
m_animPresenter->SetShelfState(LegoCarBuildAnimPresenter::e_selected);
@ -1116,7 +1116,7 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param)
case CopterScript::c_Platform_Ctl:
FUN_10024f50();
m_unk0xf8 = c_unknown8;
m_unk0xfc = param->m_unk0x28;
m_unk0xfc = param->m_enabledChild;
result = 1;
break;
default:
@ -1233,7 +1233,7 @@ undefined4 LegoCarBuild::FUN_10024c20(MxNotificationParam* p_param)
jukeboxScript = JukeboxScript::c_RaceCarBuild_Music;
}
m_unk0x338 = SoundManager()->FUN_100aebd0(*g_jukeboxScript, jukeboxScript);
m_unk0x338 = SoundManager()->FindPresenter(*g_jukeboxScript, jukeboxScript);
if (m_unk0x338) {
BackgroundAudioManager()->SetPendingPresenter(m_unk0x338, 5, MxPresenter::e_repeating);

View File

@ -11,7 +11,6 @@
#include "legoentitylist.h"
#include "legoextraactor.h"
#include "legogamestate.h"
#include "legolocomotionanimpresenter.h"
#include "legomain.h"
#include "legonavcontroller.h"
#include "legoroilist.h"
@ -20,6 +19,7 @@
#include "legoworld.h"
#include "misc.h"
#include "mxbackgroundaudiomanager.h"
#include "mxdebug.h"
#include "mxmisc.h"
#include "mxnotificationmanager.h"
#include "mxticklemanager.h"
@ -1021,7 +1021,7 @@ MxResult LegoAnimationManager::FUN_100605e0(
action.SetUnknown24(-1);
action.AppendExtra(strlen(buf) + 1, buf);
if (StartActionIfUnknown0x13c(action) == SUCCESS) {
if (StartActionIfInitialized(action) == SUCCESS) {
BackgroundAudioManager()->LowerVolume();
tranInfo->m_flags |= LegoTranInfo::c_bit2;
animInfo.m_unk0x22++;
@ -1088,7 +1088,7 @@ MxResult LegoAnimationManager::FUN_100609f0(MxU32 p_objectId, MxMatrix* p_matrix
action.SetUnknown24(-1);
action.AppendExtra(strlen(buf) + 1, buf);
if (StartActionIfUnknown0x13c(action) == SUCCESS) {
if (StartActionIfInitialized(action) == SUCCESS) {
BackgroundAudioManager()->LowerVolume();
info->m_flags |= LegoTranInfo::c_bit2;
m_animRunning = TRUE;
@ -1131,7 +1131,7 @@ MxResult LegoAnimationManager::StartEntityAction(MxDSAction& p_dsAction, LegoEnt
}
}
if (LegoOmni::GetInstance()->StartActionIfUnknown0x13c(p_dsAction) == SUCCESS) {
if (LegoOmni::GetInstance()->StartActionIfInitialized(p_dsAction) == SUCCESS) {
result = SUCCESS;
}
@ -1155,7 +1155,7 @@ MxResult LegoAnimationManager::FUN_10060dc0(
MxResult result = FAILURE;
MxBool found = FALSE;
if (!Lego()->m_unk0x13c) {
if (!Lego()->m_initialized) {
return SUCCESS;
}
@ -1192,7 +1192,7 @@ MxResult LegoAnimationManager::FUN_10060dc0(
// FUNCTION: BETA10 0x1004206c
void LegoAnimationManager::CameraTriggerFire(LegoPathActor* p_actor, MxBool, MxU32 p_location, MxBool p_bool)
{
if (Lego()->m_unk0x13c && m_enableCamAnims && !m_animRunning) {
if (Lego()->m_initialized && m_enableCamAnims && !m_animRunning) {
LegoLocation* location = LegoNavController::GetLocation(p_location);
if (location != NULL) {
@ -1231,12 +1231,10 @@ void LegoAnimationManager::CameraTriggerFire(LegoPathActor* p_actor, MxBool, MxU
}
}
// FUNCTION: LEGO1 0x10061010
#ifdef BETA10
// FUNCTION: BETA10 0x100422cc
void LegoAnimationManager::FUN_10061010(MxBool p_und)
{
MxBool unk0x39 = FALSE;
FUN_10064b50(-1);
if (m_tranInfoList != NULL) {
@ -1244,17 +1242,47 @@ void LegoAnimationManager::FUN_10061010(MxBool p_und)
LegoTranInfo* tranInfo;
while (cursor.Next(tranInfo)) {
if (tranInfo->m_presenter != NULL) {
// TODO: Match
MxU32 flags = tranInfo->m_flags;
if (tranInfo->m_unk0x14 && tranInfo->m_location != -1) {
MxTrace("Releasing user from %d\n", tranInfo->m_objectId);
if (tranInfo->m_presenter != NULL) {
tranInfo->m_presenter->FUN_1004b8c0();
}
tranInfo->m_unk0x14 = FALSE;
}
else {
MxTrace("Stopping %d\n", tranInfo->m_objectId);
if (tranInfo->m_presenter != NULL) {
tranInfo->m_presenter->FUN_1004b840();
}
}
}
}
m_animRunning = FALSE;
m_unk0x404 = Timer()->GetTime();
}
#else
// FUNCTION: LEGO1 0x10061010
void LegoAnimationManager::FUN_10061010(MxBool p_und)
{
MxBool animRunning = FALSE;
FUN_10064b50(-1);
if (m_tranInfoList != NULL) {
LegoTranInfoListCursor cursor(m_tranInfoList);
LegoTranInfo* tranInfo;
while (cursor.Next(tranInfo)) {
if (tranInfo->m_presenter) {
// LINE: LEGO1 0x100610e6
if (tranInfo->m_unk0x14 && tranInfo->m_location != -1 && p_und) {
LegoAnim* anim;
if (tranInfo->m_presenter->GetPresenter() != NULL &&
(anim = tranInfo->m_presenter->GetPresenter()->GetAnimation()) != NULL &&
anim->GetCamAnim() != NULL) {
if (flags & LegoTranInfo::c_bit2) {
if (tranInfo->m_presenter->GetPresenter() &&
tranInfo->m_presenter->GetPresenter()->GetAnimation() &&
tranInfo->m_presenter->GetPresenter()->GetAnimation()->GetCamAnim()) {
if (tranInfo->m_flags & LegoTranInfo::c_bit2) {
BackgroundAudioManager()->RaiseVolume();
tranInfo->m_flags &= ~LegoTranInfo::c_bit2;
}
@ -1263,37 +1291,43 @@ void LegoAnimationManager::FUN_10061010(MxBool p_und)
tranInfo->m_unk0x14 = FALSE;
}
else {
MxTrace("Releasing user from %d\n", tranInfo->m_objectId);
// LINE: LEGO1 0x10061137
tranInfo->m_presenter->FUN_1004b8c0();
animRunning = TRUE;
tranInfo->m_unk0x14 = FALSE;
unk0x39 = TRUE;
}
}
else {
if (flags & LegoTranInfo::c_bit2) {
if (tranInfo->m_flags & LegoTranInfo::c_bit2) {
// LINE: LEGO1 0x10061150
BackgroundAudioManager()->RaiseVolume();
tranInfo->m_flags &= ~LegoTranInfo::c_bit2;
}
MxTrace("Stopping %d\n", tranInfo->m_objectId);
tranInfo->m_presenter->FUN_1004b840();
}
}
else {
if (m_tranInfoList2 != NULL) {
LegoTranInfoListCursor cursor(m_tranInfoList2);
if (!cursor.Find(tranInfo)) {
// TODO: For some reason, the embedded `MxListEntry` constructor is not inlined.
// This may be the key for getting this function to match correctly.
m_tranInfoList2->Append(tranInfo);
}
}
unk0x39 = TRUE;
animRunning = TRUE;
}
}
}
m_animRunning = unk0x39;
m_animRunning = animRunning;
m_unk0x404 = Timer()->GetTime();
}
#endif
// FUNCTION: LEGO1 0x10061530
void LegoAnimationManager::FUN_10061530()

View File

@ -425,6 +425,21 @@ MxBool LegoAnimMMPresenter::FUN_1004b6b0(MxLong p_time)
// FUNCTION: BETA10 0x1004ce18
MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time)
{
#ifdef BETA10
switch (m_unk0x58) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
}
#endif
LegoROI* viewROI = VideoManager()->GetViewROI();
LegoPathActor* actor = UserActor();
@ -455,9 +470,13 @@ MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time)
m_world->PlaceActor(actor);
}
#ifdef BETA10
actor->VTable0xa8();
#else
if (m_tranInfo->m_unk0x29) {
actor->VTable0xa8();
}
#endif
}
actor->SetActorState(LegoPathActor::c_initial);
@ -491,9 +510,11 @@ void LegoAnimMMPresenter::FUN_1004b840()
FUN_1004b6d0(0);
EndAction();
#ifndef BETA10
if (action != NULL) {
Streamer()->FUN_100b98f0(action);
}
#endif
}
// FUNCTION: LEGO1 0x1004b8b0

View File

@ -1092,6 +1092,7 @@ LegoROI* LegoCharacterManager::FUN_10085a80(const char* p_name, const char* p_lo
}
// FUNCTION: LEGO1 0x10085aa0
// FUNCTION: BETA10 0x1007703d
CustomizeAnimFileVariable::CustomizeAnimFileVariable(const char* p_key)
{
m_key = p_key;
@ -1099,6 +1100,7 @@ CustomizeAnimFileVariable::CustomizeAnimFileVariable(const char* p_key)
}
// FUNCTION: LEGO1 0x10085b50
// FUNCTION: BETA10 0x100770c8
void CustomizeAnimFileVariable::SetValue(const char* p_value)
{
// STRING: LEGO1 0x100fc4f4

View File

@ -1349,6 +1349,11 @@ void LegoBackgroundColor::SetLightColor()
SetLightColor(convertedR, convertedG, convertedB);
}
// FUNCTION: BETA10 0x10086a87
LegoFullScreenMovie::LegoFullScreenMovie()
{
}
// FUNCTION: LEGO1 0x1003c500
// FUNCTION: BETA10 0x10086af6
LegoFullScreenMovie::LegoFullScreenMovie(const char* p_key, const char* p_value)

View File

@ -10,7 +10,7 @@
#include "legoentity.h"
#include "legopathactor.h"
// The below header inclusions should be sound.
#include "legoloopinganimpresenter.h"
#include "legoanimpresenter.h"
#include "mxcompositemediapresenter.h"
#include "legoactorpresenter.h"
#include "legomodelpresenter.h"
@ -71,10 +71,7 @@
#include "legoentity.h"
#include "legoentitypresenter.h"
#include "legoflctexturepresenter.h"
#include "legohideanimpresenter.h"
#include "legoloadcachesoundpresenter.h"
#include "legolocomotionanimpresenter.h"
#include "legoloopinganimpresenter.h"
#include "legometerpresenter.h"
#include "legomodelpresenter.h"
#include "legopalettepresenter.h"

View File

@ -6,6 +6,7 @@
#include "legonavcontroller.h"
#include "legovideomanager.h"
#include "misc.h"
#include "mxdebug.h"
#include "roi/legoroi.h"
#include <SDL3/SDL_stdinc.h>
@ -103,6 +104,10 @@ const char* g_nick = "Nick";
// STRING: LEGO1 0x100f39e0
const char* g_laura = "Laura";
// GLOBAL: BETA10 0x101f6ce4
// STRING: BETA10 0x101f6d54
const char* g_varDEBUG = "DEBUG";
// FUNCTION: LEGO1 0x10037d00
// FUNCTION: BETA10 0x100d5620
void VisibilityVariable::SetValue(const char* p_value)
@ -132,6 +137,7 @@ void VisibilityVariable::SetValue(const char* p_value)
}
// FUNCTION: LEGO1 0x10037d80
// FUNCTION: BETA10 0x100d56ee
void CameraLocationVariable::SetValue(const char* p_value)
{
char buffer[256];
@ -139,22 +145,25 @@ void CameraLocationVariable::SetValue(const char* p_value)
strcpy(buffer, p_value);
char* location = strtok(buffer, ",");
NavController()->UpdateLocation(location);
char* token = strtok(buffer, ",");
assert(token);
NavController()->UpdateLocation(token);
location = strtok(NULL, ",");
if (location) {
MxFloat pov = (MxFloat) atof(location);
token = strtok(NULL, ",");
if (token) {
MxFloat pov = (MxFloat) atof(token);
VideoManager()->Get3DManager()->SetFrustrum(pov, 0.1f, 250.0f);
}
}
// FUNCTION: LEGO1 0x10037e30
// FUNCTION: BETA10 0x100d57e2
void CursorVariable::SetValue(const char* p_value)
{
}
// FUNCTION: LEGO1 0x10037e40
// FUNCTION: BETA10 0x100d57fa
void WhoAmIVariable::SetValue(const char* p_value)
{
MxVariable::SetValue(p_value);
@ -175,3 +184,10 @@ void WhoAmIVariable::SetValue(const char* p_value)
GameState()->SetActorId(LegoActor::c_laura);
}
}
// FUNCTION: BETA10 0x100d58fa
void DebugVariable::SetValue(const char* p_value)
{
MxVariable::SetValue(p_value);
MxTrace("%s\n", p_value);
}

View File

@ -172,9 +172,9 @@ void SetUserActor(LegoPathActor* p_userActor)
// FUNCTION: LEGO1 0x10015890
// FUNCTION: BETA10 0x100e4d80
MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction)
MxResult StartActionIfInitialized(MxDSAction& p_dsAction)
{
return LegoOmni::GetInstance()->StartActionIfUnknown0x13c(p_dsAction);
return LegoOmni::GetInstance()->StartActionIfInitialized(p_dsAction);
}
// FUNCTION: LEGO1 0x100158b0

View File

@ -27,6 +27,7 @@ MxCompositeMediaPresenter::~MxCompositeMediaPresenter()
}
// FUNCTION: LEGO1 0x10074090
// FUNCTION: BETA10 0x100e9d37
MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
AUTOLOCK(m_criticalSection);

View File

@ -157,7 +157,7 @@ MxBool MxControlPresenter::Notify(LegoControlManagerNotificationParam* p_param,
p_param->SetClickedAtom(m_action->GetAtomId().GetInternal());
UpdateEnabledChild(0);
p_param->SetNotification(c_notificationControl);
p_param->SetUnknown0x28(m_enabledChild);
p_param->SetEnabledChild(m_enabledChild);
return TRUE;
}
break;
@ -167,7 +167,7 @@ MxBool MxControlPresenter::Notify(LegoControlManagerNotificationParam* p_param,
p_param->SetClickedAtom(m_action->GetAtomId().GetInternal());
UpdateEnabledChild(m_stateOrCellIndex);
p_param->SetNotification(c_notificationControl);
p_param->SetUnknown0x28(m_enabledChild);
p_param->SetEnabledChild(m_enabledChild);
return TRUE;
}
break;

View File

@ -124,28 +124,28 @@ void LegoCameraController::OnMouseMove(MxU8 p_modifier, MxPoint32 p_point)
// FUNCTION: LEGO1 0x10012260
void LegoCameraController::SetWorldTransform(const Vector3& p_at, const Vector3& p_dir, const Vector3& p_up)
{
CalcLocalTransform(p_at, p_dir, p_up, m_matrix1);
m_matrix2 = m_matrix1;
CalcLocalTransform(p_at, p_dir, p_up, m_currentTransform);
m_originalTransform = m_currentTransform;
}
// FUNCTION: LEGO1 0x10012290
// FUNCTION: BETA10 0x10068c34
void LegoCameraController::FUN_10012290(float p_angle)
void LegoCameraController::RotateZ(float p_angle)
{
m_matrix1 = m_matrix2;
m_matrix1.RotateZ(p_angle);
m_currentTransform = m_originalTransform;
m_currentTransform.RotateZ(p_angle);
}
// FUNCTION: LEGO1 0x10012320
// FUNCTION: BETA10 0x10068c73
void LegoCameraController::FUN_10012320(float p_angle)
void LegoCameraController::RotateY(float p_angle)
{
m_matrix1 = m_matrix2;
m_matrix1.RotateY(p_angle);
m_currentTransform = m_originalTransform;
m_currentTransform.RotateY(p_angle);
}
// FUNCTION: LEGO1 0x100123b0
MxResult LegoCameraController::FUN_100123b0(Matrix4& p_matrix)
MxResult LegoCameraController::GetPointOfView(Matrix4& p_matrix)
{
if (m_lego3DView) {
ViewROI* pov = m_lego3DView->GetPointOfView();
@ -160,7 +160,7 @@ MxResult LegoCameraController::FUN_100123b0(Matrix4& p_matrix)
// FUNCTION: LEGO1 0x100123e0
// FUNCTION: BETA10 0x10068cb2
void LegoCameraController::FUN_100123e0(const Matrix4& p_transform, MxU32 p_und)
void LegoCameraController::TransformPointOfView(const Matrix4& p_transform, MxU32 p_multiply)
{
if (m_lego3DView != NULL) {
ViewROI* pov = m_lego3DView->GetPointOfView();
@ -168,8 +168,8 @@ void LegoCameraController::FUN_100123e0(const Matrix4& p_transform, MxU32 p_und)
if (pov != NULL) {
MxMatrix mat;
if (p_und) {
MXM4(mat, m_matrix1, p_transform);
if (p_multiply) {
MXM4(mat, m_currentTransform, p_transform);
}
else {
mat = p_transform;

View File

@ -197,7 +197,7 @@ void LegoEntity::FUN_10010c30()
LegoWorld* world = CurrentWorld();
if (m_cameraFlag && world && world->GetCameraController() && m_roi) {
world->GetCameraController()->FUN_100123e0(m_roi->GetLocal2World(), 1);
world->GetCameraController()->TransformPointOfView(m_roi->GetLocal2World(), 1);
}
}

View File

@ -555,7 +555,7 @@ MxResult LegoNavController::ProcessJoystickInput(MxBool& p_und)
LegoWorld* world = CurrentWorld();
if (world && world->GetCameraController()) {
world->GetCameraController()->FUN_10012320(DTOR(povPosition));
world->GetCameraController()->RotateY(DTOR(povPosition));
p_und = TRUE;
}
}
@ -902,7 +902,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
break;
case SDLK_A:
if (g_animationCalcStep == 1) {
Lego()->m_unk0x13c = TRUE;
Lego()->m_initialized = TRUE;
AnimationManager()->FUN_10060570(TRUE);
g_animationCalcStep = 0;
}

View File

@ -9,7 +9,6 @@
#include "legocontrolmanager.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legolocomotionanimpresenter.h"
#include "legonavcontroller.h"
#include "legoplantmanager.h"
#include "legosoundmanager.h"
@ -288,6 +287,7 @@ MxResult LegoWorld::PlaceActor(
}
// FUNCTION: LEGO1 0x1001fa70
// FUNCTION: BETA10 0x100da328
MxResult LegoWorld::PlaceActor(LegoPathActor* p_actor)
{
LegoPathControllerListCursor cursor(&m_pathControllerList);
@ -303,6 +303,7 @@ MxResult LegoWorld::PlaceActor(LegoPathActor* p_actor)
}
// FUNCTION: LEGO1 0x1001fb70
// FUNCTION: BETA10 0x100da3f1
MxResult LegoWorld::PlaceActor(
LegoPathActor* p_actor,
LegoAnimPresenter* p_presenter,

View File

@ -612,6 +612,7 @@ MxBool LegoInputManager::HandleTouchEvent(SDL_Event* p_event, TouchScheme p_touc
case e_arrowKeys:
switch (p_event->type) {
case SDL_EVENT_FINGER_UP:
case SDL_EVENT_FINGER_CANCELED:
m_touchFlags.erase(event.fingerID);
break;
case SDL_EVENT_FINGER_DOWN:
@ -647,6 +648,7 @@ MxBool LegoInputManager::HandleTouchEvent(SDL_Event* p_event, TouchScheme p_touc
}
break;
case SDL_EVENT_FINGER_UP:
case SDL_EVENT_FINGER_CANCELED:
if (event.fingerID == g_finger) {
g_finger = 0;
m_touchVirtualThumb = {0, 0};
@ -795,6 +797,7 @@ void LegoInputManager::UpdateLastInputMethod(SDL_Event* p_event)
case SDL_EVENT_FINGER_MOTION:
case SDL_EVENT_FINGER_DOWN:
case SDL_EVENT_FINGER_UP:
case SDL_EVENT_FINGER_CANCELED:
m_lastInputMethod = SDL_TouchID_v{p_event->tfinger.touchID};
break;
}

View File

@ -74,7 +74,7 @@ void LegoOmni::Init()
m_animationManager = NULL;
m_buildingManager = NULL;
m_bkgAudioManager = NULL;
m_unk0x13c = TRUE;
m_initialized = TRUE;
m_transitionManager = NULL;
m_version10 = FALSE;
}

View File

@ -2,7 +2,7 @@
#include "anim/legoanim.h"
#include "define.h"
#include "legolocomotionanimpresenter.h"
#include "legoanimpresenter.h"
#include "legopathboundary.h"
#include "legoworld.h"
#include "misc.h"

View File

@ -1,8 +1,8 @@
#include "legoextraactor.h"
#include "anim/legoanim.h"
#include "legoanimpresenter.h"
#include "legocachesoundmanager.h"
#include "legolocomotionanimpresenter.h"
#include "legosoundmanager.h"
#include "legoworld.h"
#include "misc.h"

View File

@ -440,7 +440,7 @@ void LegoPathActor::Animate(float p_time)
LegoWorld* world = CurrentWorld();
if (world) {
world->GetCameraController()->FUN_10012290(DTOR(m_unk0x14c));
world->GetCameraController()->RotateZ(DTOR(m_unk0x14c));
}
}
}

View File

@ -2,7 +2,7 @@
#include "decomp.h"
#include "geom/legoorientededge.h"
#include "legolocomotionanimpresenter.h"
#include "legoanimpresenter.h"
#include "legopathactor.h"
#include "legopathstruct.h"

View File

@ -3,7 +3,7 @@
#include "isle.h"
#include "jukebox.h"
#include "jukebox_actions.h"
#include "legohideanimpresenter.h"
#include "legoanimpresenter.h"
#include "legopathactor.h"
#include "legoutils.h"
#include "misc.h"

View File

@ -5,8 +5,8 @@
#include "isle.h"
#include "jukebox_actions.h"
#include "legoanimationmanager.h"
#include "legoanimpresenter.h"
#include "legocontrolmanager.h"
#include "legohideanimpresenter.h"
#include "legomain.h"
#include "legonavcontroller.h"
#include "legopathstruct.h"
@ -339,7 +339,7 @@ MxLong CarRace::HandlePathStruct(LegoPathStructNotificationParam& p_param)
// FUNCTION: LEGO1 0x10017650
MxLong CarRace::HandleControl(LegoControlManagerNotificationParam& p_param)
{
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case 3:
InvokeAction(Extra::e_stop, *g_carraceScript, CarraceScript::c_irtx08ra_PlayWav, NULL);

View File

@ -6,8 +6,8 @@
#include "jetski_actions.h"
#include "jukebox_actions.h"
#include "legoanimationmanager.h"
#include "legoanimpresenter.h"
#include "legocontrolmanager.h"
#include "legohideanimpresenter.h"
#include "legomain.h"
#include "legopathstruct.h"
#include "legoracers.h"
@ -126,7 +126,7 @@ MxLong JetskiRace::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case JetraceScript::c_JetskiArms_Ctl:
m_act1State->m_state = Act1State::e_none;

View File

@ -129,7 +129,7 @@ MxLong LegoRaceMap::Notify(MxParam& p_param)
if (param.GetNotification() == c_notificationControl &&
m_Map_Ctl->GetAction()->GetObjectId() == ((LegoControlManagerNotificationParam&) p_param).m_clickedObjectId) {
if (((LegoControlManagerNotificationParam&) p_param).m_unk0x28 == 1) {
if (((LegoControlManagerNotificationParam&) p_param).m_enabledChild == 1) {
m_unk0x08 = TRUE;
FUN_1005d4b0();
m_stillPresenter->Enable(TRUE);

View File

@ -340,10 +340,10 @@ void LegoRaceCar::KickCamera(float p_param)
transformationMatrix.SetIdentity();
// Possible bug in the original code: The first argument is not initialized
a->GetAnimTreePtr()->GetCamAnim()->FUN_1009f490(deltaTime, transformationMatrix);
a->GetAnimTreePtr()->GetCamAnim()->CalculateCameraTransform(deltaTime, transformationMatrix);
if (r->GetCameraController()) {
r->GetCameraController()->FUN_100123e0(transformationMatrix, 0);
r->GetCameraController()->TransformPointOfView(transformationMatrix, 0);
}
m_roi->SetLocal2World(transformationMatrix);

View File

@ -3,6 +3,7 @@
#include "3dmanager/lego3dmanager.h"
#include "anim/legoanim.h"
#include "define.h"
#include "legoanimactor.h"
#include "legoanimationmanager.h"
#include "legoanimmmpresenter.h"
#include "legocameracontroller.h"
@ -30,6 +31,10 @@
#include <stdio.h>
DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xbc)
DECOMP_SIZE_ASSERT(LegoLoopingAnimPresenter, 0xc0)
DECOMP_SIZE_ASSERT(LegoLocomotionAnimPresenter, 0xd8)
DECOMP_SIZE_ASSERT(LegoHideAnimPresenter, 0xc4)
DECOMP_SIZE_ASSERT(LegoHideAnimStruct, 0x08)
// FUNCTION: LEGO1 0x10068420
// FUNCTION: BETA10 0x1004e5f0
@ -936,10 +941,10 @@ void LegoAnimPresenter::FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, Matrix4* p
if (p_anim->GetCamAnim() != NULL) {
MxMatrix transform(mat);
p_anim->GetCamAnim()->FUN_1009f490(p_time, transform);
p_anim->GetCamAnim()->CalculateCameraTransform(p_time, transform);
if (m_currentWorld != NULL && m_currentWorld->GetCameraController() != NULL) {
m_currentWorld->GetCameraController()->FUN_100123e0(transform, 0);
m_currentWorld->GetCameraController()->TransformPointOfView(transform, FALSE);
}
}
@ -1219,3 +1224,439 @@ MxResult LegoAnimPresenter::VTable0x98(LegoPathBoundary* p_boundary)
return SUCCESS;
}
// FUNCTION: LEGO1 0x1006caa0
// FUNCTION: BETA10 0x1005223d
void LegoLoopingAnimPresenter::StreamingTickle()
{
if (m_subscriber->PeekData()) {
MxStreamChunk* chunk = m_subscriber->PopData();
m_subscriber->FreeDataChunk(chunk);
}
if (m_unk0x95) {
ProgressTickleState(e_done);
if (m_compositePresenter) {
if (m_compositePresenter->IsA("LegoAnimMMPresenter")) {
m_compositePresenter->VTable0x60(this);
}
}
}
else {
if (m_action->GetDuration() != -1) {
if (m_action->GetElapsedTime() > m_action->GetDuration() + m_action->GetStartTime()) {
m_unk0x95 = TRUE;
}
}
}
}
// FUNCTION: LEGO1 0x1006cb40
// FUNCTION: BETA10 0x1005239a
void LegoLoopingAnimPresenter::PutFrame()
{
MxLong time;
if (m_action->GetStartTime() <= m_action->GetElapsedTime()) {
time = (m_action->GetElapsedTime() - m_action->GetStartTime()) % m_anim->GetDuration();
}
else {
time = 0;
}
FUN_1006b9a0(m_anim, time, m_unk0x78);
if (m_unk0x8c != NULL && m_currentWorld != NULL && m_currentWorld->GetCameraController() != NULL) {
for (MxS32 i = 0; i < m_unk0x94; i++) {
if (m_unk0x8c[i] != NULL) {
MxMatrix mat(m_unk0x8c[i]->GetLocal2World());
Vector3 pos(mat[0]);
Vector3 dir(mat[1]);
Vector3 up(mat[2]);
Vector3 und(mat[3]);
float possqr = sqrt(pos.LenSquared());
float dirsqr = sqrt(dir.LenSquared());
float upsqr = sqrt(up.LenSquared());
up = und;
up -= m_currentWorld->GetCameraController()->GetWorldLocation();
dir /= dirsqr;
pos.EqualsCross(dir, up);
pos.Unitize();
up.EqualsCross(pos, dir);
pos *= possqr;
dir *= dirsqr;
up *= upsqr;
m_unk0x8c[i]->SetLocal2World(mat);
m_unk0x8c[i]->WrappedUpdateWorldData();
}
}
}
}
// FUNCTION: LEGO1 0x1006cdd0
LegoLocomotionAnimPresenter::LegoLocomotionAnimPresenter()
{
Init();
}
// FUNCTION: LEGO1 0x1006d050
LegoLocomotionAnimPresenter::~LegoLocomotionAnimPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x1006d0b0
void LegoLocomotionAnimPresenter::Init()
{
m_unk0xc0 = 0;
m_unk0xc4 = NULL;
m_unk0xcc = -1;
m_unk0xd0 = -1;
m_roiMapList = NULL;
m_unk0xd4 = 0;
}
// FUNCTION: LEGO1 0x1006d0e0
void LegoLocomotionAnimPresenter::Destroy(MxBool p_fromDestructor)
{
ENTER(m_criticalSection);
if (m_unk0xc4) {
delete[] m_unk0xc4;
}
if (m_roiMapList) {
delete m_roiMapList;
}
m_roiMap = NULL;
Init();
m_criticalSection.Leave();
if (!p_fromDestructor) {
LegoLoopingAnimPresenter::Destroy();
}
}
// FUNCTION: LEGO1 0x1006d140
MxResult LegoLocomotionAnimPresenter::CreateAnim(MxStreamChunk* p_chunk)
{
MxResult result = LegoAnimPresenter::CreateAnim(p_chunk);
return result == SUCCESS ? SUCCESS : result;
}
// FUNCTION: LEGO1 0x1006d160
// FUNCTION: BETA10 0x100528c7
MxResult LegoLocomotionAnimPresenter::AddToManager()
{
m_roiMapList = new LegoROIMapList();
if (m_roiMapList == NULL) {
return FAILURE;
}
return LegoAnimPresenter::AddToManager();
}
// FUNCTION: LEGO1 0x1006d5b0
void LegoLocomotionAnimPresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x1006d5c0
void LegoLocomotionAnimPresenter::PutFrame()
{
// Empty
}
// FUNCTION: LEGO1 0x1006d5d0
void LegoLocomotionAnimPresenter::ReadyTickle()
{
LegoLoopingAnimPresenter::ReadyTickle();
if (m_currentWorld != NULL && m_currentTickleState == e_starting) {
m_currentWorld->Add(this);
if (m_compositePresenter != NULL) {
SendToCompositePresenter(Lego());
}
m_unk0xd4++;
}
}
// FUNCTION: LEGO1 0x1006d610
// FUNCTION: BETA10 0x10052a34
void LegoLocomotionAnimPresenter::StartingTickle()
{
if (m_subscriber->PeekData()) {
MxStreamChunk* chunk = m_subscriber->PopData();
m_subscriber->FreeDataChunk(chunk);
}
if (m_roiMapList->GetNumElements() != 0) {
ProgressTickleState(e_streaming);
}
}
// FUNCTION: LEGO1 0x1006d660
void LegoLocomotionAnimPresenter::StreamingTickle()
{
if (m_unk0xd4 == 0) {
EndAction();
}
}
// FUNCTION: LEGO1 0x1006d670
void LegoLocomotionAnimPresenter::EndAction()
{
if (m_action) {
MxVideoPresenter::EndAction();
}
}
// FUNCTION: LEGO1 0x1006d680
// FUNCTION: BETA10 0x10052b3d
void LegoLocomotionAnimPresenter::FUN_1006d680(LegoAnimActor* p_actor, MxFloat p_value)
{
// This asserts that LegoLocomotionAnimPresenter is contained in legoanimpresenter.cpp
AUTOLOCK(m_criticalSection);
MxVariableTable* variableTable = VariableTable();
const char* key = ((LegoAnimNodeData*) m_anim->GetRoot()->GetData())->GetName();
variableTable->SetVariable(key, p_actor->GetROI()->GetName());
FUN_100695c0();
FUN_10069b10();
if (m_roiMap != NULL) {
m_roiMapList->Append(m_roiMap);
p_actor->FUN_1001c450(m_anim, p_value, m_roiMap, m_roiMapSize);
m_roiMap = NULL;
}
variableTable->SetVariable(key, "");
if (m_sceneROIs != NULL) {
delete m_sceneROIs;
m_sceneROIs = NULL;
}
}
// We do not have any hard evidence that `LegoHideAnimPresenter` is part of this file as well.
// However, since all of the other AnimPresenters are in the same file, it is reasonable to assume
// that the same holds here.
// FUNCTION: LEGO1 0x1006d7e0
LegoHideAnimPresenter::LegoHideAnimPresenter()
{
Init();
}
// FUNCTION: LEGO1 0x1006d9f0
LegoHideAnimPresenter::~LegoHideAnimPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x1006da50
void LegoHideAnimPresenter::Init()
{
m_boundaryMap = NULL;
}
// FUNCTION: LEGO1 0x1006da60
void LegoHideAnimPresenter::Destroy(MxBool p_fromDestructor)
{
ENTER(m_criticalSection);
if (m_boundaryMap) {
delete[] m_boundaryMap;
}
Init();
m_criticalSection.Leave();
// This appears to be a bug, since it results in an endless loop
if (!p_fromDestructor) {
LegoHideAnimPresenter::Destroy();
}
}
// FUNCTION: LEGO1 0x1006dab0
MxResult LegoHideAnimPresenter::AddToManager()
{
return LegoAnimPresenter::AddToManager();
}
// FUNCTION: LEGO1 0x1006dac0
void LegoHideAnimPresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x1006dad0
void LegoHideAnimPresenter::PutFrame()
{
}
// FUNCTION: LEGO1 0x1006dae0
// FUNCTION: BETA10 0x100530f4
void LegoHideAnimPresenter::ReadyTickle()
{
LegoLoopingAnimPresenter::ReadyTickle();
if (m_currentWorld) {
if (m_currentTickleState == e_starting && m_compositePresenter != NULL) {
SendToCompositePresenter(Lego());
}
m_currentWorld->Add(this);
}
}
// FUNCTION: LEGO1 0x1006db20
// FUNCTION: BETA10 0x1005316b
void LegoHideAnimPresenter::StartingTickle()
{
LegoLoopingAnimPresenter::StartingTickle();
if (m_currentTickleState == e_streaming) {
FUN_1006dc10();
FUN_1006db40(0);
}
}
// FUNCTION: LEGO1 0x1006db40
// FUNCTION: BETA10 0x100531ab
void LegoHideAnimPresenter::FUN_1006db40(LegoTime p_time)
{
FUN_1006db60(m_anim->GetRoot(), p_time);
}
// FUNCTION: LEGO1 0x1006db60
// FUNCTION: BETA10 0x100531de
void LegoHideAnimPresenter::FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time)
{
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
MxBool newB = FALSE;
MxBool previousB = FALSE;
if (m_roiMap != NULL) {
LegoROI* roi = m_roiMap[data->GetROIIndex()];
if (roi != NULL) {
newB = data->GetVisibility(p_time);
previousB = roi->GetVisibility();
roi->SetVisibility(newB);
}
}
if (m_boundaryMap != NULL) {
LegoPathBoundary* boundary = m_boundaryMap[data->GetBoundaryIndex()];
if (boundary != NULL) {
newB = data->GetVisibility(p_time);
previousB = boundary->GetFlag0x10();
boundary->SetFlag0x10(newB);
}
}
for (MxS32 i = 0; i < p_node->GetNumChildren(); i++) {
FUN_1006db60(p_node->GetChild(i), p_time);
}
}
// FUNCTION: LEGO1 0x1006dc10
// FUNCTION: BETA10 0x100532fd
void LegoHideAnimPresenter::FUN_1006dc10()
{
LegoHideAnimStructMap anims;
FUN_1006e3f0(anims, m_anim->GetRoot());
if (m_boundaryMap != NULL) {
delete[] m_boundaryMap;
}
m_boundaryMap = new LegoPathBoundary*[anims.size() + 1];
m_boundaryMap[0] = NULL;
for (LegoHideAnimStructMap::iterator it = anims.begin(); !(it == anims.end()); it++) {
m_boundaryMap[(*it).second.m_index] = (*it).second.m_boundary;
delete[] const_cast<char*>((*it).first);
}
}
// FUNCTION: LEGO1 0x1006e3f0
// FUNCTION: BETA10 0x1005345e
void LegoHideAnimPresenter::FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node)
{
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
const char* name = data->GetName();
if (name != NULL) {
LegoPathBoundary* boundary = m_currentWorld->FindPathBoundary(name);
if (boundary != NULL) {
FUN_1006e470(p_map, data, name, boundary);
}
else {
data->SetBoundaryIndex(0);
}
}
MxS32 count = p_node->GetNumChildren();
for (MxS32 i = 0; i < count; i++) {
FUN_1006e3f0(p_map, p_node->GetChild(i));
}
}
// FUNCTION: LEGO1 0x1006e470
// FUNCTION: BETA10 0x10053520
void LegoHideAnimPresenter::FUN_1006e470(
LegoHideAnimStructMap& p_map,
LegoAnimNodeData* p_data,
const char* p_name,
LegoPathBoundary* p_boundary
)
{
LegoHideAnimStructMap::iterator it;
it = p_map.find(p_name);
if (it == p_map.end()) {
LegoHideAnimStruct animStruct;
animStruct.m_index = p_map.size() + 1;
animStruct.m_boundary = p_boundary;
p_data->SetBoundaryIndex(animStruct.m_index);
char* name = new char[strlen(p_name) + 1];
strcpy(name, p_name);
p_map[name] = animStruct;
}
else {
p_data->SetBoundaryIndex((*it).second.m_index);
}
}
// FUNCTION: LEGO1 0x1006e9e0
// FUNCTION: BETA10 0x100535ef
void LegoHideAnimPresenter::EndAction()
{
if (m_action) {
MxVideoPresenter::EndAction();
if (m_currentWorld) {
m_currentWorld->Remove(this);
}
}
}

View File

@ -1,216 +0,0 @@
#include "legohideanimpresenter.h"
#include "anim/legoanim.h"
#include "legomain.h"
#include "legoworld.h"
#include "misc.h"
DECOMP_SIZE_ASSERT(LegoHideAnimPresenter, 0xc4)
DECOMP_SIZE_ASSERT(LegoHideAnimStruct, 0x08)
// FUNCTION: LEGO1 0x1006d7e0
LegoHideAnimPresenter::LegoHideAnimPresenter()
{
Init();
}
// FUNCTION: LEGO1 0x1006d9f0
LegoHideAnimPresenter::~LegoHideAnimPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x1006da50
void LegoHideAnimPresenter::Init()
{
m_boundaryMap = NULL;
}
// FUNCTION: LEGO1 0x1006da60
void LegoHideAnimPresenter::Destroy(MxBool p_fromDestructor)
{
m_criticalSection.Enter();
if (m_boundaryMap) {
delete[] m_boundaryMap;
}
Init();
m_criticalSection.Leave();
// This appears to be a bug, since it results in an endless loop
if (!p_fromDestructor) {
LegoHideAnimPresenter::Destroy();
}
}
// FUNCTION: LEGO1 0x1006dab0
MxResult LegoHideAnimPresenter::AddToManager()
{
return LegoAnimPresenter::AddToManager();
}
// FUNCTION: LEGO1 0x1006dac0
void LegoHideAnimPresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x1006dad0
void LegoHideAnimPresenter::PutFrame()
{
}
// FUNCTION: LEGO1 0x1006dae0
// FUNCTION: BETA10 0x100530f4
void LegoHideAnimPresenter::ReadyTickle()
{
LegoLoopingAnimPresenter::ReadyTickle();
if (m_currentWorld) {
if (m_currentTickleState == e_starting && m_compositePresenter != NULL) {
SendToCompositePresenter(Lego());
}
m_currentWorld->Add(this);
}
}
// FUNCTION: LEGO1 0x1006db20
// FUNCTION: BETA10 0x1005316b
void LegoHideAnimPresenter::StartingTickle()
{
LegoLoopingAnimPresenter::StartingTickle();
if (m_currentTickleState == e_streaming) {
FUN_1006dc10();
FUN_1006db40(0);
}
}
// FUNCTION: LEGO1 0x1006db40
// FUNCTION: BETA10 0x100531ab
void LegoHideAnimPresenter::FUN_1006db40(LegoTime p_time)
{
FUN_1006db60(m_anim->GetRoot(), p_time);
}
// FUNCTION: LEGO1 0x1006db60
// FUNCTION: BETA10 0x100531de
void LegoHideAnimPresenter::FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time)
{
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
MxBool newB = FALSE;
MxBool previousB = FALSE;
if (m_roiMap != NULL) {
LegoROI* roi = m_roiMap[data->GetROIIndex()];
if (roi != NULL) {
newB = data->GetVisibility(p_time);
previousB = roi->GetVisibility();
roi->SetVisibility(newB);
}
}
if (m_boundaryMap != NULL) {
LegoPathBoundary* boundary = m_boundaryMap[data->GetBoundaryIndex()];
if (boundary != NULL) {
newB = data->GetVisibility(p_time);
previousB = boundary->GetFlag0x10();
boundary->SetFlag0x10(newB);
}
}
for (MxS32 i = 0; i < p_node->GetNumChildren(); i++) {
FUN_1006db60(p_node->GetChild(i), p_time);
}
}
// FUNCTION: LEGO1 0x1006dc10
// FUNCTION: BETA10 0x100532fd
void LegoHideAnimPresenter::FUN_1006dc10()
{
LegoHideAnimStructMap anims;
FUN_1006e3f0(anims, m_anim->GetRoot());
if (m_boundaryMap != NULL) {
delete[] m_boundaryMap;
}
m_boundaryMap = new LegoPathBoundary*[anims.size() + 1];
m_boundaryMap[0] = NULL;
for (LegoHideAnimStructMap::iterator it = anims.begin(); !(it == anims.end()); it++) {
m_boundaryMap[(*it).second.m_index] = (*it).second.m_boundary;
delete[] const_cast<char*>((*it).first);
}
}
// FUNCTION: LEGO1 0x1006e3f0
// FUNCTION: BETA10 0x1005345e
void LegoHideAnimPresenter::FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node)
{
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
const char* name = data->GetName();
if (name != NULL) {
LegoPathBoundary* boundary = m_currentWorld->FindPathBoundary(name);
if (boundary != NULL) {
FUN_1006e470(p_map, data, name, boundary);
}
else {
data->SetBoundaryIndex(0);
}
}
MxS32 count = p_node->GetNumChildren();
for (MxS32 i = 0; i < count; i++) {
FUN_1006e3f0(p_map, p_node->GetChild(i));
}
}
// FUNCTION: LEGO1 0x1006e470
// FUNCTION: BETA10 0x10053520
void LegoHideAnimPresenter::FUN_1006e470(
LegoHideAnimStructMap& p_map,
LegoAnimNodeData* p_data,
const char* p_name,
LegoPathBoundary* p_boundary
)
{
LegoHideAnimStructMap::iterator it;
it = p_map.find(p_name);
if (it == p_map.end()) {
LegoHideAnimStruct animStruct;
animStruct.m_index = p_map.size() + 1;
animStruct.m_boundary = p_boundary;
p_data->SetBoundaryIndex(animStruct.m_index);
char* name = new char[strlen(p_name) + 1];
strcpy(name, p_name);
p_map[name] = animStruct;
}
else {
p_data->SetBoundaryIndex((*it).second.m_index);
}
}
// FUNCTION: LEGO1 0x1006e9e0
// FUNCTION: BETA10 0x100535ef
void LegoHideAnimPresenter::EndAction()
{
if (m_action) {
MxVideoPresenter::EndAction();
if (m_currentWorld) {
m_currentWorld->Remove(this);
}
}
}

View File

@ -1,164 +0,0 @@
#include "legolocomotionanimpresenter.h"
#include "anim/legoanim.h"
#include "legoanimactor.h"
#include "legomain.h"
#include "legoworld.h"
#include "misc.h"
#include "mxautolock.h"
#include "mxdssubscriber.h"
#include "mxmisc.h"
#include "mxvariabletable.h"
DECOMP_SIZE_ASSERT(LegoLocomotionAnimPresenter, 0xd8)
// FUNCTION: LEGO1 0x1006cdd0
LegoLocomotionAnimPresenter::LegoLocomotionAnimPresenter()
{
Init();
}
// FUNCTION: LEGO1 0x1006d050
LegoLocomotionAnimPresenter::~LegoLocomotionAnimPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x1006d0b0
void LegoLocomotionAnimPresenter::Init()
{
m_unk0xc0 = 0;
m_unk0xc4 = NULL;
m_unk0xcc = -1;
m_unk0xd0 = -1;
m_roiMapList = NULL;
m_unk0xd4 = 0;
}
// FUNCTION: LEGO1 0x1006d0e0
void LegoLocomotionAnimPresenter::Destroy(MxBool p_fromDestructor)
{
m_criticalSection.Enter();
if (m_unk0xc4) {
delete[] m_unk0xc4;
}
if (m_roiMapList) {
delete m_roiMapList;
}
m_roiMap = NULL;
Init();
m_criticalSection.Leave();
if (!p_fromDestructor) {
LegoLoopingAnimPresenter::Destroy();
}
}
// FUNCTION: LEGO1 0x1006d140
MxResult LegoLocomotionAnimPresenter::CreateAnim(MxStreamChunk* p_chunk)
{
MxResult result = LegoAnimPresenter::CreateAnim(p_chunk);
return result == SUCCESS ? SUCCESS : result;
}
// FUNCTION: LEGO1 0x1006d160
// FUNCTION: BETA10 0x100528c7
MxResult LegoLocomotionAnimPresenter::AddToManager()
{
m_roiMapList = new LegoROIMapList();
if (m_roiMapList == NULL) {
return FAILURE;
}
return LegoAnimPresenter::AddToManager();
}
// FUNCTION: LEGO1 0x1006d5b0
void LegoLocomotionAnimPresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x1006d5c0
void LegoLocomotionAnimPresenter::PutFrame()
{
// Empty
}
// FUNCTION: LEGO1 0x1006d5d0
void LegoLocomotionAnimPresenter::ReadyTickle()
{
LegoLoopingAnimPresenter::ReadyTickle();
if (m_currentWorld != NULL && m_currentTickleState == e_starting) {
m_currentWorld->Add(this);
if (m_compositePresenter != NULL) {
SendToCompositePresenter(Lego());
}
m_unk0xd4++;
}
}
// FUNCTION: LEGO1 0x1006d610
// FUNCTION: BETA10 0x10052a34
void LegoLocomotionAnimPresenter::StartingTickle()
{
if (m_subscriber->PeekData()) {
MxStreamChunk* chunk = m_subscriber->PopData();
m_subscriber->FreeDataChunk(chunk);
}
if (m_roiMapList->GetNumElements() != 0) {
ProgressTickleState(e_streaming);
}
}
// FUNCTION: LEGO1 0x1006d660
void LegoLocomotionAnimPresenter::StreamingTickle()
{
if (m_unk0xd4 == 0) {
EndAction();
}
}
// FUNCTION: LEGO1 0x1006d670
void LegoLocomotionAnimPresenter::EndAction()
{
if (m_action) {
MxVideoPresenter::EndAction();
}
}
// FUNCTION: LEGO1 0x1006d680
// FUNCTION: BETA10 0x10052b3d
void LegoLocomotionAnimPresenter::FUN_1006d680(LegoAnimActor* p_actor, MxFloat p_value)
{
AUTOLOCK(m_criticalSection);
MxVariableTable* variableTable = VariableTable();
const char* key = ((LegoAnimNodeData*) m_anim->GetRoot()->GetData())->GetName();
variableTable->SetVariable(key, p_actor->GetROI()->GetName());
FUN_100695c0();
FUN_10069b10();
if (m_roiMap != NULL) {
m_roiMapList->Append(m_roiMap);
p_actor->FUN_1001c450(m_anim, p_value, m_roiMap, m_roiMapSize);
m_roiMap = NULL;
}
variableTable->SetVariable(key, "");
if (m_sceneROIs != NULL) {
delete m_sceneROIs;
m_sceneROIs = NULL;
}
}

View File

@ -1,83 +0,0 @@
#include "legoloopinganimpresenter.h"
#include "anim/legoanim.h"
#include "legocameracontroller.h"
#include "legoworld.h"
#include "mxcompositepresenter.h"
#include "mxdsaction.h"
#include "mxdssubscriber.h"
DECOMP_SIZE_ASSERT(LegoLoopingAnimPresenter, 0xc0)
// FUNCTION: LEGO1 0x1006caa0
// FUNCTION: BETA10 0x1005223d
void LegoLoopingAnimPresenter::StreamingTickle()
{
if (m_subscriber->PeekData()) {
MxStreamChunk* chunk = m_subscriber->PopData();
m_subscriber->FreeDataChunk(chunk);
}
if (m_unk0x95) {
ProgressTickleState(e_done);
if (m_compositePresenter) {
if (m_compositePresenter->IsA("LegoAnimMMPresenter")) {
m_compositePresenter->VTable0x60(this);
}
}
}
else {
if (m_action->GetDuration() != -1) {
if (m_action->GetElapsedTime() > m_action->GetDuration() + m_action->GetStartTime()) {
m_unk0x95 = TRUE;
}
}
}
}
// FUNCTION: LEGO1 0x1006cb40
// FUNCTION: BETA10 0x1005239a
void LegoLoopingAnimPresenter::PutFrame()
{
MxLong time;
if (m_action->GetStartTime() <= m_action->GetElapsedTime()) {
time = (m_action->GetElapsedTime() - m_action->GetStartTime()) % m_anim->GetDuration();
}
else {
time = 0;
}
FUN_1006b9a0(m_anim, time, m_unk0x78);
if (m_unk0x8c != NULL && m_currentWorld != NULL && m_currentWorld->GetCameraController() != NULL) {
for (MxS32 i = 0; i < m_unk0x94; i++) {
if (m_unk0x8c[i] != NULL) {
MxMatrix mat(m_unk0x8c[i]->GetLocal2World());
Vector3 pos(mat[0]);
Vector3 dir(mat[1]);
Vector3 up(mat[2]);
Vector3 und(mat[3]);
float possqr = sqrt(pos.LenSquared());
float dirsqr = sqrt(dir.LenSquared());
float upsqr = sqrt(up.LenSquared());
up = und;
up -= m_currentWorld->GetCameraController()->GetWorldLocation();
dir /= dirsqr;
pos.EqualsCross(dir, up);
pos.Unitize();
up.EqualsCross(pos, dir);
pos *= possqr;
dir *= dirsqr;
up *= upsqr;
m_unk0x8c[i]->SetLocal2World(mat);
m_unk0x8c[i]->WrappedUpdateWorldData();
}
}
}
}

View File

@ -35,7 +35,7 @@ void LegoModelPresenter::configureLegoModelPresenter(MxS32 p_modelPresenterConfi
// FUNCTION: LEGO1 0x1007f670
void LegoModelPresenter::Destroy(MxBool p_fromDestructor)
{
m_criticalSection.Enter();
ENTER(m_criticalSection);
m_roi = NULL;
m_addedToView = FALSE;
m_criticalSection.Leave();

View File

@ -31,7 +31,7 @@ void LegoPalettePresenter::Init()
// FUNCTION: LEGO1 0x1007a0e0
void LegoPalettePresenter::Destroy(MxBool p_fromDestructor)
{
m_criticalSection.Enter();
ENTER(m_criticalSection);
if (m_palette) {
delete m_palette;
}

View File

@ -41,7 +41,7 @@ MxResult LegoPartPresenter::AddToManager()
// FUNCTION: LEGO1 0x1007c9d0
void LegoPartPresenter::Destroy(MxBool p_fromDestructor)
{
m_criticalSection.Enter();
ENTER(m_criticalSection);
VideoManager()->UnregisterPresenter(*this);
if (m_parts) {

View File

@ -545,14 +545,14 @@ void LegoVideoManager::EnableFullScreenMovie(MxBool p_enable, MxBool p_scale)
m_palette = m_videoParam.GetPalette()->Clone();
OverrideSkyColor(FALSE);
m_displaySurface->GetVideoParam().Flags().SetF1bit3(p_scale);
m_displaySurface->GetVideoParam().Flags().SetDoubleScaling(p_scale);
m_render3d = FALSE;
m_fullScreenMovie = TRUE;
}
else {
m_displaySurface->ClearScreen();
m_displaySurface->GetVideoParam().Flags().SetF1bit3(FALSE);
m_displaySurface->GetVideoParam().Flags().SetDoubleScaling(FALSE);
// restore previous pallete
RealizePalette(m_palette);
@ -577,10 +577,10 @@ void LegoVideoManager::EnableFullScreenMovie(MxBool p_enable, MxBool p_scale)
}
if (p_enable) {
m_displaySurface->GetVideoParam().Flags().SetF1bit3(p_scale);
m_displaySurface->GetVideoParam().Flags().SetDoubleScaling(p_scale);
}
else {
m_displaySurface->GetVideoParam().Flags().SetF1bit3(FALSE);
m_displaySurface->GetVideoParam().Flags().SetDoubleScaling(FALSE);
}
}

View File

@ -87,7 +87,7 @@ MxLong ElevatorBottom::HandleControl(LegoControlManagerNotificationParam& p_para
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case ElevbottScript::c_LeftArrow_Ctl:
m_destLocation = LegoGameState::e_infodoor;

View File

@ -389,7 +389,7 @@ MxLong GasStation::HandleButtonDown(LegoControlManagerNotificationParam& p_param
// FUNCTION: BETA10 0x10029445
MxLong GasStation::HandleControl(LegoControlManagerNotificationParam& p_param)
{
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
MxDSAction action;
switch (p_param.m_clickedObjectId) {

View File

@ -555,7 +555,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
// FUNCTION: LEGO1 0x10075f90
MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param)
{
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case HospitalScript::c_Info_Ctl:
BackgroundAudioManager()->RaiseVolume();

View File

@ -948,7 +948,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
// FUNCTION: BETA10 0x1002ffd4
MxU8 Infocenter::HandleControl(LegoControlManagerNotificationParam& p_param)
{
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
m_infoManDialogueTimer = 0;
InfomainScript::Script actionToPlay = InfomainScript::c_noneInfomain;

View File

@ -96,7 +96,7 @@ MxLong InfocenterDoor::HandleControl(LegoControlManagerNotificationParam& p_para
{
MxLong result = 0;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
DeleteObjects(&m_atomId, InfodoorScript::c_iic037in_PlayWav, 510);
switch (p_param.m_clickedObjectId) {

View File

@ -284,7 +284,7 @@ void Isle::ReadyWorld()
// FUNCTION: LEGO1 0x10031030
MxLong Isle::HandleControl(LegoControlManagerNotificationParam& p_param)
{
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
MxDSAction action;
switch (p_param.m_clickedObjectId) {
@ -577,7 +577,7 @@ void Isle::Enable(MxBool p_enable)
if (UserActor() != NULL && UserActor()->IsA("Jetski")) {
IslePathActor* actor = (IslePathActor*) UserActor();
actor->SpawnPlayer(
LegoGameState::e_unk45,
LegoGameState::e_jetskiSpawn,
FALSE,
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
);
@ -1633,7 +1633,7 @@ void Act1State::PlaceActors()
if (m_helicopter != NULL) {
if (!m_helicopterPlane.IsPresent()) {
m_helicopter->SpawnPlayer(LegoGameState::e_unk40, FALSE, 0);
m_helicopter->SpawnPlayer(LegoGameState::e_helicopterSpawn, FALSE, 0);
}
else {
isle->PlaceActor(m_helicopter, m_helicopterPlane.GetName(), 0, 0.5f, 1, 0.5f);
@ -1673,7 +1673,7 @@ void Act1State::PlaceActors()
if (m_jetski != NULL) {
if (!m_jetskiPlane.IsPresent()) {
m_jetski->SpawnPlayer(LegoGameState::e_unk45, FALSE, 0);
m_jetski->SpawnPlayer(LegoGameState::e_jetskiSpawn, FALSE, 0);
}
else {
isle->PlaceActor(m_jetski, m_jetskiPlane.GetName(), 0, 0.5f, 1, 0.5f);
@ -1703,7 +1703,7 @@ void Act1State::PlaceActors()
if (m_dunebuggy != NULL) {
if (!m_dunebuggyPlane.IsPresent()) {
m_dunebuggy->SpawnPlayer(LegoGameState::e_unk43, FALSE, 0);
m_dunebuggy->SpawnPlayer(LegoGameState::e_dunebuggySpawn, FALSE, 0);
}
else {
isle->PlaceActor(m_dunebuggy, m_dunebuggyPlane.GetName(), 0, 0.5f, 1, 0.5f);
@ -1731,7 +1731,7 @@ void Act1State::PlaceActors()
if (m_racecar != NULL) {
if (!m_racecarPlane.IsPresent()) {
m_racecar->SpawnPlayer(LegoGameState::e_unk44, FALSE, 0);
m_racecar->SpawnPlayer(LegoGameState::e_racecarSpawn, FALSE, 0);
}
else {
isle->PlaceActor(m_racecar, m_racecarPlane.GetName(), 0, 0.5f, 1, 0.5f);

View File

@ -123,7 +123,7 @@ MxBool JukeBox::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxStillPresenter* presenter;
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case JukeboxwScript::c_Dback_Ctl:
switch (m_state->m_music) {

View File

@ -7,10 +7,10 @@
#include "islepathactor.h"
#include "jukebox_actions.h"
#include "legoanimationmanager.h"
#include "legoanimpresenter.h"
#include "legocachesoundmanager.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legolocomotionanimpresenter.h"
#include "legomain.h"
#include "legopathstruct.h"
#include "legosoundmanager.h"
@ -1117,7 +1117,7 @@ MxResult LegoAct2::FUN_10052560(
action.SetDirection(*p_direction);
}
StartActionIfUnknown0x13c(action);
StartActionIfInitialized(action);
}
else {
MxMatrix matrix;

View File

@ -101,7 +101,7 @@ void Police::ReadyWorld()
// FUNCTION: LEGO1 0x1005e550
MxLong Police::HandleControl(LegoControlManagerNotificationParam& p_param)
{
if (p_param.m_unk0x28 == 1) {
if (p_param.m_enabledChild == 1) {
switch (p_param.m_clickedObjectId) {
case PoliceScript::c_LeftArrow_Ctl:
case PoliceScript::c_RightArrow_Ctl:

View File

@ -241,7 +241,7 @@ MxLong RegistrationBook::HandleKeyPress(SDL_Keycode p_key)
// FUNCTION: LEGO1 0x100774a0
MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxS16 buttonId = p_param.m_unk0x28;
MxS16 buttonId = p_param.m_enabledChild;
const InternationalCharacter* intChar = NULL;
for (int i = 0; i < sizeOfArray(m_intAlphabet); i++) {

View File

@ -165,7 +165,7 @@ void Score::ReadyWorld()
// FUNCTION: LEGO1 0x100016d0
MxLong Score::FUN_100016d0(LegoControlManagerNotificationParam& p_param)
{
MxS16 unk0x28 = p_param.m_unk0x28;
MxS16 unk0x28 = p_param.m_enabledChild;
if (unk0x28 == 1 || p_param.m_clickedObjectId == InfoscorScript::c_LegoBox_Ctl) {
switch (p_param.m_clickedObjectId) {

View File

@ -10,20 +10,20 @@ DECOMP_SIZE_ASSERT(LegoTranslationKey, 0x14)
DECOMP_SIZE_ASSERT(LegoRotationKey, 0x18)
DECOMP_SIZE_ASSERT(LegoScaleKey, 0x14)
DECOMP_SIZE_ASSERT(LegoMorphKey, 0x0c)
DECOMP_SIZE_ASSERT(LegoUnknownKey, 0x0c)
DECOMP_SIZE_ASSERT(LegoRotationZKey, 0x0c)
DECOMP_SIZE_ASSERT(LegoAnimNodeData, 0x34)
DECOMP_SIZE_ASSERT(LegoAnimActorEntry, 0x08)
DECOMP_SIZE_ASSERT(LegoAnimScene, 0x24)
DECOMP_SIZE_ASSERT(LegoAnim, 0x18)
// FUNCTION: LEGO1 0x1009f000
LegoUnknownKey::LegoUnknownKey()
LegoRotationZKey::LegoRotationZKey()
{
m_z = 0.0f;
}
// FUNCTION: LEGO1 0x1009f020
LegoResult LegoUnknownKey::Read(LegoStorage* p_storage)
LegoResult LegoRotationZKey::Read(LegoStorage* p_storage)
{
LegoResult result;
@ -40,7 +40,7 @@ LegoResult LegoUnknownKey::Read(LegoStorage* p_storage)
// FUNCTION: LEGO1 0x1009f060
// FUNCTION: BETA10 0x1018133f
LegoResult LegoUnknownKey::Write(LegoStorage* p_storage)
LegoResult LegoRotationZKey::Write(LegoStorage* p_storage)
{
LegoResult result;
@ -58,33 +58,33 @@ LegoResult LegoUnknownKey::Write(LegoStorage* p_storage)
// FUNCTION: LEGO1 0x1009f0a0
LegoAnimScene::LegoAnimScene()
{
m_unk0x00 = 0;
m_unk0x04 = NULL;
m_unk0x08 = 0;
m_unk0x0c = NULL;
m_unk0x10 = 0;
m_unk0x14 = NULL;
m_unk0x18 = 0;
m_unk0x1c = 0;
m_unk0x20 = 0;
m_translationKeysCount = 0;
m_translationKeys = NULL;
m_targetKeysCount = 0;
m_targetKeys = NULL;
m_rotationKeysCount = 0;
m_rotationKeys = NULL;
m_targetIndex = 0;
m_translationIndex = 0;
m_rotationIndex = 0;
}
// FUNCTION: LEGO1 0x1009f0d0
LegoAnimScene::~LegoAnimScene()
{
if (m_unk0x04 != NULL) {
delete[] m_unk0x04;
m_unk0x04 = NULL;
if (m_translationKeys != NULL) {
delete[] m_translationKeys;
m_translationKeys = NULL;
}
if (m_unk0x0c != NULL) {
delete[] m_unk0x0c;
m_unk0x0c = NULL;
if (m_targetKeys != NULL) {
delete[] m_targetKeys;
m_targetKeys = NULL;
}
if (m_unk0x14 != NULL) {
delete[] m_unk0x14;
m_unk0x14 = NULL;
if (m_rotationKeys != NULL) {
delete[] m_rotationKeys;
m_rotationKeys = NULL;
}
}
@ -95,34 +95,34 @@ LegoResult LegoAnimScene::Write(LegoStorage* p_storage)
LegoResult result;
LegoS32 i;
if ((result = p_storage->Write(&m_unk0x00, sizeof(LegoU16))) != SUCCESS) {
if ((result = p_storage->Write(&m_translationKeysCount, sizeof(LegoU16))) != SUCCESS) {
return result;
}
if (m_unk0x00 != 0) {
for (i = 0; i < m_unk0x00; i++) {
if ((result = m_unk0x04[i].Write(p_storage)) != SUCCESS) {
if (m_translationKeysCount != 0) {
for (i = 0; i < m_translationKeysCount; i++) {
if ((result = m_translationKeys[i].Write(p_storage)) != SUCCESS) {
return result;
}
}
}
if ((result = p_storage->Write(&m_unk0x08, sizeof(LegoU16))) != SUCCESS) {
if ((result = p_storage->Write(&m_targetKeysCount, sizeof(LegoU16))) != SUCCESS) {
return result;
}
if (m_unk0x08 != 0) {
for (i = 0; i < m_unk0x08; i++) {
if ((result = m_unk0x0c[i].Write(p_storage)) != SUCCESS) {
if (m_targetKeysCount != 0) {
for (i = 0; i < m_targetKeysCount; i++) {
if ((result = m_targetKeys[i].Write(p_storage)) != SUCCESS) {
return result;
}
}
}
if ((result = p_storage->Write(&m_unk0x10, sizeof(LegoU16))) != SUCCESS) {
if ((result = p_storage->Write(&m_rotationKeysCount, sizeof(LegoU16))) != SUCCESS) {
return result;
}
if (m_unk0x10 != 0) {
for (i = 0; i < m_unk0x10; i++) {
if ((result = m_unk0x14[i].Write(p_storage)) != SUCCESS) {
if (m_rotationKeysCount != 0) {
for (i = 0; i < m_rotationKeysCount; i++) {
if ((result = m_rotationKeys[i].Write(p_storage)) != SUCCESS) {
return result;
}
}
@ -137,37 +137,37 @@ LegoResult LegoAnimScene::Read(LegoStorage* p_storage)
LegoResult result;
LegoS32 i;
if ((result = p_storage->Read(&m_unk0x00, sizeof(LegoU16))) != SUCCESS) {
if ((result = p_storage->Read(&m_translationKeysCount, sizeof(LegoU16))) != SUCCESS) {
return result;
}
if (m_unk0x00 != 0) {
m_unk0x04 = new LegoTranslationKey[m_unk0x00];
for (i = 0; i < m_unk0x00; i++) {
if ((result = m_unk0x04[i].Read(p_storage)) != SUCCESS) {
if (m_translationKeysCount != 0) {
m_translationKeys = new LegoTranslationKey[m_translationKeysCount];
for (i = 0; i < m_translationKeysCount; i++) {
if ((result = m_translationKeys[i].Read(p_storage)) != SUCCESS) {
goto done;
}
}
}
if ((result = p_storage->Read(&m_unk0x08, sizeof(LegoU16))) != SUCCESS) {
if ((result = p_storage->Read(&m_targetKeysCount, sizeof(LegoU16))) != SUCCESS) {
return result;
}
if (m_unk0x08 != 0) {
m_unk0x0c = new LegoTranslationKey[m_unk0x08];
for (i = 0; i < m_unk0x08; i++) {
if ((result = m_unk0x0c[i].Read(p_storage)) != SUCCESS) {
if (m_targetKeysCount != 0) {
m_targetKeys = new LegoTranslationKey[m_targetKeysCount];
for (i = 0; i < m_targetKeysCount; i++) {
if ((result = m_targetKeys[i].Read(p_storage)) != SUCCESS) {
goto done;
}
}
}
if ((result = p_storage->Read(&m_unk0x10, sizeof(LegoU16))) != SUCCESS) {
if ((result = p_storage->Read(&m_rotationKeysCount, sizeof(LegoU16))) != SUCCESS) {
return result;
}
if (m_unk0x10 != 0) {
m_unk0x14 = new LegoUnknownKey[m_unk0x10];
for (i = 0; i < m_unk0x10; i++) {
if ((result = m_unk0x14[i].Read(p_storage)) != SUCCESS) {
if (m_rotationKeysCount != 0) {
m_rotationKeys = new LegoRotationZKey[m_rotationKeysCount];
for (i = 0; i < m_rotationKeysCount; i++) {
if ((result = m_rotationKeys[i].Read(p_storage)) != SUCCESS) {
goto done;
}
}
@ -176,22 +176,22 @@ LegoResult LegoAnimScene::Read(LegoStorage* p_storage)
return SUCCESS;
done:
if (m_unk0x04 != NULL) {
delete[] m_unk0x04;
m_unk0x00 = 0;
m_unk0x04 = NULL;
if (m_translationKeys != NULL) {
delete[] m_translationKeys;
m_translationKeysCount = 0;
m_translationKeys = NULL;
}
if (m_unk0x0c != NULL) {
delete[] m_unk0x0c;
m_unk0x08 = 0;
m_unk0x0c = NULL;
if (m_targetKeys != NULL) {
delete[] m_targetKeys;
m_targetKeysCount = 0;
m_targetKeys = NULL;
}
if (m_unk0x14 != NULL) {
delete[] m_unk0x14;
m_unk0x10 = 0;
m_unk0x14 = NULL;
if (m_rotationKeys != NULL) {
delete[] m_rotationKeys;
m_rotationKeysCount = 0;
m_rotationKeys = NULL;
}
return result;
@ -199,82 +199,95 @@ LegoResult LegoAnimScene::Read(LegoStorage* p_storage)
// FUNCTION: LEGO1 0x1009f490
// FUNCTION: BETA10 0x10181a83
LegoResult LegoAnimScene::FUN_1009f490(LegoFloat p_time, Matrix4& p_matrix)
LegoResult LegoAnimScene::CalculateCameraTransform(LegoFloat p_time, Matrix4& p_matrix)
{
MxMatrix localb0;
MxMatrix local4c;
MxMatrix tempMatrix;
MxMatrix original;
Vector3 local5c(localb0[0]);
Vector3 local68(localb0[1]);
Vector3 local54(localb0[2]);
Vector3 localb8(localb0[3]);
Vector3 column0(tempMatrix[0]);
Vector3 column1(tempMatrix[1]);
Vector3 column2(tempMatrix[2]);
Vector3 column3(tempMatrix[3]);
Mx3DPointFloat localcc;
Mx3DPointFloat tempTranslation;
localb0.SetIdentity();
tempMatrix.SetIdentity();
LegoU32 local60;
if (m_unk0x08 != 0) {
local60 = GetUnknown0x18();
LegoAnimNodeData::GetTranslation(m_unk0x08, m_unk0x0c, p_time, localb0, local60);
SetUnknown0x18(local60);
localcc = localb8;
localb8.Clear();
LegoU32 translationIndex;
if (m_targetKeysCount != 0) {
translationIndex = GetTargetIndex();
LegoAnimNodeData::GetTranslation(m_targetKeysCount, m_targetKeys, p_time, tempMatrix, translationIndex);
SetTargetIndex(translationIndex);
tempTranslation = column3;
column3.Clear();
}
if (m_unk0x00 != 0) {
local60 = GetUnknown0x1c();
LegoAnimNodeData::GetTranslation(m_unk0x00, m_unk0x04, p_time, localb0, local60);
SetUnknown0x1c(local60);
if (m_translationKeysCount != 0) {
translationIndex = GetTranslationIndex();
LegoAnimNodeData::GetTranslation(
m_translationKeysCount,
m_translationKeys,
p_time,
tempMatrix,
translationIndex
);
SetTranslationIndex(translationIndex);
}
local54 = localcc;
local54 -= localb8;
column2 = tempTranslation;
column2 -= column3;
if (local54.Unitize() == 0) {
local5c.EqualsCross(local68, local54);
if (column2.Unitize() == 0) {
column0.EqualsCross(column1, column2);
if (local5c.Unitize() == 0) {
local68.EqualsCross(local54, local5c);
if (column0.Unitize() == 0) {
column1.EqualsCross(column2, column0);
localcc = p_matrix[3];
localcc += localb0[3];
tempTranslation = p_matrix[3];
tempTranslation += tempMatrix[3];
p_matrix[3][0] = p_matrix[3][1] = p_matrix[3][2] = localb0[3][0] = localb0[3][1] = localb0[3][2] = 0;
p_matrix[3][0] = p_matrix[3][1] = p_matrix[3][2] = tempMatrix[3][0] = tempMatrix[3][1] = tempMatrix[3][2] =
0;
if (m_unk0x10 != 0) {
LegoU32 locald0 = -1;
LegoU32 locald8;
locald0 = GetUnknown0x20();
if (m_rotationKeysCount != 0) {
LegoU32 old_index = -1;
LegoU32 i;
old_index = GetRotationIndex();
LegoU32 localdc =
LegoAnimNodeData::FindKeys(p_time, m_unk0x10, m_unk0x14, sizeof(*m_unk0x14), locald8, locald0);
LegoU32 count = LegoAnimNodeData::FindKeys(
p_time,
m_rotationKeysCount,
m_rotationKeys,
sizeof(*m_rotationKeys),
i,
old_index
);
SetUnknown0x20(locald0);
SetRotationIndex(old_index);
switch (localdc) {
switch (count) {
case 1:
p_matrix.RotateZ(m_unk0x14[locald8].GetZ());
p_matrix.RotateZ(m_rotationKeys[i].GetZ());
break;
case 2:
// Seems to be unused
LegoFloat z = LegoAnimNodeData::Interpolate(
p_time,
m_unk0x14[locald8],
m_unk0x14[locald8].GetZ(),
m_unk0x14[locald8 + 1],
m_unk0x14[locald8 + 1].GetZ()
m_rotationKeys[i],
m_rotationKeys[i].GetZ(),
m_rotationKeys[i + 1],
m_rotationKeys[i + 1].GetZ()
);
p_matrix.RotateZ(m_unk0x14[locald8].GetZ());
p_matrix.RotateZ(m_rotationKeys[i].GetZ());
break;
}
}
local4c = p_matrix;
p_matrix.Product(local4c.GetData(), localb0.GetData());
p_matrix[3][0] = localcc[0];
p_matrix[3][1] = localcc[1];
p_matrix[3][2] = localcc[2];
original = p_matrix;
p_matrix.Product(original.GetData(), tempMatrix.GetData());
p_matrix[3][0] = tempTranslation[0];
p_matrix[3][1] = tempTranslation[1];
p_matrix[3][2] = tempTranslation[2];
}
}

View File

@ -137,9 +137,9 @@ class LegoMorphKey : public LegoAnimKey {
};
// SIZE 0x0c
class LegoUnknownKey : public LegoAnimKey {
class LegoRotationZKey : public LegoAnimKey {
public:
LegoUnknownKey();
LegoRotationZKey();
LegoResult Read(LegoStorage* p_storage);
LegoResult Write(LegoStorage* p_storage);
@ -309,26 +309,26 @@ class LegoAnimScene {
~LegoAnimScene();
LegoResult Read(LegoStorage* p_storage);
LegoResult Write(LegoStorage* p_storage);
LegoResult FUN_1009f490(LegoFloat p_time, Matrix4& p_matrix);
LegoResult CalculateCameraTransform(LegoFloat p_time, Matrix4& p_matrix);
LegoU32 GetUnknown0x18() { return m_unk0x18; }
LegoU32 GetUnknown0x1c() { return m_unk0x1c; }
LegoU32 GetUnknown0x20() { return m_unk0x20; }
LegoU32 GetTargetIndex() { return m_targetIndex; }
LegoU32 GetTranslationIndex() { return m_translationIndex; }
LegoU32 GetRotationIndex() { return m_rotationIndex; }
void SetUnknown0x18(LegoU32 p_unk0x18) { m_unk0x18 = p_unk0x18; }
void SetUnknown0x1c(LegoU32 p_unk0x1c) { m_unk0x1c = p_unk0x1c; }
void SetUnknown0x20(LegoU32 p_unk0x20) { m_unk0x20 = p_unk0x20; }
void SetTargetIndex(LegoU32 p_targetIndex) { m_targetIndex = p_targetIndex; }
void SetTranslationIndex(LegoU32 p_translationIndex) { m_translationIndex = p_translationIndex; }
void SetRotationIndex(LegoU32 p_rotationIndex) { m_rotationIndex = p_rotationIndex; }
private:
LegoU16 m_unk0x00; // 0x00
LegoTranslationKey* m_unk0x04; // 0x04
LegoU16 m_unk0x08; // 0x08
LegoTranslationKey* m_unk0x0c; // 0x0c
LegoU16 m_unk0x10; // 0x10
LegoUnknownKey* m_unk0x14; // 0x14
LegoU32 m_unk0x18; // 0x18
LegoU32 m_unk0x1c; // 0x1c
LegoU32 m_unk0x20; // 0x20
LegoU16 m_translationKeysCount; // 0x00
LegoTranslationKey* m_translationKeys; // 0x04
LegoU16 m_targetKeysCount; // 0x08
LegoTranslationKey* m_targetKeys; // 0x0c
LegoU16 m_rotationKeysCount; // 0x10
LegoRotationZKey* m_rotationKeys; // 0x14
LegoU32 m_targetIndex; // 0x18
LegoU32 m_translationIndex; // 0x1c
LegoU32 m_rotationIndex; // 0x20
};
// VTABLE: LEGO1 0x100db8d8

View File

@ -87,13 +87,10 @@
#include "lego/legoomni/include/legoextraactor.h"
#include "lego/legoomni/include/legoflctexturepresenter.h"
#include "lego/legoomni/include/legogamestate.h"
#include "lego/legoomni/include/legohideanimpresenter.h"
#include "lego/legoomni/include/legoinputmanager.h"
#include "lego/legoomni/include/legoloadcachesoundpresenter.h"
#include "lego/legoomni/include/legolocations.h"
#include "lego/legoomni/include/legolocomotionanimpresenter.h"
#include "lego/legoomni/include/legolodlist.h"
#include "lego/legoomni/include/legoloopinganimpresenter.h"
#include "lego/legoomni/include/legomain.h"
#include "lego/legoomni/include/legometerpresenter.h"
#include "lego/legoomni/include/legomodelpresenter.h"
@ -239,7 +236,6 @@
#include "omni/include/mxlist.h"
#include "omni/include/mxloopingflcpresenter.h"
#include "omni/include/mxloopingsmkpresenter.h"
#include "omni/include/mxmediamanager.h"
#include "omni/include/mxmediapresenter.h"
#include "omni/include/mxmemorypool.h"
#include "omni/include/mxmisc.h"
@ -252,6 +248,7 @@
#include "omni/include/mxomnicreateparam.h"
#include "omni/include/mxpalette.h"
#include "omni/include/mxparam.h"
#include "omni/include/mxpresentationmanager.h"
#include "omni/include/mxpresenter.h"
#include "omni/include/mxpresenterlist.h"
#include "omni/include/mxqueue.h"

View File

@ -1,7 +1,12 @@
#ifndef MINIWIN
#include <initguid.h>
#endif
#include "mxdirect3d.h"
#include <SDL3/SDL.h> // for SDL_Log
#include <assert.h>
#include <miniwin/miniwind3d.h>
DECOMP_SIZE_ASSERT(MxDirect3D, 0x894)
@ -44,6 +49,7 @@ BOOL MxDirect3D::Create(
)
{
BOOL success = FALSE;
IDirect3DMiniwin* miniwind3d = nullptr;
assert(m_currentDeviceInfo);
if (!MxDirectDraw::Create(
@ -64,6 +70,21 @@ BOOL MxDirect3D::Create(
goto done;
}
if (m_pDirect3d->QueryInterface(IID_IDirect3DMiniwin, (void**) &miniwind3d) == DD_OK) {
MxVideoParam* videoParam = (MxVideoParam*) SDL_GetPointerProperty(
SDL_GetWindowProperties(reinterpret_cast<SDL_Window*>(hWnd)),
ISLE_PROP_WINDOW_CREATE_VIDEO_PARAM,
nullptr
);
#ifndef MXDIRECTX_FOR_CONFIG
assert(videoParam);
#endif
if (videoParam) {
miniwind3d->RequestMSAA(videoParam->GetMSAASamples());
miniwind3d->RequestAnisotropic(videoParam->GetAnisotropic());
}
}
if (!D3DSetMode()) {
goto done;
}

View File

@ -1,7 +1,10 @@
#include "mxdirectxinfo.h"
#include "omni/include/mxvideoparam.h"
#include <SDL3/SDL_log.h>
#include <assert.h>
#include <miniwin/miniwind3d.h>
#include <stdio.h> // for vsprintf
DECOMP_SIZE_ASSERT(MxAssignedDevice, 0xe4)
@ -216,12 +219,29 @@ BOOL MxDeviceEnumerate::EnumDirectDrawCallback(LPGUID p_guid, LPSTR p_driverDesc
LPDIRECTDRAW lpDD = NULL;
MxDriver& newDevice = m_ddInfo.back();
HRESULT result = DirectDrawCreate(newDevice.m_guid, &lpDD, NULL);
IDirect3DMiniwin* miniwind3d = nullptr;
if (result != DD_OK) {
BuildErrorString("DirectDraw Create failed: %s\n", EnumerateErrorToString(result));
goto done;
}
result = lpDD->QueryInterface(IID_IDirect3DMiniwin, (void**) &miniwind3d);
if (result == DD_OK) {
MxVideoParam* videoParam = (MxVideoParam*) SDL_GetPointerProperty(
SDL_GetWindowProperties(reinterpret_cast<SDL_Window*>(m_hWnd)),
ISLE_PROP_WINDOW_CREATE_VIDEO_PARAM,
nullptr
);
#ifndef MXDIRECTX_FOR_CONFIG
assert(videoParam);
#endif
if (videoParam) {
miniwind3d->RequestMSAA(videoParam->GetMSAASamples());
miniwind3d->RequestAnisotropic(videoParam->GetAnisotropic());
}
}
result = lpDD->SetCooperativeLevel(m_hWnd, DDSCL_NORMAL);
if (result != DD_OK) {
BuildErrorString("SetCooperativeLevel failed: %s\n", EnumerateErrorToString(result));

View File

@ -2,11 +2,12 @@
#define MXAUDIOMANAGER_H
#include "decomp.h"
#include "mxmediamanager.h"
#include "mxpresentationmanager.h"
// VTABLE: LEGO1 0x100dc6e0
// VTABLE: BETA10 0x101c2348
// SIZE 0x30
class MxAudioManager : public MxMediaManager {
class MxAudioManager : public MxPresentationManager {
public:
MxAudioManager();
~MxAudioManager() override;
@ -15,11 +16,13 @@ class MxAudioManager : public MxMediaManager {
void Destroy() override; // vtable+18
// FUNCTION: LEGO1 0x10029910
// FUNCTION: BETA10 0x100d0630
virtual MxS32 GetVolume() { return m_volume; } // vtable+28
virtual void SetVolume(MxS32 p_volume); // vtable+2c
// SYNTHETIC: LEGO1 0x100b8d70
// SYNTHETIC: BETA10 0x10145110
// MxAudioManager::`scalar deleting destructor'
private:

View File

@ -3,15 +3,27 @@
class MxCriticalSection;
#ifdef BETA10
#define AUTOLOCK(CS) MxAutoLock lock(&CS, __FILE__, __LINE__)
#else
#define AUTOLOCK(CS) MxAutoLock lock(&CS)
#endif
class MxAutoLock {
public:
#ifdef BETA10
MxAutoLock(MxCriticalSection* p_criticalSection, const char* filename, int line);
#else
MxAutoLock(MxCriticalSection* p_criticalSection);
#endif
~MxAutoLock();
private:
MxCriticalSection* m_criticalSection; // 0x00
#ifdef BETA10
unsigned long m_currentThreadId; // 0x04
#endif
};
#endif // MXAUTOLOCK_H

View File

@ -11,7 +11,11 @@ class MxCriticalSection {
static void SetDoMutex();
#ifdef BETA10
void Enter(unsigned long p_threadId, const char* filename, int line);
#else
void Enter();
#endif
void Leave();
private:
@ -22,4 +26,11 @@ class MxCriticalSection {
SDL_Mutex* m_mutex;
};
#ifdef BETA10
// TODO: Not quite correct yet, the second argument becomes a relocated value
#define ENTER(criticalSection) criticalSection.Enter(-1, NULL, 0)
#else
#define ENTER(criticalSection) criticalSection.Enter()
#endif
#endif // MXCRITICALSECTION_H

View File

@ -2,11 +2,11 @@
#define MXEVENTMANAGER_H
#include "decomp.h"
#include "mxmediamanager.h"
#include "mxpresentationmanager.h"
// VTABLE: LEGO1 0x100dc900
// SIZE 0x2c
class MxEventManager : public MxMediaManager {
class MxEventManager : public MxPresentationManager {
public:
MxEventManager();
~MxEventManager() override;

View File

@ -254,11 +254,11 @@ inline MxBool MxListCursor<T>::Next()
template <class T>
inline MxBool MxListCursor<T>::Next(T& p_obj)
{
if (!m_match) {
m_match = m_list->m_first;
if (m_match) {
m_match = m_match->GetNext();
}
else {
m_match = m_match->GetNext();
m_match = m_list->m_first;
}
if (m_match) {

View File

@ -1,5 +1,5 @@
#ifndef MXMEDIAMANGER_H
#define MXMEDIAMANGER_H
#ifndef MXPRESENTATIONMANAGER_H
#define MXPRESENTATIONMANAGER_H
#include "mxcore.h"
#include "mxcriticalsection.h"
@ -9,11 +9,12 @@
class MxThread;
// VTABLE: LEGO1 0x100dc6b0
// VTABLE: BETA10 0x101c2318
// SIZE 0x2c
class MxMediaManager : public MxCore {
class MxPresentationManager : public MxCore {
public:
MxMediaManager();
~MxMediaManager() override;
MxPresentationManager();
~MxPresentationManager() override;
MxResult Tickle() override; // vtable+08
virtual MxResult Create(); // vtable+14
@ -25,7 +26,8 @@ class MxMediaManager : public MxCore {
MxResult Init();
// SYNTHETIC: LEGO1 0x100b8540
// MxMediaManager::`scalar deleting destructor'
// SYNTHETIC: BETA10 0x10144db0
// MxPresentationManager::`scalar deleting destructor'
protected:
MxPresenterList* m_presenters; // 0x08
@ -33,4 +35,4 @@ class MxMediaManager : public MxCore {
MxCriticalSection m_criticalSection; // 0x10
};
#endif // MXMEDIAMANGER_H
#endif // MXPRESENTATIONMANAGER_H

View File

@ -5,12 +5,15 @@
#include "mxpresenter.h"
// VTABLE: LEGO1 0x100d62f0
// VTABLE: BETA10 0x101bf070
// class MxPtrList<MxPresenter>
// VTABLE: LEGO1 0x100d6308
// VTABLE: BETA10 0x101bf050
// SIZE 0x18
class MxPresenterList : public MxPtrList<MxPresenter> {
public:
// FUNCTION: BETA10 0x100dc900
MxPresenterList(MxBool p_ownership = FALSE) : MxPtrList<MxPresenter>(p_ownership) {}
// FUNCTION: LEGO1 0x1001cd00
@ -35,6 +38,13 @@ class MxPresenterListCursor : public MxPtrListCursor<MxPresenter> {
public:
// FUNCTION: BETA10 0x1007d130
MxPresenterListCursor(MxPresenterList* p_list) : MxPtrListCursor<MxPresenter>(p_list) {}
// SYNTHETIC: LEGO1 0x1001eed0
// MxPresenterListCursor::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x1001f0c0
// SYNTHETIC: BETA10 0x1007d510
// MxPresenterListCursor::~MxPresenterListCursor
};
// VTABLE: LEGO1 0x100d6350
@ -58,7 +68,11 @@ class MxPresenterListCursor : public MxPtrListCursor<MxPresenter> {
// TEMPLATE: LEGO1 0x1001ce20
// MxList<MxPresenter *>::~MxList<MxPresenter *>
// TEMPLATE: BETA10 0x100dc9f0
// MxPtrList<MxPresenter>::MxPtrList<MxPresenter>
// TEMPLATE: LEGO1 0x1001cf20
// TEMPLATE: BETA10 0x100dce70
// MxPtrList<MxPresenter>::~MxPtrList<MxPresenter>
// SYNTHETIC: LEGO1 0x1001cf70
@ -73,10 +87,8 @@ class MxPresenterListCursor : public MxPtrListCursor<MxPresenter> {
// SYNTHETIC: LEGO1 0x1001d100
// MxPresenterList::~MxPresenterList
// SYNTHETIC: LEGO1 0x1001eed0
// MxPresenterListCursor::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x1001ef40
// TEMPLATE: BETA10 0x1007d370
// MxPtrListCursor<MxPresenter>::~MxPtrListCursor<MxPresenter>
// SYNTHETIC: LEGO1 0x1001ef90
@ -86,11 +98,9 @@ class MxPresenterListCursor : public MxPtrListCursor<MxPresenter> {
// MxPtrListCursor<MxPresenter>::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x1001f070
// TEMPLATE: BETA10 0x1007d490
// MxListCursor<MxPresenter *>::~MxListCursor<MxPresenter *>
// FUNCTION: LEGO1 0x1001f0c0
// MxPresenterListCursor::~MxPresenterListCursor
// TEMPLATE: LEGO1 0x10020760
// MxListCursor<MxPresenter *>::MxListCursor<MxPresenter *>
@ -106,6 +116,18 @@ class MxPresenterListCursor : public MxPtrListCursor<MxPresenter> {
// TEMPLATE: BETA10 0x1007d270
// MxListCursor<MxPresenter *>::MxListCursor<MxPresenter *>
// TEMPLATE: BETA10 0x1007dc60
// MxListCursor<MxPresenter *>::Next
// TEMPLATE: BETA10 0x100d8f20
// MxListCursor<MxPresenter *>::Reset
// TEMPLATE: BETA10 0x1007e070
// MxListEntry<MxPresenter *>::GetNext
// TEMPLATE: BETA10 0x1007e0a0
// MxListEntry<MxPresenter *>::GetValue
// TEMPLATE: BETA10 0x100d9420
// ?Prev@?$MxListCursor@PAVMxPresenter@@@@QAEEAAPAVMxPresenter@@@Z

View File

@ -6,17 +6,20 @@
#include <SDL3/SDL_mutex.h>
// VTABLE: LEGO1 0x100dccf0
// VTABLE: BETA10 0x101c28ac
// SIZE 0x08
class MxSemaphore {
public:
MxSemaphore();
// FUNCTION: LEGO1 0x100c87e0
// FUNCTION: BETA10 0x101592a9
~MxSemaphore() { SDL_DestroySemaphore(m_semaphore); }
virtual MxResult Init(MxU32 p_initialCount, MxU32 p_maxCount);
void Wait();
void Acquire();
void TryAcquire();
void Release();
private:

View File

@ -26,7 +26,11 @@ class MxSoundManager : public MxAudioManager {
float GetAttenuation(MxU32 p_volume);
MxPresenter* FUN_100aebd0(const MxAtomId& p_atomId, MxU32 p_objectId);
MxPresenter* FindPresenter(const MxAtomId& p_atomId, MxU32 p_objectId);
// SYNTHETIC: LEGO1 0x100ae7b0
// SYNTHETIC: BETA10 0x10133460
// MxSoundManager::`scalar deleting destructor'
protected:
void Init();
@ -49,7 +53,4 @@ class MxSoundManager : public MxAudioManager {
undefined m_unk0x38[4];
};
// SYNTHETIC: LEGO1 0x100ae7b0
// MxSoundManager::`scalar deleting destructor'
#endif // MXSOUNDMANAGER_H

Some files were not shown because too many files have changed in this diff Show More