Fixed mode code under VMware running Windows 98
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402421
This commit is contained in:
parent
ebb5b5a02b
commit
31871b763d
1 changed files with 8 additions and 6 deletions
|
@ -110,7 +110,7 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode)
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static SDL_bool
|
||||||
WIN_AddDisplay(LPTSTR DeviceName)
|
WIN_AddDisplay(LPTSTR DeviceName)
|
||||||
{
|
{
|
||||||
SDL_VideoDisplay display;
|
SDL_VideoDisplay display;
|
||||||
|
@ -121,12 +121,12 @@ WIN_AddDisplay(LPTSTR DeviceName)
|
||||||
printf("Display: %s\n", WIN_StringToUTF8(DeviceName));
|
printf("Display: %s\n", WIN_StringToUTF8(DeviceName));
|
||||||
#endif
|
#endif
|
||||||
if (!WIN_GetDisplayMode(DeviceName, ENUM_CURRENT_SETTINGS, &mode)) {
|
if (!WIN_GetDisplayMode(DeviceName, ENUM_CURRENT_SETTINGS, &mode)) {
|
||||||
return;
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
|
displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
|
||||||
if (!displaydata) {
|
if (!displaydata) {
|
||||||
return;
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
SDL_memcpy(displaydata->DeviceName, DeviceName,
|
SDL_memcpy(displaydata->DeviceName, DeviceName,
|
||||||
sizeof(displaydata->DeviceName));
|
sizeof(displaydata->DeviceName));
|
||||||
|
@ -136,13 +136,14 @@ WIN_AddDisplay(LPTSTR DeviceName)
|
||||||
display.current_mode = mode;
|
display.current_mode = mode;
|
||||||
display.driverdata = displaydata;
|
display.driverdata = displaydata;
|
||||||
SDL_AddVideoDisplay(&display);
|
SDL_AddVideoDisplay(&display);
|
||||||
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
WIN_InitModes(_THIS)
|
WIN_InitModes(_THIS)
|
||||||
{
|
{
|
||||||
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
||||||
DWORD i, j;
|
DWORD i, j, count;
|
||||||
DISPLAY_DEVICE device;
|
DISPLAY_DEVICE device;
|
||||||
|
|
||||||
device.cb = sizeof(device);
|
device.cb = sizeof(device);
|
||||||
|
@ -159,6 +160,7 @@ WIN_InitModes(_THIS)
|
||||||
#ifdef DEBUG_MODES
|
#ifdef DEBUG_MODES
|
||||||
printf("Device: %s\n", WIN_StringToUTF8(DeviceName));
|
printf("Device: %s\n", WIN_StringToUTF8(DeviceName));
|
||||||
#endif
|
#endif
|
||||||
|
count = 0;
|
||||||
for (j = 0;; ++j) {
|
for (j = 0;; ++j) {
|
||||||
if (!EnumDisplayDevices(DeviceName, j, &device, 0)) {
|
if (!EnumDisplayDevices(DeviceName, j, &device, 0)) {
|
||||||
break;
|
break;
|
||||||
|
@ -166,9 +168,9 @@ WIN_InitModes(_THIS)
|
||||||
if (!(device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)) {
|
if (!(device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
WIN_AddDisplay(device.DeviceName);
|
count += WIN_AddDisplay(device.DeviceName);
|
||||||
}
|
}
|
||||||
if (j == 0) {
|
if (count == 0) {
|
||||||
WIN_AddDisplay(DeviceName);
|
WIN_AddDisplay(DeviceName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue