Index: ddraw/glDirect3DLight.cpp |
— | — | @@ -28,6 +28,7 @@ |
29 | 29 |
|
30 | 30 | glDirect3DLight::glDirect3DLight()
|
31 | 31 | {
|
| 32 | + TRACE_ENTER(1,14,this);
|
32 | 33 | refcount=1;
|
33 | 34 | viewport = NULL;
|
34 | 35 | device = NULL;
|
— | — | @@ -35,66 +36,85 @@ |
36 | 37 | light.dltType = D3DLIGHT_DIRECTIONAL;
|
37 | 38 | light.dcvAmbient.r = light.dcvAmbient.g = light.dcvAmbient.b = 1.0f;
|
38 | 39 | light.dvDirection = D3DVECTOR(0,0,1.0);
|
| 40 | + TRACE_EXIT(-1,0);
|
39 | 41 | }
|
40 | 42 | glDirect3DLight::glDirect3DLight(D3DLIGHT7 *light_in)
|
41 | 43 | {
|
| 44 | + TRACE_ENTER(2,14,this,14,light_in);
|
42 | 45 | refcount=1;
|
43 | 46 | memcpy(&light,light_in,sizeof(D3DLIGHT7));
|
| 47 | + TRACE_EXIT(-1,0);
|
44 | 48 | }
|
45 | 49 |
|
46 | 50 | glDirect3DLight::~glDirect3DLight()
|
47 | 51 | {
|
| 52 | + TRACE_ENTER(1,14,this);
|
| 53 | + TRACE_EXIT(-1,0);
|
48 | 54 | }
|
49 | 55 |
|
50 | 56 | ULONG WINAPI glDirect3DLight::AddRef()
|
51 | 57 | {
|
52 | | - if(!this) return 0;
|
| 58 | + TRACE_ENTER(1,14,this);
|
| 59 | + if(!this) TRACE_RET(8,0);
|
53 | 60 | refcount++;
|
| 61 | + TRACE_EXIT(8,refcount);
|
54 | 62 | return refcount;
|
55 | 63 | }
|
56 | 64 | ULONG WINAPI glDirect3DLight::Release()
|
57 | 65 | {
|
58 | | - if(!this) return 0;
|
| 66 | + TRACE_ENTER(1,14,this);
|
| 67 | + if(!this) TRACE_RET(8,0);
|
59 | 68 | ULONG ret;
|
60 | 69 | refcount--;
|
61 | 70 | ret = refcount;
|
62 | 71 | if(refcount == 0) delete this;
|
| 72 | + TRACE_EXIT(8,ret);
|
63 | 73 | return ret;
|
64 | 74 | }
|
65 | 75 |
|
66 | 76 | HRESULT WINAPI glDirect3DLight::Initialize(LPDIRECT3D lpDirect3D)
|
67 | 77 | {
|
68 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 78 | + TRACE_ENTER(2,14,this,14,lpDirect3D);
|
| 79 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 80 | + TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
|
69 | 81 | return DDERR_ALREADYINITIALIZED;
|
70 | 82 | }
|
71 | 83 |
|
72 | 84 | HRESULT WINAPI glDirect3DLight::QueryInterface(REFIID riid, void** ppvObj)
|
73 | | -{
|
74 | | - if(!this) return DDERR_INVALIDPARAMS;
|
75 | | - if(!ppvObj) return DDERR_INVALIDPARAMS;
|
| 85 | +{TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
| 86 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 87 | + if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
76 | 88 | if(riid == IID_IUnknown)
|
77 | 89 | {
|
78 | 90 | this->AddRef();
|
79 | 91 | *ppvObj = this;
|
| 92 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 93 | + TRACE_EXIT(23,D3D_OK);
|
80 | 94 | return D3D_OK;
|
81 | 95 | }
|
| 96 | + TRACE_EXIT(23,E_NOINTERFACE);
|
82 | 97 | return E_NOINTERFACE;
|
83 | 98 | }
|
84 | 99 |
|
85 | 100 | void glDirect3DLight::GetLight7(LPD3DLIGHT7 lpLight7)
|
86 | 101 | {
|
| 102 | + TRACE_ENTER(2,14,this,14,lpLight7);
|
87 | 103 | memcpy(lpLight7,&light,sizeof(D3DLIGHT7));
|
| 104 | + TRACE_EXIT(0,0);
|
88 | 105 | }
|
89 | 106 | void glDirect3DLight::SetLight7(LPD3DLIGHT7 lpLight7)
|
90 | 107 | {
|
| 108 | + TRACE_ENTER(2,14,this,14,lpLight7);
|
91 | 109 | memcpy(&light,lpLight7,sizeof(D3DLIGHT7));
|
| 110 | + TRACE_EXIT(0,0);
|
92 | 111 | }
|
93 | 112 |
|
94 | 113 | HRESULT WINAPI glDirect3DLight::GetLight(LPD3DLIGHT lpLight)
|
95 | 114 | {
|
96 | | - if(!this) return DDERR_INVALIDPARAMS;
|
97 | | - if(!lpLight) return DDERR_INVALIDPARAMS;
|
98 | | - if(lpLight->dwSize < sizeof(D3DLIGHT)) return DDERR_INVALIDPARAMS;
|
| 115 | + TRACE_ENTER(2,14,this,14,lpLight);
|
| 116 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 117 | + if(!lpLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 118 | + if(lpLight->dwSize < sizeof(D3DLIGHT)) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
99 | 119 | lpLight->dltType = light.dltType;
|
100 | 120 | lpLight->dcvColor = light.dcvDiffuse;
|
101 | 121 | lpLight->dvPosition = light.dvPosition;
|
— | — | @@ -106,13 +126,15 @@ |
107 | 127 | lpLight->dvAttenuation2 = light.dvAttenuation2;
|
108 | 128 | lpLight->dvTheta = light.dvTheta;
|
109 | 129 | lpLight->dvPhi = light.dvPhi;
|
| 130 | + TRACE_EXIT(23,D3D_OK);
|
110 | 131 | return D3D_OK;
|
111 | 132 | }
|
112 | 133 | HRESULT WINAPI glDirect3DLight::SetLight(LPD3DLIGHT lpLight)
|
113 | 134 | {
|
114 | | - if(!this) return DDERR_INVALIDPARAMS;
|
115 | | - if(!lpLight) return DDERR_INVALIDPARAMS;
|
116 | | - if(lpLight->dwSize < sizeof(D3DLIGHT)) return DDERR_INVALIDPARAMS;
|
| 135 | + TRACE_ENTER(2,14,this,14,lpLight);
|
| 136 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 137 | + if(!lpLight) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 138 | + if(lpLight->dwSize < sizeof(D3DLIGHT)) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
117 | 139 | light.dltType = lpLight->dltType;
|
118 | 140 | light.dcvDiffuse = lpLight->dcvColor;
|
119 | 141 | light.dcvAmbient.r = light.dcvAmbient.g = light.dcvAmbient.b = light.dcvAmbient.a = 0;
|
— | — | @@ -137,18 +159,27 @@ |
138 | 160 | }
|
139 | 161 | else device->LightEnable(index,FALSE);
|
140 | 162 | }
|
| 163 | + TRACE_EXIT(23,D3D_OK);
|
141 | 164 | return D3D_OK;
|
142 | 165 | }
|
143 | 166 |
|
144 | 167 | void glDirect3DLight::SetDevice(glDirect3DDevice7 *device, int index)
|
145 | 168 | {
|
| 169 | + TRACE_ENTER(3,14,this,14,device,11,index);
|
146 | 170 | this->device = device;
|
147 | 171 | this->index = index;
|
| 172 | + TRACE_EXIT(0,0);
|
148 | 173 | }
|
149 | 174 |
|
150 | 175 | void glDirect3DLight::Sync()
|
151 | 176 | {
|
152 | | - if(!this) return;
|
| 177 | + TRACE_ENTER(1,14,this);
|
| 178 | + if(!this)
|
| 179 | + {
|
| 180 | + TRACE_EXIT(0,0);
|
| 181 | + return;
|
| 182 | + }
|
153 | 183 | device->SetLight(index,&light);
|
154 | 184 | device->LightEnable(index,TRUE);
|
| 185 | + TRACE_EXIT(0,0);
|
155 | 186 | } |
\ No newline at end of file |