Ignore:
Timestamp:
Feb 3, 2000, 12:45:07 AM (26 years ago)
Author:
sandervl
Message:

RGB 555 conversion in SetDIBitsToDevice + quake 2 BitBlt fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibitmap.cpp

    r2592 r2600  
    1 /* $Id: dibitmap.cpp,v 1.1 2000-02-01 12:53:29 sandervl Exp $ */
     1/* $Id: dibitmap.cpp,v 1.2 2000-02-02 23:45:06 sandervl Exp $ */
    22
    33/*
     
    8282 HBITMAP res = 0;
    8383 BOOL    fFlip = 0;
    84  int iHeight, iWidth;
     84 int     iHeight, iWidth;
    8585
    8686  dprintf(("GDI32: CreateDIBSection %x %x %x %x %d", hdc, iUsage, ppvBits, hSection, dwOffset));
     
    110110  if (res)
    111111  {
    112     ULONG Pal[256];
    113112    char PalSize;
    114     LOGPALETTE tmpPal = { 0x300,1,{0,0,0,0}};
    115     HPALETTE hpalCur, hpalTmp;
    116     DIBSection *dsect = new DIBSection((WINBITMAPINFOHEADER *)&pbmi->bmiHeader, iUsage, (DWORD)res, fFlip);
    117 
    118     if(NULL!=dsect)
     113    DIBSection *dsect = new DIBSection((BITMAPINFOHEADER_W *)&pbmi->bmiHeader, (char *)&pbmi->bmiColors, iUsage, (DWORD)res, fFlip);
     114
     115    if(dsect != NULL)
    119116    {
    120117      PalSize = dsect->GetBitCount();
    121       if(PalSize<=8)
     118      if(PalSize <= 8)
    122119      {
     120       ULONG Pal[256];
     121       LOGPALETTE tmpPal = { 0x300,1,{0,0,0,0}};
     122       HPALETTE hpalCur, hpalTmp;
     123
    123124        // Now get the current Palette from the DC
    124125        hpalTmp = CreatePalette(&tmpPal);
     
    170171                                  RGBQUAD *pColors)
    171172{
    172  HPALETTE hpal = O32_GetCurrentObject(hdc, OBJ_PAL);
     173 HPALETTE hpal = GetCurrentObject(hdc, OBJ_PAL);
    173174 UINT rc;
    174175 int i;
     
    208209//******************************************************************************
    209210//******************************************************************************
    210 LONG WIN32API GetBitmapBits( HBITMAP arg1, LONG arg2, PVOID  arg3)
    211 {
    212     dprintf(("GDI32: GetBitmapBits"));
    213     return O32_GetBitmapBits(arg1, arg2, arg3);
    214 }
    215 //******************************************************************************
    216 //******************************************************************************
    217 LONG WIN32API SetBitmapBits( HBITMAP arg1, LONG arg2, const VOID *  arg3)
    218 {
    219     dprintf(("GDI32: SetBitmapBits"));
    220     return O32_SetBitmapBits(arg1, (DWORD)arg2, arg3);
    221 }
    222 //******************************************************************************
    223 //******************************************************************************
    224 BOOL WIN32API GetBitmapDimensionEx( HBITMAP arg1, PSIZE  arg2)
    225 {
    226     dprintf(("GDI32: GetBitmapDimensionEx"));
    227     return O32_GetBitmapDimensionEx(arg1, arg2);
     211LONG WIN32API GetBitmapBits( HBITMAP hBitmap, LONG arg2, PVOID  arg3)
     212{
     213    dprintf(("GDI32: GetBitmapBits %x", hBitmap));
     214    return O32_GetBitmapBits(hBitmap, arg2, arg3);
     215}
     216//******************************************************************************
     217//******************************************************************************
     218LONG WIN32API SetBitmapBits( HBITMAP hBitmap, LONG arg2, const VOID *  arg3)
     219{
     220    dprintf(("GDI32: SetBitmapBits %x", hBitmap));
     221    return O32_SetBitmapBits(hBitmap, (DWORD)arg2, arg3);
     222}
     223//******************************************************************************
     224//******************************************************************************
     225BOOL WIN32API GetBitmapDimensionEx( HBITMAP hBitmap, PSIZE pSize)
     226{
     227    dprintf(("GDI32: GetBitmapDimensionEx %x (%d,%d)", hBitmap, pSize->cx, pSize->cy));
     228    return O32_GetBitmapDimensionEx(hBitmap, pSize);
    228229}
    229230//******************************************************************************
     
    251252    dprintf(("GDI32: SetDIBits %x %x %x %x %x %x %x\n", arg1, arg2, arg3, arg4, arg5, arg6, arg7));
    252253
    253     if(DIBSection::getSection() != NULL) {
     254    if(DIBSection::getSection() != NULL)
     255    {
    254256        DIBSection *dsect;
    255257
    256258        dsect = DIBSection::find((DWORD)arg2);
    257259        if(dsect) {
    258            return dsect->SetDIBits(arg1, arg2, arg3, arg4, arg5, (WINBITMAPINFOHEADER *)&arg6->bmiHeader, arg7);
     260           return dsect->SetDIBits(arg1, arg2, arg3, arg4, arg5, (BITMAPINFOHEADER_W *)&arg6->bmiHeader, arg7);
    259261        }
    260262    }
Note: See TracChangeset for help on using the changeset viewer.