DXGL r354 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r353‎ | r354 | r355 >
Date:00:43, 18 March 2013
Author:admin
Status:new
Tags:
Comment:
Trace glDirect3DViewport.cpp
Modified paths:
  • /ddraw/glDirect3DViewport.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirect3DViewport.cpp
@@ -36,6 +36,7 @@
3737
3838 glDirect3DViewport3::glDirect3DViewport3()
3939 {
 40+ TRACE_ENTER(1,14,this);
4041 background = 0;
4142 ZeroMemory(&viewport,sizeof(D3DVIEWPORT2));
4243 viewport.dwSize = sizeof(D3DVIEWPORT2);
@@ -48,10 +49,12 @@
4950 current = false;
5051 glD3DV2 = NULL;
5152 glD3DV1 = NULL;
 53+ TRACE_EXIT(-1,0);
5254 }
5355
5456 glDirect3DViewport3::~glDirect3DViewport3()
5557 {
 58+ TRACE_ENTER(1,14,this);
5659 if(device) device->Release();
5760 if(backZ) backZ->Release();
5861 for(int i = 0; i < 8; i++)
@@ -58,15 +61,19 @@
5962 {
6063 if(lights[i]) lights[i]->Release();
6164 }
 65+ TRACE_EXIT(-1,0);
6266 }
6367
6468 HRESULT WINAPI glDirect3DViewport3::QueryInterface(REFIID riid, void** ppvObj)
6569 {
66 - if(!this) return DDERR_INVALIDOBJECT;
 70+ TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
 71+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
6772 if(riid == IID_IUnknown)
6873 {
6974 this->AddRef();
7075 *ppvObj = this;
 76+ TRACE_VAR("*ppvObj",14,*ppvObj);
 77+ TRACE_EXIT(23,D3D_OK);
7178 return D3D_OK;
7279 }
7380 if(riid == IID_IDirect3DViewport3)
@@ -73,6 +80,8 @@
7481 {
7582 this->AddRef();
7683 *ppvObj = this;
 84+ TRACE_VAR("*ppvObj",14,*ppvObj);
 85+ TRACE_EXIT(23,D3D_OK);
7786 return D3D_OK;
7887 }
7988 if(riid == IID_IDirect3DViewport2)
@@ -81,6 +90,8 @@
8291 {
8392 *ppvObj = glD3DV2;
8493 glD3DV2->AddRef();
 94+ TRACE_VAR("*ppvObj",14,*ppvObj);
 95+ TRACE_EXIT(23,D3D_OK);
8596 return D3D_OK;
8697 }
8798 else
@@ -88,6 +99,8 @@
89100 this->AddRef();
90101 *ppvObj = new glDirect3DViewport2(this);
91102 glD3DV2 = (glDirect3DViewport2*)*ppvObj;
 103+ TRACE_VAR("*ppvObj",14,*ppvObj);
 104+ TRACE_EXIT(23,D3D_OK);
92105 return D3D_OK;
93106 }
94107 }
@@ -97,6 +110,8 @@
98111 {
99112 *ppvObj = glD3DV1;
100113 glD3DV1->AddRef();
 114+ TRACE_VAR("*ppvObj",14,*ppvObj);
 115+ TRACE_EXIT(23,D3D_OK);
101116 return D3D_OK;
102117 }
103118 else
@@ -104,33 +119,41 @@
105120 this->AddRef();
106121 *ppvObj = new glDirect3DViewport1(this);
107122 glD3DV1 = (glDirect3DViewport1*)*ppvObj;
 123+ TRACE_VAR("*ppvObj",14,*ppvObj);
 124+ TRACE_EXIT(23,D3D_OK);
108125 return D3D_OK;
109126 }
110127 }
 128+ TRACE_EXIT(23,E_NOINTERFACE);
