]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into martin-t/dmgtext
authorterencehill <piuntn@gmail.com>
Thu, 1 Nov 2018 14:25:19 +0000 (15:25 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 1 Nov 2018 14:25:19 +0000 (15:25 +0100)
1  2 
qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc
xonotic-client.cfg

index a26ecdfa96349c48339e22fb2e7b98fa2661ae50,5f8d8e68230623cb7fad6700b059895c72b5ff49..c6cc40effeda874c00bafb3f4c949c28e280e2f1
@@@ -21,16 -21,14 +21,16 @@@ AUTOCVAR_SAVE(cl_damagetext_size_max
  AUTOCVAR_SAVE(cl_damagetext_size_max_damage,        float,  140,        "How much damage is considered large");
  AUTOCVAR_SAVE(cl_damagetext_alpha_start,            float,  1,          "Damage text initial alpha");
  AUTOCVAR_SAVE(cl_damagetext_alpha_lifetime,         float,  3,          "Damage text lifetime in seconds");
 -AUTOCVAR_SAVE(cl_damagetext_velocity,               vector, '0 0 20',   "Damage text move direction (world coordinates)");
 -AUTOCVAR_SAVE(cl_damagetext_offset,                 vector, '0 -40 0',  "Damage text offset (screen coordinates)");
 +AUTOCVAR_SAVE(cl_damagetext_velocity_screen,        vector, '0 0 0',    "Damage text move direction (screen coordinates)");
 +AUTOCVAR_SAVE(cl_damagetext_velocity_world,         vector, '0 0 20',   "Damage text move direction (world coordinates relative to player's view)");
 +AUTOCVAR_SAVE(cl_damagetext_offset_screen,          vector, '0 -40 0',  "Damage text offset (screen coordinates)");
 +AUTOCVAR_SAVE(cl_damagetext_offset_world,           vector, '0 0 0',    "Damage text offset (world coordinates relative to player's view)");
  AUTOCVAR_SAVE(cl_damagetext_accumulate_range,       float,  30,         "Damage text spawned within this range is accumulated");
  AUTOCVAR_SAVE(cl_damagetext_accumulate_alpha_rel,   float,  0.65,       "Only update existing damage text when it's above this much percentage (0 to 1) of the starting alpha");
 -AUTOCVAR_SAVE(cl_damagetext_friendlyfire,           bool,   true,       "Show damage text for friendlyfire too");
 +AUTOCVAR_SAVE(cl_damagetext_friendlyfire,           int,    1,          "0: never show for friendly fire, 1: when more than 0 damage, 2: always");
  AUTOCVAR_SAVE(cl_damagetext_friendlyfire_color,     vector, '1 0 0',    "Damage text color for friendlyfire");
  
 -AUTOCVAR_SAVE(cl_damagetext_2d,                     bool,   true,       "Show damagetext in 2D coordinated if the enemy's location is not known");
 +AUTOCVAR_SAVE(cl_damagetext_2d,                     bool,   true,       "Show damagetext in 2D coordinates if the enemy's location is not known");
  AUTOCVAR_SAVE(cl_damagetext_2d_pos,                 vector, '0.47 0.53 0',     "2D damage text initial position (X and Y between 0 and 1)");
  AUTOCVAR_SAVE(cl_damagetext_2d_alpha_start,         float,  1,          "2D damage text initial alpha");
  AUTOCVAR_SAVE(cl_damagetext_2d_alpha_lifetime,      float,  1.3,        "2D damage text lifetime (alpha fading) in seconds");
@@@ -38,7 -36,7 +38,7 @@@ AUTOCVAR_SAVE(cl_damagetext_2d_size_lif
  AUTOCVAR_SAVE(cl_damagetext_2d_velocity,            vector, '-25 0 0',  "2D damage text move direction (screen coordinates)");
  AUTOCVAR_SAVE(cl_damagetext_2d_overlap_offset,      vector, '0 -15 0',  "Offset 2D damage text by this much to prevent overlapping (screen coordinates)");
  AUTOCVAR_SAVE(cl_damagetext_2d_close_range,         float,  125,        "Always use 2D damagetext for hits closer that this");
 -AUTOCVAR_SAVE(cl_damagetext_2d_out_of_view,         bool,   true,       "Always use 2D damagetext for hits that occured off-screen");
 +AUTOCVAR_SAVE(cl_damagetext_2d_out_of_view,         bool,   true,       "Always use 2D damagetext for hits that occurred off-screen");
  
  CLASS(DamageText, Object)
      ATTRIB(DamageText, m_color, vector, autocvar_cl_damagetext_color);
@@@ -62,7 -60,6 +62,7 @@@
  
      void DamageText_draw2d(DamageText this) {
          float since_hit = time - this.hit_time;
 +        // can't use `dt = hit_time - prev_update_time` because shrinking wouldn't be linear
          float size = this.m_size - since_hit * this.m_shrink_rate * this.m_size;
          float alpha_ = this.alpha - since_hit * this.fade_rate;
          if (alpha_ <= 0 || size <= 0) {
          if (this.m_screen_coords) {
              screen_pos = this.origin + since_hit * autocvar_cl_damagetext_2d_velocity;
          } else {
 -            screen_pos = project_3d_to_2d(this.origin + since_hit * autocvar_cl_damagetext_velocity) + autocvar_cl_damagetext_offset;
 +            makevectors(view_angles);
 +            vector world_offset = since_hit * autocvar_cl_damagetext_velocity_world + autocvar_cl_damagetext_offset_world;
 +            vector world_pos = this.origin + world_offset.x * v_forward + world_offset.y * v_right + world_offset.z * v_up;
 +            screen_pos = project_3d_to_2d(world_pos) + since_hit * autocvar_cl_damagetext_velocity_screen + autocvar_cl_damagetext_offset_screen;
          }
          if (screen_pos.z >= 0) {
              screen_pos.z = 0;
              );
          }
  
-         if (this.text) strunzone(this.text);
-         this.text = strzone(s);
+         strcpy(this.text, s);
  
          this.m_size = map_bound_ranges(potential,
              autocvar_cl_damagetext_size_min_damage, autocvar_cl_damagetext_size_max_damage,
      }
  
      DESTRUCTOR(DamageText) {
-         if (this.text) strunzone(this.text);
+         strfree(this.text);
          if (this == DamageText_screen_first) {
              // start from 0 offset again, hopefully, others (if any) will have faded away by now
              DamageText_screen_first = NULL;
      }
  ENDCLASS(DamageText)
  
 +float current_alpha(entity damage_text) {
 +    // alpha doesn't change - actual alpha is always calculated from the initial value
 +    return damage_text.alpha - (time - damage_text.hit_time) * damage_text.fade_rate;
 +}
 +
  NET_HANDLE(damagetext, bool isNew)
  {
      int server_entity_index = ReadByte();
      else potential_damage = ReadShort();
  
      return = true;
 -    if (!autocvar_cl_damagetext) return;
 -    if (friendlyfire && !autocvar_cl_damagetext_friendlyfire) return;
 +    if (autocvar_cl_damagetext == 0) return;
 +    if (friendlyfire) {
 +        if (autocvar_cl_damagetext_friendlyfire == 0) return;
 +        if (autocvar_cl_damagetext_friendlyfire == 1 && health == 0 && armor == 0) return;
 +    }
  
      int client_entity_index = server_entity_index - 1;
      entity entcs = entcs_receiver(client_entity_index);
                  if (e.instanceOfDamageText
                      && !e.m_screen_coords // we're using origin for both world coords and screen coords so avoid mismatches
                      && e.m_group == server_entity_index
 -                    && e.alpha > autocvar_cl_damagetext_accumulate_alpha_rel * autocvar_cl_damagetext_alpha_start) {
 +                    && current_alpha(e) > autocvar_cl_damagetext_accumulate_alpha_rel * autocvar_cl_damagetext_alpha_start) {
                      DamageText_update(e, entcs.origin, e.m_healthdamage + health, e.m_armordamage + armor, e.m_potential_damage + potential_damage, deathtype);
                      return;
                  }
diff --combined xonotic-client.cfg
index c9128c0bb67f0498cc774dae8ee9f06f224addb6,280e9b1e3ea7ddb76d135d6c7382d8fccd3651f2..c229ea3c81c418aafe4ecfff6cbac082dcacd19e
@@@ -60,6 -60,9 +60,9 @@@ seta cl_unpress_zoom_on_death 1 "automa
  seta cl_unpress_zoom_on_weapon_switch 1 "automatically unpress zoom when you switch a weapon"
  seta cl_unpress_attack_on_weapon_switch 0 "automatically unpress fire and fire1 attack buttons when you switch a weapon"
  
+ seta cl_weapon_switch_reload 1 "When trying to switch to the currently held weapon, reload it"
+ seta cl_weapon_switch_fallback_to_impulse 1 "When trying to switch to a weapon that is not available, switch to an alternative from the same impulse"
  seta cl_spawn_event_particles 1 "pointparticles effect whenever a player spawns"
  seta cl_spawn_event_sound 1 "sound effect whenever a player spawns"
  //seta cl_spawn_point_model 0 "place a model at all spawn points" // still needs a model
@@@ -197,6 -200,8 +200,8 @@@ seta cl_hitsound_min_pitch 0.75 "minimu
  seta cl_hitsound_max_pitch 1.5 "maximum pitch of hit sound"
  seta cl_hitsound_nom_damage 25 "damage amount at which hitsound bases pitch off"
  
+ seta cl_eventchase_spectated_change 1 "camera goes into 3rd person mode for a moment when changing spectated player"
+ seta cl_eventchase_spectated_change_time 1 "how much time the effect lasts when changing spectated player"
  seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead; set to 2 to active the effect only when the corpse doesn't move anymore"
  seta cl_eventchase_frozen 0 "camera goes into 3rd person mode when the player is frozen"
  seta cl_eventchase_nexball 1 "camera goes into 3rd person mode when in nexball game-mode"
@@@ -229,11 -234,17 +234,17 @@@ cl_movement 
  cl_movement_track_canjump 0
  cl_stairsmoothspeed 200
  
- alias g_waypointeditor_spawn "impulse 103"
- alias g_waypointeditor_remove "impulse 104"
- alias g_waypointeditor_relinkall "impulse 105"
- alias g_waypointeditor_saveall "impulse 106"
- alias g_waypointeditor_unreachable "impulse 107"
+ alias g_waypointeditor_spawn         "wpeditor spawn"
+ alias g_waypointeditor_remove        "wpeditor remove"
+ alias g_waypointeditor_relinkall     "wpeditor relinkall"
+ alias g_waypointeditor_saveall       "wpeditor saveall"
+ alias g_waypointeditor_unreachable   "wpeditor unreachable"
+ alias navwaypoint_relink        g_waypointeditor_spawn
+ alias navwaypoint_remove        g_waypointeditor_remove
+ alias navwaypoint_save          g_waypointeditor_relinkall
+ alias navwaypoint_spawn         g_waypointeditor_saveall
+ alias navwaypoint_unreachable   g_waypointeditor_unreachable
  
  seta menu_sandbox_spawn_model ""
  seta menu_sandbox_attach_bone ""
@@@ -384,6 -395,7 +395,7 @@@ set g_waypointsprite_spam 0 "Debugging 
  set g_waypointsprite_timealphaexponent 1
  seta g_waypointsprite_turrets 1 "disable turret waypoints"
  seta g_waypointsprite_turrets_maxdist 5000 "max distance for turret waypoints"
+ seta g_waypointsprite_turrets_text 0 "show the turret's name in the waypoint"
  seta g_waypointsprite_uppercase 1
  seta g_waypointsprite_text 0 "Always show text instead of icons, setting this to 0 will still use text if the icon is unavailable"
  seta g_waypointsprite_iconsize 32
@@@ -417,16 -429,13 +429,16 @@@ seta cl_damagetext_size_max 16 "Damage 
  seta cl_damagetext_size_max_damage 140 "How much damage is considered large"
  seta cl_damagetext_alpha_start "1" "Damage text initial alpha"
  seta cl_damagetext_alpha_lifetime "3" "Damage text lifetime in seconds"
 -seta cl_damagetext_velocity "0 0 20" "Damage text move direction"
 -seta cl_damagetext_offset "0 -40 0" "Damage text offset"
 +seta cl_damagetext_velocity_screen "0 0 0" "Damage text move direction (screen coordinates)"
 +seta cl_damagetext_velocity_world "0 0 20" "Damage text move direction (world coordinates relative to player's view)"
 +seta cl_damagetext_offset_screen "0 -40 0" "Damage text offset (screen coordinates)"
 +seta cl_damagetext_offset_world "0 0 0" "Damage text offset (world coordinates relative to player's view)"
  seta cl_damagetext_accumulate_range "30" "Damage text spawned within this range is accumulated"
  seta cl_damagetext_accumulate_alpha_rel "0.65" "Only update existing damage text when it's above this much percentage (0 to 1) of the starting alpha"
  seta cl_damagetext_friendlyfire "1" "Show damage text for friendlyfire too"
  seta cl_damagetext_friendlyfire_color "1 0 0" "Damage text color for friendlyfire"
  
 +seta cl_damagetext_2d 1 "Show damagetext in 2D coordinates if the enemy's location is not known"
  seta cl_damagetext_2d_pos "0.47 0.53 0" "2D damage text initial position (X and Y between 0 and 1)"
  seta cl_damagetext_2d_alpha_start 1 "2D damage text initial alpha"
  seta cl_damagetext_2d_alpha_lifetime 1.3 "2D damage text lifetime (alpha fading) in seconds"
@@@ -434,7 -443,7 +446,7 @@@ seta cl_damagetext_2d_size_lifetime 3 "
  seta cl_damagetext_2d_velocity "-25 0 0" "2D damage text move direction (screen coordinates)"
  seta cl_damagetext_2d_overlap_offset "0 -15 0" "Offset 2D damage text by this much to prevent overlapping (screen coordinates)"
  seta cl_damagetext_2d_close_range 125 "Always use 2D damagetext for hits closer that this"
 -seta cl_damagetext_2d_out_of_view 1 "Always use 2D damagetext for hits that occured off-screen"
 +seta cl_damagetext_2d_out_of_view 1 "Always use 2D damagetext for hits that occurred off-screen"
  
  seta cl_vehicles_alarm 1 "Play an alarm sound when the vehicle you are driving is heavily damaged"
  seta cl_vehicles_hud_tactical 1
@@@ -599,11 -608,12 +611,12 @@@ makesaved music_playlist_random
  
  cl_netfps 60 // should match or be a multiple of sys_ticrate
  
- seta gl_texturecompression 0
+ gl_texture_anisotropy 8
+ seta gl_texturecompression 0 // FIXME the description is wrong - when this is 0, e.g. gl_texturecompression_sky still takes effect
  gl_texturecompression_color 1
  gl_texturecompression_gloss 1
  gl_texturecompression_glow 1
- gl_texturecompression_lightcubemaps 1
+ gl_texturecompression_lightcubemaps 0
  gl_texturecompression_q3bsplightmaps 0
  gl_texturecompression_sky 1
  
@@@ -614,13 -624,13 +627,13 @@@ seta menu_mouse_speed 1 "speed multipli
  set menu_use_default_hostname 1
  alias sethostname "set menu_use_default_hostname 0; hostname $*"
  
- seta cl_weaponpriority "vaporizer hmg rpc vortex fireball mortar machinegun hagar rifle arc electro devastator crylink minelayer shotgun shockwave hlac tuba blaster porto seeker hook" "weapon priority list"
+ seta cl_weaponpriority "vaporizer okhmg okrpc oknex vortex fireball mortar okmachinegun machinegun hagar rifle arc electro devastator crylink minelayer okshotgun shotgun shockwave hlac tuba blaster porto seeker hook" "weapon priority list"
  seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wheel makes use of the weapon priority list (the special value 2 uses the weapon ID list for cycling)"
- seta cl_weaponpriority0 "rpc devastator mortar hagar seeker fireball"                   "use weapon_priority_0_prev for prev gun from this list, weapon_priority_0_best for best gun, weapon_priority_0_next for next gun.  Default value: explosives"
- seta cl_weaponpriority1 "vaporizer vortex crylink hlac arc electro blaster shockwave"   "use weapon_priority_1_prev for prev gun from this list, weapon_priority_1_best for best gun, weapon_priority_1_next for next gun.  Default value: energy"
- seta cl_weaponpriority2 "vaporizer vortex rifle"                                        "use weapon_priority_2_prev for prev gun from this list, weapon_priority_2_best for best gun, weapon_priority_2_next for next gun.  Default value: hitscan exact"
- seta cl_weaponpriority3 "vaporizer hmg vortex rifle machinegun shotgun shockwave"       "use weapon_priority_3_prev for prev gun from this list, weapon_priority_3_best for best gun, weapon_priority_3_next for next gun.  Default value: hitscan all"
- seta cl_weaponpriority4 "mortar minelayer hlac hagar crylink seeker shotgun shockwave"  "use weapon_priority_4_prev for prev gun from this list, weapon_priority_4_best for best gun, weapon_priority_4_next for next gun.  Default value: spam weapons"
+ seta cl_weaponpriority0 "okrpc devastator mortar hagar seeker fireball"                   "use weapon_priority_0_prev for prev gun from this list, weapon_priority_0_best for best gun, weapon_priority_0_next for next gun.  Default value: explosives"
+ seta cl_weaponpriority1 "vaporizer oknex vortex crylink hlac arc electro blaster shockwave"   "use weapon_priority_1_prev for prev gun from this list, weapon_priority_1_best for best gun, weapon_priority_1_next for next gun.  Default value: energy"
+ seta cl_weaponpriority2 "vaporizer oknex vortex rifle"                                        "use weapon_priority_2_prev for prev gun from this list, weapon_priority_2_best for best gun, weapon_priority_2_next for next gun.  Default value: hitscan exact"
+ seta cl_weaponpriority3 "vaporizer okhmg oknex vortex rifle okmachinegun machinegun okshotgun shotgun shockwave"       "use weapon_priority_3_prev for prev gun from this list, weapon_priority_3_best for best gun, weapon_priority_3_next for next gun.  Default value: hitscan all"
+ seta cl_weaponpriority4 "mortar minelayer hlac hagar crylink seeker okshotgun shotgun shockwave"  "use weapon_priority_4_prev for prev gun from this list, weapon_priority_4_best for best gun, weapon_priority_4_next for next gun.  Default value: spam weapons"
  seta cl_weaponpriority5 "blaster shockwave hook porto"                                  "use weapon_priority_5_prev for prev gun from this list, weapon_priority_5_best for best gun, weapon_priority_5_next for next gun.  Default value: weapons for moving"
  seta cl_weaponpriority6 ""                                                              "use weapon_priority_6_prev for prev gun from this list, weapon_priority_6_best for best gun, weapon_priority_6_next for next gun"
  seta cl_weaponpriority7 ""                                                              "use weapon_priority_7_prev for prev gun from this list, weapon_priority_7_best for best gun, weapon_priority_7_next for next gun"
@@@ -645,6 -655,8 +658,8 @@@ seta cl_jetpack_jump 1 "Activate jetpac
  seta cl_race_cptimes_showself 1 "Always show your own times as well as the current best on checkpoints in Race/CTS"
  seta cl_race_cptimes_onlyself 0 "Only show your own times on checkpoints in Race/CTS"
  
+ seta cl_cts_noautoswitch 0 "Prevent forced switching to new weapons in CTS"
  set cl_stripcolorcodes 0      "experimental feature (notes: strips ALL color codes from messages!)"
  
  // Demo camera
@@@ -678,11 -690,10 +693,10 @@@ set cl_effects_lightningarc_drift_end 0
  set cl_effects_lightningarc_branchfactor_start 0.25
  set cl_effects_lightningarc_branchfactor_add 0.1
  
- set menu_updatecheck 1 "check for updates"
  set menu_updatecheck_getpacks 1 "get update packs from update server"
  
- set cl_loddistance1 1024
- set cl_loddistance2 3072
+ seta cl_loddistance1 1024
+ seta cl_loddistance2 3072
  seta cl_playerdetailreduction 4       "the higher, the less detailed player models are displayed (LOD)"
  seta cl_modeldetailreduction 1        "the higher, the less detailed certain map models are displayed (LOD)"
  
@@@ -719,6 -730,8 +733,8 @@@ seta cl_forcemyplayercolors 0 "set to t
  seta cl_movement_errorcompensation 1 "try to compensate for prediction errors and reduce perceived lag"
  seta cl_movement_intermissionrunning 0 "keep velocity after the match ends, players may appear to continue running while stationary"
  
+ seta cl_viewmodel_alpha 0 "Maximum transparency of the view model, set to 0 to disable"
  set debugdraw 0
  set debugdraw_filter ""
  set debugdraw_filterout ""
@@@ -775,17 -788,14 +791,14 @@@ r_cullentities_trace 
  r_shadow_glossexact 1
  r_shadow_glossintensity 1
  
- // use fake light if map has no lightmaps
- r_fakelight 1
+ // use slightly better lighting than r_fullbright if map has no lightmaps, and for fullbrightplayers
+ r_fullbright_directed 1
  
  r_water_hideplayer 1 // hide your own feet/player model in refraction views, this way you don't see half of your body under water
  r_water_refractdistort 0.019
  
  set cl_rainsnow_maxdrawdist 2048
  
- // equalize looks better than fullbright
- r_equalize_entities_fullbright 1
  // safe font defaults
  r_font_hinting 1
  r_font_disable_freetype 0
@@@ -837,11 -847,11 +850,11 @@@ alias menu_sync "menu_cmd sync
  seta cl_items_nofade 0
  seta cl_animate_items 1
  seta cl_ghost_items 0.45 "enable ghosted items (when between 0 and 1, overrides the alpha value)"
- seta cl_ghost_items_color "-1 -1 -1" "color of ghosted items, 0 0 0 leaves the color unchanged"
+ seta cl_ghost_items_color "-1 -1 -1" "color of ghosted items (colormod format: 0 0 0 leaves the color unchanged, negative values allowed)"
  seta cl_simple_items 0 "enable simple items (if server allows)"
  set cl_simpleitems_postfix "_luma" "posfix to add fo model name when simple items are enabled"
  set cl_fullbright_items 0 "enable fullbright items (if server allows, controlled by g_fullbrightitems)"
- set cl_weapon_stay_color "2 0.5 0.5" "Color of picked up weapons when g_weapon_stay > 0"
+ set cl_weapon_stay_color "2 0.5 0.5" "Color of picked up weapons when g_weapon_stay > 0 (colormod format: 0 0 0 leaves the color unchanged, negative values allowed)"
  set cl_weapon_stay_alpha 0.75 "Alpha of picked up weapons when g_weapon_stay > 0"
  
  seta cl_showspectators 0 "Show who's spectating you if server has sv_showspectators enabled"