Merge branch 'master' into 10

This commit is contained in:
Christian Semmler 2025-06-26 17:05:29 -07:00 committed by GitHub
commit 1a3bce76a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 260 additions and 294 deletions

View File

@ -525,7 +525,7 @@ endif()
if (ISLE_BUILD_CONFIG) if (ISLE_BUILD_CONFIG)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets) find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
qt_standard_project_setup() qt_standard_project_setup()
qt_add_executable(config WIN32 qt_add_executable(isle-config WIN32
LEGO1/mxdirectx/mxdirectxinfo.cpp LEGO1/mxdirectx/mxdirectxinfo.cpp
LEGO1/mxdirectx/legodxinfo.cpp LEGO1/mxdirectx/legodxinfo.cpp
CONFIG/config.cpp CONFIG/config.cpp
@ -535,22 +535,22 @@ if (ISLE_BUILD_CONFIG)
CONFIG/res/config.rc CONFIG/res/config.rc
CONFIG/res/config.qrc CONFIG/res/config.qrc
) )
target_link_libraries(config PRIVATE Qt6::Core Qt6::Widgets) target_link_libraries(isle-config PRIVATE Qt6::Core Qt6::Widgets)
set_property(TARGET config PROPERTY AUTOMOC ON) set_property(TARGET isle-config PROPERTY AUTOMOC ON)
set_property(TARGET config PROPERTY AUTORCC ON) set_property(TARGET isle-config PROPERTY AUTORCC ON)
set_property(TARGET config PROPERTY AUTOUIC ON) set_property(TARGET isle-config PROPERTY AUTOUIC ON)
set_property(TARGET config PROPERTY AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/CONFIG/res") set_property(TARGET isle-config PROPERTY AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/CONFIG/res")
list(APPEND isle_targets config) list(APPEND isle_targets isle-config)
target_compile_definitions(config PRIVATE _AFXDLL MXDIRECTX_FOR_CONFIG) target_compile_definitions(isle-config PRIVATE _AFXDLL MXDIRECTX_FOR_CONFIG)
target_include_directories(config PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/LEGO1") target_include_directories(isle-config PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/LEGO1")
target_include_directories(config PUBLIC "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/util>") target_include_directories(isle-config PUBLIC "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/util>")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14) if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
target_link_libraries(config PRIVATE DirectX5::DirectX5) target_link_libraries(isle-config PRIVATE DirectX5::DirectX5)
endif() endif()
target_compile_definitions(config PRIVATE DIRECT3D_VERSION=0x500) target_compile_definitions(isle-config PRIVATE DIRECT3D_VERSION=0x500)
target_link_libraries(config PRIVATE SDL3::SDL3 Isle::iniparser) target_link_libraries(isle-config PRIVATE SDL3::SDL3 Isle::iniparser)
if (NOT ISLE_MINIWIN) if (NOT ISLE_MINIWIN)
target_link_libraries(config PRIVATE ddraw dxguid) target_link_libraries(isle-config PRIVATE ddraw dxguid)
endif() endif()
endif() endif()
@ -564,8 +564,8 @@ if (MSVC)
if (TARGET isle) if (TARGET isle)
target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS") target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS")
endif() endif()
if (TARGET config) if (TARGET isle-config)
target_compile_definitions(config PRIVATE "_CRT_SECURE_NO_WARNINGS") target_compile_definitions(isle-config PRIVATE "_CRT_SECURE_NO_WARNINGS")
endif() endif()
endif() endif()
# Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus # Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus
@ -574,8 +574,8 @@ if (MSVC)
if (TARGET isle) if (TARGET isle)
target_compile_options(isle PRIVATE "-Zc:__cplusplus") target_compile_options(isle PRIVATE "-Zc:__cplusplus")
endif() endif()
if (TARGET config) if (TARGET isle-config)
target_compile_options(config PRIVATE "-Zc:__cplusplus") target_compile_options(isle-config PRIVATE "-Zc:__cplusplus")
endif() endif()
endif() endif()
endif() endif()
@ -633,7 +633,7 @@ install(TARGETS isle ${install_extra_targets}
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
) )
if (ISLE_BUILD_CONFIG) if (ISLE_BUILD_CONFIG)
install(TARGETS config install(TARGETS isle-config
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
) )
endif() endif()

View File

