Skip to content

Commit

Permalink
Merge branch 'interfaces' of github.com:chasonr/nethack-3.6.0-patches…
Browse files Browse the repository at this point in the history
… into interfaces
  • Loading branch information
chasonr committed Mar 4, 2016
2 parents 6ace581 + f169e01 commit ba157e7
Show file tree
Hide file tree
Showing 166 changed files with 81,841 additions and 359 deletions.
9 changes: 5 additions & 4 deletions README-patches
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ The above listed interfaces will all support Unicode on the map. Unicode will
also be available for TTY on Unix (including Linux and Mac OS X) and for TTY
and Win32 on the Windows NT series (NT, 2000, XP, Vista, 8 and 10).

Qt 3 may eventually support Unicode if I feel like including it. X11 could
support Unicode, but the Athena label widget is broken and the Xorg developers
have made it clear that they have no intention of fixing it. Thus Unicode
cannot be supported on X11.
Qt 3 may eventually support Unicode if I feel like including it. X11 can
support Unicode. The Athena label widget is broken and the Xorg developers
have made it clear that they have no intention of fixing it; thus a full i18n
job cannot be supported on X11. It could, however, support Unicode only on the
map.
222 changes: 222 additions & 0 deletions dat/symbols
Original file line number Diff line number Diff line change
Expand Up @@ -394,3 +394,225 @@ start: NHAccess
S_explode9: \047
finish

start: UTF8graphics
Handling: Unicode
S_vwall: \u2502 # vertical rule
S_hwall: \u2500 # horizontal rule
S_tlcorn: \u250C # top left corner
S_trcorn: \u2510 # top right corner
S_blcorn: \u2514 # bottom left
S_brcorn: \u2518 # bottom right
S_crwall: \u253C # cross
S_tuwall: \u2534 # T up
S_tdwall: \u252C # T down
S_tlwall: \u2524 # T left
S_trwall: \u251C # T right
S_ndoor: \u00B7 # centered dot
S_vodoor: \u25A0 # small centered square
S_hodoor: \u25A0 # small centered square
S_bars: \u2261 # equivalence symbol
S_tree: \u00B1 # plus or minus symbol
S_room: \u00B7 # centered dot
S_corr: \u2591 # light shading
S_litcorr: \u2592 # medium shading
S_fountain: \u2320 # integral top half
S_pool: \u2248 # approx. equals
S_ice: \u00B7 # centered dot
S_lava: \u2248 # approx. equals
S_vodbridge: \u00B7 # centered dot
S_hodbridge: \u00B7 # centered dot
S_water: \u2248 # approx. equals
S_vbeam: \u2502 # vertical rule
S_hbeam: \u2500 # horizontal rule
S_sw_ml: \u2502 # vertical rule
S_sw_mr: \u2502 # vertical rule
S_explode4: \u2502 # vertical rule
S_explode6: \u2502 # vertical rule
finish

start: UTF8Graphics_1
Handling: Unicode
S_vwall: \u2502 # vertical rule
S_hwall: \u2500 # horizontal rule
S_tlcorn: \u250C # top left corner
S_trcorn: \u2510 # top right corner
S_blcorn: \u2514 # bottom left
S_brcorn: \u2518 # bottom right
S_crwall: \u253C # cross
S_tuwall: \u2534 # T up
S_tdwall: \u252C # T down
S_tlwall: \u2524 # T left
S_trwall: \u251C # T right
S_vbeam: \u2502 # vertical rule
S_hbeam: \u2500 # horizontal rule
S_sw_ml: \u2502 # vertical rule
S_sw_mr: \u2502 # vertical rule
S_explode4: \u2502 # vertical rule
S_explode6: \u2502 # vertical rule
finish

start: UTF8Graphics_2
Handling: Unicode
S_vwall: \u2502 # vertical rule
S_hwall: \u2500 # horizontal rule
S_tlcorn: \u250C # top left corner
S_trcorn: \u2510 # top right corner
S_blcorn: \u2514 # bottom left
S_brcorn: \u2518 # bottom right
S_crwall: \u253C # cross
S_tuwall: \u2534 # T up
S_tdwall: \u252C # T down
S_tlwall: \u2524 # T left
S_trwall: \u251C # T right
S_vodoor: \u25A0 # small centered square
S_hodoor: \u25A0 # small centered square
S_corr: \u2591 # light shading
S_litcorr: \u2592 # medium shading
S_vbeam: \u2502 # vertical rule
S_hbeam: \u2500 # horizontal rule
S_sw_ml: \u2502 # vertical rule
S_sw_mr: \u2502 # vertical rule
S_explode4: \u2502 # vertical rule
S_explode6: \u2502 # vertical rule
finish

start: RogueIBM_UTF8
Handling: Unicode
Restrictions: rogue
S_weapon: \u0029
S_amulet: \u002c
S_food: \u003a
S_potion: \u00a1
S_scroll: \u003f
S_book: \u002b
S_wand: \u03c4
S_vwall: \u2551 # all walls now use
S_hwall: \u2550 # double line graphics
S_tlcorn: \u2554
S_trcorn: \u2557
S_blcorn: \u255a
S_brcorn: \u255d
S_crwall: \u256c
S_tuwall: \u2569
S_tdwall: \u2566
S_tlwall: \u2563
S_trwall: \u2560
S_ndoor: \u256c
S_vodoor: \u256c
S_hodoor: \u256c
S_room: \u00b7 # centered dot
S_corr: \u2592
S_litcorr: \u2593
S_upstair: \u2261 # Greek Xi
S_dnstair: \u2261
finish

