source: trunk/src/ddraw/OS2CLIPPER.CPP@ 1568

Last change on this file since 1568 was 1568, checked in by hugh, 26 years ago

Changed dprintf to add DDRAW: at start of a entry
Also copied framebuffer for solid blits to the prinmary surface
Red Alert Map editor does work now ;)

File size: 5.0 KB
Line 
1#include <memory.h>
2
3#define INITGUID
4#include "os2ddraw.h"
5#include "os2clipper.h"
6#define _OS2WIN_H
7#define FAR
8#include <misc.h>
9#include <winerror.h>
10
11//******************************************************************************
12//******************************************************************************
13OS2IDirectDrawClipper::OS2IDirectDrawClipper(OS2IDirectDraw *lpDirectDraw) :
14 Referenced(0), lastError(DD_OK),
15 clipWindow(0)
16{
17 lpVtbl = &Vtbl;
18 Vtbl.AddRef = ClipAddRef;
19 Vtbl.Release = ClipRelease;
20 Vtbl.QueryInterface = ClipQueryInterface;
21 Vtbl.GetClipList = ClipGetClipList;
22 Vtbl.GetHWnd = ClipGetHWnd;
23 Vtbl.Initialize = ClipInitialize;
24 Vtbl.IsClipListChanged = ClipIsClipListChanged;
25 Vtbl.SetClipList = ClipSetClipList;
26 Vtbl.SetHWnd = ClipSetHWnd;
27
28 lpDraw = lpDirectDraw;
29 lpDraw->Vtbl.AddRef(lpDraw);
30 hDive = lpDirectDraw->GetDiveInstance();
31}
32//******************************************************************************
33//******************************************************************************
34OS2IDirectDrawClipper::~OS2IDirectDrawClipper()
35{
36 lpDraw->Vtbl.Release(lpDraw);
37}
38//******************************************************************************
39//******************************************************************************
40HRESULT __stdcall ClipQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj)
41{
42 #ifdef DEBUG
43 dprintf(("DDRAW: ClipQueryInterface\n"));
44 #endif
45
46 *ppvObj = NULL;
47
48 if(!IsEqualGUID(riid, IID_IDirectDrawClipper) &&
49 !IsEqualGUID(riid, CLSID_DirectDrawClipper))
50//&& !IsEqualGUID(riid, IID_IUnknown))
51 return E_NOINTERFACE;
52
53 *ppvObj = This;
54
55 ClipAddRef(This);
56 return(DD_OK);
57}
58//******************************************************************************
59//******************************************************************************
60ULONG __stdcall ClipAddRef(THIS This)
61{
62 OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
63
64 #ifdef DEBUG
65 dprintf(("DDRAW: OS2IDirectDrawClipper::AddRef %d\n", me->Referenced+1));
66 #endif
67
68 return ++me->Referenced;
69}
70//******************************************************************************
71//******************************************************************************
72ULONG __stdcall ClipRelease(THIS This)
73{
74 OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
75
76 #ifdef DEBUG
77 dprintf(("DDRAW: OS2IDirectDrawClipper::Release %d\n", me->Referenced-1));
78 #endif
79
80 if(me->Referenced)
81 {
82 me->Referenced--;
83 if(me->Referenced == 0)
84 {
85 delete( me);
86 return(0);
87 }
88 else
89 return me->Referenced;
90 }
91 else
92 return(0);
93}
94//******************************************************************************
95//******************************************************************************
96HRESULT __stdcall ClipGetClipList(THIS, LPRECT, LPRGNDATA, LPDWORD)
97{
98 #ifdef DEBUG
99 dprintf(("DDRAW: ClipGetClipList\n"));
100 #endif
101
102 return(DD_OK);
103}
104//******************************************************************************
105//******************************************************************************
106HRESULT __stdcall ClipGetHWnd(THIS This, HWND FAR *pHwnd)
107{
108 OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
109
110 #ifdef DEBUG
111 dprintf(("DDRAW: ClipGetHWnd\n"));
112 #endif
113
114 *pHwnd = me->clipWindow;
115 return(DD_OK);
116}
117//******************************************************************************
118//******************************************************************************
119HRESULT __stdcall ClipInitialize(THIS, LPDIRECTDRAW, DWORD)
120{
121 #ifdef DEBUG
122 dprintf(("DDRAW: ClipInitialize\n"));
123 #endif
124
125 return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc
126}
127//******************************************************************************
128//******************************************************************************
129HRESULT __stdcall ClipIsClipListChanged(THIS, BOOL FAR *)
130{
131 #ifdef DEBUG
132 dprintf(("DDRAW: ClipIsClipListChanged\n"));
133 #endif
134
135 return(DD_OK);
136}
137//******************************************************************************
138//******************************************************************************
139HRESULT __stdcall ClipSetClipList(THIS, LPRGNDATA,DWORD)
140{
141 #ifdef DEBUG
142 dprintf(("DDRAW: ClipSetClipList\n"));
143 #endif
144
145 return(DD_OK);
146}
147//******************************************************************************
148//DWORD param not used in DirectX 3
149//******************************************************************************
150HRESULT __stdcall ClipSetHWnd(THIS This, DWORD reserved, HWND hwnd)
151{
152 OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
153
154 #ifdef DEBUG
155 dprintf(("DDRAW: ClipSetHWnd\n"));
156 #endif
157
158 me->clipWindow = hwnd;
159 return(DD_OK);
160}
161//******************************************************************************
162//******************************************************************************
Note: See TracBrowser for help on using the repository browser.