Changeset 20241


Ignore:
Timestamp:
Jan 21, 2003, 12:20:36 PM (22 years ago)
Author:
sandervl
Message:

Removed dependency on dive.dll. Load it on demand.

Location:
tags/trunk/src/ddraw
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/ddraw/divewrap.h

    r15887 r20241  
    1 /* $Id: divewrap.h,v 1.4 2001-03-18 21:44:44 mike Exp $ */
     1/* $Id: divewrap.h,v 1.5 2003-01-21 11:20:35 sandervl Exp $ */
    22
    33/*
     
    1818  #include <dive.h>
    1919
    20   inline ULONG APIENTRY _DiveQueryCaps ( PDIVE_CAPS a,
    21                                         ULONG      b )
    22   {
    23     ULONG yyrc;
    24     USHORT sel = RestoreOS2FS();
     20void DiveUnload();
     21BOOL DiveLoad();
    2522
    26     yyrc = DiveQueryCaps(a, b);
    27     SetFS(sel);
     23ULONG APIENTRY _DiveOpen ( HDIVE *a, BOOL   b, PVOID  c );
     24ULONG APIENTRY _DiveQueryCaps ( PDIVE_CAPS a, ULONG      b );
     25ULONG APIENTRY _DiveSetupBlitter ( HDIVE a, PSETUP_BLITTER b );
     26ULONG APIENTRY _DiveBlitImage ( HDIVE a, ULONG b, ULONG c );
     27ULONG APIENTRY _DiveBlitImageLines ( HDIVE a, ULONG b,
     28                                     ULONG c, PBYTE d );
     29ULONG APIENTRY _DiveClose ( HDIVE a );
     30ULONG APIENTRY _DiveAcquireFrameBuffer ( HDIVE   a, PRECTL  b );
     31ULONG APIENTRY _DiveSwitchBank ( HDIVE a, ULONG b );
     32ULONG APIENTRY _DiveDeacquireFrameBuffer ( HDIVE a );
     33ULONG APIENTRY _DiveCalcFrameBufferAddress ( HDIVE  a, PRECTL b,
     34                                             PBYTE *c, PULONG d,
     35                                             PULONG e );
     36ULONG APIENTRY _DiveAllocImageBuffer ( HDIVE  a, PULONG b,
     37                                       FOURCC c, ULONG  d,
     38                                       ULONG  e, ULONG  f,
     39                                       PBYTE  g );
     40ULONG APIENTRY _DiveFreeImageBuffer ( HDIVE a, ULONG b );
     41ULONG APIENTRY _DiveBeginImageBufferAccess ( HDIVE  a, ULONG  b,
     42                                             PBYTE *c, PULONG d,
     43                                             PULONG e );
     44ULONG APIENTRY _DiveEndImageBufferAccess ( HDIVE a, ULONG b );
     45ULONG APIENTRY _DiveSetDestinationPalette ( HDIVE a, ULONG b,
     46                                            ULONG c, PBYTE d );
     47ULONG APIENTRY _DiveSetSourcePalette ( HDIVE a, ULONG b,
     48                                       ULONG c, PBYTE d );
     49ULONG APIENTRY _DiveSetTransparentBlitMode ( HDIVE a, ULONG b,
     50                                             ULONG c, ULONG d );
    2851
    29     return yyrc;
    30   }
    3152  #undef  DiveQueryCaps
    3253  #define DiveQueryCaps _DiveQueryCaps
    3354
    34   inline ULONG APIENTRY _DiveOpen ( HDIVE *a,
    35                                    BOOL   b,
    36                                    PVOID  c )
    37   {
    38     ULONG yyrc;
    39     USHORT sel = RestoreOS2FS();
    40 
    41     yyrc = DiveOpen(a, b, c);
    42     SetFS(sel);
    43 
    44     return yyrc;
    45   }
    4655  #undef  DiveOpen
    4756  #define DiveOpen _DiveOpen
    4857
    49   inline ULONG APIENTRY _DiveSetupBlitter ( HDIVE          a,
    50                                            PSETUP_BLITTER b )
    51   {
    52     ULONG yyrc;
    53     USHORT sel = RestoreOS2FS();
    54 
    55     yyrc = DiveSetupBlitter(a, b);
    56     SetFS(sel);
    57 
    58     return yyrc;
    59   }
    6058  #undef  DiveSetupBlitter
    6159  #define DiveSetupBlitter _DiveSetupBlitter
    6260
    63   inline ULONG APIENTRY _DiveBlitImage ( HDIVE a,
    64                                         ULONG b,
    65                                         ULONG c )
    66   {
    67     ULONG yyrc;
    68     USHORT sel = RestoreOS2FS();
    69 
    70     yyrc = DiveBlitImage(a, b, c);
    71     SetFS(sel);
    72 
    73     return yyrc;
    74   }
    7561  #undef  DiveBlitImage
    7662  #define DiveBlitImage _DiveBlitImage
    7763
    78   inline ULONG APIENTRY _DiveBlitImageLines ( HDIVE a,
    79                                              ULONG b,
    80                                              ULONG c,
    81                                              PBYTE d )
    82   {
    83     ULONG yyrc;
    84     USHORT sel = RestoreOS2FS();
    85 
    86     yyrc = DiveBlitImageLines(a, b, c, d);
    87     SetFS(sel);
    88 
    89     return yyrc;
    90   }
    9164  #undef  DiveBlitImageLines
    9265  #define DiveBlitImageLines _DiveBlitImageLines
    9366
    94   inline ULONG APIENTRY _DiveClose ( HDIVE a )
    95   {
    96     ULONG yyrc;
    97     USHORT sel = RestoreOS2FS();
    98 
    99     yyrc = DiveClose(a);
    100     SetFS(sel);
    101 
    102     return yyrc;
    103   }
    10467  #undef  DiveClose
    10568  #define DiveClose _DiveClose
    10669
    107   inline ULONG APIENTRY _DiveAcquireFrameBuffer ( HDIVE   a,
    108                                                  PRECTL  b )
    109   {
    110     ULONG yyrc;
    111     USHORT sel = RestoreOS2FS();
    112 
    113     yyrc = DiveAcquireFrameBuffer(a, b);
    114     SetFS(sel);
    115 
    116     return yyrc;
    117   }
    11870  #undef  DiveAcquireFrameBuffer
    11971  #define DiveAcquireFrameBuffer _DiveAcquireFrameBuffer
    12072
    121   inline ULONG APIENTRY _DiveSwitchBank ( HDIVE a,
    122                                          ULONG b )
    123   {
    124     ULONG yyrc;
    125     USHORT sel = RestoreOS2FS();
    126 
    127     yyrc = DiveSwitchBank(a, b);
    128     SetFS(sel);
    129 
    130     return yyrc;
    131   }
    13273  #undef  DiveSwitchBank
    13374  #define DiveSwitchBank _DiveSwitchBank
    13475
    135   inline ULONG APIENTRY _DiveDeacquireFrameBuffer ( HDIVE a )
    136   {
    137     ULONG yyrc;
    138     USHORT sel = RestoreOS2FS();
    139 
    140     yyrc = DiveDeacquireFrameBuffer(a);
    141     SetFS(sel);
    142 
    143     return yyrc;
    144   }
    14576  #undef  DiveDeacquireFrameBuffer
    14677  #define DiveDeacquireFrameBuffer _DiveDeacquireFrameBuffer
    14778
    148   inline ULONG APIENTRY _DiveCalcFrameBufferAddress ( HDIVE  a,
    149                                                      PRECTL b,
    150                                                      PBYTE *c,
    151                                                      PULONG d,
    152                                                      PULONG e )
    153   {
    154    ULONG yyrc;
    155    USHORT sel = RestoreOS2FS();
    156 
    157       yyrc = DiveCalcFrameBufferAddress(a, b, c, d, e);
    158       SetFS(sel);
    159 
    160       return yyrc;
    161   }
    16279  #undef  DiveCalcFrameBufferAddress
    16380  #define DiveCalcFrameBufferAddress _DiveCalcFrameBufferAddress
    16481
    165   inline ULONG APIENTRY _DiveAllocImageBuffer ( HDIVE  a,
    166                                                PULONG b,
    167                                                FOURCC c,
    168                                                ULONG  d,
    169                                                ULONG  e,
    170                                                ULONG  f,
    171                                                PBYTE  g )
    172   {
    173     ULONG yyrc;
    174     USHORT sel = RestoreOS2FS();
    175 
    176     yyrc = DiveAllocImageBuffer(a, b, c, d, e, f, g);
    177     SetFS(sel);
    178 
    179     return yyrc;
    180   }
    18182  #undef  DiveAllocImageBuffer
    18283  #define DiveAllocImageBuffer _DiveAllocImageBuffer
    18384
    184   inline ULONG APIENTRY _DiveFreeImageBuffer ( HDIVE a,
    185                                               ULONG b )
    186   {
    187     ULONG yyrc;
    188     USHORT sel = RestoreOS2FS();
    189 
    190     yyrc = DiveFreeImageBuffer(a, b);
    191     SetFS(sel);
    192 
    193     return yyrc;
    194   }
    19585  #undef  DiveFreeImageBuffer
    19686  #define DiveFreeImageBuffer _DiveFreeImageBuffer
    19787
    198   inline ULONG APIENTRY _DiveBeginImageBufferAccess ( HDIVE  a,
    199                                                      ULONG  b,
    200                                                      PBYTE *c,
    201                                                      PULONG d,
    202                                                      PULONG e )
    203   {
    204     ULONG yyrc;
    205     USHORT sel = RestoreOS2FS();
    206 
    207     yyrc = DiveBeginImageBufferAccess(a, b, c, d, e);
    208     SetFS(sel);
    209 
    210     return yyrc;
    211   }
    21288  #undef  DiveBeginImageBufferAccess
    21389  #define DiveBeginImageBufferAccess _DiveBeginImageBufferAccess
    21490
    215   inline ULONG APIENTRY _DiveEndImageBufferAccess ( HDIVE a,
    216                                                    ULONG b )
    217   {
    218     ULONG yyrc;
    219     USHORT sel = RestoreOS2FS();
    220 
    221     yyrc = DiveEndImageBufferAccess(a, b);
    222     SetFS(sel);
    223 
    224     return yyrc;
    225   }
    22691  #undef  DiveEndImageBufferAccess
    22792  #define DiveEndImageBufferAccess _DiveEndImageBufferAccess
    22893
    229   inline ULONG APIENTRY _DiveSetDestinationPalette ( HDIVE a,
    230                                                     ULONG b,
    231                                                     ULONG c,
    232                                                     PBYTE d )
    233   {
    234     ULONG yyrc;
    235     USHORT sel = RestoreOS2FS();
    236 
    237     yyrc = DiveSetDestinationPalette(a, b, c, d);
    238     SetFS(sel);
    239 
    240     return yyrc;
    241   }
    24294  #undef  DiveSetDestinationPalette
    24395  #define DiveSetDestinationPalette _DiveSetDestinationPalette
    24496
    245   inline ULONG APIENTRY _DiveSetSourcePalette ( HDIVE a,
    246                                                ULONG b,
    247                                                ULONG c,
    248                                                PBYTE d )
    249   {
    250     ULONG yyrc;
    251     USHORT sel = RestoreOS2FS();
    252 
    253     yyrc = DiveSetSourcePalette(a, b, c, d);
    254     SetFS(sel);
    255 
    256     return yyrc;
    257   }
    25897  #undef  DiveSetSourcePalette
    25998  #define DiveSetSourcePalette _DiveSetSourcePalette
    26099
    261   inline ULONG APIENTRY _DiveSetTransparentBlitMode ( HDIVE a,
    262                                                      ULONG b,
    263                                                      ULONG c,
    264                                                      ULONG d )
    265   {
    266     ULONG yyrc;
    267     USHORT sel = RestoreOS2FS();
    268 
    269     yyrc = DiveSetTransparentBlitMode(a, b, c, d);
    270     SetFS(sel);
    271 
    272     return yyrc;
    273   }
    274100  #undef  DiveSetTransparentBlitMode
    275101  #define DiveSetTransparentBlitMode _DiveSetTransparentBlitMode
  • TabularUnified tags/trunk/src/ddraw/initterm.cpp

    r17206 r20241  
    1 /* $Id: initterm.cpp,v 1.19 2001-09-05 12:50:39 bird Exp $
     1/* $Id: initterm.cpp,v 1.20 2003-01-21 11:20:35 sandervl Exp $
    22 *
    33 * DLL entry point
     
    4040
    4141
    42 extern "C" {
    43  //Win32 resource table (produced by wrc)
    44  extern DWORD _Resource_PEResTab;
    45 }
    46 
    47 char ddrawPath[CCHMAXPATH] = "";
    48 static HMODULE dllHandle = 0;
    49 
    5042static void APIENTRY cleanup(ULONG ulReason);
    5143
     
    8274                                   ulFlag)
    8375{
     76   APIRET rc;
    8477
    8578   /*-------------------------------------------------------------------------*/
     
    9285      case 0 :
    9386      {
    94          APIRET rc;
    95 
    9687#ifdef __IBMCPP__
    9788         ctordtorInit();
    9889#endif
    99          DosQueryModuleName(hModule, CCHMAXPATH, ddrawPath);
    100          char *endofpath = strrchr(ddrawPath, '\\');
    101          if (endofpath)
    102             *(endofpath+1) = '\0';
    10390
    104          CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    105 
    106          dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab,
    107                                    DDRAW_MAJORIMAGE_VERSION, DDRAW_MINORIMAGE_VERSION,
    108                                    IMAGE_SUBSYSTEM_WINDOWS_GUI);
    109          if (dllHandle == 0)
    110             return 0UL;
    111 
     91#ifdef FULLSCREEN_DDRAW
    11292         rc = DosExitList(EXITLIST_NONCOREDLL | EXLST_ADD, cleanup);
    11393         if (rc)
    11494            return 0UL;
     95#endif
    11596
     97         rc = inittermDDraw(hModule, ulFlag);
    11698         break;
    11799      }
    118100      case 1 :
    119          if(dllHandle) {
    120             UnregisterLxDll(dllHandle);
    121          }
     101#ifdef __IBMCPP__
     102         ctordtorTerm();
     103#endif
     104         
     105         rc = inittermDDraw(hModule, ulFlag);
    122106         break;
    123107      default  :
     
    128112   /* A non-zero value must be returned to indicate success.  */
    129113   /***********************************************************/
    130    return 1UL;
     114   return rc;
    131115}
    132116//******************************************************************************
    133117//******************************************************************************
    134 
     118#ifdef FULLSCREEN_DDRAW
    135119static void APIENTRY cleanup(ULONG ulReason)
    136120{
     
    143127//******************************************************************************
    144128//******************************************************************************
     129#endif
  • TabularUnified tags/trunk/src/ddraw/makefile

    r20104 r20241  
    1 # $Id: makefile,v 1.32 2002-12-29 14:11:01 sandervl Exp $
     1# $Id: makefile,v 1.33 2003-01-21 11:20:36 sandervl Exp $
    22
    33#
     
    3535$(OBJDIR)\os2fsdd.obj \
    3636$(OBJDIR)\rectangle.obj \
     37$(OBJDIR)\initddraw.obj \
    3738$(OBJDIR)\initterm.obj \
     39$(OBJDIR)\divewrap.obj \
    3840$(OBJDIR)\os2util.obj \
    3941$(OBJDIR)\bltFunc.obj \
     
    5456$(ODIN32_LIB)/$(ODINCRT).lib \
    5557$(ODIN32_LIB)/user32.lib \
    56 mmpm2.lib \
    5758OS2386.LIB \
    5859$(RTLLIB_O)
  • TabularUnified tags/trunk/src/ddraw/surfblit.cpp

    r20110 r20241  
    1 /* $Id: surfblit.cpp,v 1.2 2002-12-30 14:05:44 sandervl Exp $ */
     1/* $Id: surfblit.cpp,v 1.3 2003-01-21 11:20:36 sandervl Exp $ */
    22
    33/*
     
    4242#include "asmutil.h"
    4343#include "wndproc.h"
     44#include "divewrap.h"
    4445
    4546#ifndef __WATCOMC__
     
    293294  } //if(src)
    294295
     296#if 0
    295297  if(dest->diveBufNr == DIVE_BUFFER_SCREEN &&
    296298     !(dwFlags & (DDBLT_COLORFILL|DDBLT_DEPTHFILL|DDBLT_ROP) ) &&
     
    405407      }
    406408  }
     409#endif
    407410
    408411  //TODO: do we need to check the source for clipping information in case
Note: See TracChangeset for help on using the changeset viewer.