Changeset 5326 for trunk/src/ddraw/OS2DDRAW.CPP
- Timestamp:
- Mar 18, 2001, 10:44:46 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/OS2DDRAW.CPP
r5291 r5326 1 /* $Id: OS2DDRAW.CPP,v 1.2 5 2001-03-09 22:48:46mike Exp $ */1 /* $Id: OS2DDRAW.CPP,v 1.26 2001-03-18 21:44:42 mike Exp $ */ 2 2 3 3 /* 4 4 * DX Draw base class implementation 5 5 * 6 * Copyright 1998 Sander va Leeuwen6 * Copyright 1998 Sander van Leeuwen 7 7 * Copyright 1999 Markus Montkowski 8 * Copyright 2000 Przemyslaw Dobrowolski 9 * Copyright 2001 Michal Necasek 8 10 * 9 11 * Project Odin Software License can be found in LICENSE.TXT … … 27 29 #include <winuser.h> 28 30 #include <winerror.h> 31 #include <options.h> 29 32 #include "cio2.h" 30 33 #include "os2util.h" 34 #include "os2fsdd.h" 31 35 // include with the videomodes we support 32 36 // better would be to get these modes from the card … … 38 42 #define KEY_DIRECT2 "\\Software\\Win32OS2\\Direct2" 39 43 #define KEY_DIRECT2DRAW "\\Software\\Win32OS2\\Direct2\\Draw" 44 45 46 BOOL bUseFSDD = FALSE; 40 47 41 48 FOURCC SupportedFourCCs[] = {FOURCC_SCRN,FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_RGB4}; … … 216 223 if(rc) // try to get IOPL for the thread 217 224 { 218 dprintf(("DDRAW: No IOPL \n"));225 dprintf(("DDRAW: No IOPL")); 219 226 } 220 227 else 221 228 { 222 dprintf(("DDRAW: IOPL 3!\n")); 223 } 229 dprintf(("DDRAW: IOPL 3!")); 230 } 231 232 233 // Check to see if FS DDraw is enabled in ODIN.INI 234 if (PROFILE_GetOdinIniBool(ODINDDRAW_SECTION, "Fullscreen", FALSE)) { 235 rc = LoadPMIService(); 236 dprintf(("DDRAW: LoadPMIService() rc=0x%08X",rc)); 237 238 if (!rc) { 239 SetUpModeTable(); 240 241 bUseFSDD = TRUE; 242 dprintf(("DDRAW: Fullscreen enabled",rc)); 243 } 244 } 224 245 } 225 246 //****************************************************************************** … … 227 248 OS2IDirectDraw::~OS2IDirectDraw() 228 249 { 229 dprintf(("DDRAW: OS2IDirectDraw::~OS2IDirectDraw()\n")); 230 if(hDive) 250 dprintf(("DDRAW: OS2IDirectDraw::~OS2IDirectDraw()")); 251 252 if (hDive) 231 253 DiveClose(hDive); 232 254 233 // Saf ty call in case the program did set the pal to all black255 // Safety call in case the program did set the pal to all black 234 256 // so if the destructor gets called we might be able change this back 235 257 OS2ResetPhysPalette(); 258 259 // FSDDRAW additions 260 // we need this in Full Screen, but don't do anything in windowed 261 // session. 262 if (bUseFSDD) { 263 RestorePM(); 264 FreeModeTable(); 265 } 236 266 } 237 267 //****************************************************************************** … … 273 303 if(IsEqualGUID(riid, IID_IDirectDraw4)) 274 304 { 275 dprintf(("DDRAW: IID_IDirectDraw4 Interface \n"));305 dprintf(("DDRAW: IID_IDirectDraw4 Interface")); 276 306 me->lpVtbl = &me->Vtbl4; 277 307 } … … 280 310 if(IsEqualGUID(riid, IID_IDirectDraw2)) 281 311 { 282 dprintf(("DDRAW: IID_IDirectDraw2 Interface \n"));312 dprintf(("DDRAW: IID_IDirectDraw2 Interface")); 283 313 me->lpVtbl = (IDirectDraw4Vtbl *) &me->Vtbl2; 284 314 } 285 315 else 286 316 { 287 dprintf(("DDRAW: IID_IDirectDraw Interface \n"));317 dprintf(("DDRAW: IID_IDirectDraw Interface")); 288 318 me->lpVtbl = (IDirectDraw4Vtbl *) &me->Vtbl; 289 319 } … … 302 332 OS2IDirectDraw *me = (OS2IDirectDraw *)This; 303 333 304 dprintf(("DDRAW: OS2IDirectDraw::AddRef %d \n", me->Referenced+1));334 dprintf(("DDRAW: OS2IDirectDraw::AddRef %d", me->Referenced+1)); 305 335 306 336 return ++me->Referenced; … … 313 343 ULONG rc; 314 344 315 dprintf(("DDRAW: OS2IDirectDraw::Release %d \n", me->Referenced-1));316 dprintf(("DDRAW: OS2IDirectDraw::%X \n", me));345 dprintf(("DDRAW: OS2IDirectDraw::Release %d", me->Referenced-1)); 346 dprintf(("DDRAW: OS2IDirectDraw::%X", me)); 317 347 318 348 if(me->Referenced) … … 337 367 HRESULT WIN32API DrawCompact(THIS) 338 368 { 339 dprintf(("DDRAW: Compact \n"));369 dprintf(("DDRAW: Compact")); 340 370 341 371 return(DD_OK); … … 351 381 newclip = new OS2IDirectDrawClipper(me); 352 382 353 dprintf(("DDRAW: CreateClipper \n"));383 dprintf(("DDRAW: CreateClipper")); 354 384 355 385 if(newclip == NULL) … … 405 435 if(DD_OK == rc) 406 436 { 407 dprintf(("DDRAW: CreatePalette with %d colors \n", palsize));437 dprintf(("DDRAW: CreatePalette with %d colors", palsize)); 408 438 409 439 newpal = new OS2IDirectDrawPalette((VOID*)me, palsize, lpColorTable, dwFlags); … … 1024 1054 { 1025 1055 // Caller wants HEL Caps 1026 dprintf(("DDRAW: 1056 dprintf(("DDRAW: CHEL\n")); 1027 1057 1028 1058 //SvL: PowerDVD uses size 316 … … 1485 1515 //****************************************************************************** 1486 1516 //****************************************************************************** 1487 HRESULT WIN32API DrawRestoreDisplayMode(THIS) 1488 { 1489 dprintf(("DDRAW: RestoreDisplayMod\n")); 1517 HRESULT WIN32API DrawRestoreDisplayMode(THIS This) 1518 { 1519 OS2IDirectDraw *me = (OS2IDirectDraw *)This; 1520 1521 dprintf(("DDRAW: RestoreDisplayMode")); 1522 1523 // FSDDRAW additions 1524 ULONG ulModeInd; 1525 /* restore previous screen mode */ 1526 if ((bUseFSDD) && (me->bInFullScreen)) 1527 { 1528 SetSVGAMode(me->oldwidth, me->oldheight, me->oldbpp, 0xFF, &ulModeInd, NULL); 1529 RestorePM(); 1530 /* restore DIVE caps entries */ 1531 me->dCaps.ulScanLineBytes = me->oldscanlines; 1532 me->dCaps.ulHorizontalResolution = me->oldwidth; 1533 me->dCaps.ulVerticalResolution = me->oldheight; 1534 me->dCaps.ulDepth = me->oldbpp; 1535 } 1490 1536 1491 1537 return(DD_OK); … … 1530 1576 if(me->dwCoopMode & DDSCL_FULLSCREEN) 1531 1577 { 1578 // FSDDRAW additions 1579 ULONG ulModeInd; 1580 1532 1581 SetWindowPos(me->hwndClient, HWND_TOP,0,0,dwWidth,dwHeight,0); 1582 SetCursorPos(dwWidth / 2, dwHeight / 2); 1583 1584 if ((bUseFSDD) && (ModeInSVGAModeTable(dwWidth,dwHeight,dwBPP))) 1585 { 1586 KillPM(); 1587 1588 rc = SetSVGAMode(dwWidth, dwHeight, dwBPP, 0xFF, &ulModeInd, NULL); 1589 1590 if (!rc) // When mode switched successfully 1591 { 1592 /* save old screen values */ 1593 me->bInFullScreen=TRUE; 1594 me->oldwidth = me->dCaps.ulHorizontalResolution; 1595 me->oldheight = me->dCaps.ulVerticalResolution; 1596 me->oldscanlines = me->dCaps.ulScanLineBytes; 1597 me->oldbpp = me->dCaps.ulDepth; 1598 1599 /* now 'fix' some DIVE caps entries */ 1600 me->dCaps.ulScanLineBytes = dwWidth * (dwBPP >> 3); /* FIX: use real value */ 1601 me->dCaps.ulHorizontalResolution = dwWidth; 1602 me->dCaps.ulVerticalResolution = dwHeight; 1603 me->dCaps.ulDepth = dwBPP; 1604 } 1605 else 1606 // Display must be return to PM Session 1607 RestorePM(); 1608 } 1533 1609 } 1534 1610 … … 1572 1648 if(me->dwCoopMode & DDSCL_FULLSCREEN) 1573 1649 { 1650 // FSDDRAW additions 1651 ULONG ulModeInd; 1652 1574 1653 SetWindowPos(me->hwndClient, HWND_TOP,0,0,dwWidth,dwHeight,0); 1654 SetCursorPos(dwWidth / 2, dwHeight / 2); 1655 1656 if ((bUseFSDD) && (ModeInSVGAModeTable(dwWidth,dwHeight,dwBPP))) 1657 { 1658 KillPM(); 1659 1660 rc = SetSVGAMode(dwWidth, dwHeight, dwBPP, 0xFF, &ulModeInd, NULL); 1661 1662 if (!rc) // When mode switched successfully 1663 { 1664 /* save old screen values */ 1665 me->bInFullScreen=TRUE; 1666 me->oldwidth = me->dCaps.ulHorizontalResolution; 1667 me->oldheight = me->dCaps.ulVerticalResolution; 1668 me->oldscanlines = me->dCaps.ulScanLineBytes; 1669 me->oldbpp = me->dCaps.ulDepth; 1670 1671 /* now 'fix' some DIVE caps entries */ 1672 me->dCaps.ulScanLineBytes = dwWidth * (dwBPP >> 3); /* FIX: use real value */ 1673 me->dCaps.ulHorizontalResolution = dwWidth; 1674 me->dCaps.ulVerticalResolution = dwHeight; 1675 me->dCaps.ulDepth = dwBPP; 1676 } 1677 else 1678 // Display must be return to PM Session 1679 RestorePM(); 1680 } 1575 1681 } 1576 1682
Note:
See TracChangeset
for help on using the changeset viewer.