MCPcopy Create free account
hub / github.com/assaultcube/AC / texdecal

Function texdecal

source/src/texture.cpp:300–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300SDL_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
315void scalesurface(SDL_Surface *s, float scale)
316{

Callers 1

loadsurfaceFunction · 0.85

Calls 2

fatalFunction · 0.70
loopiFunction · 0.70

Tested by

no test coverage detected