Debian Codegraph @

src/widget/WiPicture.cpp

raw
1 /*
2 * Copyright (C) 2004 Ivo Danihelka ([email protected])
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9 #include "WiPicture.h"
10
11 #include "ResImagePack.h"
12
13 //-----------------------------------------------------------------
14 WiPicture::WiPicture(const Path &picture)
15 {
16 m_surface = ResImagePack::loadImage(picture);
17 }
18 //-----------------------------------------------------------------
19 WiPicture::~WiPicture()
20 {
21 SDL_FreeSurface(m_surface);
22 }
23 //-----------------------------------------------------------------
24 void
25 WiPicture::drawOn(SDL_Surface *screen)
26 {
27 SDL_Rect rect;
28 rect.x = m_shift.getX();
29 rect.y = m_shift.getY();
30 SDL_BlitSurface(m_surface, NULL, screen, &rect);
31 }
32