Reformatting mouse-over messages to be consistent. More tile code cleanup and dead code removal.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3299 c06c8d41-db1a-0410-9941-cceddc491573
D5EMJEEIJSSULF236DUM26QHHNDLH7FXAOBHFDAYI65KCKTDTDYQC
ZVJPCEGKZ3MMRTTN563KQOSA7LFVFMMUDVARW2W5YQG6XZB6U7UAC
ND3T5LCZATC63EVQ6SLI7XXMSUL7XICJDNLH3UCYUDEFWTA3N5MQC
25CH7HH4LKXFIZ75YNMXS3TSXO6O27DYSOPLOD45K4OCNFWLS4LQC
MZLB3Q7G4EC2BR3OFMG55WPHXPFJGQSLWAIHHFJEAEATPUTYR7EAC
YMC3RKF4Z7DOHZNGG7INC343SXCTWOPK7ISD42I3WA3AZZNVBGIAC
WSENSWVHRNAW2NZO3HQLRV3HJKULA4JQHKM65M2NINZSD6NRQAMAC
// MAY_STAB, FLAG_STAB, and FLAG_PET are mutually exclusive
#define TILE_FLAG_MAY_STAB 0xC000 // May stab brand is always fg
#define TILE_FLAG_STAB 0x8000 // Stab brand is always fg
#define TILE_FLAG_PET 0x4000 //pet is always fg
enum tile_flags
{
// Foreground flags
TILE_FLAG_S_UNDER = 0x00000800,
TILE_FLAG_FLYING = 0x00001000,
TILE_FLAG_NET = 0x00002000,
TILE_FLAG_PET = 0x00004000,
TILE_FLAG_STAB = 0x00008000,
TILE_FLAG_MAY_STAB = 0x0000C000,
#define TILE_FLAG_NET 0x2000 //nets are always in fg
#define TILE_FLAG_FLYING 0x1000 //flying object is always fg
#define TILE_FLAG_S_UNDER 0x800 //fg
#define TILE_FLAG_CURSOR 0xc000 //cursor is always bg
#define TILE_FLAG_CURSOR1 0x8000 //cursor is always bg
#define TILE_FLAG_CURSOR2 0x4000 //cursor is always bg
#define TILE_FLAG_CURSOR3 0xc000 //cursor is always bg
#define TILE_FLAG_CURSOR0 0x0000 //cursor is always bg
#define TILE_FLAG_UNSEEN 0x2000 //unseen flag is set to bg
#define TILE_FLAG_MM_UNSEEN 0x1000
#define TILE_FLAG_RAY 0x800
// Background flags
TILE_FLAG_RAY = 0x00000800,
TILE_FLAG_MM_UNSEEN = 0x00001000,
TILE_FLAG_UNSEEN = 0x00002000,
TILE_FLAG_CURSOR0 = 0x00000000,
TILE_FLAG_CURSOR1 = 0x00008000,
TILE_FLAG_CURSOR2 = 0x00004000,
TILE_FLAG_CURSOR3 = 0x0000C000,
TILE_FLAG_CURSOR = 0x0000C000,
/*** Investigate a region of specific tile whether it contains any
picture, or it is blank ***/
int init_tileflag_aux(int tile, int xs, int ys, int wx, int wy){
int x,y, sx,sy;
img_type src=TileImg;
ASSERT(tile<TILE_TOTAL2);
sx = tile % TILE_PER_ROW;
sx *= TILE_X;
sy = tile / TILE_PER_ROW;
sy *= TILE_Y;
for(x=xs;x<xs+wx;x++){
for(y=ys;y<ys+wy;y++){
if(!ImgIsTransparentAt(src, sx+x, sy+y))
return 1;
}}
return 0;
}
void init_tileflag(){
int tile, flag;
for(tile=0;tile<TILE_TOTAL2;tile++){
flag = 0;
tile_flag[tile]=flag;
tile_prio[tile]=0;
}
for(tile=0;tile<4;tile++)
{
tile_prio[simple_iso_tile(TILE_DNGN_LAVA)+tile]=2;
tile_prio[simple_iso_tile(TILE_DNGN_SHALLOW_WATER)+tile]=2;
tile_prio[simple_iso_tile(TILE_DNGN_DEEP_WATER)+tile]=3;
}
}
if (fg == 0 || (fg & TILE_FLAG_FLYING)!=0) return 0;
/*
if ( bg0 == simple_iso_tile(TILE_DNGN_SHALLOW_WATER))
return TILE_MASK_SHALLOW_WATER;
if ( bg0 == simple_iso_tile(TILE_DNGN_DEEP_WATER))
return TILE_MASK_DEEP_WATER;
if ( bg0 >= simple_iso_tile(TILE_DNGN_LAVA) &&
bg0 <= simple_iso_tile(TILE_DNGN_LAVA)+3)
return TILE_MASK_LAVA;
*/
if ( bg0 >= simple_iso_tile(TILE_DNGN_LAVA) &&
bg0 <= simple_iso_tile(TILE_DNGN_SHALLOW_WATER) + 3)
if (fg == 0 || (fg & TILE_FLAG_FLYING) != 0)
return 0;
if ( bg0 >= TILE_DNGN_LAVA &&
bg0 <= TILE_DNGN_SHALLOW_WATER + 3)
#if 0
void libgui_load_prefs(struct pref_data *pref, int nprefs)
{
int i;
strcpy(font_name, my_getenv("CRAWL_X11_FONT",
"-alias-fixed-bold-r-normal--16-*"));
strcpy(font_name, my_getenv("CRAWL_X11_FONT", "9x15"));
*crt_x = my_getenv_int("CRAWL_X11_CRTX",80);
*crt_y = my_getenv_int("CRAWL_X11_CRTY",25);
*msg_x = my_getenv_int("CRAWL_X11_MSGX",80);
*msg_y = my_getenv_int("CRAWL_X11_MSGY",8);
*map_x = my_getenv_int("CRAWL_X11_MAPX",3);
*map_y = my_getenv_int("CRAWL_X11_MAPY",3);
*dngn_x = my_getenv_int("CRAWL_X11_DNGNX",17);
*dngn_y = my_getenv_int("CRAWL_X11_DNGNY",17);
}
void libgui_save_prefs()
{
}
#endif
strncpy(oldtip, newtip, 500);
const bool is_main_screen = (win_main->active_layer == 0);
const unsigned int height = is_main_screen ? region_tip->my : 1;
const unsigned int width = is_main_screen ? region_tip->mx : region_crt->mx;
strncpy(new_tip, tip, tip_size);
strncpy(old_tip, new_tip, tip_size);
char *state = strchr(newtip, '(');
if (state && state[-1] == ' ') state--;
if (state && (state - newtip <= region_tip->mx))
char *state = strchr(this_tip, '(');
if (state && state[-1] == ' ')
state--;
if (state && (state - this_tip <= (int)width))
region_tip->clear();
region_tip->gotoxy(1,1);
region_tip->addstr(newtip);
region_tip->make_active();
}
else
{
textattr( WHITE );
gotoxy(1, get_number_of_lines() + 1);
cprintf("%s", oldtip);
clear_to_end_of_line();
if (is_main_screen)
{
region_tip->gotoxy(1, 1 + i);
region_tip->addstr(this_tip);
region_tip->make_active();
}
else
{
ASSERT(i == 0);
textattr(WHITE);
gotoxy(1, get_number_of_lines() + 1);
cprintf("%s", this_tip);
clear_to_end_of_line();
}