Changeset 1533 for trunk/src/gdi32/dibsect.cpp
- Timestamp:
- Oct 31, 1999, 10:38:20 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibsect.cpp
r1396 r1533 1 /* $Id: dibsect.cpp,v 1. 5 1999-10-21 19:25:06 sandervlExp $ */1 /* $Id: dibsect.cpp,v 1.6 1999-10-31 21:38:15 achimha Exp $ */ 2 2 3 3 /* … … 12 12 #define INCL_GPI 13 13 #define INCL_WIN 14 #include <os2wrap.h> 14 #include <os2wrap.h> //Odin32 OS/2 api wrappers 15 15 #include <stdlib.h> 16 16 #include <string.h> … … 27 27 : bmpBits(NULL), pOS2bmp(NULL), next(NULL) 28 28 { 29 int bmpsize = pbmi->biWidth, os2bmpsize; 30 29 int os2bmpsize; 30 31 bmpsize = pbmi->biWidth; 31 32 /* @@@PH 98/06/07 -- high-color bitmaps don't have palette */ 32 33 … … 61 62 bmpsize = (bmpsize + 3) & ~3; 62 63 } 64 63 65 bmpBits = (char *)malloc(bmpsize*pbmi->biHeight); 64 66 … … 85 87 this->handle = handle; 86 88 87 if(section == NULL) { 88 section = this; 89 if(section == NULL) 90 { 91 dprintf(("section was NULL\n")); 92 section = this; 89 93 } 90 94 else 91 95 { 92 96 DIBSection *dsect = section; 97 dprintf(("Increment section starting at %08X\n",dsect)); 93 98 94 99 /* @@@PH 98/07/11 fix for dsect->next == NULL */ … … 96 101 (dsect->next != NULL) ) 97 102 { 98 dsect = dsect->next; 103 dprintf(("Increment section to %08X\n",dsect->next)); 104 dsect = dsect->next; 99 105 } 100 106 dsect->next = this; 101 107 } 108 dprintf(("Class created")); 102 109 } 103 110 //****************************************************************************** … … 285 292 //****************************************************************************** 286 293 //****************************************************************************** 294 int DIBSection::GetDIBSection(int iSize , DIBSECTION *pDIBSection){ 295 if( (sizeof(DIBSECTION)==iSize) && 296 (pDIBSection !=NULL)) 297 { 298 // BITMAP struct 299 pDIBSection->dsBm.bmType = 0; // TODO: put the correct value here 300 pDIBSection->dsBm.bmWidth = pOS2bmp->cx; 301 pDIBSection->dsBm.bmHeight = pOS2bmp->cy; 302 pDIBSection->dsBm.bmWidthBytes = bmpsize; 303 pDIBSection->dsBm.bmPlanes = pOS2bmp->cPlanes; 304 pDIBSection->dsBm.bmBitsPixel = pOS2bmp->cBitCount; 305 pDIBSection->dsBm.bmBits = bmpBits; 306 // BITMAPINFOHEADER data 307 pDIBSection->dsBmih.biSize = sizeof(BITMAPINFOHEADER); 308 pDIBSection->dsBmih.biWidth = pOS2bmp->cx; 309 pDIBSection->dsBmih.biHeight = pOS2bmp->cy; 310 pDIBSection->dsBmih.biPlanes = pOS2bmp->cPlanes; 311 pDIBSection->dsBmih.biBitCount = pOS2bmp->cBitCount; 312 pDIBSection->dsBmih.biCompression = pOS2bmp->ulCompression; 313 pDIBSection->dsBmih.biSizeImage = pOS2bmp->cbImage; 314 pDIBSection->dsBmih.biXPelsPerMeter = 0; // TODO: put the correct value here 315 pDIBSection->dsBmih.biYPelsPerMeter = 0; 316 pDIBSection->dsBmih.biClrUsed = (1<< pOS2bmp->cBitCount); 317 pDIBSection->dsBmih.biClrImportant = 0; 318 319 pDIBSection->dsBitfields[0] = 0; // TODO: put the correct value here 320 pDIBSection->dsBitfields[1] = 0; 321 pDIBSection->dsBitfields[2] = 0; 322 323 pDIBSection->dshSection = this->handle; 324 325 pDIBSection->dsOffset = 0; // TODO: put the correct value here 326 327 return 0; //ERROR_SUCCESS 328 } 329 return 87; //ERROR_INVALID_PARAMETER 330 331 } 332 //****************************************************************************** 333 //****************************************************************************** 287 334 DIBSection *DIBSection::section = NULL; 335
Note:
See TracChangeset
for help on using the changeset viewer.