Get qt6 working

This commit is contained in:
Anonymous Maarten 2025-06-01 18:13:02 +02:00
parent 877c278ce9
commit 0fc5c8e79a
23 changed files with 971 additions and 747 deletions

View File

@ -33,13 +33,13 @@ jobs:
fail-fast: false
matrix:
include:
- { name: 'Linux', os: 'ubuntu-latest', dx5: false, build-type: 'Debug', linux: true, werror: true, clang-tidy: true }
- { name: 'MSVC (x86)', os: 'windows-latest', dx5: true, build-type: 'Debug', msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64_x86' }
- { name: 'MSVC (x64)', os: 'windows-latest', dx5: false, build-type: 'Debug', msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64' }
- { name: 'MSVC (arm64)', os: 'windows-latest', dx5: false, build-type: 'Debug', msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64_arm64' }
- { name: 'msys2 mingw32', os: 'windows-latest', dx5: false, build-type: 'Debug', mingw: true, werror: true, clang-tidy: true, msystem: 'mingw32', msys-env: 'mingw-w64-i686', shell: 'msys2 {0}' }
- { name: 'msys2 mingw64', os: 'windows-latest', dx5: false, build-type: 'Debug', mingw: true, werror: true, clang-tidy: true, msystem: 'mingw64', msys-env: 'mingw-w64-x86_64', shell: 'msys2 {0}' }
- { name: 'macOS', os: 'macos-latest', dx5: false, build-type: 'Debug', brew: true, werror: true, clang-tidy: false }
- { name: 'Linux', os: 'ubuntu-latest', dx5: false, config: true, build-type: 'Debug', linux: true, werror: true, clang-tidy: true }
- { name: 'MSVC (x86)', os: 'windows-latest', dx5: true, config: false, build-type: 'Debug', msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64_x86' }
- { name: 'MSVC (x64)', os: 'windows-latest', dx5: false, config: false, build-type: 'Debug', msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64' }
- { name: 'MSVC (arm64)', os: 'windows-latest', dx5: false, config: false, build-type: 'Debug', msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64_arm64' }
- { name: 'msys2 mingw32', os: 'windows-latest', dx5: false, config: false, build-type: 'Debug', mingw: true, werror: true, clang-tidy: true, msystem: 'mingw32', msys-env: 'mingw-w64-i686', shell: 'msys2 {0}' }
- { name: 'msys2 mingw64', os: 'windows-latest', dx5: false, config: true, build-type: 'Debug', mingw: true, werror: true, clang-tidy: true, msystem: 'mingw64', msys-env: 'mingw-w64-x86_64', shell: 'msys2 {0}' }
- { name: 'macOS', os: 'macos-latest', dx5: false, config: true, build-type: 'Debug', brew: true, werror: true, clang-tidy: false }
steps:
- name: Setup vcvars
if: ${{ !!matrix.msvc }}
@ -57,6 +57,7 @@ jobs:
${{ matrix.msys-env }}-cmake
${{ matrix.msys-env }}-ninja
${{ matrix.msys-env }}-clang-tools-extra
${{ (matrix.config && format('{0}-qt6-base', matrix.msys-env)) || '' }}
- name: Install Linux dependencies (apt-get)
if: ${{ matrix.linux }}
@ -64,13 +65,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
libx11-dev libxext-dev libxrandr-dev libxrender-dev libxfixes-dev libxi-dev libxinerama-dev \
libxcursor-dev libwayland-dev libxkbcommon-dev wayland-protocols
libxcursor-dev libwayland-dev libxkbcommon-dev wayland-protocols qt6-base-dev
- name: Install macOS dependencies (brew)
if: ${{ matrix.brew }}
run: |
brew update
brew install cmake ninja llvm
brew install cmake ninja llvm qt6
echo "LLVM_ROOT=$(brew --prefix llvm)/bin" >> $GITHUB_ENV
- name: Setup ninja
@ -84,6 +85,7 @@ jobs:
cmake -S . -B build -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DISLE_USE_DX5=${{ !!matrix.dx5 }} \
-DISLE_BUILD_CONFIG=${{ matrix.config }} \
-DENABLE_CLANG_TIDY=${{ !!matrix.clang-tidy }} \
-DISLE_WERROR=${{ !!matrix.werror }} \
-Werror=dev

View File

@ -27,7 +27,7 @@ option(ISLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF)
option(ISLE_WERROR "Treat warnings as errors" OFF)
option(ISLE_DEBUG "Enable imgui debug" ON)
cmake_dependent_option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" "${NOT_MINGW}" "WIN32;CMAKE_SIZEOF_VOID_P EQUAL 4" OFF)
cmake_dependent_option(ISLE_MINIWIN "Use miniwin and minimfc" ON "NOT ISLE_USE_DX5" OFF)
cmake_dependent_option(ISLE_MINIWIN "Use miniwin" ON "NOT ISLE_USE_DX5" OFF)
cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "MSVC OR ISLE_MINIWIN" OFF)
cmake_dependent_option(ISLE_COMPILE_SHADERS "Compile shaders" ON "SDL_SHADERCROSS_BIN;TARGET Python3::Interpreter" OFF)
option(CMAKE_POSITION_INDEPENDENT_CODE "Build with -fPIC" ON)
@ -497,17 +497,17 @@ if (ISLE_BUILD_CONFIG)
LEGO1/mxdirectx/mxdirectxinfo.cpp
LEGO1/mxdirectx/legodxinfo.cpp
CONFIG/config.cpp
CONFIG/ConfigCommandLineInfo.cpp
CONFIG/AboutDlg.cpp
CONFIG/MainDlg.cpp
CONFIG/detectdx5.cpp
CONFIG/StdAfx.cpp
CONFIG/res/config.rc
CONFIG/res/config.qrc
)
if (ISLE_MINIWIN)
target_link_libraries(config PRIVATE minimfc)
target_link_libraries(config PRIVATE Qt6::Core Qt6::Widgets)
endif()
target_link_libraries(config PRIVATE Qt6::Core Qt6::Widgets)
set_property(TARGET config PROPERTY AUTOMOC ON)
set_property(TARGET config PROPERTY AUTORCC ON)
set_property(TARGET config PROPERTY AUTOUIC ON)
set_property(TARGET config PROPERTY AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/CONFIG/res")
list(APPEND isle_targets config)
target_compile_definitions(config PRIVATE _AFXDLL MXDIRECTX_FOR_CONFIG)
target_include_directories(config PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/LEGO1")
@ -516,7 +516,7 @@ if (ISLE_BUILD_CONFIG)
target_link_libraries(config PRIVATE DirectX5::DirectX5)
endif()
target_compile_definitions(config PRIVATE DIRECT3D_VERSION=0x500)
target_link_libraries(config PRIVATE SDL3::SDL3)
target_link_libraries(config PRIVATE SDL3::SDL3 iniparser-static)
if (NOT ISLE_MINIWIN)
target_link_libraries(config PRIVATE ddraw dxguid)
endif()

View File

@ -2,20 +2,16 @@
#include "decomp.h"
#include <ui_about.h>
DECOMP_SIZE_ASSERT(CDialog, 0x60)
DECOMP_SIZE_ASSERT(CAboutDialog, 0x60)
// FIXME: disable dialog resizing
// FUNCTION: CONFIG 0x00403c20
CAboutDialog::CAboutDialog() : QDialog()
{
m_ui = new Ui::AboutDialog;
m_ui->setupUi(this);
}
// FUNCTION: CONFIG 0x00403d20
/*
void CAboutDialog::DoDataExchange(CDataExchange* pDX)
{
*/
//}
/*BEGIN_MESSAGE_MAP(CAboutDialog, CDialog)*/
/*END_MESSAGE_MAP()*/

View File

@ -1,24 +1,27 @@
#if !defined(AFX_ABOUTDLG_H)
#define AFX_ABOUTDLG_H
#include "StdAfx.h"
#include "compat.h"
#include "res/resource.h"
#include <QDialog>
namespace Ui
{
class AboutDialog;
}
// VTABLE: CONFIG 0x00406308
// SIZE 0x60
class CAboutDialog : public QDialog {
public:
CAboutDialog();
enum {
IDD = IDD_ABOUT
};
protected:
/*void DoDataExchange(CDataExchange* pDX) override;*/
protected:
/*DECLARE_MESSAGE_MAP()*/
Ui::AboutDialog* m_ui;
};
// SYNTHETIC: CONFIG 0x00403cb0

View File

@ -1,22 +0,0 @@
#include "ConfigCommandLineInfo.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(CCommandLineInfo, 0x24)
DECOMP_SIZE_ASSERT(CConfigCommandLineInfo, 0x24)
// FUNCTION: CONFIG 0x00403b10
CConfigCommandLineInfo::CConfigCommandLineInfo()
{
currentConfigApp->m_run_config_dialog = FALSE;
}
// FUNCTION: CONFIG 0x00403bf0
void CConfigCommandLineInfo::ParseParam(LPCSTR pszParam, BOOL bFlag, BOOL bLast)
{
if (bFlag) {
if (lstrcmpi(pszParam, "config") == 0) {
currentConfigApp->m_run_config_dialog = TRUE;
}
}
}

View File

@ -1,21 +0,0 @@
#if !defined(AFX_CONFIGCOMMANDLINEINFO_H)
#define AFX_CONFIGCOMMANDLINEINFO_H
#include "StdAfx.h"
#include "compat.h"
#include "config.h"
#include "decomp.h"
// VTABLE: CONFIG 0x004060e8
// SIZE 0x24
class CConfigCommandLineInfo : public CCommandLineInfo {
public:
CConfigCommandLineInfo();
void ParseParam(LPCSTR pszParam, BOOL bFlag, BOOL bLast) override;
};
// SYNTHETIC: CONFIG 0x00403b80
// CConfigCommandLineInfo::`scalar deleting destructor'
#endif // !defined(AFX_CONFIGCOMMANDLINEINFO_H)

View File

@ -10,63 +10,70 @@
#include "config.h"
#include "res/resource.h"
#include <QKeyEvent>
#include <mxdirectx/legodxinfo.h>
#include <ui_maindialog.h>
DECOMP_SIZE_ASSERT(CDialog, 0x60)
DECOMP_SIZE_ASSERT(CMainDialog, 0x70)
// FIXME: disable dialog resizing
// FIXME: advanced mode should resize dialog, ignoring advanced controls
// FIXME: list widget should have less rows
// FUNCTION: CONFIG 0x00403d50
CMainDialog::CMainDialog(CWnd* pParent) : CDialog(IDD, pParent)
CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent)
{
afxCurrentWinApp;
m_icon = LoadIcon(AfxFindResourceHandle(MAKEINTRESOURCE(IDI_CONFIG), RT_GROUP_ICON), MAKEINTRESOURCE(IDI_CONFIG));
m_ui = new Ui::MainDialog;
m_ui->setupUi(this);
// Populate the dialog prior to connecting all signals
OnInitDialog();
connect(m_ui->colorPalette16bitRadioButton, &QRadioButton::toggled, this, &CMainDialog::OnRadiobuttonPalette16bit);
connect(m_ui->colorPalette256RadioButton, &QRadioButton::toggled, this, &CMainDialog::OnRadiobuttonPalette256);
connect(
m_ui->modelQualityFastRadioButton,
&QRadioButton::toggled,
this,
&CMainDialog::OnRadiobuttonModelLowQuality
);
connect(
m_ui->modelQualityHighRadioButton,
&QRadioButton::toggled,
this,
&CMainDialog::OnRadiobuttonModelHighQuality
);
connect(
m_ui->textureQualityFastRadioButton,
&QRadioButton::toggled,
this,
&CMainDialog::OnRadiobuttonTextureLowQuality
);
connect(
m_ui->textureQualityHighRadioButton,
&QRadioButton::toggled,
this,
&CMainDialog::OnRadiobuttonTextureHighQuality
);
connect(m_ui->devicesList, &QListWidget::currentRowChanged, this, &CMainDialog::OnList3DevicesSelectionChanged);
connect(m_ui->musicCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxMusic);
connect(m_ui->drawCursorCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxDrawCursor);
connect(m_ui->videomemoryCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckbox3DVideoMemory);
connect(m_ui->flipVideoMemoryPagesCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxFlipVideoMemPages);
connect(m_ui->sound3DCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckbox3DSound);
connect(m_ui->joystickCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxJoystick);
connect(m_ui->okButton, &QPushButton::clicked, this, &CMainDialog::accept);
connect(m_ui->cancelButton, &QPushButton::clicked, this, &CMainDialog::reject);
connect(m_ui->advancedButton, &QPushButton::clicked, this, &CMainDialog::OnButtonAdvanced);
}
// FUNCTION: CONFIG 0x00403e50
void CMainDialog::DoDataExchange(CDataExchange* pDX)
{
}
BEGIN_MESSAGE_MAP(CMainDialog, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_COMMAND(IDC_CHK_FLIP_VIDEO_MEM_PAGES, OnCheckboxFlipVideoMemPages)
ON_LBN_SELCHANGE(IDC_LIST_3DDEVICES, OnList3DevicesSelectionChanged)
ON_COMMAND(IDC_RAD_PALETTE_16BIT, OnRadiobuttonPalette16bit)
ON_COMMAND(IDC_RAD_PALETTE_256, OnRadiobuttonPalette256)
ON_COMMAND(IDC_CHK_3D_VIDEO_MEMORY, OnCheckbox3DVideoMemory)
ON_WM_DESTROY() // FIXME: CONFIG.EXE calls Default
ON_COMMAND(IDABORT, OnButtonCancel)
ON_COMMAND(IDC_CHK_3DSOUND, OnCheckbox3DSound)
ON_COMMAND(IDC_RAD_MODEL_QUALITY_LOW, OnRadiobuttonModelLowQuality)
ON_COMMAND(IDC_RAD_MODEL_QUALITY_HIGH, OnRadiobuttonModelHighQuality)
ON_COMMAND(IDC_RAD_TEXTURE_QUALITY_LOW, OnRadiobuttonTextureLowQuality)
ON_COMMAND(IDC_RAD_TEXTURE_QUALITY_HIGH, OnRadiobuttonTextureHighQuality)
ON_COMMAND(IDC_CHK_JOYSTICK, OnCheckboxJoystick)
ON_COMMAND(IDC_BTN_ADVANCED, OnButtonAdvanced)
ON_COMMAND(IDC_CHK_DRAW_CURSOR, OnCheckboxDrawCursor)
ON_COMMAND(IDC_CHK_MUSIC, OnCheckboxMusic)
END_MESSAGE_MAP()
// FUNCTION: CONFIG 0x00403e80
BOOL CMainDialog::OnInitDialog()
bool CMainDialog::OnInitDialog()
{
CDialog::OnInitDialog();
SwitchToAdvanced(FALSE);
CMenu* system_menu = CMenu::FromHandle(::GetSystemMenu(m_hWnd, FALSE));
CString about_text;
about_text.LoadString(IDS_ABOUT);
if (system_menu) {
AppendMenu(system_menu->m_hMenu, MF_SEPARATOR, 0, NULL);
AppendMenu(system_menu->m_hMenu, MF_STRING, 16, (LPCTSTR) about_text);
}
SendMessage(WM_SETICON, ICON_BIG, (LPARAM) m_icon);
SendMessage(WM_SETICON, ICON_SMALL, (LPARAM) m_icon);
SwitchToAdvanced(false);
LegoDeviceEnumerate* enumerator = currentConfigApp->m_device_enumerator;
enumerator->FUN_1009d210();
m_modified = currentConfigApp->ReadRegisterSettings();
CWnd* list_3d_devices = GetDlgItem(IDC_LIST_3DDEVICES);
int driver_i = 0;
int device_i = 0;
int selected = 0;
@ -84,227 +91,214 @@ BOOL CMainDialog::OnInitDialog()
device_i += 1;
sprintf(
device_name,
driver_i == 0 ? "%s ( Primary Device )" : "%s ( Secondary Device )",
device.m_deviceName
"%s [%s] ( %s )",
device.m_deviceDesc,
device.m_deviceName,
driver_i == 0 ? "Primary Device" : "Secondary Device"
);
::SendMessage(list_3d_devices->m_hWnd, LB_ADDSTRING, 0, (LPARAM) device_name);
m_ui->devicesList->addItem(device_name);
}
driver_i += 1;
}
::SendMessage(list_3d_devices->m_hWnd, LB_SETCURSEL, selected, 0);
m_ui->devicesList->setCurrentRow(selected);
UpdateInterface();
return TRUE;
return true;
}
// FUNCTION: CONFIG 0x00404080
void CMainDialog::OnSysCommand(UINT nID, LPARAM lParam)
void CMainDialog::keyReleaseEvent(QKeyEvent* event)
{
if ((nID & 0xfff0) == 0x10) {
if (event->matches(QKeySequence::StandardKey::HelpContents)) {
CAboutDialog about_dialog;
about_dialog.DoModal();
about_dialog.exec();
}
else {
Default();
QDialog::keyReleaseEvent(event);
}
}
// FUNCTION: CONFIG 0x00404150
void CMainDialog::OnPaint()
{
if (IsIconic()) {
CPaintDC painter(this);
::SendMessage(m_hWnd, WM_ICONERASEBKGND, (WPARAM) painter.m_hDC, 0);
RECT dim;
GetClientRect(&dim);
DrawIcon(
painter.m_hDC,
(dim.right - dim.left - GetSystemMetrics(SM_CXICON) + 1) / 2,
(dim.bottom - dim.top - GetSystemMetrics(SM_CYICON) + 1) / 2,
m_icon
);
}
else {
Default();
}
}
// FUNCTION: CONFIG 0x00404230
HCURSOR CMainDialog::OnQueryDragIcon()
{
return m_icon;
}
// FUNCTION: CONFIG 0x00404240
void CMainDialog::OnList3DevicesSelectionChanged()
void CMainDialog::OnList3DevicesSelectionChanged(int selected)
{
LegoDeviceEnumerate* device_enumerator = currentConfigApp->m_device_enumerator;
int selected = ::SendMessage(GetDlgItem(IDC_LIST_3DDEVICES)->m_hWnd, LB_GETCURSEL, 0, 0);
device_enumerator->GetDevice(selected, currentConfigApp->m_driver, currentConfigApp->m_device);
if (currentConfigApp->GetHardwareDeviceColorModel() != D3DCOLOR_NONE) {
GetDlgItem(IDC_CHK_DRAW_CURSOR)->EnableWindow(TRUE);
m_ui->drawCursorCheckBox->setEnabled(true);
}
else {
currentConfigApp->m_3d_video_ram = FALSE;
currentConfigApp->m_flip_surfaces = FALSE;
CheckDlgButton(IDC_CHK_3D_VIDEO_MEMORY, currentConfigApp->m_3d_video_ram);
CheckDlgButton(IDC_CHK_FLIP_VIDEO_MEM_PAGES, currentConfigApp->m_flip_surfaces);
m_ui->videomemoryCheckBox->setChecked(currentConfigApp->m_3d_video_ram);
m_ui->flipVideoMemoryPagesCheckBox->setChecked(currentConfigApp->m_flip_surfaces);
}
m_modified = TRUE;
m_modified = true;
UpdateInterface();
}
// FUNCTION: CONFIG 0x00404320
void CMainDialog::OnCancel()
{
CDialog::OnCancel();
}
// FUNCTION: CONFIG 0x00404330
void CMainDialog::OnDestroy()
{
CDialog::Default();
}
// FUNCTION: CONFIG 0x00404340
void CMainDialog::OnButtonCancel()
void CMainDialog::reject()
{
QDialog::reject();
}
void CMainDialog::accept()
{
if (m_modified) {
currentConfigApp->WriteRegisterSettings();
}
OnCancel();
QDialog::accept();
}
// FUNCTION: CONFIG 0x00404360
void CMainDialog::UpdateInterface()
{
currentConfigApp->ValidateSettings();
GetDlgItem(IDC_CHK_3D_VIDEO_MEMORY)
->EnableWindow(
!currentConfigApp->m_flip_surfaces && currentConfigApp->GetHardwareDeviceColorModel() == D3DCOLOR_NONE
);
CheckDlgButton(IDC_CHK_FLIP_VIDEO_MEM_PAGES, currentConfigApp->m_flip_surfaces);
CheckDlgButton(IDC_CHK_3D_VIDEO_MEMORY, currentConfigApp->m_3d_video_ram);
BOOL full_screen = currentConfigApp->m_full_screen;
m_ui->videomemoryCheckBox->setEnabled(
!currentConfigApp->m_flip_surfaces && currentConfigApp->GetHardwareDeviceColorModel() == D3DCOLOR_NONE
);
m_ui->flipVideoMemoryPagesCheckBox->setChecked(currentConfigApp->m_flip_surfaces);
m_ui->videomemoryCheckBox->setChecked(currentConfigApp->m_3d_video_ram);
bool full_screen = currentConfigApp->m_full_screen;
currentConfigApp->AdjustDisplayBitDepthBasedOnRenderStatus();
if (currentConfigApp->GetHardwareDeviceColorModel() != D3DCOLOR_NONE) {
CheckDlgButton(IDC_CHK_DRAW_CURSOR, TRUE);
m_ui->drawCursorCheckBox->setChecked(true);
}
else {
CheckDlgButton(IDC_CHK_DRAW_CURSOR, FALSE);
m_ui->drawCursorCheckBox->setChecked(false);
currentConfigApp->m_draw_cursor = FALSE;
GetDlgItem(IDC_CHK_DRAW_CURSOR)->EnableWindow(FALSE);
m_ui->drawCursorCheckBox->setEnabled(false);
}
if (full_screen) {
CheckRadioButton(
IDC_RAD_PALETTE_256,
IDC_RAD_PALETTE_16BIT,
currentConfigApp->m_display_bit_depth == 8 ? IDC_RAD_PALETTE_256 : IDC_RAD_PALETTE_16BIT
);
if (currentConfigApp->m_display_bit_depth == 8) {
m_ui->colorPalette256RadioButton->setChecked(true);
}
else {
m_ui->colorPalette16bitRadioButton->setChecked(true);
}
}
else {
CheckDlgButton(IDC_RAD_PALETTE_256, 0);
CheckDlgButton(IDC_RAD_PALETTE_16BIT, 0);
m_ui->colorPalette256RadioButton->setChecked(false);
m_ui->colorPalette256RadioButton->setChecked(false);
currentConfigApp->m_display_bit_depth = 0;
}
GetDlgItem(IDC_RAD_PALETTE_256)
->EnableWindow(full_screen && currentConfigApp->GetConditionalDeviceRenderBitDepth());
GetDlgItem(IDC_RAD_PALETTE_16BIT)->EnableWindow(full_screen && currentConfigApp->GetDeviceRenderBitStatus());
CheckDlgButton(IDC_CHK_3DSOUND, currentConfigApp->m_3d_sound);
CheckDlgButton(IDC_CHK_DRAW_CURSOR, currentConfigApp->m_draw_cursor);
m_ui->colorPalette256RadioButton->setEnabled(full_screen && currentConfigApp->GetConditionalDeviceRenderBitDepth());
m_ui->colorPalette16bitRadioButton->setEnabled(full_screen && currentConfigApp->GetDeviceRenderBitStatus());
m_ui->sound3DCheckBox->setChecked(currentConfigApp->m_3d_sound);
m_ui->drawCursorCheckBox->setChecked(currentConfigApp->m_draw_cursor);
switch (currentConfigApp->m_model_quality) {
case 1:
CheckRadioButton(IDC_RAD_MODEL_QUALITY_LOW, IDC_RAD_MODEL_QUALITY_HIGH, IDC_RAD_MODEL_QUALITY_LOW);
m_ui->modelQualityFastRadioButton->setChecked(true);
break;
case 2:
CheckRadioButton(IDC_RAD_MODEL_QUALITY_LOW, IDC_RAD_MODEL_QUALITY_HIGH, IDC_RAD_MODEL_QUALITY_HIGH);
m_ui->modelQualityHighRadioButton->setChecked(true);
break;
}
CheckRadioButton(
IDC_RAD_TEXTURE_QUALITY_LOW,
IDC_RAD_TEXTURE_QUALITY_HIGH,
currentConfigApp->m_texture_quality == 0 ? IDC_RAD_TEXTURE_QUALITY_LOW : IDC_RAD_TEXTURE_QUALITY_HIGH
);
CheckDlgButton(IDC_CHK_JOYSTICK, currentConfigApp->m_use_joystick);
CheckDlgButton(IDC_CHK_MUSIC, currentConfigApp->m_music);
if (currentConfigApp->m_texture_quality == 0) {
m_ui->textureQualityFastRadioButton->setChecked(true);
}
else {
m_ui->textureQualityHighRadioButton->setChecked(true);
}
m_ui->joystickCheckBox->setChecked(currentConfigApp->m_use_joystick);
m_ui->musicCheckBox->setChecked(currentConfigApp->m_music);
}
// FUNCTION: CONFIG 0x004045e0
void CMainDialog::OnCheckbox3DSound()
void CMainDialog::OnCheckbox3DSound(bool checked)
{
currentConfigApp->m_3d_sound = IsDlgButtonChecked(IDC_CHK_3DSOUND);
m_modified = TRUE;
currentConfigApp->m_3d_sound = checked;
m_modified = true;
UpdateInterface();
}
// FUNCTION: CONFIG 0x00404610
void CMainDialog::OnCheckbox3DVideoMemory()
void CMainDialog::OnCheckbox3DVideoMemory(bool checked)
{
currentConfigApp->m_3d_video_ram = IsDlgButtonChecked(IDC_CHK_3D_VIDEO_MEMORY);
m_modified = TRUE;
currentConfigApp->m_3d_video_ram = checked;
m_modified = true;
UpdateInterface();
}
// FUNCTION: CONFIG 0x00404640
void CMainDialog::OnRadiobuttonPalette16bit()
void CMainDialog::OnRadiobuttonPalette16bit(bool checked)
{
currentConfigApp->m_display_bit_depth = 16;
m_modified = TRUE;
UpdateInterface();
if (checked) {
currentConfigApp->m_display_bit_depth = 16;
m_modified = true;
UpdateInterface();
}
}
// FUNCTION: CONFIG 0x00404670
void CMainDialog::OnRadiobuttonPalette256()
void CMainDialog::OnRadiobuttonPalette256(bool checked)
{
currentConfigApp->m_display_bit_depth = 8;
m_modified = TRUE;
UpdateInterface();
if (checked) {
currentConfigApp->m_display_bit_depth = 8;
m_modified = true;
UpdateInterface();
}
}
// FUNCTION: CONFIG 0x004046a0
void CMainDialog::OnCheckboxFlipVideoMemPages()
void CMainDialog::OnCheckboxFlipVideoMemPages(bool checked)
{
currentConfigApp->m_flip_surfaces = IsDlgButtonChecked(IDC_CHK_FLIP_VIDEO_MEM_PAGES);
m_modified = TRUE;
currentConfigApp->m_flip_surfaces = checked;
m_modified = true;
UpdateInterface();
}
// FUNCTION: CONFIG 0x004046d0
void CMainDialog::OnRadiobuttonModelLowQuality()
void CMainDialog::OnRadiobuttonModelLowQuality(bool checked)
{
currentConfigApp->m_model_quality = 1;
m_modified = TRUE;
UpdateInterface();
if (checked) {
// FIXME: are OnRadiobuttonModelLowQuality and OnRadiobuttonModelHighQuality triggered both?
qInfo() << "OnRadiobuttonModelLowQuality";
currentConfigApp->m_model_quality = 1;
m_modified = true;
UpdateInterface();
}
}
// FUNCTION: CONFIG 0x00404700
void CMainDialog::OnRadiobuttonModelHighQuality()
void CMainDialog::OnRadiobuttonModelHighQuality(bool checked)
{
currentConfigApp->m_model_quality = 2;
m_modified = TRUE;
UpdateInterface();
if (checked) {
qInfo() << "OnRadiobuttonModelHighQuality";
currentConfigApp->m_model_quality = 2;
m_modified = true;
UpdateInterface();
}
}
// FUNCTION: CONFIG 0x00404730
void CMainDialog::OnRadiobuttonTextureLowQuality()
void CMainDialog::OnRadiobuttonTextureLowQuality(bool checked)
{
currentConfigApp->m_texture_quality = 0;
m_modified = TRUE;
UpdateInterface();
if (checked) {
// FIXME: are OnRadiobuttonTextureLowQuality and OnRadiobuttonTextureHighQuality triggered both?
qInfo() << "OnRadiobuttonTextureLowQuality";
currentConfigApp->m_texture_quality = 0;
m_modified = true;
UpdateInterface();
}
}
// FUNCTION: CONFIG 0x00404760
void CMainDialog::OnRadiobuttonTextureHighQuality()
void CMainDialog::OnRadiobuttonTextureHighQuality(bool checked)
{
currentConfigApp->m_texture_quality = 1;
m_modified = TRUE;
UpdateInterface();
if (checked) {
// FIXME: are OnRadiobuttonTextureLowQuality and OnRadiobuttonTextureHighQuality triggered both?
qInfo() << "OnRadiobuttonTextureHighQuality";
currentConfigApp->m_texture_quality = 1;
m_modified = true;
UpdateInterface();
}
}
// FUNCTION: CONFIG 0x00404790
void CMainDialog::OnCheckboxJoystick()
void CMainDialog::OnCheckboxJoystick(bool checked)
{
currentConfigApp->m_use_joystick = IsDlgButtonChecked(IDC_CHK_JOYSTICK);
m_modified = TRUE;
currentConfigApp->m_use_joystick = checked;
m_modified = true;
UpdateInterface();
}
@ -315,40 +309,25 @@ void CMainDialog::OnButtonAdvanced()
}
// FUNCTION: CONFIG 0x004047d0
void CMainDialog::SwitchToAdvanced(BOOL p_advanced)
void CMainDialog::SwitchToAdvanced(bool p_advanced)
{
RECT dialog_rect;
RECT grp_advanced_rect;
::GetWindowRect(m_hWnd, &dialog_rect);
::GetWindowRect(GetDlgItem(IDC_GRP_ADVANCED)->m_hWnd, &grp_advanced_rect);
CWnd* button_advanced = GetDlgItem(IDC_BTN_ADVANCED);
m_ui->advancedGroup->setVisible(p_advanced);
layout()->setSizeConstraint(QLayout::SetMinAndMaxSize);
m_advanced = p_advanced;
int height;
if (p_advanced) {
height = grp_advanced_rect.bottom - dialog_rect.top + 10;
GetDlgItem(IDC_BMP_SHARK)->EnableWindow(TRUE);
button_advanced->SetWindowText("Basic");
}
else {
height = grp_advanced_rect.top - dialog_rect.top;
GetDlgItem(IDC_BMP_SHARK)->EnableWindow(FALSE);
button_advanced->SetWindowText("Advanced");
}
SetWindowPos(&wndTop, 0, 0, dialog_rect.right - dialog_rect.left, height, SWP_NOMOVE);
}
// FUNCTION: CONFIG 0x00404890
void CMainDialog::OnCheckboxDrawCursor()
void CMainDialog::OnCheckboxDrawCursor(bool checked)
{
currentConfigApp->m_draw_cursor = IsDlgButtonChecked(IDC_CHK_DRAW_CURSOR);
m_modified = TRUE;
currentConfigApp->m_draw_cursor = checked;
m_modified = true;
UpdateInterface();
}
// FUNCTION: CONFIG 0x004048c0
void CMainDialog::OnCheckboxMusic()
void CMainDialog::OnCheckboxMusic(bool checked)
{
currentConfigApp->m_music = IsDlgButtonChecked(IDC_CHK_MUSIC);
m_modified = TRUE;
currentConfigApp->m_music = checked;
m_modified = true;
UpdateInterface();
}

View File

@ -1,55 +1,54 @@
#if !defined(AFX_MAINDLG_H)
#define AFX_MAINDLG_H
#include "StdAfx.h"
#include "compat.h"
#include "decomp.h"
#include "res/resource.h"
#include <QDialog>
namespace Ui
{
class MainDialog;
}
// VTABLE: CONFIG 0x004063e0
// SIZE 0x70
class CMainDialog : public CDialog {
class CMainDialog : public QDialog {
Q_OBJECT
public:
CMainDialog(CWnd* pParent);
enum {
IDD = IDD_MAIN
};
CMainDialog(QWidget* pParent = nullptr);
protected:
void DoDataExchange(CDataExchange* pDX) override;
// void DoDataExchange(CDataExchange* pDX) override;
void UpdateInterface();
void SwitchToAdvanced(BOOL p_advanced);
void SwitchToAdvanced(bool p_advanced);
undefined m_unk0x60[4]; // 0x60
HCURSOR m_icon; // 0x64
BOOL m_modified; // 0x68
BOOL m_advanced; // 0x6c
// Implementation
private:
bool m_modified = false;
bool m_advanced = false;
Ui::MainDialog* m_ui = nullptr;
protected:
BOOL OnInitDialog() override;
void OnSysCommand(UINT nID, LPARAM lParam);
void OnPaint();
HCURSOR OnQueryDragIcon();
void OnList3DevicesSelectionChanged();
void OnCancel();
void OnDestroy();
void OnButtonCancel();
void OnCheckbox3DSound();
void OnCheckbox3DVideoMemory();
void OnRadiobuttonPalette16bit();
void OnRadiobuttonPalette256();
void OnCheckboxFlipVideoMemPages();
void OnRadiobuttonModelLowQuality();
void OnRadiobuttonModelHighQuality();
void OnRadiobuttonTextureLowQuality();
void OnRadiobuttonTextureHighQuality();
void OnCheckboxJoystick();
void keyReleaseEvent(QKeyEvent* event) override;
bool OnInitDialog();
private slots:
void OnList3DevicesSelectionChanged(int row);
void OnCheckbox3DSound(bool checked);
void OnCheckbox3DVideoMemory(bool checked);
void OnRadiobuttonPalette16bit(bool checked);
void OnRadiobuttonPalette256(bool checked);
void OnCheckboxFlipVideoMemPages(bool checked);
void OnRadiobuttonModelLowQuality(bool checked);
void OnRadiobuttonModelHighQuality(bool checked);
void OnRadiobuttonTextureLowQuality(bool checked);
void OnRadiobuttonTextureHighQuality(bool checked);
void OnCheckboxJoystick(bool chedked);
void OnCheckboxDrawCursor(bool checked);
void OnCheckboxMusic(bool checked);
void OnButtonAdvanced();
void OnCheckboxDrawCursor();
void OnCheckboxMusic();
DECLARE_MESSAGE_MAP()
void accept() override;
void reject() override;
};
// SYNTHETIC: CONFIG 0x00403de0

View File

@ -1,7 +0,0 @@
// stdafx.cpp : source file that includes just the standard includes
// simple.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#ifndef MINIMFC
#include "StdAfx.h"
#endif

View File

@ -1,37 +0,0 @@
#if !defined(AFX_STDAFX_H)
#define AFX_STDAFX_H
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#ifdef MINIMFC
/*#include "miniwin/mfc.h"*/
#include <QApplication>
#include <QDialog>
#else
#include <afxext.h> // MFC extensions
#include <afxwin.h> // MFC core and standard components
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#endif
#if 0
// FUNCTION: CONFIG 0x402ca0
// CObject::Serialize
// FUNCTION: CONFIG 0x402cb0
// CObject::AssertValid
// FUNCTION: CONFIG 0x402cc0
// CObject::Dump
// FUNCTION: CONFIG 0x00403c90
// CWnd::BeginModalState
// FUNCTION: CONFIG 0x00403ca0
// CWnd::EndModalState
#endif
#endif // !defined(AFX_STDAFX_H)

View File

@ -1,6 +1,5 @@
#include "config.h"
#include "ConfigCommandLineInfo.h"
#include "MainDlg.h"
#include "detectdx5.h"
@ -14,44 +13,47 @@
#include <process.h> // _spawnl
#endif
#include <QApplication>
#include <QCommandLineParser>
#include <QMessageBox>
#include <SDL3/SDL.h>
#include <iniparser.h>
DECOMP_SIZE_ASSERT(CWinApp, 0xc4)
DECOMP_SIZE_ASSERT(CConfigApp, 0x108)
DECOMP_STATIC_ASSERT(offsetof(CConfigApp, m_display_bit_depth) == 0xd0)
BEGIN_MESSAGE_MAP(CConfigApp, CWinApp)
ON_COMMAND(ID_HELP, OnHelp)
END_MESSAGE_MAP()
// FUNCTION: CONFIG 0x00402c40
CConfigApp::CConfigApp()
{
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
char* iniConfig;
if (prefPath) {
m_iniPath = std::string{prefPath} + "isle.ini";
}
else {
m_iniPath = "isle.ini";
}
SDL_free(prefPath);
}
#define MiB (1024 * 1024)
// FUNCTION: CONFIG 0x00402dc0
BOOL CConfigApp::InitInstance()
bool CConfigApp::InitInstance()
{
if (!IsLegoNotRunning()) {
return FALSE;
if (!SDL_Init(SDL_INIT_VIDEO)) {
QString err = QString{"SDL failed to initialize ("} + SDL_GetError() + ")";
QMessageBox::warning(nullptr, "SDL initialization error", err);
return false;
}
if (!DetectDirectX5()) {
AfxMessageBox(
"\"LEGO\xae Island\" is not detecting DirectX 5 or later. Please quit all other applications and try "
QMessageBox::warning(
nullptr,
"Missing DirectX",
"\"LEGO\xc2\xae Island\" is not detecting DirectX 5 or later. Please quit all other applications and try "
"again."
);
return FALSE;
}
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
CConfigCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (_stricmp(afxCurrentAppName, "config") == 0) {
m_run_config_dialog = TRUE;
return false;
}
m_device_enumerator = new LegoDeviceEnumerate;
if (m_device_enumerator->DoEnumerate()) {
@ -67,15 +69,13 @@ BOOL CConfigApp::InitInstance()
m_3d_video_ram = FALSE;
m_joystick_index = -1;
m_display_bit_depth = 16;
MEMORYSTATUS memory_status;
memory_status.dwLength = sizeof(memory_status);
GlobalMemoryStatus(&memory_status);
if (memory_status.dwTotalPhys < 12 * MiB) {
int totalRamMiB = SDL_GetSystemRAM();
if (totalRamMiB < 12) {
m_3d_sound = FALSE;
m_model_quality = 0;
m_texture_quality = 1;
}
else if (memory_status.dwTotalPhys < 20 * MiB) {
else if (totalRamMiB < 20) {
m_3d_sound = FALSE;
m_model_quality = 1;
m_texture_quality = 1;
@ -85,126 +85,11 @@ BOOL CConfigApp::InitInstance()
m_3d_sound = TRUE;
m_texture_quality = 1;
}
if (!m_run_config_dialog) {
ReadRegisterSettings();
ValidateSettings();
WriteRegisterSettings();
delete m_device_enumerator;
m_device_enumerator = NULL;
m_driver = NULL;
m_device = NULL;
char password[256];
ReadReg("password", password, sizeof(password));
const char* exe = _stricmp("ogel", password) == 0 ? "isled.exe" : "isle.exe";
char diskpath[1024];
if (ReadReg("diskpath", diskpath, sizeof(diskpath))) {
_chdir(diskpath);
}
_spawnl(_P_NOWAIT, exe, exe, "/diskstream", "/script", "\\lego\\scripts\\isle\\isle.si", NULL);
return FALSE;
}
CMainDialog main_dialog(NULL);
main_dialog.DoModal();
return FALSE;
}
// FUNCTION: CONFIG 0x00403100
BOOL CConfigApp::IsLegoNotRunning()
{
HWND hWnd = FindWindow("Lego Island MainNoM App", "LEGO\xae");
if (_stricmp(afxCurrentAppName, "config") == 0 || !hWnd) {
return TRUE;
}
if (SetForegroundWindow(hWnd)) {
ShowWindow(hWnd, SW_RESTORE);
}
return FALSE;
}
// FUNCTION: CONFIG 0x004031b0
BOOL CConfigApp::WriteReg(const char* p_key, const char* p_value) const
{
HKEY hKey;
DWORD pos;
if (RegCreateKeyEx(
HKEY_LOCAL_MACHINE,
"SOFTWARE\\Mindscape\\LEGO Island",
0,
"string",
0,
KEY_READ | KEY_WRITE,
NULL,
&hKey,
&pos
) == ERROR_SUCCESS) {
if (RegSetValueEx(hKey, p_key, 0, REG_SZ, (LPBYTE) p_value, strlen(p_value)) == ERROR_SUCCESS) {
if (RegCloseKey(hKey) == ERROR_SUCCESS) {
return TRUE;
}
}
else {
RegCloseKey(hKey);
}
}
return FALSE;
}
// FUNCTION: CONFIG 0x00403240
BOOL CConfigApp::ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const
{
HKEY hKey;
DWORD valueType;
BOOL out = FALSE;
DWORD size = p_size;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueEx(hKey, p_key, NULL, &valueType, (LPBYTE) p_value, &size) == ERROR_SUCCESS) {
if (RegCloseKey(hKey) == ERROR_SUCCESS) {
out = TRUE;
}
}
}
return out;
}
// FUNCTION: CONFIG 0x004032b0
BOOL CConfigApp::ReadRegBool(LPCSTR p_key, BOOL* p_bool) const
{
char buffer[256];
BOOL read = ReadReg(p_key, buffer, sizeof(buffer));
if (read) {
if (strcmp("YES", buffer) == 0) {
*p_bool = TRUE;
return read;
}
if (strcmp("NO", buffer) == 0) {
*p_bool = FALSE;
return read;
}
read = FALSE;
}
return read;
}
// FUNCTION: CONFIG 0x00403380
BOOL CConfigApp::ReadRegInt(LPCSTR p_key, int* p_value) const
{
char buffer[256];
BOOL read = ReadReg(p_key, buffer, sizeof(buffer));
if (read) {
*p_value = atoi(buffer);
}
return read;
return true;
}
// FUNCTION: CONFIG 0x004033d0
BOOL CConfigApp::IsDeviceInBasicRGBMode() const
bool CConfigApp::IsDeviceInBasicRGBMode() const
{
/*
* BUG: should be:
@ -220,71 +105,55 @@ D3DCOLORMODEL CConfigApp::GetHardwareDeviceColorModel() const
}
// FUNCTION: CONFIG 0x00403410
BOOL CConfigApp::IsPrimaryDriver() const
bool CConfigApp::IsPrimaryDriver() const
{
return m_driver == &m_device_enumerator->GetDriverList().front();
}
// FUNCTION: CONFIG 0x00403430
BOOL CConfigApp::ReadRegisterSettings()
bool CConfigApp::ReadRegisterSettings()
{
char buffer[256];
BOOL is_modified = FALSE;
int tmp = -1;
#define NOT_FOUND (-2)
if (ReadReg("3D Device ID", buffer, sizeof(buffer))) {
tmp = m_device_enumerator->ParseDeviceName(buffer);
dictionary* dict = iniparser_load(m_iniPath.c_str());
if (!dict) {
dict = dictionary_new(0);
}
const char* device3D = iniparser_getstring(dict, "isle:3D Device ID", nullptr);
if (device3D) {
tmp = m_device_enumerator->ParseDeviceName(device3D);
if (tmp >= 0) {
tmp = m_device_enumerator->GetDevice(tmp, m_driver, m_device);
}
}
if (tmp != 0) {
is_modified = TRUE;
m_device_enumerator->FUN_1009d210();
tmp = m_device_enumerator->GetBestDevice();
m_device_enumerator->GetDevice(tmp, m_driver, m_device);
}
if (!ReadRegInt("Display Bit Depth", &m_display_bit_depth)) {
is_modified = TRUE;
}
if (!ReadRegBool("Flip Surfaces", &m_flip_surfaces)) {
is_modified = TRUE;
}
if (!ReadRegBool("Full Screen", &m_full_screen)) {
is_modified = TRUE;
}
if (!ReadRegBool("Back Buffers in Video RAM", &m_3d_video_ram)) {
is_modified = TRUE;
}
if (!ReadRegBool("Wide View Angle", &m_wide_view_angle)) {
is_modified = TRUE;
}
if (!ReadRegBool("3DSound", &m_3d_sound)) {
is_modified = TRUE;
}
if (!ReadRegBool("Draw Cursor", &m_draw_cursor)) {
is_modified = TRUE;
}
if (!ReadRegInt("Island Quality", &m_model_quality)) {
is_modified = TRUE;
}
if (!ReadRegInt("Island Texture", &m_texture_quality)) {
is_modified = TRUE;
}
if (!ReadRegBool("UseJoystick", &m_use_joystick)) {
is_modified = TRUE;
}
if (!ReadRegBool("Music", &m_music)) {
is_modified = TRUE;
}
if (!ReadRegInt("JoystickIndex", &m_joystick_index)) {
is_modified = TRUE;
}
return is_modified;
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_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_display_bit_depth = iniparser_getint(dict, "isle:Display Bit Depth", -1);
m_flip_surfaces = iniparser_getboolean(dict, "isle:Flip Surfaces", m_flip_surfaces);
m_full_screen = iniparser_getboolean(dict, "isle:Full Screen", m_full_screen);
m_3d_video_ram = iniparser_getboolean(dict, "isle:Back Buffers in Video RAM", m_3d_video_ram);
m_wide_view_angle = iniparser_getboolean(dict, "isle:Wide View Angle", m_wide_view_angle);
m_3d_sound = iniparser_getboolean(dict, "isle:3DSound", m_3d_sound);
m_draw_cursor = iniparser_getboolean(dict, "isle:Draw Cursor", m_draw_cursor);
m_model_quality = iniparser_getint(dict, "isle:Island Quality", m_model_quality);
m_texture_quality = iniparser_getint(dict, "isle:Island Texture", m_texture_quality);
m_use_joystick = iniparser_getboolean(dict, "isle:UseJoystick", m_use_joystick);
m_music = iniparser_getboolean(dict, "isle:Music", m_music);
m_joystick_index = iniparser_getint(dict, "isle:JoystickIndex", m_joystick_index);
return true;
}
// FUNCTION: CONFIG 0x00403630
BOOL CConfigApp::ValidateSettings()
bool CConfigApp::ValidateSettings()
{
BOOL is_modified = FALSE;
@ -369,7 +238,7 @@ DWORD CConfigApp::GetDeviceRenderBitStatus() const
}
// FUNCTION: CONFIG 0x00403810
BOOL CConfigApp::AdjustDisplayBitDepthBasedOnRenderStatus()
bool CConfigApp::AdjustDisplayBitDepthBasedOnRenderStatus()
{
if (m_display_bit_depth == 8) {
if (GetConditionalDeviceRenderBitDepth()) {
@ -398,32 +267,55 @@ void CConfigApp::WriteRegisterSettings() const
{
char buffer[128];
#define WriteRegBool(NAME, VALUE) WriteReg(NAME, VALUE ? "YES" : "NO")
#define WriteRegInt(NAME, VALUE) \
#define SetIniBool(DICT, NAME, VALUE) iniparser_set(DICT, NAME, VALUE ? "true" : "false")
#define SetIniInt(DICT, NAME, VALUE) \
do { \
sprintf(buffer, "%d", VALUE); \
WriteReg(NAME, buffer); \
iniparser_set(DICT, NAME, buffer); \
} while (0)
m_device_enumerator->FormatDeviceName(buffer, m_driver, m_device);
WriteReg("3D Device ID", buffer);
WriteReg("3D Device Name", m_device->m_deviceName);
WriteRegInt("Display Bit Depth", m_display_bit_depth);
WriteRegBool("Flip Surfaces", m_flip_surfaces);
WriteRegBool("Full Screen", m_full_screen);
WriteRegBool("Back Buffers in Video RAM", m_3d_video_ram);
WriteRegBool("Wide View Angle", m_wide_view_angle);
WriteRegBool("3DSound", m_3d_sound);
WriteRegBool("Draw Cursor", m_draw_cursor);
WriteRegInt("Island Quality", m_model_quality);
WriteRegInt("Island Texture", m_texture_quality);
WriteRegBool("UseJoystick", m_use_joystick);
WriteRegBool("Music", m_music);
WriteRegInt("JoystickIndex", m_joystick_index);
#undef WriteRegBool
#undef WriteRegInt
dictionary* dict = dictionary_new(0);
iniparser_set(dict, "isle", NULL);
if (m_device_enumerator->FormatDeviceName(buffer, m_driver, m_device) >= 0) {
iniparser_set(dict, "isle:3D Device ID", buffer);
}
iniparser_set(dict, "isle:diskpath", m_base_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());
SetIniBool(dict, "isle:Display Bit Depth", m_display_bit_depth);
SetIniBool(dict, "isle:Flip Surfaces", m_flip_surfaces);
SetIniBool(dict, "isle:Full Screen", m_full_screen);
SetIniBool(dict, "isle:Wide View Angle", m_wide_view_angle);
SetIniBool(dict, "isle:3DSound", m_3d_sound);
SetIniBool(dict, "isle:Music", m_music);
SetIniInt(dict, "isle:UseJoystick", m_use_joystick);
SetIniBool(dict, "isle:JoystickIndex", m_joystick_index);
SetIniBool(dict, "isle:Draw Cursor", m_draw_cursor);
SetIniBool(dict, "isle:Back Buffers in Video RAM", m_3d_video_ram);
SetIniInt(dict, "isle:Island Quality", m_model_quality);
SetIniInt(dict, "isle:Island Texture", m_texture_quality);
#undef SetIniBool
#undef SetIniInt
FILE* iniFP = fopen(m_iniPath.c_str(), "wb");
if (iniFP) {
iniparser_dump_ini(dict, iniFP);
qInfo() << "New config written at" << QString::fromStdString(m_iniPath);
fclose(iniFP);
}
else {
QMessageBox::warning(nullptr, "Failed to save ini", "Failed to save ini");
}
iniparser_freedict(dict);
}
// FUNCTION: CONFIG 0x00403a90
@ -433,8 +325,68 @@ int CConfigApp::ExitInstance()
delete m_device_enumerator;
m_device_enumerator = NULL;
}
return CWinApp::ExitInstance();
SDL_Quit();
return 0;
}
void CConfigApp::SetIniPath(const std::string& p_path)
{
m_iniPath = p_path;
}
const std::string& CConfigApp::GetIniPath() const
{
return m_iniPath;
}
// GLOBAL: CONFIG 0x00408e50
CConfigApp g_theApp;
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QCoreApplication::setApplicationName("config");
QCoreApplication::setApplicationVersion("1.0");
QCommandLineParser parser;
parser.setApplicationDescription("Configure LEGO Island");
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption iniOption(
QStringList() << "ini",
QCoreApplication::translate("config", "Set INI path."),
QCoreApplication::translate("config", "path")
);
parser.addOption(iniOption);
parser.process(app);
if (parser.isSet(iniOption)) {
g_theApp.SetIniPath(parser.value(iniOption).toStdString());
}
qInfo() << "Ini path =" << QString::fromStdString(g_theApp.GetIniPath());
int result = 1;
if (g_theApp.InitInstance()) {
CMainDialog main_dialog;
main_dialog.show();
result = app.exec();
}
g_theApp.ExitInstance();
return result;
}
#ifdef _WIN32
extern "C" int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR /*cmdParamarg*/, int cmdShow)
{
// Work-around problems with wchar_t as a native type
const unsigned short* cmdLineUtf16 = reinterpret_cast<const unsigned short*>(GetCommandLineW());
QByteArray cmdParam = QString::fromUtf16(cmdLineUtf16).toLocal8Bit();
int argc = 0;
QVector<char*> argv(8);
qWinMain(instance, prevInstance, cmdParam.data(), cmdShow, argc, argv);
int result = main(argc, argv.data());
return result;
}
#endif

View File

@ -2,7 +2,6 @@
#define AFX_CONFIG_H
#include "AboutDlg.h"
#include "StdAfx.h"
#include "compat.h"
#include "decomp.h"
@ -12,15 +11,17 @@
#include <d3d.h>
#endif
#include <string>
class LegoDeviceEnumerate;
struct Direct3DDeviceInfo;
struct MxDriver;
#define currentConfigApp ((CConfigApp*) afxCurrentWinApp)
#define currentConfigApp (&g_theApp)
// VTABLE: CONFIG 0x00406040
// SIZE 0x108
class CConfigApp : public QApplication {
class CConfigApp {
public:
CConfigApp();
@ -29,68 +30,57 @@ class CConfigApp : public QApplication {
//{{AFX_VIRTUAL(CConfigApp)
public:
BOOL InitInstance() override;
int ExitInstance() override;
bool InitInstance();
int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
BOOL WriteReg(const char* p_key, const char* p_value) const;
BOOL ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const;
BOOL ReadRegBool(LPCSTR p_key, BOOL* p_bool) const;
BOOL ReadRegInt(LPCSTR p_key, int* p_value) const;
BOOL IsDeviceInBasicRGBMode() const;
// bool WriteReg(const char* p_key, const char* p_value) const;
// bool ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const;
// bool ReadRegBool(LPCSTR p_key, bool* p_bool) const;
// bool ReadRegInt(LPCSTR p_key, int* p_value) const;
bool IsDeviceInBasicRGBMode() const;
D3DCOLORMODEL GetHardwareDeviceColorModel() const;
BOOL IsPrimaryDriver() const;
BOOL ReadRegisterSettings();
BOOL ValidateSettings();
bool IsPrimaryDriver() const;
bool ReadRegisterSettings();
bool ValidateSettings();
DWORD GetConditionalDeviceRenderBitDepth() const;
DWORD GetDeviceRenderBitStatus() const;
BOOL AdjustDisplayBitDepthBasedOnRenderStatus();
bool AdjustDisplayBitDepthBasedOnRenderStatus();
void WriteRegisterSettings() const;
void SetIniPath(const std::string& p_path);
const std::string& GetIniPath() const;
//{{AFX_MSG(CConfigApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
BOOL IsLegoNotRunning();
// DECLARE_MESSAGE_MAP()
public:
LegoDeviceEnumerate* m_device_enumerator; // 0x0c4
MxDriver* m_driver; // 0x0c8
Direct3DDeviceInfo* m_device; // 0x0cc
int m_display_bit_depth; // 0x0d0
BOOL m_flip_surfaces; // 0x0d4
BOOL m_full_screen; // 0x0d8
BOOL m_3d_video_ram; // 0x0dc
BOOL m_wide_view_angle; // 0x0e0
BOOL m_3d_sound; // 0x0e4
BOOL m_draw_cursor; // 0x0e8
BOOL m_use_joystick; // 0x0ec
int m_joystick_index; // 0x0f0
BOOL m_run_config_dialog; // 0x0f4
int m_model_quality; // 0x0f8
int m_texture_quality; // 0x0fc
undefined m_unk0x100[4]; // 0x100
BOOL m_music; // 0x104
LegoDeviceEnumerate* m_device_enumerator;
MxDriver* m_driver;
Direct3DDeviceInfo* m_device;
int m_display_bit_depth;
bool m_flip_surfaces;
bool m_full_screen;
bool m_3d_video_ram;
bool m_wide_view_angle;
bool m_3d_sound;
bool m_draw_cursor;
bool m_use_joystick;
int m_joystick_index;
int m_model_quality;
int m_texture_quality;
bool m_music;
std::string m_iniPath;
std::string m_base_path;
std::string m_cd_path;
std::string m_media_path;
std::string m_save_path;
};
// SYNTHETIC: CONFIG 0x00402cd0
// CConfigApp::`scalar deleting destructor'
// FUNCTION: CONFIG 0x402c20
// CConfigApp::_GetBaseMessageMap
// FUNCTION: CONFIG 0x402c30
// CConfigApp::GetMessageMap
// GLOBAL: CONFIG 0x406008
// CConfigApp::messageMap
// GLOBAL: CONFIG 0x406010
// CConfigApp::_messageEntries
extern CConfigApp g_theApp;
#endif // !defined(AFX_CONFIG_H)

View File

@ -3,8 +3,8 @@
#ifdef MINIWIN
#include "miniwin/ddraw.h"
#include "miniwin/dinput.h"
#include "qoperatingsystemversion.h"
#include "qlibrary.h"
#include "qoperatingsystemversion.h"
#else
#include <ddraw.h>
#include <dinput.h>
@ -17,138 +17,142 @@ typedef HRESULT WINAPI
DirectInputCreateA_fn(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA* ppDI, LPUNKNOWN punkOuter);
// FUNCTION: CONFIG 0x004048f0
BOOL DetectDirectX5()
bool DetectDirectX5()
{
unsigned int version;
BOOL found;
bool found;
DetectDirectX(&version, &found);
return version >= 0x500;
}
// FUNCTION: CONFIG 0x00404920
void DetectDirectX(unsigned int* p_version, BOOL* p_found)
void DetectDirectX(unsigned int* p_version, bool* p_found)
{
QOperatingSystemVersion os_version = QOperatingSystemVersion::current();
#ifdef MINIWIN
QOperatingSystemVersion os_version = QOperatingSystemVersion::current();
*p_found = true;
*p_version = 0x500;
#else
if (os_version.type() == QOperatingSystemVersion::Unknown) {
OSVERSIONINFOA os_version;
os_version.dwOSVersionInfoSize = sizeof(os_version);
if (!GetVersionEx(&os_version)) {
*p_version = 0;
*p_found = 0;
return;
}
if (os_version.type() == QOperatingSystemVersion::Windows) {
if (os_version.dwPlatformId == 2) {
*p_found = 2;
if (os_version.majorVersion() < 4) {
if (os_version.dwMajorVersion < 4) {
*p_found = 0;
return;
}
if (os_version.majorVersion() != 4) {
*p_version = 0x501;
if (os_version.dwMajorVersion != 4) {
*p_version = MAKEWORD(5, 1);
return;
}
*p_version = 0x200;
QLibrary dinput_module("DINPUT.DLL");
dinput_module.load();
if (!dinput_module.isLoaded()) {
QT_DEBUG("Couldn't LoadLibrary DInput\r\n");
HMODULE dinput_module = LoadLibrary("DINPUT.DLL");
if (!dinput_module) {
OutputDebugString("Couldn't LoadLibrary DInput\r\n");
return;
}
DirectInputCreateA_fn* func_DirectInputCreateA =
reinterpret_cast<DirectInputCreateA_fn*>(dinput_module.resolve("DirectInputCreateA"));
dinput_module.unload();
(DirectInputCreateA_fn*) GetProcAddress(dinput_module, "DirectInputCreateA");
FreeLibrary(dinput_module);
if (!func_DirectInputCreateA) {
QT_DEBUG("Couldn't GetProcAddress DInputCreate\r\n");
OutputDebugString("Couldn't GetProcAddress DInputCreate\r\n");
return;
}
*p_version = 0x300;
*p_version = MAKEWORD(3, 0);
return;
}
*p_found = 1;
if (os_version.majorVersion() >= 0x550) {
QT_DEBUG("what is this for??");
*p_version = 0x501;
*p_found = true;
if (LOWORD(os_version.dwBuildNumber) >= 0x550) {
*p_version = MAKEWORD(5, 1);
return;
}
QLibrary ddraw_module("DDRAW.DLL");
ddraw_module.load();
if (!ddraw_module.isLoaded()) {
HMODULE ddraw_module = LoadLibrary("DDRAW.DLL");
if (!ddraw_module) {
*p_version = 0;
*p_found = 0;
ddraw_module.unload();
*p_found = false;
FreeLibrary(ddraw_module);
return;
}
DirectDrawCreate_fn* func_DirectDrawCreate =
reinterpret_cast<DirectDrawCreate_fn*>(ddraw_module.resolve("DirectDrawCreate"));
(DirectDrawCreate_fn*) GetProcAddress(ddraw_module, "DirectDrawCreate");
if (!func_DirectDrawCreate) {
*p_version = 0;
*p_found = 0;
ddraw_module.unload();
QT_DEBUG("Couldn't LoadLibrary DDraw\r\n");
*p_found = false;
FreeLibrary(ddraw_module);
OutputDebugString("Couldn't LoadLibrary DDraw\r\n");
return;
}
LPDIRECTDRAW ddraw;
if (func_DirectDrawCreate(NULL, &ddraw, NULL) < 0) {
if (FAILED(func_DirectDrawCreate(NULL, &ddraw, NULL))) {
*p_version = 0;
*p_found = 0;
ddraw_module.unload();
QT_DEBUG("Couldn't create DDraw\r\n");
*p_found = false;
FreeLibrary(ddraw_module);
OutputDebugString("Couldn't create DDraw\r\n");
return;
}
*p_version = 0x100;
*p_version = MAKEWORD(1, 0);
LPDIRECTDRAW2 ddraw2;
if (ddraw->QueryInterface(IID_IDirectDraw2, (LPVOID*) &ddraw2) < 0) {
if (FAILED(ddraw->QueryInterface(IID_IDirectDraw2, (LPVOID*) &ddraw2))) {
ddraw->Release();
ddraw_module.unload();
QT_DEBUG("Couldn't QI DDraw2\r\n");
FreeLibrary(ddraw_module);
OutputDebugString("Couldn't QI DDraw2\r\n");
return;
}
ddraw->Release();
*p_version = 0x200;
QLibrary dinput_module("DINPUT.DLL");
dinput_module.load();
if (!dinput_module.isLoaded()) {
QT_DEBUG("Couldn't LoadLibrary DInput\r\n");
*p_version = MAKEWORD(2, 0);
HMODULE dinput_module = LoadLibrary("DINPUT.DLL");
if (!dinput_module) {
OutputDebugString("Couldn't LoadLibrary DInput\r\n");
ddraw2->Release();
ddraw_module.unload();
FreeLibrary(ddraw_module);
return;
}
DirectInputCreateA_fn* func_DirectInputCreateA =
reinterpret_cast<DirectInputCreateA_fn*>(dinput_module.resolve("DirectInputCreateA"));
dinput_module.unload();
(DirectInputCreateA_fn*) GetProcAddress(dinput_module, "DirectInputCreateA");
FreeLibrary(dinput_module);
if (!func_DirectInputCreateA) {
ddraw_module.unload();
FreeLibrary(ddraw_module);
ddraw2->Release();
QT_DEBUG("Couldn't GetProcAddress DInputCreate\r\n");
OutputDebugString("Couldn't GetProcAddress DInputCreate\r\n");
return;
}
*p_version = 0x300;
*p_version = MAKEWORD(3, 0);
DDSURFACEDESC surface_desc;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS;
surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
if (ddraw2->SetCooperativeLevel(NULL, DDSCL_NORMAL) < 0) {
if (FAILED(ddraw2->SetCooperativeLevel(NULL, DDSCL_NORMAL))) {
ddraw2->Release();
ddraw_module.unload();
FreeLibrary(ddraw_module);
*p_version = 0;
QT_DEBUG("Couldn't Set coop level\r\n");
OutputDebugString("Couldn't Set coop level\r\n");
return;
}
LPDIRECTDRAWSURFACE surface;
if (ddraw2->CreateSurface(&surface_desc, &surface, NULL) < 0) {
if (FAILED(ddraw2->CreateSurface(&surface_desc, &surface, NULL))) {
ddraw2->Release();
ddraw_module.unload();
FreeLibrary(ddraw_module);
*p_version = 0;
QT_DEBUG("Couldn't CreateSurface\r\n");
OutputDebugString("Couldn't CreateSurface\r\n");
return;
}
LPDIRECTDRAWSURFACE3 surface3;
if (surface->QueryInterface(IID_IDirectDrawSurface3, reinterpret_cast<LPVOID*>(&surface3)) < 0) {
if (FAILED(surface->QueryInterface(IID_IDirectDrawSurface3, (LPVOID*) &surface3))) {
ddraw2->Release();
ddraw_module.unload();
FreeLibrary(ddraw_module);
return;
}
*p_version = 0x500;
*p_version = MAKEWORD(5, 0);
surface3->Release();
ddraw2->Release();
ddraw_module.unload();
FreeLibrary(ddraw_module);
#endif
}

View File

@ -7,8 +7,8 @@
#include <windows.h>
#endif
extern BOOL DetectDirectX5();
extern bool DetectDirectX5();
extern void DetectDirectX(unsigned int* p_version, BOOL* p_found);
extern void DetectDirectX(unsigned int* p_version, bool* p_found);
#endif // !defined(AFX_DETECTDX5_H)

99
CONFIG/res/about.ui Normal file
View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>387</width>
<height>78</height>
</rect>
</property>
<property name="windowTitle">
<string>About Configure LEGO© Island</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0">
<item>
<widget class="QLabel" name="houseIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="config.qrc">:/lego1.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="textWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="configureLabel">
<property name="text">
<string>Configure LEGO Island Version 1.0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="copyrightLabel">
<property name="text">
<string>Copyright © 1997 mindscape</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="config.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AboutDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AboutDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

7
CONFIG/res/config.qrc Normal file
View File

@ -0,0 +1,7 @@
<RCC>
<qresource prefix="/">
<file>shark.png</file>
<file>lego1.png</file>
<file>lego2.png</file>
</qresource>
</RCC>

View File

@ -1,58 +1,6 @@
#include "resource.h"
#include "afxres.h"
#include <windows.h>
IDI_CONFIG ICON "lego.ico"
IDB_SHARK BITMAP "shark.bmp"
IDD_ABOUT DIALOG 0, 0, 217, 55
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About Configure LEGO\xAE Island"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Sans Serif"
BEGIN
CONTROL IDI_CONFIG, -1, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 11, 17, 18, 20
CONTROL "Configure LEGO Island Version 1.0", -1, "STATIC", SS_LEFT | SS_NOPREFIX | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 10, 119, 8
CONTROL "Copyright \xA9 1997 mindscape", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 25, 119, 8
CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 178, 7, 32, 14
END
STRINGTABLE
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
BEGIN
IDS_ABOUT, "&About Config..."
END
IDD_MAIN DIALOGEX 0, 0, 289, 247
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Configure LEGO Island"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "OK", IDABORT, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 172, 125, 44, 14
CONTROL "Cancel", IDCANCEL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 238, 125, 44, 14
CONTROL "Fast", IDC_RAD_MODEL_QUALITY_LOW, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 124, 18, 42, 10
CONTROL "High", IDC_RAD_MODEL_QUALITY_HIGH, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 192, 18, 69, 10
CONTROL "Fast", IDC_RAD_TEXTURE_QUALITY_LOW, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 124, 49, 43, 10
CONTROL "High", IDC_RAD_TEXTURE_QUALITY_HIGH, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 192, 49, 69, 10
CONTROL "256 Color", IDC_RAD_PALETTE_256, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 124, 80, 50, 10
CONTROL "High Color(16 bit)", IDC_RAD_PALETTE_16BIT, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 192, 80, 76, 10
CONTROL "Use Joystick", IDC_CHK_JOYSTICK, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 192, 104, 60, 10
CONTROL "", IDC_LIST_3DDEVICES, "LISTBOX", LBS_NOTIFY | LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, 115, 168, 161, 36 , WS_EX_TRANSPARENT
CONTROL "Flip Video Memory Pages", IDC_CHK_FLIP_VIDEO_MEM_PAGES, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE, 116, 224, 96, 15
CONTROL "Draw 3D to Video Memory", IDC_CHK_3D_VIDEO_MEMORY, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE, 116, 210, 99, 10
CONTROL "Color Palette", -1, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 107, 69, 175, 26
CONTROL "Direct 3D Devices", -1, "STATIC", SS_CENTER | WS_CHILD | WS_VISIBLE | WS_GROUP, 123, 158, 143, 10
CONTROL "3D Sound", IDC_CHK_3DSOUND, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE, 220, 210, 45, 10
CONTROL "Island Model Quality", -1, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 107, 7, 175, 26
CONTROL "Island Texture Quality", -1, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 107, 38, 175, 26
CONTROL "Advanced Settings", IDC_GRP_ADVANCED, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 107, 147, 175, 93
CONTROL "Advanced", IDC_BTN_ADVANCED, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 109, 124, 44, 14
CONTROL IDB_SHARK, IDC_BMP_SHARK, "STATIC", SS_BITMAP | WS_CHILD | WS_VISIBLE, 7, 7, 83, 249
CONTROL "Draw Cursor", IDC_CHK_DRAW_CURSOR, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE, 219, 227, 54, 10
CONTROL "Music", IDC_CHK_MUSIC, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 124, 104, 35, 10
END
1 ICON "lego.ico"
1 VERSIONINFO
FILEVERSION 1,1,0,0

BIN
CONFIG/res/lego1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

BIN
CONFIG/res/lego2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

357
CONFIG/res/maindialog.ui Normal file
View File

@ -0,0 +1,357 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainDialog</class>
<widget class="QDialog" name="MainDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>549</width>
<height>563</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Configure LEGO Island</string>
</property>
<property name="windowIcon">
<iconset resource="config.qrc">
<normaloff>:/lego1.png</normaloff>:/lego1.png</iconset>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
<item>
<widget class="QLabel" name="sharkImageLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>143</width>
<height>545</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="config.qrc">:/shark.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="settingsWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<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="QWidget" name="normalWidget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>41</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<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="textureQualityGroup">
<property name="title">
<string>Island Texture Quality</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QRadioButton" name="textureQualityFastRadioButton">
<property name="text">
<string>Fast</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="textureQualityHighRadioButton">
<property name="text">
<string>High</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="modelQualityGroup">
<property name="title">
<string>Island Model Quality</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QRadioButton" name="modelQualityFastRadioButton">
<property name="text">
<string>Fast</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="modelQualityHighRadioButton">
<property name="text">
<string>High</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="colorPaletteGroup">
<property name="title">
<string>Color Palette</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QRadioButton" name="colorPalette256RadioButton">
<property name="text">
<string>256 Color</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="colorPalette16bitRadioButton">
<property name="text">
<string>High Color (16 bit)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="musicJoystickWidget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="musicCheckBox">
<property name="text">
<string>Music</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="joystickCheckBox">
<property name="text">
<string>Use Joystick</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="buttonWidgets" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
<number>30</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="QPushButton" name="advancedButton">
<property name="text">
<string>Advanced</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="okButton">
<property name="text">
<string>OK</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="advancedGroup">
<property name="title">
<string>Advanced Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="direct3DDevicesLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Direct 3D Devices</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="devicesList">
<property name="enabled">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="D3DCheckboxWidget" native="true">
<layout class="QGridLayout" name="gridLayout">
<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 row="1" column="0">
<widget class="QCheckBox" name="flipVideoMemoryPagesCheckBox">
<property name="text">
<string>Flip Video Memory Pages</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="videomemoryCheckBox">
<property name="text">
<string>Draw 3D to Video Memory</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="sound3DCheckBox">
<property name="text">
<string>3D Sound</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="drawCursorCheckBox">
<property name="text">
<string>Draw Cursor</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="config.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1,25 +0,0 @@
#define IDI_CONFIG 128
#define IDD_ABOUT 100
#define IDS_ABOUT 101
#define IDD_MAIN 102
#define IDC_LIST_3DDEVICES 1000
#define IDC_CHK_FLIP_VIDEO_MEM_PAGES 1001
#define IDC_CHK_3D_VIDEO_MEMORY 1003
#define IDC_RAD_PALETTE_256 1004
#define IDC_RAD_PALETTE_16BIT 1005
#define IDC_CHK_3DSOUND 1006
#define IDC_CHK_DRAW_CURSOR 1008
#define IDC_RAD_MODEL_QUALITY_LOW 1010
#define IDC_RAD_MODEL_QUALITY_HIGH 1011
#define IDC_RAD_TEXTURE_QUALITY_LOW 1013
#define IDC_RAD_TEXTURE_QUALITY_HIGH 1014
#define IDC_CHK_JOYSTICK 1015
#define IDC_GRP_ADVANCED 1017
#define IDC_BTN_ADVANCED 1020
#define IDC_BMP_SHARK 1023
#define IDC_CHK_MUSIC 1024
#define IDB_SHARK 135

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

BIN
CONFIG/res/shark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB