Index: ddraw/glDirectDrawPalette.cpp |
— | — | @@ -90,6 +90,7 @@ |
91 | 91 |
|
92 | 92 | glDirectDrawPalette::glDirectDrawPalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
93 | 93 | {
|
| 94 | + TRACE_ENTER(4,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette);
|
94 | 95 | refcount = 1;
|
95 | 96 | flags = dwFlags;
|
96 | 97 | if(lpDDColorArray == NULL) memcpy(palette,DefaultPalette,1024);
|
— | — | @@ -107,51 +108,67 @@ |
108 | 109 | else memcpy(palette,lpDDColorArray,256*sizeof(PALETTEENTRY));
|
109 | 110 | }
|
110 | 111 | if(lplpDDPalette) *lplpDDPalette = this;
|
| 112 | + TRACE_EXIT(-1,0);
|
111 | 113 | }
|
112 | 114 |
|
113 | 115 | glDirectDrawPalette::~glDirectDrawPalette()
|
114 | 116 | {
|
| 117 | + TRACE_ENTER(1,14,this);
|
| 118 | + TRACE_EXIT(-1,0);
|
115 | 119 | }
|
116 | 120 |
|
117 | 121 | HRESULT WINAPI glDirectDrawPalette::QueryInterface(REFIID riid, void** ppvObj)
|
118 | 122 | {
|
119 | | - if(!this) return DDERR_INVALIDPARAMS;
|
120 | | - if(!ppvObj) return DDERR_INVALIDPARAMS;
|
| 123 | + TRACE_ENTER(3,14,this,24,&riid,14,ppvObj);
|
| 124 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 125 | + if(!ppvObj) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
121 | 126 | if(riid == IID_IUnknown)
|
122 | 127 | {
|
123 | 128 | this->AddRef();
|
124 | 129 | *ppvObj = this;
|
| 130 | + TRACE_VAR("*ppvObj",14,*ppvObj);
|
| 131 | + TRACE_EXIT(23,DD_OK);
|
125 | 132 | return DD_OK;
|
126 | 133 | }
|
| 134 | + TRACE_EXIT(23,E_NOINTERFACE);
|
127 | 135 | ERR(E_NOINTERFACE);
|
128 | 136 | }
|
129 | 137 |
|
130 | 138 | ULONG WINAPI glDirectDrawPalette::AddRef()
|
131 | 139 | {
|
| 140 | + TRACE_ENTER(1,14,this);
|
132 | 141 | if(!this) return 0;
|
133 | 142 | refcount++;
|
| 143 | + TRACE_EXIT(8,refcount);
|
134 | 144 | return refcount;
|
135 | 145 | }
|
136 | 146 |
|
137 | 147 | ULONG WINAPI glDirectDrawPalette::Release()
|
138 | 148 | {
|
| 149 | + TRACE_ENTER(1,14,this);
|
139 | 150 | if(!this) return 0;
|
140 | 151 | ULONG ret;
|
141 | 152 | refcount--;
|
142 | 153 | ret = refcount;
|
143 | 154 | if(refcount == 0) delete this;
|
| 155 | + TRACE_EXIT(8,ret);
|
144 | 156 | return ret;
|
145 | 157 | }
|
146 | 158 |
|
147 | 159 | HRESULT WINAPI glDirectDrawPalette::GetCaps(LPDWORD lpdwCaps)
|
148 | 160 | {
|
149 | | - if(!this) return DDERR_INVALIDPARAMS;
|
150 | | - return flags;
|
| 161 | + TRACE_ENTER(2,14,this,14,lpdwCaps);
|
| 162 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 163 | + *lpdwCaps = flags;
|
| 164 | + TRACE_VAR("*lpdwCaps",9,*lpdwCaps);
|
| 165 | + TRACE_EXIT(23,DD_OK);
|
| 166 | + return DD_OK;
|
151 | 167 | }
|
152 | 168 |
|
153 | 169 | HRESULT WINAPI glDirectDrawPalette::GetEntries(DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries)
|
154 | 170 | {
|
155 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 171 | + TRACE_ENTER(5,14,this,9,dwFlags,8,dwBase,8,dwNumEntries,14,lpEntries);
|
| 172 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
156 | 173 | DWORD allentries = 256;
|
157 | 174 | DWORD entrysize;
|
158 | 175 | if(flags & DDPCAPS_1BIT) allentries=2;
|
— | — | @@ -160,18 +177,22 @@ |
161 | 178 | if(flags & DDPCAPS_8BIT) allentries=256;
|
162 | 179 | if(flags & DDPCAPS_8BITENTRIES) entrysize = 1;
|
163 | 180 | else entrysize = sizeof(PALETTEENTRY);
|
164 | | - if((dwBase + dwNumEntries) > allentries) ERR(DDERR_INVALIDPARAMS);
|
| 181 | + if((dwBase + dwNumEntries) > allentries) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
165 | 182 | memcpy(lpEntries,((char *)palette)+(dwBase*entrysize),dwNumEntries*entrysize);
|
| 183 | + TRACE_EXIT(23,DD_OK);
|
166 | 184 | return DD_OK;
|
167 | 185 | }
|
168 | 186 | HRESULT WINAPI glDirectDrawPalette::Initialize(LPDIRECTDRAW lpDD, DWORD dwFlags, LPPALETTEENTRY lpDDColorTable)
|
169 | 187 | {
|
170 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 188 | + TRACE_ENTER(4,14,this,14,lpDD,9,dwFlags,14,lpDDColorTable);
|
| 189 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
| 190 | + TRACE_EXIT(23,DDERR_ALREADYINITIALIZED);
|
171 | 191 | return DDERR_ALREADYINITIALIZED;
|
172 | 192 | }
|
173 | 193 | HRESULT WINAPI glDirectDrawPalette::SetEntries(DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries)
|
174 | 194 | {
|
175 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 195 | + TRACE_ENTER(5,14,this,9,dwFlags,8,dwStartingEntry,8,dwCount,14,lpEntries);
|
| 196 | + if(!this) TRACE_RET(23,DDERR_INVALIDOBJECT);
|
176 | 197 | DWORD allentries = 256;
|
177 | 198 | DWORD entrysize;
|
178 | 199 | if(flags & DDPCAPS_1BIT) allentries=2;
|
— | — | @@ -180,13 +201,20 @@ |
181 | 202 | if(flags & DDPCAPS_8BIT) allentries=256;
|
182 | 203 | if(flags & DDPCAPS_8BITENTRIES) entrysize = 1;
|
183 | 204 | else entrysize = sizeof(PALETTEENTRY);
|
184 | | - if((dwStartingEntry + dwCount) > allentries) ERR(DDERR_INVALIDPARAMS);
|
| 205 | + if((dwStartingEntry + dwCount) > allentries) TRACE_RET(23,DDERR_INVALIDPARAMS);
|
185 | 206 | memcpy(((char *)palette)+(dwStartingEntry*entrysize),lpEntries,dwCount*entrysize);
|
| 207 | + TRACE_EXIT(23,DD_OK);
|
186 | 208 | return DD_OK;
|
187 | 209 | }
|
188 | 210 |
|
189 | 211 | LPPALETTEENTRY glDirectDrawPalette::GetPalette(DWORD *flags)
|
190 | 212 | {
|
191 | | - if(flags) *flags = this->flags;
|
| 213 | + TRACE_ENTER(2,14,this,14,flags);
|
| 214 | + if(flags)
|
| 215 | + {
|
| 216 | + *flags = this->flags;
|
| 217 | + TRACE_VAR("*flags",9,*flags);
|
| 218 | + }
|
| 219 | + TRACE_RET(14,palette);
|
192 | 220 | return palette;
|
193 | 221 | }
|
Index: ddraw/glDirectDrawPalette.h |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | HRESULT WINAPI SetEntries(DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries);
|
36 | 36 |
|
37 | 37 | // Internal function
|
38 | | - LPPALETTEENTRY GetPalette(DWORD *flags);
|
| 38 | + //LPPALETTEENTRY GetPalette(DWORD *flags);
|
39 | 39 | private:
|
40 | 40 | PALETTEENTRY palette[256];
|
41 | 41 | DWORD flags;
|