- Timestamp:
- May 22, 2000, 9:11:28 PM (25 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r3527 r3589 1 /* $Id: blit.cpp,v 1.1 1 2000-05-12 19:14:55sandervl Exp $ */1 /* $Id: blit.cpp,v 1.12 2000-05-22 19:11:27 sandervl Exp $ */ 2 2 3 3 /* … … 220 220 //****************************************************************************** 221 221 //****************************************************************************** 222 INT WIN32API StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, 223 INT heightDst, INT xSrc, INT ySrc, INT widthSrc, 224 INT heightSrc, const void *bits, 225 const BITMAPINFO *info, UINT wUsage, DWORD dwRop ) 226 { 227 #if 1 228 INT rc; 229 230 dprintf(("GDI32: StretchDIBits %x to (%d,%d) (%d,%d) from (%d,%d) (%d,%d), %x %x %x %x", hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, bits, info, wUsage, dwRop)); 231 232 if(wUsage == DIB_PAL_COLORS && info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER)) 233 { 234 // workaround for open32 bug. 235 // If syscolors > 256 and wUsage == DIB_PAL_COLORS. 236 237 int i; 238 USHORT *pColorIndex = (USHORT *)info->bmiColors; 239 RGBQUAD *pColors = (RGBQUAD *) alloca(info->bmiHeader.biClrUsed * 240 sizeof(RGBQUAD)); 241 BITMAPINFO *infoLoc = (BITMAPINFO *) alloca(sizeof(BITMAPINFO) + 242 info->bmiHeader.biClrUsed * sizeof(RGBQUAD)); 243 244 memcpy(infoLoc, info, sizeof(BITMAPINFO)); 245 246 if(GetDIBColorTable(hdc, 0, info->bmiHeader.biClrUsed, pColors) == 0) 247 return FALSE; 248 249 for(i=0;i<info->bmiHeader.biClrUsed;i++, pColorIndex++) 250 { 251 infoLoc->bmiColors[i] = pColors[*pColorIndex]; 252 } 253 254 rc = O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, 255 widthSrc, heightSrc, (void *)bits, 256 (PBITMAPINFO)infoLoc, DIB_RGB_COLORS, dwRop); 257 258 if(rc != heightDst) { 259 dprintf(("StretchDIBits failed with rc %x", rc)); 260 } 261 else { 262 DIBSection *destdib = DIBSection::findHDC(hdc); 263 if(destdib) { 264 destdib->sync(hdc, yDst, heightDst); 265 } 266 } 267 268 return rc; 269 } 270 271 rc = O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, 272 widthSrc, heightSrc, (void *)bits, 273 (PBITMAPINFO)info, wUsage, dwRop); 274 if(rc != heightDst) { 275 dprintf(("StretchDIBits failed with rc %x", rc)); 276 } 277 else { 278 DIBSection *destdib = DIBSection::findHDC(hdc); 279 if(destdib) { 280 destdib->sync(hdc, yDst, heightDst); 281 } 282 } 283 284 return rc; 285 #else 286 dprintf(("GDI32: StretchDIBits\n")); 287 return O32_StretchDIBits(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, (void *)arg10, (PBITMAPINFO)arg11, arg12, arg13); 288 #endif 289 } 290 //****************************************************************************** 291 //****************************************************************************** 222 292 int WIN32API SetStretchBltMode( HDC arg1, int arg2) 223 293 { -
trunk/src/gdi32/gdi32.cpp
r3255 r3589 1 /* $Id: gdi32.cpp,v 1.4 6 2000-03-28 15:25:47 cbratschiExp $ */1 /* $Id: gdi32.cpp,v 1.47 2000-05-22 19:11:28 sandervl Exp $ */ 2 2 3 3 /* … … 188 188 dprintf(("CreateCompatibleDC %X returned %x", hdc, newHdc)); 189 189 return newHdc; 190 }191 //******************************************************************************192 //******************************************************************************193 INT WIN32API StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,194 INT heightDst, INT xSrc, INT ySrc, INT widthSrc,195 INT heightSrc, const void *bits,196 const BITMAPINFO *info, UINT wUsage, DWORD dwRop )197 {198 #if 1199 dprintf(("GDI32: StretchDIBits %x to (%d,%d) (%d,%d) from (%d,%d) (%d,%d), %x %x %x %x", hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, bits, info, wUsage, dwRop));200 201 if(wUsage == DIB_PAL_COLORS && info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))202 {203 // workaround for open32 bug.204 // If syscolors > 256 and wUsage == DIB_PAL_COLORS.205 206 int i;207 USHORT *pColorIndex = (USHORT *)info->bmiColors;208 RGBQUAD *pColors = (RGBQUAD *) alloca(info->bmiHeader.biClrUsed *209 sizeof(RGBQUAD));210 BITMAPINFO *infoLoc = (BITMAPINFO *) alloca(sizeof(BITMAPINFO) +211 info->bmiHeader.biClrUsed * sizeof(RGBQUAD));212 213 memcpy(infoLoc, info, sizeof(BITMAPINFO));214 215 if(GetDIBColorTable(hdc, 0, info->bmiHeader.biClrUsed, pColors) == 0)216 return FALSE;217 218 for(i=0;i<info->bmiHeader.biClrUsed;i++, pColorIndex++)219 {220 infoLoc->bmiColors[i] = pColors[*pColorIndex];221 }222 223 return O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,224 widthSrc, heightSrc, (void *)bits,225 (PBITMAPINFO)infoLoc, DIB_RGB_COLORS, dwRop);226 }227 228 return O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,229 widthSrc, heightSrc, (void *)bits,230 (PBITMAPINFO)info, wUsage, dwRop);231 #else232 dprintf(("GDI32: StretchDIBits\n"));233 return O32_StretchDIBits(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, (void *)arg10, (PBITMAPINFO)arg11, arg12, arg13);234 #endif235 190 } 236 191 //****************************************************************************** -
trunk/src/gdi32/palette.cpp
r2802 r3589 1 /* $Id: palette.cpp,v 1. 3 2000-02-16 14:18:12sandervl Exp $ */1 /* $Id: palette.cpp,v 1.4 2000-05-22 19:11:28 sandervl Exp $ */ 2 2 3 3 /* … … 62 62 { 63 63 HPALETTE rc; 64 dprintf(("GDI32: CreatePalette\n")); 64 65 65 for(int i=0; i<arg1->palNumEntries;i++) 66 66 { 67 dprintf2(("Index %d : 0x%08X\n",i, *((DWORD*)(&arg1->palPalEntry[i])) ));67 dprintf2(("Index %d : 0x%08X\n",i, *((DWORD*)(&arg1->palPalEntry[i])) )); 68 68 } 69 69 rc = O32_CreatePalette(arg1); 70 dprintf((" 70 dprintf(("GDI32: CreatePalette returns 0x%08X\n",rc)); 71 71 72 72 return rc; … … 114 114 //****************************************************************************** 115 115 //****************************************************************************** 116 UINT WIN32API GetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PPALETTEENTRY arg4)116 UINT WIN32API GetPaletteEntries( HPALETTE hPalette, UINT arg2, UINT arg3, PPALETTEENTRY arg4) 117 117 { 118 dprintf(("GDI32: GetPaletteEntries "));119 return O32_GetPaletteEntries( arg1, arg2, arg3, arg4);118 dprintf(("GDI32: GetPaletteEntries %x %d-%d %x", hPalette, arg2, arg3, arg4)); 119 return O32_GetPaletteEntries(hPalette, arg2, arg3, arg4); 120 120 } 121 121 //****************************************************************************** … … 139 139 //****************************************************************************** 140 140 //****************************************************************************** 141 UINT WIN32API SetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PALETTEENTRY * arg4)141 UINT WIN32API SetPaletteEntries( HPALETTE hPalette, UINT arg2, UINT arg3, PALETTEENTRY * arg4) 142 142 { 143 dprintf(("GDI32: SetPaletteEntries "));144 return O32_SetPaletteEntries( arg1, arg2, arg3, (const PALETTEENTRY *)arg4);143 dprintf(("GDI32: SetPaletteEntries %x %d-%d %x", hPalette, arg2, arg3, arg4)); 144 return O32_SetPaletteEntries(hPalette, arg2, arg3, (const PALETTEENTRY *)arg4); 145 145 } 146 146 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.