Changeset 738
- Timestamp:
- 01/22/11 14:44:13 (16 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 13 modified
-
configure (modified) (6 diffs)
-
include/config.h (modified) (1 diff)
-
include/extern.h (modified) (3 diffs)
-
include/flag.h (modified) (1 diff)
-
include/rm.h (modified) (2 diffs)
-
src/drawing.c (modified) (10 diffs)
-
src/mapglyph.c (modified) (4 diffs)
-
src/options.c (modified) (5 diffs)
-
src/unicode.c (modified) (4 diffs)
-
sys/autoconf/autoconf.hin (modified) (3 diffs)
-
sys/autoconf/configure.ac (modified) (3 diffs)
-
sys/autoconf/m4/ax_define_integer_bits.m4 (added)
-
util/makedefs.c (modified) (1 diff)
-
win/tty/wintty.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure
r677 r738 749 749 enable_dump_html_css_file 750 750 enable_dump_html_css_embedded 751 enable_utf8_glyphs 751 752 enable_whereis_file 752 753 enable_wizmode … … 1450 1451 CSS file should be included in the HTML dump 1451 1452 (default=no) 1453 --enable-utf8-glyphs Enable UTF-8 glyphs in TTY (default=yes) 1452 1454 --enable-whereis-file=FILE 1453 1455 Log information about running games (default=no, … … 2010 2012 2011 2013 } # ac_fn_c_check_func 2014 2015 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES 2016 # -------------------------------------------- 2017 # Tries to find the compile-time value of EXPR in a program that includes 2018 # INCLUDES, setting VAR accordingly. Returns whether the value could be 2019 # computed 2020 ac_fn_c_compute_int () 2021 { 2022 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2023 if test "$cross_compiling" = yes; then 2024 # Depending upon the size, compute the lo and hi bounds. 2025 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2026 /* end confdefs.h. */ 2027 $4 2028 int 2029 main () 2030 { 2031 static int test_array [1 - 2 * !(($2) >= 0)]; 2032 test_array [0] = 0 2033 2034 ; 2035 return 0; 2036 } 2037 _ACEOF 2038 if ac_fn_c_try_compile "$LINENO"; then : 2039 ac_lo=0 ac_mid=0 2040 while :; do 2041 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2042 /* end confdefs.h. */ 2043 $4 2044 int 2045 main () 2046 { 2047 static int test_array [1 - 2 * !(($2) <= $ac_mid)]; 2048 test_array [0] = 0 2049 2050 ; 2051 return 0; 2052 } 2053 _ACEOF 2054 if ac_fn_c_try_compile "$LINENO"; then : 2055 ac_hi=$ac_mid; break 2056 else 2057 as_fn_arith $ac_mid + 1 && ac_lo=$as_val 2058 if test $ac_lo -le $ac_mid; then 2059 ac_lo= ac_hi= 2060 break 2061 fi 2062 as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val 2063 fi 2064 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2065 done 2066 else 2067 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2068 /* end confdefs.h. */ 2069 $4 2070 int 2071 main () 2072 { 2073 static int test_array [1 - 2 * !(($2) < 0)]; 2074 test_array [0] = 0 2075 2076 ; 2077 return 0; 2078 } 2079 _ACEOF 2080 if ac_fn_c_try_compile "$LINENO"; then : 2081 ac_hi=-1 ac_mid=-1 2082 while :; do 2083 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2084 /* end confdefs.h. */ 2085 $4 2086 int 2087 main () 2088 { 2089 static int test_array [1 - 2 * !(($2) >= $ac_mid)]; 2090 test_array [0] = 0 2091 2092 ; 2093 return 0; 2094 } 2095 _ACEOF 2096 if ac_fn_c_try_compile "$LINENO"; then : 2097 ac_lo=$ac_mid; break 2098 else 2099 as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val 2100 if test $ac_mid -le $ac_hi; then 2101 ac_lo= ac_hi= 2102 break 2103 fi 2104 as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val 2105 fi 2106 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2107 done 2108 else 2109 ac_lo= ac_hi= 2110 fi 2111 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2112 fi 2113 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2114 # Binary search between lo and hi bounds. 2115 while test "x$ac_lo" != "x$ac_hi"; do 2116 as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val 2117 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2118 /* end confdefs.h. */ 2119 $4 2120 int 2121 main () 2122 { 2123 static int test_array [1 - 2 * !(($2) <= $ac_mid)]; 2124 test_array [0] = 0 2125 2126 ; 2127 return 0; 2128 } 2129 _ACEOF 2130 if ac_fn_c_try_compile "$LINENO"; then : 2131 ac_hi=$ac_mid 2132 else 2133 as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val 2134 fi 2135 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 2136 done 2137 case $ac_lo in #(( 2138 ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; 2139 '') ac_retval=1 ;; 2140 esac 2141 else 2142 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2143 /* end confdefs.h. */ 2144 $4 2145 static long int longval () { return $2; } 2146 static unsigned long int ulongval () { return $2; } 2147 #include <stdio.h> 2148 #include <stdlib.h> 2149 int 2150 main () 2151 { 2152 2153 FILE *f = fopen ("conftest.val", "w"); 2154 if (! f) 2155 return 1; 2156 if (($2) < 0) 2157 { 2158 long int i = longval (); 2159 if (i != ($2)) 2160 return 1; 2161 fprintf (f, "%ld", i); 2162 } 2163 else 2164 { 2165 unsigned long int i = ulongval (); 2166 if (i != ($2)) 2167 return 1; 2168 fprintf (f, "%lu", i); 2169 } 2170 /* Do not output a trailing newline, as this causes \r\n confusion 2171 on some platforms. */ 2172 return ferror (f) || fclose (f) != 0; 2173 2174 ; 2175 return 0; 2176 } 2177 _ACEOF 2178 if ac_fn_c_try_run "$LINENO"; then : 2179 echo >>conftest.val; read $3 <conftest.val; ac_retval=0 2180 else 2181 ac_retval=1 2182 fi 2183 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 2184 conftest.$ac_objext conftest.beam conftest.$ac_ext 2185 rm -f conftest.val 2186 2187 fi 2188 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} 2189 as_fn_set_status $ac_retval 2190 2191 } # ac_fn_c_compute_int 2012 2192 cat >config.log <<_ACEOF 2013 2193 This file contains any messages produced by compilers while … … 3812 3992 esac 3813 3993 3814 3815 3994 for ac_prog in flex lex 3816 3995 do … … 5563 5742 5564 5743 5744 5745 5746 ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" 5747 if test "x$ac_cv_type_uint32_t" = x""yes; then : 5748 5749 else 5750 5751 { $as_echo "$as_me:${as_lineno-$LINENO}: trying to find a suitable 4-byte replacement for uint32_t" >&5 5752 $as_echo "$as_me: trying to find a suitable 4-byte replacement for uint32_t" >&6;} 5753 uint32_t=no 5754 find_uint32_t () 5755 { 5756 5757 5758 # The cast to long int works around a bug in the HP C Compiler 5759 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects 5760 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. 5761 # This bug is HP SR number 8606223364. 5762 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned int" >&5 5763 $as_echo_n "checking size of unsigned int... " >&6; } 5764 if test "${ac_cv_sizeof_unsigned_int+set}" = set; then : 5765 $as_echo_n "(cached) " >&6 5766 else 5767 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned int))" "ac_cv_sizeof_unsigned_int" "$ac_includes_default"; then : 5768 5769 else 5770 if test "$ac_cv_type_unsigned_int" = yes; then 5771 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 5772 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 5773 { as_fn_set_status 77 5774 as_fn_error "cannot compute sizeof (unsigned int) 5775 See \`config.log' for more details." "$LINENO" 5; }; } 5776 else 5777 ac_cv_sizeof_unsigned_int=0 5778 fi 5779 fi 5780 5781 fi 5782 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int" >&5 5783 $as_echo "$ac_cv_sizeof_unsigned_int" >&6; } 5784 5785 5786 5787 cat >>confdefs.h <<_ACEOF 5788 #define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int 5789 _ACEOF 5790 5791 5792 if test "$ac_cv_sizeof_unsigned_int" -eq 4; then 5793 uint32_t="unsigned int" 5794 return 5795 fi 5796 5797 5798 # The cast to long int works around a bug in the HP C Compiler 5799 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects 5800 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. 5801 # This bug is HP SR number 8606223364. 5802 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 5803 $as_echo_n "checking size of unsigned long... " >&6; } 5804 if test "${ac_cv_sizeof_unsigned_long+set}" = set; then : 5805 $as_echo_n "(cached) " >&6 5806 else 5807 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then : 5808 5809 else 5810 if test "$ac_cv_type_unsigned_long" = yes; then 5811 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 5812 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 5813 { as_fn_set_status 77 5814 as_fn_error "cannot compute sizeof (unsigned long) 5815 See \`config.log' for more details." "$LINENO" 5; }; } 5816 else 5817 ac_cv_sizeof_unsigned_long=0 5818 fi 5819 fi 5820 5821 fi 5822 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 5823 $as_echo "$ac_cv_sizeof_unsigned_long" >&6; } 5824 5825 5826 5827 cat >>confdefs.h <<_ACEOF 5828 #define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long 5829 _ACEOF 5830 5831 5832 if test "$ac_cv_sizeof_unsigned_long" -eq 4; then 5833 uint32_t="unsigned long" 5834 return 5835 fi 5836 5837 5838 # The cast to long int works around a bug in the HP C Compiler 5839 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects 5840 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. 5841 # This bug is HP SR number 8606223364. 5842 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5 5843 $as_echo_n "checking size of unsigned long long... " >&6; } 5844 if test "${ac_cv_sizeof_unsigned_long_long+set}" = set; then : 5845 $as_echo_n "(cached) " >&6 5846 else 5847 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default"; then : 5848 5849 else 5850 if test "$ac_cv_type_unsigned_long_long" = yes; then 5851 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 5852 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 5853 { as_fn_set_status 77 5854 as_fn_error "cannot compute sizeof (unsigned long long) 5855 See \`config.log' for more details." "$LINENO" 5; }; } 5856 else 5857 ac_cv_sizeof_unsigned_long_long=0 5858 fi 5859 fi 5860 5861 fi 5862 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5 5863 $as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; } 5864 5865 5866 5867 cat >>confdefs.h <<_ACEOF 5868 #define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long 5869 _ACEOF 5870 5871 5872 if test "$ac_cv_sizeof_unsigned_long_long" -eq 4; then 5873 uint32_t="unsigned long long" 5874 return 5875 fi 5876 5877 5878 5879 5880 5881 5882 5883 5884 : 5885 } 5886 find_uint32_t 5887 5888 cat >>confdefs.h <<_ACEOF 5889 #define uint32_t $uint32_t 5890 _ACEOF 5891 5892 5893 fi 5894 5895 5896 5565 5897 # Extract the first word of "nroff", so it can be a program name with args. 5566 5898 set dummy nroff; ac_word=$2 … … 6551 6883 fi 6552 6884 fi 6885 6886 if test "$enable_tty_graphics" != "no"; then 6887 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable utf8-glyphs" >&5 6888 $as_echo_n "checking whether to enable utf8-glyphs... " >&6; } 6889 # Check whether --enable-utf8-glyphs was given. 6890 if test "${enable_utf8_glyphs+set}" = set; then : 6891 enableval=$enable_utf8_glyphs; 6892 else 6893 enable_utf8_glyphs="yes" 6894 fi 6895 6896 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_utf8_glyphs" >&5 6897 $as_echo "$enable_utf8_glyphs" >&6; } 6898 if test "$enable_utf8_glyphs" != "no" ; then 6899 6900 cat >>confdefs.h <<_ACEOF 6901 #define UTF8_GLYPHS /**/ 6902 _ACEOF 6903 6904 fi 6905 6906 if test "$enable_utf8_glyphs" != "no" ; then 6907 if test "$uint32_t" = no; then 6908 as_fn_error "unable to continue without a 4-bytes datatype that could hold unicode codepoints" "$LINENO" 5 6909 fi 6910 fi 6911 fi 6912 6553 6913 6554 6914 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable whereis file" >&5 -
trunk/include/config.h
r712 r738 292 292 #ifndef _AIX32 /* identical typedef in system file causes trouble */ 293 293 typedef unsigned char uchar; 294 #endif 295 296 /* Type used for outputting DECgraphics and IBMgraphics characters into 297 * HTML dumps or for holding unicode codepoints. */ 298 #if HAVE_INTTYPES_H 299 # include <inttypes.h> 300 #else 301 # if HAVE_STDINT_H 302 # include <stdint.h> 303 # endif 304 #endif 305 #ifdef UINT32_MAX 306 typedef uint32_t glyph_t; 307 #else 308 /* Fallback that should work on most systems */ 309 typedef long glyph_t; 294 310 #endif 295 311 -
trunk/include/extern.h
r729 r738 470 470 E int FDECL(def_char_to_monclass, (CHAR_P)); 471 471 #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) 472 E void FDECL(assign_graphics, ( uchar*,int,int,int));472 E void FDECL(assign_graphics, (glyph_t *,int,int,int)); 473 473 E void FDECL(switch_graphics, (int)); 474 474 #ifdef REINCARNATION … … 1028 1028 /* ### mapglyph.c ### */ 1029 1029 1030 E void FDECL(mapglyph, (int, int *, int *, unsigned *, int, int));1030 E void FDECL(mapglyph, (int, glyph_t *, int *, unsigned *, int, int)); 1031 1031 1032 1032 /* ### mcastu.c ### */ … … 2553 2553 E int FDECL(check_tutorial_location, (int, int, BOOLEAN_P)); 2554 2554 2555 /* ### unicode.c ### */ 2556 E glyph_t FDECL(get_unicode_codepoint, (int)); 2557 E int FDECL(pututf8char, (glyph_t)); 2558 2555 2559 #undef E 2556 2560 -
trunk/include/flag.h
r625 r738 191 191 boolean echo; /* 1 to echo characters */ 192 192 boolean IBMgraphics; /* use IBM extended character set */ 193 boolean UTF8graphics; /* use UTF-8 characters */ 193 194 unsigned msg_history; /* hint: # of top lines to save */ 194 195 boolean num_pad; /* use numbers for movement commands */ -
trunk/include/rm.h
r654 r738 226 226 227 227 extern struct symdef defsyms[MAXPCHARS]; /* defaults */ 228 extern ucharshowsyms[MAXPCHARS];228 extern glyph_t showsyms[MAXPCHARS]; 229 229 extern const struct symdef def_warnsyms[WARNCOUNT]; 230 230 … … 236 236 #define DEC_GRAPHICS 2 /* VT100 line drawing characters */ 237 237 #define MAC_GRAPHICS 3 /* Macintosh drawing characters */ 238 #define CURS_GRAPHICS 4 /* Portable curses drawing characters */ 238 #define CURS_GRAPHICS 4 /* Portable curses drawing characters */ 239 #define UTF8_GRAPHICS 5 /* UTF8 characters */ 239 240 240 241 /* -
trunk/src/drawing.c
r522 r738 19 19 #define g_FILLER(symbol) 0 20 20 21 uchar oc_syms[MAXOCLASSES] = DUMMY; /* the current object display symbols */22 uchar showsyms[MAXPCHARS]= DUMMY; /* the current feature display symbols */23 uchar monsyms[MAXMCLASSES] = DUMMY; /* the current monster display symbols */24 uchar warnsyms[WARNCOUNT] = DUMMY; /* the current warning display symbols */21 uchar oc_syms[MAXOCLASSES] = DUMMY; /* the current object display symbols */ 22 glyph_t showsyms[MAXPCHARS] = DUMMY; /* the current feature display symbols */ 23 uchar monsyms[MAXMCLASSES] = DUMMY; /* the current monster display symbols */ 24 uchar warnsyms[WARNCOUNT] = DUMMY; /* the current warning display symbols */ 25 25 26 26 /* Default object class symbols. See objclass.h. */ … … 319 319 #endif 320 320 321 static ucharibm_graphics[MAXPCHARS] = {321 static glyph_t ibm_graphics[MAXPCHARS] = { 322 322 /* 0*/ g_FILLER(S_stone), 323 323 0xb3, /* S_vwall: meta-3, vertical rule */ … … 419 419 void NDECL((*decgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ 420 420 421 static uchardec_graphics[MAXPCHARS] = {421 static glyph_t dec_graphics[MAXPCHARS] = { 422 422 /* 0*/ g_FILLER(S_stone), 423 423 0xf8, /* S_vwall: meta-x, vertical rule */ … … 517 517 518 518 #ifdef MAC_GRAPHICS_ENV 519 static ucharmac_graphics[MAXPCHARS] = {519 static glyph_t mac_graphics[MAXPCHARS] = { 520 520 /* 0*/ g_FILLER(S_stone), 521 521 0xba, /* S_vwall */ … … 614 614 #endif /* MAC_GRAPHICS_ENV */ 615 615 616 #ifdef UTF8_GLYPHS 617 /* Probably best to only use characters from this list 618 * http://en.wikipedia.org/wiki/WGL4 */ 619 static glyph_t utf8_graphics[MAXPCHARS] = { 620 /* 0*/ g_FILLER(S_stone), 621 0x2502, /* S_vwall: BOX DRAWINGS LIGHT VERTICAL */ 622 0x2500, /* S_hwall: BOX DRAWINGS LIGHT HORIZONTAL */ 623 0x250c, /* S_tlcorn: BOX DRAWINGS LIGHT DOWN AND RIGHT */ 624 0x2510, /* S_trcorn: BOX DRAWINGS LIGHT DOWN AND LEFT */ 625 0x2514, /* S_blcorn: BOX DRAWINGS LIGHT UP AND RIGHT */ 626 0x2518, /* S_brcorn: BOX DRAWINGS LIGHT UP AND LEFT */ 627 0x253c, /* S_crwall: BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ 628 0x2534, /* S_tuwall: BOX DRAWINGS LIGHT UP AND HORIZONTAL */ 629 0x252c, /* S_tdwall: BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ 630 0x2524, /* S_tlwall: BOX DRAWINGS LIGHT VERTICAL AND LEFT */ 631 0x251c, /* S_trwall: BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ 632 0x00b7, /* S_ndoor: MIDDLE DOT */ 633 0x2592, /* S_vodoor: MEDIUM SHADE */ 634 0x2592, /* S_hodoor: MEDIUM SHADE */ 635 g_FILLER(S_vcdoor), 636 g_FILLER(S_hcdoor), 637 0x03c0, /* S_bars: GREEK SMALL LETTER PI */ 638 0x03a8, /* S_tree: GREEK CAPITAL LETTER PSI */ 639 0x00b7, /* S_room: MIDDLE DOT */ 640 g_FILLER(S_stone), /* S_darkroom: meta-~, centered dot */ 641 g_FILLER(S_corr), 642 g_FILLER(S_litcorr), 643 g_FILLER(S_upstair), 644 g_FILLER(S_dnstair), 645 0x2265, /* S_upladder: GREATER-THAN OR EQUAL TO */ 646 0x2264, /* S_dnladder: LESS-THAN OR EQUAL TO */ 647 0x2020, /* S_altar: DAGGER */ 648 0x03A9, /* S_grave: GREEK CAPITAL LETTER OMEGA */ 649 g_FILLER(S_throne), 650 g_FILLER(S_sink), 651 0x00b6, /* S_fountain: PILCROW SIGN */ 652 0x2248, /* S_pool: ALMOST EQUAL TO */ 653 0x00b7, /* S_ice: MIDDLE DOT */ 654 0x25c6, /* S_lava: BLACK DIAMOND */ 655 0x00b7, /* S_vodbridge: MIDDLE DOT */ 656 0x00b7, /* S_hodbridge: MIDDLE DOT */ 657 g_FILLER(S_vcdbridge), 658 g_FILLER(S_hcdbridge), 659 g_FILLER(S_air), 660 g_FILLER(S_cloud), 661 0x2248, /* S_water: ALMOST EQUAL TO */ 662 g_FILLER(S_arrow_trap), 663 g_FILLER(S_dart_trap), 664 g_FILLER(S_falling_rock_trap), 665 g_FILLER(S_squeaky_board), 666 g_FILLER(S_bear_trap), 667 g_FILLER(S_land_mine), 668 g_FILLER(S_rolling_boulder_trap), 669 g_FILLER(S_sleeping_gas_trap), 670 g_FILLER(S_rust_trap), 671 g_FILLER(S_fire_trap), 672 g_FILLER(S_pit), 673 g_FILLER(S_spiked_pit), 674 g_FILLER(S_hole), 675 g_FILLER(S_trap_door), 676 g_FILLER(S_teleportation_trap), 677 g_FILLER(S_level_teleporter), 678 g_FILLER(S_magic_portal), 679 0x00A4, /* S_web: CURRENCY SIGN */ 680 g_FILLER(S_statue_trap), 681 g_FILLER(S_magic_trap), 682 g_FILLER(S_anti_magic_trap), 683 g_FILLER(S_polymorph_trap), 684 0x58, /* S_vbeam: meta-x, vertical rule */ // TODO 685 0x51, /* S_hbeam: meta-q, horizontal rule */ // TODO 686 g_FILLER(S_lslant), 687 g_FILLER(S_rslant), 688 g_FILLER(S_digbeam), 689 g_FILLER(S_flashbeam), 690 g_FILLER(S_boomleft), 691 g_FILLER(S_boomright), 692 g_FILLER(S_ss1), 693 g_FILLER(S_ss2), 694 g_FILLER(S_ss3), 695 g_FILLER(S_ss4), 696 g_FILLER(S_sw_tl), 697 0x5f, /* S_sw_tc: meta-o, high horizontal line */ // TODO 698 g_FILLER(S_sw_tr), 699 0x58, /* S_sw_ml: meta-x, vertical rule */ // TODO 700 0x58, /* S_sw_mr: meta-x, vertical rule */ // TODO 701 g_FILLER(S_sw_bl), 702 0x53, /* S_sw_bc: meta-s, low horizontal line */ // TODO 703 g_FILLER(S_sw_br), 704 g_FILLER(S_explode1), 705 0x5f, /* S_explode2: meta-o, high horizontal line */ // TODO 706 g_FILLER(S_explode3), 707 0x58, /* S_explode4: meta-x, vertical rule */ // TODO 708 g_FILLER(S_explode5), 709 0x58, /* S_explode6: meta-x, vertical rule */ // TODO 710 g_FILLER(S_explode7), 711 0x53, /* S_explode8: meta-s, low horizontal line */ // TODO 712 g_FILLER(S_explode9) 713 }; 714 #endif 715 616 716 #ifdef PC9800 617 717 void NDECL((*ascgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ … … 649 749 void 650 750 assign_graphics(graph_chars, glth, maxlen, offset) 651 register uchar*graph_chars;751 register glyph_t *graph_chars; 652 752 int glth, maxlen, offset; 653 753 { … … 663 763 int gr_set_flag; 664 764 { 765 iflags.IBMgraphics = FALSE; 766 iflags.DECgraphics = FALSE; 767 iflags.cursesgraphics = FALSE; 768 iflags.UTF8graphics = FALSE; 769 665 770 switch (gr_set_flag) { 666 771 default: 667 772 case ASCII_GRAPHICS: 668 assign_graphics(( uchar*)0, 0, MAXPCHARS, 0);773 assign_graphics((glyph_t *)0, 0, MAXPCHARS, 0); 669 774 #ifdef PC9800 670 775 if (ascgraphics_mode_callback) (*ascgraphics_mode_callback)(); … … 712 817 #ifdef CURSES_GRAPHICS 713 818 case CURS_GRAPHICS: 714 assign_graphics(( uchar*)0, 0, MAXPCHARS, 0);819 assign_graphics((glyph_t *)0, 0, MAXPCHARS, 0); 715 820 iflags.cursesgraphics = TRUE; 716 821 iflags.IBMgraphics = FALSE; … … 718 823 break; 719 824 #endif 825 #ifdef UTF8_GLYPHS 826 case UTF8_GRAPHICS: 827 assign_graphics(utf8_graphics, SIZE(utf8_graphics), MAXPCHARS, 0); 828 iflags.UTF8graphics = TRUE; 829 break; 830 #endif 720 831 } 721 832 return; … … 728 839 * saved display symbols for objects & features. 729 840 */ 730 static uchar save_oc_syms[MAXOCLASSES] = DUMMY;731 static uchar save_showsyms[MAXPCHARS]= DUMMY;732 static uchar save_monsyms[MAXPCHARS] = DUMMY;733 734 static const ucharr_oc_syms[MAXOCLASSES] = {841 static uchar save_oc_syms[MAXOCLASSES] = DUMMY; 842 static glyph_t save_showsyms[MAXPCHARS] = DUMMY; 843 static uchar save_monsyms[MAXPCHARS] = DUMMY; 844 845 static const glyph_t r_oc_syms[MAXOCLASSES] = { 735 846 /* 0*/ '\0', 736 847 ILLOBJ_SYM, -
trunk/src/mapglyph.c
r715 r738 64 64 mapglyph(glyph, ochar, ocolor, ospecial, x, y) 65 65 int glyph, *ocolor, x, y; 66 int *ochar;66 glyph_t *ochar; 67 67 unsigned *ospecial; 68 68 { … … 71 71 int color = NO_COLOR; 72 72 #endif 73 ucharch;73 glyph_t ch; 74 74 unsigned special = 0; 75 75 … … 90 90 } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */ 91 91 /* see swallow_to_glyph() in display.c */ 92 ch = (uchar)showsyms[S_sw_tl + (offset & 0x7)];92 ch = showsyms[S_sw_tl + (offset & 0x7)]; 93 93 #ifdef ROGUE_COLOR 94 94 if (HAS_ROGUE_IBM_GRAPHICS && iflags.use_color) … … 248 248 #endif 249 249 250 *ochar = (int)ch;250 *ochar = ch; 251 251 *ospecial = special; 252 252 #ifdef TEXTCOLOR -
trunk/src/options.c
r734 r738 252 252 {"toptenwin",&flags.toptenwin, FALSE, SET_IN_GAME}, 253 253 {"travel", &iflags.travelcmd, TRUE, SET_IN_GAME}, 254 #ifdef UTF8_GLYPHS 255 {"UTF8graphics", &iflags.UTF8graphics, FALSE, SET_IN_GAME}, 256 #else 257 {"UTF8graphics", (boolean *)0, FALSE, SET_IN_FILE}, 258 #endif 254 259 {"use_inverse", &iflags.wc_inverse, TRUE, SET_IN_GAME}, /*WC*/ 255 260 #ifdef WIN_EDGE … … 920 925 int maxlen, offset; 921 926 { 922 uchartranslate[MAXPCHARS+1];927 glyph_t translate[MAXPCHARS+1]; 923 928 int length, i; 924 929 … … 931 936 /* match the form obtained from PC configuration files */ 932 937 for (i = 0; i < length; i++) 933 translate[i] = ( uchar) opts[i];938 translate[i] = (glyph_t) opts[i]; 934 939 assign_graphics(translate, length, maxlen, offset); 935 940 } … … 2842 2847 || (boolopt[i].addr) == &iflags.cursesgraphics 2843 2848 # endif 2849 # ifdef UTF8_GLYPHS 2850 || (boolopt[i].addr) == &iflags.UTF8graphics 2851 # endif 2844 2852 ) { 2845 2853 # ifdef REINCARNATION … … 2867 2875 switch_graphics(iflags.cursesgraphics ? 2868 2876 CURS_GRAPHICS : ASCII_GRAPHICS); 2877 # endif 2878 # ifdef UTF8_GLYPHS 2879 if ((boolopt[i].addr) == &iflags.UTF8graphics) 2880 switch_graphics(iflags.UTF8graphics ? 2881 UTF8_GRAPHICS : ASCII_GRAPHICS); 2869 2882 # endif 2870 2883 # ifdef REINCARNATION -
trunk/src/unicode.c
r736 r738 7 7 /** CP437 to Unicode mapping according to the Unicode Consortium 8 8 * http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP437.TXT */ 9 static int cp437_to_unicode[] = {9 static glyph_t cp437_to_unicode[] = { 10 10 0x00c7, /* LATIN CAPITAL LETTER C WITH CEDILLA */ 11 11 0x00fc, /* LATIN SMALL LETTER U WITH DIAERESIS */ … … 141 141 * Only the last 32 characters are significantly different from ASCII 142 142 * http://support.attachmate.com/techdocs/1184.html */ 143 static int dec_graphics_to_unicode[] = {143 static glyph_t dec_graphics_to_unicode[] = { 144 144 0x25c6, /* BLACK DIAMOND */ 145 145 0x2592, /* MEDIUM SHADE */ … … 177 177 178 178 /** Returns unicode codepoint of character according to selected graphics mode. */ 179 int179 glyph_t 180 180 get_unicode_codepoint(int ch) 181 181 { … … 192 192 } 193 193 194 #ifdef UTF8_GLYPHS 195 /** Prints a Unicode codepoint as UTF-8 encoded byte sequence. 196 * Originally from Ray Chason's Unicode proof of concept patch. */ 197 int 198 pututf8char(glyph_t c) 199 { 200 if (c < 0x80) { 201 putchar(c); 202 } else if(c < 0x800) { 203 putchar(0xC0 | (c>>6)); 204 putchar(0x80 | (c & 0x3F)); 205 } else if (c < 0x10000) { 206 putchar(0xE0 | (c>>12)); 207 putchar(0x80 | (c>>6 & 0x3F)); 208 putchar(0x80 | (c & 0x3F)); 209 } else if (c < 0x200000) { 210 putchar(0xF0 | (c>>18)); 211 putchar(0x80 | (c>>12 & 0x3F)); 212 putchar(0x80 | (c>>6 & 0x3F)); 213 putchar(0x80 | (c & 0x3F)); 214 } 215 216 return 0; 217 } 218 #endif 219 194 220 /*unicode.c*/ -
trunk/sys/autoconf/autoconf.hin
r597 r738 222 222 #undef SINKS 223 223 224 /* The size of `unsigned int', as computed by sizeof. */ 225 #undef SIZEOF_UNSIGNED_INT 226 227 /* The size of `unsigned long', as computed by sizeof. */ 228 #undef SIZEOF_UNSIGNED_LONG 229 230 /* The size of `unsigned long long', as computed by sizeof. */ 231 #undef SIZEOF_UNSIGNED_LONG_LONG 232 224 233 /* TTY graphics status color */ 225 234 #undef STATUS_COLORS … … 251 260 /* Using Mersenne Twister as RNG */ 252 261 #undef USE_MERSENNE_TWISTER 262 263 /* Enable UTF-8 glyphs in TTY */ 264 #undef UTF8_GLYPHS 253 265 254 266 /* Fancy mazes */ … … 274 286 #undef YYTEXT_POINTER 275 287 288 /* If not already defined, then define as a datatype of *exactly* 32 bits. */ 289 #undef uint32_t 290 276 291 #endif /* AUTOCONF_H */ -
trunk/sys/autoconf/configure.ac
r677 r738 112 112 *linux* ) AC_DEFINE(LINUX,[],[GNU Linux]);; 113 113 esac 114 115 114 116 115 dnl ----- Check for programs … … 346 345 AC_CHECK_FUNCS(fcntl) 347 346 347 dnl ------ Check for 32 bit datatype 348 AX_DEFINE_INTEGER_BITS(uint32_t, unsigned int, unsigned long, unsigned long long) 349 348 350 dnl ----- Check for program needed to build Guidebook 349 351 AC_CHECK_PROG(HAVE_NROFF, nroff, "yes", "no") … … 460 462 fi 461 463 464 if test "$enable_tty_graphics" != "no"; then 465 NETHACK_ARG(utf8-glyphs,[Enable UTF-8 glyphs in TTY],UTF8_GLYPHS,yes) 466 if test "$enable_utf8_glyphs" != "no" ; then 467 dnl check for uint32_t 468 if test "$uint32_t" = no; then 469 AC_MSG_ERROR([unable to continue without a 4-bytes datatype that could hold unicode codepoints]) 470 fi 471 fi 472 fi 473 474 462 475 NETHACK_ARG_WITH_PARAM(whereis-file,[Log information about running games],WHEREIS_FILE,no,FILE,[%n.whereis]) 463 476 -
trunk/util/makedefs.c
r687 r738 785 785 #ifdef TOURIST 786 786 "tourists", 787 #endif 788 #ifdef TOURIST 789 "UTF-8 glyphs", 787 790 #endif 788 791 #ifdef USER_SOUNDS -
trunk/win/tty/wintty.c
r709 r738 1832 1832 case NHW_BASE: 1833 1833 tty_curs(window, x, y); 1834 #ifdef UTF8_GLYPHS 1835 if (iflags.UTF8graphics) { 1836 pututf8char(ch); 1837 } else { 1838 (void) putchar(ch); 1839 } 1840 #else 1834 1841 (void) putchar(ch); 1842 #endif 1835 1843 ttyDisplay->curx++; 1836 1844 cw->curx++; … … 2586 2594 else 2587 2595 #endif 2596 #ifdef UTF8_GLYPHS 2597 if (iflags.UTF8graphics) { 2598 pututf8char(ch); 2599 } else { 2600 g_putch(ch); /* print the character */ 2601 } 2602 #else 2588 2603 g_putch(ch); /* print the character */ 2604 #endif 2589 2605 2590 2606 if (reverse_on) {