Expand windsound to support SNDCAP_USERSOUNDS (existing),
SNDCAP_SOUNDEFFECTS, SNDCAP_HEROMUSIC.
Place a small number of wav files into sound/wav that are considered
more specific to some game stuff in the core, namely: playing
instruments by the hero, squeaky board traps. The intention is that
those ones can be integrated into the game without requiring user
file deposits or mappings. Building soundlib support for sound/windsound
searches for them as resources, so they should "just work."
No actual instrument playback is available in the base sound/windsound
soundlib implementation (yet, at least), so it works around that in
a cheap way by using the note-variant wav sounds to concoct the
notes. There are better ways of doing music generation than that,
of course, but this will do in the early going. Any other soundlib
port (such as Qt) can probably easily do the exact same thing. If it
can play USER_SOUNDS, it can almost certainly use the
sound/wav/se_squeak*.wav and sound/wav/sound_*.wav files for
SND_HEROMUSIC and squeaky board sounds soundeffects.
A few of the se_ sounds in sound/wav are free yet licensed, and
there is a file called attributions.txt to meticulously attempt
to comply with the two license variations involved.
SND_SOUNDEFFECTS_AUTOMAP
If SND_SOUNDEFFECTS_AUTOMAP is defined, and a SND_LIB_ interface
that supports SNDPROC_SOUNDEFFECTS is also defined to integrate
soundlib support, the following gets added:
o If sounddir is defined (existing longstanding feature that's
been used with USER_SOUNDS for many, many years) any wav file
present in SOUNDDIR with a name that matches one of the defined
sound effects in include/sndproc.h will get played each time
that soundeffect comes up. So, just drop appropriate wav files
into sounddir and rename it to match.
No tedious config file entries are required to get soundeffects.
[ The only config file change required is to
set SOUNDDIR to point to your directory with the wav files.
Note: SOUNDDIR only works in your config file if NetHack
was built with USER_SOUNDS defined. ]
This is new so there may certainly be some bugs in here.
Please kindly report them if you encounter any.
For those that don't read C very well, these are the file names
that should trigger the SOUNDEFFECTS_AUTOMAP, assuming it is working.
se_faint_splashing.wav
se_crackling_of_hellfire.wav
se_heart_beat.wav
se_typing_noise.wav
se_hollow_sound.wav
se_rustling_paper.wav
se_crushing_sound.wav
se_splash.wav
se_chains_rattling_gears_turning.wav
se_smashing_and_crushing.wav
se_gears_turning_chains_rattling.wav
se_loud_splash.wav
se_lound_crash.wav
se_crashing_rock.wav
se_sizzling.wav
se_crashing_boulder.wav
se_boulder_drop.wav
se_item_tumble_downwards.wav
se_drain_noises.wav
se_ring_in_drain.wav
se_groans_and_moans.wav
se_scratching.wav
se_glass_shattering.wav
se_egg_cracking.wav
se_gushing_sound.wav
se_glass_crashing.wav
se_egg_splatting.wav
se_sinister_laughter.wav
se_blast.wav
se_stone_breaking.wav
se_stone_crumbling.wav
se_snakes_hissing.wav
se_loud_pop.wav
se_clanking_pipe.wav
se_sewer_song.wav
se_monster_behind_boulder.wav
se_wailing_of_the_banshee.wav
se_swoosh.wav
se_explosion.wav
se_crashing_sound.wav
se_someone_summoning.wav
se_rushing_wind_noise.wav
se_splat_from_engulf.wav
se_faint_sloshing.wav
se_crunching_sound.wav
se_slurping_sound.wav
se_masticating_sound.wav
se_distant_thunder.wav
se_applause.wav
se_shrill_whistle.wav
se_someone_yells.wav
se_door_unlock_and_open.wav
se_door_open.wav
se_door_crash_open.wav
se_dry_throat_rattle.wav
se_cough.wav
se_angry_snakes.wav
se_zap_then_explosion.wav
se_zap.wav
se_horn_being_played.wav
se_mon_chugging_potion.wav
se_bugle_playing_reveille.wav
se_crash_through_floor.wav
se_thump.wav
se_scream.wav
se_tumbler_click.wav
se_gear_turn.wav
se_divine_music.wav
se_thunderclap.wav
se_sad_wailing.wav
se_maniacal_laughter.wav
se_rumbling_of_earth.wav
se_clanging_sound.wav
se_mutter_imprecations.wav
se_mutter_incantation.wav
se_angry_voice.wav
se_sceptor_pounding.wav
se_courtly_conversation.wav
se_low_buzzing.wav
se_angry_drone.wav
se_bees.wav
se_someone_searching.wav
se_guards_footsteps.wav
se_faint_chime.wav
se_loud_click.wav
se_soft_click.wav
se_squeak.wav
se_squeak_C.wav
se_squeak_D_flat.wav
se_squeak_D.wav
se_squeak_E_flat.wav
se_squeak_E.wav
se_squeak_F.wav
se_squeak_F_sharp.wav
se_squeak_G.wav
se_squeak_G_sharp.wav
se_squeak_A.wav
se_squeak_B_flat.wav
se_squeak_B.wav
se_someone_bowling.wav
se_rumbling.wav
se_loud_crash.wav
se_deafening_roar_atmospheric.wav
se_low_hum.wav
se_laughter.wav
se_cockatrice_hiss.wav
se_chant.wav
se_cracking_sound.wav
se_ripping_sound.wav
se_thud.wav
se_clank.wav
se_crumbling_sound.wav
se_soft_crackling.wav
se_crackling.wav
se_sharp_crack.wav
se_wall_of_force.wav
se_alarm.wav
se_kick_door_it_shatters.wav
se_kick_door_it_crashes_open.wav
se_bubble_rising.wav
se_bolt_of_lightning.wav
se_board_squeak.wav
se_board_squeaks_loudly.wav
se_boing.wav
se_crashed_ceiling.wav
se_clash.wav
se_crash_door.wav
se_crash.wav
se_crash_throne_destroyed.wav
se_crash_something_broke.wav
se_kadoom_boulder_falls_in.wav
se_klunk_pipe.wav
se_kerplunk_boulder_gone.wav
se_klunk.wav
se_klick.wav
se_kaboom_door_explodes.wav
se_kaboom_boom_boom.wav
se_kaablamm_of_mine.wav
se_kaboom.wav
se_splat_egg.wav
se_destroy_web.wav
se_iron_ball_dragging_you.wav
se_iron_ball_hits_you.wav
se_lid_slams_open_falls_shut.wav
se_chain_shatters.wav
se_furious_bubbling.wav
se_air_crackles.wav
se_potion_crash_and_break.wav
se_hiss.wav
se_growl.wav
se_canine_bark.wav
se_canine_growl.wav
se_canine_whine.wav
se_canine_yip.wav
se_canine_howl.wav
se_feline_yowl.wav
se_feline_meow.wav
se_feline_purr.wav
se_feline_yip.wav
se_feline_mew.wav
se_roar.wav
se_snarl.wav
se_buzz.wav
se_squeek.wav
se_squawk.wav
se_squeal.wav
se_screech.wav
se_equine_neigh.wav
se_equine_whinny.wav
se_equine_whicker.wav
se_bovine_moo.wav
se_bovine_bellow.wav
se_wail.wav
se_groan.wav
se_grunt.wav
se_gurgle.wav
se_elephant_trumpet.wav
se_snake_rattle.wav
se_hallu_growl.wav
This needs further testing. At the moment only windsound has
this.
If nobody else looks into it for Qt, I'll take a look in a
few days.
311 lines
9.2 KiB
C
311 lines
9.2 KiB
C
/* NetHack 3.7 windconf.h $NHDT-Date: 1596498552 2020/08/03 23:49:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.89 $ */
|
|
/* Copyright (c) NetHack PC Development Team 1993, 1994. */
|
|
/* NetHack may be freely redistributed. See license for details. */
|
|
|
|
#ifndef WINDCONF_H
|
|
#define WINDCONF_H
|
|
|
|
/* #define SHELL */ /* nt use of pcsys routines caused a hang */
|
|
|
|
#define TEXTCOLOR /* Color text */
|
|
|
|
#define EXEPATH /* Allow .exe location to be used as HACKDIR */
|
|
#define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */
|
|
|
|
#define LAN_FEATURES /* Include code for lan-aware features. Untested in \
|
|
3.4.0*/
|
|
|
|
#define PC_LOCKING /* Prevent overwrites of aborted or in-progress games */
|
|
/* without first receiving confirmation. */
|
|
|
|
#define SELF_RECOVER /* Allow the game itself to recover from an aborted \
|
|
game */
|
|
|
|
#define SYSCF /* Use a global configuration */
|
|
#define SYSCF_FILE "sysconf" /* Use a file to hold the SYSCF configuration */
|
|
|
|
#define DUMPLOG /* Enable dumplog files */
|
|
/*#define DUMPLOG_FILE "nethack-%n-%d.log"*/
|
|
#define DUMPLOG_MSG_COUNT 50
|
|
|
|
/*#define CHANGE_COLOR*/ /* allow palette changes */
|
|
|
|
#define QWERTZ_SUPPORT /* when swap_yz is True, numpad 7 is 'z' not 'y' */
|
|
|
|
#define OPTIONS_AT_RUNTIME /* build info done at runtime not text file */
|
|
|
|
/*
|
|
* -----------------------------------------------------------------
|
|
* The remaining code shouldn't need modification.
|
|
* -----------------------------------------------------------------
|
|
*/
|
|
/* #define SHORT_FILENAMES */ /* All NT filesystems support long names now
|
|
*/
|
|
|
|
#ifdef DLB
|
|
#define VERSION_IN_DLB_FILENAME /* Append version digits to nhdat */
|
|
#endif
|
|
|
|
#ifdef MICRO
|
|
#undef MICRO /* never define this! */
|
|
#endif
|
|
|
|
#define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that \
|
|
it is defined for WIN32. \
|
|
Allow paths to be specified for HACKDIR, \
|
|
LEVELDIR, SAVEDIR, BONESDIR, DATADIR, \
|
|
SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
|
|
#define NO_TERMS
|
|
#define ASCIIGRAPH
|
|
|
|
#ifdef OPTIONS_USED
|
|
#undef OPTIONS_USED
|
|
#endif
|
|
#define OPTIONS_USED "options"
|
|
#define OPTIONS_FILE OPTIONS_USED
|
|
|
|
#define PORT_HELP "porthelp"
|
|
|
|
#define PORT_DEBUG /* include ability to debug international keyboard issues \
|
|
*/
|
|
|
|
#define RUNTIME_PORT_ID /* trigger run-time port identification for \
|
|
* identification of exe CPU architecture \
|
|
*/
|
|
#define RUNTIME_PASTEBUF_SUPPORT
|
|
|
|
|
|
#define SAFERHANGUP /* Define SAFERHANGUP to delay hangup processing \
|
|
* until the main command loop. 'safer' because it \
|
|
* avoids certain cheats and also avoids losing \
|
|
* objects being thrown when the hangup occurs. \
|
|
*/
|
|
|
|
#define CONFIG_FILE ".nethackrc"
|
|
#define CONFIG_TEMPLATE ".nethackrc.template"
|
|
#define SYSCF_TEMPLATE "sysconf.template"
|
|
#define SYMBOLS_TEMPLATE "symbols.template"
|
|
#define GUIDEBOOK_FILE "Guidebook.txt"
|
|
|
|
/* Stuff to help the user with some common, yet significant errors */
|
|
#define INTERJECT_PANIC 0
|
|
#define INTERJECTION_TYPES (INTERJECT_PANIC + 1)
|
|
extern void interject_assistance(int, int, genericptr_t, genericptr_t);
|
|
extern void interject(int);
|
|
|
|
#if defined(SND_LIB_WINDSOUND)
|
|
#define SND_SOUNDEFFECTS_AUTOMAP
|
|
#endif
|
|
|
|
/*
|
|
*===============================================
|
|
* Compiler-specific adjustments
|
|
*===============================================
|
|
*/
|
|
|
|
#ifdef __MINGW32__
|
|
#if 0
|
|
#define MD_USE_TMPFILE_S
|
|
#if !defined(__cplusplus)
|
|
extern errno_t tmpfile_s(FILE * restrict * restrict streamptr);
|
|
#endif
|
|
#endif
|
|
#
|
|
#ifdef strncasecmp
|
|
#undef strncasecmp
|
|
#endif
|
|
#ifdef strcasecmp
|
|
#undef strcasecmp
|
|
/* https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/ */
|
|
#ifdef __USE_MINGW_ANSI_STDIO
|
|
#undef __USE_MINGW_ANSI_STDIO
|
|
#endif
|
|
#define __USE_MINGW_ANSI_STDIO 1
|
|
#endif
|
|
/* extern int getlock(void); */
|
|
#endif
|
|
|
|
#ifdef _MSC_VER
|
|
#define MD_USE_TMPFILE_S
|
|
#define HAS_STDINT
|
|
#if (_MSC_VER > 1000)
|
|
/* Visual C 8 warning elimination */
|
|
#ifndef _CRT_SECURE_NO_DEPRECATE
|
|
#define _CRT_SECURE_NO_DEPRECATE
|
|
#endif
|
|
#ifndef _SCL_SECURE_NO_DEPRECATE
|
|
#define _SCL_SECURE_NO_DEPRECATE
|
|
#endif
|
|
#ifndef _CRT_NONSTDC_NO_DEPRECATE
|
|
#define _CRT_NONSTDC_NO_DEPRECATE
|
|
#endif
|
|
#pragma warning(disable : 4996) /* VC8 deprecation warnings */
|
|
#pragma warning(disable : 4142) /* benign redefinition */
|
|
#pragma warning(disable : 4267) /* conversion from 'size_t' to XX */
|
|
#if (_MSC_VER > 1600)
|
|
#pragma warning(disable : 4459) /* hide global declaration */
|
|
#endif /* _MSC_VER > 1600 */
|
|
#endif /* _MSC_VER > 1000 */
|
|
#pragma warning(disable : 4761) /* integral size mismatch in arg; conv \
|
|
supp*/
|
|
#ifdef YYPREFIX
|
|
#pragma warning(disable : 4102) /* unreferenced label */
|
|
#endif
|
|
#ifdef __cplusplus
|
|
/* suppress a warning in cppregex.cpp */
|
|
#pragma warning(disable : 4101) /* unreferenced local variable */
|
|
#endif
|
|
#ifndef HAS_STDINT_H
|
|
#define HAS_STDINT_H /* force include of stdint.h in integer.h */
|
|
#endif
|
|
/* Turn on some additional warnings */
|
|
#pragma warning(3:4389)
|
|
|
|
/* supply ssize_t */
|
|
#include <BaseTsd.h>
|
|
typedef SSIZE_T ssize_t;
|
|
|
|
#endif /* _MSC_VER */
|
|
|
|
/* The following is needed for prototypes of certain functions */
|
|
#if defined(_MSC_VER)
|
|
#include <process.h> /* Provides prototypes of exit(), spawn() */
|
|
#endif
|
|
|
|
#include <string.h> /* Provides prototypes of strncmpi(), etc. */
|
|
#ifdef STRNCMPI
|
|
#define strncmpi(a, b, c) strnicmp(a, b, c)
|
|
#endif
|
|
|
|
|
|
#include <sys/types.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#ifdef __BORLANDC__
|
|
#undef randomize
|
|
#undef random
|
|
#endif
|
|
|
|
#define PATHLEN BUFSZ /* maximum pathlength */
|
|
#define FILENAME BUFSZ /* maximum filename length (conservative) */
|
|
|
|
#if defined(_MAX_PATH) && defined(_MAX_FNAME)
|
|
#if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
|
|
#undef PATHLEN
|
|
#undef FILENAME
|
|
#define PATHLEN _MAX_PATH
|
|
#define FILENAME _MAX_FNAME
|
|
#endif
|
|
#endif
|
|
|
|
#define NO_SIGNAL
|
|
|
|
/* Time stuff */
|
|
#include <time.h>
|
|
|
|
#define USE_STDARG
|
|
|
|
/* Use the high quality random number routines. */
|
|
#ifdef USE_ISAAC64
|
|
#undef RANDOM
|
|
#else
|
|
#define RANDOM
|
|
#define Rand() random()
|
|
#endif
|
|
|
|
/* Fall back to C's if nothing else, but this really isn't acceptable */
|
|
#if !defined(USE_ISAAC64) && !defined(RANDOM)
|
|
#define Rand() rand()
|
|
#endif
|
|
|
|
#include <sys/stat.h>
|
|
#define FCMASK (_S_IREAD | _S_IWRITE) /* file creation mask */
|
|
#define regularize nt_regularize
|
|
#define HLOCK "NHPERM"
|
|
|
|
#ifndef M
|
|
#define M(c) ((char) (0x80 | (c)))
|
|
/* #define M(c) ((c) - 128) */
|
|
#endif
|
|
|
|
#ifndef C
|
|
#define C(c) (0x1f & (c))
|
|
#endif
|
|
|
|
#if defined(DLB) || defined(_MSC_VER)
|
|
#define FILENAME_CMP stricmp /* case insensitive */
|
|
#endif
|
|
|
|
/* this was part of the MICRO stuff in the past */
|
|
extern const char *alllevels, *allbones;
|
|
#define ABORT C('a')
|
|
#define getuid() 1
|
|
#define getlogin() ((char *) 0)
|
|
extern void win32_abort(void);
|
|
extern void consoletty_preference_update(const char *);
|
|
extern void toggle_mouse_support(void);
|
|
extern void map_subkeyvalue(char *);
|
|
extern void set_altkeyhandling(const char *);
|
|
extern void raw_clear_screen(void);
|
|
|
|
#include <fcntl.h>
|
|
#ifndef __BORLANDC__
|
|
#include <io.h>
|
|
#include <direct.h>
|
|
#else
|
|
int _RTLENTRY _EXPFUNC access(const char _FAR *__path, int __amode);
|
|
int _RTLENTRY _EXPFUNC _chdrive(int __drive);
|
|
int _RTLENTRYF _EXPFUNC32 chdir(const char _FAR *__path);
|
|
char _FAR *_RTLENTRY _EXPFUNC getcwd(char _FAR *__buf, int __buflen);
|
|
int _RTLENTRY _EXPFUNC
|
|
write(int __handle, const void _FAR *__buf, unsigned __len);
|
|
int _RTLENTRY _EXPFUNC creat(const char _FAR *__path, int __amode);
|
|
int _RTLENTRY _EXPFUNC close(int __handle);
|
|
int _RTLENTRY _EXPFUNC _close(int __handle);
|
|
int _RTLENTRY _EXPFUNC
|
|
open(const char _FAR *__path, int __access, ... /*unsigned mode*/);
|
|
long _RTLENTRY _EXPFUNC lseek(int __handle, long __offset, int __fromwhere);
|
|
int _RTLENTRY _EXPFUNC read(int __handle, void _FAR *__buf, unsigned __len);
|
|
#endif
|
|
#ifndef CURSES_GRAPHICS
|
|
#include <conio.h> /* conflicting definitions with curses.h */
|
|
#endif
|
|
#undef kbhit /* Use our special NT kbhit */
|
|
#define kbhit (*nt_kbhit)
|
|
|
|
#ifdef LAN_FEATURES
|
|
#define MAX_LAN_USERNAME 20
|
|
#endif
|
|
|
|
#ifndef alloca
|
|
#define ALLOCA_HACK /* used in util/panic.c */
|
|
#endif
|
|
|
|
extern int set_win32_option(const char *, const char *);
|
|
#define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED
|
|
#define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
|
|
#define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED
|
|
#define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON)
|
|
#ifdef CHANGE_COLOR
|
|
extern int alternative_palette(char *);
|
|
#endif
|
|
|
|
#define nethack_enter(argc, argv) nethack_enter_windows()
|
|
ATTRNORETURN extern void nethack_exit(int) NORETURN;
|
|
extern boolean file_exists(const char *);
|
|
extern boolean file_newer(const char *, const char *);
|
|
#ifndef SYSTEM_H
|
|
#include "system.h"
|
|
#endif
|
|
|
|
/* Override the default version of nhassert. The default version is unable
|
|
* to generate a string form of the expression due to the need to be
|
|
* compatible with compilers which do not support macro stringization (i.e.
|
|
* #x to turn x into its string form).
|
|
*/
|
|
extern void nt_assert_failed(const char *, const char *, int);
|
|
#define nhassert(expression) (void)((!!(expression)) || \
|
|
(nt_assert_failed(#expression, __FILE__, __LINE__), 0))
|
|
|
|
#endif /* WINDCONF_H */
|