- Nuked the storage_gworld and party_template_gworld. Monster, terrain, and PC graphics are now drawn directly from their sheets of origin. This is partly tested, and seems to work fine.

- Removed the terrain_pic and terrain_blockage arrays, which were redundant (though shorter).
- Cleaned out some of the commented code in boe.graphics.cpp and boe.graphutil.cpp
- Added a templated get function to cOutdoors::cWandering.
In the dialog engine:
- Important fields are now initialized to default values, as they should be.
- The absence of required attributes is now recognized as an error
- Added stack element to the DTD; no code support yet
- Added fore attribute to the dialog element to specify default text colour; DTD updated and code support added.
- Likewise with the def-key attribute on other clickable items besides buttons (which already had it)
- Updated stylesheet to fall back on the fore attribute when colour is unspecified
- When drawing default monster graphics, it uses m_start_pic instead of num as the index. This should be right, though it's untested.
Unfortunately, the dialog engine is still unstable.

git-svn-id: http://openexile.googlecode.com/svn/trunk@100 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
2009-06-28 17:18:24 +00:00
parent e5ac5db275
commit 6af129c277
35 changed files with 395 additions and 1120 deletions

View File

@@ -46,11 +46,11 @@ extern DialogPtr modeless_dialogs[18];
extern short combat_posing_monster , current_working_monster ; // 0-5 PC 100 + x - monster x
//extern piles_of_stuff_dumping_type *data_store; TODO: Abolish storage_gworld
extern GWorldPtr storage_gworld,terrain_screen_gworld,party_template_gworld,items_gworld,tiny_obj_gworld;
extern GWorldPtr fields_gworld,anim_gworld,vehicle_gworld;
extern short which_g_stored[STORED_GRAPHICS];
extern short wish_list[STORED_GRAPHICS];
extern short storage_status[STORED_GRAPHICS]; // 0 - empty 1 - in use 2 - there, not in use
extern GWorldPtr terrain_screen_gworld,items_gworld,tiny_obj_gworld,pc_gworld,monst_gworld[NUM_MONST_SHEETS];
extern GWorldPtr fields_gworld,anim_gworld,vehicle_gworld,terrain_gworld[NUM_TER_SHEETS];
//extern short which_g_stored[STORED_GRAPHICS];
//extern short wish_list[STORED_GRAPHICS];
//extern short storage_status[STORED_GRAPHICS]; // 0 - empty 1 - in use 2 - there, not in use
extern short terrain_there[9][9];
extern pending_special_type special_queue[20];
@@ -66,7 +66,6 @@ extern short display_mode;
extern long anim_ticks;
extern short terrain_pic[256];
extern char spot_seen[9][9];
//extern char out_trim[96][96],town_trim[64][64];
extern short monster_index[21];
@@ -80,85 +79,6 @@ extern GWorldPtr spec_scen_g;
Rect boat_rects[4] = {{0,0,36,28}, {0,28,36,56},{0,56,36,84},{0,84,36,112}};
bool gave_no_g_error = false;
eAmbientSound ambient_sound;
//unsigned char m_pic_index[200] = {////
//1,2,3,4,5,6,7,8,9,10,
//11,12,13,14,15,16,17,18,19,20,
//
//21,22,23,24,25, 26,27,28,29,30,
//31,32,33,34,35, 36,37,38,39,40,
//
//41,42,43,44,46,47,48,49,50,51,
//53,55,57,59,60,61,62,63,64,65,
//
//66,67,68,69,70, 71,72,73,74,75,
//76,77,78,79,81, 82,83,85,86,87,
//
//88,89,90,91,92, 93,94,95,96,97,
//98,99,100,101,102, 103,104,105,106,107,
//
//108,109,111,112,113, 114,116,117,118,119, //100
//120,122,123,125,127, 128,129,130,131,135,
//
//136,137,139,140,141,142,143,144,145,146,
//147,148,149,150,151,152,152,154,155,159,
//
//160,164,166,168,170,171,172,173,174,175,
//176,177,178,179,180,181,182,183,184,185,
//
//186,187,188,189,190,191,192,193,194,195,
//196,197,198,0,0,0,0,0,0,0,
//
//0,0,0,0,0,0,0,0,0,0,
//0,0,0,0,0,0,0,0,0,0};
//
//unsigned char m_pic_index_x[200] = {
//
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,2,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//
//1,2,1,1,1,2,1,1,1,1, // 100
//2,1,1,1,1,1,1,1,2,1,
//1,2,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,2,1,
//
//2,2,2,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1};
//
//unsigned char m_pic_index_y[200] = {
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,2,
//2,2,2,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,2,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//
//1,1,1,1,1,1,1,1,1,1,
//1,1,2,2,1,1,1,1,2,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,2,1,
//2,1,1,2,1,1,1,1,1,1,
//
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1,
//1,1,1,1,1,1,1,1,1,1};
void draw_one_terrain_spot (short i,short j,short terrain_to_draw) ////
//short dest; // 0 - terrain gworld 1 - screen
@@ -172,65 +92,72 @@ void draw_one_terrain_spot (short i,short j,short terrain_to_draw) ////
GrafPtr old_port;
location l;
source_gworld = storage_gworld;
l.x = i; l.y = j;
if (supressing_some_spaces && (l != ok_space[0]) && (l != ok_space[1]) && (l != ok_space[2]) && (l != ok_space[3]))
return;
where_draw = calc_rect(i,j);
OffsetRect(&where_draw,13,13);
if (terrain_to_draw == -1) {
if ((cartoon_happening == false) && (terrain_there[i][j] == 300)) {
return;
}
}
terrain_there[i][j] = 300;
GetPort(&old_port);
SetPort(terrain_screen_gworld);
PaintRect(&where_draw);
SetPort(old_port);
return;
}
}
////
if (terrain_to_draw >= 10000) { // force using a specific graphic
if (terrain_there[i][j] == terrain_to_draw - 10000)
terrain_to_draw -= 10000;
if (terrain_there[i][j] == terrain_to_draw)
return;
terrain_there[i][j] = terrain_to_draw - 10000;
source_rect = return_item_rect(terrain_to_draw - 10000);
source_gworld = terrain_gworld[terrain_to_draw / 50];
terrain_there[i][j] = terrain_to_draw;
terrain_to_draw %= 50;
source_rect = calc_rect(terrain_to_draw % 10, terrain_to_draw / 10);
anim_type = -1;
}
else if (scenario.ter_types[terrain_to_draw].picture >= 2000) { // custom
source_gworld = spec_scen_g;
source_rect = get_custom_rect(scenario.ter_types[terrain_to_draw].picture - 2000 + (anim_ticks % 4));
anim_type = 0;
terrain_there[i][j] = -1;
}
else if (scenario.ter_types[terrain_to_draw].picture >= 1000) { // custom
source_gworld = spec_scen_g;
source_rect = get_custom_rect(scenario.ter_types[terrain_to_draw].picture - 1000);
terrain_there[i][j] = -1;
}
else if (scenario.ter_types[terrain_to_draw].picture >= 400) { // animated
source_gworld = anim_gworld;
terrain_to_draw = scenario.ter_types[terrain_to_draw].picture;
source_rect = calc_rect(4 * ((terrain_to_draw - 400) / 5) + (anim_ticks % 4),(terrain_to_draw - 400) % 5);
terrain_there[i][j] = -1;
anim_type = 0;
}
else {
if (cartoon_happening == false) {
if (terrain_there[i][j] == scenario.ter_types[terrain_to_draw].picture) {
return;
}
terrain_there[i][j] = scenario.ter_types[terrain_to_draw].picture;
}
else if (terrain_pic[terrain_to_draw] >= 2000) { // custom
source_gworld = spec_scen_g;
source_rect = get_custom_rect(terrain_pic[terrain_to_draw] - 2000 + (anim_ticks % 4));
anim_type = 0;
terrain_there[i][j] = -1;
}
else if (terrain_pic[terrain_to_draw] >= 1000) { // custom
source_gworld = spec_scen_g;
source_rect = get_custom_rect(terrain_pic[terrain_to_draw] - 1000);
terrain_there[i][j] = -1;
}
else if (terrain_pic[terrain_to_draw] >= 400) { // animated
source_rect = return_item_rect(terrain_pic[terrain_to_draw] + 600 + 100 * (anim_ticks % 4));
terrain_there[i][j] = -1;
anim_type = 0;
}
else {
if (cartoon_happening == false) {
if (terrain_there[i][j] == terrain_pic[terrain_to_draw]) {
return;
}
terrain_there[i][j] = terrain_pic[terrain_to_draw];
}
source_rect = return_item_rect(terrain_pic[terrain_to_draw]);
anim_type = -1;
}
terrain_to_draw = scenario.ter_types[terrain_to_draw].picture;
source_gworld = terrain_gworld[terrain_to_draw / 50];
terrain_there[i][j] = terrain_to_draw;
terrain_to_draw %= 50;
source_rect = calc_rect(terrain_to_draw % 10, terrain_to_draw / 10);
anim_type = -1;
}
if (anim_type >= 0)
{
if ((is_town()) || (is_out()))
anim_onscreen = true;
}
if (anim_type >= 0)
{
if ((is_town()) || (is_out()))
anim_onscreen = true;
}
rect_draw_some_item(source_gworld, source_rect, terrain_screen_gworld, where_draw);
}
@@ -259,17 +186,14 @@ void draw_monsters() ////
where_draw.y = univ.party.out_c[i].m_loc.y - univ.party.p_loc.y + 4;
terrain_there[where_draw.x][where_draw.y] = -1;
j = 0;
while ((univ.party.out_c[i].what_monst.monst[j] == 0) && (j < 7)) {
j++;
}
for(j = 0; univ.party.out_c[i].what_monst.monst[j] == 0 && j < 7; j++);
if (j == 7) univ.party.out_c[i].exists = false; // begin watch out
else {
picture_wanted = get_monst_picnum(univ.party.out_c[i].what_monst.monst[j]);
} // end watch out
if (univ.party.out_c[i].exists == true) {
if (univ.party.out_c[i].exists) {
get_monst_dims(univ.party.out_c[i].what_monst.monst[j],&width,&height);
if (picture_wanted >= 1000) {
for (k = 0; k < width * height; k++) {
@@ -282,11 +206,11 @@ void draw_monsters() ////
}
if (picture_wanted < 1000) {
for (k = 0; k < width * height; k++) {
source_rect = get_monster_template_rect(univ.party.out_c[i].what_monst.monst[j],
(univ.party.out_c[i].direction < 4) ? 0 : 1,k);
pic_num_t this_monst = univ.party.out_c[i].what_monst.get(j,true,&cMonster::picture_num);
source_rect = get_monster_template_rect(this_monst,(univ.party.out_c[i].direction < 4) ? 0 : 1,k);
to_rect = monst_rects[(width - 1) * 2 + height - 1][k];
OffsetRect(&to_rect,13 + 28 * where_draw.x,13 + 36 * where_draw.y);
rect_draw_some_item(storage_gworld, source_rect, terrain_screen_gworld,to_rect, transparent);
rect_draw_some_item(monst_gworld[m_pic_index[this_monst].i/20], source_rect, terrain_screen_gworld,to_rect, transparent);
}
}
}
@@ -301,7 +225,7 @@ void draw_monsters() ////
where_draw.y = univ.town.monst[i].cur_loc.y - center.y + 4;
get_monst_dims(univ.town.monst[i].number,&width,&height);
if (point_onscreen(center,univ.town.monst[i].cur_loc) == true)
play_see_monster_str(univ.town.monst[i].number);
play_see_monster_str(univ.town.monst[i].number); // TODO: This also gets called by check_if_monst_seen!
for (k = 0; k < width * height; k++) {
store_loc = where_draw;
@@ -312,10 +236,20 @@ void draw_monsters() ////
source_rect = get_custom_rect((univ.town.monst[i].picture_num % 1000) +
k + ((univ.town.monst[i].direction < 4) ? 0 : width * height)
+ ((combat_posing_monster == i + 100) ? (2 * width * height) : 0));
Draw_Some_Item(spec_scen_g, source_rect, terrain_screen_gworld, store_loc, 1, 0);
ter = univ.town->terrain(univ.town.monst[i].cur_loc.x,univ.town.monst[i].cur_loc.y);
// in bed?
if ((store_loc.x >= 0) && (store_loc.x < 9) && (store_loc.y >= 0) && (store_loc.y < 9) &&
(scenario.ter_types[ter].special == TER_SPEC_BED) &&
((univ.town.monst[i].m_type < 7)
&& (univ.town.monst[i].m_type != 1) && (univ.town.monst[i].m_type != 2))
&& ((univ.town.monst[i].active == 1) || (univ.town.monst[i].target == 6)) &&
(width == 1) && (height == 1)) ////
draw_one_terrain_spot((short) where_draw.x,(short) where_draw.y,10000 + scenario.ter_types[ter].flag1.u);
else Draw_Some_Item(spec_scen_g, source_rect, terrain_screen_gworld, store_loc, 1, 0);
}
if (univ.town.monst[i].picture_num < 1000) {
source_rect = get_monster_template_rect(univ.town.monst[i].number,
pic_num_t this_monst = univ.town.monst[i].picture_num;
source_rect = get_monster_template_rect(this_monst,
((univ.town.monst[i].direction < 4) ? 0 : 1) + ((combat_posing_monster == i + 100) ? 10 : 0),k);
ter = univ.town->terrain(univ.town.monst[i].cur_loc.x,univ.town.monst[i].cur_loc.y);
// in bed?
@@ -326,7 +260,7 @@ void draw_monsters() ////
&& ((univ.town.monst[i].active == 1) || (univ.town.monst[i].target == 6)) &&
(width == 1) && (height == 1)) ////
draw_one_terrain_spot((short) where_draw.x,(short) where_draw.y,10000 + scenario.ter_types[ter].flag1.u);
else Draw_Some_Item(storage_gworld, source_rect, terrain_screen_gworld, store_loc, 1, 0);
else Draw_Some_Item(monst_gworld[m_pic_index[this_monst].i/20], source_rect, terrain_screen_gworld, store_loc, 1, 0);
}
}
}
@@ -349,10 +283,19 @@ void draw_monsters() ////
source_rect = get_custom_rect((univ.town.monst[i].picture_num % 1000) +
k + ((univ.town.monst[i].direction < 4) ? 0 : width * height)
+ ((combat_posing_monster == i + 100) ? (2 * width * height) : 0));
Draw_Some_Item(spec_scen_g, source_rect, terrain_screen_gworld, store_loc, 1, 0);
ter = univ.town->terrain(univ.town.monst[i].cur_loc.x,univ.town.monst[i].cur_loc.y);
if ((store_loc.x >= 0) && (store_loc.x < 9) && (store_loc.y >= 0) && (store_loc.y < 9) &&
(scenario.ter_types[ter].special == TER_SPEC_BED) &&
((univ.town.monst[i].m_type < 7)
&& (univ.town.monst[i].m_type != 1) && (univ.town.monst[i].m_type != 2))
&& ((univ.town.monst[i].active == 1) || (univ.town.monst[i].target == 6)) &&
(width == 1) && (height == 1))
draw_one_terrain_spot((short) where_draw.x,(short) where_draw.y,10000 + scenario.ter_types[ter].flag1.u); ////
else Draw_Some_Item(spec_scen_g, source_rect, terrain_screen_gworld, store_loc, 1, 0);
}
if (univ.town.monst[i].picture_num < 1000) {
source_rect = get_monster_template_rect(univ.town.monst[i].number,
pic_num_t this_monst = univ.town.monst[i].picture_num;
source_rect = get_monster_template_rect(this_monst,
((univ.town.monst[i].direction < 4) ? 0 : 1) + ((combat_posing_monster == i + 100) ? 10 : 0)
,k);
ter = univ.town->terrain(univ.town.monst[i].cur_loc.x,univ.town.monst[i].cur_loc.y);
@@ -363,7 +306,7 @@ void draw_monsters() ////
&& ((univ.town.monst[i].active == 1) || (univ.town.monst[i].target == 6)) &&
(width == 1) && (height == 1))
draw_one_terrain_spot((short) where_draw.x,(short) where_draw.y,10000 + scenario.ter_types[ter].flag1.u); ////
else Draw_Some_Item(storage_gworld, source_rect, terrain_screen_gworld, store_loc, 1, 0);
else Draw_Some_Item(monst_gworld[m_pic_index[this_monst].i/20], source_rect, terrain_screen_gworld, store_loc, 1, 0);
}
}
}
@@ -415,12 +358,14 @@ void draw_pcs(location center,short mode)
((cartoon_happening == true) || (party_can_see(pc_pos[i]) < 6))){
where_draw.x = pc_pos[i].x - center.x + 4;
where_draw.y = pc_pos[i].y - center.y + 4;
source_rect = get_party_template_rect(i,(pc_dir[i] < 4) ? 0 : 1);
source_rect = calc_rect(2 * (univ.party[i].which_graphic / 8), univ.party[i].which_graphic % 8);
if(pc_dir[i] >= 4)
OffsetRect(&source_rect,28,0);
if (combat_posing_monster == i)
OffsetRect(&source_rect,0,108);
OffsetRect(&source_rect,0,288);
if (mode == 0) {
Draw_Some_Item(party_template_gworld, source_rect, terrain_screen_gworld, where_draw, 1, 0);
Draw_Some_Item(pc_gworld, source_rect, terrain_screen_gworld, where_draw, 1, 0);
}
if ((current_pc == i) && (mode == 1) && (monsters_going == false)) {
@@ -440,12 +385,14 @@ void draw_pcs(location center,short mode)
if ( ((point_onscreen(center, pc_pos[current_pc])) == true) && (univ.party[current_pc].main_status == 1)) {
where_draw.x = pc_pos[current_pc].x - center.x + 4;
where_draw.y = pc_pos[current_pc].y - center.y + 4;
source_rect = get_party_template_rect(current_pc,(pc_dir[current_pc] < 4) ? 0 : 1);
if (combat_posing_monster == current_pc)
OffsetRect(&source_rect,0,108);
source_rect = calc_rect(2 * (univ.party[current_pc].which_graphic / 8), univ.party[current_pc].which_graphic % 8);
if(pc_dir[current_pc] >= 4)
OffsetRect(&source_rect,28,0);
if (combat_posing_monster == current_pc)
OffsetRect(&source_rect,0,288);
if (mode == 0)
Draw_Some_Item(party_template_gworld, source_rect, terrain_screen_gworld, where_draw, 1, 0);
Draw_Some_Item(pc_gworld, source_rect, terrain_screen_gworld, where_draw, 1, 0);
}
}
@@ -618,12 +565,14 @@ void draw_party_symbol(short mode,location center)
if ((univ.party.in_boat < 0) && (univ.party.in_horse < 0)) {
i = first_active_pc();
source_rect = get_party_template_rect(i,univ.party.direction > 3);
source_rect = calc_rect(2 * (univ.party[current_pc].which_graphic / 8), univ.party[i].which_graphic % 8);
if(pc_dir[current_pc] >= 4)
OffsetRect(&source_rect,28,0);
ter_num_t ter = univ.town->terrain(univ.town.p_loc.x,univ.town.p_loc.y);
// now wedge in bed graphic
if ((is_town()) && (scenario.ter_types[ter].special == TER_SPEC_BED))
draw_one_terrain_spot((short) target.x,(short) target.y,10000 + scenario.ter_types[ter].flag1.u);
else Draw_Some_Item(party_template_gworld, source_rect, terrain_screen_gworld, target, 1, 0);
else Draw_Some_Item(pc_gworld, source_rect, terrain_screen_gworld, target, 1, 0);
}
else if (univ.party.in_boat >= 0) {
//source_rect = boat_rects[dir_array[univ.party.direction]];
@@ -639,49 +588,6 @@ void draw_party_symbol(short mode,location center)
}
}
/* Input terrain currently trying to draw. Get back Rect in terrain template containing
desired pixmap, or Rect to darkness if desired map not present */
Rect get_terrain_template_rect (ter_num_t type_wanted) ////
{
short picture_wanted;
picture_wanted = terrain_pic[type_wanted];
if (picture_wanted >= 400)
return return_item_rect(picture_wanted + 700);
return return_item_rect(picture_wanted);
}
Rect return_item_rect(short wanted)////
{
Rect orig_rect = {0,0,36,28};
short i;
if (wanted < 50) {
OffsetRect(&orig_rect,28 * (wanted % 10),36 * (wanted / 10));
return orig_rect;
}
for (i = 50; i < STORED_GRAPHICS; i++)
if (which_g_stored[i] == wanted) {
OffsetRect(&orig_rect,28 * (i % 10),36 * (i / 10));
return orig_rect;
}
// oops it's not here. better try to add it.
add_one_graphic(wanted);
for (i = 50; i < STORED_GRAPHICS; i++)
if (which_g_stored[i] == wanted) {
OffsetRect(&orig_rect,28 * (i % 10),36 * (i / 10));
return orig_rect;
}
// oh well.
if (gave_no_g_error == false) {
give_error("Blades of Exile doesn't have enough memory to show all the graphics needed. Some things may look like cave floor. The game can still be played safely - restarting isn't necessary.","",0);
gave_no_g_error = true;
}
return orig_rect;
}
// Give the position of the monster graphic in the picture resource
// Will store monsters the same in Exile's II and III
Rect get_monster_rect (unsigned short type_wanted,short mode) ////
@@ -701,24 +607,22 @@ Rect get_monster_rect (unsigned short type_wanted,short mode) ////
}
// Give the position of the monster graphic in the template in memory
Rect get_monster_template_rect (unsigned short type_wanted,short mode,short which_part) ////
Rect get_monster_template_rect (pic_num_t picture_wanted,short mode,short which_part) ////
//mode; // 0 - left 1 - right +10 - combat mode
{
Rect store_rect = {0,0,36,28};
short picture_wanted;
short adj = 0;
short adj;
if (mode >= 10) {adj = 2000; mode -= 10;}
picture_wanted = get_monst_picnum(type_wanted);
if (picture_wanted >= 1000)
return store_rect;
picture_wanted = m_pic_index[picture_wanted].i + which_part;
return return_item_rect(300 + picture_wanted + (300 * mode) + adj);
if (mode >= 10) {
adj += 4;
mode -= 10;
}
if(mode == 0) adj++;
picture_wanted = (m_pic_index[picture_wanted].i + which_part) % 20;
//return return_item_rect(300 + picture_wanted + (300 * mode) + adj);
return calc_rect(2 * (picture_wanted / 10) + adj, picture_wanted % 10);
}
// Returns rect for drawing an item, if num < 25, rect is in big item template,
// otherwise in small item template
Rect get_item_template_rect (short type_wanted)////
@@ -792,75 +696,8 @@ bool is_ground(ter_num_t ter_type)
// if(scenario.ter_types[ter_type].trim_type == TRIM_WALKWAY)
// return false;
return true;
// short pic;
//
// pic = scenario.ter_types[ter_type].picture;
// if ((pic >= 0) && (pic <= 87))
// return true;
// if ((pic >= 121) && (pic <= 122))
// return true;
// if ((pic >= 179) && (pic <= 208))
// return true;
// if ((pic >= 211) && (pic <= 212))
// return true;
// if ((pic >= 215) && (pic <= 246))
// return true;
//
// return false;
}
//void make_town_trim(short mode)
////mode; // 0 - town 1 - outdoor combat
//{
// location where;
// eGameMode store_mode;
//
// store_mode = overall_mode;
// overall_mode = (mode == 0) ? MODE_TOWN : MODE_COMBAT;
// for (where.x = 0; where.x < univ.town->max_dim(); where.x++)
// for (where.y = 0; where.y < univ.town->max_dim(); where.y++)
// town_trim[where.x][where.y] = add_trim_to_array(where,
// (mode == 0) ? univ.town->terrain(where.x,where.y) : combat_terrain[where.x][where.y]);
// for (where.x = 0; where.x < univ.town->max_dim(); where.x++)
// for (where.y = 0; where.y < univ.town->max_dim(); where.y++) {
// if (town_trim[where.x][where.y] & 1)
// town_trim[where.x][where.y] &= 125;
// if (town_trim[where.x][where.y] & 4)
// town_trim[where.x][where.y] &= 245;
// if (town_trim[where.x][where.y] & 10)
// town_trim[where.x][where.y] &= 215;
// if (town_trim[where.x][where.y] & 64)
// town_trim[where.x][where.y] &= 95;
// }
// overall_mode = store_mode;
//}
//void make_out_trim()
//{
// location where;
// eGameMode store_mode;
//
// store_mode = overall_mode;
// overall_mode = MODE_OUTDOORS;
//
// for (where.x = 0; where.x < 96; where.x++)
// for (where.y = 0; where.y < 96; where.y++)
// out_trim[where.x][where.y] = add_trim_to_array(where,univ.out[where.x][where.y]);
// for (where.x = 0; where.x < 96; where.x++)
// for (where.y = 0; where.y < 96; where.y++) {
// if (out_trim[where.x][where.y] & 1)
// out_trim[where.x][where.y] &= 125;
// if (out_trim[where.x][where.y] & 4)
// out_trim[where.x][where.y] &= 245;
// if (out_trim[where.x][where.y] & 10)
// out_trim[where.x][where.y] &= 215;
// if (out_trim[where.x][where.y] & 64)
// out_trim[where.x][where.y] &= 95;
// }
// overall_mode = store_mode;
//
//}
char get_fluid_trim(location where,ter_num_t ter_type)
{
bool at_top = false,at_bot = false,at_left = false,at_right = false;