@ -11,6 +11,8 @@
#include "res/resource.h" #include "res/resource.h"
#include <QKeyEvent> #include <QKeyEvent>
#include <QMessageBox>
#include <QProcess>
#include <mxdirectx/legodxinfo.h> #include <mxdirectx/legodxinfo.h>
#include <ui_maindialog.h> #include <ui_maindialog.h>
@ -56,18 +58,16 @@ CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent)
connect(m_ui->musicCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxMusic); connect(m_ui->musicCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxMusic);
connect(m_ui->sound3DCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckbox3DSound); connect(m_ui->sound3DCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckbox3DSound);
connect(m_ui->joystickCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxJoystick); connect(m_ui->joystickCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxJoystick);
connect(m_ui->fullscreenCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxFullscreen);
connect(m_ui->okButton, &QPushButton::clicked, this, &CMainDialog::accept); connect(m_ui->okButton, &QPushButton::clicked, this, &CMainDialog::accept);
connect(m_ui->cancelButton, &QPushButton::clicked, this, &CMainDialog::reject); connect(m_ui->cancelButton, &QPushButton::clicked, this, &CMainDialog::reject);
connect(m_ui->launchButton, &QPushButton::clicked, this, &CMainDialog::launch);
connect(m_ui->diskPathOpen, &QPushButton::clicked, this, &CMainDialog::SelectDiskPathDialog); connect(m_ui->dataPathOpen, &QPushButton::clicked, this, &CMainDialog::SelectDataPathDialog);
connect(m_ui->cdPathOpen, &QPushButton::clicked, this, &CMainDialog::SelectCDPathDialog);
connect(m_ui->mediaPathOpen, &QPushButton::clicked, this, &CMainDialog::SelectMediaPathDialog);
connect(m_ui->savePathOpen, &QPushButton::clicked, this, &CMainDialog::SelectSavePathDialog); connect(m_ui->savePathOpen, &QPushButton::clicked, this, &CMainDialog::SelectSavePathDialog);
connect(m_ui->diskPath, &QLineEdit::textEdited, this, &CMainDialog::DiskPathEdited); connect(m_ui->dataPath, &QLineEdit::editingFinished, this, &CMainDialog::DataPathEdited);
connect(m_ui->cdPath, &QLineEdit::textEdited, this, &CMainDialog::CDPathEdited); connect(m_ui->savePath, &QLineEdit::editingFinished, this, &CMainDialog::SavePathEdited);
connect(m_ui->mediaPath, &QLineEdit::textEdited, this, &CMainDialog::MediaPathEdited);
connect(m_ui->savePath, &QLineEdit::textEdited, this, &CMainDialog::SavePathEdited);
connect(m_ui->maxLoDSlider, &QSlider::valueChanged, this, &CMainDialog::MaxLoDChanged); connect(m_ui->maxLoDSlider, &QSlider::valueChanged, this, &CMainDialog::MaxLoDChanged);
connect(m_ui->maxActorsSlider, &QSlider::valueChanged, this, &CMainDialog::MaxActorsChanged); connect(m_ui->maxActorsSlider, &QSlider::valueChanged, this, &CMainDialog::MaxActorsChanged);
@ -158,6 +158,30 @@ void CMainDialog::accept()
QDialog::accept(); QDialog::accept();
} }
void CMainDialog::launch()
{
if (m_modified) {
currentConfigApp->WriteRegisterSettings();
}
QDir::setCurrent(QCoreApplication::applicationDirPath());
QMessageBox msgBox = QMessageBox(
QMessageBox::Warning,
QString("Error!"),
QString("Unable to locate isle executable!"),
QMessageBox::Close
);
if (!QProcess::startDetached("./isle")) { // Check in isle-config directory
if (!QProcess::startDetached("isle")) { // Check in $PATH
msgBox.exec();
}
}
QDialog::accept();
}
// FUNCTION: CONFIG 0x00404360 // FUNCTION: CONFIG 0x00404360
void CMainDialog::UpdateInterface() void CMainDialog::UpdateInterface()
{ {
@ -187,9 +211,8 @@ void CMainDialog::UpdateInterface()
} }
m_ui->joystickCheckBox->setChecked(currentConfigApp->m_use_joystick); m_ui->joystickCheckBox->setChecked(currentConfigApp->m_use_joystick);
m_ui->musicCheckBox->setChecked(currentConfigApp->m_music); m_ui->musicCheckBox->setChecked(currentConfigApp->m_music);
m_ui->diskPath->setText(QString::fromStdString(currentConfigApp->m_base_path)); m_ui->fullscreenCheckBox->setChecked(currentConfigApp->m_full_screen);
m_ui->cdPath->setText(QString::fromStdString(currentConfigApp->m_cd_path)); m_ui->dataPath->setText(QString::fromStdString(currentConfigApp->m_cd_path));
m_ui->mediaPath->setText(QString::fromStdString(currentConfigApp->m_media_path));
m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path)); m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path));
} }
@ -266,54 +289,33 @@ void CMainDialog::OnCheckboxMusic(bool checked)
UpdateInterface(); UpdateInterface();
} }
void CMainDialog::SelectDiskPathDialog() void CMainDialog::OnCheckboxFullscreen(bool checked)
{ {
QString disk_path = QString::fromStdString(currentConfigApp->m_base_path); currentConfigApp->m_full_screen = checked;
disk_path = QFileDialog::getExistingDirectory(
this,
tr("Open Directory"),
disk_path,
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
);
if (disk_path.toStdString() != "") {
currentConfigApp->m_base_path = disk_path.toStdString();
m_modified = true; m_modified = true;
UpdateInterface(); UpdateInterface();
}
} }
void CMainDialog::SelectCDPathDialog() void CMainDialog::SelectDataPathDialog()
{ {
QString cd_path = QString::fromStdString(currentConfigApp->m_cd_path); QString data_path = QString::fromStdString(currentConfigApp->m_cd_path);
cd_path = QFileDialog::getExistingDirectory( data_path = QFileDialog::getExistingDirectory(
this, this,
tr("Open Directory"), tr("Open Directory"),
cd_path, data_path,
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
); );
if (cd_path.toStdString() != "") { QDir data_dir = QDir(data_path);
currentConfigApp->m_cd_path = cd_path.toStdString();
m_modified = true;
UpdateInterface();
}
}
void CMainDialog::SelectMediaPathDialog() if (data_dir.exists()) {
{ currentConfigApp->m_cd_path = data_dir.absolutePath().toStdString();
QString media_path = QString::fromStdString(currentConfigApp->m_media_path); data_dir.cd(QString("DATA"));
media_path = QFileDialog::getExistingDirectory( data_dir.cd(QString("disk"));
this, currentConfigApp->m_base_path = data_dir.absolutePath().toStdString();
tr("Open Directory"),
media_path,
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
);
if (media_path.toStdString() != "") {
currentConfigApp->m_media_path = media_path.toStdString();
m_modified = true; m_modified = true;
UpdateInterface();
} }
UpdateInterface();
} }
void CMainDialog::SelectSavePathDialog() void CMainDialog::SelectSavePathDialog()
@ -326,38 +328,39 @@ void CMainDialog::SelectSavePathDialog()
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
); );
if (save_path.toStdString() != "") { QDir save_dir = QDir(save_path);
currentConfigApp->m_save_path = save_path.toStdString();
if (save_dir.exists()) {
currentConfigApp->m_save_path = save_dir.absolutePath().toStdString();
m_modified = true; m_modified = true;
UpdateInterface();
} }
}
void CMainDialog::DiskPathEdited(const QString& text)
{
currentConfigApp->m_base_path = text.toStdString();
m_modified = true;
UpdateInterface(); UpdateInterface();
} }
void CMainDialog::CDPathEdited(const QString& text) void CMainDialog::DataPathEdited()
{ {
currentConfigApp->m_cd_path = text.toStdString(); QDir data_dir = QDir(m_ui->dataPath->text());
if (data_dir.exists()) {
currentConfigApp->m_cd_path = data_dir.absolutePath().toStdString();
data_dir.cd(QString("DATA"));
data_dir.cd(QString("disk"));
currentConfigApp->m_base_path = data_dir.absolutePath().toStdString();
m_modified = true; m_modified = true;
}
UpdateInterface(); UpdateInterface();
} }
void CMainDialog::MediaPathEdited(const QString& text) void CMainDialog::SavePathEdited()
{ {
currentConfigApp->m_media_path = text.toStdString();
m_modified = true;
UpdateInterface();
}
void CMainDialog::SavePathEdited(const QString& text) QDir save_dir = QDir(m_ui->savePath->text());
{
currentConfigApp->m_save_path = text.toStdString(); if (save_dir.exists()) {
currentConfigApp->m_save_path = save_dir.absolutePath().toStdString();
m_modified = true; m_modified = true;
}
UpdateInterface(); UpdateInterface();
} }

View File

@ -42,16 +42,14 @@ private slots:
void OnRadiobuttonTextureHighQuality(bool checked); void OnRadiobuttonTextureHighQuality(bool checked);
void OnCheckboxJoystick(bool checked); void OnCheckboxJoystick(bool checked);
void OnCheckboxMusic(bool checked); void OnCheckboxMusic(bool checked);
void OnCheckboxFullscreen(bool checked);
void accept() override; void accept() override;
void reject() override; void reject() override;
void SelectDiskPathDialog(); void launch();
void SelectCDPathDialog(); void SelectDataPathDialog();
void SelectMediaPathDialog();
void SelectSavePathDialog(); void SelectSavePathDialog();
void DiskPathEdited(const QString& text); void DataPathEdited();
void CDPathEdited(const QString& text); void SavePathEdited();
void MediaPathEdited(const QString& text);
void SavePathEdited(const QString& text);
void MaxLoDChanged(int value); void MaxLoDChanged(int value);
void MaxActorsChanged(int value); void MaxActorsChanged(int value);
}; };

View File

@ -141,7 +141,6 @@ bool CConfigApp::ReadRegisterSettings()
} }
m_base_path = iniparser_getstring(dict, "isle:diskpath", m_base_path.c_str()); m_base_path = iniparser_getstring(dict, "isle:diskpath", m_base_path.c_str());
m_cd_path = iniparser_getstring(dict, "isle:cdpath", m_cd_path.c_str()); m_cd_path = iniparser_getstring(dict, "isle:cdpath", m_cd_path.c_str());
m_media_path = iniparser_getstring(dict, "isle:mediapath", m_media_path.c_str());
m_save_path = iniparser_getstring(dict, "isle:savepath", m_save_path.c_str()); m_save_path = iniparser_getstring(dict, "isle:savepath", m_save_path.c_str());
m_display_bit_depth = iniparser_getint(dict, "isle:Display Bit Depth", -1); m_display_bit_depth = iniparser_getint(dict, "isle:Display Bit Depth", -1);
m_flip_surfaces = iniparser_getboolean(dict, "isle:Flip Surfaces", m_flip_surfaces); m_flip_surfaces = iniparser_getboolean(dict, "isle:Flip Surfaces", m_flip_surfaces);
@ -166,10 +165,6 @@ bool CConfigApp::ValidateSettings()
{ {
BOOL is_modified = FALSE; BOOL is_modified = FALSE;
if (!IsPrimaryDriver() && !m_full_screen) {
m_full_screen = TRUE;
is_modified = TRUE;
}
if (IsDeviceInBasicRGBMode()) { if (IsDeviceInBasicRGBMode()) {
if (m_3d_video_ram) { if (m_3d_video_ram) {
m_3d_video_ram = FALSE; m_3d_video_ram = FALSE;
@ -203,10 +198,6 @@ bool CConfigApp::ValidateSettings()
m_3d_video_ram = TRUE; m_3d_video_ram = TRUE;
is_modified = TRUE; is_modified = TRUE;
} }
if (!m_full_screen) {
m_full_screen = TRUE;
is_modified = TRUE;
}
} }
if ((m_display_bit_depth != 8 && m_display_bit_depth != 16) && (m_display_bit_depth != 0 || m_full_screen)) { if ((m_display_bit_depth != 8 && m_display_bit_depth != 16) && (m_display_bit_depth != 0 || m_full_screen)) {
m_display_bit_depth = 16; m_display_bit_depth = 16;
@ -302,7 +293,6 @@ void CConfigApp::WriteRegisterSettings() const
} }
iniparser_set(dict, "isle:diskpath", m_base_path.c_str()); iniparser_set(dict, "isle:diskpath", m_base_path.c_str());
iniparser_set(dict, "isle:cdpath", m_cd_path.c_str()); iniparser_set(dict, "isle:cdpath", m_cd_path.c_str());
iniparser_set(dict, "isle:mediapath", m_media_path.c_str());
iniparser_set(dict, "isle:savepath", m_save_path.c_str()); iniparser_set(dict, "isle:savepath", m_save_path.c_str());
SetIniInt(dict, "isle:Display Bit Depth", m_display_bit_depth); SetIniInt(dict, "isle:Display Bit Depth", m_display_bit_depth);

View File

@ -77,7 +77,6 @@ class CConfigApp {
std::string m_iniPath; std::string m_iniPath;
std::string m_base_path; std::string m_base_path;
std::string m_cd_path; std::string m_cd_path;
std::string m_media_path;
std::string m_save_path; std::string m_save_path;
float m_max_lod; float m_max_lod;
int m_max_actors; int m_max_actors;

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>575</width> <width>575</width>
<height>650</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -44,6 +44,9 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Jaws.</string>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
@ -76,13 +79,7 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="2" column="1"> <item row="5" column="2">
<widget class="QLineEdit" name="cdPath"/>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="mediaPath"/>
</item>
<item row="7" column="2">
<widget class="QPushButton" name="savePathOpen"> <widget class="QPushButton" name="savePathOpen">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@ -101,68 +98,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2">
<widget class="QPushButton" name="mediaPathOpen">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>55</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Open</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="cdPathOpen">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>55</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Open</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="cdPathLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>CD Path:</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="diskPath"/>
</item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QPushButton" name="diskPathOpen"> <widget class="QPushButton" name="dataPathOpen">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -180,26 +117,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="5" column="0">
<widget class="QLabel" name="diskPathLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Disk Path:</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="savePathLabel"> <widget class="QLabel" name="savePathLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@ -218,8 +136,22 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="0" column="1">
<widget class="QLabel" name="mediaPathLabel"> <widget class="QLineEdit" name="dataPath">
<property name="toolTip">
<string>Path to the game data files. Set this to the CD image root.</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="savePath">
<property name="toolTip">
<string>Folder where save files are kept.</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="dataPathLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -227,7 +159,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Media Path:</string> <string>Data Path:</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::PlainText</enum> <enum>Qt::PlainText</enum>
@ -237,9 +169,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1">
<widget class="QLineEdit" name="savePath"/>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -266,6 +195,9 @@
<height>120</height> <height>120</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Set 3D model detail level.</string>
</property>
<property name="title"> <property name="title">
<string>Island Model Quality</string> <string>Island Model Quality</string>
</property> </property>
@ -345,6 +277,9 @@
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QGroupBox" name="textureQualityGroup"> <widget class="QGroupBox" name="textureQualityGroup">
<property name="toolTip">
<string>Set texture detail level.</string>
</property>
<property name="title"> <property name="title">
<string>Island Texture Quality</string> <string>Island Texture Quality</string>
</property> </property>
@ -422,16 +357,13 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QWidget" name="musicJoystickWidget" native="true"> <widget class="QWidget" name="checkboxWidget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QCheckBox" name="sound3DCheckBox"> <widget class="QCheckBox" name="sound3DCheckBox">
<property name="toolTip">
<string>Enable 3D positional audio effects.</string>
</property>
<property name="text"> <property name="text">
<string>3D Sound</string> <string>3D Sound</string>
</property> </property>
@ -439,6 +371,9 @@
</item> </item>
<item> <item>
<widget class="QCheckBox" name="musicCheckBox"> <widget class="QCheckBox" name="musicCheckBox">
<property name="toolTip">
<string>Enable in-game background music.</string>
</property>
<property name="text"> <property name="text">
<string>Music</string> <string>Music</string>
</property> </property>
@ -446,11 +381,24 @@
</item> </item>
<item> <item>
<widget class="QCheckBox" name="joystickCheckBox"> <widget class="QCheckBox" name="joystickCheckBox">
<property name="toolTip">
<string>Enable joystick and gamepad support for LEGO Island.</string>
</property>
<property name="text"> <property name="text">
<string>Use Joystick</string> <string>Use Joystick</string>
</property> </property>
</widget> </widget>
</item> </item>
<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>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -462,6 +410,9 @@
<height>225</height> <height>225</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>3D graphics device used to render the game.</string>
</property>
<property name="title"> <property name="title">
<string/> <string/>
</property> </property>
@ -557,8 +508,11 @@
</property> </property>
<item> <item>
<widget class="QPushButton" name="okButton"> <widget class="QPushButton" name="okButton">
<property name="toolTip">
<string>Save configuration and close the config tool.</string>
</property>
<property name="text"> <property name="text">
<string>OK</string> <string>Save and Exit</string>
</property> </property>
<property name="default"> <property name="default">
<bool>true</bool> <bool>true</bool>
@ -566,9 +520,22 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="cancelButton"> <widget class="QPushButton" name="launchButton">
<property name="toolTip">
<string>Save configuration and launch LEGO Island.</string>
</property>
<property name="text"> <property name="text">
<string>Cancel</string> <string>Save and Launch</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="toolTip">
<string>Discard changed settings and close the config tool.</string>
</property>
<property name="text">
<string>Exit without saving</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -581,12 +548,8 @@
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>diskPath</tabstop> <tabstop>dataPath</tabstop>
<tabstop>diskPathOpen</tabstop> <tabstop>dataPathOpen</tabstop>
<tabstop>cdPath</tabstop>
<tabstop>cdPathOpen</tabstop>
<tabstop>mediaPath</tabstop>
<tabstop>mediaPathOpen</tabstop>
<tabstop>savePath</tabstop> <tabstop>savePath</tabstop>
<tabstop>savePathOpen</tabstop> <tabstop>savePathOpen</tabstop>
<tabstop>textureQualityFastRadioButton</tabstop> <tabstop>textureQualityFastRadioButton</tabstop>

View File

@ -912,7 +912,7 @@ inline bool IsleApp::Tick()
static MxLong g_lastFrameTime = 0; static MxLong g_lastFrameTime = 0;
// GLOBAL: ISLE 0x4101bc // GLOBAL: ISLE 0x4101bc
static MxS32 g_startupDelay = 200; static MxS32 g_startupDelay = 1;
if (IsleDebug_Paused() && IsleDebug_StepModeEnabled()) { if (IsleDebug_Paused() && IsleDebug_StepModeEnabled()) {
IsleDebug_SetPaused(false); IsleDebug_SetPaused(false);

View File

@ -11,6 +11,12 @@ class MxEndActionNotificationParam;
// SIZE 0x24 // SIZE 0x24
class AmbulanceMissionState : public LegoState { class AmbulanceMissionState : public LegoState {
public: public:
enum {
e_ready = 0,
e_enteredAmbulance = 1,
e_prepareAmbulance = 2,
};
AmbulanceMissionState(); AmbulanceMissionState();
// FUNCTION: LEGO1 0x10037440 // FUNCTION: LEGO1 0x10037440
@ -125,7 +131,7 @@ class AmbulanceMissionState : public LegoState {
// SYNTHETIC: LEGO1 0x100376c0 // SYNTHETIC: LEGO1 0x100376c0
// AmbulanceMissionState::`scalar deleting destructor' // AmbulanceMissionState::`scalar deleting destructor'
undefined4 m_unk0x08; // 0x08 MxU32 m_state; // 0x08
MxLong m_startTime; // 0x0c MxLong m_startTime; // 0x0c
MxS16 m_peScore; // 0x10 MxS16 m_peScore; // 0x10
MxS16 m_maScore; // 0x12 MxS16 m_maScore; // 0x12
@ -177,15 +183,21 @@ class Ambulance : public IslePathActor {
virtual MxLong HandleEndAction(MxEndActionNotificationParam& p_param); // vtable+0xf4 virtual MxLong HandleEndAction(MxEndActionNotificationParam& p_param); // vtable+0xf4
void CreateState(); void CreateState();
void FUN_10036e60(); void Init();
void ActivateSceneActions(); void ActivateSceneActions();
void StopActions(); void StopActions();
void FUN_10037250(); void Reset();
// SYNTHETIC: LEGO1 0x10036130 // SYNTHETIC: LEGO1 0x10036130
// Ambulance::`scalar deleting destructor' // Ambulance::`scalar deleting destructor'
private: private:
enum {
e_none = 0,
e_waiting = 1,
e_finished = 3,
};
void PlayAnimation(IsleScript::Script p_objectId); void PlayAnimation(IsleScript::Script p_objectId);
void PlayFinalAnimation(IsleScript::Script p_objectId); void PlayFinalAnimation(IsleScript::Script p_objectId);
void StopAction(IsleScript::Script p_objectId); void StopAction(IsleScript::Script p_objectId);
@ -196,9 +208,9 @@ class Ambulance : public IslePathActor {
AmbulanceMissionState* m_state; // 0x164 AmbulanceMissionState* m_state; // 0x164
MxS16 m_unk0x168; // 0x168 MxS16 m_unk0x168; // 0x168
MxS16 m_actorId; // 0x16a MxS16 m_actorId; // 0x16a
MxS16 m_unk0x16c; // 0x16c MxS16 m_atPoliceTask; // 0x16c
MxS16 m_unk0x16e; // 0x16e MxS16 m_atBeachTask; // 0x16e
MxS16 m_unk0x170; // 0x170 MxS16 m_taskState; // 0x170
MxS16 m_unk0x172; // 0x172 MxS16 m_unk0x172; // 0x172
IsleScript::Script m_lastAction; // 0x174 IsleScript::Script m_lastAction; // 0x174
IsleScript::Script m_lastAnimation; // 0x178 IsleScript::Script m_lastAnimation; // 0x178

View File

@ -54,7 +54,7 @@ class LEGO1_EXPORT LegoPlantManager : public MxCore {
LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId); LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId);
MxBool DecrementCounter(LegoEntity* p_entity); MxBool DecrementCounter(LegoEntity* p_entity);
void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length); void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length);
MxResult FUN_10026410(); MxResult DetermineBoundaries();
void ClearCounters(); void ClearCounters();
void SetInitialCounters(); void SetInitialCounters();
@ -78,7 +78,7 @@ class LEGO1_EXPORT LegoPlantManager : public MxCore {
static MxU32 g_maxSound; static MxU32 g_maxSound;
LegoOmni::World m_worldId; // 0x08 LegoOmni::World m_worldId; // 0x08
undefined m_unk0x0c; // 0x0c MxBool m_boundariesDetermined; // 0x0c
AnimEntry* m_entries[5]; // 0x10 AnimEntry* m_entries[5]; // 0x10
MxS8 m_numEntries; // 0x24 MxS8 m_numEntries; // 0x24
LegoWorld* m_world; // 0x28 LegoWorld* m_world; // 0x28

View File

@ -40,9 +40,9 @@ Ambulance::Ambulance()
m_state = NULL; m_state = NULL;
m_unk0x168 = 0; m_unk0x168 = 0;
m_actorId = -1; m_actorId = -1;
m_unk0x16c = 0; m_atPoliceTask = 0;
m_unk0x16e = 0; m_atBeachTask = 0;
m_unk0x170 = 0; m_taskState = Ambulance::e_none;
m_lastAction = IsleScript::c_noneIsle; m_lastAction = IsleScript::c_noneIsle;
m_unk0x172 = 0; m_unk0x172 = 0;
m_lastAnimation = IsleScript::c_noneIsle; m_lastAnimation = IsleScript::c_noneIsle;
@ -73,7 +73,7 @@ MxResult Ambulance::Create(MxDSAction& p_dsAction)
m_state = (AmbulanceMissionState*) GameState()->GetState("AmbulanceMissionState"); m_state = (AmbulanceMissionState*) GameState()->GetState("AmbulanceMissionState");
if (!m_state) { if (!m_state) {
m_state = new AmbulanceMissionState(); m_state = new AmbulanceMissionState();
m_state->m_unk0x08 = 0; m_state->m_state = AmbulanceMissionState::e_ready;
GameState()->RegisterState(m_state); GameState()->RegisterState(m_state);
} }
} }
@ -173,25 +173,25 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
m_lastAction = IsleScript::c_noneIsle; m_lastAction = IsleScript::c_noneIsle;
} }
else if (objectId == IsleScript::c_hho027en_RunAnim) { else if (objectId == IsleScript::c_hho027en_RunAnim) {
m_state->m_unk0x08 = 1; m_state->m_state = AmbulanceMissionState::e_enteredAmbulance;
CurrentWorld()->PlaceActor(UserActor()); CurrentWorld()->PlaceActor(UserActor());
HandleClick(); HandleClick();
m_unk0x172 = 0; m_unk0x172 = 0;
TickleManager()->RegisterClient(this, 40000); 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) { else if (objectId == IsleScript::c_hpz047pe_RunAnim || objectId == IsleScript::c_hpz048pe_RunAnim || objectId == IsleScript::c_hpz049bd_RunAnim || objectId == IsleScript::c_hpz053pa_RunAnim) {
if (m_unk0x170 == 3) { if (m_taskState == Ambulance::e_finished) {
PlayAnimation(IsleScript::c_hpz055pa_RunAnim); PlayAnimation(IsleScript::c_hpz055pa_RunAnim);
m_unk0x170 = 0; m_taskState = Ambulance::e_none;
} }
else { else {
PlayAnimation(IsleScript::c_hpz053pa_RunAnim); PlayAnimation(IsleScript::c_hpz053pa_RunAnim);
} }
} }
else if (objectId == IsleScript::c_hpz050bd_RunAnim || objectId == IsleScript::c_hpz052ma_RunAnim) { else if (objectId == IsleScript::c_hpz050bd_RunAnim || objectId == IsleScript::c_hpz052ma_RunAnim) {
if (m_unk0x170 == 3) { if (m_taskState == Ambulance::e_finished) {
PlayAnimation(IsleScript::c_hpz057ma_RunAnim); PlayAnimation(IsleScript::c_hpz057ma_RunAnim);
m_unk0x170 = 0; m_taskState = Ambulance::e_none;
} }
else { else {
PlayAnimation(IsleScript::c_hpz052ma_RunAnim); PlayAnimation(IsleScript::c_hpz052ma_RunAnim);
@ -204,18 +204,18 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
m_unk0x172 = 0; m_unk0x172 = 0;
TickleManager()->RegisterClient(this, 40000); TickleManager()->RegisterClient(this, 40000);
if (m_unk0x16c != 0) { if (m_atPoliceTask != 0) {
StopActions(); StopActions();
} }
} }
else if (objectId == IsleScript::c_hps116bd_RunAnim || objectId == IsleScript::c_hps118re_RunAnim) { else if (objectId == IsleScript::c_hps116bd_RunAnim || objectId == IsleScript::c_hps118re_RunAnim) {
if (objectId == IsleScript::c_hps116bd_RunAnim && m_unk0x170 != 3) { if (objectId == IsleScript::c_hps116bd_RunAnim && m_taskState != Ambulance::e_finished) {
PlayAction(IsleScript::c_Avo923In_PlayWav); PlayAction(IsleScript::c_Avo923In_PlayWav);
} }
if (m_unk0x170 == 3) { if (m_taskState == Ambulance::e_finished) {
PlayAnimation(IsleScript::c_hps117bd_RunAnim); PlayAnimation(IsleScript::c_hps117bd_RunAnim);
m_unk0x170 = 0; m_taskState = Ambulance::e_none;
} }
else { else {
PlayAnimation(IsleScript::c_hps118re_RunAnim); PlayAnimation(IsleScript::c_hps118re_RunAnim);
@ -228,12 +228,12 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
m_unk0x172 = 0; m_unk0x172 = 0;
TickleManager()->RegisterClient(this, 40000); TickleManager()->RegisterClient(this, 40000);
if (m_unk0x16e != 0) { if (m_atBeachTask != 0) {
StopActions(); StopActions();
} }
} }
else if (objectId == IsleScript::c_hho142cl_RunAnim || objectId == IsleScript::c_hho143cl_RunAnim || objectId == IsleScript::c_hho144cl_RunAnim) { else if (objectId == IsleScript::c_hho142cl_RunAnim || objectId == IsleScript::c_hho143cl_RunAnim || objectId == IsleScript::c_hho144cl_RunAnim) {
FUN_10037250(); Reset();
} }
} }
@ -244,18 +244,18 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
// FUNCTION: BETA10 0x100230bf // FUNCTION: BETA10 0x100230bf
MxLong Ambulance::HandleButtonDown(LegoControlManagerNotificationParam& p_param) MxLong Ambulance::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
{ {
if (m_unk0x170 == 1) { if (m_taskState == Ambulance::e_waiting) {
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY()); LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
if (roi != NULL && !SDL_strcasecmp(roi->GetName(), "ps-gate")) { if (roi != NULL && !SDL_strcasecmp(roi->GetName(), "ps-gate")) {
m_unk0x170 = 3; m_taskState = Ambulance::e_finished;
return 1; return 1;
} }
roi = PickRootROI(p_param.GetX(), p_param.GetY()); roi = PickRootROI(p_param.GetX(), p_param.GetY());
if (roi != NULL && !SDL_strcasecmp(roi->GetName(), "gd")) { if (roi != NULL && !SDL_strcasecmp(roi->GetName(), "gd")) {
m_unk0x170 = 3; m_taskState = Ambulance::e_finished;
return 1; return 1;
} }
} }
@ -273,9 +273,9 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
} }
if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && p_param.GetData() == 0x0b) { if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && p_param.GetData() == 0x0b) {
if (m_unk0x16e != 0) { if (m_atBeachTask != 0) {
if (m_unk0x16c != 0) { if (m_atPoliceTask != 0) {
m_state->m_unk0x08 = 2; m_state->m_state = AmbulanceMissionState::e_prepareAmbulance;
if (m_lastAction != IsleScript::c_noneIsle) { if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL); InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
@ -300,7 +300,7 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
return 0; return 0;
} }
if (m_unk0x16e != 0) { if (m_atBeachTask != 0) {
if (m_lastAction != IsleScript::c_noneIsle) { if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL); InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
} }
@ -310,7 +310,7 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
} }
} }
if (m_unk0x16c != 0) { if (m_atPoliceTask != 0) {
if (m_lastAction != IsleScript::c_noneIsle) { if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL); InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
} }
@ -318,9 +318,9 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
PlayAction(IsleScript::c_Avo915In_PlayWav); PlayAction(IsleScript::c_Avo915In_PlayWav);
} }
} }
else if (p_param.GetTrigger() == LegoPathStruct::c_s && p_param.GetData() == 0x131 && m_unk0x16e == 0) { else if (p_param.GetTrigger() == LegoPathStruct::c_s && p_param.GetData() == 0x131 && m_atBeachTask == 0) {
m_unk0x16e = 1; m_atBeachTask = 1;
m_unk0x170 = 1; m_taskState = Ambulance::e_waiting;
if (m_lastAction != IsleScript::c_noneIsle) { if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL); InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
@ -348,9 +348,9 @@ MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
break; break;
} }
} }
else if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && (p_param.GetData() == 0x22 || p_param.GetData() == 0x23 || p_param.GetData() == 0x24) && m_unk0x16c == 0) { else if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && (p_param.GetData() == 0x22 || p_param.GetData() == 0x23 || p_param.GetData() == 0x24) && m_atPoliceTask == 0) {
m_unk0x16c = 1; m_atPoliceTask = 1;
m_unk0x170 = 1; m_taskState = Ambulance::e_waiting;
if (m_lastAction != IsleScript::c_noneIsle) { if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL); InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
@ -371,7 +371,7 @@ MxLong Ambulance::HandleClick()
return 1; return 1;
} }
if (m_state->m_unk0x08 == 2) { if (m_state->m_state == AmbulanceMissionState::e_prepareAmbulance) {
return 1; return 1;
} }
@ -390,7 +390,7 @@ MxLong Ambulance::HandleClick()
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_AmbulanceDashboard, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_AmbulanceDashboard, NULL);
ControlManager()->Register(this); ControlManager()->Register(this);
if (m_state->m_unk0x08 == 1) { if (m_state->m_state == AmbulanceMissionState::e_enteredAmbulance) {
SpawnPlayer(LegoGameState::e_hospitalExited, TRUE, 0); SpawnPlayer(LegoGameState::e_hospitalExited, TRUE, 0);
m_state->m_startTime = Timer()->GetTime(); m_state->m_startTime = Timer()->GetTime();
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_pns018rd_RunAnim, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_pns018rd_RunAnim, NULL);
@ -401,9 +401,9 @@ MxLong Ambulance::HandleClick()
// FUNCTION: LEGO1 0x10036e60 // FUNCTION: LEGO1 0x10036e60
// FUNCTION: BETA10 0x100236bb // FUNCTION: BETA10 0x100236bb
void Ambulance::FUN_10036e60() void Ambulance::Init()
{ {
m_state->m_unk0x08 = 2; m_state->m_state = AmbulanceMissionState::e_prepareAmbulance;
PlayAnimation(IsleScript::c_hho027en_RunAnim); PlayAnimation(IsleScript::c_hho027en_RunAnim);
m_lastAction = IsleScript::c_noneIsle; m_lastAction = IsleScript::c_noneIsle;
m_lastAnimation = IsleScript::c_noneIsle; m_lastAnimation = IsleScript::c_noneIsle;
@ -414,7 +414,7 @@ void Ambulance::Exit()
{ {
GameState()->m_currentArea = LegoGameState::e_hospitalExterior; GameState()->m_currentArea = LegoGameState::e_hospitalExterior;
StopActions(); StopActions();
FUN_10037250(); Reset();
Leave(); Leave();
} }
@ -470,11 +470,11 @@ void Ambulance::ActivateSceneActions()
{ {
PlayMusic(JukeboxScript::c_Hospital_Music); PlayMusic(JukeboxScript::c_Hospital_Music);
if (m_state->m_unk0x08 == 1) { if (m_state->m_state == AmbulanceMissionState::e_enteredAmbulance) {
m_state->m_unk0x08 = 0; m_state->m_state = AmbulanceMissionState::e_ready;
PlayAction(IsleScript::c_ham033cl_PlayWav); PlayAction(IsleScript::c_ham033cl_PlayWav);
} }
else if (m_unk0x16c != 0 && m_unk0x16e != 0) { else if (m_atPoliceTask != 0 && m_atBeachTask != 0) {
IsleScript::Script objectId; IsleScript::Script objectId;
switch (SDL_rand(2)) { switch (SDL_rand(2)) {
@ -574,14 +574,14 @@ void Ambulance::StopActions()
} }
// FUNCTION: LEGO1 0x10037250 // FUNCTION: LEGO1 0x10037250
void Ambulance::FUN_10037250() void Ambulance::Reset()
{ {
StopAction(m_lastAction); StopAction(m_lastAction);
BackgroundAudioManager()->RaiseVolume(); BackgroundAudioManager()->RaiseVolume();
((Act1State*) GameState()->GetState("Act1State"))->m_unk0x018 = 0; ((Act1State*) GameState()->GetState("Act1State"))->m_unk0x018 = 0;
m_state->m_unk0x08 = 0; m_state->m_state = AmbulanceMissionState::e_ready;
m_unk0x16e = 0; m_atBeachTask = 0;
m_unk0x16c = 0; m_atPoliceTask = 0;
g_isleFlags |= Isle::c_playMusic; g_isleFlags |= Isle::c_playMusic;
AnimationManager()->EnableCamAnims(TRUE); AnimationManager()->EnableCamAnims(TRUE);
AnimationManager()->FUN_1005f6d0(TRUE); AnimationManager()->FUN_1005f6d0(TRUE);
@ -629,7 +629,7 @@ void Ambulance::PlayAction(IsleScript::Script p_objectId)
// FUNCTION: LEGO1 0x100373a0 // FUNCTION: LEGO1 0x100373a0
AmbulanceMissionState::AmbulanceMissionState() AmbulanceMissionState::AmbulanceMissionState()
{ {
m_unk0x08 = 0; m_state = AmbulanceMissionState::e_ready;
m_startTime = 0; m_startTime = 0;
m_peScore = 0; m_peScore = 0;
m_maScore = 0; m_maScore = 0;

View File

@ -83,7 +83,7 @@ void LegoPlantManager::Init()
} }
m_worldId = LegoOmni::e_undefined; m_worldId = LegoOmni::e_undefined;
m_unk0x0c = 0; m_boundariesDetermined = FALSE;
m_numEntries = 0; m_numEntries = 0;
} }
@ -98,7 +98,7 @@ void LegoPlantManager::LoadWorldInfo(LegoOmni::World p_worldId)
CreatePlant(i, world, p_worldId); CreatePlant(i, world, p_worldId);
} }
m_unk0x0c = 0; m_boundariesDetermined = FALSE;
} }
// FUNCTION: LEGO1 0x100263a0 // FUNCTION: LEGO1 0x100263a0
@ -119,12 +119,12 @@ void LegoPlantManager::Reset(LegoOmni::World p_worldId)
} }
m_worldId = LegoOmni::e_undefined; m_worldId = LegoOmni::e_undefined;
m_unk0x0c = 0; m_boundariesDetermined = FALSE;
} }
// FUNCTION: LEGO1 0x10026410 // FUNCTION: LEGO1 0x10026410
// FUNCTION: BETA10 0x100c50e9 // FUNCTION: BETA10 0x100c50e9
MxResult LegoPlantManager::FUN_10026410() MxResult LegoPlantManager::DetermineBoundaries()
{ {
// similar to LegoBuildingManager::FUN_10030630() // similar to LegoBuildingManager::FUN_10030630()
@ -192,7 +192,7 @@ MxResult LegoPlantManager::FUN_10026410()
} }
} }
m_unk0x0c = TRUE; m_boundariesDetermined = TRUE;
return SUCCESS; return SUCCESS;
} }
@ -200,8 +200,8 @@ MxResult LegoPlantManager::FUN_10026410()
// FUNCTION: BETA10 0x100c55e0 // FUNCTION: BETA10 0x100c55e0
LegoPlantInfo* LegoPlantManager::GetInfoArray(MxS32& p_length) LegoPlantInfo* LegoPlantManager::GetInfoArray(MxS32& p_length)
{ {
if (!m_unk0x0c) { if (!m_boundariesDetermined) {
FUN_10026410(); DetermineBoundaries();
} }
p_length = sizeOfArray(g_plantInfo); p_length = sizeOfArray(g_plantInfo);

View File

@ -810,7 +810,7 @@ void Isle::Enable(MxBool p_enable)
AnimationManager()->EnableCamAnims(FALSE); AnimationManager()->EnableCamAnims(FALSE);
g_isleFlags &= ~c_playMusic; g_isleFlags &= ~c_playMusic;
m_ambulance->FUN_10036e60(); m_ambulance->Init();
break; break;
case 11: case 11:
m_act1state->m_unk0x018 = 0; m_act1state->m_unk0x018 = 0;
@ -1209,7 +1209,7 @@ MxBool Isle::Escape()
case 10: case 10:
if (UserActor() != NULL && !UserActor()->IsA("Ambulance")) { if (UserActor() != NULL && !UserActor()->IsA("Ambulance")) {
m_ambulance->StopActions(); m_ambulance->StopActions();
m_ambulance->FUN_10037250(); m_ambulance->Reset();
} }
break; break;
} }
@ -1250,7 +1250,7 @@ void Isle::FUN_10033350()
if (m_act1state->m_unk0x018 == 10) { if (m_act1state->m_unk0x018 == 10) {
if (UserActor() != NULL && !UserActor()->IsA("Ambulance")) { if (UserActor() != NULL && !UserActor()->IsA("Ambulance")) {
m_ambulance->StopActions(); m_ambulance->StopActions();
m_ambulance->FUN_10037250(); m_ambulance->Reset();
} }
} }

