Mercurial > sdl-ios-xcode
comparison src/video/SDL_pixels.c @ 3163:a252014ce27d
Support for BGR565 pixel format has been added, mainly for OpenGL ES renderer. OpenGL ES renderer now have new texture formats.
author | Mike Gorchak <lestat@i.com.ua> |
---|---|
date | Wed, 03 Jun 2009 10:40:44 +0000 |
parents | 502adab079a4 |
children | 9f82979eaaf0 |
comparison
equal
deleted
inserted
replaced
3162:dc1eb82ffdaa | 3163:a252014ce27d |
---|---|
70 masks[0] = 0x00008000; | 70 masks[0] = 0x00008000; |
71 masks[1] = 0x00007C00; | 71 masks[1] = 0x00007C00; |
72 masks[2] = 0x000003E0; | 72 masks[2] = 0x000003E0; |
73 masks[3] = 0x0000001F; | 73 masks[3] = 0x0000001F; |
74 break; | 74 break; |
75 case SDL_PACKEDLAYOUT_5551: | |
76 masks[0] = 0x0000F800; | |
77 masks[1] = 0x000007C0; | |
78 masks[2] = 0x0000003E; | |
79 masks[3] = 0x00000001; | |
80 break; | |
75 case SDL_PACKEDLAYOUT_565: | 81 case SDL_PACKEDLAYOUT_565: |
76 masks[0] = 0x00000000; | 82 masks[0] = 0x00000000; |
77 masks[1] = 0x0000F800; | 83 masks[1] = 0x0000F800; |
78 masks[2] = 0x000007E0; | 84 masks[2] = 0x000007E0; |
79 masks[3] = 0x0000001F; | 85 masks[3] = 0x0000001F; |
87 case SDL_PACKEDLAYOUT_2101010: | 93 case SDL_PACKEDLAYOUT_2101010: |
88 masks[0] = 0xC0000000; | 94 masks[0] = 0xC0000000; |
89 masks[1] = 0x3FF00000; | 95 masks[1] = 0x3FF00000; |
90 masks[2] = 0x000FFC00; | 96 masks[2] = 0x000FFC00; |
91 masks[3] = 0x000003FF; | 97 masks[3] = 0x000003FF; |
98 break; | |
99 case SDL_PACKEDLAYOUT_1010102: | |
100 masks[0] = 0xFFC00000; | |
101 masks[1] = 0x003FF000; | |
102 masks[2] = 0x00000FFC; | |
103 masks[3] = 0x00000003; | |
92 break; | 104 break; |
93 default: | 105 default: |
94 /* Unknown layout */ | 106 /* Unknown layout */ |
95 return SDL_FALSE; | 107 return SDL_FALSE; |
96 } | 108 } |
174 return SDL_PIXELFORMAT_RGB555; | 186 return SDL_PIXELFORMAT_RGB555; |
175 } | 187 } |
176 break; | 188 break; |
177 case 16: | 189 case 16: |
178 switch (Rmask) { | 190 switch (Rmask) { |
191 case 0x000F: | |
192 return SDL_PIXELFORMAT_ABGR4444; | |
179 case 0x001F: | 193 case 0x001F: |
194 if (Gmask == 0x07E0) { | |
195 return SDL_PIXELFORMAT_BGR565; | |
196 } | |
180 return SDL_PIXELFORMAT_ABGR1555; | 197 return SDL_PIXELFORMAT_ABGR1555; |
181 case 0x0F00: | 198 case 0x0F00: |
182 return SDL_PIXELFORMAT_ARGB4444; | 199 return SDL_PIXELFORMAT_ARGB4444; |
183 case 0x7C00: | 200 case 0x7C00: |
184 return SDL_PIXELFORMAT_ARGB1555; | 201 return SDL_PIXELFORMAT_ARGB1555; |