18ON_COMMAND(ID_HELP, OnHelp)
26#define MiB (1024 * 1024)
31 if (!IsLegoNotRunning()) {
36 "\"LEGO\xae Island\" is not detecting DirectX 5 or later. Please quit all other applications and try "
44 Enable3dControlsStatic();
47 ParseCommandLine(cmdInfo);
48 if (_stricmp(afxCurrentAppName,
"config") == 0) {
65 MEMORYSTATUS memory_status;
66 memory_status.dwLength =
sizeof(memory_status);
67 GlobalMemoryStatus(&memory_status);
68 if (memory_status.dwTotalPhys < 12 *
MiB) {
73 else if (memory_status.dwTotalPhys < 20 *
MiB) {
92 ReadReg(
"password", password,
sizeof(password));
93 const char* exe = _stricmp(
"ogel", password) == 0 ?
"isled.exe" :
"isle.exe";
95 if (
ReadReg(
"diskpath", diskpath,
sizeof(diskpath))) {
98 _spawnl(_P_NOWAIT, exe, exe,
"/diskstream",
"/script",
"\\lego\\scripts\\isle\\isle.si",
NULL);
102 main_dialog.DoModal();
107BOOL CConfigApp::IsLegoNotRunning()
109 HWND
hWnd = FindWindowA(
"Lego Island MainNoM App",
"LEGO\xae");
110 if (_stricmp(afxCurrentAppName,
"config") == 0 || !
hWnd) {
113 if (SetForegroundWindow(
hWnd)) {
114 ShowWindow(
hWnd, SW_RESTORE);
127 "SOFTWARE\\Mindscape\\LEGO Island",
131 KEY_READ | KEY_WRITE,
135 ) == ERROR_SUCCESS) {
136 if (RegSetValueExA(hKey, p_key, 0, REG_SZ, (LPBYTE) p_value, strlen(p_value)) == ERROR_SUCCESS) {
137 if (RegCloseKey(hKey) == ERROR_SUCCESS) {
156 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
157 if (RegQueryValueExA(hKey, p_key,
NULL, &valueType, (LPBYTE) p_value, &size) == ERROR_SUCCESS) {
158 if (RegCloseKey(hKey) == ERROR_SUCCESS) {
171 BOOL read =
ReadReg(p_key, buffer,
sizeof(buffer));
173 if (strcmp(
"YES", buffer) == 0) {
178 if (strcmp(
"NO", buffer) == 0) {
193 BOOL read =
ReadReg(p_key, buffer,
sizeof(buffer));
195 *p_value = atoi(buffer);
230 if (
ReadReg(
"3D Device ID", buffer,
sizeof(buffer))) {
332 if (m_model_quality < 0 || m_model_quality > 2) {
336 if (m_texture_quality < 0 || m_texture_quality > 1) {
397#define WriteRegBool(NAME, VALUE) WriteReg(NAME, VALUE ? "YES" : "NO")
398#define WriteRegInt(NAME, VALUE) \
400 sprintf(buffer, "%d", VALUE); \
401 WriteReg(NAME, buffer); \
431 return CWinApp::ExitInstance();
BOOL m_3d_video_ram
[AI] TRUE if back-buffering should use 3D video RAM, else system RAM.
BOOL ReadRegBool(LPCSTR p_key, BOOL *p_bool) const
[AI] Reads a BOOL value ("YES"/"NO") from the registry.
BOOL ReadRegInt(LPCSTR p_key, int *p_value) const
[AI] Reads an integer-valued registry entry.
BOOL m_use_joystick
[AI] Enables joystick/gamepad input if supported and selected.
BOOL IsDeviceInBasicRGBMode() const
[AI] Checks if the selected Direct3D device operates in basic RGB color model mode.
BOOL InitInstance() override
[AI] Initializes the configuration application, checks DirectX availability and system memory,...
int m_model_quality
[AI] Detail/complexity level for 3D models (0 = low, 1 = medium, 2 = high).
D3DCOLORMODEL GetHardwareDeviceColorModel() const
[AI] Returns the color model (RGB or other) used by the hardware Direct3D device.
Direct3DDeviceInfo * m_device
[AI] Selected Direct3D device structure, describes device capabilities and mode. Not owned by this cl...
BOOL m_draw_cursor
[AI] TRUE if in-game mouse cursor is drawn.
DWORD GetDeviceRenderBitStatus() const
[AI] Returns bit mask status for the currently active device's rendering status (e....
BOOL m_music
[AI] If TRUE, enables background music.
int m_texture_quality
[AI] Quality (bit-depth, filtering) of loaded textures (0 = low, 1 = high).
BOOL ValidateSettings()
[AI] Ensures all configuration values are legal/compatible, correcting them if needed (e....
BOOL m_wide_view_angle
[AI] If TRUE, increases camera field-of-view for wider display.
BOOL m_flip_surfaces
[AI] If TRUE, enables flipping display buffers during rendering (double-buffering).
BOOL WriteReg(const char *p_key, const char *p_value) const
[AI] Writes a string value into the registry under the LEGO Island key.
BOOL IsPrimaryDriver() const
[AI] Determines if the currently selected driver is the primary driver detected by enumeration.
MxDriver * m_driver
[AI] Currently selected (or default) 3D hardware driver. Managed externally or by enumerator.
int m_joystick_index
[AI] Index of selected joystick (if multiple present).
BOOL ReadRegisterSettings()
[AI] Loads all settings from the registry if present, else selects appropriate default device/setting...
DWORD GetConditionalDeviceRenderBitDepth() const
[AI] Returns bit mask status for the conditional device-rendered bit depth, depending on current devi...
LegoDeviceEnumerate * m_device_enumerator
[AI] Enumerates all supported Direct3D and DirectSound devices, used for configuration panel....
int ExitInstance() override
[AI] Finalizes and cleans up resources before configuration application exit.
void WriteRegisterSettings() const
[AI] Saves current hardware/gameplay option selections to the registry under LEGO Island.
BOOL AdjustDisplayBitDepthBasedOnRenderStatus()
[AI] Adjusts display (screen) bit depth according to the device's rendering capabilities and configur...
BOOL ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const
[AI] Reads a string value from the registry under the LEGO Island key.
BOOL m_3d_sound
[AI] TRUE if 3D positional audio is enabled.
BOOL m_full_screen
[AI] TRUE for fullscreen Direct3D, FALSE for windowed.
int m_display_bit_depth
[AI] User-selected or optimal display (screen) bit depth (8/16/etc.).
BOOL m_run_config_dialog
[AI] Set to TRUE if the configuration dialog should run (otherwise will read reg & launch game).
[AI] Specialized command line parser for the configuration application.
The main dialog window for the LEGO Island configuration program (config.exe).
[AI] Enumerates and manages Direct3D devices and drivers for the LEGO Island engine.
int GetDevice(int p_deviceNum, MxDriver *&p_driver, Direct3DDeviceInfo *&p_device)
[AI] Outputs pointers to the MxDriver and Direct3DDeviceInfo for the given device index.
int FUN_1009d0d0()
[AI] Finds and returns the preferred device index that supports required features.
int ParseDeviceName(const char *p_deviceId)
[AI] Parses a device string identifier and locates the matching device entry.
int FormatDeviceName(char *p_buffer, const MxDriver *p_ddInfo, const Direct3DDeviceInfo *p_d3dInfo) const
[AI] Formats and serializes a device identification string for a given driver/device.
int FUN_1009d210()
[AI] Prunes the enumeration to only include devices/drivers that support the required display mode an...
virtual int DoEnumerate()
[AI] Begins enumeration of DirectDraw drivers, their devices, and available display modes.
const list< MxDriver > & GetDriverList() const
[AI] Returns a const reference to the list of enumerated drivers/devices/modes.
#define WriteRegBool(NAME, VALUE)
#define WriteRegInt(NAME, VALUE)
typedef DWORD(FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper
#define DECOMP_SIZE_ASSERT(T, S)
#define DECOMP_STATIC_ASSERT(V)
BOOL DetectDirectX5()
[AI] Checks whether DirectX 5 or a later version is present and available on the system.
#define NULL
[AI] Null pointer value (C/C++ semantics).
D3DDEVICEDESC m_HWDesc
[AI] Hardware Direct3D device capability description.
D3DDEVICEDESC m_HELDesc
[AI] Software (HEL) emulation device capability description.
char * m_deviceName
[AI] Unlocalized device name/identifier (owned string).
DWORD dwDeviceRenderBitDepth
D3DCOLORMODEL dcmColorModel