Fix: SE017 Problem: The current implementation of the Qt interface for Slash'EM has become somewhat awkward to use as witnessed by the need for Ralf Engels' detailed instructions included with version 0.0.5E6. After an aborted attempt to simplify the process (with hindsight I think because I was trying to use Qt 1.44 and I should have been using 1.33), I decided to redo the port from scratch using Warwick's 1.0.1 interface which I knew worked on RedHat 6.1 with Qt 1.44. There are some advantages of this approach: many redundant files have been removed, and some disadvantages: all Dirk's changes have been lost, including support for KDE. The new Qt interface itself is supplied as a tarball. This includes all the files from Warwick Allison's Qt NetHack whith appropriate modifications for Slash'EM (eg., name change, new commands, new key bindings, secondary weapon). The one missing modification is support for the showeight option which can be added later. To install this fix you need both this file and the accompanying tarball (SE017.tar.gz). The following commands will apply the fix: % cd slashem-0.0.5E6 % rm -rf slashem-0.0.5E6/win/Qt % lynx --source http://avrc.city.ac.uk/nethack/fixes/SE017.tar.gz | \ gzip -dc | tar xf - % lynx --source http://avrc.city.ac.uk/nethack/fixes/SE017 | \ patch -p0 -E Compatible with: Slash'EM 0.0.5E6 Author: J. Ali Harlow, ali@avrc.city.ac.uk Date: 31 Oct 1999 *** include/cluster.h.orig Sat Oct 30 21:13:33 1999 --- include/cluster.h Thu Jan 1 01:00:00 1970 *************** *** 1,25 **** - #ifndef clusterizer_H - #define clusterizer_H - - #include - - class Clusterizer { - public: - Clusterizer(int maxclusters); - ~Clusterizer(); - - void add(int x, int y); // 1x1 rectangle (point) - void add(int x, int y, int w, int h); - void add(const QRect& rect); - - void clear(); - int clusters() { return count; } - const QRect& operator[](int i); - - private: - QRect* cluster; - int count; - const int max; - }; - - #endif --- 0 ---- *** include/config.h.orig Sat Oct 30 21:13:33 1999 --- include/config.h Sat Oct 30 21:35:47 1999 *************** *** 225,231 **** * Define the default window system. This should be one that is compiled * into your system (see defines above). Known window systems are: * ! * tty, X11, mac, amii, win32 */ /* MAC also means MAC windows */ --- 225,231 ---- * Define the default window system. This should be one that is compiled * into your system (see defines above). Known window systems are: * ! * tty, X11, mac, amii, win32, Qt */ /* MAC also means MAC windows */ *** include/diff.orig Sat Oct 30 21:13:33 1999 --- include/diff Thu Jan 1 01:00:00 1970 *************** *** 1,97 **** - *** prop.h Tue Sep 29 20:24:34 1998 - --- \net\nethack\code\proph~1.txt Sun Nov 8 23:25:46 1998 - *************** - *** 69,84 **** - #define ACID_RES 59 - #define STONE_RES 60 - #define UNCHANGING 61 - - ! #define LAST_PROP (UNCHANGING) /* the last property */ - - - - #if 1 - /*** Where the properties come from ***/ - /* Definitions were moved here from obj.h and you.h */ - struct prop { - /*** Properties conveyed by objects ***/ - ! /*unsigned*/ long extrinsic; - /* Armor */ - # define W_ARM 0x00001000L /* Body armor */ - # define W_ARMC 0x00002000L /* Cloak */ - --- 69,85 ---- - #define ACID_RES 59 - #define STONE_RES 60 - #define UNCHANGING 61 - + #define PASSES_WALLS 62 - + #define INDIGESTION 63 - - ! #define LAST_PROP (INDIGESTION) /* the last property */ - - - /*** Where the properties come from ***/ - /* Definitions were moved here from obj.h and you.h */ - struct prop { - /*** Properties conveyed by objects ***/ - ! long extrinsic; - /* Armor */ - # define W_ARM 0x00001000L /* Body armor */ - # define W_ARMC 0x00002000L /* Cloak */ - *************** - *** 110,117 **** - # define W_BALL 0x00000400L /* Punishment ball */ - # define W_CHAIN 0x00000800L /* Punishment chain */ - - /*** Permanent properties, timeouts, and other flags ***/ - ! /*unsigned*/ long intrinsic; - /* Timed properties */ - # define TIMEOUT 0x00000fffL /* Up to 4095 */ - /* Permanent properties */ - --- 111,122 ---- - # define W_BALL 0x00000400L /* Punishment ball */ - # define W_CHAIN 0x00000800L /* Punishment chain */ - - + /*** Property is blocked by an object ***/ - + long blocked; /* Same assignments as extrinsic */ - + /*# define I_BLOCKED 0x80000000L /* Property is blocked */ - + - /*** Permanent properties, timeouts, and other flags ***/ - ! long intrinsic; - /* Timed properties */ - # define TIMEOUT 0x00000fffL /* Up to 4095 */ - /* Permanent properties */ - *************** - *** 120,131 **** - # define INTRINSIC (FROMOUTSIDE|FROMEXPER) - /* Control flags */ - # define I_SPECIAL 0x40000000L /* Property is controllable */ - - # define I_BLOCKED 0x80000000L /* Property is blocked */ - }; - - - /*** Definitions for backwards compatibility ***/ - ! #define p_flgs intrinsic - #define LEFT_RING W_RINGL - #define RIGHT_RING W_RINGR - #define LEFT_SIDE LEFT_RING - --- 125,135 ---- - # define INTRINSIC (FROMOUTSIDE|FROMEXPER) - /* Control flags */ - # define I_SPECIAL 0x40000000L /* Property is controllable */ - }; - - - /*** Definitions for backwards compatibility ***/ - ! /*#define p_flgs intrinsic*/ - #define LEFT_RING W_RINGL - #define RIGHT_RING W_RINGR - #define LEFT_SIDE LEFT_RING - *************** - *** 141,147 **** - #define WORN_BLINDF W_TOOL - #ifdef TOURIST - #define WORN_SHIRT W_ARMU - - #endif - #endif - - - --- 145,150 ---- --- 0 ---- *** include/qt_win.h.orig Sat Oct 30 21:13:33 1999 --- include/qt_win.h Thu Jan 1 01:00:00 1970 *************** *** 1,742 **** - // Qt Binding for NetHack 3.2 - // - // Copyright (C) 1996 by Warwick W. Allison (warwick@cs.uq.edu.au) - // - // Unfortunately, this doesn't use Qt as well as I would like, - // primarily because NetHack is fundamentally a getkey-type - // program rather than being event driven (hence the ugly key - // and click buffer rather), but also because this is my first - // major application of Qt. - // - - #ifndef qt_win_h - #define qt_win_h - - - #include - #include - #include - #include - #include - - #ifdef KDE - #include - #include - #else - #include - #endif - - #include - #include - #include - #include - #include - #include - - #include "qviewp.h" - #include "cluster.h" - - ////////////////////////////////////////////////////////////// - // - // The beautiful, abstracted and well-modelled classes... - // - ////////////////////////////////////////////////////////////// - - class NetHackQtGlyphs; - - class NetHackQtLineEdit : public QLineEdit { - public: - NetHackQtLineEdit(); - NetHackQtLineEdit(QWidget* parent, const char* name); - - void fakeEvent(int key, int ascii, int state); - }; - - class NetHackQtSettings : public QDialog { - Q_OBJECT - public: - // Size of window - used to decide default sizes - NetHackQtSettings(int width, int height); - - const char* petMarkDataFile() const; - const char* petMarkMaskFile() const; - - const NetHackQtGlyphs& glyphs(); - const QFont& normalFont(); - const QFont& normalFixedFont(); - const QFont& largeFont(); - - bool ynInMessages(); - - signals: - void fontChanged(); - void tilesChanged(); - - private: - NetHackQtLineEdit petDataFile; - NetHackQtLineEdit petMaskFile; - QComboBox tilesize; - QComboBox fontsize; - QFont normal, normalfixed, large; - - NetHackQtGlyphs* theglyphs; - - private slots: - void loadTiles(); - }; - - class NetHackQtKeyBuffer { - public: - NetHackQtKeyBuffer(); - - bool Empty() const; - bool Full() const; - - void Put(int k, int ascii, int state); - void Put(const char* str); - int GetKey(); - int GetAscii(); - int GetState(); - - int TopKey() const; - int TopAscii() const; - int TopState() const; - - private: - static const int maxkey=64; - int key[maxkey]; - int ascii[maxkey]; - int state[maxkey]; - int in,out; - }; - - class NetHackQtClickBuffer { - public: - NetHackQtClickBuffer(); - - bool Empty() const; - bool Full() const; - - void Put(int x, int y, int mod); - - int NextX() const; - int NextY() const; - int NextMod() const; - - void Get(); - - private: - static const int maxclick=64; - struct { - int x,y,mod; - } click[maxclick]; - int in,out; - }; - - - - class NetHackQtPlayerSelector : private QDialog { - Q_OBJECT - public: - enum { R_None=-1, R_Quit=-2, R_Rand=-3 }; - - NetHackQtPlayerSelector(NetHackQtKeyBuffer&, Role roles[]); - - protected: - void resizeEvent(QResizeEvent*); - virtual void done(int); - - public slots: - void Quit(); - void Random(); - - public: - bool ChooseRole(int& role); - - private: - NetHackQtKeyBuffer& keysource; - int role_count; - QButtonGroup* group; - QPushButton* qbutton; - QPushButton* rbutton; - QPushButton* *rolebutton; - }; - - class NetHackQtStringRequestor : QDialog { - private: - QLabel prompt; - NetHackQtLineEdit input; - QPushButton* okay; - QPushButton* cancel; - NetHackQtKeyBuffer& keysource; - - virtual void done(int); - - public: - NetHackQtStringRequestor(NetHackQtKeyBuffer&, const char* p,const char* cancelstr="Cancel"); - void SetDefault(const char*); - bool Get(char* buffer, int maxchar=80); - virtual void resizeEvent(QResizeEvent*); - }; - - - class NetHackQtWindow { - public: - NetHackQtWindow(); - virtual ~NetHackQtWindow(); - - virtual QWidget* Widget() =0; - - virtual void Clear(); - virtual void Display(bool block); - virtual bool Destroy(); - virtual void CursorTo(int x,int y); - virtual void PutStr(int attr, const char* text); - virtual void StartMenu(); - virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr, - const char* str, bool presel); - virtual void EndMenu(const char* prompt); - virtual int SelectMenu(int how, MENU_ITEM_P **menu_list); - virtual void ClipAround(int x,int y); - virtual void PrintGlyph(int x,int y,int glyph); - virtual void UseRIP(int how); - }; - - class NetHackQtGlyphs : public QPixmap { - public: - NetHackQtGlyphs(const char* tile_file); - - int width() const { return size.width(); } - int height() const { return size.height(); } - - int yFor(int glyph) const; - int xFor(int glyph) const; - private: - QSize size; - }; - - class NetHackQtMapWindow : public QWidget, public NetHackQtWindow { - Q_OBJECT - private: - NetHackQtClickBuffer& clicksink; - unsigned short glyph[ROWNO][COLNO]; - unsigned short& Glyph(int x, int y) { return glyph[y][x]; } - QPoint cursor; - QViewPort viewport; - QPixmap pet_annotation; - Clusterizer change; - - void Changed(int x,int y); - - signals: - void resized(); - - private slots: - void updateTiles(); - - protected: - virtual void paintEvent(QPaintEvent*); - virtual void mousePressEvent(QMouseEvent*); - - public: - NetHackQtMapWindow(NetHackQtClickBuffer& click_sink); - ~NetHackQtMapWindow(); - - virtual QWidget* Widget(); - virtual bool Destroy(); - - virtual void Clear(); - virtual void Display(bool block); - virtual void CursorTo(int x,int y); - virtual void PutStr(int attr, const char* text); - virtual void ClipAround(int x,int y); - virtual void PrintGlyph(int x,int y,int glyph); - - void Scroll(int dx, int dy); - }; - - class NetHackQtListBox; - class NetHackQtMessageWindow : QObject, public NetHackQtWindow { - Q_OBJECT - public: - NetHackQtMessageWindow(); - ~NetHackQtMessageWindow(); - - virtual QWidget* Widget(); - virtual void Clear(); - virtual void Display(bool block); - virtual void PutStr(int attr, const char* text); - - void Scroll(int dx, int dy); - - private: - NetHackQtListBox* list; - bool changed; - - private slots: - void updateFont(); - }; - - class NetHackQtLabelledIcon : public QWidget { - public: - NetHackQtLabelledIcon(QWidget* parent, const char* label); - NetHackQtLabelledIcon(QWidget* parent, const char* label, const QPixmap& icon); - - static const int NoNum=-99999; - void setLabel(const char*, bool lower=true); // a string - void setLabel(const char*, long, const char* tail=""); // a number - void setLabel(const char*, long show_value, long comparative_value, const char* tail=""); - void setIcon(const QPixmap&); - virtual void setFont(const QFont&); - - void highlightWhenChanging(); - void lowIsGood(); - void dissipateHighlight(); - - virtual void show(); - - protected: - void resizeEvent(QResizeEvent*); - - private: - void initHighlight(); - void setAlignments(); - void highlight(const QPalette& highlight); - void unhighlight(); - - bool low_is_good; - int prev_value; - int turn_count; /* last time the value changed */ - QPalette hl_good; - QPalette hl_bad; - - QLabel* label; - QLabel* icon; - }; - - class NetHackQtStatusWindow : QWidget, public NetHackQtWindow { - Q_OBJECT - public: - NetHackQtStatusWindow(); - - virtual QWidget* Widget(); - - virtual void Clear(); - virtual void Display(bool block); - virtual void CursorTo(int x,int y); - virtual void PutStr(int attr, const char* text); - - void fadeHighlighting(); - - protected: - void resizeEvent(QResizeEvent*); - - private slots: - void doUpdate(); - - private: - static const int hilight_time = 1; /* number of turns to hilight a changed value */ - - QPixmap p_str; - QPixmap p_dex; - QPixmap p_con; - QPixmap p_int; - QPixmap p_wis; - QPixmap p_cha; - - QPixmap p_chaotic; - QPixmap p_neutral; - QPixmap p_lawful; - - QPixmap p_satiated; - QPixmap p_hungry; - - QPixmap p_confused; - QPixmap p_sick_fp; - QPixmap p_sick_il; - QPixmap p_blind; - QPixmap p_stunned; - QPixmap p_hallu; - - QPixmap p_encumber[5]; - - NetHackQtLabelledIcon name; - NetHackQtLabelledIcon dlevel; - - NetHackQtLabelledIcon str; - NetHackQtLabelledIcon dex; - NetHackQtLabelledIcon con; - NetHackQtLabelledIcon intel; - NetHackQtLabelledIcon wis; - NetHackQtLabelledIcon cha; - - NetHackQtLabelledIcon gold; - NetHackQtLabelledIcon hp; - NetHackQtLabelledIcon power; - NetHackQtLabelledIcon ac; - NetHackQtLabelledIcon level; - NetHackQtLabelledIcon exp; - NetHackQtLabelledIcon align; - - NetHackQtLabelledIcon time; - NetHackQtLabelledIcon score; - - NetHackQtLabelledIcon hunger; - NetHackQtLabelledIcon confused; - NetHackQtLabelledIcon sick_fp; - NetHackQtLabelledIcon sick_il; - NetHackQtLabelledIcon blind; - NetHackQtLabelledIcon stunned; - NetHackQtLabelledIcon hallu; - NetHackQtLabelledIcon encumber; - - QFrame hline1; - QFrame hline2; - QFrame hline3; - - int cursy; - - bool first_set; - - void nullOut(); - void updateStats(); - void checkTurnEvents(); - }; - - class NetHackQtMenuDialog : public QDialog { - Q_OBJECT - public: - NetHackQtMenuDialog(); - - void Accept(); - void Reject(); - void SetResult(int); - - virtual void done(int); - - protected: - void resizeEvent(QResizeEvent*); - - signals: - void Resized(); - }; - - - class NetHackQtMenuWindow : QTableView, public NetHackQtWindow { - Q_OBJECT - public: - NetHackQtMenuWindow(NetHackQtKeyBuffer&); - ~NetHackQtMenuWindow(); - - virtual QWidget* Widget(); - - virtual void StartMenu(); - virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr, - const char* str, bool presel); - virtual void EndMenu(const char* prompt); - virtual int SelectMenu(int how, MENU_ITEM_P **menu_list); - - public slots: - void All(); - void None_(); - void Invert(); - void Search(); - - void Layout(); - void ToggleSelect(int); - - protected: - virtual void keyPressEvent(QKeyEvent*); - //virtual void mouseDoubleClickEvent(QMouseEvent*); - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void focusOutEvent(QFocusEvent*); - virtual void focusInEvent(QFocusEvent*); - - virtual void paintCell(QPainter*, int, int); - virtual int cellWidth(int col); - - private: - struct MenuItem { - MenuItem(); - ~MenuItem(); - - int glyph; - ANY_P identifier; - int attr; - const char* str; - int count; - char ch; - bool selected; - - bool Selectable() const { return identifier.a_void!=0; } - }; - - QArray item; - - int itemcount; - int str_width; - bool str_fixed; - int next_accel; - - NetHackQtKeyBuffer& keysource; - - NetHackQtMenuDialog* dialog; - - QPushButton* ok; - QPushButton* cancel; - QPushButton* all; - QPushButton* none; - QPushButton* invert; - QPushButton* search; - QLabel prompt; - - int how; - - bool has_glyphs; - - int pressed; - bool was_sel; - }; - - class NetHackQtTextListBox; - - class NetHackQtRIP : public QWidget { - private: - static QPixmap* pixmap; - char** line; - int riplines; - - public: - NetHackQtRIP(QWidget* parent); - - void setLines(char** l, int n); - - protected: - virtual void paintEvent(QPaintEvent* event); - }; - - - class NetHackQtTextWindow : public QDialog, public NetHackQtWindow { - Q_OBJECT - public: - NetHackQtTextWindow(NetHackQtKeyBuffer&); - ~NetHackQtTextWindow(); - - virtual QWidget* Widget(); - - virtual void Clear(); - virtual bool Destroy(); - virtual void Display(bool block); - virtual void PutStr(int attr, const char* text); - virtual void UseRIP(int how); - - public slots: - void Search(); - - protected: - virtual void done(int); - virtual void resizeEvent(QResizeEvent*); - - private slots: - void doUpdate(); - - private: - NetHackQtKeyBuffer& keysource; - - NetHackQtRIP rip; - bool use_rip; - bool str_fixed; - - QPushButton ok; - QPushButton search; - NetHackQtTextListBox* lines; - }; - - class NetHackQtMenuOrTextWindow : public NetHackQtWindow { - private: - NetHackQtWindow* actual; - NetHackQtKeyBuffer& keysource; - - public: - NetHackQtMenuOrTextWindow(NetHackQtKeyBuffer&); - - virtual QWidget* Widget(); - - // Text - virtual void Clear(); - virtual bool Destroy(); - virtual void Display(bool block); - virtual void PutStr(int attr, const char* text); - - // Menu - virtual void StartMenu(); - virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr, - const char* str, bool presel); - virtual void EndMenu(const char* prompt); - virtual int SelectMenu(int how, MENU_ITEM_P **menu_list); - - }; - - class NetHackQtDelay : QObject { - private: - int msec; - - public: - NetHackQtDelay(int ms); - void wait(); - virtual void timerEvent(QTimerEvent* timer); - }; - - - class NetHackQtInvUsageWindow : public QWidget { - public: - NetHackQtInvUsageWindow(QWidget* parent); - virtual void paintEvent(QPaintEvent*); - private: - void drawWorn(QPainter& painter, obj*, int x, int y, bool canbe=true); - }; - - // This class is the main widget for NetHack - // - // It is a collection of Message, Map, and Status windows. In the current - // version of nethack there is only one of each, and this class makes this - // assumption, not showing itself until all are inserted. - // - // This class simply knows how to layout such children sensibly. - // - // Since it is only responsible for layout, the class does not - // note the actual class of the windows. - // - - #ifndef KDE - #include "qtdummy.h" - #endif - - class NetHackQtMainWindow : public KTopLevelWidget { - Q_OBJECT - public: - NetHackQtMainWindow(NetHackQtKeyBuffer&); - - void AddMessageWindow(NetHackQtMessageWindow* window); - void AddMapWindow(NetHackQtMapWindow* window); - void AddStatusWindow(NetHackQtStatusWindow* window); - void RemoveWindow(NetHackQtWindow* window); - void updateInventory(); - - void fadeHighlighting(); - - public slots: - void doMenuItem(int); - - protected: - virtual void resizeEvent(QResizeEvent*); - virtual void keyPressEvent(QKeyEvent*); - - private slots: - void layout(); - - private: - void ShowIfReady(); - - #ifdef KDE - KMenuBar *menubar; - #else - class QMenuBar* menubar; - #endif - - NetHackQtMessageWindow* message; - NetHackQtMapWindow* map; - NetHackQtStatusWindow* status; - NetHackQtInvUsageWindow invusage; - - NetHackQtKeyBuffer& keysink; - - const char* *macro; - }; - - class NetHackQtYnDialog : QDialog { - private: - const char* question; - const char* choices; - char def; - NetHackQtKeyBuffer& keysource; - - protected: - virtual void keyPressEvent(QKeyEvent*); - virtual void done(int); - - public: - NetHackQtYnDialog(NetHackQtKeyBuffer& keysource,const char*,const char*,char); - - char Exec(); - }; - - #ifdef KDE - #define PARENT KApplication - #else - #define PARENT QApplication - #endif - class NetHackQtBind : PARENT { - private: - // Single-instance preservation... - NetHackQtBind(int& argc, char** argv); - - static NetHackQtBind* instance; - - static NetHackQtKeyBuffer keybuffer; - static NetHackQtClickBuffer clickbuffer; - - static NetHackQtMainWindow* main; - - public: - static void qt_init_nhwindows(int* argc, char** argv); - static void qt_player_selection(); - static void qt_askname(); - static void qt_get_nh_event(); - static void qt_exit_nhwindows(const char *); - static void qt_suspend_nhwindows(const char *); - static void qt_resume_nhwindows(); - static winid qt_create_nhwindow(int type); - static void qt_clear_nhwindow(winid wid); - static void qt_display_nhwindow(winid wid, BOOLEAN_P block); - static void qt_destroy_nhwindow(winid wid); - static void qt_curs(winid wid, int x, int y); - static void qt_putstr(winid wid, int attr, const char *text); - static void qt_display_file(const char *filename, BOOLEAN_P must_exist); - static void qt_start_menu(winid wid); - static void qt_add_menu(winid wid, int glyph, - const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr, - const char *str, BOOLEAN_P presel); - static void qt_end_menu(winid wid, const char *prompt); - static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list); - static void qt_update_inventory(); - static void qt_mark_synch(); - static void qt_wait_synch(); - - static void qt_cliparound(int x, int y); - static void qt_cliparound(winid wid, int x, int y); - static void qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph); - static void qt_raw_print(const char *str); - static void qt_raw_print_bold(const char *str); - static int qt_nhgetch(); - static int qt_nh_poskey(int *x, int *y, int *mod); - static void qt_nhbell(); - static int qt_doprev_message(); - static char qt_yn_function(const char *question, const char *choices, CHAR_P def); - static void qt_getlin(const char *prompt, char *line); - static int qt_get_ext_cmd(); - static void qt_number_pad(int); - static void qt_delay_output(); - static void qt_start_screen(); - static void qt_end_screen(); - - static void qt_outrip(winid wid, int how); - - - private: - virtual bool notify(QObject *receiver, QEvent *event); - }; - - #endif --- 0 ---- *** include/qtdummy.h.orig Sat Oct 30 21:13:33 1999 --- include/qtdummy.h Thu Jan 1 01:00:00 1970 *************** *** 1,3 **** - class KTopLevelWidget : public QWidget { - Q_OBJECT - }; --- 0 ---- *** include/qviewp.h.orig Sat Oct 30 21:13:33 1999 --- include/qviewp.h Thu Jan 1 01:00:00 1970 *************** *** 1,82 **** - // QViewPort widget for Qt C++ class library. - // - // Author: Warwick Allison (warwick@cs.uq.oz.au) - // Date: May 24, 1995 - // - // Copyright (C) 1995 by Warwick Allison. - // - - #ifndef QVIEWP_H - #define QVIEWP_H - - #include - #include - - class QViewPort : public QWidget - { - Q_OBJECT - public: - QViewPort(QWidget *parent=0, const char *name=0, WFlags f=0 ); - - // One QWidget can be the child of the porthole. - QWidget* portHole(); - - // The component scrollbars are made available to allow - // accelerators, autoscrolling, etc., and to allow changing - // of arrow scrollrates: bar->setSteps(rate, bar->pageStep()). - // They should not be otherwise manipulated. - QScrollBar& horizontalScrollBar(); - QScrollBar& verticalScrollBar(); - - // Overrides (for implementation purposes) - virtual void resize(int w, int h); - virtual void show(); - - void ensureVisible(int x, int y, int xmargin=50, int ymargin=50); - void centerOn(int x, int y); - void centralize(int x, int y, float xmargin=0.5, float ymargin=0.5); - - // Visual properties. - - // Default 16 - virtual int scrollBarWidth() const; - - // Default false. - virtual bool scrollBarOnLeft() const; - - // Default false. - virtual bool scrollBarOnTop() const; - - // Corner between scrollbars to be empty when both are visible. - // Default true. - virtual bool emptyCorner() const; - - // Corner between scrollbars to always be empty. - // Default false. - virtual bool alwaysEmptyCorner() const; - - // Call this if above properties change dynamically. - void resizeScrollBars(); - - protected: - virtual void resizeEvent(QResizeEvent*); - - // The child of the porthole. - QWidget* viewedWidget() const; - - private: - QScrollBar hbar; - QScrollBar vbar; - QWidget porthole; - static bool signal_choke; - - private slots: - void hslide(int); - void vslide(int); - }; - - inline QWidget* QViewPort::portHole() { return &porthole; } - inline QScrollBar& QViewPort::horizontalScrollBar() { return hbar; } - inline QScrollBar& QViewPort::verticalScrollBar() { return vbar; } - - #endif --- 0 ---- *** include/system.h.orig Sat Oct 30 21:13:33 1999 --- include/system.h Sat Oct 30 21:36:41 1999 *************** *** 160,166 **** # ifndef bsdi E long FDECL(lseek, (int,long,int)); # endif ! # if defined(POSIX_TYPES) || defined(__TURBOC__) # ifndef bsdi E int FDECL(write, (int, const void *,unsigned)); # endif --- 160,166 ---- # ifndef bsdi E long FDECL(lseek, (int,long,int)); # endif ! # if defined(POSIX_TYPES) || defined(__TURBOC__) || defined(_MSC_VER) # ifndef bsdi E int FDECL(write, (int, const void *,unsigned)); # endif *************** *** 204,210 **** E int FDECL(setmode, (int,int)); E int NDECL(kbhit); # if !defined(_DCC) ! # if defined(__TURBOC__) E int FDECL(chdir, (const char *)); # else E int FDECL(chdir, (char *)); --- 204,210 ---- E int FDECL(setmode, (int,int)); E int NDECL(kbhit); # if !defined(_DCC) ! # if defined(__TURBOC__) || defined(_MSC_VER) E int FDECL(chdir, (const char *)); # else E int FDECL(chdir, (char *)); *** src/files.c.orig Sat Oct 30 21:13:33 1999 --- src/files.c Sat Oct 30 21:40:25 1999 *************** *** 1277,1282 **** --- 1277,1307 ---- } amii_setpens( amii_numcolors = i ); #endif + #ifdef USER_SOUNDS + } else if (!strncmpi(buf, "SOUNDDIR", 8)) { + extern char* sounddir; + sounddir=(char *)strdup(bufp); + } else if (!strncmpi(buf, "SOUND", 5)) { + if (!add_sound_mapping(bufp)) + return 0; + #endif + + /* Set initial tile/font sizes for QT port */ + #ifdef QT_GRAPHICS + } else if (!strncmpi(buf, "QT_TILEWIDTH", 11)) { + extern char *qt_tilewidth; + if (qt_tilewidth == NULL) + qt_tilewidth=(char *)strdup(bufp); + } else if (!strncmpi(buf, "QT_TILEHEIGHT", 11)) { + extern char *qt_tileheight; + if (qt_tileheight == NULL) + qt_tileheight=(char *)strdup(bufp); + } else if (!strncmpi(buf, "QT_FONTSIZE", 11)) { + extern char *qt_fontsize; + if (qt_fontsize == NULL) + qt_fontsize=(char *)strdup(bufp); + #endif + } else return 0; return 1; *** sys/unix/Makefile.dat.orig Sat Oct 30 21:13:34 1999 --- sys/unix/Makefile.dat Sat Oct 30 21:14:28 1999 *************** *** 22,130 **** ../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \ ../win/share/other.txt ! qt_tiles_1.ppm: ../util/txt2ppm ../win/share/monsters.txt ../win/share/objects.txt \ ../win/share/other.txt ! ../util/txt2ppm -w 32 qt_tiles_1.ppm ../win/share/monsters.txt ../win/share/objects.txt \ ../win/share/other.txt - qt_tiles_1.bmp: qt_tiles_1.ppm - ppmtobmp qt_tiles_1.ppm >qt_tiles_1.bmp - - qt_tiles_0.bmp: qt_tiles_1.ppm - pnmscale -xscale 0.75 -yscale 0.875 qt_tiles_1.ppm | \ - pnmdepth 255 | \ - ppmquant 90 | ppmtobmp > qt_tiles_0.bmp - - qt_tiles_2.bmp: qt_tiles_1.ppm - pnmscale -xscale 1 -yscale 1.625 qt_tiles_1.ppm | \ - pnmdepth 255 | \ - ppmquant 90 | ppmtobmp > qt_tiles_2.bmp - - qt_tiles_3.bmp: qt_tiles_1.ppm - pnmscale -xscale 2 -yscale 2 qt_tiles_1.ppm | \ - pnmdepth 255 | \ - ppmquant 90 | ppmtobmp > qt_tiles_3.bmp - - # qt_tiles_3.ppm: qt_tiles_1.ppm - # pnmscale -xscale 2 -yscale 2 qt_tiles_1.ppm | pnmsmooth | \ - # pnmdepth 255 | \ - # ppmquant 90 > qt_tiles_3.ppm - - - pet_mark.xpm: ../win/Qt/pet_mark.ppm - ppmtoxpm ../win/Qt/pet_mark.ppm | sed -e 's/#FFFFFF/none/' > pet_mark.xpm - pet_mark.xbm: ../win/X11/pet_mark.xbm cp ../win/X11/pet_mark.xbm pet_mark.xbm - attr_sml.ppm: ../win/Qt/attr.ppm ../win/Qt/colormap.ppm - pnmscale 0.5 ../win/Qt/attr.ppm | ppmquant -fs -map ../win/Qt/colormap.ppm >attr_sml.ppm - - attr_tny.ppm: ../win/Qt/attr.ppm ../win/Qt/colormap.ppm - pnmscale 0.25 ../win/Qt/attr.ppm | ppmquant -fs -map ../win/Qt/colormap.ppm >attr_tny.ppm - - str.xpm: attr_sml.ppm - pnmcut 0 0 40 40 attr_sml.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >str.xpm - - dex.xpm: attr_sml.ppm - pnmcut 40 0 40 40 attr_sml.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >dex.xpm - - con.xpm: attr_sml.ppm - pnmcut 80 0 40 40 attr_sml.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >con.xpm - - int.xpm: attr_sml.ppm - pnmcut 120 0 40 40 attr_sml.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >int.xpm - - wis.xpm: attr_sml.ppm - pnmcut 160 0 40 40 attr_sml.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >wis.xpm - - cha.xpm: attr_sml.ppm - pnmcut 200 0 40 40 attr_sml.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >cha.xpm - - str_tny.xpm: attr_tny.ppm - pnmcut 0 0 20 20 attr_tny.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >str_tny.xpm - - dex_tny.xpm: attr_tny.ppm - pnmcut 20 0 20 20 attr_tny.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >dex_tny.xpm - - con_tny.xpm: attr_tny.ppm - pnmcut 40 0 20 20 attr_tny.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >con_tny.xpm - - int_tny.xpm: attr_tny.ppm - pnmcut 60 0 20 20 attr_tny.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >int_tny.xpm - - wis_tny.xpm: attr_tny.ppm - pnmcut 80 0 20 20 attr_tny.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >wis_tny.xpm - - cha_tny.xpm: attr_tny.ppm - pnmcut 100 0 20 20 attr_tny.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >cha_tny.xpm - - %_tny.xpm: %.ppm - pnmscale 0.5 $*.ppm | ppmquant -fs -map ../win/Qt/colormap.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >$*_tny.xpm - - %.pbm: ../win/Qt/%.pbm - cp ../win/Qt/$*.pbm $*.pbm - - %.ppm: ../win/Qt/%.ppm - cp ../win/Qt/$*.ppm $*.ppm - - %.ppm: ../win/Qt/%_l.ppm ../win/Qt/colormap.ppm - pnmscale 0.5 ../win/Qt/$*_l.ppm | \ - pnmdepth 255 | \ - ppmquant -fs -map ../win/Qt/colormap.ppm >$*.ppm - - # %.xpm: ../win/Qt/%.xpm - # cp ../win/Qt/$*.xpm $*.xpm - - %.xpm: ../win/Qt/%_l.ppm ../win/Qt/colormap.ppm - pnmscale 0.5 ../win/Qt/$*_l.ppm | \ - pnmdepth 255 | \ - ppmquant -fs -map ../win/Qt/colormap.ppm | ppmtoxpm | sed -e 's/#C0C0C0/none/' >$*.xpm - rip.xpm: ../win/X11/rip.xpm cp ../win/X11/rip.xpm rip.xpm - data: data.base ../util/makedefs ../util/makedefs -d --- 22,38 ---- ../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \ ../win/share/other.txt ! tiles.xpm: ../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \ ../win/share/other.txt ! ../util/tile2x11 -xpm ../win/share/monsters.txt ../win/share/objects.txt \ ../win/share/other.txt pet_mark.xbm: ../win/X11/pet_mark.xbm cp ../win/X11/pet_mark.xbm pet_mark.xbm rip.xpm: ../win/X11/rip.xpm cp ../win/X11/rip.xpm rip.xpm data: data.base ../util/makedefs ../util/makedefs -d *************** *** 222,227 **** spotless: -rm -f spec_levs quest_levs *.lev $(VARDAT) dungeon dungeon.pdf ! -rm -f nhdat x11tiles pet_mark.xbm rip.xpm ! # delete qt bmps, compressed bonefiles and other ! -rm -f *.bmp *.Z *.T prem --- 130,133 ---- spotless: -rm -f spec_levs quest_levs *.lev $(VARDAT) dungeon dungeon.pdf ! -rm -f nhdat x11tiles pet_mark.xbm rip.xpm tiles.xpm *** sys/unix/Makefile.src.orig Sat Oct 30 21:13:34 1999 --- sys/unix/Makefile.src Sat Oct 30 21:14:28 1999 *************** *** 127,141 **** CFLAGS = -O -I../include LFLAGS = ! # QT link ! # CFLAGS = -O2 -I../include ! # LFLAGS = -L/usr/X11/lib -L$(QTDIR)/lib -L$(KDEDIR)/lib ! # LFLAGS = -L/usr/X11/lib -L$(QTDIR)/lib -L$(KDEDIR)/lib ! ! # For USER_SOUNDS support, include -I/usr/X11/include ! # CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include -I$(KDEDIR)/include -I/usr/X11/include ! # CXXFLAGS = $(CFLAGS) -I. -I/usr/local/qt/include -I/opt/kde/include -I/usr/X11/include # Set the WINSRC, WINOBJ, and WINLIB lines to correspond to your desired # combination of windowing systems. Also set windowing systems in config.h. --- 127,151 ---- CFLAGS = -O -I../include LFLAGS = ! # QT windowing system ! # SuSE 6.1 ! # QTDIR=/usr/lib/qt ! # RedHat 6.1 ! # QTDIR=/usr/lib/qt-1.44 ! # ! QTLIBDIR=$(QTDIR)/lib ! QTINCDIR=$(QTDIR)/include ! QTBINDIR=$(QTDIR)/bin ! # SuSE 6.1 ! # KDELIBDIR=/opt/kde/lib ! # KDEINCDIR=/opt/kde/include ! # RedHat 6.1 ! KDELIBDIR=/usr/lib ! KDEINCDIR=/usr/include/kde ! # CFLAGS = -O -I../include ! # LFLAGS = -L/usr/X11/lib -L$(QTLIBDIR) -L$(KDELIBDIR) + # CXXFLAGS = $(CFLAGS) -I. -I$(QTINCDIR) -I$(KDEINCDIR) -I/usr/X11/include # Set the WINSRC, WINOBJ, and WINLIB lines to correspond to your desired # combination of windowing systems. Also set windowing systems in config.h. *************** *** 146,173 **** WINTTYOBJ = getline.o termcap.o topl.o wintty.o # # files for an X11 port ! # (weird format for tile.c is for "make depend"'s benefit) WINX11SRC = ../win/X11/Window.c ../win/X11/dialogs.c ../win/X11/winX.c \ ../win/X11/winmap.c ../win/X11/winmenu.c ../win/X11/winmesg.c \ ../win/X11/winmisc.c ../win/X11/winstat.c ../win/X11/wintext.c \ ! ../win/X11/winval.c ../src/./tile.c WINX11OBJ = Window.o dialogs.o winX.o winmap.o winmenu.o winmesg.o \ winmisc.o winstat.o wintext.o winval.o tile.o # ! # Files for a Qt port ! # ! # for USER_SOUNDS support, include ../win/Qt/qaudio.cc ../win/Qt/qaudio-p.cc ! WINQTSRC = ../win/Qt/qt_win.cc ../win/Qt/qviewp.cc ../win/Qt/cluster.cc \ ! ../win/Qt/qaudio.cc ../win/Qt/qaudio-p.cc ! ! # For USER_SOUNDS support, include qaudio.o qaudio-p.o ! WINQTOBJ = qt_win.o qviewp.o cluster.o tile.o \ ! qaudio.o qaudio-p.o ! # ! # WINSRC = $(WINTTYSRC) WINOBJ = $(WINTTYOBJ) # on some systems the termcap library is in -ltermcap or -lcurses # on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead --- 156,194 ---- WINTTYOBJ = getline.o termcap.o topl.o wintty.o # # files for an X11 port ! # (tile.c is included in the defn. for WINCSRC, below) WINX11SRC = ../win/X11/Window.c ../win/X11/dialogs.c ../win/X11/winX.c \ ../win/X11/winmap.c ../win/X11/winmenu.c ../win/X11/winmesg.c \ ../win/X11/winmisc.c ../win/X11/winstat.c ../win/X11/wintext.c \ ! ../win/X11/winval.c WINX11OBJ = Window.o dialogs.o winX.o winmap.o winmenu.o winmesg.o \ winmisc.o winstat.o wintext.o winval.o tile.o # ! # files for a Qt port ! # (tile.c is included in the defn. for WINCSRC, below) ! WINQTGSRC = ../win/Qt/qt_win.cpp ../win/Qt/qt_cluster.cpp ! WINQTASRC = ../win/Qt/qaudio.cpp ../win/Qt/qaudio-p.cpp ! # for USER_SOUNDS support, include $(WINQTASRC) ! # WINQTSRC = $(WINQTGSRC) $(WINQTASRC) ! WINQTSRC = $(WINQTGSRC) ! ! WINQTGOBJ = qt_win.o qt_cluster.o tile.o ! WINQTAOBJ = qaudio.o qaudio-p.o ! # For USER_SOUNDS support, include $(WINQTAOBJ) ! # WINQTOBJ = $(WINQTGOBJ) $(WINQTAOBJ) ! WINQTOBJ = $(WINQTGOBJ) ! # Use these declarations if you only want to support the TTY windowing system WINSRC = $(WINTTYSRC) WINOBJ = $(WINTTYOBJ) + # Use these declarations if you want to support the X11 windowing system + # WINSRC = $(WINTTYSRC) $(WINX11SRC) + # WINOBJ = $(WINTTYOBJ) $(WINX11OBJ) + # Use these declarations if you want to support the Qt windowing system + # WINSRC = $(WINTTYSRC) $(WINQTSRC) + # WINOBJ = $(WINTTYOBJ) $(WINQTOBJ) + # + # You must also change the definition of WINLIB (below) to match these # on some systems the termcap library is in -ltermcap or -lcurses # on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead *************** *** 193,204 **** # WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0 # # libraries for Qt (X11 binding) ! # For USER_SOUNDS support, include -laudio -lm ! # WINQTLIB = -lqt -lX11 -lm -lXext -lstdc++ ! # KDELIB = -lkdeui -lkdecore ! # ! # WINLIB = $(WINTTYLIB) # any other strange libraries your system needs (for Sysunix only -- the more # specialized targets should already be right) --- 214,233 ---- # WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0 # # libraries for Qt (X11 binding) ! WINQTGLIB = -lqt -lX11 -lm -lXext -lstdc++ ! WINQTALIB = -laudio ! # For USER_SOUNDS support, include $(WINQTALIB) ! # WINQTLIB = $(WINQTGLIB) $(WINQTALIB) ! WINQTLIB = $(WINQTGLIB) ! KDELIB = -lkdeui -lkdecore ! ! ! # Use this declaration if you only want to support the TTY windowing system WINLIB = $(WINTTYLIB) + # Use this declaration if you want to support the X11 windowing system + # WINLIB = $(WINTTYLIB) $(WINX11LIB) + # Use this declaration if you want to support the Qt windowing system + # WINLIB = $(WINTTYLIB) $(WINQTLIB) # any other strange libraries your system needs (for Sysunix only -- the more # specialized targets should already be right) *************** *** 269,276 **** ../sys/unix/unixunix.c ../sys/be/bemain.c # all windowing-system-dependent .c (for dependencies and such) ! WINCSRC = $(WINTTYSRC) $(WINX11SRC) ! # all windowing-system-dependent .cc (for dependencies and such) WINCXXSRC = $(WINQTSRC) # .c files for this version (for date.h) --- 298,306 ---- ../sys/unix/unixunix.c ../sys/be/bemain.c # all windowing-system-dependent .c (for dependencies and such) ! # (weird format for tile.c is for "make depend"'s benefit) ! WINCSRC = $(WINTTYSRC) $(WINX11SRC) ../src/./tile.c ! # all windowing-system-dependent .cpp (for dependencies and such) WINCXXSRC = $(WINQTSRC) # .c files for this version (for date.h) *************** *** 393,399 **** # Meta-object compiler outputs (for Qt windowport) %.moc: ../include/%.h ! moc ../include/$*.h -o $*.moc $(MAKEDEFS): ../util/makedefs.c ../include/config.h ../include/permonst.h \ ../include/objclass.h ../include/monsym.h \ --- 423,429 ---- # Meta-object compiler outputs (for Qt windowport) %.moc: ../include/%.h ! $(QTBINDIR)/moc ../include/$*.h -o $*.moc $(MAKEDEFS): ../util/makedefs.c ../include/config.h ../include/permonst.h \ ../include/objclass.h ../include/monsym.h \ *************** *** 428,434 **** # Files copied from Window-port-specific directories # ! HGENERATE = ../include/qt_win.h ../include/qviewp.h ../include/qtdummy.h ../include/cluster.h ../include/%.h: ../win/Qt/%.h -rm -f ../include/$*.h --- 458,464 ---- # Files copied from Window-port-specific directories # ! HGENERATE = ../include/qt_win.h ../include/qt_cluster.h ../include/qaudio.h ../include/qaudio-p.h ../include/qt_xpms.h ../include/%.h: ../win/Qt/%.h -rm -f ../include/$*.h *************** *** 457,463 **** -rm -f a.out core $(GAME) Sys* -rm -f ../include/date.h ../include/onames.h ../include/pm.h -rm -f monstr.c ../include/vis_tab.h vis_tab.c tile.c ! depend: $(WINCXXSRC) $(HACKCSRC) $(SYSCSRC) $(WINCSRC) $(HGENERATE) # For the moment we are lazy and disregard /usr/include files because --- 487,493 ---- -rm -f a.out core $(GAME) Sys* -rm -f ../include/date.h ../include/onames.h ../include/pm.h -rm -f monstr.c ../include/vis_tab.h vis_tab.c tile.c ! -rm -f *.moc $(HGENERATE) ../include/filename.h depend: $(WINCXXSRC) $(HACKCSRC) $(SYSCSRC) $(WINCSRC) $(HGENERATE) # For the moment we are lazy and disregard /usr/include files because *************** *** 487,493 **** # pick up hold space # change newlines to spaces # prepend file: ! # change .c to .o (and .cc to .o for C++ files) # add command if necessary # for i in ${WINCXXSRC}; do \ --- 517,523 ---- # pick up hold space # change newlines to spaces # prepend file: ! # change .c to .o (and .cpp to .o for C++ files) # add command if necessary # for i in ${WINCXXSRC}; do \ *************** *** 499,505 **** -e H \ -e '$$g' -e '$$s/\n/ /g' \ -e '$$s;.*;'$$i': '$$i'&;' \ ! -e '$$s;\.\./[^/]*/[^/]*/\([^.]*\)\.cc;\1.o;' \ -e '$$s;.*;&@ $$(CXX) $$(CXXFLAGS) -c '$$i';p' | \ tr '[@]' '[\012]' \ >> makedep); done --- 529,535 ---- -e H \ -e '$$g' -e '$$s/\n/ /g' \ -e '$$s;.*;'$$i': '$$i'&;' \ ! -e '$$s;\.\./[^/]*/[^/]*/\([^.]*\)\.cpp;\1.o;' \ -e '$$s;.*;&@ $$(CXX) $$(CXXFLAGS) -c '$$i';p' | \ tr '[@]' '[\012]' \ >> makedep); done *************** *** 551,566 **** # DO NOT DELETE THIS LINE ! qt_win.o: ../win/Qt/qt_win.cc ../include/hack.h ../include/qt_win.h ../include/cluster.h ../include/qviewp.h ../include/qaudio.h qt_win.moc qtdummy.moc ! $(CXX) $(CXXFLAGS) -c ../win/Qt/qt_win.cc ! qviewp.o: ../win/Qt/qviewp.cc ../include/qviewp.h qviewp.moc ! $(CXX) $(CXXFLAGS) -c ../win/Qt/qviewp.cc ! cluster.o: ../win/Qt/cluster.cc ../include/cluster.h ! $(CXX) $(CXXFLAGS) -c ../win/Qt/cluster.cc ! qaudio.o: ../win/Qt/qaudio.cc ../include/qaudio.h ../include/qaudio-p.h ! $(CXX) $(CXXFLAGS) -c ../win/Qt/qaudio.cc ! qaudio-p.o: ../win/Qt/qaudio-p.cc ../include/qaudio-p.h qaudio-p.moc ! $(CXX) $(CXXFLAGS) -c ../win/Qt/qaudio-p.cc tos.o: ../sys/atari/tos.c ../include/hack.h ../include/termcap.h $(CC) $(CFLAGS) -c ../sys/atari/tos.c pcmain.o: ../sys/share/pcmain.c ../include/hack.h ../include/dlb.h ../include/patchlevel.h ../include/win32api.h --- 581,594 ---- # DO NOT DELETE THIS LINE ! qt_win.o: ../win/Qt/qt_win.cpp ../include/hack.h ../include/dlb.h ../include/patchlevel.h ../include/qt_win.h ../include/qt_cluster.h ../include/qt_xpms.h ../include/qaudio.h qt_win.moc ! $(CXX) $(CXXFLAGS) -c ../win/Qt/qt_win.cpp ! qt_cluster.o: ../win/Qt/qt_cluster.cpp ../include/qt_cluster.h ! $(CXX) $(CXXFLAGS) -c ../win/Qt/qt_cluster.cpp ! qaudio.o: ../win/Qt/qaudio.cpp ! $(CXX) $(CXXFLAGS) -c ../win/Qt/qaudio.cpp ! qaudio-p.o: ../win/Qt/qaudio-p.cpp ../include/qaudio-p.h qaudio-p.moc ! $(CXX) $(CXXFLAGS) -c ../win/Qt/qaudio-p.cpp tos.o: ../sys/atari/tos.c ../include/hack.h ../include/termcap.h $(CC) $(CFLAGS) -c ../sys/atari/tos.c pcmain.o: ../sys/share/pcmain.c ../include/hack.h ../include/dlb.h ../include/patchlevel.h ../include/win32api.h *** sys/unix/Makefile.top.orig Sat Oct 30 21:13:34 1999 --- sys/unix/Makefile.top Sat Oct 30 21:14:28 1999 *************** *** 39,60 **** # SHELLDIR = $(KDEDIR)/bin ! # per discussion in Install.X11 and Install.Qt ! #VARDATND = qt_tiles_0.bmp qt_tiles_1.bmp qt_tiles_2.bmp qt_tiles_3.bmp \ ! # str.xpm dex.xpm con.xpm int.xpm wis.xpm cha.xpm \ ! # blind.xpm chaotic.xpm confused.xpm ext_encumber.xpm \ ! # hallu.xpm hungry.xpm hvy_encumber.xpm lawful.xpm \ ! # mod_encumber.xpm neutral.xpm ovr_encumber.xpm satiated.xpm \ ! # sick_fp.xpm sick_il.xpm slt_encumber.xpm stunned.xpm \ ! # str_tny.xpm dex_tny.xpm con_tny.xpm int_tny.xpm wis_tny.xpm cha_tny.xpm \ ! # blind_tny.xpm chaotic_tny.xpm confused_tny.xpm ext_encumber_tny.xpm \ ! # hallu_tny.xpm hungry_tny.xpm hvy_encumber_tny.xpm lawful_tny.xpm \ ! # mod_encumber_tny.xpm neutral_tny.xpm ovr_encumber_tny.xpm satiated_tny.xpm \ ! # sick_fp_tny.xpm sick_il_tny.xpm slt_encumber_tny.xpm stunned_tny.xpm \ ! # rip.xpm pet_mark.xbm pet_mark.xpm ! # VARDATND = x11tiles pet_mark.xbm ! VARDATND = x11tiles pet_mark.xbm rip.xpm VARDATD = data oracles options quest.dat rumors VARDAT = $(VARDATD) $(VARDATND) --- 39,53 ---- # SHELLDIR = $(KDEDIR)/bin ! # per discussions in Install.X11 and Install.Qt ! VARQTND = tiles.xpm rip.xpm ! VARX11ND = x11tiles pet_mark.xbm ! # VARX11ND = x11tiles pet_mark.xbm rip.xpm ! ! # VARDATND = $(VARX11ND) ! # VARDATND = $(VARQTND) ! VARDATND = VARDATD = data oracles options quest.dat rumors VARDAT = $(VARDATD) $(VARDATND) *************** *** 143,163 **** util/txt2ppm: ( cd util ; $(MAKE) txt2ppm ) - - qt_tiles_0.bmp: util/txt2ppm - ( cd dat ; $(MAKE) qt_tiles_0.bmp ) - - qt_tiles_1.bmp: util/txt2ppm - ( cd dat ; $(MAKE) qt_tiles_1.bmp ) - - qt_tiles_2.bmp: util/txt2ppm - ( cd dat ; $(MAKE) qt_tiles_2.bmp ) - - qt_tiles_3.bmp: util/txt2ppm - ( cd dat ; $(MAKE) qt_tiles_3.bmp ) - - %.ppm: - ( cd dat ; $(MAKE) $*.ppm ) %.xpm: ( cd dat ; $(MAKE) $*.xpm ) --- 136,141 ---- *** win/X11/tile2x11.c.orig Sat Oct 30 21:13:35 1999 --- win/X11/tile2x11.c Sat Oct 30 21:14:28 1999 *************** *** 10,16 **** #include "tile.h" #include "tile2x11.h" /* x11 output file header structure */ ! #define OUTNAME "x11tiles" /* output file name */ /*#define PRINT_COLORMAP /* define to print the colormap */ --- 10,17 ---- #include "tile.h" #include "tile2x11.h" /* x11 output file header structure */ ! #define OUTNAME "x11tiles" /* output file name, builtin format */ ! #define OUTNAMEXPM "tiles.xpm" /* output file name, XPM format */ /*#define PRINT_COLORMAP /* define to print the colormap */ *************** *** 117,123 **** } - #ifdef USE_XPM static int xpm_write(fp) FILE *fp; --- 118,123 ---- *************** *** 159,165 **** return fprintf(fp, "};\n")>=0; } - #endif /* USE_XPM */ int main(argc, argv) --- 159,164 ---- *************** *** 169,174 **** --- 168,179 ---- FILE *fp; int i; + #ifdef USE_XPM + int xpm=1; + #else + int xpm=0; + #endif + header.version = 1; header.ncolors = 0; header.tile_width = TILE_X; *************** *** 176,186 **** header.ntiles = 0; /* updated as we read in files */ if (argc == 1) { ! Fprintf(stderr, "usage: %s txt_file1 [txt_file2 ...]\n", argv[0]); exit(1); } ! fp = fopen(OUTNAME, "w"); if (!fp) { Fprintf(stderr, "can't open output file\n"); exit(1); --- 181,199 ---- header.ntiles = 0; /* updated as we read in files */ if (argc == 1) { ! Fprintf(stderr, "usage: %s [-xpm] txt_file1 [txt_file2 ...]\n", argv[0]); exit(1); } ! if (argv[1][0]=='-' && argv[1][1]=='x') { ! xpm = 1; ! argv++; ! argc--; ! fp = fopen(OUTNAMEXPM, "w"); ! } else { ! fp = fopen(OUTNAME, "w"); ! } ! if (!fp) { Fprintf(stderr, "can't open output file\n"); exit(1); *************** *** 190,218 **** process_file(argv[i]); Fprintf(stderr, "Total tiles: %ld\n", header.ntiles); ! #ifdef USE_XPM ! if (xpm_write(fp) == 0) { ! Fprintf(stderr, "can't write XPM file\n"); ! exit(1); ! } ! #else ! if (fwrite((char *)&header, sizeof(x11_header), 1, fp) == 0) { ! Fprintf(stderr, "can't open output header\n"); ! exit(1); } ! if (fwrite((char *)x11_colormap, 1, header.ncolors*3, fp) == 0) { ! Fprintf(stderr, "can't write output colormap\n"); ! exit(1); ! } ! if (fwrite((char *)tile_bytes, 1, ! (int) header.ntiles*header.tile_width*header.tile_height, fp) == 0) { ! Fprintf(stderr, "can't write tile bytes\n"); ! exit(1); } - #endif fclose(fp); return 0; --- 203,231 ---- process_file(argv[i]); Fprintf(stderr, "Total tiles: %ld\n", header.ntiles); ! if (xpm) { ! if (xpm_write(fp) == 0) { ! Fprintf(stderr, "can't write XPM file\n"); ! exit(1); } + } else { + if (fwrite((char *)&header, sizeof(x11_header), 1, fp) == 0) { + Fprintf(stderr, "can't open output header\n"); + exit(1); + } ! if (fwrite((char *)x11_colormap, 1, header.ncolors*3, fp) == 0) { ! Fprintf(stderr, "can't write output colormap\n"); ! exit(1); ! } ! if (fwrite((char *)tile_bytes, 1, ! (int) header.ntiles*header.tile_width*header.tile_height, fp) == 0) { ! Fprintf(stderr, "can't write tile bytes\n"); ! exit(1); ! } } fclose(fp); return 0;