diff options
author | Tim Angus <tim@ngus.net> | 2001-01-15 04:06:42 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-01-15 04:06:42 +0000 |
commit | 64806bda9892ce84e0b5e11ce5e5f9052c1183b3 (patch) | |
tree | b3e6b5c05c901b13031710c4d28cf21baae71b3b /src/cgame | |
parent | dfa6ae440ddddaaf22e4b32dbc6d31b13e162d4d (diff) |
Half-done revamping defmenus; bug fixes;MCU
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 77 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 4 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 24 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 24 |
4 files changed, 53 insertions, 76 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 02457071..e92e8652 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -337,63 +337,49 @@ CG_DrawLighting static void CG_DrawLighting( void ) { centity_t *cent; - byte lum; - static byte lastLum; + int currentLum; + static int lum; vec3_t point, direction; cent = &cg_entities[cg.snap->ps.clientNum]; VectorCopy( cent->lerpOrigin, point ); - //TA: when wall climbing the viewheight is not straight up - if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_WALLCLIMBING ) - VectorMA( point, 32, cg.predictedPlayerState.grapplePoint, point ); - else - point[ 2 ] += 32; AngleVectors( cg.predictedPlayerState.viewangles, direction, NULL, NULL ); - lum = CG_LightFromDirection( point, direction ); + currentLum = CG_LightFromDirection( point, direction ); //CG_Printf( "%d\n", lum ); - if( abs( lastLum - lum ) > 4 ) - lastLum = lum; - - if( BG_activated( UP_NVG, cg.snap->ps.stats ) ) - CG_DrawPic( 0, 0, 640, 480, cgs.media.humanNV ); + if( abs( lum - currentLum ) > 4 ) + lum = currentLum; switch( cg.snap->ps.stats[ STAT_PCLASS ] ) { case PCL_D_BASE: case PCL_D_BUILDER: - if( lastLum < 10 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav80 ); - else if( lastLum >= 10 && lastLum < 16 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav75 ); - else if( lastLum >= 16 && lastLum < 22 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav70 ); - else if( lastLum >= 22 && lastLum < 28 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav65 ); - else if( lastLum >= 28 && lastLum < 34 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav60 ); - else if( lastLum >= 34 && lastLum < 40 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav55 ); - else if( lastLum >= 40 && lastLum < 46 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav50 ); - else if( lastLum >= 46 && lastLum < 53 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav45 ); - else if( lastLum >= 53 && lastLum < 61 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav40 ); - else if( lastLum >= 61 && lastLum < 70 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav35 ); - else if( lastLum >= 70 && lastLum < 80 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav30 ); - else if( lastLum >= 80 && lastLum < 100 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav25 ); - else if( lastLum >= 100 && lastLum < 130 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav20 ); - else if( lastLum >= 130 && lastLum < 180 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav15 ); - else if( lastLum >= 180 ) - CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav10 ); + if( lum < 10 ) + CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav9 ); + else if( lum >= 10 && lum < 16 ) + CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav8 ); + else if( lum >= 16 && lum < 22 ) + CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav7 ); + else if( lum >= 22 && lum < 28 ) + CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav6 ); + else if( lum >= 28 && lum < 34 ) + CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav5 ); + else if( lum >= 34 && lum < 40 ) + CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav4 ); + else if( lum >= 40 && lum < 46 ) + CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav3 ); + else if( lum >= 46 && lum < 53 ) + CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav2 ); + else if( lum >= 53 ) + CG_DrawPic( -4, -4, 648, 488, cgs.media.droidNav1 ); + + break; + + case PCL_H_BASE: + if( BG_activated( UP_NVG, cg.snap->ps.stats ) ) + CG_DrawPic( 0, 0, 640, 480, cgs.media.humanNV ); break; } @@ -424,8 +410,6 @@ static void CG_DrawStatusBar( void ) { vec4_t hcolor; vec3_t angles; vec3_t origin; - byte lum; - static byte lastLum; static float colors[4][4] = { // { 0.2, 1.0, 0.2, 1.0 } , { 1.0, 0.2, 0.2, 1.0 }, {0.5, 0.5, 0.5, 1} }; { 0.3f, 0.4f, 0.3f, 1.0f } , // normal @@ -1284,7 +1268,7 @@ static void CG_DrawLowerRight( void ) { } //y = CG_DrawScores( y ); - y = CG_DrawPoints( y ); + //y = CG_DrawPoints( y ); y = CG_DrawPowerups( y ); } @@ -2243,6 +2227,7 @@ static void CG_Draw2D( void ) { CG_DrawSpectator(); CG_DrawCrosshair(); CG_DrawCrosshairNames(); + CG_DrawLighting(); } else { // don't draw any status if dead or the scoreboard is being explicitly shown if ( !cg.showScores && cg.snap->ps.stats[STAT_HEALTH] > 0 ) { diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 231972ee..b33c742e 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -443,6 +443,10 @@ void CG_Menu( centity_t *cent, int eventParm ) trap_SendConsoleCommand( "menu hbuildmenu\n" ); break; + case MN_MCU: + trap_SendConsoleCommand( "menu hmcumenu\n" ); + break; + default: Com_Printf( "cgame: debug: no such menu no %d\n", eventParm ); diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 9e342591..4874d0cf 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -737,21 +737,15 @@ typedef struct { qhandle_t explosionTrailShader; qhandle_t humanNV; - qhandle_t droidNav10; - qhandle_t droidNav15; - qhandle_t droidNav20; - qhandle_t droidNav25; - qhandle_t droidNav30; - qhandle_t droidNav35; - qhandle_t droidNav40; - qhandle_t droidNav45; - qhandle_t droidNav50; - qhandle_t droidNav55; - qhandle_t droidNav60; - qhandle_t droidNav65; - qhandle_t droidNav70; - qhandle_t droidNav75; - qhandle_t droidNav80; + qhandle_t droidNav9; + qhandle_t droidNav8; + qhandle_t droidNav7; + qhandle_t droidNav6; + qhandle_t droidNav5; + qhandle_t droidNav4; + qhandle_t droidNav3; + qhandle_t droidNav2; + qhandle_t droidNav1; qhandle_t droidHealth; qhandle_t flameShader; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 4d86b0c1..7583d402 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -793,21 +793,15 @@ static void CG_RegisterGraphics( void ) { //TA: screenfades cgs.media.humanNV = trap_R_RegisterShader( "humanNV" ); - cgs.media.droidNav10 = trap_R_RegisterShader( "droidNav10" ); - cgs.media.droidNav15 = trap_R_RegisterShader( "droidNav15" ); - cgs.media.droidNav20 = trap_R_RegisterShader( "droidNav20" ); - cgs.media.droidNav25 = trap_R_RegisterShader( "droidNav25" ); - cgs.media.droidNav30 = trap_R_RegisterShader( "droidNav30" ); - cgs.media.droidNav35 = trap_R_RegisterShader( "droidNav35" ); - cgs.media.droidNav40 = trap_R_RegisterShader( "droidNav40" ); - cgs.media.droidNav45 = trap_R_RegisterShader( "droidNav45" ); - cgs.media.droidNav50 = trap_R_RegisterShader( "droidNav50" ); - cgs.media.droidNav55 = trap_R_RegisterShader( "droidNav55" ); - cgs.media.droidNav60 = trap_R_RegisterShader( "droidNav60" ); - cgs.media.droidNav65 = trap_R_RegisterShader( "droidNav65" ); - cgs.media.droidNav70 = trap_R_RegisterShader( "droidNav70" ); - cgs.media.droidNav75 = trap_R_RegisterShader( "droidNav75" ); - cgs.media.droidNav80 = trap_R_RegisterShader( "droidNav80" ); + cgs.media.droidNav9 = trap_R_RegisterShader( "droidNav9" ); + cgs.media.droidNav8 = trap_R_RegisterShader( "droidNav8" ); + cgs.media.droidNav7 = trap_R_RegisterShader( "droidNav7" ); + cgs.media.droidNav6 = trap_R_RegisterShader( "droidNav6" ); + cgs.media.droidNav5 = trap_R_RegisterShader( "droidNav5" ); + cgs.media.droidNav4 = trap_R_RegisterShader( "droidNav4" ); + cgs.media.droidNav3 = trap_R_RegisterShader( "droidNav3" ); + cgs.media.droidNav2 = trap_R_RegisterShader( "droidNav2" ); + cgs.media.droidNav1 = trap_R_RegisterShader( "droidNav1" ); cgs.media.droidHealth = trap_R_RegisterShader( "gfx/2d/droidhealth.tga" ); cgs.media.armorModel = trap_R_RegisterModel( "models/powerups/armor/armor_yel.md3" ); |