3728
|
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
|