Changeset 5326 for trunk/src


Ignore:
Timestamp:
Mar 18, 2001, 10:44:46 PM (24 years ago)
Author:
mike
Message:

Merged DDRAW and DDRAW\NEW

Location:
trunk/src/ddraw
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ddraw/OS2D3D.CPP

    r5291 r5326  
    1 /* $Id: OS2D3D.CPP,v 1.11 2001-03-09 22:48:46 mike Exp $ */
     1/* $Id: OS2D3D.CPP,v 1.12 2001-03-18 21:44:42 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/OS2DDRAW.CPP

    r5291 r5326  
    1 /* $Id: OS2DDRAW.CPP,v 1.25 2001-03-09 22:48:46 mike Exp $ */
     1/* $Id: OS2DDRAW.CPP,v 1.26 2001-03-18 21:44:42 mike Exp $ */
    22
    33/*
    44 * DX Draw base class implementation
    55 *
    6  * Copyright 1998 Sander va Leeuwen
     6 * Copyright 1998 Sander van Leeuwen
    77 * Copyright 1999 Markus Montkowski
     8 * Copyright 2000 Przemyslaw Dobrowolski
     9 * Copyright 2001 Michal Necasek
    810 *
    911 * Project Odin Software License can be found in LICENSE.TXT
     
    2729#include <winuser.h>
    2830#include <winerror.h>
     31#include <options.h>
    2932#include "cio2.h"
    3033#include "os2util.h"
     34#include "os2fsdd.h"
    3135// include with the videomodes we support
    3236// better would be to get these modes from the card
     
    3842#define KEY_DIRECT2 "\\Software\\Win32OS2\\Direct2"
    3943#define KEY_DIRECT2DRAW "\\Software\\Win32OS2\\Direct2\\Draw"
     44
     45
     46BOOL bUseFSDD = FALSE;
    4047
    4148FOURCC  SupportedFourCCs[] = {FOURCC_SCRN,FOURCC_LUT8,FOURCC_R565,FOURCC_RGB3,FOURCC_RGB4};
     
    216223  if(rc)  // try to get IOPL for the thread
    217224  {
    218     dprintf(("DDRAW: No IOPL\n"));
     225    dprintf(("DDRAW: No IOPL"));
    219226  }
    220227  else
    221228  {
    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        }       
    224245}
    225246//******************************************************************************
     
    227248OS2IDirectDraw::~OS2IDirectDraw()
    228249{
    229   dprintf(("DDRAW: OS2IDirectDraw::~OS2IDirectDraw()\n"));
    230   if(hDive)
     250  dprintf(("DDRAW: OS2IDirectDraw::~OS2IDirectDraw()"));
     251
     252  if (hDive)
    231253    DiveClose(hDive);
    232254
    233   // Safty call in case the program did set the pal to all black
     255  // Safety call in case the program did set the pal to all black
    234256  // so if the destructor gets called we might be able change this back
    235257  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  }
    236266}
    237267//******************************************************************************
     
    273303    if(IsEqualGUID(riid, IID_IDirectDraw4))
    274304    {
    275       dprintf(("DDRAW: IID_IDirectDraw4 Interface\n"));
     305      dprintf(("DDRAW: IID_IDirectDraw4 Interface"));
    276306      me->lpVtbl = &me->Vtbl4;
    277307    }
     
    280310      if(IsEqualGUID(riid, IID_IDirectDraw2))
    281311      {
    282         dprintf(("DDRAW: IID_IDirectDraw2 Interface\n"));
     312        dprintf(("DDRAW: IID_IDirectDraw2 Interface"));
    283313        me->lpVtbl = (IDirectDraw4Vtbl *) &me->Vtbl2;
    284314      }
    285315      else
    286316      {
    287         dprintf(("DDRAW: IID_IDirectDraw Interface\n"));
     317        dprintf(("DDRAW: IID_IDirectDraw Interface"));
    288318        me->lpVtbl = (IDirectDraw4Vtbl *) &me->Vtbl;
    289319      }
     
    302332 OS2IDirectDraw *me = (OS2IDirectDraw *)This;
    303333
    304   dprintf(("DDRAW: OS2IDirectDraw::AddRef %d\n", me->Referenced+1));
     334  dprintf(("DDRAW: OS2IDirectDraw::AddRef %d", me->Referenced+1));
    305335
    306336  return ++me->Referenced;
     
    313343 ULONG rc;
    314344
    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));
    317347
    318348  if(me->Referenced)
     
    337367HRESULT WIN32API DrawCompact(THIS)
    338368{
    339   dprintf(("DDRAW: Compact\n"));
     369  dprintf(("DDRAW: Compact"));
    340370
    341371  return(DD_OK);
     
    351381  newclip = new OS2IDirectDrawClipper(me);
    352382
    353   dprintf(("DDRAW: CreateClipper\n"));
     383  dprintf(("DDRAW: CreateClipper"));
    354384
    355385  if(newclip == NULL)
     
    405435  if(DD_OK == rc)
    406436  {
    407     dprintf(("DDRAW: CreatePalette with %d colors\n", palsize));
     437    dprintf(("DDRAW: CreatePalette with %d colors", palsize));
    408438
    409439    newpal = new OS2IDirectDrawPalette((VOID*)me, palsize, lpColorTable, dwFlags);
     
    10241054  {
    10251055    // Caller wants HEL Caps
    1026     dprintf(("DDRAW:  HEL\n"));
     1056    dprintf(("DDRAW: CHEL\n"));
    10271057
    10281058    //SvL: PowerDVD uses size 316
     
    14851515//******************************************************************************
    14861516//******************************************************************************
    1487 HRESULT WIN32API DrawRestoreDisplayMode(THIS)
    1488 {
    1489   dprintf(("DDRAW: RestoreDisplayMod\n"));
     1517HRESULT 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  }
    14901536
    14911537  return(DD_OK);
     
    15301576  if(me->dwCoopMode & DDSCL_FULLSCREEN)
    15311577  {
     1578    // FSDDRAW additions
     1579    ULONG  ulModeInd;
     1580
    15321581    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    }
    15331609  }
    15341610
     
    15721648  if(me->dwCoopMode & DDSCL_FULLSCREEN)
    15731649  {
     1650    // FSDDRAW additions
     1651    ULONG  ulModeInd;
     1652
    15741653    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    }
    15751681  }
    15761682
  • trunk/src/ddraw/OS2DDRAW.H

    r4136 r5326  
    1 /* $Id: OS2DDRAW.H,v 1.13 2000-08-31 17:57:10 sandervl Exp $ */
     1/* $Id: OS2DDRAW.H,v 1.14 2001-03-18 21:44:42 mike Exp $ */
    22
    33/*
     
    2626#define THIS VOID*
    2727
    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     
     34extern BOOL bUseFSDD;
     35                                       
    3036class OS2IDirectDraw
    3137{
     
    9197    BOOL    PrimaryExists;
    9298    BOOL    bScale;
     99    int     oldwidth, oldheight, oldbpp, oldscanlines;
     100    BOOL    bInFullScreen;
     101
    93102
    94103   // Linked list management
     
    146155};
    147156
    148 #define OFFSET_D3DVTABLE        (LONG)(&((OS2IDirectDraw *)NULL)->lpVtbl3D)
     157#define OFFSET_D3DVTABLE        (LONG)(&((OS2IDirectDraw *)NULL)->lpVtbl3D)
    149158#define DDraw3D_GetThisPtr(a)   (OS2IDirectDraw *)((ULONG)a-OFFSET_D3DVTABLE)
    150159
  • trunk/src/ddraw/OS2PALETTE.CPP

    r5291 r5326  
    1 /* $Id: OS2PALETTE.CPP,v 1.13 2001-03-09 22:48:46 mike Exp $ */
     1/* $Id: OS2PALETTE.CPP,v 1.14 2001-03-18 21:44:42 mike Exp $ */
    22
    33/*
     
    2424#include <misc.h>
    2525#include "os2palset.h"
     26#include "os2fsdd.h"
    2627#include <winerror.h>
    2728
     
    9192HRESULT __stdcall PalQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj)
    9293{
    93   dprintf(("DDRAW: OS2IDirectDrawPalette::PalQueryInterface\n"));
     94  dprintf(("DDRAW: OS2IDirectDrawPalette::PalQueryInterface"));
    9495
    9596  *ppvObj = NULL;
     
    110111  OS2IDirectDrawPalette *me = (OS2IDirectDrawPalette *)This;
    111112
    112   dprintf(("DDRAW: OS2IDirectDrawPalette::PalAddRef %d\n", me->Referenced+1));
     113  dprintf(("DDRAW: OS2IDirectDrawPalette::PalAddRef %d", me->Referenced+1));
    113114
    114115  return (++me->Referenced);
     
    120121  OS2IDirectDrawPalette *me = (OS2IDirectDrawPalette *)This;
    121122
    122   #ifdef DEBUG
    123     dprintf(("DDRAW: OS2IDirectDrawPalette::PalRelease %d\n", me->Referenced-1));
    124   #endif
     123  dprintf(("DDRAW: OS2IDirectDrawPalette::PalRelease %d", me->Referenced-1));
    125124
    126125  if(me->Referenced)
     
    144143  OS2IDirectDrawPalette *me = (OS2IDirectDrawPalette *)This;
    145144
    146   #ifdef DEBUG
    147     dprintf(("DDRAW: OS2IDirectDrawPalette::GetCaps\n"));
    148   #endif
     145  dprintf(("DDRAW: OS2IDirectDrawPalette::GetCaps"));
    149146
    150147  if(NULL== lpdwCaps)
     
    158155  return(DD_OK);
    159156}
     157
    160158//******************************************************************************
    161159//******************************************************************************
     
    167165 OS2IDirectDrawPalette *me = (OS2IDirectDrawPalette *)This;
    168166
    169   dprintf(("DDRAW: OS2IDirectDrawPalette::PalGetEntries\n"));
    170 
    171   if ((NULL == lpEntries) || (0 != dwFlags) || (dwBase > 65536)
    172       || ((dwBase + dwNumEntries) > me->dwSize))
    173     return(DDERR_INVALIDPARAMS);
     167  dprintf(("DDRAW: OS2IDirectDrawPalette::PalGetEntries"));
     168
     169  if ((NULL == lpEntries) || (0 != dwFlags) || (dwBase > 0xFFFF) ||
     170        ((dwBase + dwNumEntries) > me->dwSize))
     171        return(DDERR_INVALIDPARAMS);
    174172
    175173  memcpy( (char *)lpEntries,
     
    179177  return(DD_OK);
    180178}
     179
    181180//******************************************************************************
    182181//******************************************************************************
    183182HRESULT __stdcall PalInitialize(THIS, LPDIRECTDRAW, DWORD, LPPALETTEENTRY)
    184183{
    185   dprintf(("DDRAW: OS2IDirectDrawPalette::PalInitialize\n"));
     184  dprintf(("DDRAW: OS2IDirectDrawPalette::PalInitialize"));
    186185  return(DDERR_ALREADYINITIALIZED);
    187186}
     
    196195
    197196  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))
    201199    return(DDERR_INVALIDPARAMS);
    202200
     
    222220  }
    223221
    224   if(8==((OS2IDirectDraw*)me->lpDraw)->dCaps.ulDepth)
     222  if (8==((OS2IDirectDraw*)me->lpDraw)->dCaps.ulDepth)
    225223  {
    226224    if(me->fAttachedToPrimary)
     
    238236void OS2IDirectDrawPalette::SetPhysPalette()
    239237{
    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);
    241243}
    242244//******************************************************************************
  • trunk/src/ddraw/OS2PALETTE.H

    r2174 r5326  
    1 /* $Id: OS2PALETTE.H,v 1.7 1999-12-21 01:28:19 hugh Exp $ */
     1/* $Id: OS2PALETTE.H,v 1.8 2001-03-18 21:44:43 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/OS2PALSET.CPP

    r5291 r5326  
    1 /* $Id: OS2PALSET.CPP,v 1.9 2001-03-09 22:48:47 mike Exp $ */
     1/* $Id: OS2PALSET.CPP,v 1.10 2001-03-18 21:44:43 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/OS2PALSET.H

    r2174 r5326  
    1 /* $Id: OS2PALSET.H,v 1.5 1999-12-21 01:28:19 hugh Exp $ */
     1/* $Id: OS2PALSET.H,v 1.6 2001-03-18 21:44:43 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/OS2SURFACE.CPP

    r5291 r5326  
    1 /* $Id: OS2SURFACE.CPP,v 1.28 2001-03-09 22:48:47 mike Exp $ */
     1/* $Id: OS2SURFACE.CPP,v 1.29 2001-03-18 21:44:43 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/OS2UTIL.H

    r2638 r5326  
    1 /* $Id: OS2UTIL.H,v 1.5 2000-02-04 19:31:25 hugh Exp $ */
     1/* $Id: OS2UTIL.H,v 1.6 2001-03-18 21:44:43 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/asmutil.asm

    r4322 r5326  
    1 ; $Id: asmutil.asm,v 1.7 2000-09-25 18:53:45 mike Exp $
     1; $Id: asmutil.asm,v 1.8 2001-03-18 21:44:44 mike Exp $
    22
    33;
  • trunk/src/ddraw/asmutil.h

    r2174 r5326  
    1 /* $Id: asmutil.h,v 1.5 1999-12-21 01:28:17 hugh Exp $ */
     1/* $Id: asmutil.h,v 1.6 2001-03-18 21:44:44 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/bltFunc.cpp

    r2174 r5326  
    1 /* $Id: bltFunc.cpp,v 1.2 1999-12-21 01:28:15 hugh Exp $ */
     1/* $Id: bltFunc.cpp,v 1.3 2001-03-18 21:44:44 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/colorconv.cpp

    r5291 r5326  
    1 /* $Id: colorconv.cpp,v 1.4 2001-03-09 22:48:47 mike Exp $ */
     1/* $Id: colorconv.cpp,v 1.5 2001-03-18 21:44:44 mike Exp $ */
    22
    33/*
     
    2727  char *pSrcLine, *pDstLine;
    2828
    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));
    3030
    3131  pSrcLine = pFB + (dwTop*dwPitchDB) + dwLeft;
    3232  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*2);
    3333
    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++)
    3737    {
    3838      *(((WORD*)pDstLine)+x) = ((WORD*)pPalette)[pSrcLine[x]];
     
    5757  char *pSrcLine, *pDstLine;
    5858
    59   dprintf(("DDRAW: Conv8to24\n"));
     59  dprintf(("DDRAW: Conv8to24"));
    6060
    6161  pSrcLine = pFB + (dwTop*dwPitchDB) + dwLeft;
    6262  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*3);
    6363
    64   for(;dwHeight;dwHeight--)
     64  for (;dwHeight;dwHeight--)
    6565  {
    6666    char *pIter;
    6767    pIter=pDstLine;
    68     for(int x=0;x<dwWidth;x++)
     68    for (int x=0;x<dwWidth;x++)
    6969    {
    7070      *((DWORD*)pIter) = ((DWORD*)pPalette)[pSrcLine[x]];
     
    8888  char *pSrcLine, *pDstLine;
    8989
    90   dprintf(("DDRAW: Conv8to32\n"));
     90  dprintf(("DDRAW: Conv8to32"));
    9191
    9292  pSrcLine = pFB + (dwTop*dwPitchDB) + dwLeft;
     
    116116                        )
    117117{
    118   dprintf(("DDRAW: Conv16to8 Not Implemented\n"));
     118  dprintf(("DDRAW: Conv16to8 Not Implemented"));
    119119}
    120120
     
    133133  char *pDstLine;
    134134
    135   dprintf(("DDRAW: Conv16to24 (assuming R565) \n"));
     135  dprintf(("DDRAW: Conv16to24 (assuming R565)"));
    136136
    137137  pSrcLine = (WORD*)(pFB + (dwTop*dwPitchDB) + (dwLeft*2));
     
    168168  char *pDstLine;
    169169
    170   dprintf(("DDRAW: Conv16to32 (assuming R565) \n"));
     170  dprintf(("DDRAW: Conv16to32 (assuming R565)"));
    171171
    172172  pSrcLine = (WORD*)(pFB + (dwTop*dwPitchDB) + (dwLeft*2));
     
    198198                        )
    199199{
    200   dprintf(("DDRAW: Conv24to8 Not Implmented\n"));
     200  dprintf(("DDRAW: Conv24to8 Not Implmented"));
    201201}
    202202 void __cdecl Conv24to16( char *pDB,
     
    214214  char *pDstLine;
    215215
    216   dprintf(("DDRAW: Conv24to16 (assuming R565) \n"));
     216  dprintf(("DDRAW: Conv24to16 (assuming R565)"));
    217217
    218218  pSrcLine = pFB + (dwTop*dwPitchDB) + (dwLeft*3);
     
    248248
    249249
    250   dprintf(("DDRAW: Conv24to32 Assuming RGBA \n"));
     250  dprintf(("DDRAW: Conv24to32 Assuming RGBA"));
    251251
    252252  pSrcLine = pFB + (dwTop*dwPitchDB) + (dwLeft*3);;
     
    279279                        )
    280280{
    281   dprintf(("DDRAW: Conv32to8 Not Implemented\n"));
     281  dprintf(("DDRAW: Conv32to8 Not Implemented"));
    282282}
    283283 void __cdecl Conv32to16( char *pDB,
     
    331331
    332332
    333   dprintf(("DDRAW: Conv32to24 Assuming RGBA \n"));
     333  dprintf(("DDRAW: Conv32to24 Assuming RGBA"));
    334334
    335335  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 hugh Exp $ */
     1/* $Id: colorconv.h,v 1.2 2001-03-18 21:44:44 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/ddraw.CPP

    r5291 r5326  
    1 /* $Id: ddraw.CPP,v 1.16 2001-03-09 22:48:47 mike Exp $ */
     1/* $Id: ddraw.CPP,v 1.17 2001-03-18 21:44:44 mike Exp $ */
    22
    33/*
    44 * DXDraw DLL implementaion
    55 *
    6  * Copyright 1998 Sander va Leeuwen
     6 * Copyright 1998 Sander van Leeuwen
    77 * Copyright 1999 Markus Montkowski
    88 *
     
    1616#include <memory.h>
    1717#include <stdio.h>
    18 
    1918#define INITGUID
    2019#define ICOM_CINTERFACE 1
     
    2928#include <misc.h>
    3029
    31 extern "C" {
    32 
    3330//******************************************************************************
    3431//******************************************************************************
     
    4037  HRESULT         rc;
    4138
    42   dprintf(("DDRAW: DirectDrawCreate %X %X %X\n", lpGUID, lplpDD, pUnkOuter));
     39  dprintf(("DDRAW: DirectDrawCreate %X %X %X", lpGUID, lplpDD, pUnkOuter));
    4340
    4441  newdraw = new OS2IDirectDraw(lpGUID);
     
    5552    if(rc != DD_OK)
    5653    {
    57          *lplpDD = NULL;
    58 
    59          delete newdraw;
     54      *lplpDD = NULL;
     55
     56      delete newdraw;
    6057    }
    61     else *lplpDD = (LPDIRECTDRAW)newdraw;
     58    else
     59      *lplpDD = (LPDIRECTDRAW)newdraw;
    6260  }
    6361  return(rc);
     
    7371
    7472//******************************************************************************
    75 //typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID);
     73typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID);
    7674//******************************************************************************
    7775HRESULT WIN32API OS2DirectDrawEnumerateA(LPDDENUMCALLBACKA lpCallback,
    7876               LPVOID lpContext)
    7977{
    80   dprintf(("DDRAW: DirectDrawEnumerateA\n Callback for DIVE\n"));
     78  dprintf(("DDRAW: DirectDrawEnumerateA\n Callback for DIVE"));
    8179  //call it twice for the DirectDraw & Direct3D classes
    82   if(lpCallback(NULL, "DIVE DirectDraw for OS/2",
    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"));
    8684    return(DD_OK);
    8785  }
    8886//SvL: Crashes dxview.exe; expects a different vtbl when creating
    8987//     an IID_IDirect3D object
    90 #if 1
     88#if 1 //!!enabled!!
    9189  else //now for Direct3D
    9290  {
     
    9593      "Direct3D/2 v0.2", lpContext) == DDENUMRET_CANCEL)
    9694    {
    97       dprintf(("DDRAW: Cancel Callback\n"));
     95      dprintf(("DDRAW: Cancel Callback"));
    9896      return(DD_OK);
    9997    }
     
    120118  PENUMDATA pData;
    121119
    122   dprintf(("DDRAW: SimpleEnum\n"));
     120  dprintf(("DDRAW: SimpleEnum"));
    123121
    124122  pData = (PENUMDATA)lpContext;
     
    129127                            NULL);
    130128
    131   dprintf(("DDRAW: Callback returned\n"));
     129  dprintf(("DDRAW: Callback returned"));
    132130  return rc;
    133131}
     
    140138  ENUMDATA data;
    141139
    142   dprintf(("DDRAW: DirectDrawEnumerateExA\n"));
     140  dprintf(("DDRAW: DirectDrawEnumerateExA"));
    143141
    144142  data.lpCallbackEx = lpCallbackEx;
     
    153151DWORD WIN32API DDHAL32_VidMemFree(DWORD address)
    154152{
    155   dprintf(("DDRAW: DDHAL32_VidMemFree, not supported\n"));
     153  dprintf(("DDRAW: DDHAL32_VidMemFree, not supported"));
    156154  return(0);
    157155}
     
    160158DWORD WIN32API DDHAL32_VidMemAlloc(DWORD size)
    161159{
    162   dprintf(("DDRAW: DDHAL32_VidMemAlloc, not supported\n"));
     160  dprintf(("DDRAW: DDHAL32_VidMemAlloc, not supported"));
    163161  return(0);
    164162}
     
    187185  else
    188186    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));
    190188  return E_NOINTERFACE;
    191189}
     
    214212  lpGUID = (LPGUID) riid;
    215213
    216   dprintf(("DDRAW:DDCF_CreateInstance\n"));
     214  dprintf(("DDRAW:DDCF_CreateInstance"));
    217215  if( lpGUID &&
    218216      ( (*lpGUID == IID_IDirectDraw ) ||
     
    230228{
    231229  ICOM_THIS(IClassFactoryImpl,iface);
    232   dprintf(("DDRAW:(%p)->(%d),stub!\n",This,dolock));
     230  dprintf(("DDRAW:(%p)->(%d),stub!",This,dolock));
    233231  return S_OK;
    234232}
     
    262260  WINE_StringFromCLSID(riid,xbuf);
    263261
    264   dprintf(("DDRAW:(%p,%p,%p)\n", xbuf, buf, ppv));
     262  dprintf(("DDRAW:(%p,%p,%p)", xbuf, buf, ppv));
    265263  if (!memcmp(riid,&IID_IClassFactory,sizeof(IID_IClassFactory)))
    266264  {
     
    269267    return S_OK;
    270268  }
    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));
    272270  return E_NOINTERFACE;
    273271}
     
    283281HRESULT WINAPI DllCanUnloadNow(void)
    284282{
    285   dprintf(("DllCanUnloadNow(void) stub\n"));
     283  dprintf(("DllCanUnloadNow(void) stub"));
    286284  return S_FALSE;
    287285}//******************************************************************************
    288 }
     286
  • trunk/src/ddraw/ddraw.DEF

    r5291 r5326  
    1 ; $Id: ddraw.DEF,v 1.7 2001-03-09 22:48:47 mike Exp $
     1; $Id: ddraw.DEF,v 1.8 2001-03-18 21:44:44 mike Exp $
    22
    33;
     
    1212
    1313EXPORTS
    14 ; AcquireDDThreadLock           @1
    15 ; D3DParseUnknownCommand          @2
    16 ; DDGetAttachedSurfaceLcl         @3
    17  DDHAL32_VidMemFree = _DDHAL32_VidMemFree@4                     @4
    18  DDHAL32_VidMemAlloc    = _DDHAL32_VidMemAlloc@4                @5
     14; AcquireDDThreadLock       @1
     15; D3DParseUnknownCommand    @2
     16; DDGetAttachedSurfaceLcl   @3
     17 DDHAL32_VidMemFree  = _DDHAL32_VidMemFree@4                    @4
     18 DDHAL32_VidMemAlloc = _DDHAL32_VidMemAlloc@4                   @5
    1919; DDInternalLock            @6
    20 ; DDInternalUnlock            @7
    21 ; DSoundHelp              @8
     20; DDInternalUnlock          @7
     21; DSoundHelp                @8
    2222 DirectDrawCreate         = _OS2DirectDrawCreate@12             @9
    2323; DirectDrawCreateClipper         @10
     
    2929DllCanUnloadNow   = _DllCanUnloadNow@0                          @16
    3030DllGetClassObject = _DllGetClassObject@12                       @17
    31 ; GetAliasedVidMem            @18
    32 ; GetDDSurfaceLocal           @19
     31; GetAliasedVidMem          @18
     32; GetDDSurfaceLocal         @19
    3333; GetNextMipMap             @20
    3434; GetOLEThunkData           @21
    35 ; GetSurfaceFromDC            @22
    36 ; HeapVidMemAllocAligned          @23
     35; GetSurfaceFromDC          @22
     36; HeapVidMemAllocAligned    @23
    3737; InternalLock              @24
    3838; InternalUnlock            @25
    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
     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 hugh Exp $ */
     1/* $Id: divewrap.h,v 1.4 2001-03-18 21:44:44 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/fillfunc.cpp

    r2638 r5326  
    1 /* $Id: fillfunc.cpp,v 1.2 2000-02-04 19:31:23 hugh Exp $ */
     1/* $Id: fillfunc.cpp,v 1.3 2001-03-18 21:44:44 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/fillfunc.h

    r2174 r5326  
    1 /* $Id: fillfunc.h,v 1.1 1999-12-21 01:28:18 hugh Exp $ */
     1/* $Id: fillfunc.h,v 1.2 2001-03-18 21:44:45 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/initterm.cpp

    r5305 r5326  
    3333#include <winconst.h>
    3434#include <odinlx.h>
     35#include <exitlist.h>
    3536#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
    3637#include <initdll.h>
     38#include "os2fsdd.h"    // For RestorePM()
     39
    3740
    3841extern "C" {
     
    4447static HMODULE dllHandle = 0;
    4548
     49static void APIENTRY cleanup(ULONG ulReason);
     50
    4651//******************************************************************************
    4752//******************************************************************************
    48 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     53BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
    4954{
    5055   switch (fdwReason)
     
    5863
    5964   case DLL_PROCESS_DETACH:
     65#ifdef __IBMCPP__
    6066        ctordtorTerm();
     67#endif
    6168        return TRUE;
    6269   }
     
    7178/* calling this function.                                                   */
    7279/****************************************************************************/
    73 ULONG DLLENTRYPOINT_CCONV DLLENTRYPOINT_NAME(ULONG hModule, ULONG ulFlag)
     80unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long
     81                                   ulFlag)
    7482{
    7583
     
    8391      case 0 :
    8492      {
     93             APIRET rc;
     94               
     95#ifdef __IBMCPP__
     96         ctordtorInit();
     97#endif
    8598         DosQueryModuleName(hModule, CCHMAXPATH, ddrawPath);
    8699         char *endofpath = strrchr(ddrawPath, '\\');
    87          if(endofpath) *(endofpath+1) = 0;
    88 
    89          ctordtorInit();
     100         if (endofpath)
     101                        *(endofpath+1) = '\0';
    90102
    91103         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    92104
    93          dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab,
     105         dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab,
    94106                                   DDRAW_MAJORIMAGE_VERSION, DDRAW_MINORIMAGE_VERSION,
    95107                                   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;
    98114
    99115         break;
     
    101117      case 1 :
    102118         if(dllHandle) {
    103                 UnregisterLxDll(dllHandle);
     119                        UnregisterLxDll(dllHandle);
    104120         }
    105121         break;
     
    115131//******************************************************************************
    116132//******************************************************************************
     133
     134static 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 sandervl Exp $ */
     1/* $Id: initterm.h,v 1.2 2001-03-18 21:44:45 mike Exp $ */
    22/*
    33 * KERNEL32 DLL entry point header
  • trunk/src/ddraw/makefile

    r4717 r5326  
    1 # $Id: makefile,v 1.26 2000-12-02 23:38:54 bird Exp $
     1# $Id: makefile,v 1.27 2001-03-18 21:44:45 mike Exp $
    22
    33#
     
    99
    1010#
    11 # Compiler, tools, and interference rules.
     11# Compiler, tools, and inference rules.
    1212#
    1313!include ../../makefile.inc
     
    2727$(OBJDIR)\os2palette.obj \
    2828$(OBJDIR)\os2palset.obj \
     29$(OBJDIR)\os2fsdd.obj \
    2930$(OBJDIR)\rectangle.obj \
    3031$(OBJDIR)\initterm.obj \
     
    4849$(ODIN32_LIB)/user32.lib \
    4950mmpm2.lib \
    50 os2386.lib \
     51OS2386.LIB \
    5152$(RTLLIB_O)
    5253
    5354
    5455#
    55 # Target name - name of the dll without extention and path.
     56# Target name - name of the dll without extension and path.
    5657#
    5758TARGET = ddraw
  • trunk/src/ddraw/os2DDWindow.cpp

    r2174 r5326  
    1 /* $Id: os2DDWindow.cpp,v 1.4 1999-12-21 01:28:16 hugh Exp $ */
     1/* $Id: os2DDWindow.cpp,v 1.5 2001-03-18 21:44:45 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/os2DDWindow.h

    r2174 r5326  
    1 /* $Id: os2DDWindow.h,v 1.2 1999-12-21 01:28:19 hugh Exp $ */
     1/* $Id: os2DDWindow.h,v 1.3 2001-03-18 21:44:45 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/os2ddrawmodes.h

    r2638 r5326  
    1 /* $Id: os2ddrawmodes.h,v 1.3 2000-02-04 19:31:25 hugh Exp $ */
     1/* $Id: os2ddrawmodes.h,v 1.4 2001-03-18 21:44:46 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/rectangle.cpp

    r2174 r5326  
    1 /* $Id: rectangle.cpp,v 1.3 1999-12-21 01:28:17 hugh Exp $ */
     1/* $Id: rectangle.cpp,v 1.4 2001-03-18 21:44:46 mike Exp $ */
    22
    33/*
  • trunk/src/ddraw/rectangle.h

    r2174 r5326  
    1 /* $Id: rectangle.h,v 1.4 1999-12-21 01:28:19 hugh Exp $ */
     1/* $Id: rectangle.h,v 1.5 2001-03-18 21:44:46 mike Exp $ */
    22
    33/*
Note: See TracChangeset for help on using the changeset viewer.