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 |
|
---|
27 | #ifndef CINTERFACE
|
---|
28 | #define CINTERFACE 1
|
---|
29 | #endif
|
---|
30 | #include "ddraw2d.h"
|
---|
31 | #include "clipper.h"
|
---|
32 | #include "palette.h"
|
---|
33 | #include "surface.h"
|
---|
34 | #include "surfacehlp.h"
|
---|
35 | #include "os2util.h"
|
---|
36 | #include "rectangle.h"
|
---|
37 |
|
---|
38 | #include <misc.h>
|
---|
39 | #include "asmutil.h"
|
---|
40 | #include "bltFunc.h"
|
---|
41 | #include "colorconv.h"
|
---|
42 | #include "fillfunc.h"
|
---|
43 | #include <winerror.h>
|
---|
44 | #include <os2win.h>
|
---|
45 | #include <cpuhlp.h>
|
---|
46 | #include "asmutil.h"
|
---|
47 | #include "wndproc.h"
|
---|
48 |
|
---|
49 | #ifndef __WATCOMC__
|
---|
50 | #include <builtin.h>
|
---|
51 | #endif
|
---|
52 |
|
---|
53 |
|
---|
54 |
|
---|
55 | //******************************************************************************
|
---|
56 | //******************************************************************************
|
---|
57 | HRESULT WIN32API SurfUpdateOverlay(THIS This, LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX)
|
---|
58 | {
|
---|
59 | dprintf(("DDRAW: SurfUpdateOverlay NOT IMPLEMENTED"));
|
---|
60 | return(DD_OK);
|
---|
61 | }
|
---|
62 | //******************************************************************************
|
---|
63 | //******************************************************************************
|
---|
64 | HRESULT WIN32API SurfUpdateOverlay3(THIS This, LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX)
|
---|
65 | {
|
---|
66 | dprintf(("DDRAW: SurfUpdateOverlay NOT IMPLEMENTED"));
|
---|
67 | return(DD_OK);
|
---|
68 | }
|
---|
69 | //******************************************************************************
|
---|
70 | //******************************************************************************
|
---|
71 | HRESULT WIN32API SurfUpdateOverlay4(THIS, LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX)
|
---|
72 | {
|
---|
73 | dprintf(("DDRAW: SurfUpdateOverlay NOT IMPLEMENTED"));
|
---|
74 | return(DD_OK);
|
---|
75 | }
|
---|
76 | //******************************************************************************
|
---|
77 | //******************************************************************************
|
---|
78 | HRESULT WIN32API SurfUpdateOverlayDisplay(THIS, DWORD)
|
---|
79 | {
|
---|
80 | dprintf(("DDRAW: SurfUpdateOverlayDisplay NOT IMPLEMENTED"));
|
---|
81 | return(DD_OK);
|
---|
82 | }
|
---|
83 | //******************************************************************************
|
---|
84 | //******************************************************************************
|
---|
85 | HRESULT WIN32API SurfUpdateOverlayZOrder(THIS, DWORD, LPDIRECTDRAWSURFACE2)
|
---|
86 | {
|
---|
87 | dprintf(("DDRAW: SurfUpdateOverlayZOrder NOT IMPLEMENTED"));
|
---|
88 | return(DD_OK);
|
---|
89 | }
|
---|
90 | //******************************************************************************
|
---|
91 | //******************************************************************************
|
---|
92 | HRESULT WIN32API SurfUpdateOverlayZOrder3(THIS, DWORD, LPDIRECTDRAWSURFACE3)
|
---|
93 | {
|
---|
94 | dprintf(("DDRAW: SurfUpdateOverlayZOrder NOT IMPLEMENTED"));
|
---|
95 | return(DD_OK);
|
---|
96 | }
|
---|
97 | //******************************************************************************
|
---|
98 | //******************************************************************************
|
---|
99 | HRESULT WIN32API SurfUpdateOverlayZOrder4(THIS, DWORD, LPDIRECTDRAWSURFACE4)
|
---|
100 | {
|
---|
101 | dprintf(("DDRAW: SurfUpdateOverlayZOrder4 NOT IMPLEMENTED"));
|
---|
102 | return(DD_OK);
|
---|
103 | }
|
---|
104 | //******************************************************************************
|
---|
105 | //******************************************************************************
|
---|
106 | HRESULT WIN32API SurfGetOverlayPosition(THIS This, LPLONG lplX, LPLONG lplY)
|
---|
107 | {
|
---|
108 | OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
|
---|
109 | dprintf(("DDRAW: SurfGetOverlayPosition\n"));
|
---|
110 |
|
---|
111 | // Maybe simply return dderr_notsupported as we retun a max overlay value of 0 in the caps ?
|
---|
112 |
|
---|
113 | if( (NULL==lplX) || (NULL==lplY))
|
---|
114 | return DDERR_INVALIDPARAMS;
|
---|
115 |
|
---|
116 | if(!(me->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_OVERLAY))
|
---|
117 | return DDERR_NOTAOVERLAYSURFACE;
|
---|
118 |
|
---|
119 | if(!(me->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_VISIBLE))
|
---|
120 | return DDERR_OVERLAYNOTVISIBLE;
|
---|
121 |
|
---|
122 | if(!me->fOverlayValid)
|
---|
123 | return DDERR_NOOVERLAYDEST;
|
---|
124 |
|
---|
125 | *lplX = me->lOverlayX;
|
---|
126 | *lplY = me->lOverlayY;
|
---|
127 |
|
---|
128 | return(DD_OK);
|
---|
129 | }
|
---|
130 | //******************************************************************************
|
---|
131 | //******************************************************************************
|
---|
132 | HRESULT WIN32API SurfSetOverlayPosition(THIS This, LONG lX, LONG lY)
|
---|
133 | {
|
---|
134 | OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
|
---|
135 |
|
---|
136 | dprintf(("DDRAW: SurfSetOverlayPosition\n"));
|
---|
137 |
|
---|
138 | if( (me->DDSurfaceDesc.dwFlags & DDSD_CAPS) &&
|
---|
139 | (me->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_OVERLAY) )
|
---|
140 | {
|
---|
141 | if(me->fOverlayValid)
|
---|
142 | return(DDERR_NOOVERLAYDEST);
|
---|
143 |
|
---|
144 | if(!(me->DDSurfaceDesc.dwFlags & DDSCAPS_VISIBLE))
|
---|
145 | return(DDERR_OVERLAYNOTVISIBLE);
|
---|
146 |
|
---|
147 | // ToDo: If we implement alignment restricions to the Overlay position
|
---|
148 | // check if the new values are OK otherwiese return DDERR_INVALIDPOSITION
|
---|
149 |
|
---|
150 | me->lOverlayX = lX;
|
---|
151 | me->lOverlayY = lY;
|
---|
152 | return(DD_OK);
|
---|
153 | }
|
---|
154 |
|
---|
155 | return(DDERR_NOTAOVERLAYSURFACE);
|
---|
156 | }
|
---|
157 | //******************************************************************************
|
---|
158 | //******************************************************************************
|
---|
159 | HRESULT WIN32API SurfAddOverlayDirtyRect(THIS, LPRECT)
|
---|
160 | {
|
---|
161 | dprintf(("DDRAW: SurfAddOverlayDirtyRect Not implemented by M$ in DX 6.0!\n"));
|
---|
162 |
|
---|
163 | return(DD_OK);
|
---|
164 | }
|
---|
165 | //******************************************************************************
|
---|
166 | //******************************************************************************
|
---|
167 | HRESULT WIN32API SurfEnumOverlayZOrders(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK)
|
---|
168 | {
|
---|
169 | dprintf(("DDRAW: SurfEnumOverlayZOrders\n"));
|
---|
170 |
|
---|
171 | return(DD_OK);
|
---|
172 | }
|
---|
173 | //******************************************************************************
|
---|
174 | //******************************************************************************
|
---|
175 | HRESULT WIN32API SurfEnumOverlayZOrders4(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2)
|
---|
176 | {
|
---|
177 | dprintf(("DDRAW: SurfEnumOverlayZOrders\n"));
|
---|
178 |
|
---|
179 | return(DD_OK);
|
---|
180 | }
|
---|
181 | //******************************************************************************
|
---|
182 | //******************************************************************************
|
---|