Index: trunk/src/ddraw/OS2CLIPPER.CPP
===================================================================
--- trunk/src/ddraw/OS2CLIPPER.CPP	(revision 2173)
+++ trunk/src/ddraw/OS2CLIPPER.CPP	(revision 2174)
@@ -1,2 +1,14 @@
+/* $Id: OS2CLIPPER.CPP,v 1.9 1999-12-21 01:28:15 hugh Exp $ */
+
+/*
+ * DX clipper class routines
+ *
+ * Copyright 1998 Sander van Leeuwen
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #include <memory.h>
 
Index: trunk/src/ddraw/OS2CLIPPER.H
===================================================================
--- trunk/src/ddraw/OS2CLIPPER.H	(revision 2173)
+++ trunk/src/ddraw/OS2CLIPPER.H	(revision 2174)
@@ -1,2 +1,12 @@
+/* $Id: OS2CLIPPER.H,v 1.6 1999-12-21 01:28:19 hugh Exp $ */
+
+/*
+ * DX clipper class definition
+ *
+ * Copyright 1998 Sander va Leeuwen
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
 #ifndef __OS2CLIPPER_H__
 #define __OS2CLIPPER_H__
Index: trunk/src/ddraw/OS2D3D.CPP
===================================================================
--- trunk/src/ddraw/OS2D3D.CPP	(revision 2173)
+++ trunk/src/ddraw/OS2D3D.CPP	(revision 2174)
@@ -1,2 +1,13 @@
+/* $Id: OS2D3D.CPP,v 1.9 1999-12-21 01:28:15 hugh Exp $ */
+
+/*
+ * DX clipper class routines
+ *
+ * Copyright 1998 Sander van Leeuwen
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #include <memory.h>
 
Index: trunk/src/ddraw/OS2DDRAW.CPP
===================================================================
--- trunk/src/ddraw/OS2DDRAW.CPP	(revision 2173)
+++ trunk/src/ddraw/OS2DDRAW.CPP	(revision 2174)
@@ -1,2 +1,13 @@
+/* $Id: OS2DDRAW.CPP,v 1.18 1999-12-21 01:28:15 hugh Exp $ */
+
+/*
+ * DX Draw base class implementation
+ *
+ * Copyright 1998 Sander va Leeuwen
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
 #include <stdlib.h>
 #include <string.h>
@@ -1479,5 +1490,11 @@
     dprintf(("DDRAW: SetCooperativeLevel: hwnd %X, Flags %X\n", hwndClient, dwFlags));
   #endif
-
+  me->dwCoopMode = dwFlags;
+  if(!(DDSCL_NORMAL & dwFlags))
+  {
+    // client window req. for all none DDSCL_NORMAL modes
+    if(NULL==hwndClient)
+      return(DDERR_INVALIDPARAMS);
+  }
   me->hwndClient = hwndClient;
   #if 0
@@ -1504,4 +1521,9 @@
   me->screenheight = dwHeight;
   me->screenbpp    = dwBPP;
+
+  if(me->dwCoopMode & DDSCL_FULLSCREEN)
+  {
+    SetWindowPos(me->hwndClient, HWND_TOP,0,0,dwWidth,dwHeight,0);
+  }
 
   memset(&sBlt,0,sizeof(sBlt));
@@ -1542,4 +1564,9 @@
   me->screenbpp    = dwBPP;
 
+  if(me->dwCoopMode & DDSCL_FULLSCREEN)
+  {
+    SetWindowPos(me->hwndClient, HWND_TOP,0,0,dwWidth,dwHeight,0);
+  }
+
   memset(&sBlt,0,sizeof(sBlt));
   sBlt.ulStructLen = sizeof(sBlt);
Index: trunk/src/ddraw/OS2DDRAW.H
===================================================================
--- trunk/src/ddraw/OS2DDRAW.H	(revision 2173)
+++ trunk/src/ddraw/OS2DDRAW.H	(revision 2174)
@@ -1,2 +1,14 @@
+/* $Id: OS2DDRAW.H,v 1.9 1999-12-21 01:28:19 hugh Exp $ */
+
+/*
+ * DX Draw base class definition
+ *
+ * Copyright 1998 Sander va Leeuwen
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #ifndef __OS2DDRAW_HPP__
   #define __OS2DDRAW_HPP__
@@ -67,4 +79,5 @@
     char   *pFrameBuffer;
     HWND    hwndClient;
+    DWORD   dwCoopMode;
     int     screenwidth, screenheight, screenbpp;
     BOOL    PrimaryExists;
Index: trunk/src/ddraw/OS2PALETTE.CPP
===================================================================
--- trunk/src/ddraw/OS2PALETTE.CPP	(revision 2173)
+++ trunk/src/ddraw/OS2PALETTE.CPP	(revision 2174)
@@ -1,2 +1,14 @@
+/* $Id: OS2PALETTE.CPP,v 1.12 1999-12-21 01:28:16 hugh Exp $ */
+
+/*
+ * DX palette class implementation
+ *
+ * Copyright 1998 Sander va Leeuwen
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #include <stdio.h>
 #include <stdlib.h>
Index: trunk/src/ddraw/OS2PALETTE.H
===================================================================
--- trunk/src/ddraw/OS2PALETTE.H	(revision 2173)
+++ trunk/src/ddraw/OS2PALETTE.H	(revision 2174)
@@ -1,2 +1,14 @@
+/* $Id: OS2PALETTE.H,v 1.7 1999-12-21 01:28:19 hugh Exp $ */
+
+/*
+ * DX palette class definition
+ *
+ * Copyright 1998 Sander va Leeuwen
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #ifndef __OS2PALETTE_H__
 #define __OS2PALETTE_H__
Index: trunk/src/ddraw/OS2PALSET.CPP
===================================================================
--- trunk/src/ddraw/OS2PALSET.CPP	(revision 2173)
+++ trunk/src/ddraw/OS2PALSET.CPP	(revision 2174)
@@ -1,2 +1,12 @@
+/* $Id: OS2PALSET.CPP,v 1.7 1999-12-21 01:28:16 hugh Exp $ */
+
+/*
+ * Functions used to Set the Physical Palette in OS/2 when in 8 Bit mode
+ *
+ * Copyright 1998 Sander va Leeuwen
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
 #define INCL_GREALL
 #define INCL_GPI
@@ -18,5 +28,5 @@
  int  i;
 
-  
+
 
   hps = WinGetPS(HWND_DESKTOP);
@@ -45,5 +55,5 @@
   WinReleasePS(hps);
 
-  
+
 
 }
@@ -55,5 +65,5 @@
  HDC hdc;
 
-  
+
 
   hps = WinGetPS( HWND_DESKTOP);
@@ -71,5 +81,5 @@
   WinReleasePS(hps);
 
-  
+
 
 }
Index: trunk/src/ddraw/OS2PALSET.H
===================================================================
--- trunk/src/ddraw/OS2PALSET.H	(revision 2173)
+++ trunk/src/ddraw/OS2PALSET.H	(revision 2174)
@@ -1,17 +1,28 @@
+/* $Id: OS2PALSET.H,v 1.5 1999-12-21 01:28:19 hugh Exp $ */
+
+/*
+ * Defintions for OS/2 Palette functions
+ *
+ * Copyright 1998 Sander van Leeuwen
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
 #ifndef __OS2PALSET_H__
-#define __OS2PALSET_H__
+  #define __OS2PALSET_H__
 
-#ifndef __OS2PALETTE_H__
- typedef struct tagPALETTEENTRY {
-    BYTE        peRed;
-    BYTE        peGreen;
-    BYTE        peBlue;
-    BYTE        peFlags;
- } PALETTEENTRY;
-#endif
+  #ifndef __OS2PALETTE_H__
+   typedef struct tagPALETTEENTRY
+   {
+      BYTE        peRed;
+      BYTE        peGreen;
+      BYTE        peBlue;
+      BYTE        peFlags;
+   } PALETTEENTRY;
+  #endif
 
-//void OS2SetPhysPalette(PALETTEENTRY *pDirectXPal);
-void OS2SetPhysPalette(void *pal);
-void OS2ResetPhysPalette();
+  //void OS2SetPhysPalette(PALETTEENTRY *pDirectXPal);
+  void OS2SetPhysPalette(void *pal);
+  void OS2ResetPhysPalette();
 
 #endif
Index: trunk/src/ddraw/OS2SURFACE.CPP
===================================================================
--- trunk/src/ddraw/OS2SURFACE.CPP	(revision 2173)
+++ trunk/src/ddraw/OS2SURFACE.CPP	(revision 2174)
@@ -1,2 +1,13 @@
+/* $Id: OS2SURFACE.CPP,v 1.21 1999-12-21 01:28:16 hugh Exp $ */
+
+/*
+ * Direct/X Surface class implementaion
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #include <stdlib.h>
 #include <string.h>
@@ -17,4 +28,6 @@
 #include "asmutil.h"
 #include "bltFunc.h"
+#include "colorconv.h"
+#include "fillfunc.h"
 #include <winerror.h>
 #include <os2win.h>
@@ -284,4 +297,5 @@
 
 WORD wDefaultPalete16[256];
+DWORD dwDefaultPalete24[256];
 BOOL fPalInit=FALSE;
 
@@ -730,81 +744,121 @@
       {
         case 8:
-          BltSolid = &BltSolid8to8;
+          BltSolid  = &BltSolid8to8;
+          ColorConv = NULL;
+          ColorFill = &Fill8on8;
           break;
         case 16:
-          BltSolid = &BltSolid8to16;
+          BltSolid  = &BltSolid8to16;
+          ColorConv = &Conv8to16;
+          ColorFill = &Fill8on16;
           break;
         case 24:
-          BltSolid = &BltSolid8to24;
+          BltSolid  = &BltSolid8to24;
+          ColorConv = &Conv8to24;
+          ColorFill = &Fill8on24;
           break;
         case 32:
-          BltSolid = &BltSolid8to32;
+          BltSolid  = &BltSolid8to32;
+          ColorConv = &Conv8to32;
+          ColorFill = &Fill8on32;
           break;
         default:
           dprintf(("DDRAW: Unsupported System ColorDeapth %d",lpDraw->dCaps.ulDepth));
-          BltSolid = NULL;
+          BltSolid  = NULL;
+          ColorConv = NULL;
+          ColorFill = NULL;
           break;
       }
       break;
-    case16:
+    case 16:
       switch(lpDraw->dCaps.ulDepth)
       {
         case 8:
           BltSolid = &BltSolid16to8;
+          ColorConv = &Conv16to8;
+          ColorFill = &Fill16on8;
           break;
         case 16:
-          BltSolid = &BltSolid16to16;
+          BltSolid  = &BltSolid16to16;
+          ColorConv = NULL;
+          ColorFill = &Fill16on16;
           break;
         case 24:
-          BltSolid = &BltSolid16to24;
+          BltSolid  = &BltSolid16to24;
+          ColorConv = &Conv16to24;
+          ColorFill = &Fill16on24;
           break;
         case 32:
-          BltSolid = &BltSolid16to32;
+          BltSolid  = &BltSolid16to32;
+          ColorConv = &Conv16to32;
+          ColorFill = &Fill16on32;
           break;
         default:
           dprintf(("DDRAW: Unsupported System ColorDeapth %d",lpDraw->dCaps.ulDepth));
-          BltSolid = NULL;
+          BltSolid  = NULL;
+          ColorConv = NULL;
+          ColorFill = NULL;
           break;
       }
       break;
-    case24:
+    case 24:
       switch(lpDraw->dCaps.ulDepth)
       {
         case 8:
-          BltSolid = &BltSolid24to8;
+          BltSolid  = &BltSolid24to8;
+          ColorConv = &Conv24to8;
+          ColorFill = &Fill24on8;
           break;
         case 16:
-          BltSolid = &BltSolid24to16;
+          BltSolid  = &BltSolid24to16;
+          ColorConv = &Conv24to16;
+          ColorFill = &Fill24on16;
           break;
         case 24:
-          BltSolid = &BltSolid24to24;
+          BltSolid  = &BltSolid24to24;
+          ColorConv = NULL;
+          ColorFill = &Fill24on24;
           break;
         case 32:
-          BltSolid = &BltSolid24to32;
+          BltSolid  = &BltSolid24to32;
+          ColorConv = &Conv24to32;
+          ColorFill = &Fill24on32;
           break;
         default:
           dprintf(("DDRAW: Unsupported System ColorDeapth %d",lpDraw->dCaps.ulDepth));
-          BltSolid = NULL;
+          BltSolid  = NULL;
+          ColorConv = NULL;
+          ColorFill = NULL;
           break;
       }
       break;
-    case32:
+    case 32:
       switch(lpDraw->dCaps.ulDepth)
       {
         case 8:
-          BltSolid = &BltSolid32to8;
+          BltSolid  = &BltSolid32to8;
+          ColorConv = &Conv32to8;
+          ColorFill = &Fill32on8;
           break;
         case 16:
-          BltSolid = &BltSolid32to16;
+          BltSolid  = &BltSolid32to16;
+          ColorConv = &Conv32to16;
+          ColorFill = &Fill32on16;
           break;
         case 24:
-          BltSolid = &BltSolid32to24;
+          BltSolid  = &BltSolid32to24;
+          ColorConv = &Conv32to24;
+          ColorFill = &Fill32on24;
           break;
         case 32:
-          BltSolid = &BltSolid32to32;
+          BltSolid  = &BltSolid32to32;
+          ColorConv = NULL;
+          ColorFill = &Fill32on32;
           break;
         default:
           dprintf(("DDRAW: Unsupported System ColorDeapth %d",lpDraw->dCaps.ulDepth));
-          BltSolid = NULL;
+          BltSolid  = NULL;
+          ColorConv = NULL;
+          ColorFill = NULL;
           break;
       }
@@ -812,5 +866,7 @@
     default:
       dprintf(("DDRAW: Unsupported DX ColorDeapth %d",lpDraw->GetScreenBpp()));
-      BltSolid = NULL;
+      BltSolid  = NULL;
+      ColorConv = NULL;
+      ColorFill = NULL;
       break;
   }
@@ -1402,11 +1458,11 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT OS2IDirectDrawSurface::ColorFill(LPRECT lpDestRect,DWORD dwFillColor)
-{
-
-  int i,j, FillWidth, FillHeight;
-  char *pLine, *pFillPos;
-
-  DWORD *pColor, dwColor,y;
+HRESULT OS2IDirectDrawSurface::DoColorFill(LPRECT lpDestRect,DWORD dwFillColor)
+{
+
+  int i, FillWidth, FillHeight, Top, Left;
+  //char *pLine, *pFillPos;
+
+  //DWORD *pColor, dwColor,y;
   DWORD *pPal24;
   WORD  *pPal16;
@@ -1421,16 +1477,17 @@
     FillWidth  = lpDestRect->right - lpDestRect->left;
     FillHeight = lpDestRect->bottom - lpDestRect->top -1;
-    pLine = pDiveBuffer +
-            (lpDestRect->top*dwPitchDB) +
-            (lpDestRect->left*dwBytesPPDive);
+    Top = lpDestRect->top;
+    Left = lpDestRect->left;
   }
   else
   {
     dprintf(("DDRAW: Fill all at addr "));
+    Top = 0;
+    Left = 0;
     FillWidth  = width;
     FillHeight = height -1;
-    pLine = pDiveBuffer;
-  }
-  dprintf(("DDRAW: 0x%08X (%d/%d) at\n", pLine,FillWidth,FillHeight));
+    //pLine = pDiveBuffer;
+  }
+  //dprintf(("DDRAW: 0x%08X (%d/%d) at\n", pLine,FillWidth,FillHeight));
 
   // Better safe then sorry
@@ -1450,4 +1507,7 @@
                                 ((DefaultPalette[i*3+1]>>2) <<5) +
                                 ((DefaultPalette[i*3]>>3) << 11);
+          dwDefaultPalete24[i]= ((DefaultPalette[i*3+2]>>3) <<8)+
+                                ((DefaultPalette[i*3+1]>>2) <<16) +
+                                ((DefaultPalette[i*3]>>3) << 24);
           dprintf(( " # %d : RGB=%02X/%02X/%02X => %04X\n",
                     i,
@@ -1463,4 +1523,5 @@
       }
       pPal16 = &wDefaultPalete16[0];
+      pPal24 = &dwDefaultPalete24[0];
     }
     else
@@ -1471,4 +1532,13 @@
   }
 
+  if(NULL!=ColorFill)
+    ColorFill( pDiveBuffer, pFrameBuffer, Top, Left,
+              FillWidth, FillHeight, dwPitchDB,dwPitchFB,
+              dwFillColor,(16==lpDraw->dCaps.ulDepth)?(VOID*)pPal16:(VOID*)pPal24);
+  else
+  {
+    dprintf(("DDRAW: ColorFill function is NULL!!"));
+  }
+/*
   switch(dwBytesPPDive)
   {
@@ -1634,5 +1704,5 @@
     }
   }
-
+*/
   return(DD_OK);
 }
