Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ui_sound.c File Reference

#include "ui_local.h"

Include dependency graph for ui_sound.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  soundOptionsInfo_t

Defines

#define ART_BACK0   "menu/art/back_0"
#define ART_BACK1   "menu/art/back_1"
#define ART_FRAMEL   "menu/art/frame2_l"
#define ART_FRAMER   "menu/art/frame1_r"
#define ID_BACK   18
#define ID_DISPLAY   11
#define ID_EFFECTSVOLUME   14
#define ID_GRAPHICS   10
#define ID_MUSICVOLUME   15
#define ID_NETWORK   13
#define ID_QUALITY   16
#define ID_SOUND   12

Functions

void UI_SoundOptionsMenu (void)
void UI_SoundOptionsMenu_Cache (void)
void UI_SoundOptionsMenu_Event (void *ptr, int event)
void UI_SoundOptionsMenu_Init (void)

Variables

const char * quality_items []
soundOptionsInfo_t soundOptionsInfo


Define Documentation

#define ART_BACK0   "menu/art/back_0"
 

Definition at line 36 of file ui_sound.c.

#define ART_BACK1   "menu/art/back_1"
 

Definition at line 37 of file ui_sound.c.

#define ART_FRAMEL   "menu/art/frame2_l"
 

Definition at line 34 of file ui_sound.c.

#define ART_FRAMER   "menu/art/frame1_r"
 

Definition at line 35 of file ui_sound.c.

#define ID_BACK   18
 

Definition at line 47 of file ui_sound.c.

#define ID_DISPLAY   11
 

Definition at line 40 of file ui_sound.c.

#define ID_EFFECTSVOLUME   14
 

Definition at line 43 of file ui_sound.c.

Referenced by UI_SoundOptionsMenu_Event().

#define ID_GRAPHICS   10
 

Definition at line 39 of file ui_sound.c.

#define ID_MUSICVOLUME   15
 

Definition at line 44 of file ui_sound.c.

Referenced by UI_SoundOptionsMenu_Event().

#define ID_NETWORK   13
 

Definition at line 42 of file ui_sound.c.

#define ID_QUALITY   16
 

Definition at line 45 of file ui_sound.c.

Referenced by UI_SoundOptionsMenu_Event().

#define ID_SOUND   12
 

Definition at line 41 of file ui_sound.c.


Function Documentation

void UI_SoundOptionsMenu void   ) 
 

Definition at line 312 of file ui_sound.c.

References soundOptionsInfo_t::menu, Menu_SetCursorToItem(), soundOptionsInfo_t::sound, soundOptionsInfo, UI_PushMenu(), and UI_SoundOptionsMenu_Init().

Here is the call graph for this function:

void UI_SoundOptionsMenu_Cache void   ) 
 

Definition at line 299 of file ui_sound.c.

References ART_BACK0, ART_BACK1, ART_FRAMEL, ART_FRAMER, and trap_R_RegisterShaderNoMip().

00299                                        {
00300     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00301     trap_R_RegisterShaderNoMip( ART_FRAMER );
00302     trap_R_RegisterShaderNoMip( ART_BACK0 );
00303     trap_R_RegisterShaderNoMip( ART_BACK1 );
00304 }

Here is the call graph for this function:

void UI_SoundOptionsMenu_Event void *  ptr,
int  event
[static]
 

Definition at line 82 of file ui_sound.c.

References menulist_s::curvalue, menuslider_s::curvalue, EXEC_APPEND, ID_BACK, ID_DISPLAY, ID_EFFECTSVOLUME, ID_GRAPHICS, ID_MUSICVOLUME, ID_NETWORK, ID_QUALITY, ID_SOUND, soundOptionsInfo_t::musicvolume, soundOptionsInfo_t::quality, soundOptionsInfo_t::sfxvolume, soundOptionsInfo, trap_Cmd_ExecuteText(), trap_Cvar_SetValue(), UI_DisplayOptionsMenu(), UI_ForceMenuOff(), UI_GraphicsOptionsMenu(), UI_NetworkOptionsMenu(), and UI_PopMenu().