111129 return E_NOINTERFACE;
112130 }
113131
114132 ULONG WINAPI glDirect3DViewport3::AddRef()
115133 {
116 - if(!this) return 0;
 134+ TRACE_ENTER(1,14,this);
 135+ if(!this) TRACE_RET(8,0);
117136 refcount++;
 137+ TRACE_EXIT(8,refcount);
118138 return refcount;
119139 }
120140
121141 ULONG WINAPI glDirect3DViewport3::Release()
122142 {
123 - if(!this) return 0;
 143+ TRACE_ENTER(1,14,this);
 144+ if(!this) TRACE_RET(8,0);
124145 ULONG ret;
125146 refcount--;
126147 ret = refcount;
127148 if(refcount == 0) delete this;
 149+ TRACE_EXIT(8,refcount);
128150 return ret;
129151 }
130152
131153 HRESULT WINAPI glDirect3DViewport3::AddLight(LPDIRECT3DLIGHT lpDirect3DLight)
132154 {
133 - if(!this) return DDERR_INVALIDOBJECT;
134 - if(((glDirect3DLight*)lpDirect3DLight)->viewport) return D3DERR_LIGHTHASVIEWPORT;
 155+ TRACE_ENTER(2,14,this,14,lpDirect3DLight);
 156+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 157+ if(((glDirect3DLight*)lpDirect3DLight)->viewport) TRACE_EXIT(23,D3DERR_LIGHTHASVIEWPORT);
135158 for(int i = 0; i < 8; i++)
136159 {
137160 if(!lights[i])
@@ -141,32 +164,37 @@
142165 lights[i]->viewport = this;
143166 if(device) lights[i]->SetDevice(device,i);
144167 lights[i]->Sync();
 168+ TRACE_EXIT(23,D3D_OK);
145169 return D3D_OK;
146170 }
147171 }
 172+ TRACE_EXIT(23,D3DERR_LIGHT_SET_FAILED);
