+(defun resize-image (image width height)
+ (let ((old-width (surface-w image)) (old-height (surface-h image)))
+ (cond ((and (= width old-width) (= height old-height)) image)
+ (t (let ((zoomx (/ width old-width)) (zoomy (/ height old-height)) zoomed-image)
+ (setq zoomed-image (zoomSurface image zoomx zoomy 0))
+ (let ((new-width (surface-w zoomed-image)) (new-height (surface-h zoomed-image)))
+ (cond ((or (and (= width new-width) (= height new-height))
+ (and (= old-width new-width) (= old-height new-height))) zoomed-image)
+ (t (let (rezoomed)
+ (setq rezoomed (resize-image zoomed-image width height))
+ (SDL_FreeSurface zoomed-image)
+ rezoomed)))))))))
+