start: RogueEpyx_UTF8
Description: Rogue level color symbol set like Epyx Rogue
Restrictions: rogue
Handling: Unicode
Color: Yes
S_weapon: \u2191 # up arrow
S_armor: \u25d9 # Vert rect with o
S_ring: \u25cb # circle with arrow
S_amulet: \u2640 # "female" symbol
S_food: \u2663 # club (as in cards)
S_potion: \u00a1 # upside down '!'
S_scroll: \u266b # musical note
S_wand: \u03c4 # greek tau
S_coin: \u263c # yes it's the same as gems
S_gem: \u263c # fancy '*'
S_rock: \u0060
S_ball: \u0030
S_chain: \u005f
S_venom: \u002e
S_vwall: \u2551 # all walls now use
S_hwall: \u2550 # double line graphics
S_tlcorn: \u2554
S_trcorn: \u2557
S_blcorn: \u255a
S_brcorn: \u255d
S_crwall: \u256c
S_tuwall: \u2569
S_tdwall: \u2566
S_tlwall: \u2563
S_trwall: \u2560
S_ndoor: \u256c
S_vodoor: \u256c
S_hodoor: \u256c
S_room: \u00b7 # centered dot
S_corr: \u2592
S_litcorr: \u2593
S_upstair: \u2261 # Greek Xi
S_dnstair: \u2261
S_arrow_trap: \u2666 # diamond (cards)
S_dart_trap: \u2666
S_falling_rock_trap: \u2666
S_squeaky_board: \u2666
S_bear_trap: \u2666
S_land_mine: \u2666
S_rolling_boulder_trap: \u2666
S_sleeping_gas_trap: \u2666
S_rust_trap: \u2666
S_fire_trap: \u2666
S_pit: \u2666
S_spiked_pit: \u2666
S_hole: \u2666
S_trap_door: \u2666
S_teleportation_trap: \u2666
S_level_teleporter: \u2666
S_magic_portal: \u2666
S_web: \u2666
S_statue_trap: \u2666
S_magic_trap: \u2666
S_anti_magic_trap: \u2666
S_polymorph_trap: \u2666
S_weapon: \u2191
S_armor: \u005b
S_ring: \u003d
S_amulet: \u2640
S_tool: \u0028
S_food: \u2663
S_potion: \u00a1
S_scroll: \u266b
S_book: \u002b
S_wand: \u03c4
S_coin: \u263c
S_gem: \u263c
S_rock: \u0060
S_ball: \u0030
S_chain: \u005f
S_venom: \u002e
S_human: \u263a
finish

start: RogueWindows_UTF8
Restrictions: rogue
Handling: Unicode
S_weapon: \u0029
S_amulet: \u002c
S_food: \u003a
S_potion: \u00a1
S_scroll: \u003f
S_book: \u002b
S_wand: \u03c4
S_vwall: \u2551 # all walls now use
S_hwall: \u2550 # double line graphics
S_tlcorn: \u2554
S_trcorn: \u2557
S_blcorn: \u255a
S_brcorn: \u255d
S_crwall: \u256c
S_tuwall: \u2569
S_tdwall: \u2566
S_tlwall: \u2563
S_trwall: \u2560
S_ndoor: \u256c
S_vodoor: \u256c
S_hodoor: \u256c
S_room: \u00b7 # centered dot
S_corr: \u2592
S_litcorr: \u2593
S_upstair: \u2261 # Greek Xi
S_dnstair: \u2261
finish
46 changes: 42 additions & 4 deletions include/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ E boolean FDECL(usmellmon, (struct permonst *));

/* ### mapglyph.c ### */

E int FDECL(mapglyph, (int, int *, int *, unsigned *, int, int));
E int FDECL(mapglyph, (int, nhsym *, int *, unsigned *, int, int));
E char *FDECL(encglyph, (int));
E void FDECL(genl_putmixed, (winid, int, const char *));

Expand Down Expand Up @@ -1634,7 +1634,7 @@ E int FDECL(choose_classes_menu,
(const char *, int, BOOLEAN_P, char *, char *));
E void FDECL(add_menu_cmd_alias, (CHAR_P, CHAR_P));
E char FDECL(map_menu_cmd, (CHAR_P));
E void FDECL(assign_warnings, (uchar *));
E void FDECL(assign_warnings, (nhsym *));
E char *FDECL(nh_getenv, (const char *));
E void FDECL(set_duplicate_opt_detection, (int));
E void FDECL(set_wc_option_mod_status, (unsigned long, int));
Expand All @@ -1650,7 +1650,7 @@ E void NDECL(set_playmode);
E int FDECL(sym_val, (char *));
E const char *FDECL(clr2colorname, (int));
E boolean FDECL(add_menu_coloring, (char *));
E boolean FDECL(get_menu_coloring, (char *, int *, int *));
E boolean FDECL(get_menu_coloring, (const char *, int *, int *));
E void NDECL(free_menu_coloring);
E boolean FDECL(msgtype_parse_add, (char *));
E int FDECL(msgtype_type, (const char *));
Expand All @@ -1668,7 +1668,7 @@ E char *FDECL(dowhatdoes_core, (CHAR_P, char *));
E int NDECL(dohelp);
E int NDECL(dohistory);
E int FDECL(do_screen_description,
(coord, BOOLEAN_P, int, char *, const char **));
(coord, BOOLEAN_P, nhsym, char *, const char **));
E int FDECL(do_look, (int, coord *));

