From e16198a441aa1ffc2d91e814457ac8dd2c5fc9dd Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 14 Dec 2009 23:29:37 +0000 Subject: [PATCH] The SDL 1.3 tests have been cleaned up not to include any 1.2 compatibility code. --- include/SDL_compat.h | 55 ---------------------------------------- include/SDL_keysym.h | 56 +++++++++++++++++++++++++++++++++++++++++ include/SDL_surface.h | 2 +- src/video/SDL_surface.c | 2 +- test/common.h | 1 + test/testsprite2.c | 12 ++++----- 6 files changed, 64 insertions(+), 64 deletions(-) diff --git a/include/SDL_compat.h b/include/SDL_compat.h index 530714b2a..511d1a529 100644 --- a/include/SDL_compat.h +++ b/include/SDL_compat.h @@ -193,61 +193,6 @@ struct SDL_SysWMinfo; * These key constants were renamed for clarity or consistency. */ /*@{*/ -#define SDLK_0 '0' -#define SDLK_1 '1' -#define SDLK_2 '2' -#define SDLK_3 '3' -#define SDLK_4 '4' -#define SDLK_5 '5' -#define SDLK_6 '6' -#define SDLK_7 '7' -#define SDLK_8 '8' -#define SDLK_9 '9' -#define SDLK_a 'a' -#define SDLK_b 'b' -#define SDLK_c 'c' -#define SDLK_d 'd' -#define SDLK_e 'e' -#define SDLK_f 'f' -#define SDLK_g 'g' -#define SDLK_h 'h' -#define SDLK_i 'i' -#define SDLK_j 'j' -#define SDLK_k 'k' -#define SDLK_l 'l' -#define SDLK_m 'm' -#define SDLK_n 'n' -#define SDLK_o 'o' -#define SDLK_p 'p' -#define SDLK_q 'q' -#define SDLK_r 'r' -#define SDLK_s 's' -#define SDLK_t 't' -#define SDLK_u 'u' -#define SDLK_v 'v' -#define SDLK_w 'w' -#define SDLK_x 'x' -#define SDLK_y 'y' -#define SDLK_z 'z' -#define SDLK_QUOTE '\'' -#define SDLK_MINUS '-' -#define SDLK_BACKQUOTE '`' -#define SDLK_EXCLAIM '!' -#define SDLK_QUOTEDBL '"' -#define SDLK_HASH '#' -#define SDLK_DOLLAR '$' -#define SDLK_AMPERSAND '&' -#define SDLK_LEFTPAREN '(' -#define SDLK_RIGHTPAREN ')' -#define SDLK_ASTERISK '*' -#define SDLK_PLUS '+' -#define SDLK_COLON ':' -#define SDLK_LESS '<' -#define SDLK_GREATER '>' -#define SDLK_QUESTION '?' -#define SDLK_AT '@' -#define SDLK_CARET '^' -#define SDLK_UNDERSCORE '_' #define SDLK_KP0 SDLK_KP_0 #define SDLK_KP1 SDLK_KP_1 #define SDLK_KP2 SDLK_KP_2 diff --git a/include/SDL_keysym.h b/include/SDL_keysym.h index b302d0683..b56ebfbb9 100644 --- a/include/SDL_keysym.h +++ b/include/SDL_keysym.h @@ -55,6 +55,62 @@ enum SDLK_TAB = '\t', SDLK_SPACE = ' ', + SDLK_0 = '0', + SDLK_1 = '1', + SDLK_2 = '2', + SDLK_3 = '3', + SDLK_4 = '4', + SDLK_5 = '5', + SDLK_6 = '6', + SDLK_7 = '7', + SDLK_8 = '8', + SDLK_9 = '9', + SDLK_a = 'a', + SDLK_b = 'b', + SDLK_c = 'c', + SDLK_d = 'd', + SDLK_e = 'e', + SDLK_f = 'f', + SDLK_g = 'g', + SDLK_h = 'h', + SDLK_i = 'i', + SDLK_j = 'j', + SDLK_k = 'k', + SDLK_l = 'l', + SDLK_m = 'm', + SDLK_n = 'n', + SDLK_o = 'o', + SDLK_p = 'p', + SDLK_q = 'q', + SDLK_r = 'r', + SDLK_s = 's', + SDLK_t = 't', + SDLK_u = 'u', + SDLK_v = 'v', + SDLK_w = 'w', + SDLK_x = 'x', + SDLK_y = 'y', + SDLK_z = 'z', + SDLK_QUOTE = '\'', + SDLK_MINUS = '-', + SDLK_BACKQUOTE = '`', + SDLK_EXCLAIM = '!', + SDLK_QUOTEDBL = '"', + SDLK_HASH = '#', + SDLK_DOLLAR = '$', + SDLK_AMPERSAND = '&', + SDLK_LEFTPAREN = '(', + SDLK_RIGHTPAREN = ')', + SDLK_ASTERISK = '*', + SDLK_PLUS = '+', + SDLK_COLON = ':', + SDLK_LESS = '<', + SDLK_GREATER = '>', + SDLK_QUESTION = '?', + SDLK_AT = '@', + SDLK_CARET = '^', + SDLK_UNDERSCORE = '_', + SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), diff --git a/include/SDL_surface.h b/include/SDL_surface.h index 5b3afe954..4898edfeb 100644 --- a/include/SDL_surface.h +++ b/include/SDL_surface.h @@ -216,7 +216,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, * \return 0 on success, or -1 if the surface is not valid */ extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, - Uint32 flag, Uint32 key); + int flag, Uint32 key); /** * \brief Gets the color key (transparent pixel) in a blittable surface. diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index cd761f4b7..e2c7509b3 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -239,7 +239,7 @@ SDL_SetSurfaceRLE(SDL_Surface * surface, int flag) } int -SDL_SetColorKey(SDL_Surface * surface, Uint32 flag, Uint32 key) +SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key) { int flags; diff --git a/test/common.h b/test/common.h index d331109c1..ac81b84e3 100644 --- a/test/common.h +++ b/test/common.h @@ -1,6 +1,7 @@ /* A simple test program framework */ +#define SDL_NO_COMPAT #include "SDL.h" #define DEFAULT_WINDOW_WIDTH 640 diff --git a/test/testsprite2.c b/test/testsprite2.c index a8ab84ac7..d67402655 100644 --- a/test/testsprite2.c +++ b/test/testsprite2.c @@ -57,22 +57,20 @@ LoadSprite(char *file) /* Set transparent pixel as the pixel at (0,0) */ if (temp->format->palette) { - SDL_SetColorKey(temp, SDL_SRCCOLORKEY, *(Uint8 *) temp->pixels); + SDL_SetColorKey(temp, 1, *(Uint8 *) temp->pixels); } else { switch (temp->format->BitsPerPixel) { case 15: - SDL_SetColorKey(temp, SDL_SRCCOLORKEY, - (*(Uint16 *) temp->pixels) & 0x00007FFF); + SDL_SetColorKey(temp, 1, (*(Uint16 *) temp->pixels) & 0x00007FFF); break; case 16: - SDL_SetColorKey(temp, SDL_SRCCOLORKEY, *(Uint16 *) temp->pixels); + SDL_SetColorKey(temp, 1, *(Uint16 *) temp->pixels); break; case 24: - SDL_SetColorKey(temp, SDL_SRCCOLORKEY, - (*(Uint32 *) temp->pixels) & 0x00FFFFFF); + SDL_SetColorKey(temp, 1, (*(Uint32 *) temp->pixels) & 0x00FFFFFF); break; case 32: - SDL_SetColorKey(temp, SDL_SRCCOLORKEY, *(Uint32 *) temp->pixels); + SDL_SetColorKey(temp, 1, *(Uint32 *) temp->pixels); break; } }