00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef MISC_H
00030 #define MISC_H
00031 #define MISC_DEBUG 0
00032
00033 #ifndef MAPEDIT_H
00034 #include <iostream>
00035 #include <stdio.h>
00036 #include <stdlib.h>
00037 #include <string>
00038 #include "SDL.h"
00039 using std::string;
00040 using namespace std;
00041 #endif
00042
00043 #define FRAMES_PER_SECOND 10
00044 #define MOVE_PER_FRAME 10 // Number of pixels a sprite moves per frame
00045
00046 #define MINMAPWIDTH 20 // window_width/tilesize (640/32)
00047 #define MINMAPHEIGHT 15 // window_height/tilesize (480/32)
00048 #define TILESIZE 32
00049
00050 #define north 0
00051 #define northeast 3
00052 #define east 6
00053 #define southeast 9
00054 #define south 12
00055 #define southwest 15
00056 #define west 18
00057 #define northwest 21
00058 #define attack 24
00059 #define range 3
00060
00061 #define BACKGROUND_BEGIN 0
00062 #define BACKGROUND_END 176
00063 #define ENEMY_BEGIN 177
00064 #define ENEMY_END 192
00065 #define KEY_BEGIN 193
00066 #define KEY_END 193
00067 #define TELEPORTER_BEGIN 194
00068 #define TELEPORTER_END 194
00069 #define EXIT_BEGIN 195
00070 #define EXIT_END 195
00071 #define SCROLL_BEGIN 196
00072 #define SCROLL_END 196
00073 #define DOOR_BEGIN 197
00074 #define DOOR_END 200
00075 #define POWERUP_BEGIN 201
00076 #define POWERUP_END 207
00077 #define GOLD_BEGIN 208
00078 #define GOLD_END 215
00079 #define GENERATOR_BEGIN 216
00080 #define GENERATOR_END 216
00081 #define TRAPS_BEGIN 217
00082 #define TRAPS_END 220
00083 #define EMPTY_BEGIN 221
00084 #define EMPTY_END 254
00085 #define PIEDMONT_BEGIN 255
00086 #define PIEDMONT_END 255
00087 #define PIEDMONT 255
00088 #define PIEDMONT_MIN_HTPTS 0
00089 #define PIEDMONT_MAX_HTPTS 500
00090 #define PIEDMONT_MIN_DAMAGE 1
00091 #define PIEDMONT_MAX_DAMAGE 50
00092
00093 #define BG_MIN_DAMAGE 0
00094 #define BG_MAX_DAMAGE 10000
00095 #define ENEMY_MIN_HTPTS -1
00096 #define ENEMY_MAX_HTPTS 1000
00097 #define ENEMY_MIN_DAMAGE 0
00098 #define ENEMY_MAX_DAMAGE 100
00099 #define EXIT_MAX 20
00100 #define POWERUP_MIN -255
00101 #define POWERUP_MAX 255
00102 #define GOLD_MIN 5
00103 #define GOLD_MAX 500
00104 #define GEN_MIDX_MIN 177
00105 #define GEN_MIDX_MAX 192
00106 #define GEN_MIN_HTPTS -1
00107 #define GEN_MAX_HTPTS 500
00108 #define TRAP_MIN_DAMAGE 0
00109 #define TRAP_MAX_DAMAGE 100
00110
00111
00112 #ifndef MAPEDIT_H // don't include misc functions in mapedit program
00113
00114 typedef struct{
00115 char* name;
00116 int num_images;
00117 int first_prop;
00118 int second_prop;
00119 int third_prop;
00120 int first_min;
00121 int first_max;
00122 int second_min;
00123 int second_max;
00124 int third_min;
00125 int third_max;
00126 char* first_string;
00127 char* second_string;
00128 char* third_string;
00129 char** suffix;
00130 }tile_info;
00131
00132 typedef struct{
00133 int hitpoints;
00134 int base_health;
00135 int damage;
00136 int ranged;
00137 int keys;
00138 int level;
00139 int score;
00140 int direction;
00141 int map_width;
00142 int map_height;
00143 int win_width;
00144 int win_height;
00145 int map_width_in_tiles;
00146 int map_height_in_tiles;
00147 int win_width_in_tiles;
00148 int win_height_in_tiles;
00149 int tilesize;
00150 int paul_x;
00151 int paul_y;
00152 int paul_ax;
00153 int paul_ay;
00154 int center_x;
00155 int center_y;
00156 int paul_center_ax;
00157 int paul_center_ay;
00158 int map_ax;
00159 int map_ay;
00160 int tile_start_x;
00161 int tile_stop_x;
00162 int tile_start_y;
00163 int tile_stop_y;
00164 int tile_ax_in_win;
00165 int tile_ay_in_win;
00166
00167
00168
00169
00170
00171
00172 }paul_info;
00173
00174 SDL_Rect makerect(int x, int y, int w, int h);
00175 void wait_frame();
00176 tile_info* process_tile(int index, int first_flag, char* tilename);
00177 char* get_level_filename(int level_number);
00178 void print_paul_info(paul_info *p);
00179 void print_tile_info(tile_info *t);
00180
00181 #endif
00182
00183 #endif
00184
00185
00186