Isle
Loading...
Searching...
No Matches
LegoDeviceEnumerate Class Reference

[AI] Enumerates and manages Direct3D devices and drivers for the LEGO Island engine. More...

#include <legodxinfo.h>

Inheritance diagram for LegoDeviceEnumerate:
Collaboration diagram for LegoDeviceEnumerate:

Public Member Functions

int ParseDeviceName (const char *p_deviceId)
 [AI] Parses a device string identifier and locates the matching device entry. More...
 
int ProcessDeviceBytes (int p_deviceNum, GUID &p_guid)
 [AI] Returns the index of the device matching the given GUID and driver number. More...
 
int GetDevice (int p_deviceNum, MxDriver *&p_driver, Direct3DDeviceInfo *&p_device)
 [AI] Outputs pointers to the MxDriver and Direct3DDeviceInfo for the given device index. More...
 
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. More...
 
int BETA_1011cc65 (int p_idx, char *p_buffer)
 [AI] Formats device identification string for the device at a specific global index (Beta10-specific). More...
 
int FUN_1009d0d0 ()
 [AI] Finds and returns the preferred device index that supports required features. More...
 
int FUN_1009d210 ()
 [AI] Prunes the enumeration to only include devices/drivers that support the required display mode and features. More...
 
unsigned char DriverSupportsRequiredDisplayMode (MxDriver &p_driver)
 [AI] Checks if a driver supports a 640x480 display mode in 8bpp or 16bpp (needed by LEGO Island). More...
 
unsigned char FUN_1009d3d0 (Direct3DDeviceInfo &p_device)
 [AI] Checks if a device supports required rendering features (Z-buffer, perspective, HW support, etc). More...
 
- Public Member Functions inherited from MxDeviceEnumerate
 MxDeviceEnumerate ()
 [AI] Constructs an MxDeviceEnumerate object, sets initialized flag to FALSE. More...
 
 ~MxDeviceEnumerate ()
 [AI] Destructor. More...
 
virtual int DoEnumerate ()
 [AI] Begins enumeration of DirectDraw drivers, their devices, and available display modes. More...
 
BOOL EnumDirectDrawCallback (LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName)
 [AI] Callback for enumerating a single DirectDraw driver. More...
 
HRESULT EnumDisplayModesCallback (LPDDSURFACEDESC p_ddsd)
 [AI] Callback for each display mode in a driver. More...
 
HRESULT EnumDevicesCallback (LPGUID p_guid, LPSTR p_deviceDesc, LPSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc)
 [AI] Callback for enumerating 3D devices on a driver. More...
 
const char * EnumerateErrorToString (HRESULT p_error)
 [AI] Converts a DirectDraw/Direct3D HRESULT enumeration error to a human-readable string. More...
 
const list< MxDriver > & GetDriverList () const
 [AI] Returns a const reference to the list of enumerated drivers/devices/modes. More...
 
unsigned char IsInitialized () const
 [AI] Checks if the enumeration has already been performed. More...
 

Static Public Member Functions

static int SupportsMMX ()
 [AI] Checks if the CPU supports MMX instructions. More...
 
static int SupportsCPUID ()
 [AI] Checks if the CPU supports CPUID instruction. More...
 
- Static Public Member Functions inherited from MxDeviceEnumerate
static void BuildErrorString (const char *,...)
 [AI] Utility for formatting and outputting error/debug strings. More...
 
static BOOL CALLBACK DirectDrawEnumerateCallback (LPGUID p_guid, LPSTR p_driverDesc, LPSTR p_driverName, LPVOID p_context)
 [AI] Static thunk callback suitable for passing to DirectDrawEnumerate. More...
 
static HRESULT CALLBACK DisplayModesEnumerateCallback (LPDDSURFACEDESC p_ddsd, LPVOID p_context)
 [AI] Static thunk callback for enumerating display modes during driver enumeration. More...
 
static HRESULT CALLBACK DevicesEnumerateCallback (LPGUID p_guid, LPSTR p_deviceDesc, LPSTR p_deviceName, LPD3DDEVICEDESC p_HWDesc, LPD3DDEVICEDESC p_HELDesc, LPVOID p_context)
 [AI] Static thunk callback for enumerating 3D devices within a driver. More...
 

Additional Inherited Members

- Protected Attributes inherited from MxDeviceEnumerate
list< MxDriverm_list
 [AI] List of all discovered DirectDraw drivers and their device/mode info. More...
 
unsigned char m_initialized
 [AI] Set TRUE after successful enumeration to prevent redundant operations. More...
 

Detailed Description

[AI] Enumerates and manages Direct3D devices and drivers for the LEGO Island engine.

LegoDeviceEnumerate inherits from MxDeviceEnumerate, providing extended functionality to identify, process, and verify Direct3D devices and drivers required for engine rendering. This includes hardware capability checks (such as MMX and CPUID support), device string parsing/formatting, and display mode support checks.

