OSDN Git Service

Initial revision
[hengband/hengband.git] / src / z-config.h
1 /* File: z-config.h */
2
3 /* Purpose: Angband specific configuration stuff */
4
5 /*
6  * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
7  *
8  * This software may be copied and distributed for educational, research, and
9  * not for profit purposes provided that this copyright and statement are
10  * included in all such copies.
11  */
12
13 /* Allow debug commands */
14 #define USE_DEBUG
15
16 /* Allow various special stuff (sound, graphics, etc.) */
17 #define USE_SPECIAL
18
19 #ifndef HAVE_CONFIG_H
20 #ifdef JP
21 #define USE_FONTSET
22 #define USE_XIM
23 #endif
24
25 #if defined(USE_FONTSET) || defined(USE_XIM)
26 #define USE_LOCALE
27 #endif
28
29 #ifndef USE_FONTSET
30 #define _JP
31 #endif
32 #endif /* HAVE_CONFIG_H */
33
34
35 /*
36  * Look through the following lines, and where a comment includes the
37  * tag "OPTION:", examine the associated "#define" statements, and decide
38  * whether you wish to keep, comment, or uncomment them.  You should not
39  * have to modify any lines not indicated by "OPTION".
40  *
41  * Note: Also examine the "system" configuration file "h-config.h"
42  * and the variable initialization file "variable.c".  If you change
43  * anything in "variable.c", you only need to recompile that file.
44  *
45  * And finally, remember that the "Makefile" will specify some rather
46  * important compile time options, like what visual module to use.
47  */
48
49
50 /*
51  * OPTION: See the Makefile(s), where several options may be declared.
52  *
53  * Some popular options include "USE_GCU" (allow use with Unix "curses"),
54  * "USE_X11" (allow basic use with Unix X11), "USE_XAW" (allow use with
55  * Unix X11 plus the Athena Widget set), and "USE_CAP" (allow use with
56  * the "termcap" library, or with hard-coded vt100 terminals).
57  *
58  * The old "USE_NCU" option has been replaced with "USE_GCU".
59  *
60  * Several other such options are available for non-unix machines,
61  * such as "MACINTOSH", "WINDOWS", "USE_IBM", "USE_EMX".
62  *
63  * You may also need to specify the "system", using defines such as
64  * "SOLARIS" (for Solaris), etc, see "h-config.h" for more info.
65  */
66
67
68 /*
69  * OPTION: define "SPECIAL_BSD" for using certain versions of UNIX
70  * that use the 4.4BSD Lite version of Curses in "main-gcu.c"
71  */
72 /* #define SPECIAL_BSD */
73
74
75 /*
76  * OPTION: Use the POSIX "termios" methods in "main-gcu.c"
77  */
78 /* #define USE_TPOSIX */
79
80 /*
81  * OPTION: Use the "termio" methods in "main-gcu.c"
82  */
83 /* #define USE_TERMIO */
84
85 /*
86  * OPTION: Use the icky BSD "tchars" methods in "main-gcu.c"
87  */
88 /* #define USE_TCHARS */
89
90
91 /*
92  * OPTION: Use "blocking getch() calls" in "main-gcu.c".
93  * Hack -- Note that this option will NOT work on many BSD machines
94  * Currently used whenever available, if you get a warning about
95  * "nodelay()" undefined, then make sure to undefine this.
96  */
97 #if defined(SYS_V) || defined(AMIGA)
98 # define USE_GETCH
99 #endif
100
101
102 /*
103  * OPTION: Use the "curs_set()" call in "main-gcu.c".
104  * Hack -- This option will not work on most BSD machines
105  */
106 #ifdef SYS_V
107 # define USE_CURS_SET
108 #endif
109
110
111 /*
112  * OPTION: Include "ncurses.h" instead of "curses.h" in "main-gcu.c"
113  */
114 /* #define USE_NCURSES */
115
116
117 /*
118  * OPTION: for multi-user machines running the game setuid to some other
119  * user (like 'games') this SAFE_SETUID option allows the program to drop
120  * its privileges when saving files that allow for user specified pathnames.
121  * This lets the game be installed system wide without major security
122  * concerns.  There should not be any side effects on any machines.
123  *
124  * This will handle "gids" correctly once the permissions are set right.
125  */
126 #define SAFE_SETUID
127
128
129 /*
130  * This flag enables the "POSIX" methods for "SAFE_SETUID".
131  */
132 #ifdef _POSIX_SAVED_IDS
133 # define SAFE_SETUID_POSIX
134 #endif
135
136
137 /*
138  * Prevent problems on (non-Solaris) Suns using "SAFE_SETUID".
139  * The SAFE_SETUID code is weird, use it at your own risk...
140  */
141 #if defined(SUNOS) && !defined(SOLARIS)
142 # undef SAFE_SETUID_POSIX
143 #endif
144
145
146
147
148 /*
149  * OPTION: for the AFS distributed file system, define this to ensure that
150  * the program is secure with respect to the setuid code.  This option has
151  * not been tested (to the best of my knowledge).  This option may require
152  * some weird tricks with "player_uid" and such involving "defines".
153  * Note that this option used the AFS library routines Authenticate(),
154  * bePlayer(), beGames() to enforce the proper priviledges.
155  * You may need to turn "SAFE_SETUID" off to use this option.
156  */
157 /* #define SECURE */
158
159
160
161
162 /*
163  * OPTION: Verify savefile Checksums (Angband 2.7.0 and up)
164  * This option can help prevent "corruption" of savefiles, and also
165  * stop intentional modification by amateur users.
166  */
167 #define VERIFY_CHECKSUMS
168
169
170 /*
171  * OPTION: Forbid the use of "fiddled" savefiles.  As far as I can tell,
172  * a fiddled savefile is one with an internal timestamp different from
173  * the actual timestamp.  Thus, turning this option on forbids one from
174  * copying a savefile to a different name.  Combined with disabling the
175  * ability to save the game without quitting, and with some method of
176  * stopping the user from killing the process at the tombstone screen,
177  * this should prevent the use of backup savefiles.  It may also stop
178  * the use of savefiles from other platforms, so be careful.
179  */
180 /* #define VERIFY_TIMESTAMP */
181
182
183 /*
184  * OPTION: Forbid the "savefile over-write" cheat, in which you simply
185  * run another copy of the game, loading a previously saved savefile,
186  * and let that copy over-write the "dead" savefile later.  This option
187  * either locks the savefile, or creates a fake "xxx.lok" file to prevent
188  * the use of the savefile until the file is deleted.  Not ready yet.
189  */
190 /* #define VERIFY_SAVEFILE */
191
192
193
194 /*
195  * OPTION: Hack -- Compile in support for "Cyborg" mode
196  */
197 /*#define ALLOW_BORG*/
198
199 #ifdef USE_DEBUG
200
201 /*
202  * OPTION: Hack -- Compile in support for "Wizard Commands"
203  */
204 #define ALLOW_WIZARD
205
206 /*
207  * OPTION: Hack -- Compile in support for "Spoiler Generation"
208  */
209 #define ALLOW_SPOILERS
210
211 #endif /* USE_DEBUG */
212
213 /*
214  * OPTION: Allow "do_cmd_colors" at run-time
215  */
216 #define ALLOW_COLORS
217
218 /*
219  * OPTION: Allow "do_cmd_visuals" at run-time
220  */
221 #define ALLOW_VISUALS
222
223 /*
224  * OPTION: Allow "do_cmd_macros" at run-time
225  */
226 #define ALLOW_MACROS
227
228 /*
229  * OPTION: Allow characteres to be "auto-rolled"
230  */
231 #define ALLOW_AUTOROLLER
232
233
234 /*
235  * OPTION: Allow monsters to "flee" when hit hard
236  */
237 #define ALLOW_FEAR
238
239 /*
240  * OPTION: Allow monsters to "flee" from strong players
241  */
242 #define ALLOW_TERROR
243
244
245 /*
246  * OPTION: Allow parsing of the ascii template files in "init.c".
247  * This must be defined if you do not have valid binary image files.
248  * It should be usually be defined anyway to allow easy "updating".
249  */
250 #define ALLOW_TEMPLATES
251
252 /*
253  * OPTION: Allow loading of pre-2.7.0 savefiles.  Note that it takes
254  * about 15K of code in "save-old.c" to parse the old savefile format.
255  * Angband 2.8.0 will ignore a lot of info from pre-2.7.0 savefiles.
256  */
257 #define ALLOW_OLD_SAVEFILES
258
259
260 /*
261  * OPTION: Delay the loading of the "f_text" array until it is actually
262  * needed, saving ~1K, since "feature" descriptions are unused.
263  */
264 #define DELAY_LOAD_F_TEXT
265
266 /*
267  * OPTION: Delay the loading of the "k_text" array until it is actually
268  * needed, saving ~1K, since "object" descriptions are unused.
269  */
270 #define DELAY_LOAD_K_TEXT
271
272 /*
273  * OPTION: Delay the loading of the "a_text" array until it is actually
274  * needed, saving ~1K, since "artifact" descriptions are unused.
275  */
276 #ifndef JP
277 #define DELAY_LOAD_A_TEXT
278 #endif
279
280 /*
281  * OPTION: Delay the loading of the "e_text" array until it is actually
282  * needed, saving ~1K, since "ego-item" descriptions are unused.
283  */
284 #define DELAY_LOAD_E_TEXT
285
286 /*
287  * OPTION: Delay the loading of the "r_text" array until it is actually
288  * needed, saving ~60K, but "simplifying" the "monster" descriptions.
289  */
290 /* #define DELAY_LOAD_R_TEXT */
291
292 /*
293  * OPTION: Delay the loading of the "d_text" array until it is actually
294  * needed, saving ~1K, since "dungeon" descriptions are unused.
295  */
296 /* #define DELAY_LOAD_D_TEXT */
297
298 /*
299  * OPTION: Delay the loading of the "v_text" array until it is actually
300  * needed, saving ~1K, but "destroying" the "vault" generation.
301  */
302 /* #define DELAY_LOAD_V_TEXT */
303
304
305 /*
306  * OPTION: Handle signals
307  */
308 #define HANDLE_SIGNALS
309
310
311 /*
312  * Allow "Wizards" to yield "high scores"
313  */
314 /* #define SCORE_WIZARDS */
315
316 /*
317  * Allow "Borgs" to yield "high scores"
318  */
319 /*#define SCORE_BORGS*/
320
321 /*
322  * Allow "Cheaters" to yield "high scores"
323  */
324 /* #define SCORE_CHEATERS */
325
326
327
328 /*
329  * OPTION: Maximum flow depth when using "MONSTER_FLOW"
330  */
331 #define MONSTER_FLOW_DEPTH 32
332
333
334
335 /*
336  * OPTION: Allow use of extended spell info     -DRS-
337  */
338 #define DRS_SHOW_SPELL_INFO
339
340 /*
341  * OPTION: Allow use of the monster health bar  -DRS-
342  */
343 #define DRS_SHOW_HEALTH_BAR
344
345
346 /*
347  * OPTION: Enable the "smart_learn" and "smart_cheat" options.
348  * They let monsters make more "intelligent" choices about attacks
349  * (including spell attacks) based on their observations of the
350  * player's reactions to previous attacks.  The "smart_cheat" option
351  * lets the monster know how the player would react to an attack
352  * without actually needing to make the attack.  The "smart_learn"
353  * option requires that a monster make a "failed" attack before
354  * learning that the player is not harmed by that attack.
355  *
356  * This adds about 3K to the memory and about 5K to the executable.
357  *
358  * SPECIAL NOTE: In Z, the "smart" field is also used to store such
359  * monster information as "friendly" and "cloned". Therefore this
360  * option should always be defined when compiling Zangband 2.1.0
361  * or later.
362  */
363 #define DRS_SMART_OPTIONS
364
365
366
367 /*
368  * OPTION: Enable the "track_follow" and "track_target" options.
369  * They let monsters follow the player's foot-prints, or remember
370  * the player's recent locations.  This code has been removed from
371  * the current version because it is being rewritten by Billy, and
372  * until it is ready, it will not work.  Do not define this option.
373  */
374 /* #define WDT_TRACK_OPTIONS */
375
376 #ifdef USE_SPECIAL
377
378 /*
379  * OPTION: Allow the use of "sound" in various places.
380  */
381 #define USE_SOUND
382
383 /*
384  * OPTION: Allow the use of "graphics" in various places
385  */
386 #define USE_GRAPHICS
387
388 /*
389  * OPTION: Allow the use of "music" in various places
390  */
391 /* #define USE_MUSIC */
392
393 #endif /* USE_SPECIAL */
394
395 /*
396  * OPTION: Hack -- Macintosh stuff
397  */
398 #ifdef MACINTOSH
399
400 /* Do not handle signals */
401 # undef HANDLE_SIGNALS
402
403 #endif
404
405
406 /*
407  * OPTION: Hack -- Windows stuff
408  */
409 #ifdef WINDOWS
410
411 /* Do not handle signals */
412 # undef HANDLE_SIGNALS
413
414 #endif
415
416
417 /*
418  * OPTION: Hack -- EMX stuff
419  */
420 #ifdef USE_EMX
421
422 /* Do not handle signals */
423 # undef HANDLE_SIGNALS
424
425 #endif
426
427
428 /*
429  * OPTION: Set the "default" path to the angband "lib" directory.
430  *
431  * See "main.c" for usage, and note that this value is only used on
432  * certain machines, primarily Unix machines.  If this value is used,
433  * it will be over-ridden by the "ANGBAND_PATH" environment variable,
434  * if that variable is defined and accessable.  The final slash is
435  * optional, but it may eventually be required.
436  *
437  * Using the value "./lib/" below tells Angband that, by default,
438  * the user will run "angband" from the same directory that contains
439  * the "lib" directory.  This is a reasonable (but imperfect) default.
440  *
441  * If at all possible, you should change this value to refer to the
442  * actual location of the "lib" folder, for example, "/tmp/angband/lib/"
443  * or "/usr/games/lib/angband/", or "/pkg/angband/lib".
444  */
445 #ifndef DEFAULT_PATH
446 # define DEFAULT_PATH "./lib/"
447 #endif
448
449
450 /*
451  * OPTION: Create and use a hidden directory in the users home directory
452  * for storing pref-files and character-dumps.
453  */
454 #ifdef SET_UID
455 #define PRIVATE_USER_PATH "~/.angband"
456 #endif /* SET_UID */
457
458
459 /*
460  * On multiuser systems, add the "uid" to savefile names
461  */
462 #ifdef SET_UID
463 # define SAVEFILE_USE_UID
464 #endif
465
466
467 /*
468  * OPTION: Check the "time" against "lib/file/hours.txt"
469  */
470 /* #define CHECK_TIME */
471
472 /*
473  * OPTION: Check the "load" against "lib/file/load.txt"
474  * This may require the 'rpcsvs' library
475  */
476 /* #define CHECK_LOAD */
477
478
479 /*
480  * OPTION: For some brain-dead computers with no command line interface,
481  * namely Macintosh, there has to be some way of "naming" your savefiles.
482  * The current "Macintosh" hack is to make it so whenever the character
483  * name changes, the savefile is renamed accordingly.  But on normal
484  * machines, once you manage to "load" a savefile, it stays that way.
485  * Macintosh is particularly weird because you can load savefiles that
486  * are not contained in the "lib:save:" folder, and if you change the
487  * player's name, it will then save the savefile elsewhere.  Note that
488  * this also gives a method of "bypassing" the "VERIFY_TIMESTAMP" code.
489  */
490 /*
491 #if defined(MACINTOSH) || defined(WINDOWS) || defined(AMIGA)
492 # define SAVEFILE_MUTABLE
493 #endif
494 */
495
496 /*
497  * OPTION: Capitalize the "user_name" (for "default" player name)
498  * This option is only relevant on SET_UID machines.
499  */
500 #define CAPITALIZE_USER_NAME
501
502
503
504 /*
505  * OPTION: Person to bother if something goes wrong.
506  */
507 /* #define MAINTAINER   "rr9@angband.org" */
508 #define MAINTAINER      "echizen@s5.xrea.com"
509
510
511 #ifdef JP
512 #ifndef USE_FONTSET
513 /*
514  * OPTION: Default font (when using X11).
515  */
516 #define DEFAULT_X11_FONT  "a24"
517 #define DEFAULT_X11_KFONT "kanji24"
518 #define DEFAULT_X11_FONT_SUB  "a16"
519 #define DEFAULT_X11_KFONT_SUB "kanji16"
520
521
522 /*
523  * OPTION: Default fonts (when using X11)
524  */
525 #define DEFAULT_X11_FONT_0  DEFAULT_X11_FONT
526 #define DEFAULT_X11_KFONT_0 DEFAULT_X11_KFONT
527 #define DEFAULT_X11_FONT_1  DEFAULT_X11_FONT_SUB
528 #define DEFAULT_X11_KFONT_1 DEFAULT_X11_KFONT_SUB
529 #define DEFAULT_X11_FONT_2  DEFAULT_X11_FONT_SUB
530 #define DEFAULT_X11_KFONT_2 DEFAULT_X11_KFONT_SUB
531 #define DEFAULT_X11_FONT_3  DEFAULT_X11_FONT_SUB
532 #define DEFAULT_X11_KFONT_3 DEFAULT_X11_KFONT_SUB
533 #define DEFAULT_X11_FONT_4  DEFAULT_X11_FONT_SUB
534 #define DEFAULT_X11_KFONT_4 DEFAULT_X11_KFONT_SUB
535 #define DEFAULT_X11_FONT_5  DEFAULT_X11_FONT_SUB
536 #define DEFAULT_X11_KFONT_5 DEFAULT_X11_KFONT_SUB
537 #define DEFAULT_X11_FONT_6  DEFAULT_X11_FONT_SUB
538 #define DEFAULT_X11_KFONT_6 DEFAULT_X11_KFONT_SUB
539 #define DEFAULT_X11_FONT_7  DEFAULT_X11_FONT_SUB
540 #define DEFAULT_X11_KFONT_7 DEFAULT_X11_KFONT_SUB
541
542 #else
543 /*
544  * OPTION: Default font (when using X11).
545  */
546 #define DEFAULT_X11_FONT \
547         "-*-*-medium-r-normal--24-*-*-*-*-*-iso8859-1" \
548         ",-*-*-medium-r-normal--24-*-*-*-*-*-jisx0208.1983-0"
549 /*      "12x24" \
550         ",kanji24"*/
551 #define DEFAULT_X11_FONT_SUB \
552         "-*-*-medium-r-normal--16-*-*-*-*-*-iso8859-1" \
553         ",-*-*-medium-r-normal--16-*-*-*-*-*-jisx0208.1983-0"
554 /*      "8x16" \
555         ",kanji16"*/
556
557 /*
558  * OPTION: Default fonts (when using X11)
559  */
560 #define DEFAULT_X11_FONT_0              DEFAULT_X11_FONT
561 #define DEFAULT_X11_FONT_1              DEFAULT_X11_FONT_SUB
562 #define DEFAULT_X11_FONT_2              DEFAULT_X11_FONT_SUB
563 #define DEFAULT_X11_FONT_3              DEFAULT_X11_FONT_SUB
564 #define DEFAULT_X11_FONT_4              DEFAULT_X11_FONT_SUB
565 #define DEFAULT_X11_FONT_5              DEFAULT_X11_FONT_SUB
566 #define DEFAULT_X11_FONT_6              DEFAULT_X11_FONT_SUB
567 #define DEFAULT_X11_FONT_7              DEFAULT_X11_FONT_SUB
568 #endif
569
570 #else
571 /*
572  * OPTION: Default font (when using X11).
573  */
574 #define DEFAULT_X11_FONT                "9x15"
575
576 /*
577  * OPTION: Default fonts (when using X11)
578  */
579 #define DEFAULT_X11_FONT_0              "10x20"
580 #define DEFAULT_X11_FONT_1              "9x15"
581 #define DEFAULT_X11_FONT_2              "9x15"
582 #define DEFAULT_X11_FONT_3              "5x8"
583 #define DEFAULT_X11_FONT_4              "5x8"
584 #define DEFAULT_X11_FONT_5              "5x8"
585 #define DEFAULT_X11_FONT_6              "5x8"
586 #define DEFAULT_X11_FONT_7              "5x8"
587 #endif
588
589
590 /*
591  * OPTION: Gamma correct X11 colours.
592  */
593  
594 #define SUPPORT_GAMMA
595
596 /*
597  * Hack -- Special "ancient machine" versions
598  */
599 #if defined(USE_286) || defined(ANGBAND_LITE_MAC)
600 # ifndef ANGBAND_LITE
601 #  define ANGBAND_LITE
602 # endif
603 #endif
604
605 /*
606  * OPTION: Attempt to minimize the size of the game
607  */
608 #ifndef ANGBAND_LITE
609 /* #define ANGBAND_LITE */
610 #endif
611
612 /*
613  * Hack -- React to the "ANGBAND_LITE" flag
614  */
615 #ifdef ANGBAND_LITE
616 # undef ALLOW_COLORS
617 # undef ALLOW_VISUALS
618 # undef ALLOW_MACROS
619 # undef WDT_TRACK_OPTIONS
620 # undef DRS_SMART_OPTIONS
621 # undef ALLOW_OLD_SAVEFILES
622 # undef ALLOW_BORG
623 # undef ALLOW_WIZARD
624 # undef ALLOW_SPOILERS
625 # undef ALLOW_TEMPLATES
626 # undef DELAY_LOAD_R_TEXT
627 # define DELAY_LOAD_R_TEXT
628 #endif
629
630
631
632 /*
633  * OPTION: Attempt to prevent all "cheating"
634  */
635 /* #define VERIFY_HONOR */
636
637
638 /*
639  * React to the "VERIFY_HONOR" flag
640  */
641 #ifdef VERIFY_HONOR
642 # define VERIFY_SAVEFILE
643 # define VERIFY_CHECKSUMS
644 # define VERIFY_TIMESTAMPS
645 #endif
646
647 /* Zangband options: */
648
649 /* (see above) */
650 #ifndef DRS_SMART_OPTIONS
651  #define DRS_SMART_OPTIONS
652 #endif
653
654 /* Do we want different characters for different races? */
655 # define VARIABLE_PLAYER_GRAPH
656
657 /* Allow hordes of 'similar' monsters */
658 # define MONSTER_HORDES
659
660 /* Wizard mode testing options: */
661
662 /* Testing upkeep */
663 /* # define TRACK_FRIENDS */
664
665 /*
666  * OPTION: Repeat last command -- TNB
667  */
668 #define ALLOW_REPEAT
669
670 /*
671  * OPTION: Make opening and closing things easy -- TNB
672  */
673 #define ALLOW_EASY_OPEN
674
675 /*
676  * OPTION: Make disarming traps easy -- TNB
677  */
678 #define ALLOW_EASY_DISARM
679
680 /*
681  * OPTION: Make floor stacks easy -- TNB
682  */
683 #define ALLOW_EASY_FLOOR
684
685 /*
686  * Check the modification time of *_info.raw files
687  * (by Keldon Jones)
688  */
689 #define CHECK_MODIFICATION_TIME
690
691 /*
692  * Use the new sorting routines for creation
693  * of the monster allocation table
694  */
695 #define SORT_R_INFO
696
697 /*
698  * Use a scripting language
699  */
700 /* #define USE_SCRIPT */
701
702 #ifdef USE_SCRIPT
703 /*
704  * Python is statically linked into ZAngband
705  */
706 # define STATIC_PYTHON
707 /* # define SCRIPT_OBJ_KIND */
708 #endif /* USE_SCRIPT */
709
710 /*
711  * The Frakir can predict danger when equipped
712  */
713 #define USE_FRAKIR
714
715 #ifndef HAVE_CONFIG_H
716 #ifndef MSDOS
717 #define WORLD_SCORE
718 #endif
719 #endif /* HAVE_CONFIG_H */