Added some typedefs for clarity, and also added a cAttack class.
git-svn-id: http://openexile.googlecode.com/svn/trunk@77 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
@@ -63,7 +63,7 @@ extern cTown* town;
|
||||
//extern big_tr_type t_d;
|
||||
//extern short town_type; // 0 - big 1 - ave 2 - small
|
||||
extern short /*max_dim[3],*/mode_count,to_create;
|
||||
extern unsigned short template_terrain[64][64];
|
||||
extern ter_num_t template_terrain[64][64];
|
||||
extern cItemRec item_list[400];
|
||||
extern cScenario scenario;
|
||||
extern ControlHandle right_sbar;
|
||||
@@ -107,7 +107,7 @@ cSpeech::cNode null_talk_node = {0,0,{120,120,120,120},{120,120,120,120},{0,0,0,
|
||||
rectangle working_rect;
|
||||
location last_space_hit;
|
||||
bool erasing_mode;
|
||||
unsigned short current_ground = 0;
|
||||
ter_num_t current_ground = 0;
|
||||
|
||||
short special_to_paste = -1;
|
||||
|
||||
@@ -1252,7 +1252,7 @@ void flash_rect(Rect to_flash) {
|
||||
|
||||
void swap_terrain() {
|
||||
short a,b,c,i,j;
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
|
||||
change_ter(&a,&b,&c);
|
||||
if (a < 0) return;
|
||||
@@ -1270,7 +1270,7 @@ void swap_terrain() {
|
||||
|
||||
}
|
||||
|
||||
void set_new_terrain(unsigned short selected_terrain) {
|
||||
void set_new_terrain(ter_num_t selected_terrain) {
|
||||
current_terrain_type = selected_terrain;
|
||||
redraw_selected_ter();
|
||||
// if (selected_terrain < 2)
|
||||
@@ -1549,7 +1549,7 @@ void set_up_lights() {
|
||||
|
||||
|
||||
bool is_wall(short i,short j) {
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
bool answer = false;
|
||||
short pic;
|
||||
|
||||
@@ -1578,7 +1578,7 @@ bool is_wall(short i,short j) {
|
||||
}
|
||||
|
||||
bool is_correctable_wall(short i,short j) {
|
||||
unsigned short ter,walls[13] = {5,6,8,9,11,12,
|
||||
ter_num_t ter,walls[13] = {5,6,8,9,11,12,
|
||||
14,15,17,18,19,20,21};
|
||||
bool answer = false;
|
||||
short k;
|
||||
@@ -1598,7 +1598,7 @@ bool is_correctable_wall(short i,short j) {
|
||||
bool is_mountain(short i,short j) {
|
||||
bool answer = false;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
pic = scenario.ter_types[ter].picture;
|
||||
@@ -1620,7 +1620,7 @@ bool is_mountain(short i,short j) {
|
||||
bool is_hill(short i,short j) {
|
||||
bool answer = false;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
pic = scenario.ter_types[ter].picture;
|
||||
@@ -1650,7 +1650,7 @@ bool is_hill_or_mountain(short i,short j) {
|
||||
bool is_erasable_water(short i,short j) {
|
||||
bool answer = false;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
pic = scenario.ter_types[ter].picture;
|
||||
@@ -1667,7 +1667,7 @@ bool is_erasable_water(short i,short j) {
|
||||
bool is_water(short i,short j) {
|
||||
bool answer = false;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
pic = scenario.ter_types[ter].picture;
|
||||
@@ -1684,7 +1684,7 @@ bool is_water(short i,short j) {
|
||||
bool is_correctable_water(short i,short j) {
|
||||
bool answer = false;
|
||||
short pic;
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
|
||||
ter = (editing_town == true) ? town->terrain(i,j) : current_terrain.terrain[i][j];
|
||||
pic = scenario.ter_types[ter].picture;
|
||||
@@ -1699,11 +1699,11 @@ bool is_correctable_water(short i,short j) {
|
||||
return answer;
|
||||
}
|
||||
|
||||
void shy_change_circle_terrain(location center,short radius,unsigned short terrain_type,short probability) {
|
||||
void shy_change_circle_terrain(location center,short radius,ter_num_t terrain_type,short probability) {
|
||||
// prob is 0 - 20, 0 no, 20 always
|
||||
location l;
|
||||
short i,j;
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
|
||||
for (i = 0; i < ((editing_town == true) ? town->max_dim() : 48); i++)
|
||||
for (j = 0; j < ((editing_town == true) ? town->max_dim() : 48); j++) {
|
||||
@@ -1716,7 +1716,7 @@ void shy_change_circle_terrain(location center,short radius,unsigned short terra
|
||||
}
|
||||
}
|
||||
|
||||
void change_circle_terrain(location center,short radius,unsigned short terrain_type,short probability) {
|
||||
void change_circle_terrain(location center,short radius,ter_num_t terrain_type,short probability) {
|
||||
// prob is 0 - 20, 0 no, 20 always
|
||||
location l;
|
||||
short i,j;
|
||||
@@ -1730,7 +1730,7 @@ void change_circle_terrain(location center,short radius,unsigned short terrain_t
|
||||
}
|
||||
}
|
||||
|
||||
void change_rect_terrain(rectangle r,unsigned short terrain_type,short probability,bool hollow) {
|
||||
void change_rect_terrain(rectangle r,ter_num_t terrain_type,short probability,bool hollow) {
|
||||
// prob is 0 - 20, 0 no, 20 always
|
||||
location l;
|
||||
short i,j;
|
||||
@@ -1769,7 +1769,7 @@ void change_val (unsigned char *val,short a,short b) {
|
||||
|
||||
void frill_up_terrain() {
|
||||
short i,j;
|
||||
unsigned short terrain_type;
|
||||
ter_num_t terrain_type;
|
||||
|
||||
for (i = 0; i < ((editing_town == true) ? town->max_dim() : 48); i++)
|
||||
for (j = 0; j < ((editing_town == true) ? town->max_dim() : 48); j++) {
|
||||
@@ -1792,7 +1792,7 @@ void frill_up_terrain() {
|
||||
|
||||
void unfrill_terrain() {
|
||||
short i,j;
|
||||
unsigned short terrain_type;
|
||||
ter_num_t terrain_type;
|
||||
|
||||
for (i = 0; i < ((editing_town == true) ? town->max_dim() : 48); i++)
|
||||
for (j = 0; j < ((editing_town == true) ? town->max_dim() : 48); j++) {
|
||||
@@ -1812,7 +1812,7 @@ void unfrill_terrain() {
|
||||
draw_terrain();
|
||||
}
|
||||
|
||||
unsigned short find_object_part(unsigned char num, unsigned char x, unsigned char y, unsigned short fallback){
|
||||
ter_num_t find_object_part(unsigned char num, unsigned char x, unsigned char y, ter_num_t fallback){
|
||||
for(int i = 0; i < 256; i++){
|
||||
if(scenario.ter_types[i].obj_num == num &&
|
||||
scenario.ter_types[i].obj_pos.x == x &&
|
||||
@@ -1822,7 +1822,7 @@ unsigned short find_object_part(unsigned char num, unsigned char x, unsigned cha
|
||||
return fallback;
|
||||
}
|
||||
|
||||
unsigned short get_ground_from_ter(unsigned short ter){
|
||||
ter_num_t get_ground_from_ter(ter_num_t ter){
|
||||
unsigned char ground = scenario.ter_types[ter].ground_type;
|
||||
for(int i = 0; i < 256; i++)
|
||||
if(scenario.ter_types[i].ground_type == ground)
|
||||
@@ -1830,8 +1830,8 @@ unsigned short get_ground_from_ter(unsigned short ter){
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool terrain_matches(unsigned char x, unsigned char y, unsigned short ter){
|
||||
unsigned short ter2;
|
||||
bool terrain_matches(unsigned char x, unsigned char y, ter_num_t ter){
|
||||
ter_num_t ter2;
|
||||
if(editing_town) ter2 = town->terrain(x,y); else ter2 = current_terrain.terrain[x][y];
|
||||
if(ter2 == ter) return true;
|
||||
if(scenario.ter_types[ter2].ground_type != scenario.ter_types[ter].ground_type)
|
||||
@@ -1853,9 +1853,9 @@ bool terrain_matches(unsigned char x, unsigned char y, unsigned short ter){
|
||||
}
|
||||
|
||||
|
||||
void set_terrain(location l,unsigned short terrain_type) {
|
||||
void set_terrain(location l,ter_num_t terrain_type) {
|
||||
short i,j,which_sign = -1;
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
location l2;
|
||||
|
||||
i = l.x;
|
||||
@@ -2014,7 +2014,7 @@ void set_terrain(location l,unsigned short terrain_type) {
|
||||
}
|
||||
|
||||
bool fix_rubble(location l) {
|
||||
unsigned short terrain_type;
|
||||
ter_num_t terrain_type;
|
||||
|
||||
if ((l.x < 0) || (l.y > town->max_dim() - 1) || (l.y < 0) || (l.y > town->max_dim() - 1))
|
||||
return false;
|
||||
@@ -2039,8 +2039,8 @@ bool fix_rubble(location l) {
|
||||
}
|
||||
|
||||
bool fix_cave(location l) {
|
||||
unsigned short ter_to_fix;
|
||||
unsigned short store_ter;
|
||||
ter_num_t ter_to_fix;
|
||||
ter_num_t store_ter;
|
||||
short i,j;
|
||||
|
||||
if ((l.x < 0) || (l.y > town->max_dim() - 1) || (l.y < 0) || (l.y > town->max_dim() - 1))
|
||||
@@ -2135,8 +2135,8 @@ bool fix_cave(location l) {
|
||||
|
||||
|
||||
bool fix_mountain(location l) {
|
||||
unsigned short ter_to_fix;
|
||||
unsigned short store_ter;
|
||||
ter_num_t ter_to_fix;
|
||||
ter_num_t store_ter;
|
||||
short i,j;
|
||||
|
||||
if ((l.x < 0) || (l.y > town->max_dim() - 1) || (l.y < 0) || (l.y > town->max_dim() - 1))
|
||||
@@ -2230,8 +2230,8 @@ bool fix_mountain(location l) {
|
||||
}
|
||||
|
||||
bool fix_hill(location l) {
|
||||
unsigned short ter_to_fix;
|
||||
unsigned short store_ter;
|
||||
ter_num_t ter_to_fix;
|
||||
ter_num_t store_ter;
|
||||
short i,j;
|
||||
|
||||
if ((l.x < 0) || (l.y > town->max_dim() - 1) || (l.y < 0) || (l.y > town->max_dim() - 1))
|
||||
@@ -2329,8 +2329,8 @@ bool fix_hill(location l) {
|
||||
}
|
||||
|
||||
bool fix_water(location l) {
|
||||
unsigned short ter_to_fix;
|
||||
unsigned short store_ter;
|
||||
ter_num_t ter_to_fix;
|
||||
ter_num_t store_ter;
|
||||
short i,j;
|
||||
|
||||
if ((l.x < 0) || (l.y > town->max_dim() - 1) || (l.y < 0) || (l.y > town->max_dim() - 1))
|
||||
@@ -2427,7 +2427,7 @@ bool fix_water(location l) {
|
||||
|
||||
// begin out
|
||||
bool out_fix_rubble(location l) {
|
||||
unsigned short terrain_type;
|
||||
ter_num_t terrain_type;
|
||||
|
||||
if ((l.x < 0) || (l.y > 47) || (l.y < 0) || (l.y > 47))
|
||||
return false;
|
||||
@@ -2452,8 +2452,8 @@ bool out_fix_rubble(location l) {
|
||||
}
|
||||
|
||||
bool out_fix_cave(location l) {
|
||||
unsigned short ter_to_fix;
|
||||
unsigned short store_ter;
|
||||
ter_num_t ter_to_fix;
|
||||
ter_num_t store_ter;
|
||||
short i,j;
|
||||
|
||||
if ((l.x < 0) || (l.y > 47) || (l.y < 0) || (l.y > 47))
|
||||
@@ -2548,8 +2548,8 @@ bool out_fix_cave(location l) {
|
||||
|
||||
|
||||
bool out_fix_mountain(location l) {
|
||||
unsigned short ter_to_fix;
|
||||
unsigned short store_ter;
|
||||
ter_num_t ter_to_fix;
|
||||
ter_num_t store_ter;
|
||||
short i,j;
|
||||
|
||||
if ((l.x < 0) || (l.y > 47) || (l.y < 0) || (l.y > 47))
|
||||
@@ -2643,8 +2643,8 @@ bool out_fix_mountain(location l) {
|
||||
}
|
||||
|
||||
bool out_fix_hill(location l) {
|
||||
unsigned short ter_to_fix;
|
||||
unsigned short store_ter;
|
||||
ter_num_t ter_to_fix;
|
||||
ter_num_t store_ter;
|
||||
short i,j;
|
||||
|
||||
if ((l.x < 0) || (l.y > 47) || (l.y < 0) || (l.y > 47))
|
||||
@@ -2742,8 +2742,8 @@ bool out_fix_hill(location l) {
|
||||
}
|
||||
|
||||
bool out_fix_water(location l) {
|
||||
unsigned short ter_to_fix;
|
||||
unsigned short store_ter;
|
||||
ter_num_t ter_to_fix;
|
||||
ter_num_t store_ter;
|
||||
short i,j;
|
||||
|
||||
if ((l.x < 0) || (l.y > 47) || (l.y < 0) || (l.y > 47))
|
||||
@@ -3066,7 +3066,7 @@ void set_special(location spot_hit) {
|
||||
|
||||
void town_entry(location spot_hit) {
|
||||
short x,y;
|
||||
unsigned short ter;
|
||||
ter_num_t ter;
|
||||
|
||||
ter = current_terrain.terrain[spot_hit.x][spot_hit.y];
|
||||
if (scenario.ter_types[ter].special != TER_SPEC_TOWN_ENTRANCE) {
|
||||
@@ -3569,7 +3569,7 @@ bool is_lava(short x,short y) {
|
||||
}
|
||||
|
||||
short get_obscurity(short x,short y) {
|
||||
unsigned short what_terrain;
|
||||
ter_num_t what_terrain;
|
||||
short store;
|
||||
|
||||
what_terrain = coord_to_ter(x,y);
|
||||
@@ -3582,8 +3582,8 @@ short get_obscurity(short x,short y) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned short coord_to_ter(short x,short y) {
|
||||
unsigned short what_terrain;
|
||||
ter_num_t coord_to_ter(short x,short y) {
|
||||
ter_num_t what_terrain;
|
||||
|
||||
if (editing_town == true)
|
||||
what_terrain = town->terrain(x,y);
|
||||
|
Reference in New Issue
Block a user