[AI] This class holds a list of available Direct3D drivers (MxDriver) with their associated device information. It provides functions to search, filter, and format driver or device descriptors, and supports pruning the list according to hardware or mode requirements needed by the LEGO Island engine renderer.

Definition at line 24 of file legodxinfo.h.

Member Function Documentation

◆ BETA_1011cc65()

int LegoDeviceEnumerate::BETA_1011cc65 ( int  p_idx,
char *  p_buffer 
)

[AI] Formats device identification string for the device at a specific global index (Beta10-specific).

Parameters
p_idxIndex of the device in the global list. [AI]
p_bufferOutput buffer for the formatted string. [AI]
Returns
0 on success, -1 if index is invalid. [AI]

Definition at line 131 of file legodxinfo.cpp.

◆ DriverSupportsRequiredDisplayMode()

unsigned char LegoDeviceEnumerate::DriverSupportsRequiredDisplayMode ( MxDriver p_driver)

[AI] Checks if a driver supports a 640x480 display mode in 8bpp or 16bpp (needed by LEGO Island).

Parameters
p_driverThe driver to check. [AI]
Returns
TRUE if supported, FALSE otherwise. [AI]

Definition at line 335 of file legodxinfo.cpp.

◆ FormatDeviceName()

int LegoDeviceEnumerate::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.

Parameters
p_bufferOutput buffer for the formatted device string. [AI]
p_ddInfoPointer to the relevant MxDriver (DirectDraw info). [AI]
p_d3dInfoPointer to the relevant Direct3DDeviceInfo. [AI]
Returns
0 on success, -1 if the driver not found. [AI]

Definition at line 111 of file legodxinfo.cpp.

◆ FUN_1009d0d0()

int LegoDeviceEnumerate::FUN_1009d0d0 ( )

[AI] Finds and returns the preferred device index that supports required features.

[AI]

Returns
Device index for first device meeting requirements, or -1 if none is found. [AI]

Definition at line 161 of file legodxinfo.cpp.

◆ FUN_1009d210()

int LegoDeviceEnumerate::FUN_1009d210 ( )

[AI] Prunes the enumeration to only include devices/drivers that support the required display mode and features.

Returns
0 on success, -1 if no valid devices remain. [AI]

Definition at line 294 of file legodxinfo.cpp.

◆ FUN_1009d3d0()

unsigned char LegoDeviceEnumerate::FUN_1009d3d0 ( Direct3DDeviceInfo p_device)

[AI] Checks if a device supports required rendering features (Z-buffer, perspective, HW support, etc).

Parameters
p_deviceThe device to validate. [AI]
Returns
TRUE if device is adequate, FALSE otherwise. [AI]

Definition at line 352 of file legodxinfo.cpp.

◆ GetDevice()

int LegoDeviceEnumerate::GetDevice ( int  p_deviceNum,
MxDriver *&  p_driver,
Direct3DDeviceInfo *&  p_device 
)

[AI] Outputs pointers to the MxDriver and Direct3DDeviceInfo for the given device index.

Parameters
p_deviceNumGlobal device list index. [AI]
p_driverOutput: Pointer to the matched MxDriver. [AI]
p_deviceOutput: Pointer to the matched Direct3DDeviceInfo. [AI]
Returns
0 on success, -1 if not found. [AI]

Definition at line 85 of file legodxinfo.cpp.

◆ ParseDeviceName()

int LegoDeviceEnumerate::ParseDeviceName ( const char *  p_deviceId)

[AI] Parses a device string identifier and locates the matching device entry.

Parameters
p_deviceIdDevice identifier string in the format: "<driverIndex> 0x<X> 0x<Y> 0x<Z> 0x<W>" [AI]
Returns
Device index if found, -1 on failure. [AI]

Definition at line 11 of file legodxinfo.cpp.

◆ ProcessDeviceBytes()

int LegoDeviceEnumerate::ProcessDeviceBytes ( int  p_deviceNum,
GUID &  p_guid 
)

[AI] Returns the index of the device matching the given GUID and driver number.

Parameters
p_deviceNumDriver index; may be -1 to search all drivers. [AI]
p_guidGUID of the device. [AI]
Returns
Index of device within the device enumeration, or -1 if not found. [AI]

Definition at line 44 of file legodxinfo.cpp.

◆ SupportsCPUID()

int LegoDeviceEnumerate::SupportsCPUID ( )
static

[AI] Checks if the CPU supports CPUID instruction.

[AI] Uses platform-specific assembly instructions to detect CPUID availability.

Returns
1 if CPUID is supported, 0 otherwise. [AI]

Definition at line 249 of file legodxinfo.cpp.

◆ SupportsMMX()

int LegoDeviceEnumerate::SupportsMMX ( )
static

[AI] Checks if the CPU supports MMX instructions.

[AI] Uses platform-specific assembly instructions to detect MMX feature availability.

Returns
1 if MMX is supported, 0 otherwise. [AI]

Definition at line 202 of file legodxinfo.cpp.


The documentation for this class was generated from the following files: