diff options
-rw-r--r-- | src/cgame/cg_ents.c | 14 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 32 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 2 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 4 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 5 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 2 | ||||
-rw-r--r-- | src/game/bg_public.h | 3 | ||||
-rw-r--r-- | src/game/g_missile.c | 6 | ||||
-rw-r--r-- | src/ui/ui_atoms.c | 2 | ||||
-rw-r--r-- | src/ui/ui_main.c | 1 | ||||
-rw-r--r-- | src/ui/ui_shared.c | 3 |
11 files changed, 43 insertions, 31 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index df34af3c..c523378f 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -383,6 +383,8 @@ static void CG_Missile( centity_t *cent ) entityState_t *s1; const weaponInfo_t *weapon; vec3_t up; + float fraction; + int index; s1 = ¢->currentState; if ( s1->weapon > WP_NUM_WEAPONS ) { @@ -435,10 +437,18 @@ static void CG_Missile( centity_t *cent ) break; case WP_FLAMER: + fraction = ( ( cg.time - s1->pos.trTime ) / FIREBALL_LIFETIME ); + + if( fraction > 1.0f ) + fraction = 1.0f; + ent.reType = RT_SPRITE; - ent.radius = ( ( cg.time - s1->pos.trTime ) * ( cg.time - s1->pos.trTime ) ) / 9000; + ent.radius = fraction * 32; + ent.shaderTime = s1->pos.trTime / 1000.0f; ent.rotation = 0; - ent.customShader = cgs.media.flameShader; + + index = (int)( fraction * 31 ); + ent.customShader = cgs.media.flameShader[ index ]; trap_R_AddRefEntityToScene( &ent ); return; break; diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 7aebd973..1d2bf6eb 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -432,22 +432,22 @@ void CG_Menu( int eventParm ) case MN_D_BUILD: trap_SendConsoleCommand( "menu tremulous_alienbuild\n" ); break; case MN_H_BUILD: trap_SendConsoleCommand( "menu tremulous_humanbuild\n" ); break; case MN_H_MCU: trap_SendConsoleCommand( "menu tremulous_humanmcu\n" ); break; - case MN_H_BANK: trap_SendConsoleCommand( "menu hbankmenu\n" ); break; - case MN_H_NOROOM: trap_SendConsoleCommand( "menu hnoroom\n" ); break; - case MN_H_NOPOWER: trap_SendConsoleCommand( "menu hnopower\n" ); break; - case MN_D_NOROOM: trap_SendConsoleCommand( "menu dnoroom\n" ); break; - case MN_D_NOCREEP: trap_SendConsoleCommand( "menu dnocreep\n" ); break; - case MN_D_NOHVMND: trap_SendConsoleCommand( "menu dnohvmnd\n" ); break; - case MN_D_HIVEMIND: trap_SendConsoleCommand( "menu dhivemind\n" ); break; - case MN_D_NOASSERT: trap_SendConsoleCommand( "menu dnoassert\n" ); break; - case MN_D_SPWNWARN: trap_SendConsoleCommand( "menu dspwnwarn\n" ); break; - case MN_H_REACTOR: trap_SendConsoleCommand( "menu hreactor\n" ); break; - case MN_H_REPEATER: trap_SendConsoleCommand( "menu hrepeater\n" ); break; - case MN_H_RPLWARN: trap_SendConsoleCommand( "menu hrplwarn\n" ); break; - case MN_H_RPTWARN: trap_SendConsoleCommand( "menu hrptwarn\n" ); break; - case MN_H_NOSLOTS: trap_SendConsoleCommand( "menu hnoslots\n" ); break; - case MN_H_NOFUNDS: trap_SendConsoleCommand( "menu hnofunds\n" ); break; - case MN_H_ITEMHELD: trap_SendConsoleCommand( "menu hitemheld\n" ); break; + case MN_H_BANK: trap_SendConsoleCommand( "menu tremulous_humanbank\n" ); break; + case MN_H_NOROOM: trap_SendConsoleCommand( "menu tremulous_human_no_room\n" ); break; + case MN_H_NOPOWER: trap_SendConsoleCommand( "menu tremulous_human_no_power\n" ); break; + case MN_D_NOROOM: trap_SendConsoleCommand( "menu tremulous_alien_no_room\n" ); break; + case MN_D_NOCREEP: trap_SendConsoleCommand( "menu tremulous_alien_no_creep\n" ); break; + case MN_D_NOHVMND: trap_SendConsoleCommand( "menu tremulous_alien_no_hivemind\n" ); break; + case MN_D_HIVEMIND: trap_SendConsoleCommand( "menu tremulous_alien_one_hivemind\n" ); break; + case MN_D_NOASSERT: trap_SendConsoleCommand( "menu tremulous_alien_no_assertion\n" ); break; + case MN_D_SPWNWARN: trap_SendConsoleCommand( "menu tremulous_alien_egg_warning\n" ); break; + case MN_H_REACTOR: trap_SendConsoleCommand( "menu tremulous_human_one_reactor\n" ); break; + case MN_H_REPEATER: trap_SendConsoleCommand( "menu tremulous_human_repeater\n" ); break; + case MN_H_RPLWARN: trap_SendConsoleCommand( "menu tremulous_human_replicator_warning\n" ); break; + case MN_H_RPTWARN: trap_SendConsoleCommand( "menu tremulous_human_repeater_warning\n" ); break; + case MN_H_NOSLOTS: trap_SendConsoleCommand( "menu tremulous_human_no_slots\n" ); break; + case MN_H_NOFUNDS: trap_SendConsoleCommand( "menu tremulous_human_no_funds\n" ); break; + case MN_H_ITEMHELD: trap_SendConsoleCommand( "menu tremulous_human_item_held\n" ); break; case MN_D_INFEST: trap_SendConsoleCommand( "menu dinfest\n" ); break; default: diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 90c4320a..d98039ec 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -809,7 +809,7 @@ typedef struct { qhandle_t droidNav1; qhandle_t droidHealth; - qhandle_t flameShader; + qhandle_t flameShader[ 32 ]; qhandle_t flameExplShader; qhandle_t creepShader; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 12eb4265..d10ed749 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -748,7 +748,9 @@ static void CG_RegisterGraphics( void ) { cgs.media.greenBloodMarkShader = trap_R_RegisterShader( "greenBloodMark" ); cgs.media.explosionTrailShader = trap_R_RegisterShader( "explosionTrail" ); - cgs.media.flameShader = trap_R_RegisterShader( "sprites/flameball" ); + for( i = 0; i < 32; i++ ) + cgs.media.flameShader[ i ] = trap_R_RegisterShader( va( "fireball%d", i + 1 ) ); + cgs.media.creepShader = trap_R_RegisterShader( "creep" ); cgs.media.scannerBlipShader = trap_R_RegisterShader( "gfx/2d/droidhealth" ); diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 9aacd702..50a97655 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -718,7 +718,7 @@ void CG_RegisterWeapon( int weaponNum ) { weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); MAKERGB( weaponInfo->flashDlightColor, 0.25, 0.1, 0 ); //weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/railgun/railgf1a.wav", qfalse ); - cgs.media.flameExplShader = trap_R_RegisterShader( "rocketExplosion" ); + /*cgs.media.flameExplShader = trap_R_RegisterShader( "rocketExplosion" );*/ break; case WP_PLASMAGUN: @@ -1839,12 +1839,9 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im radius = 24; break; case WP_FLAMER: - mod = cgs.media.dishFlashModel; - shader = cgs.media.flameExplShader; sfx = cgs.media.sfx_lghit2; mark = cgs.media.burnMarkShader; radius = 32; - isSprite = qtrue; break; case WP_PLASMAGUN: mod = cgs.media.ringFlashModel; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 30d71fa9..685a0617 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2343,7 +2343,7 @@ static void PM_Weapon( void ) addTime = 800; break; case WP_FLAMER: - addTime = 70; + addTime = 40; break; case WP_RAILGUN: addTime = 1500; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 2195db13..e03ef4bd 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -327,6 +327,9 @@ typedef enum { HI_NUM_HOLDABLE } holdable_t; +//TA: needed client side to size sprites +#define FIREBALL_LIFETIME 1500.0f + typedef enum { WP_NONE, diff --git a/src/game/g_missile.c b/src/game/g_missile.c index 46fe9239..8b2aba73 100644 --- a/src/game/g_missile.c +++ b/src/game/g_missile.c @@ -83,7 +83,7 @@ void G_ExplodeMissile( gentity_t *ent ) { ent->s.eType = ET_GENERAL; //TA: tired... can't be fucked... hack - if( ent->s.weapon != WP_LOCKBLOB_LAUNCHER ) + if( ent->s.weapon != WP_LOCKBLOB_LAUNCHER && ent->s.weapon != WP_FLAMER ) G_AddEvent( ent, EV_MISSILE_MISS, DirToByte( dir ) ); ent->freeAfterEvent = qtrue; @@ -309,7 +309,7 @@ gentity_t *fire_flamer( gentity_t *self, vec3_t start, vec3_t dir ) bolt = G_Spawn(); bolt->classname = "flame"; - bolt->nextthink = level.time + 600; + bolt->nextthink = level.time + FIREBALL_LIFETIME; bolt->think = G_ExplodeMissile; bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; @@ -328,7 +328,7 @@ gentity_t *fire_flamer( gentity_t *self, vec3_t start, vec3_t dir ) bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame VectorCopy( start, bolt->s.pos.trBase ); //VectorMA( self->client->ps.velocity, 300, dir, bolt->s.pos.trDelta ); - VectorScale( dir, 350, bolt->s.pos.trDelta ); + VectorScale( dir, 200, bolt->s.pos.trDelta ); SnapVector( bolt->s.pos.trDelta ); // save net bandwidth VectorCopy (start, bolt->r.currentOrigin); diff --git a/src/ui/ui_atoms.c b/src/ui/ui_atoms.c index cac94738..6a6ddda6 100644 --- a/src/ui/ui_atoms.c +++ b/src/ui/ui_atoms.c @@ -356,7 +356,7 @@ qboolean UI_ConsoleCommand( int realTime ) if ( Q_stricmp (cmd, "menu") == 0 ) { - strcpy( arg1, UI_Argv( 1 ) ); + arg1 = UI_Argv( 1 ); if( Menu_Count() > 0 ) { diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 0d545dfc..35d8f67e 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -5219,6 +5219,7 @@ void UI_LoadNonIngame() { void _UI_SetActiveMenu( uiMenuCommand_t menu ) { char buf[256]; + Com_Printf( "_UI_SetActiveMenu\n" ); // this should be the ONLY way the menu system is brought up // enusure minumum menu data is cached if (Menu_Count() > 0) { diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 3240ebb8..67824064 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -4105,6 +4105,7 @@ menuDef_t *Menus_ActivateByName(const char *p) { int i; menuDef_t *m = NULL; menuDef_t *focus = Menu_GetFocused(); + for (i = 0; i < menuCount; i++) { if (Q_stricmp(Menus[i].window.name, p) == 0) { m = &Menus[i]; @@ -5568,8 +5569,6 @@ Menu_New void Menu_New(int handle) { menuDef_t *menu = &Menus[menuCount]; - Com_Printf( "menu_new\n" ); - if (menuCount < MAX_MENUS) { Menu_Init(menu); if (Menu_Parse(handle, menu)) { |