Changeset 240
- Timestamp:
- Nov 30, 2003, 5:34:04 PM (19 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/examples/view.c
r238 r240 62 62 #endif 63 63 { 64 rmask = 0x0000ff00; gmask = 0x00ff0000; bmask = 0xff000000; 65 } 66 else 67 { 64 68 rmask = 0x00ff0000; gmask = 0x0000ff00; bmask = 0x000000ff; 65 }66 else67 {68 rmask = 0x0000ff00; gmask = 0x00ff0000; bmask = 0xff000000;69 69 } 70 70 -
libcaca/trunk/src/bitmap.c
r239 r240 38 38 #endif 39 39 40 #ifdef HAVE_ENDIAN_H 41 # include <endian.h> 42 #endif 43 40 44 #include <stdlib.h> 41 45 … … 237 241 unsigned int *g, unsigned int *b) 238 242 { 239 u nsigned int bits;243 uint32_t bits; 240 244 241 245 pixels += (bitmap->bpp / 8) * x + bitmap->pitch * y; … … 244 248 { 245 249 case 4: 246 bits = ((uint32_t)pixels[0] << 24) | 247 ((uint32_t)pixels[1] << 16) | 248 ((uint32_t)pixels[2] << 8) | 249 ((uint32_t)pixels[3]); 250 bits = *(uint32_t *)pixels; 250 251 break; 251 252 case 3: 252 bits = ((uint32_t)pixels[0] << 16) | 253 ((uint32_t)pixels[1] << 8) | 254 ((uint32_t)pixels[2]); 253 { 254 #ifdef HAVE_ENDIAN_H 255 if(__BYTE_ORDER == __BIG_ENDIAN) 256 #else 257 static const uint32_t rmask = 0x12345678; 258 if(*(uint8_t *)&rmask == 0x12) 259 #endif 260 bits = ((uint32_t)pixels[0] << 16) | 261 ((uint32_t)pixels[1] << 8) | 262 ((uint32_t)pixels[2]); 263 else 264 bits = ((uint32_t)pixels[2] << 16) | 265 ((uint32_t)pixels[1] << 8) | 266 ((uint32_t)pixels[0]); 255 267 break; 268 } 256 269 case 2: 257 bits = ((uint16_t)pixels[0] << 8) | 258 ((uint16_t)pixels[1]); 270 bits = *(uint16_t *)pixels; 259 271 break; 260 272 case 1: -
libcaca/trunk/src/io.c
r213 r240 171 171 } 172 172 173 caca_printf(0,0, "unknown esc sequence %2x %2x %2x %2x %2x\n", '\x1b', keybuf[0], keybuf[1], keybuf[2], keybuf[3]);174 173 /* Unknown escape sequence: return the ESC key */ 175 174 return CACA_EVENT_KEY_PRESS | '\x1b';
Note: See TracChangeset
for help on using the changeset viewer.