Ignore:
Timestamp:
Oct 25, 1999, 1:17:30 AM (26 years ago)
Author:
hugh
Message:

Fixed Bug in colorconversion, didn't iterate
ddex1.exe from the DX samples now works,
but bitmap is still mirrored up/down

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ddraw/OS2SURFACE.CPP

    r913 r1434  
    532532
    533533  lpVtbl                     = &Vtbl;
     534  lpVtbl2                    = &Vtbl;
     535  dwUnknownData              = 0xDEADDEAD;
    534536  Vtbl.AddRef                = SurfAddRef;
    535537  Vtbl.Release               = SurfRelease;
     
    818820
    819821          BackBuffer = new OS2IDirectDrawSurface(lpDraw, &ComplexSurfaceDesc, TRUE, TRUE);
     822          BackBuffer->Vtbl.AddRef((IDirectDrawSurface *)BackBuffer);
    820823
    821824          if (BackBuffer->GetLastError()==DD_OK)
     
    11401143
    11411144          BackBuffer = new OS2IDirectDrawSurface(lpDraw, &ComplexSurfaceDesc, TRUE, Mainchain);
     1145          BackBuffer->Vtbl.AddRef((IDirectDrawSurface *)BackBuffer);
     1146
    11421147          if (BackBuffer->GetLastError()==DD_OK)
    11431148          {
     
    11721177
    11731178            MipMapSurface = new OS2IDirectDrawSurface(lpDraw, &ComplexSurfaceDesc, TRUE);
     1179            MipMapSurface->Vtbl.AddRef((IDirectDrawSurface *)MipMapSurface);
    11741180
    11751181            DPA_InsertPtr( DPA_SurfaceMipMaps,
     
    15841590          for(x=0;x<width;x++)
    15851591          {
    1586             *((WORD*)pDLine) = pPal16[pSLine[x]];
     1592            *(((WORD*)pDLine)+x) = pPal16[pSLine[x]];
     1593
    15871594          }
    15881595          pSLine += dwPitchFB;
     
    44734480  memset(&BitmapInfo,0, sizeof(BitmapInfo));
    44744481  BitmapInfo.bmiHead.biSize     = sizeof(BITMAPINFOHEADER);
     4482  /*
    44754483  BitmapInfo.bmiHead.biWidth    = me->DDSurfaceDesc.lPitch/ (me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3);
    44764484  BitmapInfo.bmiHead.biHeight   = me->DDSurfaceDesc.dwHeight;
    44774485  BitmapInfo.bmiHead.biPlanes   = 1;
    44784486  BitmapInfo.bmiHead.biBitCount = 0; // me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount;
    4479 
     4487  */
    44804488  switch(me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)
    44814489  {
     
    44854493      BitmapInfo.bmiHead.biCompression = BI_RGB;
    44864494      //GetSystemPaletteEntries(me->hdcImage,0,255,(PPALETTEENTRY)&BitmapInfo.bmiCols[0]);
    4487       rc = GetDIBits(hdc, me->hbmImage, 0, me->DDSurfaceDesc.dwHeight,
    4488                 NULL,(PBITMAPINFO)&BitmapInfo,DIB_PAL_COLORS);
     4495      rc = GetDIBits( hdc,
     4496                      me->hbmImage,
     4497                      0,
     4498                      me->DDSurfaceDesc.dwHeight,
     4499                      NULL,
     4500                      (PBITMAPINFO)&BitmapInfo,
     4501                      DIB_RGB_COLORS);
    44894502      WriteLog( "GetDIBits rc=%d\n Size   :%d\n Width  :%d\n Height :%d\n"
    4490                 " Planes :%d\n BitCount :%d\nLastEror = %d\n",
     4503                " Planes :%d\n BitCount :%d\nLastEror = %d\nPixel[0,0] = 0x%02X\n",
    44914504                rc,
    44924505                BitmapInfo.bmiHead.biSize,
     
    44954508                BitmapInfo.bmiHead.biPlanes,
    44964509                BitmapInfo.bmiHead.biBitCount,
    4497                 GetLastError());
     4510                GetLastError(),
     4511                ((char*)me->DDSurfaceDesc.lpSurface)[0]);
    44984512      rc = GetDIBits( hdc,
    4499                       me->hbmImage, 0,
     4513                      me->hbmImage,
     4514                      0,
    45004515                      me->DDSurfaceDesc.dwHeight,
    45014516                      me->DDSurfaceDesc.lpSurface,
    45024517                      (PBITMAPINFO)&BitmapInfo,
    4503                       DIB_PAL_COLORS);
    4504       WriteLog( "GetDIBits rc=%d\n LastEror = %d\n",
     4518                      DIB_RGB_COLORS);
     4519      WriteLog( "GetDIBits rc=%d\n LastEror = %d\nPixel[0,0] = 0x%02X\n",
    45054520                rc,
    4506                 GetLastError());
     4521                GetLastError(),
     4522                ((char*)me->DDSurfaceDesc.lpSurface)[0]);
    45074523      break;
    45084524    case 16:
Note: See TracChangeset for help on using the changeset viewer.