Automatic width/height detection removed. (was hack for cursors.)
This commit is contained in:
parent
8817d197c3
commit
15c11d248e
1 changed files with 8 additions and 11 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue