/*
   spacemaze - Fly a space ship through a maze and collect all the items.
   Copyright (C) 2000, 2001, 2002 John Ericson 

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

   2001-09-21 High / John Ericson john@john.pp.se
*/

#include "sprite.h"


void drawsprite(sprite *sprite) {
   //struct struct_drawrect *u;
   SDL_Rect rect;

   //printf("sprite: x: %d y: %d w: %d h: %d\n", sprite->x, sprite->y, sprite->image->w, sprite->image->h);
   //exit(1);
   /*
   u = &drawrect[drawrect_numupdate++];
   
   u->src = sprite->image;
   u->rectsrc->x = 0;
   u->rectsrc->y = 0;
   u->rectsrc->w = sprite->image->w;
   u->rectsrc->h = sprite->image->h;
   
   u->rectdst->x = sprite->x;
   u->rectdst->y = sprite->y;
   u->rectdst->w = sprite->image->w;
   u->rectdst->h = sprite->image->h;
   */
   rect.x = sprite->x;
   rect.y = sprite->y;
   rect.w = sprite->image->w;
   rect.h = sprite->image->h;

   //printf("rect: x: %d y: %d w: %d h: %d\n", rect.x, rect.y, rect.w, rect.h);
   //exit(1);

   inputdrawrectsrc(&rect, sprite->image);
}

void erasesprite(sprite *sprite) {
   SDL_Rect rect;

   rect.x = sprite->x;
   rect.y = sprite->y;
   rect.w = sprite->image->w;
   rect.h = sprite->image->h;

   inputdrawrect(&rect);

   /* Draws a black rectangle */
   SDL_FillRect(screen, &rect, 0);
}