OSDN Git Service

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