@@ -1641,5 +1711,5 @@
 void OS2IDirectDrawSurface::ColorConversion(LPRECT lpRect)
 {
-  char *pSrc,*pDst,*pSLine,*pDLine;
+  //char *pSrc,*pDst,*pSLine,*pDLine;
   DWORD CCwidth,CCheight,x,y;
   DWORD *pPal24;
@@ -1656,4 +1726,7 @@
                                 ((DefaultPalette[i*3+1]>>2) <<5) +
                                 ((DefaultPalette[i*3]>>3) << 11);
+          dwDefaultPalete24[i]= ((DefaultPalette[i*3+2]>>3) <<8)+
+                                ((DefaultPalette[i*3+1]>>2) <<16) +
+                                ((DefaultPalette[i*3]>>3) << 24);
         dprintf(( " # %d : RGB=%02X/%02X/%02X => %04X\n",
                   i,
@@ -1669,4 +1742,5 @@
     }
     pPal16 = &wDefaultPalete16[0];
+    pPal24 = &dwDefaultPalete24[0];
   }
   else
@@ -1678,8 +1752,10 @@
   if(NULL==lpRect)
   {
-    pSrc = pFrameBuffer;
-    pDst = pDiveBuffer;
+    //pSrc = pFrameBuffer;
+    //pDst = pDiveBuffer;
     CCwidth  = width;
     CCheight = height;
+    x = 0;
+    y = 0;
   }
   else
@@ -1691,4 +1767,5 @@
     lpRect->bottom = y;
     // end of hack
+  #if 0
     pSrc = pFrameBuffer +
            (lpRect->top * dwPitchFB) +
@@ -1697,4 +1774,7 @@
            (lpRect->top * dwPitchDB) +
            (lpRect->left* dwBytesPPDive);
+  #endif
+    y = lpRect->top;
+    x = lpRect->left;
     CCwidth  = lpRect->right - lpRect->left;
     CCheight = lpRect->bottom - lpRect->top;
@@ -1702,7 +1782,16 @@
   }
 
