00001 /************************************************************************* 00002 tiles.h 00003 Project Piedmont game 00004 ------------------------- 00005 00006 Date Created: 9/25/00 Last Modified: 03/20/08 00007 Programmer: David Foster 00008 Copyright: (C) 2000 David Foster (see file COPYING) 00009 E-mail: dfoster@computer.org 00010 00011 Description: to come.... 00012 00013 This program is free software; you can redistribute it and/or modify 00014 it under the terms of the GNU General Public License as published by 00015 the Free Software Foundation; either version 2 of the License, or 00016 (at your option) any later version. 00017 00018 This program is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 GNU General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 along with this program; if not, write to the Free Software 00025 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00026 00027 ************************************************************************/ 00028 00029 #ifndef TILES_H 00030 #define TILES_H 00031 #define TILES_DEBUG 0 // 1 allows debug statements to be output 00032 00033 #include <stdio.h> 00034 #include <iostream> 00035 #include <fstream> 00036 #include <stdlib.h> 00037 #include <string> 00038 #include "SDL.h" 00039 #include "tiledata.h" 00040 using std::string; 00041 using namespace std; 00042 00043 //#define n 0 00044 //#define ne 3 00045 //#define e 6 00046 //#define se 9 00047 //#define s 12 00048 //#define sw 15 00049 //#define w 18 00050 //#define nw 21 00051 //#define attack 24 00052 //#define ranged 3 00053 00054 00055 class Tiles{ 00056 private: 00057 string tilefile_name; 00058 Tiledata *tiles; 00059 00060 public: 00061 Tiles(); 00062 ~Tiles(); 00063 void set_num_frames (int tile_index, int num_frames); 00064 void set_name (int tile_index, char* name); 00065 void set_num_images (int tile_index, int number); 00066 SDL_Surface* get_frame (int tile_index, int frame_index); 00067 int get_num_frames (int tile_index); 00068 string get_name (int tile_index); 00069 void load_tileimages(char *filename); 00070 Tiledata* get_tiledata (int index); 00071 }; 00072 00073 #endif 00074 00075 00076