From 15c11d248e6974904403a7fc90bc9b089ce6da81 Mon Sep 17 00:00:00 2001 From: johns <> Date: Mon, 4 Jun 2001 12:53:02 +0000 Subject: [PATCH] Automatic width/height detection removed. (was hack for cursors.) --- src/video/sprite.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/video/sprite.cpp b/src/video/sprite.cpp index 6abb35ba4..6db21a42c 100644 --- a/src/video/sprite.cpp +++ b/src/video/sprite.cpp @@ -1651,20 +1651,17 @@ global Graphic* LoadSprite(const char* name,unsigned width,unsigned height) int w; graphic=LoadGraphic(name); - if( !width ) { // FIXME: this is hack for cursors! - width=graphic->Width; - } - if( !height ) { - height=graphic->Height; - } + + DebugCheck( !width || !height ); DebugCheck( width>graphic->Width || height>graphic->Height ); + depth=8; - if(((graphic->Width/width)*width!=graphic->Width) - || ((graphic->Height/height)*height!=graphic->Height) ){ - fprintf(stderr,"Invalid graphic (width, height) %s\n",name); - fprintf(stderr,"Expected: (%d,%d) Found: (%d,%d)", - width,height,graphic->Width,graphic->Height); + if( ((graphic->Width/width)*width!=graphic->Width) + || ((graphic->Height/height)*height!=graphic->Height) ) { + fprintf(stderr,"Invalid graphic (width, height) %s\n",name); + fprintf(stderr,"Expected: (%d,%d) Found: (%d,%d)", + width,height,graphic->Width,graphic->Height); } // Check if width and height fits.