00001 /************************************************************************* 00002 bgdraw.h 00003 Project Piedmont game 00004 ------------------------- 00005 00006 Date Created: 10/30/00 Last Modified: 05/21/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 BGDRAW_H 00030 #define BGDRAW_H 00031 #define BGDRAW_DEBUG 0 //1 allows debug statements to be output 00032 00033 #include <stdio.h> 00034 #include <iostream> 00035 #include <stdlib.h> 00036 #include <string> 00037 #include <stddef.h> 00038 #include <unistd.h> 00039 #include "SDL.h" 00040 #include "misc.h" 00041 #include "screen.h" 00042 #include "bgentity.h" 00043 using std::string; 00044 using namespace std; 00045 00046 00047 class BGDraw{ 00048 private: 00049 BGEntity *bgentity; 00050 Screen screen; 00051 paul_info *pinfo; 00052 int tilesize; 00053 int tile_start_x, tile_stop_x, tile_start_y, tile_stop_y; 00054 int map_offset_x, map_offset_y; //This is the x and y offset of the window compared to the map 00055 // When the window is drawn the window border may not line up on map 00056 // tile borders. These values indicate how many pixels from the window 00057 // borders you must go to line up with a map tile. This is how we 00058 // are able to draw parts of tiles on the window. 00059 00060 public: 00061 BGDraw(); 00062 ~BGDraw(); 00063 void set_display (Screen &s); 00064 void set_background (BGEntity *bge); 00065 void set_paul_info (paul_info *p); 00066 void set_size (int wwidth, int wheight, int mwidth, int mheight, 00067 int tsize, int startx, int starty); 00068 void set_char_position (int charx, int chary); 00069 void update_screen (); 00070 void initialize (); 00071 void refresh_all (); 00072 void move (int dir); 00073 }; 00074 00075 #endif 00076 00077 00078