- Timestamp:
- Sep 16, 1999, 4:58:33 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/dib.cpp
r949 r960 1 /* $Id: dib.cpp,v 1. 1 1999-09-15 23:18:49 sandervlExp $ */1 /* $Id: dib.cpp,v 1.2 1999-09-16 14:57:05 phaller Exp $ */ 2 2 3 3 /* … … 132 132 133 133 //SvL: Wine code doesn't work for OS/2 1.3 bitmaps 134 if (bmi->bmiHeader.biSize == sizeof(BITMAPINFOHEADER)) { 135 if (bmi->bmiHeader.biBitCount > 8) return; 136 colors = bmi->bmiHeader.biClrUsed; 137 bitcount = bmi->bmiHeader.biBitCount; 138 colorptr = (char*)bmi->bmiColors; 134 if (bmi->bmiHeader.biSize == sizeof(BITMAPINFOHEADER)) 135 { 136 if (bmi->bmiHeader.biBitCount > 8) return; 137 colors = bmi->bmiHeader.biClrUsed; 138 bitcount = bmi->bmiHeader.biBitCount; 139 colorptr = (char*)bmi->bmiColors; 140 incr = 4; 139 141 } 140 142 else 141 if (bmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) { 142 BITMAPCOREHEADER *core = (BITMAPCOREHEADER *)bmi; 143 144 if (core->bcBitCount > 8) return; 145 colors = (1 << core->bcBitCount); 146 bitcount = core->bcBitCount; 147 colorptr = (char*)(core + 1); 148 } 149 else { 150 dprintf(("Wrong bitmap header size!\n")); 151 return; 152 } 143 if (bmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) 144 { 145 BITMAPCOREHEADER *core = (BITMAPCOREHEADER *)bmi; 146 147 if (core->bcBitCount > 8) return; 148 colors = (1 << core->bcBitCount); 149 bitcount = core->bcBitCount; 150 colorptr = (char*)(core + 1); 151 incr = 3; 152 } 153 else 154 { 155 dprintf(("Wrong bitmap header size!\n")); 156 return; 157 } 158 153 159 if (!colors && (bitcount <= 8)) 154 160 colors = 1 << bitcount; 155 161 156 162 c_W = GetSysColor(COLOR_WINDOW); … … 163 169 case 4: pix = pix >> 4; break; 164 170 case 8: break; 165 default: 166 dprintf(("(%d): Unsupported depth\n", bitcount)); 171 default: 172 dprintf(("(%d): Unsupported depth\n", bitcount)); 167 173 return; 168 174 } … … 182 188 ptr = (RGBQUAD*)(colorptr +i*incr); 183 189 c_C = RGB(ptr->rgbRed, ptr->rgbGreen, ptr->rgbBlue); 184 if (c_C == RGB(128, 128, 128)) { 190 if (c_C == RGB(128, 128, 128)) { 185 191 ptr->rgbRed = GetRValue(c_S); 186 192 ptr->rgbGreen = GetGValue(c_S); 187 193 ptr->rgbBlue = GetBValue(c_S); 188 } else if (c_C == RGB(192, 192, 192)) { 194 } else if (c_C == RGB(192, 192, 192)) { 189 195 ptr->rgbRed = GetRValue(c_F); 190 196 ptr->rgbGreen = GetGValue(c_F); 191 197 ptr->rgbBlue = GetBValue(c_F); 192 } else if (c_C == RGB(223, 223, 223)) { 198 } else if (c_C == RGB(223, 223, 223)) { 193 199 ptr->rgbRed = GetRValue(c_L); 194 200 ptr->rgbGreen = GetGValue(c_L); 195 201 ptr->rgbBlue = GetBValue(c_L); 196 } 202 } 197 203 } 198 204 } 199 200 } 205 206 }
Note:
See TracChangeset
for help on using the changeset viewer.