148173 return D3DERR_LIGHT_SET_FAILED;
149174 }
150175
151176 HRESULT WINAPI glDirect3DViewport3::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
152177 {
153 - if(!this) return DDERR_INVALIDOBJECT;
154 - if(!device) return D3DERR_VIEWPORTHASNODEVICE;
 178+ TRACE_ENTER(4,14,this,8,dwCount,14,lpRects,9,dwFlags);
 179+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 180+ if(!device) TRACE_RET(23,D3DERR_VIEWPORTHASNODEVICE);
155181 D3DCOLORVALUE bgcolor = {0.0,0.0,0.0,0.0};
156182 if(device->materials[background]) bgcolor = device->materials[background]->material.diffuse;
157 - return device->Clear(dwCount,lpRects,dwFlags,d3dcvtod3dcolor(bgcolor),0.0,0);
 183+ TRACE_RET(23,device->Clear(dwCount,lpRects,dwFlags,d3dcvtod3dcolor(bgcolor),0.0,0));
158184 }
159185
160186 HRESULT WINAPI glDirect3DViewport3::Clear2(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil)
161187 {
162 - if(!this) return DDERR_INVALIDOBJECT;
163 - if(!device) return D3DERR_VIEWPORTHASNODEVICE;
164 - return device->Clear(dwCount,lpRects,dwFlags,dwColor,dvZ,dwStencil);
 188+ TRACE_ENTER(7,14,this,8,dwCount,14,lpRects,9,dwFlags,9,dwColor,19,&dvZ,9,dwStencil);
 189+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 190+ if(!device) TRACE_EXIT(23,D3DERR_VIEWPORTHASNODEVICE);
 191+ TRACE_RET(23,device->Clear(dwCount,lpRects,dwFlags,dwColor,dvZ,dwStencil));
165192 }
166193
167194 HRESULT WINAPI glDirect3DViewport3::DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight)
168195 {
169 - if(!this) return DDERR_INVALIDOBJECT;
170 - if(!lpDirect3DLight) return DDERR_INVALIDPARAMS;
 196+ TRACE_ENTER(2,14,this,14,lpDirect3DLight);
 197+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 198+ if(!lpDirect3DLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
171199 for(int i = 0; i < 8; i++)
172200 {
173201 if(lights[i] == lpDirect3DLight)
@@ -174,119 +202,151 @@
175203 lights[i]->Release();
176204 lights[i]->SetDevice(NULL,0);
177205 lights[i] = NULL;
 206+ TRACE_EXIT(23,D3D_OK);
178207 return D3D_OK;
179208 }
180209 }
 210+ TRACE_EXIT(23,D3DERR_LIGHTHASVIEWPORT);
181211 return D3DERR_LIGHTNOTINTHISVIEWPORT;
182212 }
183213
184214 HRESULT WINAPI glDirect3DViewport3::GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
185215 {
186 - if(!this) return DDERR_INVALIDOBJECT;
187 - if(!lphMat) return DDERR_INVALIDPARAMS;
 216+ TRACE_ENTER(3,14,this,14,lphMat,14,lpValid);
 217+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 218+ if(!lphMat) TRACE_RET(23,DDERR_INVALIDPARAMS);
188219 if(lpValid)
189220 {
190221 if(background) *lpValid = TRUE;
191222 else *lpValid = FALSE;
 223+ TRACE_VAR("*lpValid",22,*lpValid);
192224 }
193225 *lphMat = background;
 226+ TRACE_VAR("*lphMat",9,*lphMat);
 227+ TRACE_EXIT(23,D3D_OK);
194228 return D3D_OK;
195229 }
196230
197231 HRESULT WINAPI glDirect3DViewport3::GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
198232 {
199 - if(!this) return DDERR_INVALIDOBJECT;
200 - if(!lplpDDSurface) return DDERR_INVALIDPARAMS;
 233+ TRACE_ENTER(3,14,this,14,lplpDDSurface,14,lpValid);
 234+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 235+ if(!lplpDDSurface) TRACE_RET(23,DDERR_INVALIDPARAMS);
201236 if(lpValid)
202237 {
203238 if(backZ) *lpValid = TRUE;
204239 else *lpValid = FALSE;
 240+ TRACE_VAR("*lpValid",22,*lpValid);
205241 }
206242 if(backZ) backZ->QueryInterface(IID_IDirectDrawSurface,(void**)lplpDDSurface);
207243 else *lplpDDSurface = NULL;
 244+ TRACE_VAR("*lplpDDSurface",14,*lplpDDSurface);
 245+ TRACE_EXIT(23,D3D_OK);
208246 return D3D_OK;
209247 }
210248 HRESULT WINAPI glDirect3DViewport3::GetBackgroundDepth2(LPDIRECTDRAWSURFACE4* lplpDDS, LPBOOL lpValid)
211249 {
212 - if(!this) return DDERR_INVALIDOBJECT;
213 - if(!lplpDDS) return DDERR_INVALIDPARAMS;
 250+ TRACE_ENTER(3,14,this,14,lplpDDS,14,lpValid);
 251+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 252+ if(!lplpDDS) TRACE_RET(23,DDERR_INVALIDPARAMS);
214253 if(lpValid)
215254 {
216255 if(backZ) *lpValid = TRUE;
217256 else *lpValid = FALSE;
 257+ TRACE_VAR("*lpValid",22,*lpValid);
218258 }
219259 if(backZ) backZ->QueryInterface(IID_IDirectDrawSurface4,(void**)lplpDDS);
220260 else *lplpDDS = NULL;
 261+ TRACE_VAR("*lplpDDS",14,*lplpDDS);
 262+ TRACE_EXIT(23,D3D_OK);
221263 return D3D_OK;
222264 }
223265 HRESULT WINAPI glDirect3DViewport3::GetViewport(LPD3DVIEWPORT lpData)
224266 {
225 - if(!this) return DDERR_INVALIDOBJECT;
226 - if(!lpData) return DDERR_INVALIDPARAMS;
 267+ TRACE_ENTER(2,14,this,14,lpData);
 268+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 269+ if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
227270 memcpy(lpData,&viewport,sizeof(D3DVIEWPORT2));
228271 lpData->dvScaleX = scaleX;
229272 lpData->dvScaleY = scaleY;
230273 lpData->dvMaxX = maxX;
231274 lpData->dvMaxY = maxY;
 275+ TRACE_EXIT(23,D3D_OK);
232276 return D3D_OK;
233277 }
234278 HRESULT WINAPI glDirect3DViewport3::GetViewport2(LPD3DVIEWPORT2 lpData)
235279 {
236 - if(!this) return DDERR_INVALIDOBJECT;
237 - if(!lpData) return DDERR_INVALIDPARAMS;
 280+ TRACE_ENTER(2,14,this,14,lpData);
 281+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 282+ if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
238283 memcpy(lpData,&viewport,sizeof(D3DVIEWPORT2));
 284+ TRACE_EXIT(23,D3D_OK);
239285 return D3D_OK;
240286 }
241287 HRESULT WINAPI glDirect3DViewport3::Initialize(LPDIRECT3D lpDirect3D)
242288 {
243 - if(!this) return DDERR_INVALIDOBJECT;
 289+ TRACE_ENTER(2,14,this,14,lpDirect3D);
 290+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 291+ TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
244292 return DDERR_ALREADYINITIALIZED;
245293 }
246294 HRESULT WINAPI glDirect3DViewport3::LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData)
247295 {
248 - return E_NOTIMPL;
 296+ TRACE_ENTER(3,14,this,8,dwElementCount,14,lpData);
 297+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 298+ TRACE_EXIT(23,DDERR_UNSUPPORTED);
 299+ return DDERR_UNSUPPORTED;
249300 }
250301 HRESULT WINAPI glDirect3DViewport3::NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
251302 {
252 - if(!this) return DDERR_INVALIDOBJECT;
253 - if(!lplpDirect3DLight) return DDERR_INVALIDPARAMS;
 303+ TRACE_ENTER(4,14,this,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
 304+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 305+ if(!lplpDirect3DLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
254306 FIXME("glDirect3DViewport3::NextLight: stub");
 307+ TRACE_EXIT(23,DDERR_GENERIC);
255308 return DDERR_GENERIC;
256309 }
257310 HRESULT WINAPI glDirect3DViewport3::SetBackground(D3DMATERIALHANDLE hMat)
258311 {
259 - if(!this) return DDERR_INVALIDOBJECT;
260 - if(!device) return D3DERR_VIEWPORTHASNODEVICE;
261 - if(hMat > device->materialcount) return DDERR_INVALIDPARAMS;
 312+ TRACE_ENTER(2,14,this,9,hMat);
 313+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 314+ if(!device) TRACE_RET(23,D3DERR_VIEWPORTHASNODEVICE);
 315+ if(hMat > device->materialcount) TRACE_RET(23,DDERR_INVALIDPARAMS);
262316 background = hMat;
 317+ TRACE_EXIT(23,D3D_OK);
263318 return D3D_OK;
264319 }
265320 HRESULT WINAPI glDirect3DViewport3::SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface)
266321 {
267 - if(!this) return DDERR_INVALIDOBJECT;
268 - if(!backZ && !lpDDSurface) return D3D_OK;
269 - if(((glDirectDrawSurface1*)lpDDSurface)->GetDDS7() == backZ) return D3D_OK;
 322+ TRACE_ENTER(2,14,this,14,lpDDSurface);
 323+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 324+ if(!backZ && !lpDDSurface) TRACE_RET(23,D3D_OK);
 325+ if(((glDirectDrawSurface1*)lpDDSurface)->GetDDS7() == backZ) TRACE_RET(23,D3D_OK);
270326 if(backZ)backZ->Release();
271327 if(lpDDSurface) lpDDSurface->QueryInterface(IID_IDirectDrawSurface7,(void**)&backZ);
272328 else backZ = NULL;
 329+ TRACE_EXIT(23,D3D_OK);
273330 return D3D_OK;
274331 }
275332 HRESULT WINAPI glDirect3DViewport3::SetBackgroundDepth2(LPDIRECTDRAWSURFACE4 lpDDS)
276333 {
277 - if(!this) return DDERR_INVALIDOBJECT;
278 - if(!backZ && !lpDDS) return D3D_OK;
279 - if(((glDirectDrawSurface4*)lpDDS)->GetDDS7() == backZ) return D3D_OK;
 334+ TRACE_ENTER(2,14,this,14,lpDDS);
 335+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 336+ if(!backZ && !lpDDS) TRACE_RET(23,D3D_OK);
 337+ if(((glDirectDrawSurface4*)lpDDS)->GetDDS7() == backZ) TRACE_RET(23,D3D_OK);
280338 if(backZ)backZ->Release();
281339 if(lpDDS) lpDDS->QueryInterface(IID_IDirectDrawSurface7,(void**)&backZ);
282340 else backZ = NULL;
 341+ TRACE_EXIT(23,D3D_OK);
283342 return D3D_OK;
284343 }
285344
286345 HRESULT WINAPI glDirect3DViewport3::SetViewport(LPD3DVIEWPORT lpData)
287346 {
288 - if(!this) return DDERR_INVALIDOBJECT;
289 - if(!device) return D3DERR_VIEWPORTHASNODEVICE;
290 - if(!lpData) return DDERR_INVALIDPARAMS;
 347+ TRACE_ENTER(2,14,this,14,lpData);
 348+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 349+ if(!device) TRACE_RET(23,D3DERR_VIEWPORTHASNODEVICE);
 350+ if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
291351 D3DVIEWPORT2 vp;
292352 memcpy(&vp,lpData,sizeof(D3DVIEWPORT));
293353 vp.dvClipHeight = viewport.dvClipHeight;
@@ -300,27 +360,37 @@
301361 scaleX = lpData->dvScaleX;
302362 scaleY = lpData->dvScaleY;
303363 if(current && device) Sync();
 364+ TRACE_EXIT(23,D3D_OK);
304365 return D3D_OK;
305366 }
306367 HRESULT WINAPI glDirect3DViewport3::SetViewport2(LPD3DVIEWPORT2 lpData)
307368 {
308 - if(!this) return DDERR_INVALIDOBJECT;
309 - if(!device) return D3DERR_VIEWPORTHASNODEVICE;
310 - if(!lpData) return DDERR_INVALIDPARAMS;
 369+ TRACE_ENTER(2,14,this,14,lpData);
 370+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 371+ if(!device) TRACE_RET(23,D3DERR_VIEWPORTHASNODEVICE);
 372+ if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
311373 viewport = *lpData;
312374 if(current && device) Sync();
 375+ TRACE_EXIT(23,D3D_OK);
313376 return D3D_OK;
314377 }
315378 HRESULT WINAPI glDirect3DViewport3::TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
316379 {
317 - if(!this) return DDERR_INVALIDOBJECT;
 380+ TRACE_ENTER(5,14,this,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
 381+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
318382 FIXME("glDirect3DViewport3::TransformVertices: stub");
 383+ TRACE_EXIT(23,DDERR_GENERIC);
319384 return DDERR_GENERIC;
320385 }
321386
322387 void glDirect3DViewport3::SetCurrent(bool current)
323388 {
324 - if(this->current && current) return;
 389+ TRACE_ENTER(2,14,this,21,current);
 390+ if(this->current && current)
 391+ {
 392+ TRACE_EXIT(0,0);
 393+ return;
 394+ }
325395 this->current = current;
326396 if(current && device)
327397 {
@@ -327,10 +397,12 @@
328398 Sync();
329399 SyncLights();
330400 }
 401+ TRACE_EXIT(0,0);
331402 }
332403
333404 void glDirect3DViewport3::Sync()
334405 {
 406+ TRACE_ENTER(1,14,this);
335407 D3DVIEWPORT7 vp7;
336408 vp7.dwX = viewport.dwX;
337409 vp7.dwY = viewport.dwY;
@@ -340,10 +412,12 @@
341413 vp7.dvMaxZ = viewport.dvMaxZ;
342414 device->SetViewport(&vp7);
343415 device->SetScale(scaleX,scaleY);
 416+ TRACE_EXIT(0,0);
344417 }
345418
346419 void glDirect3DViewport3::SyncLights()
347420 {
 421+ TRACE_ENTER(1,14,this);
348422 D3DLIGHT7 light;
349423 for(int i = 0; i < 8; i++)
350424 {
@@ -356,230 +430,281 @@
357431 }
358432 else device->LightEnable(i,FALSE);
359433 }
 434+ TRACE_EXIT(0,0);
360435 }
361436
362437
363438 glDirect3DViewport2::glDirect3DViewport2(glDirect3DViewport3 *glD3DV3)
364439 {
 440+ TRACE_ENTER(2,14,this,14,glD3DV3);
365441 this->glD3DV3 = glD3DV3;
366442 refcount = 1;
 443+ TRACE_EXIT(-1,0);
367444 }
368445
369446 glDirect3DViewport2::~glDirect3DViewport2()
370447 {
 448+ TRACE_ENTER(1,14,this);
371449 glD3DV3->glD3DV2 = NULL;
372450 glD3DV3->Release();
 451+ TRACE_EXIT(-1,0);
373452 }
374453
375454 ULONG WINAPI glDirect3DViewport2::AddRef()
376455 {
377 - if(!this) return 0;
 456+ TRACE_ENTER(1,14,this);
 457+ if(!this) TRACE_RET(8,0);
378458 refcount++;
 459+ TRACE_EXIT(8,refcount);
379460 return refcount;
380461 }
381462
382463 ULONG WINAPI glDirect3DViewport2::Release()
383464 {
384 - if(!this) return 0;
 465+ TRACE_ENTER(1,14,this);
 466+ if(!this) TRACE_RET(8,0);
385467 ULONG ret;
386468 refcount--;
387469 ret = refcount;
388470 if(refcount == 0) delete this;
 471+ TRACE_ENTER(8,ret);
389472 return ret;
390473 }
391474
392475 HRESULT WINAPI glDirect3DViewport2::QueryInterface(REFIID riid, void** ppvObj)
393476 {
394 - if(!this) return DDERR_INVALIDOBJECT;
 477+ TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
 478+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
395479 if(riid == IID_IUnknown)
396480 {
397481 this->AddRef();
398482 *ppvObj = this;
 483+ TRACE_VAR("*ppvObj",14,*ppvObj);
 484+ TRACE_EXIT(23,D3D_OK);
399485 return D3D_OK;
400486 }
401 - return glD3DV3->QueryInterface(riid,ppvObj);
 487+ TRACE_RET(23,glD3DV3->QueryInterface(riid,ppvObj));
402488 }
403489
404490 HRESULT WINAPI glDirect3DViewport2::AddLight(LPDIRECT3DLIGHT lpLight)
405491 {
406 - if(!this) return DDERR_INVALIDOBJECT;
407 - return glD3DV3->AddLight(lpLight);
 492+ TRACE_ENTER(2,14,this,14,lpLight);
 493+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 494+ TRACE_RET(23,glD3DV3->AddLight(lpLight));
408495 }
409496 HRESULT WINAPI glDirect3DViewport2::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
410497 {
411 - if(!this) return DDERR_INVALIDOBJECT;
412 - return glD3DV3->Clear(dwCount,lpRects,dwFlags);
 498+ TRACE_ENTER(4,14,this,9,dwCount,14,lpRects,9,dwFlags);
 499+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 500+ TRACE_RET(23,glD3DV3->Clear(dwCount,lpRects,dwFlags));
413501 }
414502 HRESULT WINAPI glDirect3DViewport2::DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight)
415503 {
416 - if(!this) return DDERR_INVALIDOBJECT;
417 - return glD3DV3->DeleteLight(lpDirect3DLight);
 504+ TRACE_ENTER(2,14,this,14,lpDirect3DLight);
 505+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 506+ TRACE_RET(23,glD3DV3->DeleteLight(lpDirect3DLight));
418507 }
419508 HRESULT WINAPI glDirect3DViewport2::GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
420509 {
421 - if(!this) return DDERR_INVALIDOBJECT;
422 - return glD3DV3->GetBackground(lphMat,lpValid);
 510+ TRACE_ENTER(3,14,this,14,lphMat,14,lpValid);
 511+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 512+ TRACE_RET(23,glD3DV3->GetBackground(lphMat,lpValid));
423513 }
424514 HRESULT WINAPI glDirect3DViewport2::GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
425515 {
426 - if(!this) return DDERR_INVALIDOBJECT;
427 - return glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid);
 516+ TRACE_ENTER(3,14,this,14,lplpDDSurface,14,lpValid);
 517+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 518+ TRACE_RET(23,glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid));