-  dprintf( ("H: %d W: %d\n SRC @ %08X\n DST @ %08X\n",
-            CCheight, CCwidth, pSrc,pDst));
-
+//  dprintf( ("H: %d W: %d\n SRC @ %08X\n DST @ %08X\n",
+//            CCheight, CCwidth, pSrc,pDst));
+  if(NULL!=ColorConv)
+    ColorConv( pDiveBuffer, pFrameBuffer, y, x,
+               CCwidth, CCheight, dwPitchDB,dwPitchFB,
+               16==lpDraw->dCaps.ulDepth?(VOID*)pPal16:(VOID*)pPal24);
+  else
+  {
+    dprintf(("DDRAW: ColorConv function is NULL!!"));
+  }
+
+/*
   pSLine = pSrc;
   pDLine = pDst;
@@ -1739,4 +1828,15 @@
       {
         dprintf(("DDRAW: 8->24Bit CC"));
+        for(y=0;CCheight;CCheight--,y++)
+        {
+          char *pIter;
+          for(x=0,pIter=pDLine;x<width;x++,pIter=pDLine)
+          {
+            *((DWORD*)pIter) = pPal24[pSLine[x]];
+            pIter+=3;
+          }
+          pSLine += dwPitchFB;
+          pDLine += dwPitchDB;
+        }
       }
       else
@@ -1749,4 +1849,14 @@
       {
         dprintf(("DDRAW: 8->32Bit CC"));
+        for(y=0;CCheight;CCheight--,y++)
+        {
+          for(x=0;x<width;x++)
+          {
+            *(((DWORD*)pDLine)+x) = pPal24[pSLine[x]];
+
+          }
+          pSLine += dwPitchFB;
+          pDLine += dwPitchDB;
+        }
       }
       else
@@ -1762,75 +1872,4 @@
       break;
   }
-
-/*
-  SETUP_BLITTER sBlt;
-  ULONG ulDN1, ulDN2;
-  ULONG rc;
-  ulDN1 = ulDN2 = 0;
-
-  memset(&sBlt,0,sizeof(sBlt));
-  sBlt.ulStructLen = sizeof(sBlt);
-  sBlt.fccSrcColorFormat = (FOURCC) DDSurfaceDesc.ddpfPixelFormat.dwFourCC;
-  if (NULL!=lpRect)
-  {
-    sBlt.ulSrcWidth        = lpRect->right - lpRect->left;
-    sBlt.ulSrcHeight       = lpRect->top   - lpRect->bottom;
-    sBlt.ulSrcPosX         = lpRect->left;
-    sBlt.ulSrcPosY         = height - lpRect->top;
-  }
-  else
-  {
-    sBlt.ulSrcWidth        = width;
-    sBlt.ulSrcHeight       = height;
-    sBlt.ulSrcPosX         = 0;
-    sBlt.ulSrcPosY         = 0;
-  }
-  sBlt.fccDstColorFormat = FOURCC_SCRN;
-  sBlt.ulDstWidth        = sBlt.ulSrcWidth;
-  sBlt.ulDstHeight       = sBlt.ulSrcHeight;
-  sBlt.lDstPosX          = sBlt.ulSrcPosX;
-  sBlt.lDstPosY          = sBlt.ulSrcPosY;
-  sBlt.ulNumDstRects     = DIVE_FULLY_VISIBLE;
-
-  dprintf( ("Colorconversion:\n FCC SRC %08X\n FCC DST %08X\n",
-            sBlt.fccSrcColorFormat,
-            sBlt.fccDstColorFormat ));
-
-  rc = DiveAllocImageBuffer( hDiveCC,
-                             &ulDN1,
-                             sBlt.fccSrcColorFormat,
-                             width,
-                             height,
-                             dwPitchFB,
-                             (PBYTE)pFrameBuffer);
-  dprintf("AllocDiveSrc Buffer rc= 0x%08X\n",rc);
-
-  rc = DiveAllocImageBuffer( hDiveCC,
-                             &ulDN2,
-                             sBlt.fccDstColorFormat,
-                             width,
-                             height,
-                             dwPitchDB,
-                             (PBYTE)pDiveBuffer);
-  dprintf(("DDRAW: AllocDiveDst Buffer rc= 0x%08X\n",rc));
-
-  rc = DiveSetupBlitter( hDiveCC,
-                         &sBlt);
-  dprintf(("DDRAW: SetupBlitter rc= %X\n",rc));
-
-  rc = DiveBlitImage( hDiveCC,
-                      ulDN1,
-                      ulDN2);
-
-  dprintf(("DDRAW: Blit rc= %X\n",rc));
-
-  rc = DiveFreeImageBuffer( hDiveCC,
-                            ulDN1);
-  dprintf(("DDRAW: Free Src rc= %X\n",rc));
-
-  rc = DiveFreeImageBuffer( hDiveCC,
-                            ulDN2);
-
-  dprintf(("DDRAW: Free dst rc= %X\n",rc));
 */
 }
@@ -2488,8 +2527,5 @@
       return DDERR_INVALIDPARAMS;
 
-    // ToDo : as we fill the DiveBuffer check if we need to convert the
-    // specified color
-
-    dest->ColorFill(lpDestRect,lpDDBltFx->dwFillColor);
+    dest->DoColorFill(lpDestRect,lpDDBltFx->dwFillColor);
 
     return(DD_OK); // according to the M$ DDK only one flag shall/can be set.
@@ -2530,8 +2566,8 @@
         {
           // ToDo: Realy implement code to get the correct index for black in 8 Bitmode
-          dest->ColorFill(lpDestRect, 0 );
+          dest->DoColorFill(lpDestRect, 0 );
         }
         else
-          dest->ColorFill(lpDestRect, 0);
+          dest->DoColorFill(lpDestRect, 0);
         return DD_OK;
       }
@@ -2541,10 +2577,10 @@
         if(1==dest->dwBytesPPDive)
         {
-          // ToDo: Realy implement code to get the correct index for black in 8 Bitmode
-          dest->ColorFill(lpDestRect, 0xFFFFFFFF );
+          // ToDo: Realy implement code to get the correct index for white in 8 Bitmode
+          dest->DoColorFill(lpDestRect, 0xFFFFFFFF );
         }
         else
