DoorKeeper/include/doorkeeper/components/tile.hpp

53 lines
1.5 KiB
C++

/* Copyright 2015, Michele Santullo
* This file is part of DoorKeeper.
*
* DoorKeeper 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.
*
* DoorKeeper 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 DoorKeeper. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef id4617732A05EA419CA0CD21B7338E5471
#define id4617732A05EA419CA0CD21B7338E5471
#include "doorkeeper/primitivetypes.hpp"
#include "doorkeeper/components/pixelconv.hpp"
#include <vector>
namespace dk {
template <uint32_t D>
class PixelConv;
template <typename T, uint32_t D>
class Tile {
public:
typedef Vector<D> coords;
Tile ( T* parData, const TileCoords<D>& parPos, const coords& parBlockOffs, const PixelConv<D>* parPConv );
const T& data ( void ) const;
T& data ( void );
const coords& block_position ( void ) const;
const TileCoords<D>& raw_coords ( void ) const;
coords screen_position ( void ) const;
private:
const TileCoords<D> m_position;
const coords m_block_offs;
const PixelConv<D>* const m_pixconv;
T* const m_data;
};
} //namespace dk
#include "doorkeeper/implem/tile.inl"
#endif