New TiledWallpaper class for the background.

This commit is contained in:
King_DuckZ 2014-03-06 11:42:56 +01:00
parent 83d139d4b5
commit 8d2ddaa9ff
5 changed files with 107 additions and 0 deletions

54
src/tiledwallpaper.cpp Normal file
View file

@ -0,0 +1,54 @@
/*
Copyright 2014 Michele "King_DuckZ" Santullo
This file is part of CloonelJump.
CloonelJump 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 3 of the License, or
(at your option) any later version.
CloonelJump 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 CloonelJump. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tiledwallpaper.hpp"
#include "texture.hpp"
namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
TiledWallpaper::TiledWallpaper (const std::string&& parPath, SDLMain* parMain) :
Drawable(0, 0),
m_tile(new Texture(parPath, parMain, false))
{
}
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
TiledWallpaper::~TiledWallpaper() noexcept {
}
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
void TiledWallpaper::Reload() {
m_tile->Reload();
}
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
void TiledWallpaper::Destroy() noexcept {
m_tile->Destroy();
}
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
void TiledWallpaper::Draw() const {
m_tile->Render(int2(0));
}
} //namespace cloonel