428519 }
429520 HRESULT WINAPI glDirect3DViewport2::GetViewport(LPD3DVIEWPORT lpData)
430521 {
431 - if(!this) return DDERR_INVALIDOBJECT;
432 - return glD3DV3->GetViewport(lpData);
 522+ TRACE_ENTER(2,14,this,14,lpData);
 523+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 524+ TRACE_RET(23,glD3DV3->GetViewport(lpData));
433525 }
434526 HRESULT WINAPI glDirect3DViewport2::GetViewport2(LPD3DVIEWPORT2 lpData)
435527 {
436 - if(!this) return DDERR_INVALIDOBJECT;
437 - return glD3DV3->GetViewport2(lpData);
 528+ TRACE_ENTER(2,14,this,14,lpData);
 529+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 530+ TRACE_RET(23,glD3DV3->GetViewport2(lpData));
438531 }
439532 HRESULT WINAPI glDirect3DViewport2::Initialize(LPDIRECT3D lpDirect3D)
440533 {
441 - if(!this) return DDERR_INVALIDOBJECT;
442 - return glD3DV3->Initialize(lpDirect3D);
 534+ TRACE_ENTER(2,14,this,14,lpDirect3D);
 535+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 536+ TRACE_RET(23,glD3DV3->Initialize(lpDirect3D));
443537 }
444538 HRESULT WINAPI glDirect3DViewport2::LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData)
445539 {
446 - if(!this) return DDERR_INVALIDOBJECT;
447 - return glD3DV3->LightElements(dwElementCount,lpData);
 540+ TRACE_ENTER(3,14,this,8,dwElementCount,14,lpData);
 541+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 542+ TRACE_RET(23,glD3DV3->LightElements(dwElementCount,lpData));
448543 }
449544 HRESULT WINAPI glDirect3DViewport2::NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
450545 {
451 - if(!this) return DDERR_INVALIDOBJECT;
452 - return glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags);
 546+ TRACE_ENTER(4,14,this,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
 547+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 548+ TRACE_RET(23,glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags));
