- Timestamp:
- Mar 18, 2001, 10:44:46 PM (24 years ago)
- Location:
- trunk/src/ddraw
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/OS2D3D.CPP
r5291 r5326 1 /* $Id: OS2D3D.CPP,v 1.1 1 2001-03-09 22:48:46mike Exp $ */1 /* $Id: OS2D3D.CPP,v 1.12 2001-03-18 21:44:42 mike Exp $ */ 2 2 3 3 /* -
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 -
trunk/src/ddraw/OS2DDRAW.H
r4136 r5326 1 /* $Id: OS2DDRAW.H,v 1.1 3 2000-08-31 17:57:10 sandervlExp $ */1 /* $Id: OS2DDRAW.H,v 1.14 2001-03-18 21:44:42 mike Exp $ */ 2 2 3 3 /* … … 26 26 #define THIS VOID* 27 27 28 #define MAX_FOURCC_CODES 3 29 28 #define MAX_FOURCC_CODES 3 29 30 #define ODINDDRAW_SECTION "DirectDraw" 31 32 // This variable is global, mixing windowed and FS DDraw doesn't 33 // make much sense 34 extern BOOL bUseFSDD; 35 30 36 class OS2IDirectDraw 31 37 { … … 91 97 BOOL PrimaryExists; 92 98 BOOL bScale; 99 int oldwidth, oldheight, oldbpp, oldscanlines; 100 BOOL bInFullScreen; 101 93 102 94 103 // Linked list management … … 146 155 }; 147 156 148 #define OFFSET_D3DVTABLE 157 #define OFFSET_D3DVTABLE (LONG)(&((OS2IDirectDraw *)NULL)->lpVtbl3D) 149 158 #define DDraw3D_GetThisPtr(a) (OS2IDirectDraw *)((ULONG)a-OFFSET_D3DVTABLE) 150 159 -
trunk/src/ddraw/OS2PALETTE.CPP
r5291 r5326 1 /* $Id: OS2PALETTE.CPP,v 1.1 3 2001-03-09 22:48:46mike Exp $ */1 /* $Id: OS2PALETTE.CPP,v 1.14 2001-03-18 21:44:42 mike Exp $ */ 2 2 3 3 /* … … 24 24 #include <misc.h> 25 25 #include "os2palset.h" 26 #include "os2fsdd.h" 26 27 #include <winerror.h> 27 28 … … 91 92 HRESULT __stdcall PalQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj) 92 93 { 93 dprintf(("DDRAW: OS2IDirectDrawPalette::PalQueryInterface \n"));94 dprintf(("DDRAW: OS2IDirectDrawPalette::PalQueryInterface")); 94 95 95 96 *ppvObj = NULL; … … 110 111 OS2IDirectDrawPalette *me = (OS2IDirectDrawPalette *)This; 111 112 112 dprintf(("DDRAW: OS2IDirectDrawPalette::PalAddRef %d \n", me->Referenced+1));113 dprintf(("DDRAW: OS2IDirectDrawPalette::PalAddRef %d", me->Referenced+1)); 113 114 114 115 return (++me->Referenced); … … 120 121 OS2IDirectDrawPalette *me = (OS2IDirectDrawPalette *)This; 121 122 122 #ifdef DEBUG 123 dprintf(("DDRAW: OS2IDirectDrawPalette::PalRelease %d\n", me->Referenced-1)); 124 #endif 123 dprintf(("DDRAW: OS2IDirectDrawPalette::PalRelease %d", me->Referenced-1)); 125 124 126 125 if(me->Referenced) … … 144 143 OS2IDirectDrawPalette *me = (OS2IDirectDrawPalette *)This; 145 144 146 #ifdef DEBUG 147 dprintf(("DDRAW: OS2IDirectDrawPalette::GetCaps\n")); 148 #endif 145 dprintf(("DDRAW: OS2IDirectDrawPalette::GetCaps")); 149 146 150 147 if(NULL== lpdwCaps) … … 158 155 return(DD_OK); 159 156 } 157 160 158 //****************************************************************************** 161 159 //****************************************************************************** … … 167 165 OS2IDirectDrawPalette *me = (OS2IDirectDrawPalette *)This; 168 166 169 dprintf(("DDRAW: OS2IDirectDrawPalette::PalGetEntries \n"));170 171 if ((NULL == lpEntries) || (0 != dwFlags) || (dwBase > 65536)172 ||((dwBase + dwNumEntries) > me->dwSize))173 167 dprintf(("DDRAW: OS2IDirectDrawPalette::PalGetEntries")); 168 169 if ((NULL == lpEntries) || (0 != dwFlags) || (dwBase > 0xFFFF) || 170 ((dwBase + dwNumEntries) > me->dwSize)) 171 return(DDERR_INVALIDPARAMS); 174 172 175 173 memcpy( (char *)lpEntries, … … 179 177 return(DD_OK); 180 178 } 179 181 180 //****************************************************************************** 182 181 //****************************************************************************** 183 182 HRESULT __stdcall PalInitialize(THIS, LPDIRECTDRAW, DWORD, LPPALETTEENTRY) 184 183 { 185 dprintf(("DDRAW: OS2IDirectDrawPalette::PalInitialize \n"));184 dprintf(("DDRAW: OS2IDirectDrawPalette::PalInitialize")); 186 185 return(DDERR_ALREADYINITIALIZED); 187 186 } … … 196 195 197 196 dprintf(("DDRAW: OS2IDirectDrawPalette::PalSetEntries\n")); 198 199 if ((NULL== lpNewEntries) || (0 != dwFlags) || (dwBase > 65536) 200 || ((dwBase + dwNumEntries) > me->dwSize)) 197 if ((NULL == lpNewEntries) || (0 != dwFlags) || (dwBase > 0xFFFF) || 198 ((dwBase + dwNumEntries) > me->dwSize)) 201 199 return(DDERR_INVALIDPARAMS); 202 200 … … 222 220 } 223 221 224 if (8==((OS2IDirectDraw*)me->lpDraw)->dCaps.ulDepth)222 if (8==((OS2IDirectDraw*)me->lpDraw)->dCaps.ulDepth) 225 223 { 226 224 if(me->fAttachedToPrimary) … … 238 236 void OS2IDirectDrawPalette::SetPhysPalette() 239 237 { 240 OS2SetPhysPalette(os2pal); 238 // Run appropriate code depening on whether FS DDraw is enabled 239 if (bUseFSDD) 240 SetSVGAPalette(os2pal); 241 else 242 OS2SetPhysPalette(os2pal); 241 243 } 242 244 //****************************************************************************** -
trunk/src/ddraw/OS2PALETTE.H
r2174 r5326 1 /* $Id: OS2PALETTE.H,v 1. 7 1999-12-21 01:28:19 hughExp $ */1 /* $Id: OS2PALETTE.H,v 1.8 2001-03-18 21:44:43 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/OS2PALSET.CPP
r5291 r5326 1 /* $Id: OS2PALSET.CPP,v 1. 9 2001-03-09 22:48:47mike Exp $ */1 /* $Id: OS2PALSET.CPP,v 1.10 2001-03-18 21:44:43 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/OS2PALSET.H
r2174 r5326 1 /* $Id: OS2PALSET.H,v 1. 5 1999-12-21 01:28:19 hughExp $ */1 /* $Id: OS2PALSET.H,v 1.6 2001-03-18 21:44:43 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/OS2SURFACE.CPP
r5291 r5326 1 /* $Id: OS2SURFACE.CPP,v 1.2 8 2001-03-09 22:48:47mike Exp $ */1 /* $Id: OS2SURFACE.CPP,v 1.29 2001-03-18 21:44:43 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/OS2UTIL.H
r2638 r5326 1 /* $Id: OS2UTIL.H,v 1. 5 2000-02-04 19:31:25 hughExp $ */1 /* $Id: OS2UTIL.H,v 1.6 2001-03-18 21:44:43 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/asmutil.asm
r4322 r5326 1 ; $Id: asmutil.asm,v 1. 7 2000-09-25 18:53:45mike Exp $1 ; $Id: asmutil.asm,v 1.8 2001-03-18 21:44:44 mike Exp $ 2 2 3 3 ; -
trunk/src/ddraw/asmutil.h
r2174 r5326 1 /* $Id: asmutil.h,v 1. 5 1999-12-21 01:28:17 hughExp $ */1 /* $Id: asmutil.h,v 1.6 2001-03-18 21:44:44 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/bltFunc.cpp
r2174 r5326 1 /* $Id: bltFunc.cpp,v 1. 2 1999-12-21 01:28:15 hughExp $ */1 /* $Id: bltFunc.cpp,v 1.3 2001-03-18 21:44:44 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/colorconv.cpp
r5291 r5326 1 /* $Id: colorconv.cpp,v 1. 4 2001-03-09 22:48:47mike Exp $ */1 /* $Id: colorconv.cpp,v 1.5 2001-03-18 21:44:44 mike Exp $ */ 2 2 3 3 /* … … 27 27 char *pSrcLine, *pDstLine; 28 28 29 dprintf(("DDRAW: Conv8to16(%d,%d ,%d,%d) \n",dwTop,dwLeft,dwWidth,dwHeight));29 dprintf(("DDRAW: Conv8to16(%d,%d ,%d,%d)",dwTop,dwLeft,dwWidth,dwHeight)); 30 30 31 31 pSrcLine = pFB + (dwTop*dwPitchDB) + dwLeft; 32 32 pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*2); 33 33 34 for (;dwHeight;dwHeight--)35 { 36 for (int x=0;x<dwWidth;x++)34 for ( ; dwHeight; dwHeight--) 35 { 36 for (int x=0; x<dwWidth; x++) 37 37 { 38 38 *(((WORD*)pDstLine)+x) = ((WORD*)pPalette)[pSrcLine[x]]; … … 57 57 char *pSrcLine, *pDstLine; 58 58 59 dprintf(("DDRAW: Conv8to24 \n"));59 dprintf(("DDRAW: Conv8to24")); 60 60 61 61 pSrcLine = pFB + (dwTop*dwPitchDB) + dwLeft; 62 62 pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*3); 63 63 64 for (;dwHeight;dwHeight--)64 for (;dwHeight;dwHeight--) 65 65 { 66 66 char *pIter; 67 67 pIter=pDstLine; 68 for (int x=0;x<dwWidth;x++)68 for (int x=0;x<dwWidth;x++) 69 69 { 70 70 *((DWORD*)pIter) = ((DWORD*)pPalette)[pSrcLine[x]]; … … 88 88 char *pSrcLine, *pDstLine; 89 89 90 dprintf(("DDRAW: Conv8to32 \n"));90 dprintf(("DDRAW: Conv8to32")); 91 91 92 92 pSrcLine = pFB + (dwTop*dwPitchDB) + dwLeft; … … 116 116 ) 117 117 { 118 dprintf(("DDRAW: Conv16to8 Not Implemented \n"));118 dprintf(("DDRAW: Conv16to8 Not Implemented")); 119 119 } 120 120 … … 133 133 char *pDstLine; 134 134 135 dprintf(("DDRAW: Conv16to24 (assuming R565) \n"));135 dprintf(("DDRAW: Conv16to24 (assuming R565)")); 136 136 137 137 pSrcLine = (WORD*)(pFB + (dwTop*dwPitchDB) + (dwLeft*2)); … … 168 168 char *pDstLine; 169 169 170 dprintf(("DDRAW: Conv16to32 (assuming R565) \n"));170 dprintf(("DDRAW: Conv16to32 (assuming R565)")); 171 171 172 172 pSrcLine = (WORD*)(pFB + (dwTop*dwPitchDB) + (dwLeft*2)); … … 198 198 ) 199 199 { 200 dprintf(("DDRAW: Conv24to8 Not Implmented \n"));200 dprintf(("DDRAW: Conv24to8 Not Implmented")); 201 201 } 202 202 void __cdecl Conv24to16( char *pDB, … … 214 214 char *pDstLine; 215 215 216 dprintf(("DDRAW: Conv24to16 (assuming R565) \n"));216 dprintf(("DDRAW: Conv24to16 (assuming R565)")); 217 217 218 218 pSrcLine = pFB + (dwTop*dwPitchDB) + (dwLeft*3); … … 248 248 249 249 250 dprintf(("DDRAW: Conv24to32 Assuming RGBA \n"));250 dprintf(("DDRAW: Conv24to32 Assuming RGBA")); 251 251 252 252 pSrcLine = pFB + (dwTop*dwPitchDB) + (dwLeft*3);; … … 279 279 ) 280 280 { 281 dprintf(("DDRAW: Conv32to8 Not Implemented \n"));281 dprintf(("DDRAW: Conv32to8 Not Implemented")); 282 282 } 283 283 void __cdecl Conv32to16( char *pDB, … … 331 331 332 332 333 dprintf(("DDRAW: Conv32to24 Assuming RGBA \n"));333 dprintf(("DDRAW: Conv32to24 Assuming RGBA")); 334 334 335 335 pSrcLine = pFB + (dwTop*dwPitchDB) + (dwLeft*3); -
trunk/src/ddraw/colorconv.h
r2174 r5326 1 /* $Id: colorconv.h,v 1. 1 1999-12-21 01:28:18 hughExp $ */1 /* $Id: colorconv.h,v 1.2 2001-03-18 21:44:44 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/ddraw.CPP
r5291 r5326 1 /* $Id: ddraw.CPP,v 1.1 6 2001-03-09 22:48:47mike Exp $ */1 /* $Id: ddraw.CPP,v 1.17 2001-03-18 21:44:44 mike Exp $ */ 2 2 3 3 /* 4 4 * DXDraw DLL implementaion 5 5 * 6 * Copyright 1998 Sander va Leeuwen6 * Copyright 1998 Sander van Leeuwen 7 7 * Copyright 1999 Markus Montkowski 8 8 * … … 16 16 #include <memory.h> 17 17 #include <stdio.h> 18 19 18 #define INITGUID 20 19 #define ICOM_CINTERFACE 1 … … 29 28 #include <misc.h> 30 29 31 extern "C" {32 33 30 //****************************************************************************** 34 31 //****************************************************************************** … … 40 37 HRESULT rc; 41 38 42 dprintf(("DDRAW: DirectDrawCreate %X %X %X \n", lpGUID, lplpDD, pUnkOuter));39 dprintf(("DDRAW: DirectDrawCreate %X %X %X", lpGUID, lplpDD, pUnkOuter)); 43 40 44 41 newdraw = new OS2IDirectDraw(lpGUID); … … 55 52 if(rc != DD_OK) 56 53 { 57 58 59 54 *lplpDD = NULL; 55 56 delete newdraw; 60 57 } 61 else *lplpDD = (LPDIRECTDRAW)newdraw; 58 else 59 *lplpDD = (LPDIRECTDRAW)newdraw; 62 60 } 63 61 return(rc); … … 73 71 74 72 //****************************************************************************** 75 //typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID);73 typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID); 76 74 //****************************************************************************** 77 75 HRESULT WIN32API OS2DirectDrawEnumerateA(LPDDENUMCALLBACKA lpCallback, 78 76 LPVOID lpContext) 79 77 { 80 dprintf(("DDRAW: DirectDrawEnumerateA\n Callback for DIVE \n"));78 dprintf(("DDRAW: DirectDrawEnumerateA\n Callback for DIVE")); 81 79 //call it twice for the DirectDraw & Direct3D classes 82 83 "DirectDraw/2 v0. 2", lpContext) == DDENUMRET_CANCEL)84 { 85 dprintf(("DDRAW: Cancel Callback \n"));80 if(lpCallback(NULL, "DIVE DirectDraw for OS/2", 81 "DirectDraw/2 v0.4", lpContext) == DDENUMRET_CANCEL) 82 { 83 dprintf(("DDRAW: Cancel Callback")); 86 84 return(DD_OK); 87 85 } 88 86 //SvL: Crashes dxview.exe; expects a different vtbl when creating 89 87 // an IID_IDirect3D object 90 #if 1 88 #if 1 //!!enabled!! 91 89 else //now for Direct3D 92 90 { … … 95 93 "Direct3D/2 v0.2", lpContext) == DDENUMRET_CANCEL) 96 94 { 97 dprintf(("DDRAW: Cancel Callback \n"));95 dprintf(("DDRAW: Cancel Callback")); 98 96 return(DD_OK); 99 97 } … … 120 118 PENUMDATA pData; 121 119 122 dprintf(("DDRAW: SimpleEnum \n"));120 dprintf(("DDRAW: SimpleEnum")); 123 121 124 122 pData = (PENUMDATA)lpContext; … … 129 127 NULL); 130 128 131 dprintf(("DDRAW: Callback returned \n"));129 dprintf(("DDRAW: Callback returned")); 132 130 return rc; 133 131 } … … 140 138 ENUMDATA data; 141 139 142 dprintf(("DDRAW: DirectDrawEnumerateExA \n"));140 dprintf(("DDRAW: DirectDrawEnumerateExA")); 143 141 144 142 data.lpCallbackEx = lpCallbackEx; … … 153 151 DWORD WIN32API DDHAL32_VidMemFree(DWORD address) 154 152 { 155 dprintf(("DDRAW: DDHAL32_VidMemFree, not supported \n"));153 dprintf(("DDRAW: DDHAL32_VidMemFree, not supported")); 156 154 return(0); 157 155 } … … 160 158 DWORD WIN32API DDHAL32_VidMemAlloc(DWORD size) 161 159 { 162 dprintf(("DDRAW: DDHAL32_VidMemAlloc, not supported \n"));160 dprintf(("DDRAW: DDHAL32_VidMemAlloc, not supported")); 163 161 return(0); 164 162 } … … 187 185 else 188 186 sprintf(buf,"<guid-0x%04x>",LOWORD(riid)); 189 dprintf(("DDRAW:(%p)->(%s,%p),stub! \n",This,buf,ppobj));187 dprintf(("DDRAW:(%p)->(%s,%p),stub!",This,buf,ppobj)); 190 188 return E_NOINTERFACE; 191 189 } … … 214 212 lpGUID = (LPGUID) riid; 215 213 216 dprintf(("DDRAW:DDCF_CreateInstance \n"));214 dprintf(("DDRAW:DDCF_CreateInstance")); 217 215 if( lpGUID && 218 216 ( (*lpGUID == IID_IDirectDraw ) || … … 230 228 { 231 229 ICOM_THIS(IClassFactoryImpl,iface); 232 dprintf(("DDRAW:(%p)->(%d),stub! \n",This,dolock));230 dprintf(("DDRAW:(%p)->(%d),stub!",This,dolock)); 233 231 return S_OK; 234 232 } … … 262 260 WINE_StringFromCLSID(riid,xbuf); 263 261 264 dprintf(("DDRAW:(%p,%p,%p) \n", xbuf, buf, ppv));262 dprintf(("DDRAW:(%p,%p,%p)", xbuf, buf, ppv)); 265 263 if (!memcmp(riid,&IID_IClassFactory,sizeof(IID_IClassFactory))) 266 264 { … … 269 267 return S_OK; 270 268 } 271 dprintf(("DDRAW: (%p,%p,%p): no interface found. \n", xbuf, buf, ppv));269 dprintf(("DDRAW: (%p,%p,%p): no interface found.", xbuf, buf, ppv)); 272 270 return E_NOINTERFACE; 273 271 } … … 283 281 HRESULT WINAPI DllCanUnloadNow(void) 284 282 { 285 dprintf(("DllCanUnloadNow(void) stub \n"));283 dprintf(("DllCanUnloadNow(void) stub")); 286 284 return S_FALSE; 287 285 }//****************************************************************************** 288 } 286 -
trunk/src/ddraw/ddraw.DEF
r5291 r5326 1 ; $Id: ddraw.DEF,v 1. 7 2001-03-09 22:48:47mike Exp $1 ; $Id: ddraw.DEF,v 1.8 2001-03-18 21:44:44 mike Exp $ 2 2 3 3 ; … … 12 12 13 13 EXPORTS 14 ; AcquireDDThreadLock 15 ; D3DParseUnknownCommand 16 ; DDGetAttachedSurfaceLcl 17 DDHAL32_VidMemFree = _DDHAL32_VidMemFree@4@418 DDHAL32_VidMemAlloc = _DDHAL32_VidMemAlloc@4@514 ; AcquireDDThreadLock @1 15 ; D3DParseUnknownCommand @2 16 ; DDGetAttachedSurfaceLcl @3 17 DDHAL32_VidMemFree = _DDHAL32_VidMemFree@4 @4 18 DDHAL32_VidMemAlloc = _DDHAL32_VidMemAlloc@4 @5 19 19 ; DDInternalLock @6 20 ; DDInternalUnlock 21 ; DSoundHelp @820 ; DDInternalUnlock @7 21 ; DSoundHelp @8 22 22 DirectDrawCreate = _OS2DirectDrawCreate@12 @9 23 23 ; DirectDrawCreateClipper @10 … … 29 29 DllCanUnloadNow = _DllCanUnloadNow@0 @16 30 30 DllGetClassObject = _DllGetClassObject@12 @17 31 ; GetAliasedVidMem 32 ; GetDDSurfaceLocal 31 ; GetAliasedVidMem @18 32 ; GetDDSurfaceLocal @19 33 33 ; GetNextMipMap @20 34 34 ; GetOLEThunkData @21 35 ; GetSurfaceFromDC 36 ; HeapVidMemAllocAligned 35 ; GetSurfaceFromDC @22 36 ; HeapVidMemAllocAligned @23 37 37 ; InternalLock @24 38 38 ; InternalUnlock @25 39 ; LateAllocateSurfaceMem 40 ; RegisterSpecialCase 41 ; ReleaseDDThreadLock 42 ; VidMemAlloc @2943 ; VidMemAmountFree 44 ; VidMemFini @3145 ; VidMemFree @3246 ; VidMemInit @3347 ; VidMemLargestFree 48 ; thk1632_ThunkData32 49 ; thk3216_ThunkData32 39 ; LateAllocateSurfaceMem @26 40 ; RegisterSpecialCase @27 41 ; ReleaseDDThreadLock @28 42 ; VidMemAlloc @29 43 ; VidMemAmountFree @30 44 ; VidMemFini @31 45 ; VidMemFree @32 46 ; VidMemInit @33 47 ; VidMemLargestFree @34 48 ; thk1632_ThunkData32 @35 49 ; thk3216_ThunkData32 @36 -
trunk/src/ddraw/divewrap.h
r2174 r5326 1 /* $Id: divewrap.h,v 1. 3 1999-12-21 01:28:18 hughExp $ */1 /* $Id: divewrap.h,v 1.4 2001-03-18 21:44:44 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/fillfunc.cpp
r2638 r5326 1 /* $Id: fillfunc.cpp,v 1. 2 2000-02-04 19:31:23 hughExp $ */1 /* $Id: fillfunc.cpp,v 1.3 2001-03-18 21:44:44 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/fillfunc.h
r2174 r5326 1 /* $Id: fillfunc.h,v 1. 1 1999-12-21 01:28:18 hughExp $ */1 /* $Id: fillfunc.h,v 1.2 2001-03-18 21:44:45 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/initterm.cpp
r5305 r5326 33 33 #include <winconst.h> 34 34 #include <odinlx.h> 35 #include <exitlist.h> 35 36 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 36 37 #include <initdll.h> 38 #include "os2fsdd.h" // For RestorePM() 39 37 40 38 41 extern "C" { … … 44 47 static HMODULE dllHandle = 0; 45 48 49 static void APIENTRY cleanup(ULONG ulReason); 50 46 51 //****************************************************************************** 47 52 //****************************************************************************** 48 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)53 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 49 54 { 50 55 switch (fdwReason) … … 58 63 59 64 case DLL_PROCESS_DETACH: 65 #ifdef __IBMCPP__ 60 66 ctordtorTerm(); 67 #endif 61 68 return TRUE; 62 69 } … … 71 78 /* calling this function. */ 72 79 /****************************************************************************/ 73 ULONG DLLENTRYPOINT_CCONV DLLENTRYPOINT_NAME(ULONG hModule, ULONG ulFlag) 80 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long 81 ulFlag) 74 82 { 75 83 … … 83 91 case 0 : 84 92 { 93 APIRET rc; 94 95 #ifdef __IBMCPP__ 96 ctordtorInit(); 97 #endif 85 98 DosQueryModuleName(hModule, CCHMAXPATH, ddrawPath); 86 99 char *endofpath = strrchr(ddrawPath, '\\'); 87 if(endofpath) *(endofpath+1) = 0; 88 89 ctordtorInit(); 100 if (endofpath) 101 *(endofpath+1) = '\0'; 90 102 91 103 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 92 104 93 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab,105 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab, 94 106 DDRAW_MAJORIMAGE_VERSION, DDRAW_MINORIMAGE_VERSION, 95 107 IMAGE_SUBSYSTEM_WINDOWS_GUI); 96 if(dllHandle == 0) 97 return 0UL; 108 if (dllHandle == 0) 109 return 0UL; 110 111 rc = DosExitList(EXITLIST_NONCOREDLL | EXLST_ADD, cleanup); 112 if (rc) 113 return 0UL; 98 114 99 115 break; … … 101 117 case 1 : 102 118 if(dllHandle) { 103 119 UnregisterLxDll(dllHandle); 104 120 } 105 121 break; … … 115 131 //****************************************************************************** 116 132 //****************************************************************************** 133 134 static void APIENTRY cleanup(ULONG ulReason) 135 { 136 dprintf(("DDRAW processing exitlist")); 137 RestorePM(); 138 dprintf(("DDRAW exitlist done")); 139 140 DosExitList(EXLST_EXIT, cleanup); 141 } 142 //****************************************************************************** 143 //****************************************************************************** -
trunk/src/ddraw/initterm.h
r1456 r5326 1 /* $Id: initterm.h,v 1. 1 1999-10-26 17:52:32 sandervlExp $ */1 /* $Id: initterm.h,v 1.2 2001-03-18 21:44:45 mike Exp $ */ 2 2 /* 3 3 * KERNEL32 DLL entry point header -
trunk/src/ddraw/makefile
r4717 r5326 1 # $Id: makefile,v 1.2 6 2000-12-02 23:38:54 birdExp $1 # $Id: makefile,v 1.27 2001-03-18 21:44:45 mike Exp $ 2 2 3 3 # … … 9 9 10 10 # 11 # Compiler, tools, and in terference rules.11 # Compiler, tools, and inference rules. 12 12 # 13 13 !include ../../makefile.inc … … 27 27 $(OBJDIR)\os2palette.obj \ 28 28 $(OBJDIR)\os2palset.obj \ 29 $(OBJDIR)\os2fsdd.obj \ 29 30 $(OBJDIR)\rectangle.obj \ 30 31 $(OBJDIR)\initterm.obj \ … … 48 49 $(ODIN32_LIB)/user32.lib \ 49 50 mmpm2.lib \ 50 os2386.lib\51 OS2386.LIB \ 51 52 $(RTLLIB_O) 52 53 53 54 54 55 # 55 # Target name - name of the dll without exten tion and path.56 # Target name - name of the dll without extension and path. 56 57 # 57 58 TARGET = ddraw -
trunk/src/ddraw/os2DDWindow.cpp
r2174 r5326 1 /* $Id: os2DDWindow.cpp,v 1. 4 1999-12-21 01:28:16 hughExp $ */1 /* $Id: os2DDWindow.cpp,v 1.5 2001-03-18 21:44:45 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/os2DDWindow.h
r2174 r5326 1 /* $Id: os2DDWindow.h,v 1. 2 1999-12-21 01:28:19 hughExp $ */1 /* $Id: os2DDWindow.h,v 1.3 2001-03-18 21:44:45 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/os2ddrawmodes.h
r2638 r5326 1 /* $Id: os2ddrawmodes.h,v 1. 3 2000-02-04 19:31:25 hughExp $ */1 /* $Id: os2ddrawmodes.h,v 1.4 2001-03-18 21:44:46 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/rectangle.cpp
r2174 r5326 1 /* $Id: rectangle.cpp,v 1. 3 1999-12-21 01:28:17 hughExp $ */1 /* $Id: rectangle.cpp,v 1.4 2001-03-18 21:44:46 mike Exp $ */ 2 2 3 3 /* -
trunk/src/ddraw/rectangle.h
r2174 r5326 1 /* $Id: rectangle.h,v 1. 4 1999-12-21 01:28:19 hughExp $ */1 /* $Id: rectangle.h,v 1.5 2001-03-18 21:44:46 mike Exp $ */ 2 2 3 3 /*
Note:
See TracChangeset
for help on using the changeset viewer.