]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into divVerent/csqcmodel
authorRudolf Polzer <divverent@xonotic.org>
Sun, 4 Dec 2011 15:37:25 +0000 (16:37 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 4 Dec 2011 15:37:25 +0000 (16:37 +0100)
Conflicts:
qcsrc/client/View.qc

1  2 
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/progs.src

diff --combined qcsrc/client/Main.qc
index 572e5981d56b83edd12a4853dd287673d2502688,2252f6f61cec427d69ebe63d9a26eca8394955f3..8c7c6bc0c7a47509695dd131d48682dca0fdf4f8
@@@ -41,55 -41,6 +41,55 @@@ void menu_sub_null(
  float __engine_check;
  #endif
  
 +void precache_playermodel(string m)
 +{
 +      string f;
 +
 +      if(substring(m, -9,5) == "_lod1")
 +              return;
 +      if(substring(m, -9,5) == "_lod2")
 +              return;
 +      precache_model(m);
 +      f = strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1));
 +      if(fexists(f))
 +              precache_model(f);
 +      f = strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1));
 +      if(fexists(f))
 +              precache_model(f);
 +
 +      /*
 +      float globhandle, i, n;
 +      globhandle = search_begin(strcat(m, "_*.sounds"), TRUE, FALSE);
 +      if (globhandle < 0)
 +              return;
 +      n = search_getsize(globhandle);
 +      for (i = 0; i < n; ++i)
 +      {
 +              //print(search_getfilename(globhandle, i), "\n");
 +              f = search_getfilename(globhandle, i);
 +              PrecachePlayerSounds(f);
 +      }
 +      search_end(globhandle);
 +      */
 +}
 +void precache_all_playermodels(string pattern)
 +{
 +      float globhandle, i, n;
 +      string f;
 +
 +      globhandle = search_begin(pattern, TRUE, FALSE);
 +      if (globhandle < 0)
 +              return;
 +      n = search_getsize(globhandle);
 +      for (i = 0; i < n; ++i)
 +      {
 +              //print(search_getfilename(globhandle, i), "\n");
 +              f = search_getfilename(globhandle, i);
 +              precache_playermodel(f);
 +      }
 +      search_end(globhandle);
 +}
 +
  string forcefog;
  void WaypointSprite_Load();
  void CSQC_Init(void)
  
        float i;
  
+ #ifdef COMPAT_XON050_ENGINE
+       // old engine lacks implementation of player_localnum
+       player_localnum = player_localentnum - 1;
+ #endif
        binddb = db_create();
        tempdb = db_create();
        ClientProgsDB = db_load("client.db");
        precache_model("null");
        precache_sound("misc/hit.wav");
        precache_sound("misc/typehit.wav");
 +      if (autocvar_cl_precacheplayermodels)
 +      {
 +              precache_all_playermodels("models/player/*.zym");
 +              precache_all_playermodels("models/player/*.dpm");
 +              precache_all_playermodels("models/player/*.md3");
 +              precache_all_playermodels("models/player/*.psk");
 +              precache_all_playermodels("models/player/*.iqm");
 +      }
 +
        Projectile_Precache();
        Hook_Precache();
        GibSplash_Precache();
@@@ -864,7 -811,7 +869,7 @@@ void Ent_ClientData(
        if(f & 2)
        {
                newspectatee_status = ReadByte();
-               if(newspectatee_status == player_localentnum)
+               if(newspectatee_status == player_localnum + 1)
                        newspectatee_status = -1; // observing
        }
        else
                        prev_health = -1;
        }
        spectatee_status = newspectatee_status;
+       // non-COMPAT_XON050_ENGINE: we could get rid of spectatee_status, and derive it from player_localentnum and player_localnum
  }
  
  void Ent_Nagger()
@@@ -1067,7 -1016,6 +1074,7 @@@ void CSQC_Ent_Update(float bIsNewEntity
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
                case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
                case ENT_CLIENT_TURRET: ent_turret(); break; 
 +              case ENT_CLIENT_MODEL: CSQCModel_Read(); break; 
                default:
                        //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
                        error(sprintf(_("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n"), self.enttype, num_for_edict(self), self.classname));
@@@ -1345,7 -1293,7 +1352,7 @@@ void Net_ReadRace(
                                strunzone(grecordholder[pos-1]);
                        grecordholder[pos-1] = strzone(ReadString());
                        grecordtime[pos-1] = ReadInt24_t();
-                       if(grecordholder[pos-1] == GetPlayerName(player_localentnum -1))
+                       if(grecordholder[pos-1] == GetPlayerName(player_localnum))
                                race_myrank = pos;
                        break;
                case RACE_NET_SERVER_STATUS:
diff --combined qcsrc/client/View.qc
index f8e054df86a53d898ce8b2f71de1dad63b425f40,d9f6df7ee77281fdf2e52b650d25680dec5f72a9..ac2f12cb52a9eba1196579b8616b4a6631d6d53a
@@@ -371,6 -371,7 +371,7 @@@ void CSQC_UpdateView(float w, float h
        vector v;
        vector vf_size, vf_min;
        float a;
        hud = getstati(STAT_HUD);
  
        if(checkextension("DP_CSQC_MINFPS_QUALITY"))
  
        WaypointSprite_Load();
  
 +      CSQCPlayer_SetCamera();
 +
+ #ifdef COMPAT_XON050_ENGINE
        if(spectatee_status)
                myteam = GetPlayerColor(spectatee_status - 1);
        else
+ #endif
                myteam = GetPlayerColor(player_localentnum - 1);
  
        ticrate = getstatf(STAT_MOVEVARS_TICRATE) * getstatf(STAT_MOVEVARS_TIMESCALE);
diff --combined qcsrc/client/progs.src
index 9abb3a81f1d6c5b99dfd08fc54e4e9570dcd187e,06b3e8b7b751469e5d126a7aeb22bb9f3cb8e552..1a303f4f42d57916214aa3db15c804fce89f4294
@@@ -22,7 -22,7 +22,7 @@@ Defs.q
  
  autocvars.qh
  
 -interpolate.qh
 +../csqcmodel/interpolate.qh
  teamradar.qh
  hud.qh
  scoreboard.qh
@@@ -37,23 -37,16 +37,21 @@@ tturrets.q
  ../server/movelib.qc
  main.qh
  vehicles/vehicles.qh
 +../csqcmodel/settings.qh
 +../csqcmodel/common.qh
 +../csqcmodel/cl_model.qh
 +../csqcmodel/cl_player.qh
  
  sortlist.qc
  miscfunctions.qc
  teamplay.qc
  
- ctf.qc
  teamradar.qc
  hud_config.qc
  hud.qc
  scoreboard.qc
  mapvoting.qc
 +csqcmodel_hooks.qc
  
  rubble.qc
  hook.qc
@@@ -63,8 -56,6 +61,8 @@@ projectile.q
  gibs.qc
  damage.qc
  casings.qc
 +../csqcmodel/cl_model.qc
 +../csqcmodel/cl_player.qc
  effects.qc
  wall.qc
  modeleffects.qc
@@@ -78,7 -69,7 +76,7 @@@ shownames.q
  announcer.qc
  Main.qc
  View.qc
 -interpolate.qc
 +../csqcmodel/interpolate.qc
  waypointsprites.qc
  movetypes.qc
  prandom.qc