#endif
#ifdef QT_GRAPHICS
+# define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say wc_ascii_map */
# define USER_SOUNDS /* Use sounds */
# define USE_XPM /* Use XPM format for images (required) */
# define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
#define WINTYPELEN 16
+#ifdef DEFAULT_WC_TILED_MAP
+#define PREFER_TILED TRUE
+#else
+#define PREFER_TILED FALSE
+#endif
+
/*
* NOTE: If you add (or delete) an option, please update the short
* options help (option_help()), the long options help (dat/opthelp),
#else
{"altmeta", (boolean *)0, TRUE, DISP_IN_GAME},
#endif
- {"ascii_map", &iflags.wc_ascii_map, TRUE, SET_IN_GAME}, /*WC*/
+ {"ascii_map", &iflags.wc_ascii_map, !PREFER_TILED, SET_IN_GAME}, /*WC*/
#ifdef MFLOPPY
{"asksavedisk", &flags.asksavedisk, FALSE, SET_IN_GAME},
#else
{"sparkle", &flags.sparkle, TRUE, SET_IN_GAME},
{"standout", &flags.standout, FALSE, SET_IN_GAME},
{"splash_screen", &iflags.wc_splash_screen, TRUE, DISP_IN_GAME}, /*WC*/
- {"tiled_map", &iflags.wc_tiled_map, FALSE, DISP_IN_GAME}, /*WC*/
+ {"tiled_map", &iflags.wc_tiled_map, PREFER_TILED, DISP_IN_GAME}, /*WC*/
{"time", &flags.time, FALSE, SET_IN_GAME},
#ifdef TIMED_DELAY
{"timed_delay", &flags.nap, TRUE, SET_IN_GAME},
painter.begin(this);
+ if (
#ifdef REINCARNATION
- if (Is_rogue_level(&u.uz)) {
+ Is_rogue_level(&u.uz) ||
+#endif
+ iflags.wc_ascii_map
+ )
+ {
// You enter a VERY primitive world!
painter.setClipRect( event->rect() ); // (normally we don't clip)
if ( !rogue_font ) {
// Find font...
int pts = 5;
+ QString fontfamily = iflags.wc_font_map
+ ? iflags.wc_font_map : "Courier";
+ bool bold = FALSE;
+ if ( fontfamily.right(5).lower() == "-bold" ) {
+ fontfamily.truncate(fontfamily.length()-5);
+ bold = TRUE;
+ }
while ( pts < 32 ) {
- painter.setFont(QFont("Courier", pts));
+ QFont f(fontfamily, pts, bold ? QFont::Bold : QFont::Normal);
+ painter.setFont(QFont(fontfamily, pts));
QFontMetrics fm = painter.fontMetrics();
if ( fm.width("M") > qt_settings->glyphs().width() )
break;
break;
pts++;
}
- rogue_font = new QFont("Courier",pts-1);
+ rogue_font = new QFont(fontfamily,pts-1);
}
painter.setFont(*rogue_font);
}
painter.setFont(font());
- } else
-#endif
- {
+ } else {
for (int j=garea.top(); j<=garea.bottom(); j++) {
for (int i=garea.left(); i<=garea.right(); i++) {
unsigned short g=Glyph(i,j);
#endif
{
QPixmap pm("nhsplash.xpm");
- if ( !pm.isNull() ) {
+ if ( iflags.wc_splash_screen && !pm.isNull() ) {
QVBox *vb = new QVBox(0,0,
WStyle_Customize | WStyle_NoBorder | nh_WX11BypassWM | WStyle_StaysOnTop );
splash = vb;
struct window_procs Qt_procs = {
"Qt",
- WC_COLOR|WC_HILITE_PET,
+ WC_COLOR|WC_HILITE_PET|
+ WC_ASCII_MAP|WC_TILED_MAP|
+ WC_FONT_MAP|WC_TILE_FILE|WC_TILE_WIDTH|WC_TILE_HEIGHT|
+ WC_PLAYER_SELECTION|WC_SPLASH_SCREEN,
NetHackQtBind::qt_init_nhwindows,
NetHackQtBind::qt_player_selection,
NetHackQtBind::qt_askname,
if (windowprocs.name != NULL &&
!strcmpi(windowprocs.name, "Gem")) return TRUE;
#endif
+#ifdef QT_GRAPHICS
+ /* XXX has_color() should be added to windowprocs */
+ if (windowprocs.name != NULL &&
+ !strcmpi(windowprocs.name, "Qt")) return TRUE;
+#endif
#ifdef AMII_GRAPHICS
/* hilites[] not used */
return iflags.use_color;