ref: 9563371e9ad296eded19008a26382ad311182dbc
parent: 0044cf8336b5a623b5a56a2827a938276363770e
author: James Haley <haleyjd@hotmail.com>
date: Sun Aug 29 14:13:19 EDT 2010
Added voice volume and back flat configuration variables. Made status bar redraw when menus are active as in Strife. Finished up the Strife "settings" menu which was only for sound volumes in vanilla Doom. Subversion-branch: /branches/strife-branch Subversion-revision: 1973
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -136,6 +136,12 @@
CONFIG_VARIABLE_INT(music_volume),
//!
+ // Volume of voice sound effects, range 0-15. Strife only.
+ //
+
+ CONFIG_VARIABLE_INT(voice_volume),
+
+ //!
// If non-zero, messages are displayed on the heads-up display
// in the game ("picked up a clip", etc). If zero, these messages
// are not displayed.
@@ -479,6 +485,12 @@
//
CONFIG_VARIABLE_STRING(chatmacro9),
+
+ //!
+ // Name of background flat used by view border. Strife only.
+ //
+
+ CONFIG_VARIABLE_STRING(back_flat),
};
static default_collection_t doom_defaults =
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -128,10 +128,10 @@
boolean advancedemo;
// Store demo, do not accept any inputs
+// haleyjd [STRIFE] Unused.
+//boolean storedemo;
-boolean storedemo;
-
char wadfile[1024]; // primary wad file
char mapdir[1024]; // directory of development maps
@@ -235,7 +235,8 @@
AM_Drawer ();
if (wipe || (viewheight != 200 && fullscreen) )
redrawsbar = true;
- if (inhelpscreensstate && !inhelpscreens)
+ // haleyjd 08/29/10: [STRIFE] Always redraw sbar if menu is/was active
+ if (menuactivestate || (inhelpscreensstate && !inhelpscreens))
redrawsbar = true; // just put away the help screen
ST_Drawer (viewheight == 200, redrawsbar );
fullscreen = viewheight == 200;
@@ -264,7 +265,19 @@
R_RenderPlayerView (&players[displayplayer]);
if (gamestate == GS_LEVEL && gametic)
+ {
HU_Drawer ();
+ // STRIFE-TODO: ST_DrawMore, unknown variable dword_861C8
+ /*
+ if(ST_DrawMore())
+ dword_861C8 = 1;
+ else if(dword_861C8)
+ {
+ dword_861C8 = 0;
+ menuactivestate = 1;
+ }
+ */
+ }
// clean up border stuff
if (gamestate != oldgamestate && gamestate != GS_LEVEL)
@@ -377,9 +390,13 @@
NET_BindVariables();
#endif
+ // haleyjd 08/29/10: [STRIFE]
+ // * Added voice volume
+ // * Added back flat
M_BindVariable("mouse_sensitivity", &mouseSensitivity);
M_BindVariable("sfx_volume", &sfxVolume);
M_BindVariable("music_volume", &musicVolume);
+ M_BindVariable("voice_volume", &voiceVolume);
M_BindVariable("show_messages", &showMessages);
M_BindVariable("screenblocks", &screenblocks);
M_BindVariable("detaillevel", &detailLevel);
@@ -387,6 +404,7 @@
M_BindVariable("vanilla_savegame_limit", &vanilla_savegame_limit);
M_BindVariable("vanilla_demo_limit", &vanilla_demo_limit);
M_BindVariable("show_endoom", &show_endoom);
+ M_BindVariable("back_flat", &back_flat);
// Multiplayer chat macros
--- a/src/strife/doomstat.h
+++ b/src/strife/doomstat.h
@@ -116,6 +116,7 @@
// These are multiplied by 8.
extern int sfxVolume;
extern int musicVolume;
+extern int voiceVolume; // haleyjd 08/29/10: [STRIFE]
// Current music/sfx card - index useless
// w/o a reference LUT in a sound module.
--- a/src/strife/m_menu.c
+++ b/src/strife/m_menu.c
@@ -199,6 +199,7 @@
void M_ChangeMessages(int choice);
void M_ChangeSensitivity(int choice);
void M_SfxVol(int choice);
+void M_VoiceVol(int choice); // [STRIFE]
void M_MusicVol(int choice);
void M_ChangeDetail(int choice);
void M_SizeDisplay(int choice);
@@ -448,14 +449,26 @@
sfx_empty1,
music_vol,
sfx_empty2,
+ voice_vol,
+ sfx_empty3,
+ sfx_mouse,
+ sfx_empty4,
sound_end
} sound_e;
+// haleyjd 08/29/10:
+// [STRIFE]
+// * Added voice volume
+// * Moved mouse sensitivity here (who knows why...)
menuitem_t SoundMenu[]=
{
{2,"M_SFXVOL",M_SfxVol,'s'},
{-1,"",0,'\0'},
{2,"M_MUSVOL",M_MusicVol,'m'},
+ {-1,"",0,'\0'},
+ {2,"M_VOIVOL",M_VoiceVol,'v'},
+ {-1,"",0,'\0'},
+ {2,"M_MSENS",M_ChangeSensitivity,'m'},
{-1,"",0,'\0'}
};
@@ -465,7 +478,7 @@
&OptionsDef,
SoundMenu,
M_DrawSound,
- 80,64,
+ 80,35, // [STRIFE] changed y coord 64 -> 35
0
};
@@ -808,15 +821,25 @@
//
// Change Sfx & Music volumes
//
+// haleyjd 08/29/10: [STRIFE]
+// * Changed title graphic coordinates
+// * Added voice volume and sensitivity sliders
+//
void M_DrawSound(void)
{
- V_DrawPatchDirect (60, 38, W_CacheLumpName(DEH_String("M_SVOL"), PU_CACHE));
+ V_DrawPatchDirect (100, 10, W_CacheLumpName(DEH_String("M_SVOL"), PU_CACHE));
M_DrawThermo(SoundDef.x,SoundDef.y+LINEHEIGHT*(sfx_vol+1),
- 16,sfxVolume);
+ 16,sfxVolume);
M_DrawThermo(SoundDef.x,SoundDef.y+LINEHEIGHT*(music_vol+1),
- 16,musicVolume);
+ 16,musicVolume);
+
+ M_DrawThermo(SoundDef.x,SoundDef.y+LINEHEIGHT*(voice_vol+1),
+ 16,voiceVolume);
+
+ M_DrawThermo(SoundDef.x,SoundDef.y+LINEHEIGHT*(sfx_mouse+1),
+ 16,mouseSensitivity);
}
void M_Sound(int choice)
@@ -839,6 +862,30 @@
}
S_SetSfxVolume(sfxVolume * 8);
+}
+
+//
+// M_VoiceVol
+//
+// haleyjd 08/29/10: [STRIFE] New function
+// Sets voice volume level.
+//
+void M_VoiceVol(int choice)
+{
+ switch(choice)
+ {
+ case 0:
+ if (voiceVolume)
+ voiceVolume--;
+ break;
+ case 1:
+ if (voiceVolume < 15)
+ voiceVolume++;
+ break;
+ }
+
+ // STRIFE-TODO: Voice volume setting
+ //S_SetVoiceVolume(voiceVolume * 8);
}
void M_MusicVol(int choice)
--- a/src/strife/r_draw.c
+++ b/src/strife/r_draw.c
@@ -82,6 +82,9 @@
static byte *background_buffer = NULL;
+// haleyjd 08/29/10: [STRIFE] Rogue added the ability to customize the view
+// border flat by storing it in the configuration file.
+char *back_flat = "F_PAVE01";
//
// R_DrawColumn
@@ -827,6 +830,8 @@
// for variable screen sizes
// Also draws a beveled edge.
//
+// haleyjd 08/29/10: [STRIFE] Added support for configurable back_flat.
+//
void R_FillBackScreen (void)
{
byte* src;
@@ -835,12 +840,6 @@
int y;
patch_t* patch;
- // DOOM border patch.
- char *name1 = DEH_String("FLOOR7_2");
-
- // DOOM II border patch.
- char *name2 = DEH_String("GRNROCK");
-
char *name;
// If we are running full screen, there is no need to do any of this,
@@ -865,10 +864,8 @@
PU_STATIC, NULL);
}
- if (gamemode == commercial)
- name = name2;
- else
- name = name1;
+ // haleyjd 08/29/10: [STRIFE] Use configurable back_flat
+ name = back_flat;
src = W_CacheLumpName(name, PU_CACHE);
dest = background_buffer;
--- a/src/strife/r_draw.h
+++ b/src/strife/r_draw.h
@@ -81,6 +81,7 @@
extern byte* dc_translation;
extern byte* xlatab; // haleyjd 08/26/10: [STRIFE]
+extern char *back_flat; // haleyjd 08/29/10: [STRIFE]
// Span blitting for rows, floor/ceiling.
// No Sepctre effect needed.
--- a/src/strife/s_sound.c
+++ b/src/strife/s_sound.c
@@ -96,6 +96,11 @@
int musicVolume = 8;
+// haleyjd 08/29/10: [STRIFE] New global variable
+// Maximum volume of voice channel.
+
+int voiceVolume = 15;
+
// Internal volume level, ranging from 0-127
static int snd_SfxVolume;