comparison test/automated/common/common.h @ 3259:22ac66da0765

Merged Edgar's code changes from Google Summer of Code 2009
author Sam Lantinga <slouken@libsdl.org>
date Mon, 07 Sep 2009 05:06:34 +0000
parents
children 9f62f47d989b
comparison
equal deleted inserted replaced
3258:e786366ea23b 3259:22ac66da0765
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 #if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
15 # define RMASK 0xff000000 /**< Red bit mask. */
16 # define GMASK 0x00ff0000 /**< Green bit mask. */
17 # define BMASK 0x0000ff00 /**< Blue bit mask. */
18 # define AMASK 0x000000ff /**< Alpha bit mask. */
19 #else
20 # define RMASK 0x000000ff /**< Red bit mask. */
21 # define GMASK 0x0000ff00 /**< Green bit mask. */
22 # define BMASK 0x00ff0000 /**< Blue bit mask. */
23 # define AMASK 0xff000000 /**< Alpha bit mask. */
24 #endif
25
26
27 typedef struct SurfaceImage_s {
28 int width;
29 int height;
30 unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
31 const unsigned char pixel_data[];
32 } SurfaceImage_t;
33
34
35 /**
36 * @brief Compares a surface and a surface image for equality.
37 *
38 * @param sur Surface to compare.
39 * @param img Image to compare against.
40 * @return 0 if they are the same, -1 on error and positive if different.
41 */
42 int surface_compare( SDL_Surface *sur, const SurfaceImage_t *img );
43
44
45 #endif /* COMMON_H */
46