]> granicus.if.org Git - nethack/commitdiff
Only embed wav resources if soundlib defined
authornhmall <nhmall@nethack.org>
Tue, 31 Jan 2023 07:22:25 +0000 (02:22 -0500)
committernhmall <nhmall@nethack.org>
Tue, 31 Jan 2023 07:22:25 +0000 (02:22 -0500)
sys/windows/Makefile.nmake
sys/windows/console.rc
win/win32/NetHackW.rc

index 368e08cdfaee4811f2864015c333563d182e2eba..5e8836d93f5dff7d112cbbe40ee9cd66c99c92a1 100644 (file)
@@ -49,7 +49,7 @@ GAMEDIR = ..\binary               # Default game build directory
 #
 # windsound uses built-in Microsoft API's, no 3rd party download is required.
 
-#SOUND_LIBRARIES = windsound
+SOUND_LIBRARIES = windsound
 
 #
 #------------------------------------------------------------------------------
@@ -797,6 +797,8 @@ SOUNDLIBDEFS = $(SOUNDLIBDEFS) -DUSER_SOUNDS
 !IF "$(NEED_SEAUTOMAP)" == "Y"
 SOUNDLIBDEFS = $(SOUNDLIBDEFS) -DSND_SOUNDEFFECTS_AUTOMAP
 !ENDIF
+WAV = $(WAVS)
+RCFLAGS = $(RCFLAGS) -dRCWAV
 !ENDIF   #HAVE_SOUNDLIB
 
 #==========================================
@@ -1448,17 +1450,16 @@ $(INCL)\nhlua.h:
 tileutil: $(U)gif2txt.exe $(U)gif2tx32.exe $(U)txt2ppm.exe
        @echo Optional tile development utilities are up to date.
 
-$(OGUI)NetHackW.res: $(SRC)\tiles.bmp $(MSWIN)\NetHackW.rc \
-       $(MSWIN)\mnsel.bmp \
-       $(MSWIN)\mnselcnt.bmp $(MSWIN)\mnunsel.bmp \
+$(OGUI)NetHackW.res: $(SRC)\tiles.bmp $(MSWIN)\NetHackW.rc $(MSWIN)\NetHack.ico \
+       $(MSWIN)\mnsel.bmp $(MSWIN)\mnselcnt.bmp $(MSWIN)\mnunsel.bmp \
        $(MSWIN)\petmark.bmp $(MSWIN)\pilemark.bmp $(MSWIN)\NetHack.ico \
-       $(MSWIN)\rip.bmp $(MSWIN)\splash.bmp $(WAVS)
+       $(MSWIN)\rip.bmp $(MSWIN)\splash.bmp $(WAV)
        @echo Building resource file $@ from $**
-       $(rc) -nologo -r -fo$@ -i$(MSWIN) -i$(SndWavDir) -dNDEBUG $(MSWIN)\NetHackW.rc
+       $(rc) -nologo -r -fo$@ -i$(MSWIN) -i$(SndWavDir) -dNDEBUG $(RCFLAGS) $(MSWIN)\NetHackW.rc
 
-$(OTTY)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico $(WAVS)
+$(OTTY)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico $(WAV)
        @echo Building resource file $@ from $**
-       $(rc) -nologo -r -fo$@ -i$(MSWSYS) -i$(SndWavDir) -dNDEBUG $(MSWSYS)\console.rc
+       $(rc) -nologo -r -fo$@ -i$(MSWSYS) -i$(SndWavDir) -dNDEBUG $(RCFLAGS) $(MSWSYS)\console.rc
 
 #
 #  Secondary Targets.
index 49996af8f091aa7773bbe70e4d1c3742ffcf22d6..16eaae9c05a616a913cd96e209eb9bc5251a306e 100644 (file)
@@ -43,6 +43,8 @@ BEGIN
         VALUE "Translation", 0x409, 1200
     END
 END
+
+#ifdef RCWAV
 se_squeak_A WAVE "se_squeak_A.wav"
 se_squeak_B WAVE "se_squeak_B.wav"
 se_squeak_B_flat WAVE "se_squeak_B_flat.wav"
@@ -103,5 +105,6 @@ sound_Wooden_Harp_D WAVE "sound_Wooden_Harp_D.wav"
 sound_Wooden_Harp_E WAVE "sound_Wooden_Harp_E.wav"
 sound_Wooden_Harp_F WAVE "sound_Wooden_Harp_F.wav"
 sound_Wooden_Harp_G WAVE "sound_Wooden_Harp_G.wav"
+#endif
 
 /*console.rc*/"
index 79892fea4ead1571a471c051ab99df8656d569aa..61ef051f3cac3233d500259a3e6b6586620d791f 100644 (file)
@@ -391,6 +391,7 @@ BEGIN
     IDS_APP_TITLE_SHORT     "NetHack for Windows"
 END
 
+#ifdef RCWAV
 se_squeak_A WAVE "se_squeak_A.wav"
 se_squeak_B WAVE "se_squeak_B.wav"
 se_squeak_B_flat WAVE "se_squeak_B_flat.wav"
@@ -451,7 +452,7 @@ sound_Wooden_Harp_D WAVE "sound_Wooden_Harp_D.wav"
 sound_Wooden_Harp_E WAVE "sound_Wooden_Harp_E.wav"
 sound_Wooden_Harp_F WAVE "sound_Wooden_Harp_F.wav"
 sound_Wooden_Harp_G WAVE "sound_Wooden_Harp_G.wav"
-
+#endif
 #endif    // English (United States) resources
 /////////////////////////////////////////////////////////////////////////////