]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Penguinum/Antiwall
authorMario <zacjardine@y7mail.com>
Sun, 12 Jul 2015 10:46:34 +0000 (20:46 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 12 Jul 2015 10:46:34 +0000 (20:46 +1000)
1  2 
qcsrc/client/wall.qc
qcsrc/client/wall.qh
qcsrc/server/defs.qh
qcsrc/server/g_models.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_triggers.qh

index 6a9f5a440fc1c1d6f0fc366d5110945bda33d300,f591268d358919420adcbd57851bf6e98f8b0356..f9bf9914c6f1ab7bc3587499001bdf223cae75e4
@@@ -1,46 -1,16 +1,57 @@@
  #include "wall.qh"
+ #include "_all.qh"
+ #include "bgmscript.qh"
+ #include "../common/util.qh"
+ #include "../csqcmodellib/interpolate.qh"
+ .float alpha;
+ .float scale;
+ .vector movedir;
  
 +void Ent_Wall_PreDraw()
 +{
 +      if (self.inactive)
 +      {
 +              self.alpha = 0;
 +      }
 +      else
 +      {
 +              vector org;
 +              org = getpropertyvec(VF_ORIGIN);
 +              if(!checkpvs(org, self))
 +                      self.alpha = 0;
 +              else if(self.fade_start || self.fade_end) {
 +                      vector offset = '0 0 0';
 +                      offset_z = self.fade_vertical_offset;
 +                      float player_dist = vlen(org - self.origin - 0.5 * (self.mins + self.maxs) + offset);
 +                      if (self.fade_end == self.fade_start)
 +                      {
 +                              if (player_dist >= self.fade_start)
 +                                      self.alpha = 0;
 +                              else
 +                                      self.alpha = 1;
 +                      }
 +                      else
 +                      {
 +                              self.alpha = (self.alpha_min + self.alpha_max * bound(0,
 +                                                         (self.fade_end - player_dist)
 +                                                         / (self.fade_end - self.fade_start), 1)) / 100.0;
 +                      }
 +              }
 +              else
 +              {
 +                      self.alpha = 1;
 +              }
 +      }
 +      if(self.alpha <= 0)
 +              self.drawmask = 0;
 +      else
 +              self.drawmask = MASK_NORMAL;
 +}
 +
  void Ent_Wall_Draw()
  {
        float f;
index 3094b4373de44f8cf288414b16e6715e93512dde,57aef7e0c51959d9c11eae7b858ded57b3ad2bb9..d84fa46b6cd8812ad6540c9844f385d8ff003ac6
@@@ -1,22 -1,13 +1,23 @@@
  #ifndef WALL_H
  #define WALL_H
  
- .float lip;
- .float bgmscriptangular;
- .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
- .float loddistance1, loddistance2;
- .vector saved;
+ entityclass(Wall);
+ class(Wall) .float lip;
+ class(Wall) .float bgmscriptangular;
+ class(Wall) .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
+ class(Wall) .float loddistance1, loddistance2;
+ class(Wall) .vector saved;
  
 +// Needed for interactive clientwalls
 +.float inactive; // Clientwall disappears when inactive
 +.float alpha_max, alpha_min;
 +// If fade_start > fade_end, fadeout will be inverted
 +// fade_vertical_offset is a vertival offset for player position
 +.float fade_start, fade_end, fade_vertical_offset;
 +.float default_solid;
 +// This variable will be set by trigger
 +.float antiwall_flag;
 +
  void Ent_Wall_Draw();
  
  void Ent_Wall_Remove();
Simple merge
Simple merge
Simple merge
Simple merge