tileset.h

Go to the documentation of this file.
00001 
00002 //            Copyright (C) 2004-2007 by The Allacrost Project
00003 //                         All Rights Reserved
00004 //
00005 // This code is licensed under the GNU GPL version 2. It is free software 
00006 // and you may modify it and/or redistribute it under the terms of this license.
00007 // See http://www.gnu.org/copyleft/gpl.html for details.
00009 
00010 /*!****************************************************************************
00011  * \file    tileset.h
00012  * \author  Philip Vorsilak, gorzuate@allacrost.org
00013  * \brief   Header file for editor's tileset, used for maintaining a visible
00014  *          "list" of tiles to select from for painting on a map.
00015  *****************************************************************************/
00016 
00017 #ifndef __TILESET_HEADER__
00018 #define __TILESET_HEADER__
00019 
00020 #include "utils.h"
00021 #include "defs.h"
00022 #include "script.h"
00023 #include "video.h"
00024 
00025 #include <QMessageBox>
00026 #include <Q3Table>
00027 #include <QImageReader>
00028 #include <QRect>
00029 #include <QVariant>
00030 
00032 namespace hoa_editor
00033 {
00034 
00035   struct AnimatedTileData {
00036     int tile_id;
00037     int time;
00038   };
00039 
00041 const int TILE_WIDTH  = 32;
00042 const int TILE_HEIGHT = 32;
00043 
00048 class Tileset
00049 {
00050   public:
00052     Tileset(QWidget* parent, const QString& name);
00054     ~Tileset();
00055 
00056     void Save();
00057 
00059     QString tileset_name;
00061     std::vector<hoa_video::StillImage> tiles;
00063     std::map<int, std::vector<int32> > walkability;
00065     Q3Table* table;
00066     // TODO: implement some sort of dynamic table resizing on window resize
00067 
00068   private:
00069     std::vector<std::vector<AnimatedTileData> > _animated_tiles;
00070 }; // class Tileset
00071 
00072 } // namespace hoa_editor
00073 
00074 #endif
00075 // __TILESET_HEADER__

Generated on Fri Jul 6 23:11:25 2007 for Hero of Allacrost by  doxygen 1.5.1