453549 }
454550 HRESULT WINAPI glDirect3DViewport2::SetBackground(D3DMATERIALHANDLE hMat)
455551 {
456 - if(!this) return DDERR_INVALIDOBJECT;
457 - return glD3DV3->SetBackground(hMat);
 552+ TRACE_ENTER(2,14,this,9,hMat);
 553+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 554+ TRACE_RET(23,glD3DV3->SetBackground(hMat));
458555 }
459556 HRESULT WINAPI glDirect3DViewport2::SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface)
460557 {
461 - if(!this) return DDERR_INVALIDOBJECT;
462 - return glD3DV3->SetBackgroundDepth(lpDDSurface);
 558+ TRACE_ENTER(2,14,this,14,lpDDSurface);
 559+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 560+ TRACE_RET(23,glD3DV3->SetBackgroundDepth(lpDDSurface));
463561 }
464562 HRESULT WINAPI glDirect3DViewport2::SetViewport(LPD3DVIEWPORT lpData)
465563 {
466 - if(!this) return DDERR_INVALIDOBJECT;
467 - return glD3DV3->SetViewport(lpData);
 564+ TRACE_ENTER(2,14,this,14,lpData);
 565+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 566+ TRACE_RET(23,glD3DV3->SetViewport(lpData));
468567 }
469568 HRESULT WINAPI glDirect3DViewport2::SetViewport2(LPD3DVIEWPORT2 lpData)
470569 {
471 - if(!this) return DDERR_INVALIDOBJECT;
472 - return glD3DV3->SetViewport2(lpData);
 570+ TRACE_ENTER(2,14,this,14,lpData);
 571+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 572+ TRACE_RET(23,glD3DV3->SetViewport2(lpData));
473573 }
474574 HRESULT WINAPI glDirect3DViewport2::TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
475575 {
476 - if(!this) return DDERR_INVALIDOBJECT;
477 - return glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen);
 576+ TRACE_ENTER(5,14,this,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
 577+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 578+ TRACE_RET(23,glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen));