-          dest->ColorFill(lpDestRect, 0xFFFFFFFF);
-        return DD_OK;
+          dest->DoColorFill(lpDestRect, 0xFFFFFFFF);
+        return (DD_OK);
       }
 
Index: trunk/src/ddraw/OS2SURFACE.H
===================================================================
--- trunk/src/ddraw/OS2SURFACE.H	(revision 2173)
+++ trunk/src/ddraw/OS2SURFACE.H	(revision 2174)
@@ -1,2 +1,13 @@
+/* $Id: OS2SURFACE.H,v 1.13 1999-12-21 01:28:19 hugh Exp $ */
+
+/*
+ * Direct/X Surface class
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #ifndef __OS2SURFACE_H__
 #define __OS2SURFACE_H__
@@ -52,5 +63,5 @@
 
  private:
-        HRESULT         ColorFill(LPRECT, DWORD);
+        HRESULT         DoColorFill(LPRECT, DWORD);
         void (__cdecl *BltSolid)( char *pDBDst,
                                 char *pFBDst,
@@ -68,4 +79,25 @@
                                 DWORD dwPitchFBSrc
                                );
+        void (__cdecl *ColorConv)( char *pDB,
+                                   char *pFB,
+                                   DWORD dwTop,
+                                   DWORD dwLeft,
+                                   DWORD dwWidth,
+                                   DWORD dwHeight,
+                                   DWORD dwPitchDB,
+                                   DWORD dwPitchFB,
+                                   VOID  *pPalette
+                                   );
+        void (__cdecl *ColorFill)( char *pDBDst,
+                                   char *pFBDst,
+                                   DWORD dwDstTop,
+                                   DWORD dwDstLeft,
+                                   DWORD dwWidth,
+                                   DWORD dwHeight,
+                                   DWORD dwPitchDBDst,
+                                   DWORD dwPitchFBDst,
+                                   DWORD dwColor,
+                                   VOID  *pPalette
+                                 );
  protected:
         HRESULT                lastError;
Index: trunk/src/ddraw/asmutil.asm
===================================================================
--- trunk/src/ddraw/asmutil.asm	(revision 2173)
+++ trunk/src/ddraw/asmutil.asm	(revision 2174)
@@ -1,6 +1,12 @@
+; $Id: asmutil.asm,v 1.5 1999-12-21 01:28:19 hugh Exp $
+
+;
 ; asmutil.asm Color key bit blitting for DirectDraw
 ;
 ; Copyright 1998 Sander van Leeuwen
 ;           1999 Markus Montkowski
+;
+; Project Odin Software License can be found in LICENSE.TXT
+;
 
                 NAME    asmutil
Index: trunk/src/ddraw/asmutil.h
===================================================================
--- trunk/src/ddraw/asmutil.h	(revision 2173)
+++ trunk/src/ddraw/asmutil.h	(revision 2174)
@@ -1,2 +1,4 @@
+/* $Id: asmutil.h,v 1.5 1999-12-21 01:28:17 hugh Exp $ */
+
 /*
  * asmutil.asm function definition
@@ -4,4 +6,7 @@
  * Copyright 1998 Sander van Leeuwen
  *           1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
  */
 