00082                                                               {
00083     if( event != QM_ACTIVATED ) {
00084         return;
00085     }
00086 
00087     switch( ((menucommon_s*)ptr)->id ) {
00088     case ID_GRAPHICS:
00089         UI_PopMenu();
00090         UI_GraphicsOptionsMenu();
00091         break;
00092 
00093     case ID_DISPLAY:
00094         UI_PopMenu();
00095         UI_DisplayOptionsMenu();
00096         break;
00097 
00098     case ID_SOUND:
00099         break;
00100 
00101     case ID_NETWORK:
00102         UI_PopMenu();
00103         UI_NetworkOptionsMenu();
00104         break;
00105 
00106     case ID_EFFECTSVOLUME:
00107         trap_Cvar_SetValue( "s_volume", soundOptionsInfo.sfxvolume.curvalue / 10 );
00108         break;
00109 
00110     case ID_MUSICVOLUME:
00111         trap_Cvar_SetValue( "s_musicvolume", soundOptionsInfo.musicvolume.curvalue / 10 );
00112         break;
00113 
00114     case ID_QUALITY:
00115         if( soundOptionsInfo.quality.curvalue ) {
00116             trap_Cvar_SetValue( "s_khz", 22 );
00117             trap_Cvar_SetValue( "s_compression", 0 );
00118         }
00119         else {
00120             trap_Cvar_SetValue( "s_khz", 11 );
00121             trap_Cvar_SetValue( "s_compression", 1 );
00122         }
00123         UI_ForceMenuOff();
00124         trap_Cmd_ExecuteText( EXEC_APPEND, "snd_restart\n" );
00125         break;
00126 /*
00127     case ID_A3D:
00128         if( soundOptionsInfo.a3d.curvalue ) {
00129             trap_Cmd_ExecuteText( EXEC_NOW, "s_enable_a3d\n" );
00130         }
00131         else {
00132             trap_Cmd_ExecuteText( EXEC_NOW, "s_disable_a3d\n" );
00133         }
00134         soundOptionsInfo.a3d.curvalue = (int)trap_Cvar_VariableValue( "s_usingA3D" );
00135         break;
00136 */
00137     case ID_BACK:
00138         UI_PopMenu();
00139         break;
00140     }
00141 }

Here is the call graph for this function:

void UI_SoundOptionsMenu_Init void   )  [static]
 

Definition at line 149 of file ui_sound.c.

References soundOptionsInfo_t::back, soundOptionsInfo_t::banner, BIGCHAR_HEIGHT, menucommon_s::callback, menutext_s::color, menulist_s::curvalue, menuslider_s::curvalue, soundOptionsInfo_t::display, menucommon_s::flags, menubitmap_s::focuspic, soundOptionsInfo_t::framel, soundOptionsInfo_t::framer, _tag_menuframework::fullscreen, menulist_s::generic, menuslider_s::generic, menubitmap_s::generic, menutext_s::generic, soundOptionsInfo_t::graphics, menubitmap_s::height, menucommon_s::id, menulist_s::itemnames, menuslider_s::maxvalue, memset(), soundOptionsInfo_t::menu, Menu_AddItem(), menuslider_s::minvalue, soundOptionsInfo_t::musicvolume, menucommon_s::name, soundOptionsInfo_t::network, QMF_LEFT_JUSTIFY, QMF_PULSEIFFOCUS, QMF_RIGHT_JUSTIFY, soundOptionsInfo_t::quality, soundOptionsInfo_t::sfxvolume, soundOptionsInfo_t::sound, soundOptionsInfo, menutext_s::string, menutext_s::style, trap_Cvar_VariableValue(), menucommon_s::type, UI_SoundOptionsMenu_Cache(), menubitmap_s::width, _tag_menuframework::wrapAround, menucommon_s::x, y, and menucommon_s::y.

Referenced by UI_SoundOptionsMenu().

