Changeset 6648 for trunk/src/msvfw32/drawdib.c
- Timestamp:
- Sep 5, 2001, 3:19:02 PM (24 years ago)
- File:
-
- 1 edited
-
trunk/src/msvfw32/drawdib.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/msvfw32/drawdib.c
r6386 r6648 1 /* 1 /* $Id: drawdib.c,v 1.2 2001-09-05 13:12:34 bird Exp $ */ 2 /* 2 3 * Copyright 2000 Bradley Baetz 3 4 * … … 21 22 22 23 typedef struct { 23 HDC hdc;24 INT dxDst;25 INT dyDst;26 LPBITMAPINFOHEADER lpbi;27 INT dxSrc;28 INT dySrc;29 HPALETTE hpal;/* Palette to use for the DIB */30 BOOL begun;/* DrawDibBegin has been called */31 LPBITMAPINFOHEADER lpbiOut;/* Output format */32 HIC hic;/* HIC for decompression */33 HDC hMemDC;/* DC for buffering */34 HBITMAP hOldDib;/* Original Dib */35 HBITMAP hDib;/* DibSection */36 LPVOID lpvbits;/* Buffer for holding decompressed dib */24 HDC hdc; 25 INT dxDst; 26 INT dyDst; 27 LPBITMAPINFOHEADER lpbi; 28 INT dxSrc; 29 INT dySrc; 30 HPALETTE hpal; /* Palette to use for the DIB */ 31 BOOL begun; /* DrawDibBegin has been called */ 32 LPBITMAPINFOHEADER lpbiOut; /* Output format */ 33 HIC hic; /* HIC for decompression */ 34 HDC hMemDC; /* DC for buffering */ 35 HBITMAP hOldDib; /* Original Dib */ 36 HBITMAP hDib; /* DibSection */ 37 LPVOID lpvbits; /* Buffer for holding decompressed dib */ 37 38 } WINE_HDD; 38 39 … … 58 59 59 60 /*********************************************************************** 60 * DrawDibOpen[MSVFW32.@]61 * DrawDibOpen [MSVFW32.@] 61 62 */ 62 63 HDRAWDIB VFWAPI DrawDibOpen(void) { 63 HDRAWDIB hdd;64 65 TRACE("(void)\n");66 hdd = GlobalAlloc16(GHND,sizeof(WINE_HDD));67 TRACE("=> %d\n",hdd);68 return hdd;69 } 70 71 /*********************************************************************** 72 * DrawDibOpen[MSVIDEO.102]64 HDRAWDIB hdd; 65 66 TRACE("(void)\n"); 67 hdd = GlobalAlloc16(GHND,sizeof(WINE_HDD)); 68 TRACE("=> %d\n",hdd); 69 return hdd; 70 } 71 72 /*********************************************************************** 73 * DrawDibOpen [MSVIDEO.102] 73 74 */ 74 75 HDRAWDIB16 VFWAPI DrawDibOpen16(void) { 75 return (HDRAWDIB16)DrawDibOpen();76 } 77 78 /*********************************************************************** 79 * DrawDibClose[MSVFW32.@]76 return (HDRAWDIB16)DrawDibOpen(); 77 } 78 79 /*********************************************************************** 80 * DrawDibClose [MSVFW32.@] 80 81 */ 81 82 BOOL VFWAPI DrawDibClose(HDRAWDIB hdd) { 82 WINE_HDD *whdd = GlobalLock16(hdd);83 84 TRACE("(0x%08lx)\n",(DWORD)hdd);85 86 if (!whdd)87 return FALSE;88 89 if (whdd->begun)90 DrawDibEnd(hdd);91 92 GlobalUnlock16(hdd);93 GlobalFree16(hdd);94 return TRUE;95 } 96 97 /*********************************************************************** 98 * DrawDibClose[MSVIDEO.103]83 WINE_HDD *whdd = GlobalLock16(hdd); 84 85 TRACE("(0x%08lx)\n",(DWORD)hdd); 86 87 if (!whdd) 88 return FALSE; 89 90 if (whdd->begun) 91 DrawDibEnd(hdd); 92 93 GlobalUnlock16(hdd); 94 GlobalFree16(hdd); 95 return TRUE; 96 } 97 98 /*********************************************************************** 99 * DrawDibClose [MSVIDEO.103] 99 100 */ 100 101 BOOL16 VFWAPI DrawDibClose16(HDRAWDIB16 hdd) { 101 return DrawDibClose(hdd);102 } 103 104 /*********************************************************************** 105 * DrawDibEnd[MSVFW32.@]102 return DrawDibClose(hdd); 103 } 104 105 /*********************************************************************** 106 * DrawDibEnd [MSVFW32.@] 106 107 */ 107 108 BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd) { 108 BOOL ret = TRUE;109 WINE_HDD *whdd = GlobalLock16(hdd);110 111 TRACE("(0x%08lx)\n",(DWORD)hdd);112 113 whdd->hpal = 0; /* Do not free this */114 whdd->hdc = 0;115 if (whdd->lpbi) {116 HeapFree(GetProcessHeap(),0,whdd->lpbi);117 whdd->lpbi = NULL;118 }119 if (whdd->lpbiOut) {120 HeapFree(GetProcessHeap(),0,whdd->lpbiOut);121 whdd->lpbiOut = NULL;122 }123 124 whdd->begun = FALSE;125 126 /*if (whdd->lpvbits)127 HeapFree(GetProcessHeap(),0,whdd->lpvbuf);*/128 129 if (whdd->hMemDC) {130 SelectObject(whdd->hMemDC,whdd->hOldDib);131 DeleteDC(whdd->hMemDC);132 }133 134 if (whdd->hDib)135 DeleteObject(whdd->hDib);136 137 if (whdd->hic) {138 ICDecompressEnd(whdd->hic);139 ICClose(whdd->hic);140 }141 142 whdd->lpvbits = NULL;143 144 GlobalUnlock16(hdd);145 return ret;146 } 147 148 /*********************************************************************** 149 * DrawDibEnd[MSVIDEO.105]109 BOOL ret = TRUE; 110 WINE_HDD *whdd = GlobalLock16(hdd); 111 112 TRACE("(0x%08lx)\n",(DWORD)hdd); 113 114 whdd->hpal = 0; /* Do not free this */ 115 whdd->hdc = 0; 116 if (whdd->lpbi) { 117 HeapFree(GetProcessHeap(),0,whdd->lpbi); 118 whdd->lpbi = NULL; 119 } 120 if (whdd->lpbiOut) { 121 HeapFree(GetProcessHeap(),0,whdd->lpbiOut); 122 whdd->lpbiOut = NULL; 123 } 124 125 whdd->begun = FALSE; 126 127 /*if (whdd->lpvbits) 128 HeapFree(GetProcessHeap(),0,whdd->lpvbuf);*/ 129 130 if (whdd->hMemDC) { 131 SelectObject(whdd->hMemDC,whdd->hOldDib); 132 DeleteDC(whdd->hMemDC); 133 } 134 135 if (whdd->hDib) 136 DeleteObject(whdd->hDib); 137 138 if (whdd->hic) { 139 ICDecompressEnd(whdd->hic); 140 ICClose(whdd->hic); 141 } 142 143 whdd->lpvbits = NULL; 144 145 GlobalUnlock16(hdd); 146 return ret; 147 } 148 149 /*********************************************************************** 150 * DrawDibEnd [MSVIDEO.105] 150 151 */ 151 152 BOOL16 VFWAPI DrawDibEnd16(HDRAWDIB16 hdd) { 152 return DrawDibEnd(hdd);153 return DrawDibEnd(hdd); 153 154 } 154 155 … … 157 158 */ 158 159 BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, 159 HDC hdc,160 INT dxDst,161 INT dyDst,162 LPBITMAPINFOHEADER lpbi,163 INT dxSrc,164 INT dySrc,165 UINT wFlags) {166 BOOL ret = TRUE;167 WINE_HDD *whdd;168 169 TRACE("(%d,0x%lx,%d,%d,%p,%d,%d,0x%08lx)\n",170 hdd,(DWORD)hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,(DWORD)wFlags171 );172 TRACE("lpbi: %ld,%ld/%ld,%d,%d,%ld,%ld,%ld,%ld,%ld,%ld\n",173 lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, 174 lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, 175 lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, 176 lpbi->biClrImportant);177 178 if (wFlags & ~(DDF_BUFFER))179 FIXME("wFlags == 0x%08x not handled\n", wFlags & ~(DDF_BUFFER));180 181 whdd = (WINE_HDD*)GlobalLock16(hdd);182 if (!whdd) return FALSE;183 184 if (whdd->begun)185 DrawDibEnd(hdd);186 187 if (lpbi->biCompression) {188 DWORD size = 0;189 190 whdd->hic = ICOpen(ICTYPE_VIDEO,lpbi->biCompression,ICMODE_DECOMPRESS);191 if (!whdd->hic) {192 WARN("Could not open IC. biCompression == 0x%08lx\n",lpbi->biCompression);193 ret = FALSE;194 }195 196 if (ret) {197 size = ICDecompressGetFormat(whdd->hic,lpbi,NULL);198 if (size == ICERR_UNSUPPORTED) {199 WARN("Codec doesn't support GetFormat, giving up.\n");200 ret = FALSE;201 }202 }203 204 if (ret) {205 whdd->lpbiOut = HeapAlloc(GetProcessHeap(),0,size);206 207 if (ICDecompressGetFormat(whdd->hic,lpbi,whdd->lpbiOut) != ICERR_OK)208 ret = FALSE;209 }210 211 if (ret) {212 /* FIXME: Use Ex functions if available? */213 if (ICDecompressBegin(whdd->hic,lpbi,whdd->lpbiOut) != ICERR_OK)214 ret = FALSE;215 216 TRACE("biSizeImage == %ld\n",whdd->lpbiOut->biSizeImage);217 TRACE("biCompression == %ld\n",whdd->lpbiOut->biCompression);218 TRACE("biBitCount == %d\n",whdd->lpbiOut->biBitCount);219 }220 } else {221 DWORD dwSize;222 /* No compression */223 TRACE("Not compressed!\n");224 dwSize = lpbi->biSize + lpbi->biClrUsed*sizeof(RGBQUAD);225 whdd->lpbiOut = HeapAlloc(GetProcessHeap(),0,dwSize);226 memcpy(whdd->lpbiOut,lpbi,dwSize);227 }228 229 if (ret) {230 /*whdd->lpvbuf = HeapAlloc(GetProcessHeap(),0,whdd->lpbiOut->biSizeImage);*/231 232 whdd->hMemDC = CreateCompatibleDC(hdc);233 TRACE("Creating: %ld,%p\n",whdd->lpbiOut->biSize,whdd->lpvbits);234 whdd->hDib = CreateDIBSection(whdd->hMemDC,(BITMAPINFO *)whdd->lpbiOut,DIB_RGB_COLORS,&(whdd->lpvbits),0,0);235 if (!whdd->hDib) {236 TRACE("Error: %ld\n",GetLastError());237 }238 TRACE("Created: %d,%p\n",whdd->hDib,whdd->lpvbits);239 whdd->hOldDib = SelectObject(whdd->hMemDC,whdd->hDib);240 }241 242 if (ret) {243 whdd->hdc = hdc;244 whdd->dxDst = dxDst;245 whdd->dyDst = dyDst;246 whdd->lpbi = HeapAlloc(GetProcessHeap(),0,lpbi->biSize);247 memcpy(whdd->lpbi,lpbi,lpbi->biSize);248 whdd->dxSrc = dxSrc;249 whdd->dySrc = dySrc;250 whdd->begun = TRUE;251 whdd->hpal = 0;252 } else {253 if (whdd->hic)254 ICClose(whdd->hic);255 if (whdd->lpbiOut) {256 HeapFree(GetProcessHeap(),0,whdd->lpbiOut);257 whdd->lpbiOut = NULL;258 }259 }260 261 GlobalUnlock16(hdd);262 263 return ret;160 HDC hdc, 161 INT dxDst, 162 INT dyDst, 163 LPBITMAPINFOHEADER lpbi, 164 INT dxSrc, 165 INT dySrc, 166 UINT wFlags) { 167 BOOL ret = TRUE; 168 WINE_HDD *whdd; 169 170 TRACE("(%d,0x%lx,%d,%d,%p,%d,%d,0x%08lx)\n", 171 hdd,(DWORD)hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,(DWORD)wFlags 172 ); 173 TRACE("lpbi: %ld,%ld/%ld,%d,%d,%ld,%ld,%ld,%ld,%ld,%ld\n", 174 lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, 175 lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, 176 lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, 177 lpbi->biClrImportant); 178 179 if (wFlags & ~(DDF_BUFFER)) 180 FIXME("wFlags == 0x%08x not handled\n", wFlags & ~(DDF_BUFFER)); 181 182 whdd = (WINE_HDD*)GlobalLock16(hdd); 183 if (!whdd) return FALSE; 184 185 if (whdd->begun) 186 DrawDibEnd(hdd); 187 188 if (lpbi->biCompression) { 189 DWORD size = 0; 190 191 whdd->hic = ICOpen(ICTYPE_VIDEO,lpbi->biCompression,ICMODE_DECOMPRESS); 192 if (!whdd->hic) { 193 WARN("Could not open IC. biCompression == 0x%08lx\n",lpbi->biCompression); 194 ret = FALSE; 195 } 196 197 if (ret) { 198 size = ICDecompressGetFormat(whdd->hic,lpbi,NULL); 199 if (size == ICERR_UNSUPPORTED) { 200 WARN("Codec doesn't support GetFormat, giving up.\n"); 201 ret = FALSE; 202 } 203 } 204 205 if (ret) { 206 whdd->lpbiOut = HeapAlloc(GetProcessHeap(),0,size); 207 208 if (ICDecompressGetFormat(whdd->hic,lpbi,whdd->lpbiOut) != ICERR_OK) 209 ret = FALSE; 210 } 211 212 if (ret) { 213 /* FIXME: Use Ex functions if available? */ 214 if (ICDecompressBegin(whdd->hic,lpbi,whdd->lpbiOut) != ICERR_OK) 215 ret = FALSE; 216 217 TRACE("biSizeImage == %ld\n",whdd->lpbiOut->biSizeImage); 218 TRACE("biCompression == %ld\n",whdd->lpbiOut->biCompression); 219 TRACE("biBitCount == %d\n",whdd->lpbiOut->biBitCount); 220 } 221 } else { 222 DWORD dwSize; 223 /* No compression */ 224 TRACE("Not compressed!\n"); 225 dwSize = lpbi->biSize + lpbi->biClrUsed*sizeof(RGBQUAD); 226 whdd->lpbiOut = HeapAlloc(GetProcessHeap(),0,dwSize); 227 memcpy(whdd->lpbiOut,lpbi,dwSize); 228 } 229 230 if (ret) { 231 /*whdd->lpvbuf = HeapAlloc(GetProcessHeap(),0,whdd->lpbiOut->biSizeImage);*/ 232 233 whdd->hMemDC = CreateCompatibleDC(hdc); 234 TRACE("Creating: %ld,%p\n",whdd->lpbiOut->biSize,whdd->lpvbits); 235 whdd->hDib = CreateDIBSection(whdd->hMemDC,(BITMAPINFO *)whdd->lpbiOut,DIB_RGB_COLORS,&(whdd->lpvbits),0,0); 236 if (!whdd->hDib) { 237 TRACE("Error: %ld\n",GetLastError()); 238 } 239 TRACE("Created: %d,%p\n",whdd->hDib,whdd->lpvbits); 240 whdd->hOldDib = SelectObject(whdd->hMemDC,whdd->hDib); 241 } 242 243 if (ret) { 244 whdd->hdc = hdc; 245 whdd->dxDst = dxDst; 246 whdd->dyDst = dyDst; 247 whdd->lpbi = HeapAlloc(GetProcessHeap(),0,lpbi->biSize); 248 memcpy(whdd->lpbi,lpbi,lpbi->biSize); 249 whdd->dxSrc = dxSrc; 250 whdd->dySrc = dySrc; 251 whdd->begun = TRUE; 252 whdd->hpal = 0; 253 } else { 254 if (whdd->hic) 255 ICClose(whdd->hic); 256 if (whdd->lpbiOut) { 257 HeapFree(GetProcessHeap(),0,whdd->lpbiOut); 258 whdd->lpbiOut = NULL; 259 } 260 } 261 262 GlobalUnlock16(hdd); 263 264 return ret; 264 265 } 265 266 266 267 /************************************************************************ 267 * DrawDibBegin[MSVIDEO.104]268 * DrawDibBegin [MSVIDEO.104] 268 269 */ 269 270 BOOL16 VFWAPI DrawDibBegin16(HDRAWDIB16 hdd, 270 HDC16 hdc,271 INT16 dxDst,272 INT16 dyDst,273 LPBITMAPINFOHEADER lpbi,274 INT16 dxSrc,275 INT16 dySrc,276 UINT16 wFlags) {277 return DrawDibBegin(hdd,hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,wFlags);271 HDC16 hdc, 272 INT16 dxDst, 273 INT16 dyDst, 274 LPBITMAPINFOHEADER lpbi, 275 INT16 dxSrc, 276 INT16 dySrc, 277 UINT16 wFlags) { 278 return DrawDibBegin(hdd,hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,wFlags); 278 279 } 279 280 280 281 /********************************************************************** 281 * DrawDibDraw[MSVFW32.@]282 * DrawDibDraw [MSVFW32.@] 282 283 */ 283 284 BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, 284 INT xDst, INT yDst, INT dxDst, INT dyDst,285 LPBITMAPINFOHEADER lpbi,286 LPVOID lpBits,287 INT xSrc, INT ySrc, INT dxSrc, INT dySrc,288 UINT wFlags285 INT xDst, INT yDst, INT dxDst, INT dyDst, 286 LPBITMAPINFOHEADER lpbi, 287 LPVOID lpBits, 288 INT xSrc, INT ySrc, INT dxSrc, INT dySrc, 289 UINT wFlags 289 290 ) { 290 WINE_HDD *whdd;291 BOOL ret = TRUE;292 293 TRACE("(%d,0x%lx,%d,%d,%d,%d,%p,%p,%d,%d,%d,%d,0x%08lx)\n",294 hdd,(DWORD)hdc,xDst,yDst,dxDst,dyDst,lpbi,lpBits,xSrc,ySrc,dxSrc,dySrc,(DWORD)wFlags295 );296 297 if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | 298 DDF_UPDATE | DDF_DONTDRAW))299 FIXME("wFlags == 0x%08lx not handled\n",(DWORD)wFlags);300 301 if (!lpBits) {302 /* Undocumented? */303 lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(lpbi->biClrUsed*sizeof(RGBQUAD));304 }305 306 whdd = GlobalLock16(hdd);291 WINE_HDD *whdd; 292 BOOL ret = TRUE; 293 294 TRACE("(%d,0x%lx,%d,%d,%d,%d,%p,%p,%d,%d,%d,%d,0x%08lx)\n", 295 hdd,(DWORD)hdc,xDst,yDst,dxDst,dyDst,lpbi,lpBits,xSrc,ySrc,dxSrc,dySrc,(DWORD)wFlags 296 ); 297 298 if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | 299 DDF_UPDATE | DDF_DONTDRAW)) 300 FIXME("wFlags == 0x%08lx not handled\n",(DWORD)wFlags); 301 302 if (!lpBits) { 303 /* Undocumented? */ 304 lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(lpbi->biClrUsed*sizeof(RGBQUAD)); 305 } 306 307 whdd = GlobalLock16(hdd); 307 308 308 309 #define CHANGED(x) (whdd->x != x) 309 310 310 if ((!whdd->begun) || (!(wFlags & DDF_SAME_HDC) && CHANGED(hdc)) || (!(wFlags & DDF_SAME_DRAW) &&311 (CHANGED(lpbi) || CHANGED(dxSrc) || CHANGED(dySrc) || CHANGED(dxDst) || CHANGED(dyDst)))) {312 TRACE("Something changed!\n");313 ret = DrawDibBegin(hdd,hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,0);314 }311 if ((!whdd->begun) || (!(wFlags & DDF_SAME_HDC) && CHANGED(hdc)) || (!(wFlags & DDF_SAME_DRAW) && 312 (CHANGED(lpbi) || CHANGED(dxSrc) || CHANGED(dySrc) || CHANGED(dxDst) || CHANGED(dyDst)))) { 313 TRACE("Something changed!\n"); 314 ret = DrawDibBegin(hdd,hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,0); 315 } 315 316 316 317 #undef CHANGED 317 318 318 319 if ((dxDst == -1) && (dyDst == -1)) { 319 dxDst = dxSrc;320 dyDst = dySrc;321 }322 323 if (!(wFlags & DDF_UPDATE)) {324 /* biSizeImage may be set to 0 for BI_RGB (uncompressed) bitmaps */325 if ((lpbi->biCompression == BI_RGB) && (lpbi->biSizeImage == 0))326 lpbi->biSizeImage = ((lpbi->biWidth * lpbi->biBitCount + 31) / 32) * 4 * lpbi->biHeight;327 328 if (lpbi->biCompression) {329 DWORD flags = 0;330 331 TRACE("Compression == 0x%08lx\n",lpbi->biCompression);332 333 if (wFlags & DDF_NOTKEYFRAME)334 flags |= ICDECOMPRESS_NOTKEYFRAME;335 336 ICDecompress(whdd->hic,flags,lpbi,lpBits,whdd->lpbiOut,whdd->lpvbits);337 } else {338 memcpy(whdd->lpvbits,lpBits,lpbi->biSizeImage);339 } 340 }341 if (!(wFlags & DDF_DONTDRAW) && whdd->hpal)342 SelectPalette(hdc,whdd->hpal,FALSE);343 344 if (!(StretchBlt(whdd->hdc,xDst,yDst,dxDst,dyDst,whdd->hMemDC,xSrc,ySrc,dxSrc,dySrc,SRCCOPY)))345 ret = FALSE;346 347 GlobalUnlock16(hdd);348 return ret;320 dxDst = dxSrc; 321 dyDst = dySrc; 322 } 323 324 if (!(wFlags & DDF_UPDATE)) { 325 /* biSizeImage may be set to 0 for BI_RGB (uncompressed) bitmaps */ 326 if ((lpbi->biCompression == BI_RGB) && (lpbi->biSizeImage == 0)) 327 lpbi->biSizeImage = ((lpbi->biWidth * lpbi->biBitCount + 31) / 32) * 4 * lpbi->biHeight; 328 329 if (lpbi->biCompression) { 330 DWORD flags = 0; 331 332 TRACE("Compression == 0x%08lx\n",lpbi->biCompression); 333 334 if (wFlags & DDF_NOTKEYFRAME) 335 flags |= ICDECOMPRESS_NOTKEYFRAME; 336 337 ICDecompress(whdd->hic,flags,lpbi,lpBits,whdd->lpbiOut,whdd->lpvbits); 338 } else { 339 memcpy(whdd->lpvbits,lpBits,lpbi->biSizeImage); 340 } 341 } 342 if (!(wFlags & DDF_DONTDRAW) && whdd->hpal) 343 SelectPalette(hdc,whdd->hpal,FALSE); 344 345 if (!(StretchBlt(whdd->hdc,xDst,yDst,dxDst,dyDst,whdd->hMemDC,xSrc,ySrc,dxSrc,dySrc,SRCCOPY))) 346 ret = FALSE; 347 348 GlobalUnlock16(hdd); 349 return ret; 349 350 } 350 351 351 352 /********************************************************************** 352 * DrawDibDraw[MSVIDEO.106]353 */ 354 BOOL16 VFWAPI DrawDibDraw16(HDRAWDIB16 hdd, 355 HDC16 hdc,356 INT16 xDst,357 INT16 yDst,358 INT16 dxDst,359 INT16 dyDst,360 LPBITMAPINFOHEADER lpbi,361 LPVOID lpBits,362 INT16 xSrc,363 INT16 ySrc,364 INT16 dxSrc,365 INT16 dySrc,366 UINT16 wFlags) {367 return DrawDibDraw(hdd,hdc,xDst,yDst,dxDst,dyDst,lpbi,lpBits,xSrc,ySrc,dxSrc,dySrc,wFlags);353 * DrawDibDraw [MSVIDEO.106] 354 */ 355 BOOL16 VFWAPI DrawDibDraw16(HDRAWDIB16 hdd, 356 HDC16 hdc, 357 INT16 xDst, 358 INT16 yDst, 359 INT16 dxDst, 360 INT16 dyDst, 361 LPBITMAPINFOHEADER lpbi, 362 LPVOID lpBits, 363 INT16 xSrc, 364 INT16 ySrc, 365 INT16 dxSrc, 366 INT16 dySrc, 367 UINT16 wFlags) { 368 return DrawDibDraw(hdd,hdc,xDst,yDst,dxDst,dyDst,lpbi,lpBits,xSrc,ySrc,dxSrc,dySrc,wFlags); 368 369 } 369 370 370 371 /************************************************************************* 371 * DrawDibStart[MSVFW32.@]372 * DrawDibStart [MSVFW32.@] 372 373 */ 373 374 BOOL VFWAPI DrawDibStart(HDRAWDIB hdd, DWORD rate) { 374 FIXME("(0x%08lx,%ld), stub\n",(DWORD)hdd,rate);375 return TRUE;375 FIXME("(0x%08lx,%ld), stub\n",(DWORD)hdd,rate); 376 return TRUE; 376 377 } 377 378 378 379 /************************************************************************* 379 * DrawDibStart[MSVIDEO.118]380 * DrawDibStart [MSVIDEO.118] 380 381 */ 381 382 BOOL16 VFWAPI DrawDibStart16(HDRAWDIB16 hdd, DWORD rate) { 382 return DrawDibStart(hdd,rate);383 return DrawDibStart(hdd,rate); 383 384 } 384 385 385 386 /************************************************************************* 386 * DrawDibStop[MSVFW32.@]387 * DrawDibStop [MSVFW32.@] 387 388 */ 388 389 BOOL VFWAPI DrawDibStop(HDRAWDIB hdd) { 389 FIXME("(0x%08lx), stub\n",(DWORD)hdd);390 return TRUE;390 FIXME("(0x%08lx), stub\n",(DWORD)hdd); 391 return TRUE; 391 392 } 392 393 393 394 /************************************************************************* 394 * DrawDibStop[MSVIDEO.119]395 * DrawDibStop [MSVIDEO.119] 395 396 */ 396 397 BOOL16 DrawDibStop16(HDRAWDIB16 hdd) { 397 return DrawDibStop(hdd);398 return DrawDibStop(hdd); 398 399 } 399 400 … … 402 403 */ 403 404 BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal) { 404 WINE_HDD *whdd;405 406 TRACE("(0x%08lx,0x%08lx)\n",(DWORD)hdd,(DWORD)hpal);407 408 whdd = GlobalLock16(hdd);409 whdd->hpal = hpal;410 411 if (whdd->begun) {412 SelectPalette(whdd->hdc,hpal,0);413 RealizePalette(whdd->hdc);414 }415 GlobalUnlock16(hdd);416 return TRUE;405 WINE_HDD *whdd; 406 407 TRACE("(0x%08lx,0x%08lx)\n",(DWORD)hdd,(DWORD)hpal); 408 409 whdd = GlobalLock16(hdd); 410 whdd->hpal = hpal; 411 412 if (whdd->begun) { 413 SelectPalette(whdd->hdc,hpal,0); 414 RealizePalette(whdd->hdc); 415 } 416 GlobalUnlock16(hdd); 417 return TRUE; 417 418 } 418 419 … … 421 422 */ 422 423 BOOL16 VFWAPI DrawDibSetPalette16(HDRAWDIB16 hdd, HPALETTE16 hpal) { 423 return DrawDibSetPalette(hdd,hpal);424 return DrawDibSetPalette(hdd,hpal); 424 425 } 425 426 … … 428 429 */ 429 430 HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd) { 430 WINE_HDD *whdd;431 HPALETTE ret;432 433 TRACE("(0x%08lx)\n",(DWORD)hdd);434 435 whdd = GlobalLock16(hdd);436 ret = whdd->hpal;437 GlobalUnlock16(hdd);438 return ret;431 WINE_HDD *whdd; 432 HPALETTE ret; 433 434 TRACE("(0x%08lx)\n",(DWORD)hdd); 435 436 whdd = GlobalLock16(hdd); 437 ret = whdd->hpal; 438 GlobalUnlock16(hdd); 439 return ret; 439 440 } 440 441 … … 443 444 */ 444 445 HPALETTE16 VFWAPI DrawDibGetPalette16(HDRAWDIB16 hdd) { 445 return (HPALETTE16)DrawDibGetPalette(hdd);446 return (HPALETTE16)DrawDibGetPalette(hdd); 446 447 } 447 448 … … 450 451 */ 451 452 UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground) { 452 WINE_HDD *whdd;453 HPALETTE oldPal;454 UINT ret = 0;455 456 FIXME("(%d,0x%08lx,%d), stub\n",hdd,(DWORD)hdc,fBackground);457 458 whdd = GlobalLock16(hdd);459 460 if (!whdd || !(whdd->begun)) {461 ret = 0;462 goto out;463 }464 465 if (!whdd->hpal)466 whdd->hpal = CreateHalftonePalette(hdc);467 468 oldPal = SelectPalette(hdc,whdd->hpal,fBackground);469 ret = RealizePalette(hdc);470 453 WINE_HDD *whdd; 454 HPALETTE oldPal; 455 UINT ret = 0; 456 457 FIXME("(%d,0x%08lx,%d), stub\n",hdd,(DWORD)hdc,fBackground); 458 459 whdd = GlobalLock16(hdd); 460 461 if (!whdd || !(whdd->begun)) { 462 ret = 0; 463 goto out; 464 } 465 466 if (!whdd->hpal) 467 whdd->hpal = CreateHalftonePalette(hdc); 468 469 oldPal = SelectPalette(hdc,whdd->hpal,fBackground); 470 ret = RealizePalette(hdc); 471 471 472 out: 472 GlobalUnlock16(hdd);473 474 TRACE("=> %u\n",ret);475 return ret;473 GlobalUnlock16(hdd); 474 475 TRACE("=> %u\n",ret); 476 return ret; 476 477 } 477 478 … … 480 481 */ 481 482 UINT16 VFWAPI DrawDibRealize16(HDRAWDIB16 hdd, HDC16 hdc, BOOL16 fBackground) { 482 return (UINT16)DrawDibRealize(hdd,hdc,fBackground);483 } 483 return (UINT16)DrawDibRealize(hdd,hdc,fBackground); 484 }
Note:
See TracChangeset
for help on using the changeset viewer.
