diff options
-rw-r--r-- | src/cgame/cg_consolecmds.c | 2 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 2 | ||||
-rw-r--r-- | src/cgame/cg_tutorial.c | 3 | ||||
-rw-r--r-- | src/cgame/cg_view.c | 59 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 12 | ||||
-rw-r--r-- | ui/ingame_options.menu | 29 |
6 files changed, 47 insertions, 60 deletions
diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c index 44b135bb..68aab6c1 100644 --- a/src/cgame/cg_consolecmds.c +++ b/src/cgame/cg_consolecmds.c @@ -208,8 +208,6 @@ static consoleCommand_t commands[ ] = { "-scores", CG_ScoresUp_f }, { "scoresUp", CG_scrollScoresUp_f }, { "scoresDown", CG_scrollScoresDown_f }, - { "+zoom", CG_ZoomDown_f }, - { "-zoom", CG_ZoomUp_f }, { "sizeup", CG_SizeUp_f }, { "sizedown", CG_SizeDown_f }, { "weapnext", CG_NextWeapon_f }, diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 320e060d..7beadaac 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1537,8 +1537,6 @@ void CG_TestModelNextFrame_f( void ); void CG_TestModelPrevFrame_f( void ); void CG_TestModelNextSkin_f( void ); void CG_TestModelPrevSkin_f( void ); -void CG_ZoomDown_f( void ); -void CG_ZoomUp_f( void ); void CG_AddBufferedSound( sfxHandle_t sfx ); void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demoPlayback ); diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c index 91df7864..1499daef 100644 --- a/src/cgame/cg_tutorial.c +++ b/src/cgame/cg_tutorial.c @@ -38,7 +38,6 @@ static bind_t bindings[ ] = { "boost", "Sprint", { -1, -1 } }, { "+moveup", "Jump", { -1, -1 } }, { "+movedown", "Crouch", { -1, -1 } }, - { "+zoom", "ZoomView", { -1, -1 } }, { "+attack", "Primary Attack", { -1, -1 } }, { "+button5", "Secondary Attack", { -1, -1 } }, { "reload", "Reload", { -1, -1 } }, @@ -428,7 +427,7 @@ static void CG_HumanText( char *text, playerState_t *ps ) Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold %s to zoom\n", - CG_KeyNameForCommand( "+zoom" ) ) ); + CG_KeyNameForCommand( "+button5" ) ) ); break; case WP_PAIN_SAW: diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index 9fc2a145..8fc92b03 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -695,25 +695,6 @@ static void CG_OffsetFirstPersonView( void ) //====================================================================== -void CG_ZoomDown_f( void ) -{ - if( cg.zoomed ) - return; - - cg.zoomed = qtrue; - cg.zoomTime = cg.time; -} - -void CG_ZoomUp_f( void ) -{ - if( !cg.zoomed ) - return; - - cg.zoomed = qfalse; - cg.zoomTime = cg.time; -} - - /* ==================== CG_CalcFov @@ -728,15 +709,20 @@ Fixed fov at intermissions, otherwise account for fov variable and zooms. static int CG_CalcFov( void ) { - float x; - float phase; - float v; - int contents; - float fov_x, fov_y; - float zoomFov; - float f; - int inwater; - int attribFov; + float x; + float phase; + float v; + int contents; + float fov_x, fov_y; + float zoomFov; + float f; + int inwater; + int attribFov; + usercmd_t cmd; + int cmdNum; + + cmdNum = trap_GetCurrentCmdNumber( ); + trap_GetUserCmd( cmdNum, &cmd ); if( cg.predictedPlayerState.pm_type == PM_INTERMISSION || ( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) ) @@ -775,7 +761,8 @@ static int CG_CalcFov( void ) else if ( zoomFov > attribFov ) zoomFov = attribFov; - //TA: only do all the zoom stuff if the client CAN zoom + // only do all the zoom stuff if the client CAN zoom + // FIXME: zoom control is currently hard coded to BUTTON_ATTACK2 if( BG_WeaponCanZoom( cg.predictedPlayerState.weapon ) ) { if ( cg.zoomed ) @@ -786,6 +773,13 @@ static int CG_CalcFov( void ) fov_x = zoomFov; else fov_x = fov_x + f * ( zoomFov - fov_x ); + + // BUTTON_ATTACK2 isn't held so unzoom next time + if( !( cmd.buttons & BUTTON_ATTACK2 ) ) + { + cg.zoomed = qfalse; + cg.zoomTime = cg.time; + } } else { @@ -795,6 +789,13 @@ static int CG_CalcFov( void ) fov_x = fov_x; else fov_x = zoomFov + f * ( fov_x - zoomFov ); + + // BUTTON_ATTACK2 is held so zoom next time + if( cmd.buttons & BUTTON_ATTACK2 ) + { + cg.zoomed = qtrue; + cg.zoomTime = cg.time; + } } } } diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index feac25b1..4afdfaac 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2886,6 +2886,18 @@ static void PM_Weapon( void ) } break; + case WP_MASS_DRIVER: + attack1 = pm->cmd.buttons & BUTTON_ATTACK; + // attack2 is handled on the client for zooming (cg_view.c) + + if( !attack1 ) + { + pm->ps->weaponTime = 0; + pm->ps->weaponstate = WEAPON_READY; + return; + } + break; + default: //by default primary and secondary attacks are allowed attack1 = pm->cmd.buttons & BUTTON_ATTACK; diff --git a/ui/ingame_options.menu b/ui/ingame_options.menu index 47914b4a..ad75e1b1 100644 --- a/ui/ingame_options.menu +++ b/ui/ingame_options.menu @@ -414,31 +414,10 @@ { name look group optionsGrp - type ITEM_TYPE_BIND - text "ZoomView:" - cvar "+zoom" - rect 96 145 192 15 - textalign ITEM_ALIGN_RIGHT - textalignx 90 - maxPaintChars 20 - textaligny 12 - textscale .25 - forecolor 1 1 1 1 - visible 0 - action - { - play "sound/misc/menu1.wav"; - } - } - - itemDef - { - name look - group optionsGrp type ITEM_TYPE_YESNO text "Free Look:" cvar "cl_freelook" - rect 96 160 192 15 + rect 96 145 192 15 textalign ITEM_ALIGN_RIGHT textalignx 90 maxPaintChars 20 @@ -459,7 +438,7 @@ type ITEM_TYPE_SLIDER text "Mouse Sensitivity:" cvarfloat "sensitivity" 5 1 30 - rect 96 175 192 20 + rect 96 160 192 20 textalign ITEM_ALIGN_RIGHT textalignx 90 maxPaintChars 20 @@ -476,7 +455,7 @@ type ITEM_TYPE_YESNO text "Invert Mouse:" cvar "ui_mousePitch" - rect 96 195 192 15 + rect 96 180 192 15 textalign ITEM_ALIGN_RIGHT textalignx 90 maxPaintChars 20 @@ -498,7 +477,7 @@ type ITEM_TYPE_YESNO text "Smooth Mouse:" cvar "m_filter" - rect 96 210 192 15 + rect 96 195 192 15 textalign ITEM_ALIGN_RIGHT textalignx 90 maxPaintChars 20 |