- Timestamp:
- Aug 18, 2000, 8:14:59 PM (25 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r3726 r4034 1 /* $Id: blit.cpp,v 1.1 5 2000-06-17 11:58:07sandervl Exp $ */1 /* $Id: blit.cpp,v 1.16 2000-08-18 18:14:56 sandervl Exp $ */ 2 2 3 3 /* … … 244 244 memcpy(infoLoc, info, sizeof(BITMAPINFO)); 245 245 246 if(GetDIBColorTable(hdc, 0, info->bmiHeader.biClrUsed, pColors) == 0) 246 if(GetDIBColorTable(hdc, 0, info->bmiHeader.biClrUsed, pColors) == 0) { 247 dprintf(("ERROR: StretchDIBits: GetDIBColorTable failed!!")); 247 248 return FALSE; 248 249 } 249 250 for(i=0;i<info->bmiHeader.biClrUsed;i++, pColorIndex++) 250 251 { … … 268 269 return rc; 269 270 } 270 271 271 rc = O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, 272 272 widthSrc, heightSrc, (void *)bits, -
trunk/src/gdi32/dbglocal.cpp
r3705 r4034 1 /* $Id: dbglocal.cpp,v 1. 3 2000-06-14 13:17:49sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.4 2000-08-18 18:14:56 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #ifdef DEBUG 17 17 18 USHORT DbgEnabled[DBG_MAXFILES]; 18 USHORT DbgEnabled[DBG_MAXFILES] = {0}; 19 USHORT DbgEnabledLvl2[DBG_MAXFILES] = {0}; 20 19 21 char *DbgFileNames[DBG_MAXFILES] = 20 22 { … … 43 45 { 44 46 char *envvar = getenv(DBG_ENVNAME); 47 char *envvar2= getenv(DBG_ENVNAME_LVL2); 45 48 char *dbgvar; 46 49 int i; … … 73 76 } 74 77 } 78 if(envvar2) { 79 dbgvar = strstr(envvar2, "dll"); 80 if(dbgvar) { 81 if(*(dbgvar-1) == '+') { 82 for(i=0;i<DBG_MAXFILES;i++) { 83 DbgEnabledLvl2[i] = 1; 84 } 85 } 86 } 87 for(i=0;i<DBG_MAXFILES;i++) { 88 dbgvar = strstr(envvar2, DbgFileNames[i]); 89 if(dbgvar) { 90 if(*(dbgvar-1) == '-') { 91 DbgEnabledLvl2[i] = 0; 92 } 93 else 94 if(*(dbgvar-1) == '+') { 95 DbgEnabledLvl2[i] = 1; 96 } 97 } 98 } 99 } 75 100 } 76 101 //****************************************************************************** -
trunk/src/gdi32/dbglocal.h
r3705 r4034 1 /* $Id: dbglocal.h,v 1. 3 2000-06-14 13:17:49sandervl Exp $ */1 /* $Id: dbglocal.h,v 1.4 2000-08-18 18:14:56 sandervl Exp $ */ 2 2 3 3 /* … … 18 18 19 19 #define DBG_ENVNAME "dbg_gdi32" 20 #define DBG_ENVNAME_LVL2 "dbg_user32_lvl2" 20 21 21 22 #define DBG_gdi32 0 … … 40 41 41 42 extern USHORT DbgEnabled[DBG_MAXFILES]; 43 extern USHORT DbgEnabledLvl2[DBG_MAXFILES]; 42 44 43 45 #ifdef dprintf … … 46 48 47 49 #define dprintf(a) if(DbgEnabled[DBG_LOCALLOG] == 1) WriteLog a 50 51 #ifdef dprintf2 52 #undef dprintf2 53 #endif 54 55 #define dprintf2(a) if(DbgEnabledLvl2[DBG_LOCALLOG] == 1) WriteLog a 48 56 49 57 #else -
trunk/src/gdi32/dibitmap.cpp
r3235 r4034 1 /* $Id: dibitmap.cpp,v 1. 7 2000-03-25 12:19:07sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.8 2000-08-18 18:14:56 sandervl Exp $ */ 2 2 3 3 /* … … 92 92 BOOL fCreateDC = FALSE; 93 93 94 dprintf(("GDI32: CreateDIBSection %x %x %x %x % d", hdc, iUsage, ppvBits, hSection, dwOffset));94 dprintf(("GDI32: CreateDIBSection %x %x %x %x %x %d", hdc, pbmi, iUsage, ppvBits, hSection, dwOffset)); 95 95 96 96 //SvL: 13-9-98: StarCraft uses bitmap with negative height … … 128 128 if(PalSize <= 8) 129 129 { 130 ULONG Pal[256] ;130 ULONG Pal[256], nrcolors; 131 131 LOGPALETTE tmpPal = { 0x300,1,{0,0,0,0}}; 132 132 HPALETTE hpalCur, hpalTmp; … … 137 137 138 138 // and use it to set the DIBColorTable 139 GetPaletteEntries( hpalCur, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);140 dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal);139 nrcolors = GetPaletteEntries( hpalCur, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal); 140 dsect->SetDIBColorTable(0, nrcolors, (RGBQUAD*)&Pal); 141 141 142 142 // Restore the DC Palette -
trunk/src/gdi32/dibsect.cpp
r3755 r4034 1 /* $Id: dibsect.cpp,v 1.3 6 2000-06-26 10:27:45sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.37 2000-08-18 18:14:57 sandervl Exp $ */ 2 2 3 3 /* 4 4 * GDI32 DIB sections 5 5 * 6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)6 * Copyright 1998-2000 Sander van Leeuwen (sandervl@xs4all.nl) 7 7 * Copyright 1998 Patrick Haller 8 8 * … … 131 131 132 132 dibinfo.dshSection = handle; 133 dibinfo.dsOffset = 0; // TODO: put the correct value here (if createdibsection with file handle)133 dibinfo.dsOffset = dwOffset; 134 134 135 135 if(iUsage == DIB_PAL_COLORS || pbmi->biBitCount <= 8) … … 555 555 dprintf(("Sync destination dibsection %x (%x)", handle, hdc)); 556 556 557 //todo: rgb 565 to 555 conversion if bpp == 16558 if(GetBitCount() == 16) {559 dprintf(("WARNING: need to convert RGB 565 to RGB 555!!"));560 }561 562 557 BITMAPINFO2 *tmphdr = (BITMAPINFO2 *)malloc(os2bmphdrsize); 563 558 memcpy(tmphdr, pOS2bmp, os2bmphdrsize); … … 582 577 tmphdr); 583 578 } 579 if(dibinfo.dsBitfields[1] == 0x3E0) {//RGB 555? 580 dprintf(("DIBSection::sync: convert RGB 565 to RGB 555")); 581 582 destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes; 583 584 if(CPUFeatures & CPUID_MMX) { 585 RGB565to555MMX((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD)); 586 } 587 else RGB565to555((WORD *)destBuf, (WORD *)destBuf, (nDestHeight*dibinfo.dsBm.bmWidthBytes)/sizeof(WORD)); 588 } 584 589 free(tmphdr); 585 590 if(rc != nDestHeight) { -
trunk/src/gdi32/gdi32.cpp
r3929 r4034 1 /* $Id: gdi32.cpp,v 1.5 3 2000-08-02 16:26:43 birdExp $ */1 /* $Id: gdi32.cpp,v 1.54 2000-08-18 18:14:57 sandervl Exp $ */ 2 2 3 3 /* … … 102 102 //****************************************************************************** 103 103 //****************************************************************************** 104 HPEN WIN32API CreatePen( int fnPenStyle, int nWidth, COLORREF crColor) 105 { 106 dprintf(("GDI32: CreatePen\n")); 107 104 ODINFUNCTION3(HPEN, CreatePen, int, fnPenStyle, int, nWidth, COLORREF, crColor) 105 { 108 106 //CB: todo: PS_DOT is different in Win32 (. . . . and not - - - -) 109 107 // Open32 looks like LINETYPE_SHORTDASH instead of LINETYPE_DOT!!! … … 114 112 //****************************************************************************** 115 113 //****************************************************************************** 116 HPEN WIN32API CreatePenIndirect( 117 { 118 dprintf(("GDI32: CreatePenIndirect \n"));114 HPEN WIN32API CreatePenIndirect(const LOGPEN * lplgpn) 115 { 116 dprintf(("GDI32: CreatePenIndirect %x", lplgpn)); 119 117 return O32_CreatePenIndirect(lplgpn); 120 118 } … … 449 447 //****************************************************************************** 450 448 //****************************************************************************** 451 HBRUSH WIN32API CreateSolidBrush( COLORREF arg1) 452 { 453 dprintf(("GDI32: CreateSolidBrush\n")); 454 return O32_CreateSolidBrush(arg1); 449 ODINFUNCTION1(HBRUSH, CreateSolidBrush, COLORREF, color) 450 { 451 return O32_CreateSolidBrush(color); 455 452 } 456 453 //****************************************************************************** … … 491 488 //****************************************************************************** 492 489 //****************************************************************************** 493 BOOL WIN32API Rectangle( HDC arg1, int arg2, int arg3, int arg4, int arg5) 494 { 495 dprintf(("GDI32: Rectangle\n")); 496 return O32_Rectangle(arg1, arg2, arg3, arg4, arg5); 490 ODINFUNCTION5(BOOL, Rectangle, HDC, hdc, int, left, int, top, int, right, int, bottom) 491 { 492 return O32_Rectangle(hdc, left, top, right, bottom); 497 493 } 498 494 //****************************************************************************** … … 592 588 //****************************************************************************** 593 589 //****************************************************************************** 594 int WIN32API Escape( HDC arg1, int arg2, int arg3, LPCSTR arg4, PVOID arg5) 595 { 596 dprintf(("GDI32: Escape")); 597 return O32_Escape(arg1, arg2, arg3, arg4, arg5); 590 int WIN32API Escape( HDC hdc, int nEscape, int cbInput, LPCSTR lpvInData, PVOID lpvOutData) 591 { 592 int rc; 593 594 rc = O32_Escape(hdc, nEscape, cbInput, lpvInData, lpvOutData); 595 if(rc == 0) { 596 dprintf(("GDI32: Escape %x %d %d %x %x returned %d (WARNING: might not be implemented!!) ", hdc, nEscape, cbInput, lpvInData, lpvOutData, rc)); 597 } 598 else dprintf(("GDI32: Escape %x %d %d %x %x returned %d ", hdc, nEscape, cbInput, lpvInData, lpvOutData, rc)); 599 600 return rc; 598 601 } 599 602 //****************************************************************************** -
trunk/src/gdi32/objhandle.cpp
r3705 r4034 1 /* $Id: objhandle.cpp,v 1. 1 2000-06-14 13:17:51sandervl Exp $ */1 /* $Id: objhandle.cpp,v 1.2 2000-08-18 18:14:57 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Handle Management Code for OS/2 … … 124 124 return 0; 125 125 } 126 dprintf(("GDI32: GetObject %X %X %X\n", hObject, size, lpBuffer)); 126 127 if(DIBSection::getSection() != NULL) 127 128 { … … 139 140 } 140 141 141 dprintf(("GDI32: GetObject %X %X %X\n", hObject, size, lpBuffer));142 142 return O32_GetObject(hObject, size, lpBuffer); 143 143 } -
trunk/src/gdi32/palette.cpp
r3594 r4034 1 /* $Id: palette.cpp,v 1. 5 2000-05-23 18:46:21sandervl Exp $ */1 /* $Id: palette.cpp,v 1.6 2000-08-18 18:14:58 sandervl Exp $ */ 2 2 3 3 /* … … 71 71 } 72 72 rc = O32_CreatePalette(arg1); 73 dprintf(("GDI32: CreatePalette returns 0x%08X\n",rc));73 dprintf(("GDI32: CreatePalette %x %d returns 0x%08X\n", arg1, arg1->palNumEntries, rc)); 74 74 75 75 return rc; … … 77 77 //****************************************************************************** 78 78 //****************************************************************************** 79 HPALETTE WIN32API SelectPalette(HDC arg1, HPALETTE arg2, BOOL arg3)79 HPALETTE WIN32API SelectPalette(HDC hdc, HPALETTE hPalette, BOOL bForceBackground) 80 80 { 81 dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X) \n", arg1, arg2, arg3));81 dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)", hdc, hPalette, bForceBackground)); 82 82 if(DIBSection::getSection() != NULL) 83 83 { 84 DIBSection *dsect = DIBSection::findHDC( arg1);84 DIBSection *dsect = DIBSection::findHDC(hdc); 85 85 if(dsect) 86 86 { 87 int nrcolors; 87 88 PALETTEENTRY Pal[256]; 88 89 char PalSize = dsect->GetBitCount(); … … 90 91 if(PalSize<=8) 91 92 { 92 GetPaletteEntries( arg2, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);93 dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal);93 nrcolors = GetPaletteEntries( hPalette, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal); 94 dsect->SetDIBColorTable(0, nrcolors, (RGBQUAD*)&Pal); 94 95 } 95 96 96 97 } 97 98 } 98 return O32_SelectPalette( arg1, arg2, arg3);99 return O32_SelectPalette(hdc, hPalette, bForceBackground); 99 100 } 100 101 //****************************************************************************** … … 117 118 //****************************************************************************** 118 119 //****************************************************************************** 119 UINT WIN32API GetPaletteEntries( HPALETTE hPalette, UINT arg2, UINT arg3, PPALETTEENTRY arg4)120 UINT WIN32API GetPaletteEntries(HPALETTE hPalette, UINT iStart, UINT count, PPALETTEENTRY entries) 120 121 { 121 dprintf(("GDI32: GetPaletteEntries %x %d-%d %x", hPalette, arg2, arg3, arg4)); 122 return O32_GetPaletteEntries(hPalette, arg2, arg3, arg4); 122 UINT rc; 123 124 rc = O32_GetPaletteEntries(hPalette, iStart, count, entries); 125 dprintf(("GDI32: GetPaletteEntries %x %d-%d %x returned %d", hPalette, iStart, count, entries, rc)); 126 return rc; 123 127 } 124 128 //****************************************************************************** … … 151 155 HPALETTE WIN32API CreateHalftonePalette(HDC hdc) 152 156 { 153 dprintf(("GDI32: CreateHalftonePalette, not implemented\n")); 154 return(NULL); 157 int i, r, g, b; 158 struct { 159 WORD Version; 160 WORD NumberOfEntries; 161 PALETTEENTRY aEntries[256]; 162 } Palette = { 163 0x300, 256 164 }; 165 166 dprintf(("GDI32: CreateHalftonePalette %x", hdc)); 167 GetSystemPaletteEntries(hdc, 0, 256, Palette.aEntries); 168 return CreatePalette((LOGPALETTE *)&Palette); 169 170 for (r = 0; r < 6; r++) { 171 for (g = 0; g < 6; g++) { 172 for (b = 0; b < 6; b++) { 173 i = r + g*6 + b*36 + 10; 174 Palette.aEntries[i].peRed = r * 51; 175 Palette.aEntries[i].peGreen = g * 51; 176 Palette.aEntries[i].peBlue = b * 51; 177 } 178 } 179 } 180 181 for (i = 216; i < 246; i++) { 182 int v = (i - 216) * 8; 183 Palette.aEntries[i].peRed = v; 184 Palette.aEntries[i].peGreen = v; 185 Palette.aEntries[i].peBlue = v; 186 } 187 188 return CreatePalette((LOGPALETTE *)&Palette); 155 189 } 156 190 //****************************************************************************** -
trunk/src/gdi32/rgbcvt.asm
r2614 r4034 1 ; $Id: rgbcvt.asm,v 1. 3 2000-02-03 18:59:04sandervl Exp $1 ; $Id: rgbcvt.asm,v 1.4 2000-08-18 18:14:58 sandervl Exp $ 2 2 ; Copyright 2000 Daniela Engert (dani@ngrt.de) 3 3 … … 9 9 10 10 align 4 11 and1mask dd 12 dd 11 and1mask dd 0001F001Fh 12 dd 0001F001Fh 13 13 and2mask dd 0FFC0FFC0h 14 14 dd 0FFC0FFC0h 15 and2mask565 dd 0FFE07FE0h 16 dd 07FE07FE0h 15 17 16 18 .CODE … … 37 39 shl eax, 1 38 40 39 and edx, 00 1F001Fh41 and edx, 0001F001Fh 40 42 and eax, 0FFC0FFC0h 41 43 … … 51 53 mov ax, [esi] 52 54 mov dx, ax 53 and dx, 00 1Fh55 and dx, 0001Fh 54 56 shl ax, 1 55 57 and ax, 0FFC0h … … 63 65 64 66 RGB555to565 ENDP 67 68 PUBLIC RGB565to555 69 70 RGB565to555 PROC NEAR 71 72 push esi 73 push edi 74 cld 75 76 mov edi, eax ; _Optlink arg1 = EAX 77 mov esi, edx ; _Optlink arg2 = EDX 78 shr ecx, 1 ; _Optlink arg3 = ECX 79 pushf 80 cvt: 81 mov eax, [esi] 82 mov edx, eax 83 84 add esi, 4 85 shr eax, 1 86 87 and edx, 0001F001Fh 88 and eax, 0FFE07FE0h 89 90 add edi, 4 91 or eax, edx 92 93 mov [edi-4], eax 94 loop cvt 95 96 popf 97 jnc SHORT done 98 99 mov ax, [esi] 100 mov dx, ax 101 and dx, 0001Fh 102 shr ax, 1 103 and ax, 0FFE0h 104 or ax, dx 105 mov [edi], ax 106 107 done: 108 pop edi 109 pop esi 110 ret 111 112 RGB565to555 ENDP 65 113 66 114 ; void _Optlink RGB555to565MMX(WORD *dest, WORD *src, ULONG num); … … 151 199 RGB555to565MMX ENDP 152 200 201 202 ; void _Optlink RGB565to555MMX(WORD *dest, WORD *src, ULONG num); 203 204 PUBLIC RGB565to555MMX 205 206 RGB565to555MMX PROC NEAR 207 push esi 208 push edi 209 cld 210 211 cmp ecx, 0 212 jz done 213 214 push ecx 215 216 mov edi, eax ; _Optlink arg1 = EAX 217 mov esi, edx ; _Optlink arg2 = EDX 218 shr ecx, 3 ; _Optlink arg3 = ECX 219 jz lastpixels 220 221 sub esp, 108 222 fsaved dword ptr [esp] 223 224 movq mm2, qword ptr and1mask ; 0001F001F001F001Fh 225 movq mm3, qword ptr and2mask565 ; FFE07FE007FE07FE0h 226 227 cvt: 228 movq mm0, qword ptr [esi] 229 add edi, 16 230 231 movq mm4, qword ptr [esi+8] 232 movq mm1, mm0 233 234 movq mm5, mm4 235 psrlq mm0, 1 236 237 psrlq mm4, 1 238 pand mm1, mm2 239 240 pand mm0, mm3 241 pand mm5, mm2 242 243 pand mm4, mm3 244 por mm0, mm1 245 246 por mm4, mm5 247 add esi, 16 248 249 movq qword ptr [edi-16], mm0 250 dec ecx 251 252 movq qword ptr [edi-8], mm4 253 jnz cvt 254 255 nop 256 nop 257 258 frstord dword ptr [esp] 259 add esp, 108 260 261 lastpixels: 262 pop ecx 263 and ecx, 3 264 jz short done 265 266 cvt2loop: 267 mov ax, [esi] 268 mov dx, ax 269 270 add esi, 2 271 and dx, 001Fh 272 273 shr ax, 1 274 add edi, 2 275 276 and ax, 0FFE0h 277 or ax, dx 278 279 mov [edi-2], ax 280 loop cvt2loop 281 282 done: 283 pop edi 284 pop esi 285 ret 286 287 RGB565to555MMX ENDP 288 153 289 END -
trunk/src/gdi32/rgbcvt.h
r2614 r4034 1 //$Id: rgbcvt.h,v 1. 1 2000-02-03 18:59:04sandervl Exp $1 //$Id: rgbcvt.h,v 1.2 2000-08-18 18:14:58 sandervl Exp $ 2 2 #ifndef __RGBCVT_H__ 3 3 #define __RGBCVT_H__ … … 6 6 void _Optlink RGB555to565MMX(WORD *dest, WORD *src, ULONG num); 7 7 8 void _Optlink RGB565to555(WORD *dest, WORD *src, ULONG num); 9 void _Optlink RGB565to555MMX(WORD *dest, WORD *src, ULONG num); 10 8 11 #endif //__RGBCVT_H__ -
trunk/src/gdi32/text.cpp
r4012 r4034 1 /* $Id: text.cpp,v 1.1 1 2000-08-14 15:51:20 cbratschiExp $ */1 /* $Id: text.cpp,v 1.12 2000-08-18 18:14:59 sandervl Exp $ */ 2 2 3 3 /* … … 426 426 INT rc; 427 427 428 dprintf(("InternalDrawTextExW %x %s %d %x", hdc, astring, cchText, dwDTFormat)); 428 429 rc = InternalDrawTextExA(hdc,astring,cchText,lprc,dwDTFormat,lpDTParams,isDrawTextEx); 429 430 if (dwDTFormat & DT_MODIFYSTRING && (dwDTFormat & (DT_END_ELLIPSIS | DT_PATH_ELLIPSIS))) AsciiToUnicode(astring,(LPWSTR)lpchText);
Note:
See TracChangeset
for help on using the changeset viewer.