478579 }
479580
480581
481582 glDirect3DViewport1::glDirect3DViewport1(glDirect3DViewport3 *glD3DV3)
482583 {
 584+ TRACE_ENTER(2,14,this,14,glD3DV3);
483585 this->glD3DV3 = glD3DV3;
484586 refcount = 1;
 587+ TRACE_EXIT(-1,0);
485588 }
486589
487590 glDirect3DViewport1::~glDirect3DViewport1()
488591 {
 592+ TRACE_ENTER(1,14,this);
489593 glD3DV3->glD3DV1 = NULL;
490594 glD3DV3->Release();
 595+ TRACE_EXIT(-1,0);
491596 }
492597
493598 ULONG WINAPI glDirect3DViewport1::AddRef()
494599 {
495 - if(!this) return 0;
 600+ TRACE_ENTER(1,14,this);
 601+ if(!this) TRACE_RET(8,0);
496602 refcount++;
 603+ TRACE_EXIT(8,refcount);
497604 return refcount;
498605 }
499606
500607 ULONG WINAPI glDirect3DViewport1::Release()
501608 {
502 - if(!this) return 0;
 609+ TRACE_ENTER(1,14,this);
 610+ if(!this) TRACE_RET(8,0);
503611 ULONG ret;
504612 refcount--;
505613 ret = refcount;
506614 if(refcount == 0) delete this;
 615+ TRACE_EXIT(8,ret);
507616 return ret;
508617 }
509618
510619 HRESULT WINAPI glDirect3DViewport1::QueryInterface(REFIID riid, void** ppvObj)
511620 {
512 - if(!this) return DDERR_INVALIDOBJECT;
 621+ TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
 622+ TRACE_EXIT(-1,0);
513623 if(riid == IID_IUnknown)
514624 {
515625 this->AddRef();
516626 *ppvObj = this;
 627+ TRACE_VAR("*ppvObj",14,*ppvObj);
 628+ TRACE_EXIT(23,D3D_OK);
517629 return D3D_OK;
518630 }
519 - return glD3DV3->QueryInterface(riid,ppvObj);
 631+ TRACE_RET(23,glD3DV3->QueryInterface(riid,ppvObj));
520632 }
521633
522634 HRESULT WINAPI glDirect3DViewport1::AddLight(LPDIRECT3DLIGHT lpLight)
523635 {
524 - if(!this) return DDERR_INVALIDOBJECT;
525 - return glD3DV3->AddLight(lpLight);
 636+ TRACE_ENTER(2,14,this,14,lpLight);
 637+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 638+ TRACE_RET(23,glD3DV3->AddLight(lpLight));
526639 }
527640 HRESULT WINAPI glDirect3DViewport1::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags)
528641 {
529 - if(!this) return DDERR_INVALIDOBJECT;
530 - return glD3DV3->Clear(dwCount,lpRects,dwFlags);
 642+ TRACE_ENTER(4,14,this,8,dwCount,14,lpRects,9,dwFlags);
 643+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 644+ TRACE_RET(23,glD3DV3->Clear(dwCount,lpRects,dwFlags));
531645 }
532646 HRESULT WINAPI glDirect3DViewport1::DeleteLight(LPDIRECT3DLIGHT lpDirect3DLight)
533647 {
534 - if(!this) return DDERR_INVALIDOBJECT;
535 - return glD3DV3->DeleteLight(lpDirect3DLight);
 648+ TRACE_ENTER(2,14,this,14,lpDirect3DLight);
 649+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 650+ TRACE_RET(23,glD3DV3->DeleteLight(lpDirect3DLight));
536651 }
537652 HRESULT WINAPI glDirect3DViewport1::GetBackground(LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid)
538653 {
539 - if(!this) return DDERR_INVALIDOBJECT;
540 - return glD3DV3->GetBackground(lphMat,lpValid);
 654+ TRACE_ENTER(3,14,this,14,lphMat,14,lpValid);
 655+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 656+ TRACE_RET(23,glD3DV3->GetBackground(lphMat,lpValid));
541657 }
542658 HRESULT WINAPI glDirect3DViewport1::GetBackgroundDepth(LPDIRECTDRAWSURFACE* lplpDDSurface, LPBOOL lpValid)
543659 {
544 - if(!this) return DDERR_INVALIDOBJECT;
545 - return glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid);
 660+ TRACE_ENTER(3,14,this,14,lplpDDSurface,14,lpValid);
 661+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 662+ TRACE_RET(23,glD3DV3->GetBackgroundDepth(lplpDDSurface,lpValid));