View File

@ -59,7 +59,7 @@ HRESULT Direct3DRMMeshImpl::AddGroup(
MeshGroup group; MeshGroup group;
group.vertexPerFace = vertexPerFace; group.vertexPerFace = vertexPerFace;
DWORD* src = faceBuffer; unsigned int* src = faceBuffer;
group.indices.assign(src, src + faceCount * vertexPerFace); group.indices.assign(src, src + faceCount * vertexPerFace);
m_groups.push_back(std::move(group)); m_groups.push_back(std::move(group));

View File

@ -18,6 +18,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <assert.h> #include <assert.h>
#include <cinttypes>
#include <cstdint> #include <cstdint>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
@ -75,7 +76,7 @@ HRESULT DirectDrawImpl::CreateSurface(
if ((lpDDSurfaceDesc->dwFlags & DDSD_ZBUFFERBITDEPTH) != DDSD_ZBUFFERBITDEPTH) { if ((lpDDSurfaceDesc->dwFlags & DDSD_ZBUFFERBITDEPTH) != DDSD_ZBUFFERBITDEPTH) {
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
} }
SDL_Log("Todo: Set %dbit Z-Buffer", lpDDSurfaceDesc->dwZBufferBitDepth); SDL_Log("Todo: Set %" PRIu32 "bit Z-Buffer", lpDDSurfaceDesc->dwZBufferBitDepth);
*lplpDDSurface = static_cast<IDirectDrawSurface*>(new DummySurfaceImpl); *lplpDDSurface = static_cast<IDirectDrawSurface*>(new DummySurfaceImpl);
return DD_OK; return DD_OK;
} }