| 1 | /* $Id: surfoverlay.cpp,v 1.1 2002-12-29 14:11:03 sandervl Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * DirectDraw Surface class implementaion
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1999 Markus Montkowski
|
|---|
| 7 | * Copyright 2000 Michal Necasek
|
|---|
| 8 | * Copyright 1998-2001 Sander van Leeuwen
|
|---|
| 9 | *
|
|---|
| 10 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 11 | *
|
|---|
| 12 | */
|
|---|
| 13 |
|
|---|
| 14 | #define _OS2WIN_H
|
|---|
| 15 | #define FAR
|
|---|
| 16 |
|
|---|
| 17 | #include <odin.h>
|
|---|
| 18 | #include <winbase.h>
|
|---|
| 19 | #include <stdlib.h>
|
|---|
| 20 | #include <string.h>
|
|---|
| 21 | #include <memory.h>
|
|---|
| 22 | #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
|
|---|
| 23 | ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
|
|---|
| 24 | ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
|
|---|
| 25 | #include <fourcc.h>
|
|---|
| 26 | #define INITGUID
|
|---|
| 27 | #include "ddraw2d.h"
|
|---|
| 28 | #include "clipper.h"
|
|---|
| 29 | #include "palette.h"
|
|---|
| 30 | #include "surface.h"
|
|---|
| 31 | #include "surfacehlp.h"
|
|---|
| 32 | #include "os2util.h"
|
|---|
| 33 | #include "rectangle.h"
|
|---|
| 34 | #include <misc.h>
|
|---|
| 35 | #include "asmutil.h"
|
|---|
| 36 | #include "bltFunc.h"
|
|---|
| 37 | #include "colorconv.h"
|
|---|
| 38 | #include "fillfunc.h"
|
|---|
| 39 | #include <winerror.h>
|
|---|
| 40 | #include <os2win.h>
|
|---|
| 41 | #include <cpuhlp.h>
|
|---|
| 42 | #include "asmutil.h"
|
|---|
| 43 | #include "wndproc.h"
|
|---|
| 44 |
|
|---|
| 45 | #ifndef __WATCOMC__
|
|---|
| 46 | #include <builtin.h>
|
|---|
| 47 | #endif
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 | //******************************************************************************
|
|---|
| 52 | //******************************************************************************
|
|---|
| 53 | HRESULT WIN32API SurfUpdateOverlay(THIS This, LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX)
|
|---|
| 54 | {
|
|---|
| 55 | dprintf(("DDRAW: SurfUpdateOverlay NOT IMPLEMENTED"));
|
|---|
| 56 | return(DD_OK);
|
|---|
| 57 | }
|
|---|
| 58 | //******************************************************************************
|
|---|
| 59 | //******************************************************************************
|
|---|
| 60 | HRESULT WIN32API SurfUpdateOverlay3(THIS This, LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX)
|
|---|
| 61 | {
|
|---|
| 62 | dprintf(("DDRAW: SurfUpdateOverlay NOT IMPLEMENTED"));
|
|---|
| 63 | return(DD_OK);
|
|---|
| 64 | }
|
|---|
| 65 | //******************************************************************************
|
|---|
| 66 | //******************************************************************************
|
|---|
| 67 | HRESULT WIN32API SurfUpdateOverlay4(THIS, LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX)
|
|---|
| 68 | {
|
|---|
| 69 | dprintf(("DDRAW: SurfUpdateOverlay NOT IMPLEMENTED"));
|
|---|
| 70 | return(DD_OK);
|
|---|
| 71 | }
|
|---|
| 72 | //******************************************************************************
|
|---|
| 73 | //******************************************************************************
|
|---|
| 74 | HRESULT WIN32API SurfUpdateOverlayDisplay(THIS, DWORD)
|
|---|
| 75 | {
|
|---|
| 76 | dprintf(("DDRAW: SurfUpdateOverlayDisplay NOT IMPLEMENTED"));
|
|---|
| 77 | return(DD_OK);
|
|---|
| 78 | }
|
|---|
| 79 | //******************************************************************************
|
|---|
| 80 | //******************************************************************************
|
|---|
| 81 | HRESULT WIN32API SurfUpdateOverlayZOrder(THIS, DWORD, LPDIRECTDRAWSURFACE2)
|
|---|
| 82 | {
|
|---|
| 83 | dprintf(("DDRAW: SurfUpdateOverlayZOrder NOT IMPLEMENTED"));
|
|---|
| 84 | return(DD_OK);
|
|---|
| 85 | }
|
|---|
| 86 | //******************************************************************************
|
|---|
| 87 | //******************************************************************************
|
|---|
| 88 | HRESULT WIN32API SurfUpdateOverlayZOrder3(THIS, DWORD, LPDIRECTDRAWSURFACE3)
|
|---|
| 89 | {
|
|---|
| 90 | dprintf(("DDRAW: SurfUpdateOverlayZOrder NOT IMPLEMENTED"));
|
|---|
| 91 | return(DD_OK);
|
|---|
| 92 | }
|
|---|
| 93 | //******************************************************************************
|
|---|
| 94 | //******************************************************************************
|
|---|
| 95 | HRESULT WIN32API SurfUpdateOverlayZOrder4(THIS, DWORD, LPDIRECTDRAWSURFACE4)
|
|---|
| 96 | {
|
|---|
| 97 | dprintf(("DDRAW: SurfUpdateOverlayZOrder4 NOT IMPLEMENTED"));
|
|---|
| 98 | return(DD_OK);
|
|---|
| 99 | }
|
|---|
| 100 | //******************************************************************************
|
|---|
| 101 | //******************************************************************************
|
|---|
| 102 | HRESULT WIN32API SurfGetOverlayPosition(THIS This, LPLONG lplX, LPLONG lplY)
|
|---|
| 103 | {
|
|---|
| 104 | OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
|
|---|
| 105 | dprintf(("DDRAW: SurfGetOverlayPosition\n"));
|
|---|
| 106 |
|
|---|
| 107 | // Maybe simply return dderr_notsupported as we retun a max overlay value of 0 in the caps ?
|
|---|
| 108 |
|
|---|
| 109 | if( (NULL==lplX) || (NULL==lplY))
|
|---|
| 110 | return DDERR_INVALIDPARAMS;
|
|---|
| 111 |
|
|---|
| 112 | if(!(me->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_OVERLAY))
|
|---|
| 113 | return DDERR_NOTAOVERLAYSURFACE;
|
|---|
| 114 |
|
|---|
| 115 | if(!(me->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_VISIBLE))
|
|---|
| 116 | return DDERR_OVERLAYNOTVISIBLE;
|
|---|
| 117 |
|
|---|
| 118 | if(!me->fOverlayValid)
|
|---|
| 119 | return DDERR_NOOVERLAYDEST;
|
|---|
| 120 |
|
|---|
| 121 | *lplX = me->lOverlayX;
|
|---|
| 122 | *lplY = me->lOverlayY;
|
|---|
| 123 |
|
|---|
| 124 | return(DD_OK);
|
|---|
| 125 | }
|
|---|
| 126 | //******************************************************************************
|
|---|
| 127 | //******************************************************************************
|
|---|
| 128 | HRESULT WIN32API SurfSetOverlayPosition(THIS This, LONG lX, LONG lY)
|
|---|
| 129 | {
|
|---|
| 130 | OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
|
|---|
| 131 |
|
|---|
| 132 | dprintf(("DDRAW: SurfSetOverlayPosition\n"));
|
|---|
| 133 |
|
|---|
| 134 | if( (me->DDSurfaceDesc.dwFlags & DDSD_CAPS) &&
|
|---|
| 135 | (me->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_OVERLAY) )
|
|---|
| 136 | {
|
|---|
| 137 | if(me->fOverlayValid)
|
|---|
| 138 | return(DDERR_NOOVERLAYDEST);
|
|---|
| 139 |
|
|---|
| 140 | if(!(me->DDSurfaceDesc.dwFlags & DDSCAPS_VISIBLE))
|
|---|
| 141 | return(DDERR_OVERLAYNOTVISIBLE);
|
|---|
| 142 |
|
|---|
| 143 | // ToDo: If we implement alignment restricions to the Overlay position
|
|---|
| 144 | // check if the new values are OK otherwiese return DDERR_INVALIDPOSITION
|
|---|
| 145 |
|
|---|
| 146 | me->lOverlayX = lX;
|
|---|
| 147 | me->lOverlayY = lY;
|
|---|
| 148 | return(DD_OK);
|
|---|
| 149 | }
|
|---|
| 150 |
|
|---|
| 151 | return(DDERR_NOTAOVERLAYSURFACE);
|
|---|
| 152 | }
|
|---|
| 153 | //******************************************************************************
|
|---|
| 154 | //******************************************************************************
|
|---|
| 155 | HRESULT WIN32API SurfAddOverlayDirtyRect(THIS, LPRECT)
|
|---|
| 156 | {
|
|---|
| 157 | dprintf(("DDRAW: SurfAddOverlayDirtyRect Not implemented by M$ in DX 6.0!\n"));
|
|---|
| 158 |
|
|---|
| 159 | return(DD_OK);
|
|---|
| 160 | }
|
|---|
| 161 | //******************************************************************************
|
|---|
| 162 | //******************************************************************************
|
|---|
| 163 | HRESULT WIN32API SurfEnumOverlayZOrders(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK)
|
|---|
| 164 | {
|
|---|
| 165 | dprintf(("DDRAW: SurfEnumOverlayZOrders\n"));
|
|---|
| 166 |
|
|---|
| 167 | return(DD_OK);
|
|---|
| 168 | }
|
|---|
| 169 | //******************************************************************************
|
|---|
| 170 | //******************************************************************************
|
|---|
| 171 | HRESULT WIN32API SurfEnumOverlayZOrders4(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2)
|
|---|
| 172 | {
|
|---|
| 173 | dprintf(("DDRAW: SurfEnumOverlayZOrders\n"));
|
|---|
| 174 |
|
|---|
| 175 | return(DD_OK);
|
|---|
| 176 | }
|
|---|
| 177 | //******************************************************************************
|
|---|
| 178 | //******************************************************************************
|
|---|