Mercurial > sdl-ios-xcode
annotate src/video/maccommon/SDL_mackeys.h @ 1057:e9d23bb80140
Date: Mon, 02 May 2005 04:23:16 -0500
From: Jonathan Atkins
Subject: Re: [PATCH] *CRITICAL* 8bit direct RGB palette not being created
I think that SDL_AllocFormat should create the palette for all 8bit
surfaces. And when the RGBAmasks match the normal 3:3:2:0 we need to
apply the old behavior. If the mask doesn't match that, then we need
to make the right palette assuming the masks are valid (I don't think
we validate any masks for high color surfaces...so we wouldn't here)
Then there's always a palette available for the 8bit surfaces.
This restores the normal behavior and allows for masks to create
palettes automatically for odd masks even, which would be a neato
thing to have in there, as SDL never did this before.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 16 May 2005 05:34:58 +0000 |
parents | b8d311d90021 |
children | c9b51268668f |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
769
b8d311d90021
Updated copyright information for 2004 (Happy New Year!)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
3 Copyright (C) 1997-2004 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Library General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Library General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Library General Public | |
16 License along with this library; if not, write to the Free | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
23 #ifdef SAVE_RCSID | |
24 static char rcsid = | |
25 "@(#) $Id$"; | |
26 #endif | |
27 | |
28 /* These are the Macintosh key scancode constants -- from Inside Macintosh */ | |
29 | |
30 #define MK_ESCAPE 0x35 | |
31 #define MK_F1 0x7A | |
32 #define MK_F2 0x78 | |
33 #define MK_F3 0x63 | |
34 #define MK_F4 0x76 | |
35 #define MK_F5 0x60 | |
36 #define MK_F6 0x61 | |
37 #define MK_F7 0x62 | |
38 #define MK_F8 0x64 | |
39 #define MK_F9 0x65 | |
40 #define MK_F10 0x6D | |
41 #define MK_F11 0x67 | |
42 #define MK_F12 0x6F | |
43 #define MK_PRINT 0x69 | |
44 #define MK_SCROLLOCK 0x6B | |
45 #define MK_PAUSE 0x71 | |
46 #define MK_POWER 0x7F | |
47 #define MK_BACKQUOTE 0x32 | |
48 #define MK_1 0x12 | |
49 #define MK_2 0x13 | |
50 #define MK_3 0x14 | |
51 #define MK_4 0x15 | |
52 #define MK_5 0x17 | |
53 #define MK_6 0x16 | |
54 #define MK_7 0x1A | |
55 #define MK_8 0x1C | |
56 #define MK_9 0x19 | |
57 #define MK_0 0x1D | |
58 #define MK_MINUS 0x1B | |
59 #define MK_EQUALS 0x18 | |
60 #define MK_BACKSPACE 0x33 | |
61 #define MK_INSERT 0x72 | |
62 #define MK_HOME 0x73 | |
63 #define MK_PAGEUP 0x74 | |
64 #define MK_NUMLOCK 0x47 | |
65 #define MK_KP_EQUALS 0x51 | |
66 #define MK_KP_DIVIDE 0x4B | |
67 #define MK_KP_MULTIPLY 0x43 | |
68 #define MK_TAB 0x30 | |
69 #define MK_q 0x0C | |
70 #define MK_w 0x0D | |
71 #define MK_e 0x0E | |
72 #define MK_r 0x0F | |
73 #define MK_t 0x11 | |
74 #define MK_y 0x10 | |
75 #define MK_u 0x20 | |
76 #define MK_i 0x22 | |
77 #define MK_o 0x1F | |
78 #define MK_p 0x23 | |
79 #define MK_LEFTBRACKET 0x21 | |
80 #define MK_RIGHTBRACKET 0x1E | |
81 #define MK_BACKSLASH 0x2A | |
82 #define MK_DELETE 0x75 | |
83 #define MK_END 0x77 | |
84 #define MK_PAGEDOWN 0x79 | |
85 #define MK_KP7 0x59 | |
86 #define MK_KP8 0x5B | |
87 #define MK_KP9 0x5C | |
88 #define MK_KP_MINUS 0x4E | |
89 #define MK_CAPSLOCK 0x39 | |
90 #define MK_a 0x00 | |
91 #define MK_s 0x01 | |
92 #define MK_d 0x02 | |
93 #define MK_f 0x03 | |
94 #define MK_g 0x05 | |
95 #define MK_h 0x04 | |
96 #define MK_j 0x26 | |
97 #define MK_k 0x28 | |
98 #define MK_l 0x25 | |
99 #define MK_SEMICOLON 0x29 | |
100 #define MK_QUOTE 0x27 | |
101 #define MK_RETURN 0x24 | |
102 #define MK_KP4 0x56 | |
103 #define MK_KP5 0x57 | |
104 #define MK_KP6 0x58 | |
105 #define MK_KP_PLUS 0x45 | |
106 #define MK_LSHIFT 0x38 | |
107 #define MK_z 0x06 | |
108 #define MK_x 0x07 | |
109 #define MK_c 0x08 | |
110 #define MK_v 0x09 | |
111 #define MK_b 0x0B | |
112 #define MK_n 0x2D | |
113 #define MK_m 0x2E | |
114 #define MK_COMMA 0x2B | |
115 #define MK_PERIOD 0x2F | |
116 #define MK_SLASH 0x2C | |
117 #if 0 /* These are the same as the left versions - use left by default */ | |
118 #define MK_RSHIFT 0x38 | |
119 #endif | |
120 #define MK_UP 0x7E | |
121 #define MK_KP1 0x53 | |
122 #define MK_KP2 0x54 | |
123 #define MK_KP3 0x55 | |
124 #define MK_KP_ENTER 0x4C | |
125 #define MK_LCTRL 0x3B | |
126 #define MK_LALT 0x3A | |
127 #define MK_LMETA 0x37 | |
128 #define MK_SPACE 0x31 | |
129 #if 0 /* These are the same as the left versions - use left by default */ | |
130 #define MK_RMETA 0x37 | |
131 #define MK_RALT 0x3A | |
132 #define MK_RCTRL 0x3B | |
133 #endif | |
134 #define MK_LEFT 0x7B | |
135 #define MK_DOWN 0x7D | |
136 #define MK_RIGHT 0x7C | |
137 #define MK_KP0 0x52 | |
138 #define MK_KP_PERIOD 0x41 | |
139 | |
140 /* Wierd, these keys are on my iBook under MacOS X */ | |
141 #define MK_IBOOK_ENTER 0x34 | |
142 #define MK_IBOOK_LEFT 0x3B | |
143 #define MK_IBOOK_RIGHT 0x3C | |
144 #define MK_IBOOK_DOWN 0x3D | |
145 #define MK_IBOOK_UP 0x3E |