Index: trunk/src/ddraw/bltFunc.cpp
===================================================================
--- trunk/src/ddraw/bltFunc.cpp	(revision 2173)
+++ trunk/src/ddraw/bltFunc.cpp	(revision 2174)
@@ -1,2 +1,13 @@
+/* $Id: bltFunc.cpp,v 1.2 1999-12-21 01:28:15 hugh Exp $ */
+
+/*
+ * Blitting functions
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #include <memory.h>
 #include <misc.h>
Index: trunk/src/ddraw/bltFunc.h
===================================================================
--- trunk/src/ddraw/bltFunc.h	(revision 2173)
+++ trunk/src/ddraw/bltFunc.h	(revision 2174)
@@ -1,2 +1,12 @@
+/* $Id: bltFunc.h,v 1.2 1999-12-21 01:28:17 hugh Exp $ */
+
+/*
+ * Blitting functions definitions
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
 
 
Index: trunk/src/ddraw/colorconv.cpp
===================================================================
--- trunk/src/ddraw/colorconv.cpp	(revision 2174)
+++ trunk/src/ddraw/colorconv.cpp	(revision 2174)
@@ -0,0 +1,350 @@
+/* $Id: colorconv.cpp,v 1.1 1999-12-21 01:28:15 hugh Exp $ */
+
+/*
+ * ColorConversion routines
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+#include <memory.h>
+#include <misc.h>
+#include "colorconv.h"
+
+ void __cdecl Conv8to16( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        )
+{
+  char *pSrcLine, *pDstLine;
+
+  dprintf(("DDRAW: Conv8to16\n"));
+
+  pSrcLine = pFB + (dwTop*dwPitchDB) + dwLeft;
+  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*2);
+
+  for(;dwHeight;dwHeight--)
+  {
+    for(int x=0;x<dwWidth;x++)
+    {
+      *(((WORD*)pDstLine)+x) = ((WORD*)pPalette)[pSrcLine[x]];
+
+    }
+    pSrcLine += dwPitchDB;
+    pDstLine += dwPitchFB;
+  }
+}
+
+ void __cdecl Conv8to24( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        )
+{
+  char *pSrcLine, *pDstLine;
+
+  dprintf(("DDRAW: Conv8to24\n"));
+
+  pSrcLine = pFB + (dwTop*dwPitchDB) + dwLeft;
+  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*3);
+
+  for(;dwHeight;dwHeight--)
+  {
+    char *pIter;
+    pIter=pDstLine;
+    for(int x=0;x<dwWidth;x++)
+    {
+      *((DWORD*)pIter) = ((DWORD*)pPalette)[pSrcLine[x]];
+      pIter+=3;
+    }
+    pSrcLine += dwPitchDB;
+    pDstLine += dwPitchFB;
+  }
+}
+ void __cdecl Conv8to32( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        )
+{
+  char *pSrcLine, *pDstLine;
+
+  dprintf(("DDRAW: Conv8to32\n"));
+
+  pSrcLine = pFB + (dwTop*dwPitchDB) + dwLeft;
+  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*4);
+
+  for(;dwHeight;dwHeight--)
+  {
+    for(int x=0;x<dwWidth;x++)
+    {
+      *(((DWORD*)pDstLine)+x) = ((DWORD*)pPalette)[pSrcLine[x]];
+
+    }
+    pSrcLine += dwPitchDB;
+    pDstLine += dwPitchFB;
+  }
+}
+
+ void __cdecl Conv16to8( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        )
+{
+  dprintf(("DDRAW: Conv16to8 Not Implemented\n"));
+}
+
+ void __cdecl Conv16to24( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                        )
+{
+  WORD *pSrcLine;
+  char *pDstLine;
+
+  dprintf(("DDRAW: Conv16to24 (assuming R565) \n"));
+
+  pSrcLine = (WORD*)(pFB + (dwTop*dwPitchDB) + (dwLeft*2));
+  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*3);
+
+  for(;dwHeight;dwHeight--)
+  {
+    char *pIter;
+    pIter=pDstLine;
+    for(int x=0;x<dwWidth;x++)
+    {
+      *((DWORD*)pIter) = ((pSrcLine[x] & 0xF800)<< 16) +
+                         ((pSrcLine[x] & 0x07E0)<< 13) +
+                         ((pSrcLine[x] & 0x001F)<< 11);
+      pIter+=3;
+    }
+    pSrcLine = (WORD*)((char*)pSrcLine +dwPitchDB);
+    pDstLine += dwPitchFB;
+  }
+
+}
+ void __cdecl Conv16to32( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                         )
+{
+  WORD *pSrcLine;
+  char *pDstLine;
+
+  dprintf(("DDRAW: Conv16to32 (assuming R565) \n"));
+
+  pSrcLine = (WORD*)(pFB + (dwTop*dwPitchDB) + (dwLeft*2));
+  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*4);
+
+  for(;dwHeight;dwHeight--)
+  {
+
+    for(int x=0;x<dwWidth;x++)
+    {
+      *(((DWORD*)pDstLine)+x) = ((pSrcLine[x] & 0xF800)<< 16) +
+                                ((pSrcLine[x] & 0x07E0)<< 13) +
+                                ((pSrcLine[x] & 0x001F)<< 11);
+    }
+    pSrcLine = (WORD*)((char*)pSrcLine + dwPitchDB);
+    pDstLine += dwPitchFB;
+  }
+}
+
+ void __cdecl Conv24to8( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        )
+{
+  dprintf(("DDRAW: Conv24to8 Not Implmented\n"));
+}
+ void __cdecl Conv24to16( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                        )
+{
+  char *pSrcLine;
+  char *pDstLine;
+
+  dprintf(("DDRAW: Conv24to16 (assuming R565) \n"));
+
+  pSrcLine = pFB + (dwTop*dwPitchDB) + (dwLeft*3);
+  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*2);
+
+  for(;dwHeight;dwHeight--)
+  {
+
+    for(int x=0;x<dwWidth;x++)
+    {
+      *((WORD*)pDstLine[x]) = ((pSrcLine[x*3] & 0x1F)<< 11) +
+                              ((pSrcLine[x*3+1] & 0x3F)<< 5) +
+                              ((pSrcLine[x*3+2] & 0x1F));
+    }
+    pSrcLine += dwPitchDB;
+    pDstLine += dwPitchFB;
+  }
+}
+
+ void __cdecl Conv24to32( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                         )
+{
+  char *pSrcLine;
+  char *pDstLine;
+
+
+  dprintf(("DDRAW: Conv24to32 Assuming RGBA \n"));
+
+  pSrcLine = pFB + (dwTop*dwPitchDB) + (dwLeft*3);;
+  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*4);
+
+  for(;dwHeight;dwHeight--)
+  {
+    char *pIter;
+    pIter=pDstLine;
+    for(int x=0;x<dwWidth;x++)
+    {
+      *((DWORD*)pDstLine[x]) = *((DWORD*)pIter) & 0xffffff00;
+      pIter +=3;
+    }
+    pSrcLine += dwPitchDB;
+    pDstLine += dwPitchFB;
+  }
+
+}
+
+ void __cdecl Conv32to8( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        )
+{
+  dprintf(("DDRAW: Conv32to8 Not Implemented\n"));
+}
+ void __cdecl Conv32to16( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                        )
+{
+  DWORD *pSrcLine;
+  WORD  *pDstLine;
+
+  dprintf(("DDRAW: Conv32to16 (assuming R565) \n"));
+
+  pSrcLine = (DWORD*)(pFB + (dwTop*dwPitchDB) + (dwLeft*4));
+  pDstLine = (WORD*)(pDB + (dwTop*dwPitchFB) + (dwLeft*2));
+
+  for(;dwHeight;dwHeight--)
+  {
+
+    for(int x=0;x<dwWidth;x++)
+    {
+      pDstLine[x] = ((pSrcLine[x] & 0xF8000000) >> 16) +
+                    ((pSrcLine[x] & 0x00FE0000) >> 13) +
+                    ((pSrcLine[x] & 0x0000F800) >> 11);
+    }
+    pSrcLine = (DWORD*)((char*)pSrcLine + dwPitchDB);
+    pDstLine = (WORD*)((char*)pDstLine + dwPitchFB);
+  }
+}
+
+ void __cdecl Conv32to24( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                         )
+{
+  char *pSrcLine;
+  char *pDstLine;
+
+
+  dprintf(("DDRAW: Conv32to24 Assuming RGBA \n"));
+
+  pSrcLine = pFB + (dwTop*dwPitchDB) + (dwLeft*3);
+  pDstLine = pDB + (dwTop*dwPitchFB) + (dwLeft*4);
+
+  for(;dwHeight;dwHeight--)
+  {
+    char *pIter;
+    pIter=pDstLine;
+    for(int x=0;x<dwWidth;x++)
+    {
+      *((DWORD*)pIter[x]) = *((DWORD*)pSrcLine[x]);
+      pIter +=3;
+    }
+    pSrcLine += dwPitchDB;
+    pDstLine += dwPitchFB;
+  }
+
+}
+
Index: trunk/src/ddraw/colorconv.h
===================================================================
--- trunk/src/ddraw/colorconv.h	(revision 2174)
+++ trunk/src/ddraw/colorconv.h	(revision 2174)
@@ -0,0 +1,136 @@
+/* $Id: colorconv.h,v 1.1 1999-12-21 01:28:18 hugh Exp $ */
+
+/*
+ * ColorConversion definitions
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+
+ extern void __cdecl Conv8to16( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        );
+
+ extern void __cdecl Conv8to24( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        );
+ extern void __cdecl Conv8to32( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        );
+
+ extern void __cdecl Conv16to8( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        );
+
+ extern void __cdecl Conv16to24( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                        );
+ extern void __cdecl Conv16to32( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                         );
+ extern void __cdecl Conv24to8( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        );
+ extern void __cdecl Conv24to16( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                        );
+ extern void __cdecl Conv24to32( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                         );
+ extern void __cdecl Conv32to8( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         VOID  *pPalette
+                        );
+ extern void __cdecl Conv32to16( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                        );
+ extern void __cdecl Conv32to24( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          VOID  *pPalette
+                         );
+
Index: trunk/src/ddraw/ddraw.CPP
===================================================================
--- trunk/src/ddraw/ddraw.CPP	(revision 2173)
+++ trunk/src/ddraw/ddraw.CPP	(revision 2174)
@@ -1,2 +1,14 @@
+/* $Id: ddraw.CPP,v 1.10 1999-12-21 01:28:15 hugh Exp $ */
+
+/*
+ * DXDraw DLL implementaion
+ *
+ * Copyright 1998 Sander va Leeuwen
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #include <memory.h>
 
Index: trunk/src/ddraw/divewrap.h
===================================================================
--- trunk/src/ddraw/divewrap.h	(revision 2173)
+++ trunk/src/ddraw/divewrap.h	(revision 2174)
@@ -1,2 +1,12 @@
+/* $Id: divewrap.h,v 1.3 1999-12-21 01:28:18 hugh Exp $ */
+
+/*
+ * Wrapper for DIVE functions calls
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
 
 
Index: trunk/src/ddraw/fillfunc.cpp
===================================================================
--- trunk/src/ddraw/fillfunc.cpp	(revision 2174)
+++ trunk/src/ddraw/fillfunc.cpp	(revision 2174)
@@ -0,0 +1,586 @@
+/* $Id: fillfunc.cpp,v 1.1 1999-12-21 01:28:15 hugh Exp $ */
+
+/*
+ * ColorFill functions
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+#include <memory.h>
+#include <misc.h>
+#include "fillfunc.h"
+
+//
+// Blt Functions
+//
+
+#ifndef USE_ASM
+void __cdecl Fill8( char* pDst,
+                    DWORD dwWidth,
+                    DWORD dwHeight,
+                    DWORD dwPitch,
+                    DWORD dwColor)
+{
+  DWORD *pColor;
+  char  *pFillPos;
+  int i;
+  dprintf(("DDRAW:Fill8 with %08X\n",dwColor));
+
+  // First Fill First row with the color
+
+  for( i=0,pColor = (DWORD*)pDst;i<(dwWidth/4);i++)
+    pColor[i] = dwColor;
+
+  if(dwWidth % 4)
+  {
+    pFillPos = (char*) (&pColor[i-1]);
+    for(i=0;i<dwWidth % 4;i++)
+      pFillPos[i] = (UCHAR) dwColor;
+  }
+
+  dwHeight--;
+
+  if(dwWidth == dwPitch)
+  {
+    // Width = Pitch => fill buffer so no need to take care of lines
+    memcpy(pDst+dwPitch, pDst, dwWidth*dwHeight);
+  }
+  else
+  {
+    pFillPos = pDst+dwPitch;
+    while(dwHeight)
+    {
+      memcpy(pFillPos,pDst,dwWidth);
+      pFillPos += dwPitch;
+      dwHeight--;
+    }
+  }
+}
+void __cdecl Fill16( char* pDst,
+                     DWORD dwWidth,
+                     DWORD dwHeight,
+                     DWORD dwPitch,
+                     DWORD dwColor)
+{
+  DWORD *pColor;
+  char  *pFillPos;
+  int i;
+  dprintf(("DDRAW:Fill16 with %08X \n",dwColor));
+
+  // First Fill First row with the color
+
+  for( i=0,pColor = (DWORD*)pDst;i<(dwWidth/2);i++)
+    pColor[i] = dwColor;
+
+  if(dwWidth % 2)
+  {
+     pFillPos = (char*)(&pColor[i-1]);
+    *((USHORT*)pFillPos) = (USHORT)dwColor;
+  }
+
+  dwWidth *=2;
+  dwHeight--;
+
+  if(dwWidth == dwPitch)
+  {
+    // Width = Pitch => fill buffer so no need to take care of lines
+    memcpy(pDst+dwPitch, pDst, dwWidth*dwHeight);
+  }
+  else
+  {
+    pFillPos = pDst+dwPitch;
+    while(dwHeight)
+    {
+      memcpy(pFillPos,pDst,dwWidth);
+      pFillPos += dwPitch;
+      dwHeight--;
+    }
+  }
+}
+void __cdecl Fill24( char* pDst,
+                     DWORD dwWidth,
+                     DWORD dwHeight,
+                     DWORD dwPitch,
+                     DWORD dwColor)
+{
+  DWORD *pColor;
+  char  *pFillPos;
+  int i;
+  dprintf(("DDRAW:Fill24 with %08X \n",dwColor));
+
+  // First Fill First row with the color
+
+  for(i=0 ; i<dwWidth ; i++)
+  {
+    pColor = (DWORD*)(pDst+(i*3));
+    *pColor = dwColor;
+  }
+  dwWidth *=3;
+  dwHeight--;
+
+  if(dwWidth == dwPitch)
+  {
+    // Width = Pitch => fill buffer so no need to take care of lines
+    memcpy(pDst+dwPitch, pDst, dwWidth*dwHeight);
+  }
+  else
+  {
+    pFillPos = pDst+dwPitch;
+    while(dwHeight)
+    {
+      memcpy(pFillPos,pDst,dwWidth);
+      pFillPos += dwPitch;
+      dwHeight--;
+    }
+  }
+}
+
+void __cdecl Fill32( char* pDst,
+                     DWORD dwWidth,
+                     DWORD dwHeight,
+                     DWORD dwPitch,
+                     DWORD dwColor)
+{
+  DWORD *pColor;
+  char  *pFillPos;
+  int i;
+  dprintf(("DDRAW:Fill24 with %08X \n",dwColor));
+
+  // First Fill First row with the color
+
+  for(i=0 ; i<dwWidth ; i++)
+  {
+    pColor[i] = dwColor;
+  }
+  dwWidth *=4;
+  dwHeight--;
+
+  if(dwWidth == dwPitch)
+  {
+    // Width = Pitch => fill buffer so no need to take care of lines
+    memcpy(pDst+dwPitch, pDst, dwWidth*dwHeight);
+  }
+  else
+  {
+    pFillPos = pDst+dwPitch;
+    while(dwHeight)
+    {
+      memcpy(pFillPos,pDst,dwWidth);
+      pFillPos += dwPitch;
+      dwHeight--;
+    }
+  }
+}
+#else
+  #define Fill8  Fill8ASM
+  #define Fill16 Fill16ASM
+  #define Fill24 Fill24ASM
+  #define Fill32 Fill32ASM
+#endif
+
+
+
+// without ColorConversion
+ void __cdecl Fill8on8( char *pDB,
+                        char *pFB,
+                        DWORD dwTop,
+                        DWORD dwLeft,
+                        DWORD dwWidth,
+                        DWORD dwHeight,
+                        DWORD dwPitchDB,
+                        DWORD dwPitchFB,
+                        DWORD dwColor,
+                        VOID  *pPalette
+                       )
+{
+  dprintf(("Fill8on8\n"));
+  dwColor = (dwColor&0xFF)+(dwColor&0xFF<<8);
+  dwColor += (dwColor<<16);
+
+  Fill8( pDB+(dwTop*dwPitchDB)+dwLeft,
+         dwWidth,
+         dwHeight,
+         dwPitchDB,
+         dwColor);
+}
+ void __cdecl Fill16on16( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          DWORD dwColor,
+                          VOID  *pPalette
+                        )
+{
+  dprintf(("Fill16on16\n"));
+  dwColor = (dwColor&0xFFFF)+((dwColor&0xFFFF)<<16);
+
+  Fill16( pDB+(dwTop*dwPitchDB)+(dwLeft*2),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwColor);
+}
+ void __cdecl Fill24on24( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          DWORD dwColor,
+                          VOID  *pPalette
+                         )
+{
+  dprintf(("Fill24on24\n"));
+  dwColor <<= 8;
+
+  Fill24( pDB+(dwTop*dwPitchDB)+(dwLeft*3),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwColor);
+
+}
+ void __cdecl Fill32on32( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          DWORD dwColor,
+                          VOID  *pPalette
+                         )
+{
+  dprintf(("Fill32on32\n"));
+  Fill32( pDB+(dwTop*dwPitchDB)+(dwLeft*4),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwColor);
+}
+
+ void __cdecl Fill8on16( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         DWORD dwColor,
+                         VOID  *pPalette
+                        )
+{
+  DWORD dwCol;
+  dprintf(("Fill8on16\n"));
+  dwCol = (dwColor&0xFF)+(dwColor&0xFF<<8);
+  dwCol += (dwCol<<16);
+
+  Fill8( pFB+(dwTop*dwPitchDB)+dwLeft,
+         dwWidth,
+         dwHeight,
+         dwPitchDB,
+         dwCol);
+
+  dwCol = ((WORD*)pPalette)[dwColor];
+  dwCol += (dwCol<<16);
+  Fill16( pDB+(dwTop*dwPitchDB)+(dwLeft*2),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwCol);
+}
+
+ void __cdecl Fill8on24( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         DWORD dwColor,
+                         VOID  *pPalette
+                        )
+{
+  DWORD dwCol;
+  dprintf(("Fill8on24\n"));
+  dwCol = (dwColor&0xFF)+(dwColor&0xFF<<8);
+  dwCol += (dwCol<<16);
+
+  Fill8( pFB+(dwTop*dwPitchDB)+dwLeft,
+         dwWidth,
+         dwHeight,
+         dwPitchDB,
+         dwCol);
+
+  dwCol = ((DWORD*)pPalette)[dwColor];
+  //dwCol <<= 8;
+  Fill24( pDB+(dwTop*dwPitchDB)+(dwLeft*3),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwCol);
+}
+ void __cdecl Fill8on32( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         DWORD dwColor,
+                         VOID  *pPalette
+                        )
+{
+  DWORD dwCol;
+  dprintf(("Fill8on32\n"));
+  dwCol = (dwColor&0xFF)+(dwColor&0xFF<<8);
+  dwCol += (dwCol<<16);
+
+  Fill8( pFB+(dwTop*dwPitchDB)+dwLeft,
+         dwWidth,
+         dwHeight,
+         dwPitchDB,
+         dwCol);
+
+  dwCol = ((DWORD*)pPalette)[dwColor];
+  Fill32( pDB+(dwTop*dwPitchDB)+(dwLeft*4),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwCol);
+}
+ void __cdecl Fill16on8( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         DWORD dwColor,
+                         VOID  *pPalette
+                        )
+{
+  dprintf(("Fill16on8 NOT Implemented \n"));
+}
+ void __cdecl Fill16on24( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          DWORD dwColor,
+                          VOID  *pPalette
+                        )
+{
+  DWORD dwCol;
+  dprintf(("Fill16on24\n"));
+  dwCol = dwColor + (dwColor<<16);
+
+  Fill16( pFB+(dwTop*dwPitchDB)+(dwLeft*2),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwCol);
+
+  dwCol = ((dwColor & 0xF800)<< 16) +
+          ((dwColor & 0x07E0)<< 13) +
+          ((dwColor & 0x001F)<< 11);
+  Fill24( pDB+(dwTop*dwPitchDB)+(dwLeft*2),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwCol);
+}
+ void __cdecl Fill16on32( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          DWORD dwColor,
+                          VOID  *pPalette
+                         )
+{
+  DWORD dwCol;
+  dprintf(("Fill16on32\n"));
+  dwCol = dwColor + (dwColor<<16);
+
+  Fill16( pFB+(dwTop*dwPitchDB)+(dwLeft*2),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwCol);
+
+  dwCol = ((dwColor & 0xF800)<< 16) +
+          ((dwColor & 0x07E0)<< 13) +
+          ((dwColor & 0x001F)<< 11);
+  Fill32( pDB+(dwTop*dwPitchDB)+(dwLeft*4),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwCol);
+}
+
+ void __cdecl Fill24on8( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         DWORD dwColor,
+                         VOID  *pPalette
+                        )
+{
+  dprintf(("Fill24on8 NOT implemented\n"));
+}
+ void __cdecl Fill24on16( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          DWORD dwColor,
+                          VOID  *pPalette
+                        )
+{
+  DWORD dwCol;
+  dprintf(("Fill24on16\n"));
+  //dwColor <<=8;
+
+  Fill24( pFB+(dwTop*dwPitchDB)+(dwLeft*3),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwColor);
+
+  dwCol = ((dwColor & 0xF8000000) >>16) +
+          ((dwColor & 0x00FE0000)>> 13) +
+          ((dwColor & 0x0000F800)>> 11);
+
+  dwCol = dwCol + (dwCol<<16);
+  Fill16( pDB+(dwTop*dwPitchDB)+(dwLeft*2),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwCol);
+}
+ void __cdecl Fill24on32( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          DWORD dwColor,
+                          VOID  *pPalette
+                         )
+{
+  dprintf(("Fill24on32\n"));
+  //dwColor <<=8;
+
+  Fill24( pFB+(dwTop*dwPitchDB)+(dwLeft*3),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwColor);
+  Fill32( pDB+(dwTop*dwPitchDB)+(dwLeft*4),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwColor);
+}
+ void __cdecl Fill32on8( char *pDB,
+                         char *pFB,
+                         DWORD dwTop,
+                         DWORD dwLeft,
+                         DWORD dwWidth,
+                         DWORD dwHeight,
+                         DWORD dwPitchDB,
+                         DWORD dwPitchFB,
+                         DWORD dwColor,
+                         VOID  *pPalette
+                        )
+{
+  dprintf(("Fill32on8 NOT implemented\n"));
+}
+ void __cdecl Fill32on16( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          DWORD dwColor,
+                          VOID  *pPalette
+                        )
+{
+  DWORD dwCol;
+  dprintf(("Fill32on16\n"));
+
+  Fill32( pFB+(dwTop*dwPitchDB)+(dwLeft*4),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwColor);
+
+  dwCol = ((dwColor & 0xF8000000) >>16) +
+          ((dwColor & 0x00FE0000)>> 13) +
+          ((dwColor & 0x0000F800)>> 11);
+
+  dwCol = dwCol + (dwCol<<16);
+  Fill16( pDB+(dwTop*dwPitchDB)+(dwLeft*2),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwCol);
+}
+ void __cdecl Fill32on24( char *pDB,
+                          char *pFB,
+                          DWORD dwTop,
+                          DWORD dwLeft,
+                          DWORD dwWidth,
+                          DWORD dwHeight,
+                          DWORD dwPitchDB,
+                          DWORD dwPitchFB,
+                          DWORD dwColor,
+                          VOID  *pPalette
+                         )
+{
+  dprintf(("Fill32on24\n"));
+  Fill32( pFB+(dwTop*dwPitchDB)+(dwLeft*4),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwColor);
+
+  Fill24( pDB+(dwTop*dwPitchDB)+(dwLeft*3),
+          dwWidth,
+          dwHeight,
+          dwPitchDB,
+          dwColor);
+}
+
Index: trunk/src/ddraw/fillfunc.h
===================================================================
--- trunk/src/ddraw/fillfunc.h	(revision 2174)
+++ trunk/src/ddraw/fillfunc.h	(revision 2174)
@@ -0,0 +1,203 @@
+/* $Id: fillfunc.h,v 1.1 1999-12-21 01:28:18 hugh Exp $ */
+
+/*
+ * Colorfill function definitions
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+
+// without ColorConversion
+extern void __cdecl Fill8on8( char *pDBDst,
+                              char *pFBDst,
+                              DWORD dwDstTop,
+                              DWORD dwDstLeft,
+                              DWORD dwWidth,
+                              DWORD dwHeight,
+                              DWORD dwPitchDBDst,
+                              DWORD dwPitchFBDst,
+                              DWORD dwColor,
+                              VOID  *pPalette
+                             );
+
+extern void __cdecl Fill16on16( char *pDBDst,
+                                char *pFBDst,
+                                DWORD dwDstTop,
+                                DWORD dwDstLeft,
+                                DWORD dwWidth,
+                                DWORD dwHeight,
+                                DWORD dwPitchDBDst,
+                                DWORD dwPitchFBDst,
+                                DWORD dwColor,
+                                VOID  *pPalette
+                              );
+extern void __cdecl Fill24on24( char *pDBDst,
+                                char *pFBDst,
+                                DWORD dwDstTop,
+                                DWORD dwDstLeft,
+                                DWORD dwWidth,
+                                DWORD dwHeight,
+                                DWORD dwPitchDBDst,
+                                DWORD dwPitchFBDst,
+                                DWORD dwColor,
+                                VOID  *pPalette
+                               );
+extern void __cdecl Fill32on32( char *pDBDst,
+                                char *pFBDst,
+                                DWORD dwDstTop,
+                                DWORD dwDstLeft,
+                                DWORD dwWidth,
+                                DWORD dwHeight,
+                                DWORD dwPitchDBDst,
+                                DWORD dwPitchFBDst,
+                                DWORD dwColor,
+                                VOID  *pPalette
+                               );
+
+extern void __cdecl Fill8on16( char *pDBDst,
+                               char *pFBDst,
+                               DWORD dwDstTop,
+                               DWORD dwDstLeft,
+                               DWORD dwWidth,
+                               DWORD dwHeight,
+                               DWORD dwPitchDBDst,
+                               DWORD dwPitchFBDst,
+                               DWORD dwColor,
+                               VOID  *pPalette
+                              );
+
+extern void __cdecl Fill8on24( char *pDBDst,
+                               char *pFBDst,
+                               DWORD dwDstTop,
+                               DWORD dwDstLeft,
+                               DWORD dwWidth,
+                               DWORD dwHeight,
+                               DWORD dwPitchDBDst,
+                               DWORD dwPitchFBDst,
+                               DWORD dwColor,
+                               VOID  *pPalette
+                              );
+
+extern void __cdecl Fill8on32( char *pDBDst,
+                               char *pFBDst,
+                               DWORD dwDstTop,
+                               DWORD dwDstLeft,
+                               DWORD dwWidth,
+                               DWORD dwHeight,
+                               DWORD dwPitchDBDst,
+                               DWORD dwPitchFBDst,
+                               DWORD dwColor,
+                               VOID  *pPalette
+                              );
+
+extern void __cdecl Fill16on8( char *pDBDst,
+                               char *pFBDst,
+                               DWORD dwDstTop,
+                               DWORD dwDstLeft,
+                               DWORD dwWidth,
+                               DWORD dwHeight,
+                               DWORD dwPitchDBDst,
+                               DWORD dwPitchFBDst,
+                               DWORD dwColor,
+                               VOID  *pPalette
+                              );
+
+extern void __cdecl Fill16on24( char *pDBDst,
+                                char *pFBDst,
+                                DWORD dwDstTop,
+                                DWORD dwDstLeft,
+                                DWORD dwWidth,
+                                DWORD dwHeight,
+                                DWORD dwPitchDBDst,
+                                DWORD dwPitchFBDst,
+                                DWORD dwColor,
+                                VOID  *pPalette
+                              );
+
+extern void __cdecl Fill16on32( char *pDBDst,
+                               char *pFBDst,
+                               DWORD dwDstTop,
+                               DWORD dwDstLeft,
+                               DWORD dwWidth,
+                               DWORD dwHeight,
+                               DWORD dwPitchDBDst,
+                               DWORD dwPitchFBDst,
+                               DWORD dwColor,
+                               VOID  *pPalette
+                              );
+
+extern void __cdecl Fill24on8( char *pDBDst,
+                               char *pFBDst,
+                               DWORD dwDstTop,
+                               DWORD dwDstLeft,
+                               DWORD dwWidth,
+                               DWORD dwHeight,
+                               DWORD dwPitchDBDst,
+                               DWORD dwPitchFBDst,
+                               DWORD dwColor,
+                               VOID  *pPalette
+                              );
+
+extern void __cdecl Fill24on16( char *pDBDst,
+                                char *pFBDst,
+                                DWORD dwDstTop,
+                                DWORD dwDstLeft,
+                                DWORD dwWidth,
+                                DWORD dwHeight,
+                                DWORD dwPitchDBDst,
+                                DWORD dwPitchFBDst,
+                                DWORD dwColor,
+                                VOID  *pPalette
+                              );
+
+extern void __cdecl Fill24on32( char *pDBDst,
+                               char *pFBDst,
+                               DWORD dwDstTop,
+                               DWORD dwDstLeft,
+                               DWORD dwWidth,
+                               DWORD dwHeight,
+                               DWORD dwPitchDBDst,
+                               DWORD dwPitchFBDst,
+                               DWORD dwColor,
+                               VOID  *pPalette
+                              );
+
+extern void __cdecl Fill32on8( char *pDBDst,
+                               char *pFBDst,
+                               DWORD dwDstTop,
+                               DWORD dwDstLeft,
+                               DWORD dwWidth,
+                               DWORD dwHeight,
+                               DWORD dwPitchDBDst,
+                               DWORD dwPitchFBDst,
+                               DWORD dwColor,
+                               VOID  *pPalette
+                              );
+
+extern void __cdecl Fill32on16( char *pDBDst,
+                                char *pFBDst,
+                                DWORD dwDstTop,
+                                DWORD dwDstLeft,
+                                DWORD dwWidth,
+                                DWORD dwHeight,
+                                DWORD dwPitchDBDst,
+                                DWORD dwPitchFBDst,
+                                DWORD dwColor,
+                                VOID  *pPalette
+                              );
+
+extern void __cdecl Fill32on24( char *pDBDst,
+                               char *pFBDst,
+                               DWORD dwDstTop,
+                               DWORD dwDstLeft,
+                               DWORD dwWidth,
+                               DWORD dwHeight,
+                               DWORD dwPitchDBDst,
+                               DWORD dwPitchFBDst,
+                               DWORD dwColor,
+                               VOID  *pPalette
+                              );
+
Index: trunk/src/ddraw/makefile
===================================================================
--- trunk/src/ddraw/makefile	(revision 2173)
+++ trunk/src/ddraw/makefile	(revision 2174)
@@ -1,6 +1,11 @@
-#
-# PD-Win32 API
+# $Id: makefile,v 1.16 1999-12-21 01:28:20 hugh Exp $
 #
 # ddraw.dll makefile
+#
+# Copyright 1998 Sander van Leeuwen
+#           1999 Markus Montkowski
+#
+# Project Odin Software License can be found in LICENSE.TXT
+#
 #
 
@@ -20,8 +25,10 @@
 OBJS =  ddraw.obj os2ddraw.obj os2clipper.obj os2d3d.obj iccio1.obj asmutil.obj\
         os2surface.obj os2palette.obj os2palset.obj rectangle.obj initterm.obj \
-        os2util.obj bltFunc.obj
+        os2util.obj bltFunc.obj fillfunc.obj colorconv.obj
 
 
-LIBS =  ..\..\lib\pmwinx.lib mmpm2.lib ..\..\lib\comctl32.lib $(PDWIN32_LIB)\advapi32.lib $(PDWIN32_LIB)\kernel32.lib $(PDWIN32_LIB)\gdi32.lib $(PDWIN32_LIB)\comctl32.lib $(PDWIN32_LIB)\kernel32.lib $(PDWIN32_LIB)/odincrt.lib OS2386.LIB $(RTLLIB_O)
+LIBS =  $(PDWIN32_LIB)\pmwinx.lib $(PDWIN32_LIB)\advapi32.lib $(PDWIN32_LIB)\gdi32.lib \
+        $(PDWIN32_LIB)\comctl32.lib $(PDWIN32_LIB)\kernel32.lib $(PDWIN32_LIB)\odincrt.lib \
+        $(PDWIN32_LIB)\user32.lib mmpm2.lib OS2386.LIB $(RTLLIB_O)
 
 all: $(TARGET).dll $(TARGET).lib
@@ -78,8 +85,9 @@
     os2surface.h \
     os2ddraw.h\
+    rectangle.h \
     $(PDWIN32_INCLUDE)\win\ddraw.h \
     $(PDWIN32_INCLUDE)\win\d3d.h
 
-rectangle.obj: rectangle.cpp
+rectangle.obj: rectangle.cpp rectangle.h
 
 initterm.obj: initterm.cpp initterm.h
@@ -88,4 +96,10 @@
 
 bltFunc.obj: bltFunc.cpp bltFunc.h \
+    $(PDWIN32_INCLUDE)\misc.h
+
+fillfunc.obj: fillfunc.cpp fillfunc.h \
+    $(PDWIN32_INCLUDE)\misc.h
+
+colorconv.obj: colorconv.cpp colorconv.h \
     $(PDWIN32_INCLUDE)\misc.h
 
Index: trunk/src/ddraw/os2DDWindow.cpp
===================================================================
--- trunk/src/ddraw/os2DDWindow.cpp	(revision 2173)
+++ trunk/src/ddraw/os2DDWindow.cpp	(revision 2174)
@@ -1,2 +1,14 @@
+/* $Id: os2DDWindow.cpp,v 1.4 1999-12-21 01:28:16 hugh Exp $ */
+
+/*
+ * Functions to subclass the games windowproc to be used for
+ * fullscreen switching
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #define INCL_WIN
 #include <os2wrap.h>
@@ -9,5 +21,5 @@
 extern VOID SwitchDisplay(HWND hwnd);
 
-ODINFUNCTION1(BOOL , OS2DdSubClassWindow ,HWND, hwndClient)
+ODINFUNCTION1(BOOL , OS2DDSubClassWindow ,HWND, hwndClient)
 {
   HWND hwndParent;
Index: trunk/src/ddraw/os2DDWindow.h
===================================================================
--- trunk/src/ddraw/os2DDWindow.h	(revision 2173)
+++ trunk/src/ddraw/os2DDWindow.h	(revision 2174)
@@ -1,2 +1,12 @@
+/* $Id: os2DDWindow.h,v 1.2 1999-12-21 01:28:19 hugh Exp $ */
+
+/*
+ * Windwo subclass definitions
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
 
 #ifndef OS2DDWindow
Index: trunk/src/ddraw/os2ddrawmodes.h
===================================================================
--- trunk/src/ddraw/os2ddrawmodes.h	(revision 2173)
+++ trunk/src/ddraw/os2ddrawmodes.h	(revision 2174)
@@ -1,2 +1,12 @@
+/* $Id: os2ddrawmodes.h,v 1.2 1999-12-21 01:28:19 hugh Exp $ */
+
+/*
+ * Defintions of common videomodes we report back
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
 #ifndef __OS2DDRAWMODES__
 #define __OS2DDRAWMODES__
Index: trunk/src/ddraw/rectangle.cpp
===================================================================
--- trunk/src/ddraw/rectangle.cpp	(revision 2173)
+++ trunk/src/ddraw/rectangle.cpp	(revision 2174)
@@ -1,2 +1,15 @@
+/* $Id: rectangle.cpp,v 1.3 1999-12-21 01:28:17 hugh Exp $ */
+
+/*
+ * Rectangle class Implementaion
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+typedef long BOOL;
+
 #include "rectangle.h"
 
@@ -13,5 +26,5 @@
 }
 
-IBase::Boolean DDRectangle::operator == ( const DDRectangle &aRect ) const
+BOOL DDRectangle::operator == ( const DDRectangle &aRect ) const
   {
   return ( lTop == aRect.lTop && lLeft == aRect.lLeft
@@ -19,9 +32,9 @@
            lBottom == aRect.lBottom && lRight == aRect.lRight);
   }
-IBase::Boolean DDRectangle::operator != ( const DDRectangle& aRect ) const
+BOOL DDRectangle::operator != ( const DDRectangle& aRect ) const
   {
   return !( *this == aRect );
   }
-IBase::Boolean DDRectangle::intersects ( const DDRectangle &aRect ) const
+BOOL DDRectangle::intersects ( const DDRectangle &aRect ) const
 {
   return ( lTop < aRect.lBottom && lLeft<aRect.lRight
Index: trunk/src/ddraw/rectangle.h
===================================================================
--- trunk/src/ddraw/rectangle.h	(revision 2173)
+++ trunk/src/ddraw/rectangle.h	(revision 2174)
@@ -1,10 +1,17 @@
+/* $Id: rectangle.h,v 1.4 1999-12-21 01:28:19 hugh Exp $ */
+
+/*
+ * Rectangle class used to keep track of locked rects in surfaces
+ *
+ * Copyright 1999 Markus Montkowski
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
 #ifndef __DDRectandle
   #define __DDRectandle
 
-#include <ibase.hpp>
-
-class DDRectangle : public IBase {
-typedef IBase
-  Inherited;
+class DDRectangle {
 public:
 /*------------------------------ Related Types -------------------------------*/
@@ -22,10 +29,10 @@
 
 /*------------------------------- Comparisons --------------------------------*/
-Boolean
+BOOL
   operator == ( const DDRectangle& rectangle ) const,
   operator != ( const DDRectangle& rectangle ) const;
 
 /*--------------------------------- Testing ----------------------------------*/
-Boolean
+BOOL
   intersects ( const DDRectangle& rectangle ) const;
 
