src/video/SDL_blit.h
branchSDL-1.2
changeset 4367 2d00ed718720
parent 4293 63b54ddd38ea
child 6137 4720145f848b
equal deleted inserted replaced
4366:f00e178dfc9e 4367:2d00ed718720
   164 	}								   \
   164 	}								   \
   165 	RGB_FROM_PIXEL(Pixel, fmt, r, g, b);				   \
   165 	RGB_FROM_PIXEL(Pixel, fmt, r, g, b);				   \
   166 } while(0)
   166 } while(0)
   167 
   167 
   168 /* Assemble R-G-B values into a specified pixel format and store them */
   168 /* Assemble R-G-B values into a specified pixel format and store them */
   169 #ifdef __NDS__ // FIXME
   169 #ifdef __NDS__ /* FIXME */
   170 #define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)				\
   170 #define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)				\
   171 {									\
   171 {									\
   172 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   172 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   173 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   173 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   174 		((b>>fmt->Bloss)<<fmt->Bshift) | (1<<15);				\
   174 		((b>>fmt->Bloss)<<fmt->Bshift) | (1<<15);				\
   178 {									\
   178 {									\
   179 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   179 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   180 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   180 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   181 		((b>>fmt->Bloss)<<fmt->Bshift);				\
   181 		((b>>fmt->Bloss)<<fmt->Bshift);				\
   182 }
   182 }
   183 #endif // __NDS__ FIXME
   183 #endif /* __NDS__ FIXME */
   184 #define RGB565_FROM_RGB(Pixel, r, g, b)					\
   184 #define RGB565_FROM_RGB(Pixel, r, g, b)					\
   185 {									\
   185 {									\
   186 	Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3);			\
   186 	Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3);			\
   187 }
   187 }
   188 #define RGB555_FROM_RGB(Pixel, r, g, b)					\
   188 #define RGB555_FROM_RGB(Pixel, r, g, b)					\
   328 	RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a);			   \
   328 	RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a);			   \
   329 	Pixel &= ~fmt->Amask;						   \
   329 	Pixel &= ~fmt->Amask;						   \
   330 } while(0)
   330 } while(0)
   331 
   331 
   332 /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */
   332 /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */
   333 #ifdef __NDS__ // FIXME
   333 #ifdef __NDS__ /* FIXME */
   334 #define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)				\
   334 #define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)				\
   335 {									\
   335 {									\
   336 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   336 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   337 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   337 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   338 		((b>>fmt->Bloss)<<fmt->Bshift)|				\
   338 		((b>>fmt->Bloss)<<fmt->Bshift)|				\
   344 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   344 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   345 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   345 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   346 		((b>>fmt->Bloss)<<fmt->Bshift)|				\
   346 		((b>>fmt->Bloss)<<fmt->Bshift)|				\
   347 		((a>>fmt->Aloss)<<fmt->Ashift);				\
   347 		((a>>fmt->Aloss)<<fmt->Ashift);				\
   348 }
   348 }
   349 #endif // __NDS__ FIXME
   349 #endif /* __NDS__ FIXME */
   350 #define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)			\
   350 #define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)			\
   351 {									\
   351 {									\
   352 	switch (bpp) {							\
   352 	switch (bpp) {							\
   353 		case 2: {						\
   353 		case 2: {						\
   354 			Uint16 Pixel;					\
   354 			Uint16 Pixel;					\