- Timestamp:
- Dec 4, 1999, 2:53:14 PM (26 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibsect.cpp
r1937 r1966 1 /* $Id: dibsect.cpp,v 1.1 0 1999-12-02 13:26:04 achimhaExp $ */1 /* $Id: dibsect.cpp,v 1.11 1999-12-04 13:53:12 hugh Exp $ */ 2 2 3 3 /* … … 101 101 dprintf(("pOS2bmp->ulCompression %d\n", pOS2bmp->ulCompression)); 102 102 dprintf(("pOS2bmp->cbImage %d\n", pOS2bmp->cbImage)); 103 dprintf(("Bits at 0x%08X\n",bmpBits)); 103 104 104 105 this->handle = handle; … … 123 124 dsect->next = this; 124 125 } 126 125 127 dprintf(("Class created")); 126 128 } … … 134 136 free(pOS2bmp); 135 137 136 if(section == this) { 137 section = this->next; 138 } 139 else { 140 DIBSection *dsect = section; 141 142 while(dsect->next != this) { 143 dsect = dsect->next; 144 } 145 dsect->next = this->next; 138 if(section == this) 139 { 140 section = this->next; 141 } 142 else 143 { 144 DIBSection *dsect = section; 145 146 while(dsect->next != this) 147 { 148 dsect = dsect->next; 149 } 150 dsect->next = this->next; 146 151 } 147 152 } … … 161 166 switch(pbmi->biBitCount) 162 167 { 163 case 1: 164 bmpsize /= 8; 165 palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2); 166 os2bmpsize += palsize; 167 break; 168 case 4: 169 bmpsize /= 2; 170 palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2); 171 os2bmpsize += palsize; 172 break; 173 case 8: 174 palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2); 175 os2bmpsize += palsize; 176 break; 177 case 16: 178 bmpsize *= 2; 179 break; 180 case 24: 181 bmpsize *= 3; 182 break; 183 case 32: 184 bmpsize *= 4; 185 break; 186 } 187 if(bmpsize & 3) { 188 bmpsize = (bmpsize + 3) & ~3; 168 case 1: 169 bmpsize /= 8; 170 palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2); 171 os2bmpsize += palsize; 172 break; 173 case 4: 174 bmpsize /= 2; 175 palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2); 176 os2bmpsize += palsize; 177 break; 178 case 8: 179 palsize = ((1 << pbmi->biBitCount))*sizeof(RGB2); 180 os2bmpsize += palsize; 181 break; 182 case 16: 183 bmpsize *= 2; 184 break; 185 case 24: 186 bmpsize *= 3; 187 break; 188 case 32: 189 bmpsize *= 4; 190 break; 191 } 192 193 if(bmpsize & 3) 194 { 195 bmpsize = (bmpsize + 3) & ~3; 189 196 } 190 197 … … 216 223 int i; 217 224 218 if(startIdx + cEntries > (1 << pOS2bmp->cBitCount)) { 219 dprintf(("DIBSection::SetDIBColorTable, invalid nr of entries %d %d\n", startIdx, cEntries)); 220 return(0); 221 } 225 if(startIdx + cEntries > (1 << pOS2bmp->cBitCount)) 226 { 227 dprintf(("DIBSection::SetDIBColorTable, invalid nr of entries %d %d\n", startIdx, cEntries)); 228 return(0); 229 } 230 222 231 memcpy(&pOS2bmp->argbColor[startIdx], rgb, cEntries*sizeof(RGB2)); 223 for(i=startIdx;i<cEntries;i++) { 224 pOS2bmp->argbColor[i].fcOptions = 0; 225 } 232 233 for(i=startIdx;i<cEntries;i++) 234 { 235 pOS2bmp->argbColor[i].fcOptions = 0; 236 dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&pOS2bmp->argbColor[i])) )); 237 } 238 226 239 return(cEntries); 227 240 } … … 306 319 this->hdc = hdc; 307 320 hwndParent = WinWindowFromDC(hdc); 321 dprintf(("SelectDIBObject(0x%08X) hwndParent = 0x%08X\n",hdc, hwndParent)); 308 322 } 309 323 //****************************************************************************** … … 313 327 DIBSection *dsect = section; 314 328 315 while(dsect) { 316 if(dsect->handle == handle) { 317 return(dsect); 318 } 319 dsect = dsect->next; 329 while(dsect) 330 { 331 if(dsect->handle == handle) 332 { 333 return(dsect); 334 } 335 dsect = dsect->next; 320 336 } 321 337 return(NULL); … … 328 344 DIBSection *dsect = section; 329 345 330 while(dsect) { 331 if(dsect->hdc == hdc) { 332 return(dsect); 333 } 334 dsect = dsect->next; 346 while(dsect) 347 { 348 if(dsect->hdc == hdc) 349 { 350 return(dsect); 351 } 352 dsect = dsect->next; 335 353 } 336 354 return(NULL); … … 343 361 344 362 if(dsect) 345 delete dsect; 346 347 } 348 //****************************************************************************** 349 //****************************************************************************** 350 int DIBSection::GetDIBSection(int iSize , DIBSECTION *pDIBSection){ 363 delete dsect; 364 365 } 366 //****************************************************************************** 367 //****************************************************************************** 368 int DIBSection::GetDIBSection(int iSize , DIBSECTION *pDIBSection) 369 { 351 370 if( (sizeof(DIBSECTION)==iSize) && 352 371 (pDIBSection !=NULL)) … … 388 407 //****************************************************************************** 389 408 //****************************************************************************** 409 char DIBSection::GetBitCount() 410 { 411 if(NULL==pOS2bmp) 412 return 0; 413 else 414 return pOS2bmp->cBitCount; 415 } 416 //****************************************************************************** 417 //****************************************************************************** 390 418 DIBSection *DIBSection::section = NULL; 391 -
trunk/src/gdi32/dibsect.h
r1937 r1966 1 /* $Id: dibsect.h,v 1. 7 1999-12-02 13:26:05 achimhaExp $ */1 /* $Id: dibsect.h,v 1.8 1999-12-04 13:53:14 hugh Exp $ */ 2 2 3 3 /* … … 10 10 11 11 #ifdef OS2_ONLY 12 typedef struct { 12 typedef struct 13 { 13 14 BYTE rgbBlue; 14 15 BYTE rgbGreen; … … 67 68 char *GetDIBObject() { return bmpBits; }; 68 69 void SelectDIBObject(HDC hdc); 69 70 char GetBitCount(); 70 71 void UnSelectDIBObject() { this->hdc = 0; }; 71 72 -
trunk/src/gdi32/font.cpp
r1707 r1966 1 /* $Id: font.cpp,v 1. 6 1999-11-11 19:09:34 sandervlExp $ */1 /* $Id: font.cpp,v 1.7 1999-12-04 13:53:12 hugh Exp $ */ 2 2 3 3 /* … … 37 37 38 38 typedef struct { 39 40 41 39 DWORD userProc; 40 DWORD userData; 41 DWORD dwFlags; 42 42 } ENUMUSERDATA; 43 43 … … 72 72 { HANGEUL_CHARSET, 949, FS(19)}, 73 73 { CHINESEBIG5_CHARSET, 950, FS(20)}, 74 { JOHAB_CHARSET, 1361, FS(21)}, 74 { JOHAB_CHARSET, 1361, FS(21)}, 75 75 /* reserved for alternate ANSI and OEM */ 76 76 { DEFAULT_CHARSET, 0, FS(0)}, … … 266 266 { 267 267 ENUMUSERDATA *lpEnumData = (ENUMUSERDATA *)arg4; 268 FONTENUMPROCA proc = (FONTENUMPROCA)lpEnumData->userProc; 268 FONTENUMPROCA proc = (FONTENUMPROCA)lpEnumData->userProc; 269 269 270 270 return proc(lpLogFont, lpTextM, arg3, lpEnumData->userData); … … 276 276 { 277 277 ENUMUSERDATA *lpEnumData = (ENUMUSERDATA *)arg4; 278 FONTENUMPROCW proc = (FONTENUMPROCW)lpEnumData->userProc; 278 FONTENUMPROCW proc = (FONTENUMPROCW)lpEnumData->userProc; 279 279 ENUMLOGFONTW LogFont; 280 280 NEWTEXTMETRICW textM; … … 321 321 { 322 322 ENUMUSERDATA *lpEnumData = (ENUMUSERDATA *)arg4; 323 FONTENUMPROCEXA proc = (FONTENUMPROCEXA)lpEnumData->userProc; 323 FONTENUMPROCEXA proc = (FONTENUMPROCEXA)lpEnumData->userProc; 324 324 ENUMLOGFONTEXA logFont; 325 325 NEWTEXTMETRICEXA textM; … … 340 340 { 341 341 ENUMUSERDATA *lpEnumData = (ENUMUSERDATA *)arg4; 342 FONTENUMPROCEXW proc = (FONTENUMPROCEXW)lpEnumData->userProc; 342 FONTENUMPROCEXW proc = (FONTENUMPROCEXW)lpEnumData->userProc; 343 343 ENUMLOGFONTEXW LogFont; 344 344 NEWTEXTMETRICEXW textM; … … 598 598 * Fills a CHARSETINFO structure for a character set, code page, or 599 599 * font. This allows making the correspondance between different labelings 600 * (character set, Windows, ANSI, and OEM codepages, and Unicode ranges) 600 * (character set, Windows, ANSI, and OEM codepages, and Unicode ranges) 601 601 * of the same encoding. 602 602 * … … 613 613 if flags == TCI_SRCCHARSET: a character set value 614 614 if flags == TCI_SRCCODEPAGE: a code page value 615 615 */ 616 616 LPCHARSETINFO lpCs, /* structure to receive charset information */ 617 617 DWORD flags /* determines interpretation of lpSrc */ … … 620 620 switch (flags) { 621 621 case TCI_SRCFONTSIG: 622 622 while (!(*lpSrc>>index & 0x0001) && index<MAXTCIINDEX) index++; 623 623 break; 624 624 case TCI_SRCCODEPAGE: -
trunk/src/gdi32/gdi32.cpp
r1961 r1966 1 /* $Id: gdi32.cpp,v 1.2 2 1999-12-03 17:31:49 cbratschiExp $ */1 /* $Id: gdi32.cpp,v 1.23 1999-12-04 13:53:12 hugh Exp $ */ 2 2 3 3 /* … … 149 149 //****************************************************************************** 150 150 //****************************************************************************** 151 152 static hFntDefaultGui = NULL; 151 153 HGDIOBJ WIN32API GetStockObject(int arg1) 152 154 { 153 155 HGDIOBJ obj; 154 156 155 switch(arg1) { 157 switch(arg1) 158 { 156 159 case DEFAULT_GUI_FONT: 157 obj = NULL; 160 if(NULL==hFntDefaultGui) 161 hFntDefaultGui = CreateFontA( 0, 0, 0, 0, FW_MEDIUM, FALSE, 162 FALSE, FALSE, ANSI_CHARSET, 163 OUT_DEFAULT_PRECIS, 164 CLIP_DEFAULT_PRECIS, 165 DEFAULT_QUALITY, 166 FIXED_PITCH|FF_MODERN, "WarpSans"); 167 obj = hFntDefaultGui; 158 168 break; 159 169 default: … … 168 178 UINT WIN32API RealizePalette( HDC arg1) 169 179 { 170 dprintf(("GDI32: RealizePalette \n"));180 dprintf(("GDI32: RealizePalette(0x%08X)\n",arg1)); 171 181 return O32_RealizePalette(arg1); 172 182 } … … 176 186 { 177 187 178 if(DIBSection::getSection() != NULL) 188 if(DIBSection::getSection() != NULL) 189 { 190 DIBSection *dsect = DIBSection::find(arg1); 191 if(dsect) 179 192 { 180 DIBSection *dsect = DIBSection::find(arg1); 181 if(dsect) 182 { 183 return dsect->GetDIBSection(arg2, (DIBSECTION*)arg3); 184 } 193 return dsect->GetDIBSection(arg2, (DIBSECTION*)arg3); 185 194 } 186 187 dprintf(("GDI32: GetObject %X %X %X\n", arg1, arg2, arg3)); 188 return O32_GetObject(arg1, arg2, arg3); 195 } 196 197 dprintf(("GDI32: GetObject %X %X %X\n", arg1, arg2, arg3)); 198 return O32_GetObject(arg1, arg2, arg3); 189 199 } 190 200 //****************************************************************************** … … 214 224 HPALETTE WIN32API CreatePalette( const LOGPALETTE * arg1) 215 225 { 226 HPALETTE rc; 216 227 dprintf(("GDI32: CreatePalette\n")); 217 return O32_CreatePalette(arg1); 228 for(int i=0; i<arg1->palNumEntries;i++) 229 { 230 dprintf2(("Index %d : 0x%08X\n",i, *((DWORD*)(&arg1->palPalEntry[i])) )); 231 } 232 rc = O32_CreatePalette(arg1); 233 dprintf((" returns 0x%08X\n",rc)); 234 235 return rc; 218 236 } 219 237 //****************************************************************************** … … 266 284 HBITMAP WIN32API CreateDIBitmap(HDC arg1, const BITMAPINFOHEADER * arg2, DWORD arg3, const void * arg4, const BITMAPINFO * arg5, UINT arg6) 267 285 { 286 int iHeight; 287 HBITMAP rc; 268 288 dprintf(("GDI32: CreateDIBitmap\n")); 269 //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA) 270 if(arg2->biHeight < 0) { 271 ((BITMAPINFOHEADER *)arg2)->biHeight = -arg2->biHeight; 289 290 //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA) 291 292 iHeight = arg2->biHeight; 293 if(arg2->biHeight < 0) 294 { 295 ((BITMAPINFOHEADER *)arg2)->biHeight = -arg2->biHeight; 272 296 } 273 return O32_CreateDIBitmap(arg1, arg2, arg3, arg4, arg5, arg6); 297 298 rc = O32_CreateDIBitmap(arg1, arg2, arg3, arg4, arg5, arg6); 299 300 ((BITMAPINFOHEADER *)arg2)->biHeight = iHeight; 301 302 return rc; 274 303 } 275 304 //****************************************************************************** … … 378 407 int WIN32API SetStretchBltMode( HDC arg1, int arg2) 379 408 { 380 dprintf(("GDI32: SetStretchBltMode %X, %x\n",arg1, arg2));409 dprintf(("GDI32: SetStretchBltMode 0x%08X, 0x%08X\n",arg1, arg2)); 381 410 382 411 if(DIBSection::getSection() != NULL) … … 398 427 //// dprintf(("GDI32: SelectObject\n")); 399 428 400 if(DIBSection::getSection() != NULL) { 401 DIBSection *dsect; 402 403 dsect = DIBSection::find(hdc); 404 if(dsect) {//remove previously selected dibsection 405 dsect->UnSelectDIBObject(); 406 } 407 dsect = DIBSection::find((DWORD)hObj); 408 if(dsect) { 409 dsect->SelectDIBObject(hdc); 410 } 429 if(DIBSection::getSection() != NULL) 430 { 431 DIBSection *dsect; 432 433 dsect = DIBSection::find(hdc); 434 if(dsect) 435 { 436 //remove previously selected dibsection 437 dsect->UnSelectDIBObject(); 438 } 439 dsect = DIBSection::find((DWORD)hObj); 440 if(dsect) 441 { 442 dsect->SelectDIBObject(hdc); 443 } 411 444 } 412 445 rc = O32_SelectObject(hdc, hObj); 413 if(rc != 0 && DIBSection::getSection != NULL) { 414 DIBSection *dsect = DIBSection::find((DWORD)rc); 415 if(dsect) { 416 dsect->UnSelectDIBObject(); 417 } 446 if(rc != 0 && DIBSection::getSection != NULL) 447 { 448 DIBSection *dsect = DIBSection::find((DWORD)rc); 449 if(dsect) 450 { 451 dsect->UnSelectDIBObject(); 452 } 418 453 } 419 454 return(rc); … … 423 458 HPALETTE WIN32API SelectPalette(HDC arg1, HPALETTE arg2, BOOL arg3) 424 459 { 425 dprintf(("GDI32: SelectPalette %x", arg1)); 426 return O32_SelectPalette(arg1, arg2, arg3); 460 dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)\n", arg1, arg2, arg3)); 461 if(DIBSection::getSection() != NULL) 462 { 463 DIBSection *dsect = DIBSection::findHDC(arg1); 464 if(dsect) 465 { 466 PALETTEENTRY Pal[256]; 467 char PalSize = dsect->GetBitCount(); 468 dprintf((" - Set Palette Values in DIBSection\n")); 469 if(PalSize<=8) 470 { 471 GetPaletteEntries( arg2, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal); 472 dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal); 473 } 474 475 } 476 } 477 return O32_SelectPalette(arg1, arg2, arg3); 427 478 } 428 479 //****************************************************************************** … … 651 702 char *astring2 = UnicodeToAsciiString((LPWSTR)arg2); 652 703 char *astring3 = UnicodeToAsciiString((LPWSTR)arg3); 704 653 705 if(arg4) 654 706 { … … 697 749 devmode.dmReserved1 = arg4->dmReserved1; 698 750 devmode.dmReserved2 = arg4->dmReserved2; 699 700 751 rc = O32_CreateDC(astring1,astring2,astring3,&devmode); 701 752 } … … 706 757 FreeAsciiString(astring2); 707 758 FreeAsciiString(astring3); 759 708 760 if(arg4) 709 761 { … … 739 791 HENHMETAFILE WIN32API CreateEnhMetaFileW( HDC arg1, LPCWSTR arg2, const RECT * arg3, LPCWSTR arg4) 740 792 { 741 dprintf(("GDI32: CreateEnhMetaFileW STUB")); 742 // NOTE: This will not work as is (needs UNICODE support) 743 // return O32_CreateEnhMetaFile(arg1, arg2, arg3, arg4); 744 return 0; 793 char *astring1 = UnicodeToAsciiString((LPWSTR)arg2); 794 char *astring2 = UnicodeToAsciiString((LPWSTR)arg4); 795 HENHMETAFILE rc; 796 797 dprintf(("GDI32: CreateMetaFileW")); 798 rc = O32_CreateEnhMetaFile(arg1,astring1,arg3,astring2); 799 FreeAsciiString(astring1); 800 FreeAsciiString(astring2); 801 return rc; 745 802 } 746 803 //****************************************************************************** … … 1322 1379 UINT WIN32API GetNearestPaletteIndex( HPALETTE arg1, COLORREF arg2) 1323 1380 { 1324 dprintf(("GDI32: GetNearestPaletteIndex\n")); 1325 return O32_GetNearestPaletteIndex(arg1, arg2); 1381 UINT rc; 1382 dprintf(("GDI32: GetNearestPaletteIndex (0x%08X ,0x%08X) ",arg1,arg2)); 1383 rc = O32_GetNearestPaletteIndex(arg1, arg2); 1384 dprintf(("Returns %d\n",rc)); 1385 return rc; 1326 1386 } 1327 1387 //****************************************************************************** … … 2108 2168 //****************************************************************************** 2109 2169 //WINE: OBJECTS\DIB.C 2110 //****************************************************************************** 2111 HBITMAP WIN32API CreateDIBSection( HDC hdc, BITMAPINFO *pbmi, UINT iUsage,2112 2170 //********************************************************************************* 2171 HBITMAP WIN32API CreateDIBSection( HDC hdc, BITMAPINFO *pbmi, UINT iUsage, 2172 VOID **ppvBits, HANDLE hSection, DWORD dwOffset) 2113 2173 { 2114 2174 HBITMAP res = 0; 2115 2175 BOOL fFlip = 0; 2176 int iHeight, iWidth; 2116 2177 2117 2178 dprintf(("GDI32: CreateDIBSection %x %x %x %d", hdc, iUsage, hSection, dwOffset)); 2118 if(hSection) { 2119 dprintf(("GDI32: CreateDIBSection, hSection != NULL, not supported!\n")); 2120 return NULL; 2179 if(hSection) 2180 { 2181 dprintf(("GDI32: CreateDIBSection, hSection != NULL, not supported!\n")); 2182 return NULL; 2121 2183 } 2122 2184 2123 2185 //SvL: 13-9-98: StarCraft uses bitmap with negative height 2124 if(pbmi->bmiHeader.biWidth < 0) { 2125 pbmi->bmiHeader.biWidth = -pbmi->bmiHeader.biWidth; 2126 fFlip = FLIP_HOR; 2186 iWidth = pbmi->bmiHeader.biWidth; 2187 if(pbmi->bmiHeader.biWidth < 0) 2188 { 2189 pbmi->bmiHeader.biWidth = -pbmi->bmiHeader.biWidth; 2190 fFlip = FLIP_HOR; 2127 2191 } 2128 if(pbmi->bmiHeader.biHeight < 0) { 2129 pbmi->bmiHeader.biHeight = -pbmi->bmiHeader.biHeight; 2130 fFlip |= FLIP_VERT; 2192 iHeight = pbmi->bmiHeader.biHeight; 2193 if(pbmi->bmiHeader.biHeight < 0) 2194 { 2195 pbmi->bmiHeader.biHeight = -pbmi->bmiHeader.biHeight; 2196 fFlip |= FLIP_VERT; 2131 2197 } 2132 2198 … … 2134 2200 if (res) 2135 2201 { 2136 DIBSection *dsect = new DIBSection((WINBITMAPINFOHEADER *)&pbmi->bmiHeader, (DWORD)res, fFlip); 2137 dprintf(("Constructor returned\n",res)); 2138 if(ppvBits!=NULL) 2139 *ppvBits = dsect->GetDIBObject(); 2140 dprintf(("GDI32: return %08X\n",res)); 2141 return(res); 2202 ULONG Pal[256]; 2203 char PalSize; 2204 LOGPALETTE tmpPal = { 0x300,1,{0,0,0,0}}; 2205 HPALETTE hpalCur, hpalTmp; 2206 DIBSection *dsect = new DIBSection((WINBITMAPINFOHEADER *)&pbmi->bmiHeader, (DWORD)res, fFlip); 2207 dprintf(("Constructor returned\n")); 2208 2209 if(NULL!=dsect) 2210 { 2211 PalSize = dsect->GetBitCount(); 2212 if(PalSize<=8) 2213 { 2214 // Now get the current Palette from the DC 2215 hpalTmp = CreatePalette(&tmpPal); 2216 hpalCur = SelectPalette(hdc, hpalTmp, FALSE); 2217 2218 // and use it to set the DIBColorTable 2219 GetPaletteEntries( hpalCur, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal); 2220 dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal); 2221 2222 // Restore the DC Palette 2223 SelectPalette(hdc,hpalCur,FALSE); 2224 DeleteObject(hpalTmp); 2225 } 2226 // Set the hdc in the DIBSection so we can update the palete if a new 2227 // Paletet etc. gets selected into the DC. 2228 2229 dsect->SelectDIBObject(hdc); 2230 2231 if(ppvBits!=NULL) 2232 *ppvBits = dsect->GetDIBObject(); 2233 2234 pbmi->bmiHeader.biWidth = iWidth; 2235 pbmi->bmiHeader.biHeight = iHeight; 2236 2237 dprintf(("GDI32: return %08X\n",res)); 2238 return(res); 2239 } 2142 2240 } 2143 2241 2144 2242 /* Error. */ 2145 if (res) DeleteObject(res); 2243 if (res) 2244 DeleteObject(res); 2146 2245 *ppvBits = NULL; 2147 2246 #ifdef DEBUG … … 2156 2255 //****************************************************************************** 2157 2256 //****************************************************************************** 2158 UINT WIN32API GetDIBColorTable( HDC hdc, UINT uStartIndex, UINT cEntries,2257 UINT WIN32API GetDIBColorTable( HDC hdc, UINT uStartIndex, UINT cEntries, 2159 2258 RGBQUAD *pColors) 2160 2259 { … … 2188 2287 2189 2288 dprintf(("GDI32: SetDIBColorTable\n")); 2190 if(dsect) { 2191 return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors)); 2289 if(dsect) 2290 { 2291 return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors)); 2192 2292 } 2193 else return(0); 2293 else 2294 return(0); 2194 2295 } 2195 2296 //****************************************************************************** … … 2572 2673 * Result : TRUE / FALSE 2573 2674 * Remark : 2574 * Status : UNTESTED STUB2675 * Status : UNTESTED 2575 2676 * 2576 2677 * Author : Patrick Haller [Mon, 1998/06/15 08:00] 2678 * Markus Montkowski [Wen, 1999/01/12 20:18] 2577 2679 *****************************************************************************/ 2578 2680 … … 2581 2683 CONST XFORM *lLPXFORM2) 2582 2684 { 2583 dprintf(("GDI32: CombineTransform(%08xh,%08xh,%08xh) not implemented.\n",2685 dprintf(("GDI32: CombineTransform(%08xh,%08xh,%08xh).\n", 2584 2686 lLPXFORMResult, 2585 2687 lLPXFORM1, 2586 2688 lLPXFORM2)); 2587 2689 2690 XFORM xfrm; 2691 if( O32_IsBadWritePtr( (void*)lLPXFORMResult, sizeof(XFORM)) || 2692 O32_IsBadReadPtr( (void*)lLPXFORM1, sizeof(XFORM)) || 2693 O32_IsBadWritePtr( (void*)lLPXFORM2, sizeof(XFORM)) ) 2588 2694 return (FALSE); 2695 2696 // Add the translations 2697 lLPXFORMResult->eDx = lLPXFORM1->eDx + lLPXFORM2->eDx; 2698 lLPXFORMResult->eDy = lLPXFORM1->eDy + lLPXFORM2->eDy; 2699 2700 // Multiply the matrixes 2701 xfrm.eM11 = lLPXFORM1->eM11 * lLPXFORM2->eM11 + lLPXFORM1->eM21 * lLPXFORM1->eM12; 2702 xfrm.eM12 = lLPXFORM1->eM11 * lLPXFORM2->eM12 + lLPXFORM1->eM12 * lLPXFORM1->eM22; 2703 xfrm.eM21 = lLPXFORM1->eM21 * lLPXFORM2->eM11 + lLPXFORM1->eM22 * lLPXFORM1->eM21; 2704 xfrm.eM22 = lLPXFORM1->eM21 * lLPXFORM2->eM12 + lLPXFORM1->eM22 * lLPXFORM1->eM22; 2705 2706 // Now copy to resulting XFROM as the pt must not be distinct 2707 lLPXFORMResult->eM11 = xfrm.eM11; 2708 lLPXFORMResult->eM12 = xfrm.eM12; 2709 lLPXFORMResult->eM21 = xfrm.eM21; 2710 lLPXFORMResult->eM22 = xfrm.eM22; 2711 2712 return (TRUE); 2589 2713 } 2590 2714
Note:
See TracChangeset
for help on using the changeset viewer.