[Pkg-nethack-devel] nethack/debian/patches 12_lisp_windowing.dpatch,1.1,1.2
Ben Gertzfield
che@quantz.debian.org
Wed, 15 Oct 2003 14:18:14 +0000
Update of /cvsroot/pkg-nethack/nethack/debian/patches
In directory quantz:/tmp/cvs-serv27665
Modified Files:
12_lisp_windowing.dpatch
Log Message:
Update to enh-342.patch from nethack-el-0.9.2.
Index: 12_lisp_windowing.dpatch
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/debian/patches/12_lisp_windowing.dpatch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- 12_lisp_windowing.dpatch 7 Oct 2003 23:35:08 -0000 1.1
+++ 12_lisp_windowing.dpatch 15 Oct 2003 14:18:11 -0000 1.2
@@ -37,7 +37,7 @@
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---- /dev/null 1969-12-31 16:00:00.000000000 -0800
+--- /dev/null 2003-05-01 12:00:27.000000000 -0700
+++ nethack/include/winlisp.h 2002-01-10 19:54:20.000000000 -0800
@@ -0,0 +1,70 @@
+#ifndef WINLISP_H
@@ -110,7 +110,7 @@
+E void FDECL(lisp_outrip, (winid,int));
+
+#endif /* WINLISP_H */
---- nethack-3.4.1/src/windows.c 2003-02-23 06:43:31.000000000 -0800
+--- nethack-3.4.2/src/windows.c 2003-08-29 17:07:43.000000000 -0700
+++ nethack/src/windows.c 2002-04-23 17:44:58.000000000 -0700
@@ -40,6 +40,10 @@
#ifdef MSWIN_GRAPHICS
@@ -133,8 +133,8 @@
{ 0, 0 } /* must be last */
};
---- nethack-3.4.1/win/tty/termcap.c 2003-02-23 06:43:46.000000000 -0800
-+++ nethack/win/tty/termcap.c 2003-03-09 13:49:04.000000000 -0800
+--- nethack-3.4.2/win/tty/termcap.c 2003-08-29 17:08:25.000000000 -0700
++++ nethack/win/tty/termcap.c 2003-03-09 13:50:46.000000000 -0800
@@ -1161,6 +1161,11 @@
if (windowprocs.name != NULL &&
!strcmpi(windowprocs.name, "Gem")) return TRUE;
@@ -147,9 +147,20 @@
#ifdef QT_GRAPHICS
/* XXX has_color() should be added to windowprocs */
if (windowprocs.name != NULL &&
---- /dev/null 1969-12-31 16:00:00.000000000 -0800
-+++ nethack/win/lisp/ChangeLog 2002-09-19 21:15:20.000000000 -0700
-@@ -0,0 +1,293 @@
+--- /dev/null 2003-05-01 12:00:27.000000000 -0700
++++ nethack/win/lisp/ChangeLog 2003-06-03 02:04:26.000000000 -0700
+@@ -0,0 +1,304 @@
++2003-06-03 Shawn Betts <sabetts@sfu.ca>
++
++ * winlisp.c (lisp_print_glyph): Pass special to the print-glyph
++ lisp function as a symbol. delete the MG_PET bit in special if
++ iflags.hilite_pet is not set.
++ (special_glyph_to_string): new function
++
++2003-05-14 Shawn Betts <sabetts@sfu.ca>
++
++ * winlisp.c (lisp_string): Also escape the backslash character.
++
+2002-09-19 Ryan Yeske <rcyeske@vcn.bc.ca>
+
+ * winlisp.c (lisp_cmd): nethack-api-* renamed to nhapi-*.
@@ -443,9 +454,9 @@
+ s/nethack-api-updated-inventory/nethack-api-update-inventory/
+ (WINLISP_VOID_RETVAL): added macro, called for every void
+ function.
---- /dev/null 1969-12-31 16:00:00.000000000 -0800
-+++ nethack/win/lisp/winlisp.c 2002-09-19 21:15:20.000000000 -0700
-@@ -0,0 +1,1820 @@
+--- /dev/null 2003-05-01 12:00:27.000000000 -0700
++++ nethack/win/lisp/winlisp.c 2003-09-13 12:38:18.000000000 -0700
+@@ -0,0 +1,1876 @@
+/* Copyright (c) Shawn Betts, Ryan Yeske, 2001 */
+/* NetHack may be freely redistributed. See license for details. */
+
@@ -676,6 +687,7 @@
+struct window_procs lisp_procs = {
+ "lisp",
+ WC_COLOR|WC_HILITE_PET,
++ 0L,
+ lisp_init_nhwindows,
+ lisp_player_selection,
+ lisp_askname,
@@ -770,19 +782,20 @@
+ } \
+ while (0)
+#define lisp_int(i) printf("%d ",i)
-+#define lisp_string(s) \
-+ do \
-+ { \
-+ int nhi; \
-+ printf ("\""); \
-+ if (s) \
-+ for (nhi=0;nhi<strlen(s);nhi++) \
-+ { \
-+ if (s[nhi] == 34) putchar('\\'); \
-+ putchar(s[nhi]); \
-+ } \
-+ printf("\" "); \
-+ } \
++#define lisp_string(s) \
++ do \
++ { \
++ int nhi; \
++ printf ("\""); \
++ if (s) \
++ for (nhi=0;nhi<strlen(s);nhi++) \
++ { \
++ if (s[nhi] == 34 \
++ || s[nhi] == 92) putchar('\\'); \
++ putchar(s[nhi]); \
++ } \
++ printf("\" "); \
++ } \
+ while (0)
+
+static const char*
@@ -810,6 +823,31 @@
+}
+
+static const char*
++special_glyph_to_string(special)
++ unsigned special;
++{
++ switch (special)
++ {
++ case MG_CORPSE:
++ return "corpse";
++ case MG_INVIS:
++ return "invis";
++ case MG_DETECT:
++ return "detect";
++ case MG_PET:
++ return "pet";
++ case MG_RIDDEN:
++ return "ridden";
++ }
++
++ /* If it's a combination, just return special. */
++ if (special)
++ return "special";
++ else
++ return "none";
++}
++
++static const char*
+wintype_to_string(type)
+ int type;
+{
@@ -2217,14 +2255,43 @@
+ /* map glyph to character and color */
+ mapglyph(glyph, &ch, &color, &special, x, y);
+
++ /* If the user doesn't want to highlight the pet, then we erase
++ the PET bit from special. In the lisp code the special argument
++ will be 'pet if the glyph is a pet and will be printed in the
++ color of the pet highlight face. But we don't want this if the
++ user hasn't turned on hilite_pet. */
++ if (!iflags.hilite_pet)
++ {
++ special &= ~MG_PET;
++ }
++
+ if (window == WIN_MAP)
-+ lisp_cmd ("print-glyph",
-+ lisp_int (x);
-+ lisp_int (y);
-+ lisp_int (color);
-+ lisp_int (glyph);
-+ lisp_int (glyph2tile[glyph]);
-+ lisp_int (ch););
++ {
++ /* The last parameter, special, is optional. It is only
++ present when the tile is special in some way. FIXME: This
++ duplicate code is a bit gross. */
++ if (special)
++ {
++ lisp_cmd ("print-glyph",
++ lisp_int (x);
++ lisp_int (y);
++ lisp_int (color);
++ lisp_int (glyph);
++ lisp_int (glyph2tile[glyph]);
++ lisp_int (ch);
++ lisp_literal (special_glyph_to_string (special)););
++ }
++ else
++ {
++ lisp_cmd ("print-glyph",
++ lisp_int (x);
++ lisp_int (y);
++ lisp_int (color);
++ lisp_int (glyph);
++ lisp_int (glyph2tile[glyph]);
++ lisp_int (ch););
++ }
++ }
+ else
+ lisp_cmd ("error",
+ lisp_string ("lisp_print_glyph bad window");