X11 dynamic map mode selection
Prompted by a question from Pat a long time back, this change finally allows tiles or text map mode to be chosen dynamically at runtime (using the "tiled_map" option) rather than having to pick it via an X resource and keep your selection until you exit. This brings map mode selection up to a level similar to most other graphical window ports. In addition, the map mode automatically switches to text on the Rogue level, also like other graphical window ports. The default mode for the X11 binary is now tiles, once again, like most (all?) other graphical window ports. The patch also removes some dead X11 code that is unlikely to be useful again.
This commit is contained in:
@@ -83,7 +83,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef QT_GRAPHICS
|
||||
# define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say wc_ascii_map */
|
||||
# ifndef DEFAULT_WC_TILED_MAP
|
||||
# define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say wc_ascii_map */
|
||||
# endif
|
||||
# define USER_SOUNDS /* Use sounds */
|
||||
/* # define USER_SOUNDS_REGEX */ /* Use regexps for sound message matches */
|
||||
# define USE_XPM /* Use XPM format for images (required) */
|
||||
@@ -128,6 +130,9 @@
|
||||
# ifdef USE_XPM
|
||||
# define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */
|
||||
# endif
|
||||
# ifndef DEFAULT_WC_TILED_MAP
|
||||
# define DEFAULT_WC_TILED_MAP /* Default to tiles */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,11 @@ struct text_map_info_t {
|
||||
GC copy_gc, /* Drawing GC */
|
||||
inv_copy_gc; /* Inverse drawing GC */
|
||||
#endif
|
||||
|
||||
int square_width, /* Saved font information so */
|
||||
square_height, /* we can calculate the correct */
|
||||
square_ascent, /* placement of changes. */
|
||||
square_lbearing;
|
||||
};
|
||||
|
||||
struct tile_map_info_t {
|
||||
@@ -58,6 +63,11 @@ struct tile_map_info_t {
|
||||
GC black_gc;
|
||||
unsigned long image_width; /* dimensions of tile image */
|
||||
unsigned long image_height;
|
||||
|
||||
int square_width, /* Saved tile information so */
|
||||
square_height, /* we can calculate the correct */
|
||||
square_ascent, /* placement of changes. */
|
||||
square_lbearing;
|
||||
};
|
||||
|
||||
struct map_info_t {
|
||||
@@ -65,15 +75,10 @@ struct map_info_t {
|
||||
viewport_height; /* clip to cursor on a resize. */
|
||||
unsigned char t_start[ROWNO], /* Starting column for new info. */
|
||||
t_stop[ROWNO]; /* Ending column for new info. */
|
||||
int square_width, /* Saved font/tile information so */
|
||||
square_height, /* we can calculate the correct */
|
||||
square_ascent, /* placement of changes. */
|
||||
square_lbearing;
|
||||
boolean is_tile;
|
||||
union {
|
||||
struct text_map_info_t *text_map;
|
||||
struct tile_map_info_t *tile_map;
|
||||
} mtype;
|
||||
|
||||
boolean is_tile; /* true if currently using tiles */
|
||||
struct text_map_info_t text_map;
|
||||
struct tile_map_info_t tile_map;
|
||||
};
|
||||
|
||||
|
||||
@@ -408,4 +413,6 @@ E void FDECL(X11_outrip, (winid,int));
|
||||
E void FDECL(genl_outrip, (winid,int));
|
||||
#endif
|
||||
|
||||
E void FDECL(X11_preference_update, (const char *));
|
||||
|
||||
#endif /* WINX_H */
|
||||
|
||||
Reference in New Issue
Block a user