Index: ddraw/glDirect3DExecuteBuffer.cpp |
— | — | @@ -20,6 +20,7 @@ |
21 | 21 |
|
22 | 22 | glDirect3DExecuteBuffer::glDirect3DExecuteBuffer(LPD3DEXECUTEBUFFERDESC lpDesc)
|
23 | 23 | {
|
| 24 | + TRACE_ENTER(2,14,this,14,lpDesc);
|
24 | 25 | locked = false;
|
25 | 26 | inuse = false;
|
26 | 27 | data = NULL;
|
— | — | @@ -31,48 +32,60 @@ |
32 | 33 | }
|
33 | 34 | ZeroMemory(&datadesc,sizeof(D3DEXECUTEDATA));
|
34 | 35 | datadesc.dwSize = sizeof(D3DEXECUTEDATA);
|
| 36 | + TRACE_EXIT(-1,0);
|
35 | 37 | }
|
36 | 38 | glDirect3DExecuteBuffer::~glDirect3DExecuteBuffer()
|
37 | 39 | {
|
| 40 | + TRACE_ENTER(1,14,this);
|
38 | 41 | if(data) free(data);
|
| 42 | + TRACE_EXIT(-1,0);
|
39 | 43 | }
|
40 | 44 |
|
41 | 45 | HRESULT WINAPI glDirect3DExecuteBuffer::QueryInterface(REFIID riid, void** ppvObj)
|
42 | 46 | {
|
43 | | - if(!this) return DDERR_INVALIDOBJECT;
|
| 47 | + TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
| 48 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
44 | 49 | if((riid == IID_IUnknown) || (riid == IID_IDirect3DExecuteBuffer))
|
45 | 50 | {
|
46 | 51 | this->AddRef();
|
47 | 52 | *ppvObj = this;
|
| 53 | + TRACE_EXIT(23,D3D_OK);
|
48 | 54 | return D3D_OK;
|
49 | 55 | }
|
| 56 | + TRACE_EXIT(23,E_NOINTERFACE);
|
50 | 57 | return E_NOINTERFACE;
|
51 | 58 | }
|
52 | 59 |
|
53 | 60 | ULONG WINAPI glDirect3DExecuteBuffer::AddRef()
|
54 | 61 | {
|
55 | | - if(!this) return 0;
|
| 62 | + TRACE_ENTER(1,14,this);
|
| 63 | + if(!this) TRACE_RET(8,0);
|
56 | 64 | refcount++;
|
| 65 | + TRACE_EXIT(8,refcount);
|
57 | 66 | return refcount;
|
58 | 67 | }
|
59 | 68 |
|
60 | 69 | ULONG WINAPI glDirect3DExecuteBuffer::Release()
|
61 | 70 | {
|
62 | | - if(!this) return 0;
|
| 71 | + TRACE_ENTER(1,14,this);
|
| 72 | + if(!this) TRACE_RET(8,0);
|
63 | 73 | ULONG ret;
|
64 | 74 | refcount--;
|
65 | 75 | ret = refcount;
|
66 | 76 | if(refcount == 0) delete this;
|
| 77 | + TRACE_EXIT(8,ret);
|
67 | 78 | return ret;
|
68 | 79 | }
|
69 | 80 |
|
70 | 81 | HRESULT WINAPI glDirect3DExecuteBuffer::GetExecuteData(LPD3DEXECUTEDATA lpData)
|
71 | 82 | {
|
72 | | - if(!this) return DDERR_INVALIDOBJECT;
|
73 | | - if(!lpData) return DDERR_INVALIDPARAMS;
|
74 | | - if(locked) return D3DERR_EXECUTE_LOCKED;
|
75 | | - if(lpData->dwSize < sizeof(D3DEXECUTEDATA)) return DDERR_INVALIDPARAMS;
|
| 83 | + TRACE_ENTER(2,14,this,14,lpData);
|
| 84 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 85 | + if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 86 | + if(locked) TRACE_RET(23,D3DERR_EXECUTE_LOCKED);
|
| 87 | + if(lpData->dwSize < sizeof(D3DEXECUTEDATA)) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
76 | 88 | memcpy(lpData,&datadesc,sizeof(D3DEXECUTEDATA));
|
| 89 | + TRACE_EXIT(23,D3D_OK);
|
77 | 90 | return D3D_OK;
|
78 | 91 | }
|
79 | 92 |
|
— | — | @@ -79,17 +92,20 @@ |
80 | 93 | HRESULT WINAPI glDirect3DExecuteBuffer::Initialize(LPDIRECT3DDEVICE lpDirect3DDevice,
|
81 | 94 | LPD3DEXECUTEBUFFERDESC lpDesc)
|
82 | 95 | {
|
83 | | - if(!this) return DDERR_INVALIDOBJECT;
|
| 96 | + TRACE_ENTER(3,14,this,14,lpDirect3DDevice,14,lpDesc);
|
| 97 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 98 | + TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
|
84 | 99 | return DDERR_ALREADYINITIALIZED;
|
85 | 100 | }
|
86 | 101 |
|
87 | 102 | HRESULT WINAPI glDirect3DExecuteBuffer::Lock(LPD3DEXECUTEBUFFERDESC lpDesc)
|
88 | 103 | {
|
89 | | - if(!this) return DDERR_INVALIDOBJECT;
|
90 | | - if(!lpDesc) return DDERR_INVALIDPARAMS;
|
91 | | - if(lpDesc->dwSize < sizeof(D3DEXECUTEBUFFERDESC)) return DDERR_INVALIDPARAMS;
|
92 | | - if(inuse) return DDERR_WASSTILLDRAWING;
|
93 | | - if(locked) return D3DERR_EXECUTE_LOCKED;
|
| 104 | + TRACE_ENTER(2,14,this,14,lpDesc);
|
| 105 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 106 | + if(!lpDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 107 | + if(lpDesc->dwSize < sizeof(D3DEXECUTEBUFFERDESC)) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 108 | + if(inuse) TRACE_RET(23,DDERR_WASSTILLDRAWING);
|
| 109 | + if(locked) TRACE_RET(23,D3DERR_EXECUTE_LOCKED);
|
94 | 110 | desc.dwCaps = lpDesc->dwCaps;
|
95 | 111 | desc.dwFlags |= D3DDEB_LPDATA;
|
96 | 112 | if(!data)
|
— | — | @@ -100,51 +116,61 @@ |
101 | 117 | desc.lpData = data;
|
102 | 118 | memcpy(lpDesc,&desc,sizeof(D3DEXECUTEBUFFERDESC));
|
103 | 119 | locked = true;
|
| 120 | + TRACE_EXIT(23,D3D_OK);
|
104 | 121 | return D3D_OK;
|
105 | 122 | }
|
106 | 123 |
|
107 | 124 | HRESULT WINAPI glDirect3DExecuteBuffer::Optimize(DWORD dwDummy)
|
108 | 125 | {
|
109 | | - if(!this) return DDERR_INVALIDOBJECT;
|
| 126 | + TRACE_ENTER(2,14,this,9,dwDummy);
|
| 127 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 128 | + TRACE_EXIT(23,DDERR_UNSUPPORTED);
|
110 | 129 | return DDERR_UNSUPPORTED;
|
111 | 130 | }
|
112 | 131 |
|
113 | 132 | HRESULT WINAPI glDirect3DExecuteBuffer::SetExecuteData(LPD3DEXECUTEDATA lpData)
|
114 | 133 | {
|
115 | | - if(!this) return DDERR_INVALIDOBJECT;
|
116 | | - if(!lpData) return DDERR_INVALIDPARAMS;
|
117 | | - if(lpData->dwSize != sizeof(D3DEXECUTEDATA)) return DDERR_INVALIDPARAMS;
|
| 134 | + TRACE_ENTER(2,14,this,14,lpData);
|
| 135 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 136 | + if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 137 | + if(lpData->dwSize != sizeof(D3DEXECUTEDATA)) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
118 | 138 | memcpy(&datadesc,lpData,sizeof(D3DEXECUTEDATA));
|
| 139 | + TRACE_EXIT(23,D3D_OK);
|
119 | 140 | return D3D_OK;
|
120 | 141 | }
|
121 | 142 |
|
122 | 143 | HRESULT WINAPI glDirect3DExecuteBuffer::Unlock()
|
123 | 144 | {
|
124 | | - if(!this) return DDERR_INVALIDOBJECT;
|
125 | | - if(inuse) return D3DERR_EXECUTE_NOT_LOCKED;
|
126 | | - if(!locked) return D3DERR_EXECUTE_NOT_LOCKED;
|
| 145 | + TRACE_ENTER(1,14,this);
|
| 146 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 147 | + if(inuse) TRACE_RET(23,D3DERR_EXECUTE_NOT_LOCKED);
|
| 148 | + if(!locked) TRACE_RET(23,D3DERR_EXECUTE_NOT_LOCKED);
|
127 | 149 | locked = false;
|
| 150 | + TRACE_RET(23,D3D_OK);
|
128 | 151 | return D3D_OK;
|
129 | 152 | }
|
130 | 153 |
|
131 | 154 | HRESULT WINAPI glDirect3DExecuteBuffer::Validate(LPDWORD lpdwOffset, LPD3DVALIDATECALLBACK lpFunc, LPVOID lpUserArg, DWORD dwReserved)
|
132 | 155 | {
|
133 | | - if(!this) return DDERR_INVALIDOBJECT;
|
| 156 | + TRACE_ENTER(5,14,this,14,lpdwOffset,14,lpFunc,14,lpUserArg,9,dwReserved);
|
| 157 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 158 | + TRACE_EXIT(23,DDERR_UNSUPPORTED);
|
134 | 159 | return DDERR_UNSUPPORTED;
|
135 | 160 | }
|
136 | 161 |
|
137 | 162 | HRESULT glDirect3DExecuteBuffer::ExecuteLock(LPD3DEXECUTEBUFFERDESC lpDesc,LPD3DEXECUTEDATA lpData)
|
138 | 163 | {
|
139 | | - if(!this) return DDERR_INVALIDOBJECT;
|
140 | | - if(inuse) return DDERR_WASSTILLDRAWING;
|
141 | | - if(locked) return D3DERR_EXECUTE_LOCKED;
|
142 | | - if(!lpDesc) return DDERR_INVALIDPARAMS;
|
143 | | - if(!lpData) return DDERR_INVALIDPARAMS;
|
| 164 | + TRACE_ENTER(3,14,this,14,lpDesc,14,lpData);
|
| 165 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 166 | + if(inuse) TRACE_RET(23,DDERR_WASSTILLDRAWING);
|
| 167 | + if(locked) TRACE_RET(23,D3DERR_EXECUTE_LOCKED);
|
| 168 | + if(!lpDesc) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 169 | + if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
144 | 170 | desc.dwFlags |= D3DDEB_LPDATA;
|
145 | 171 | if(!data)
|
146 | 172 | {
|
147 | 173 | data = (unsigned char *)malloc(desc.dwBufferSize);
|
148 | | - if(!data) return DDERR_OUTOFMEMORY;
|
| 174 | + if(!data) TRACE_RET(23,DDERR_OUTOFMEMORY);
|
149 | 175 | }
|
150 | 176 | desc.lpData = data;
|
151 | 177 | memcpy(lpDesc,&desc,sizeof(D3DEXECUTEBUFFERDESC));
|
— | — | @@ -151,16 +177,19 @@ |
152 | 178 | memcpy(lpData,&datadesc,sizeof(D3DEXECUTEDATA));
|
153 | 179 | locked = true;
|
154 | 180 | inuse = true;
|
| 181 | + TRACE_EXIT(23,D3D_OK);
|
155 | 182 | return D3D_OK;
|
156 | 183 | }
|
157 | 184 |
|
158 | 185 | HRESULT glDirect3DExecuteBuffer::ExecuteUnlock(LPD3DEXECUTEDATA lpData)
|
159 | 186 | {
|
160 | | - if(!this) return DDERR_INVALIDOBJECT;
|
161 | | - if(!lpData) return DDERR_INVALIDPARAMS;
|
162 | | - if(!inuse) return D3DERR_EXECUTE_NOT_LOCKED;
|
| 187 | + TRACE_ENTER(2,14,this,14,lpData);
|
| 188 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 189 | + if(!lpData) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
| 190 | + if(!inuse) TRACE_RET(23,D3DERR_EXECUTE_NOT_LOCKED);
|
163 | 191 | inuse = false;
|
164 | 192 | locked = false;
|
165 | 193 | memcpy(&datadesc,lpData,sizeof(D3DEXECUTEDATA));
|
| 194 | + TRACE_RET(23,D3D_OK);
|
166 | 195 | return D3D_OK;
|
167 | 196 | } |
\ No newline at end of file |