00001 /* 00002 * Copyright (C) 2003-2009 Olivier Boudeville 00003 * 00004 * This file is part of the OSDL library. 00005 * 00006 * The OSDL library is free software: you can redistribute it and/or modify 00007 * it under the terms of either the GNU Lesser General Public License or 00008 * the GNU General Public License, as they are published by the Free Software 00009 * Foundation, either version 3 of these Licenses, or (at your option) 00010 * any later version. 00011 * 00012 * The OSDL library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License and the GNU General Public License 00016 * for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License and of the GNU General Public License along with the OSDL library. 00020 * If not, see <http://www.gnu.org/licenses/>. 00021 * 00022 * Author: Olivier Boudeville (olivier.boudeville@esperide.com) 00023 * 00024 */ 00025 00026 00027 #ifndef OSDL_TILE_MAP_H_ 00028 #define OSDL_TILE_MAP_H_ 00029 00030 00031 00032 #include "OSDLVideoRenderer.h" // for VideoRenderingException 00033 #include "OSDLVideoTypes.h" // for Length 00034 #include "OSDLPalette.h" // for ColorIndex 00035 00036 #include "Ceylan.h" // for inheritance 00037 00038 00039 #include <string> 00040 00041 00042 00043 00044 namespace OSDL 00045 { 00046 00047 00048 00049 namespace Rendering 00050 { 00051 00052 00053 00055 class OSDL_DLL TileMapException: public VideoRenderingException 00056 { 00057 00058 public: 00059 explicit TileMapException( const std::string & message ) ; 00060 00061 virtual ~TileMapException() throw() ; 00062 00063 } ; 00064 00065 00066 00067 00074 typedef Ceylan::Uint8 TileCount ; 00075 00076 00077 00084 typedef Ceylan::Uint16 TileNumber ; 00085 00086 00087 00088 00090 typedef Ceylan::Uint8 TileIndex ; 00091 00092 00093 00094 00095 // Tile section. 00096 00097 00099 typedef Ceylan::Uint8 TileLength ; 00100 00101 00102 00104 const TileLength TileWidth = 8 ; 00105 00106 00108 const TileLength TileHeight = 8 ; 00109 00110 00111 00117 typedef OSDL::Video::ColorIndex TileDefinition[TileWidth][TileHeight] ; 00118 00119 00120 00121 00126 class OSDL_DLL TileMap: public Ceylan::TextDisplayable 00127 { 00128 00129 00130 public: 00131 00132 00133 00152 TileMap( TileCount width, TileCount height, 00153 Ceylan::System::File & mapFile ) ; 00154 00155 00156 00161 virtual ~TileMap() throw() ; 00162 00163 00164 00176 virtual const std::string toString( 00177 Ceylan::VerbosityLevels level = Ceylan::high ) const ; 00178 00179 00180 00181 00182 00183 00184 protected: 00185 00186 00187 00189 TileCount _width ; 00190 00191 00193 TileCount _height ; 00194 00195 00202 TileNumber _size ; 00203 00204 00206 TileIndex * _map ; 00207 00208 00209 00210 00211 private: 00212 00213 00214 00223 TileMap( const TileMap & source ) ; 00224 00225 00226 00235 TileMap & operator = ( const TileMap & source ) ; 00236 00237 00238 } ; 00239 00240 00241 } 00242 00243 } 00244 00245 00246 00247 #endif // OSDL_TILE_MAP_H_ 00248