SDL_Surface *WadImageCache::resize_image(SDL_Surface *original, int width, int height) const { if (original) { if (original->w != width || original->h != height) { return SDL_Resize(original, width, height, false, 1); } } return NULL; }
SDL_Surface* SDL_Resize(SDL_Surface *src, float factor, bool free, int filter) { if (factor > 100.0f) factor = 100.0f; //let's be reasonable... int new_w = (int)(src->w * factor), new_h = (int)(src->h * factor); if (new_w < 1) new_w = 1; if (new_h < 1) new_h = 1; return SDL_Resize(src, new_w, new_h, free, filter); }