25 #include <SDL/SDL_endian.h>
29 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
30 #define R_MASK 0x00ff0000
31 #define G_MASK 0x0000ff00
32 #define B_MASK 0x000000ff
33 #define A_MASK 0xff000000
35 #define R_MASK 0x000000ff
36 #define G_MASK 0x0000ff00
37 #define B_MASK 0x00ff0000
38 #define A_MASK 0xff000000
54 if (screen::dbl_mode ()) {
62 vis = SDL_DisplayFormat (s);
63 SDL_SetColorKey (
vis, SDL_SRCCOLORKEY | SDL_RLEACCEL,
64 SDL_MapRGB (
vis->format, color.r, color.g, color.b));
125 rawdata =
new char[l * h * 3];
128 raw2display (rawdata, l, h);
130 delete[] (
char *) rawdata;
161 raw2display (rawdata, l, h);
177 file = SDL_RWFromFile (fname.c_str (),
"rb");
217 SDL_Surface *tmp2 = SDL_CreateRGBSurface (0, 1, 1, 24,
222 SDL_Surface * toconvert;
227 imt->double_size(*
this);
228 toconvert = imt->
vis;
235 SDL_Surface * temp = SDL_ConvertSurface (toconvert, tmp2->format, 0);
237 SDL_LockSurface (temp);
246 SDL_UnlockSurface (temp);
248 SDL_FreeSurface (temp);
249 SDL_FreeSurface (tmp2);
268 SDL_Surface *tmp2 = SDL_CreateRGBSurface (0, 1, 1, 24,
277 imt.half_size(*
this);
278 temp = SDL_ConvertSurface (imt.
vis, tmp2->format, 0);
282 temp = SDL_ConvertSurface (
vis, tmp2->format, 0);
287 SDL_FreeSurface (temp);
288 SDL_FreeSurface (tmp2);
298 file = SDL_RWFromFile (fname.c_str (),
"wb");
325 for (j = y; j < h + y; j++)
328 for (i = x; i < l + x; i++)
330 src.
get_pix (xcur >> 16, ycur >> 16, col);
347 for (posy = 0; posy < h; posy += src.
height ())
348 for (posx = 0; posx < l; posx += src.
length ())
349 src.
draw (x + posx, y + posy, &da,
this);
363 for (j = 0; j <
height (); j++)
364 for (i = 0; i <
length (); i++)
369 src.
get_pix (i, j, ir, ig, ib);
370 ir = (ir * cont) >> 8;
371 ig = (ig * cont) >> 8;
372 ib = (ib * cont) >> 8;
402 SDL_Surface *tmp2 = SDL_CreateRGBSurfaceFrom (rawdata,
length (),
407 vis = SDL_DisplayFormat (tmp2);
411 imt.double_size(*
this);
414 SDL_FreeSurface (tmp2);