test/automated/common/common.h
author Ryan C. Gordon
Wed, 03 Apr 2013 11:49:25 -0400
changeset 7053 187225ae13e5
parent 7051 cf773d8091c7
child 7191 75360622e65f
permissions -rw-r--r--
Another attempt at fixing compiler warnings for SDLTest_SurfaceImage_t.
     1 /**
     2  * Automated SDL test common framework.
     3  *
     4  * Written by Edgar Simo "bobbens"
     5  *
     6  * Released under Public Domain.
     7  */
     8 
     9 
    10 #ifndef COMMON_H
    11 #  define COMMON_H
    12 
    13 
    14 #  define FORMAT  SDL_PIXELFORMAT_ARGB8888
    15 #  define AMASK   0xff000000 /**< Alpha bit mask. */
    16 #  define RMASK   0x00ff0000 /**< Red bit mask. */
    17 #  define GMASK   0x0000ff00 /**< Green bit mask. */
    18 #  define BMASK   0x000000ff /**< Blue bit mask. */
    19 
    20 
    21 typedef struct SurfaceImage_s {
    22    int width;
    23    int height;
    24    unsigned int  bytes_per_pixel; /* 3:RGB, 4:RGBA */ 
    25    const char *pixel_data;
    26 } SurfaceImage_t;
    27 
    28 #define ALLOWABLE_ERROR_OPAQUE	0
    29 #define ALLOWABLE_ERROR_BLENDED	64
    30 
    31 /**
    32  * @brief Compares a surface and a surface image for equality.
    33  *
    34  *    @param sur Surface to compare.
    35  *    @param img Image to compare against.
    36  *    @return 0 if they are the same, -1 on error and positive if different.
    37  */
    38 int surface_compare( SDL_Surface *sur, const SurfaceImage_t *img, int allowable_error );
    39 
    40 
    41 #endif /* COMMON_H */
    42