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

@@@ -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;
@@@ -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