/* ### pcmain.c ### */
Expand Down Expand Up @@ -2228,6 +2228,44 @@ E void FDECL(dismount_steed, (int));
E void FDECL(place_monster, (struct monst *, int, int));
E boolean FDECL(stucksteed, (BOOLEAN_P));

/* ### string.c ### */

E void NDECL(str_clear);
E str_context FDECL(str_open_context, (const char *));
E void FDECL(str_close_context, (str_context));
E genericptr_t FDECL(str_mem_alloc, (size_t));
E char *FDECL(str_alloc, (size_t));
E utf16_t *FDECL(str_alloc16, (size_t));
E utf32_t *FDECL(str_alloc32, (size_t));
E char *FDECL(str_copy, (const char *));
E utf16_t *FDECL(str_copy16, (const utf16_t *));
E utf32_t *FDECL(str_copy32, (const utf32_t *));
E genericptr_t FDECL(str_export, (str_context, genericptr_t));
E char *FDECL(str_detach, (char *));
E utf16_t *FDECL(str_detach16, (utf16_t *));
E utf32_t *FDECL(str_detach32, (utf32_t *));

#ifdef __cplusplus
class StringContext {
public:
StringContext(const char *trace)
: m_ctx(::str_open_context(trace)) {}

~StringContext(void)
{
::str_close_context(m_ctx);
}

operator ::str_context(void)
{
return m_ctx;
}

private:
::str_context m_ctx;
};
#endif

/* ### teleport.c ### */

E boolean FDECL(goodpos, (int, int, struct monst *, unsigned));
Expand Down
6 changes: 4 additions & 2 deletions include/flag.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ struct instance_flags {
as defined in the special font HackFont */
#endif
#endif
uchar bouldersym; /* symbol for boulder display */
#ifdef TTY_GRAPHICS
nhsym bouldersym; /* symbol for boulder display */
#if defined(TTY_GRAPHICS) || defined(CURSES_GRAPHICS)
char prevmsg_window; /* type of old message window to use */
boolean extmenu; /* extended commands use menu interface */
#endif
Expand Down Expand Up @@ -252,6 +252,8 @@ struct instance_flags {
#ifdef MSDOS
boolean hasvga; /* has a vga adapter */
boolean usevga; /* use the vga adapter */
boolean hasvesa; /* has a VESA-capable VGA adapter */
boolean usevesa; /* use the VESA-capable VGA adapter */
boolean grmode; /* currently in graphics mode */
#endif
#ifdef LAN_FEATURES
Expand Down
26 changes: 25 additions & 1 deletion include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,43 @@
* since otherwise comparisons with signed quantities are done incorrectly
*/
typedef schar xchar;
#if defined(__GNUC__) && defined(WIN32) && defined(__cplusplus)
/* Resolve conflict with Qt 5 and MinGW-w64 */
typedef uchar boolean; /* 0 or 1 */
#else
#ifndef SKIP_BOOLEAN
typedef xchar boolean; /* 0 or 1 */
#endif
#endif

#ifndef TRUE /* defined in some systems' native include files */
#define TRUE ((boolean) 1)
#define FALSE ((boolean) 0)
#endif

/*
* Unicode character types
* Improvise a bit
*/
typedef unsigned short utf16_t;
#if defined(MSDOS) || defined(OS2)
/* Possible 16 bit build; ensure 32 bit */
typedef unsigned long utf32_t;
#else
/* Most things have 32 bit int */
typedef unsigned utf32_t;
#endif

/*
* type nhsym: loadable symbols go into this type
*/
typedef uchar nhsym;
typedef utf32_t nhsym;

/*
* opaque type for string allocation
*/
struct str_context_rec;
typedef struct str_context_rec *str_context;

#ifndef STRNCMPI
#ifndef __SASC_60 /* SAS/C already shifts to stricmp */
Expand Down
2 changes: 2 additions & 0 deletions include/hack.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
#define TEST_TRAV 2 /* test a future travel location */

/*** some utility macros ***/
#ifndef __cplusplus /* resolve conflict with math.h */
#define yn(query) yn_function(query, ynchars, 'n')
#endif
#define ynq(query) yn_function(query, ynqchars, 'q')
#define ynaq(query) yn_function(query, ynaqchars, 'y')
#define nyaq(query) yn_function(query, ynaqchars, 'n')
Expand Down
Loading

0 comments on commit ba157e7

Please sign in to comment.