The SDL 1.3 tests have been cleaned up not to include any 1.2 compatibility code.
authorSam Lantinga <slouken@libsdl.org>
Mon, 14 Dec 2009 23:29:37 +0000
changeset 3560 5543db4239e6
parent 3559 5f26a7eb5ff0
child 3561 00e7c6b7eb03
The SDL 1.3 tests have been cleaned up not to include any 1.2 compatibility code.
include/SDL_compat.h
include/SDL_keysym.h
include/SDL_surface.h
src/video/SDL_surface.c
test/common.h
test/testsprite2.c
--- a/include/SDL_compat.h	Mon Dec 14 06:52:17 2009 +0000
+++ b/include/SDL_compat.h	Mon Dec 14 23:29:37 2009 +0000
@@ -193,61 +193,6 @@
  *  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
--- a/include/SDL_keysym.h	Mon Dec 14 06:52:17 2009 +0000
+++ b/include/SDL_keysym.h	Mon Dec 14 23:29:37 2009 +0000
@@ -55,6 +55,62 @@
     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),
--- a/include/SDL_surface.h	Mon Dec 14 06:52:17 2009 +0000
+++ b/include/SDL_surface.h	Mon Dec 14 23:29:37 2009 +0000
@@ -216,7 +216,7 @@
  *  \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.
--- a/src/video/SDL_surface.c	Mon Dec 14 06:52:17 2009 +0000
+++ b/src/video/SDL_surface.c	Mon Dec 14 23:29:37 2009 +0000
@@ -239,7 +239,7 @@
 }
 
 int
-SDL_SetColorKey(SDL_Surface * surface, Uint32 flag, Uint32 key)
+SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key)
 {
     int flags;
 
--- a/test/common.h	Mon Dec 14 06:52:17 2009 +0000
+++ b/test/common.h	Mon Dec 14 23:29:37 2009 +0000
@@ -1,6 +1,7 @@
 
 /* A simple test program framework */
 
+#define SDL_NO_COMPAT
 #include "SDL.h"
 
 #define DEFAULT_WINDOW_WIDTH  640
--- a/test/testsprite2.c	Mon Dec 14 06:52:17 2009 +0000
+++ b/test/testsprite2.c	Mon Dec 14 23:29:37 2009 +0000
@@ -57,22 +57,20 @@
 
     /* 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;
         }
     }