comparison src/video/SDL_pixels.c @ 2102:0975e24a3670

Merged r3007:3008 from branches/SDL-1.2: MapRGB/MapRGBA const correctness.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 04 Apr 2007 09:43:53 +0000
parents a788656ca29a
children 2c835d58faad
comparison
equal deleted inserted replaced
2101:c4e0afbcf1f6 2102:0975e24a3670
535 return (pixel); 535 return (pixel);
536 } 536 }
537 537
538 /* Find the opaque pixel value corresponding to an RGB triple */ 538 /* Find the opaque pixel value corresponding to an RGB triple */
539 Uint32 539 Uint32
540 SDL_MapRGB(SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b) 540 SDL_MapRGB(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g,
541 const Uint8 b)
541 { 542 {
542 if (format->palette == NULL) { 543 if (format->palette == NULL) {
543 return (r >> format->Rloss) << format->Rshift 544 return (r >> format->Rloss) << format->Rshift
544 | (g >> format->Gloss) << format->Gshift 545 | (g >> format->Gloss) << format->Gshift
545 | (b >> format->Bloss) << format->Bshift | format->Amask; 546 | (b >> format->Bloss) << format->Bshift | format->Amask;
548 } 549 }
549 } 550 }
550 551
551 /* Find the pixel value corresponding to an RGBA quadruple */ 552 /* Find the pixel value corresponding to an RGBA quadruple */
552 Uint32 553 Uint32
553 SDL_MapRGBA(SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b, Uint8 a) 554 SDL_MapRGBA(const SDL_PixelFormat * const format, const Uint8 r, const Uint8 g,
555 const Uint8 b, const Uint8 a)
554 { 556 {
555 if (format->palette == NULL) { 557 if (format->palette == NULL) {
556 return (r >> format->Rloss) << format->Rshift 558 return (r >> format->Rloss) << format->Rshift
557 | (g >> format->Gloss) << format->Gshift 559 | (g >> format->Gloss) << format->Gshift
558 | (b >> format->Bloss) << format->Bshift 560 | (b >> format->Bloss) << format->Bshift