00001 /* 00002 * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 */ 00009 #include "WiPicture.h" 00010 00011 #include "ResImagePack.h" 00012 00013 //----------------------------------------------------------------- 00014 WiPicture::WiPicture(const Path &picture) 00015 { 00016 m_surface = ResImagePack::loadImage(picture); 00017 } 00018 //----------------------------------------------------------------- 00019 WiPicture::~WiPicture() 00020 { 00021 SDL_FreeSurface(m_surface); 00022 } 00023 //----------------------------------------------------------------- 00024 void 00025 WiPicture::drawOn(SDL_Surface *screen) 00026 { 00027 SDL_Rect rect; 00028 rect.x = m_shift.getX(); 00029 rect.y = m_shift.getY(); 00030 SDL_BlitSurface(m_surface, NULL, screen, &rect); 00031 } 00032