546663 }
547664 HRESULT WINAPI glDirect3DViewport1::GetViewport(LPD3DVIEWPORT lpData)
548665 {
549 - if(!this) return DDERR_INVALIDOBJECT;
550 - return glD3DV3->GetViewport(lpData);
 666+ TRACE_ENTER(2,14,this,14,lpData);
 667+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 668+ TRACE_RET(23,glD3DV3->GetViewport(lpData));
551669 }
552670 HRESULT WINAPI glDirect3DViewport1::Initialize(LPDIRECT3D lpDirect3D)
553671 {
554 - if(!this) return DDERR_INVALIDOBJECT;
555 - return glD3DV3->Initialize(lpDirect3D);
 672+ TRACE_ENTER(2,14,this,14,lpDirect3D);
 673+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 674+ TRACE_RET(23,glD3DV3->Initialize(lpDirect3D));
556675 }
557676 HRESULT WINAPI glDirect3DViewport1::LightElements(DWORD dwElementCount, LPD3DLIGHTDATA lpData)
558677 {
559 - if(!this) return DDERR_INVALIDOBJECT;
 678+ TRACE_ENTER(3,14,this,8,dwElementCount,14,lpData);
 679+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
560680 return glD3DV3->LightElements(dwElementCount,lpData);
561681 }
562682 HRESULT WINAPI glDirect3DViewport1::NextLight(LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT* lplpDirect3DLight, DWORD dwFlags)
563683 {
564 - if(!this) return DDERR_INVALIDOBJECT;
565 - return glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags);
 684+ TRACE_ENTER(4,14,this,14,lpDirect3DLight,14,lplpDirect3DLight,9,dwFlags);
 685+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 686+ TRACE_RET(23,glD3DV3->NextLight(lpDirect3DLight,lplpDirect3DLight,dwFlags));
566687 }
567688 HRESULT WINAPI glDirect3DViewport1::SetBackground(D3DMATERIALHANDLE hMat)
568689 {
569 - if(!this) return DDERR_INVALIDOBJECT;
570 - return glD3DV3->SetBackground(hMat);
 690+ TRACE_ENTER(2,14,this,9,hMat);
 691+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 692+ TRACE_RET(23,glD3DV3->SetBackground(hMat));
571693 }
572694 HRESULT WINAPI glDirect3DViewport1::SetBackgroundDepth(LPDIRECTDRAWSURFACE lpDDSurface)
573695 {
574 - if(!this) return DDERR_INVALIDOBJECT;
575 - return glD3DV3->SetBackgroundDepth(lpDDSurface);
 696+ TRACE_ENTER(2,14,this,14,lpDDSurface);
 697+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 698+ TRACE_RET(23,glD3DV3->SetBackgroundDepth(lpDDSurface));
576699 }
577700 HRESULT WINAPI glDirect3DViewport1::SetViewport(LPD3DVIEWPORT lpData)
578701 {
579 - if(!this) return DDERR_INVALIDOBJECT;
580 - return glD3DV3->SetViewport(lpData);
 702+ TRACE_ENTER(2,14,this,14,lpData);
 703+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 704+ TRACE_RET(23,glD3DV3->SetViewport(lpData));
581705 }
582706 HRESULT WINAPI glDirect3DViewport1::TransformVertices(DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffscreen)
583707 {
584 - if(!this) return DDERR_INVALIDOBJECT;
585 - return glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen);
 708+ TRACE_ENTER(5,14,this,8,dwVertexCount,14,lpData,9,dwFlags,14,lpOffscreen);
 709+ if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
 710+ TRACE_RET(23,glD3DV3->TransformVertices(dwVertexCount,lpData,dwFlags,lpOffscreen));
586711 }