00149                                              {
00150     int             y;
00151 
00152     memset( &soundOptionsInfo, 0, sizeof(soundOptionsInfo) );
00153 
00154     UI_SoundOptionsMenu_Cache();
00155     soundOptionsInfo.menu.wrapAround = qtrue;
00156     soundOptionsInfo.menu.fullscreen = qtrue;
00157 
00158     soundOptionsInfo.banner.generic.type        = MTYPE_BTEXT;
00159     soundOptionsInfo.banner.generic.flags       = QMF_CENTER_JUSTIFY;
00160     soundOptionsInfo.banner.generic.x           = 320;
00161     soundOptionsInfo.banner.generic.y           = 16;
00162     soundOptionsInfo.banner.string              = "SYSTEM SETUP";
00163     soundOptionsInfo.banner.color               = color_white;
00164     soundOptionsInfo.banner.style               = UI_CENTER;
00165 
00166     soundOptionsInfo.framel.generic.type        = MTYPE_BITMAP;
00167     soundOptionsInfo.framel.generic.name        = ART_FRAMEL;
00168     soundOptionsInfo.framel.generic.flags       = QMF_INACTIVE;
00169     soundOptionsInfo.framel.generic.x           = 0;  
00170     soundOptionsInfo.framel.generic.y           = 78;
00171     soundOptionsInfo.framel.width               = 256;
00172     soundOptionsInfo.framel.height              = 329;
00173 
00174     soundOptionsInfo.framer.generic.type        = MTYPE_BITMAP;
00175     soundOptionsInfo.framer.generic.name        = ART_FRAMER;
00176     soundOptionsInfo.framer.generic.flags       = QMF_INACTIVE;
00177     soundOptionsInfo.framer.generic.x           = 376;
00178     soundOptionsInfo.framer.generic.y           = 76;
00179     soundOptionsInfo.framer.width               = 256;
00180     soundOptionsInfo.framer.height              = 334;
00181 
00182     soundOptionsInfo.graphics.generic.type      = MTYPE_PTEXT;
00183     soundOptionsInfo.graphics.generic.flags     = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
00184     soundOptionsInfo.graphics.generic.id        = ID_GRAPHICS;
00185     soundOptionsInfo.graphics.generic.callback  = UI_SoundOptionsMenu_Event;
00186     soundOptionsInfo.graphics.generic.x         = 216;
00187     soundOptionsInfo.graphics.generic.y         = 240 - 2 * PROP_HEIGHT;
00188     soundOptionsInfo.graphics.string            = "GRAPHICS";
00189     soundOptionsInfo.graphics.style             = UI_RIGHT;
00190     soundOptionsInfo.graphics.color             = color_red;
00191 
00192     soundOptionsInfo.display.generic.type       = MTYPE_PTEXT;
00193     soundOptionsInfo.display.generic.flags      = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
00194     soundOptionsInfo.display.generic.id         = ID_DISPLAY;
00195     soundOptionsInfo.display.generic.callback   = UI_SoundOptionsMenu_Event;
00196     soundOptionsInfo.display.generic.x          = 216;
00197     soundOptionsInfo.display.generic.y          = 240 - PROP_HEIGHT;
00198     soundOptionsInfo.display.string             = "DISPLAY";
00199     soundOptionsInfo.display.style              = UI_RIGHT;
00200     soundOptionsInfo.display.color              = color_red;
00201 
00202     soundOptionsInfo.sound.generic.type         = MTYPE_PTEXT;
00203     soundOptionsInfo.sound.generic.flags        = QMF_RIGHT_JUSTIFY;
00204     soundOptionsInfo.sound.generic.id           = ID_SOUND;
00205     soundOptionsInfo.sound.generic.callback     = UI_SoundOptionsMenu_Event;
00206     soundOptionsInfo.sound.generic.x            = 216;
00207     soundOptionsInfo.sound.generic.y            = 240;
00208     soundOptionsInfo.sound.string               = "SOUND";
00209     soundOptionsInfo.sound.style                = UI_RIGHT;
00210     soundOptionsInfo.sound.color                = color_red;
00211 
00212     soundOptionsInfo.network.generic.type       = MTYPE_PTEXT;
00213     soundOptionsInfo.network.generic.flags      = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
00214     soundOptionsInfo.network.generic.id         = ID_NETWORK;
00215     soundOptionsInfo.network.generic.callback   = UI_SoundOptionsMenu_Event;
00216     soundOptionsInfo.network.generic.x          = 216;
00217     soundOptionsInfo.network.generic.y          = 240 + PROP_HEIGHT;
00218     soundOptionsInfo.network.string             = "NETWORK";
00219     soundOptionsInfo.network.style              = UI_RIGHT;
00220     soundOptionsInfo.network.color              = color_red;
00221 
00222     y = 240 - 1.5 * (BIGCHAR_HEIGHT + 2);
00223     soundOptionsInfo.sfxvolume.generic.type     = MTYPE_SLIDER;
00224     soundOptionsInfo.sfxvolume.generic.name     = "Effects Volume:";
00225     soundOptionsInfo.sfxvolume.generic.flags    = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
00226     soundOptionsInfo.sfxvolume.generic.callback = UI_SoundOptionsMenu_Event;
00227     soundOptionsInfo.sfxvolume.generic.id       = ID_EFFECTSVOLUME;
00228     soundOptionsInfo.sfxvolume.generic.x        = 400;
00229     soundOptionsInfo.sfxvolume.generic.y        = y;
00230     soundOptionsInfo.sfxvolume.minvalue         = 0;
00231     soundOptionsInfo.sfxvolume.maxvalue         = 10;
00232 
00233     y += BIGCHAR_HEIGHT+2;
00234     soundOptionsInfo.musicvolume.generic.type       = MTYPE_SLIDER;
00235     soundOptionsInfo.musicvolume.generic.name       = "Music Volume:";
00236     soundOptionsInfo.musicvolume.generic.flags      = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
00237     soundOptionsInfo.musicvolume.generic.callback   = UI_SoundOptionsMenu_Event;
00238     soundOptionsInfo.musicvolume.generic.id         = ID_MUSICVOLUME;
00239     soundOptionsInfo.musicvolume.generic.x          = 400;
00240     soundOptionsInfo.musicvolume.generic.y          = y;
00241     soundOptionsInfo.musicvolume.minvalue           = 0;
00242     soundOptionsInfo.musicvolume.maxvalue           = 10;
00243 
00244     y += BIGCHAR_HEIGHT+2;
00245     soundOptionsInfo.quality.generic.type       = MTYPE_SPINCONTROL;
00246     soundOptionsInfo.quality.generic.name       = "Sound Quality:";
00247     soundOptionsInfo.quality.generic.flags      = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
00248     soundOptionsInfo.quality.generic.callback   = UI_SoundOptionsMenu_Event;
00249     soundOptionsInfo.quality.generic.id         = ID_QUALITY;
00250     soundOptionsInfo.quality.generic.x          = 400;
00251     soundOptionsInfo.quality.generic.y          = y;
00252     soundOptionsInfo.quality.itemnames          = quality_items;
00253 /*
00254     y += BIGCHAR_HEIGHT+2;
00255     soundOptionsInfo.a3d.generic.type           = MTYPE_RADIOBUTTON;
00256     soundOptionsInfo.a3d.generic.name           = "A3D:";
00257     soundOptionsInfo.a3d.generic.flags          = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
00258     soundOptionsInfo.a3d.generic.callback       = UI_SoundOptionsMenu_Event;
00259     soundOptionsInfo.a3d.generic.id             = ID_A3D;
00260     soundOptionsInfo.a3d.generic.x              = 400;
00261     soundOptionsInfo.a3d.generic.y              = y;
00262 */
00263     soundOptionsInfo.back.generic.type          = MTYPE_BITMAP;
00264     soundOptionsInfo.back.generic.name          = ART_BACK0;
00265     soundOptionsInfo.back.generic.flags         = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
00266     soundOptionsInfo.back.generic.callback      = UI_SoundOptionsMenu_Event;
00267     soundOptionsInfo.back.generic.id            = ID_BACK;
00268     soundOptionsInfo.back.generic.x             = 0;
00269     soundOptionsInfo.back.generic.y             = 480-64;
00270     soundOptionsInfo.back.width                 = 128;
00271     soundOptionsInfo.back.height                = 64;
00272     soundOptionsInfo.back.focuspic              = ART_BACK1;
00273 
00274     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.banner );
00275     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.framel );
00276     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.framer );
00277     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.graphics );
00278     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.display );
00279     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.sound );
00280     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.network );
00281     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.sfxvolume );
00282     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.musicvolume );
00283     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.quality );
00284 //  Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.a3d );
00285     Menu_AddItem( &soundOptionsInfo.menu, ( void * ) &soundOptionsInfo.back );
00286 
00287     soundOptionsInfo.sfxvolume.curvalue = trap_Cvar_VariableValue( "s_volume" ) * 10;
00288     soundOptionsInfo.musicvolume.curvalue = trap_Cvar_VariableValue( "s_musicvolume" ) * 10;
00289     soundOptionsInfo.quality.curvalue = !trap_Cvar_VariableValue( "s_compression" );
00290 //  soundOptionsInfo.a3d.curvalue = (int)trap_Cvar_VariableValue( "s_usingA3D" );
00291 }

Here is the call graph for this function:


Variable Documentation

const char* quality_items[] [static]
 

Initial value:

 {
    "Low", "High", 0
}

Definition at line 50 of file ui_sound.c.

soundOptionsInfo_t soundOptionsInfo [static]
 

Definition at line 74 of file ui_sound.c.

Referenced by UI_SoundOptionsMenu(), UI_SoundOptionsMenu_Event(), and UI_SoundOptionsMenu_Init().


Generated on Thu Aug 25 14:34:40 2005 for Quake III Arena by  doxygen 1.3.9.1