Changeset 438 for pwntcha


Ignore:
Timestamp:
Jan 9, 2005, 1:24:24 AM (16 years ago)
Author:
Sam Hocevar
Message:
  • use IPicture's DC instead of CreateCompatibleDC.
  • nicer error message.
Location:
pwntcha/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/common.h

    r430 r438  
    1919
    2020/* global variables */
     21extern char *argv0;
    2122extern char *share;
    2223
  • pwntcha/trunk/src/image.c

    r435 r438  
    4545    HDC dc;
    4646    long scrwidth = 0, scrheight = 0;
    47     int width, height, i;
     47    int width, height;
    4848    void *data = NULL;
    4949#elif defined(HAVE_SDL_IMAGE_H)
     
    6565    }
    6666
    67     dc = CreateCompatibleDC(NULL);
    68 
     67#if 0
    6968    for(i = 0; ; i++)
    7069    {
     
    7574            break;
    7675
    77         /* printf("mode %i x %i - %i\n", (int)devMode.dmPelsWidth,
    78                   (int)devMode.dmPelsHeight, (int)devMode.dmBitsPerPel); */
    79     }
     76        printf("mode %i x %i - %i\n", (int)devMode.dmPelsWidth,
     77               (int)devMode.dmPelsHeight, (int)devMode.dmBitsPerPel);
     78    }
     79#endif
     80
     81    pic->lpVtbl->get_CurDC(pic, &dc);
    8082
    8183    if(GetDeviceCaps(dc, BITSPIXEL) < 24)
    8284    {
    83         fprintf(stderr, "a screen depth of at least 24bpp is required\n");
     85        fprintf(stderr, "%s: 24bpp screen depth or better required\n", argv0);
    8486        DeleteDC(dc);
    8587        free(priv);
Note: See TracChangeset for help on using the changeset viewer.