| 298 | } |
| 299 | |
| 300 | SDL_Surface *texdecal(SDL_Surface *s) |
| 301 | { |
| 302 | SDL_Surface *m = SDL_CreateRGBSurface(SDL_SWSURFACE, s->w, s->h, 16, 0, 0, 0, 0); |
| 303 | if(!m) fatal("create surface"); |
| 304 | uchar *dst = (uchar *)m->pixels, *src = (uchar *)s->pixels; |
| 305 | loopi(s->h*s->w) |
| 306 | { |
| 307 | *dst++ = *src; |
| 308 | *dst++ = 255 - *src; |
| 309 | src += s->format->BytesPerPixel; |
| 310 | } |
| 311 | SDL_FreeSurface(s); |
| 312 | return m; |
| 313 | } |
| 314 | |
| 315 | void scalesurface(SDL_Surface *s, float scale) |
| 316 | { |
no test coverage detected