]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
more stuff
authorRudolf Polzer <divverent@xonotic.org>
Sat, 12 Nov 2011 16:52:46 +0000 (17:52 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 12 Nov 2011 16:52:46 +0000 (17:52 +0100)
qcsrc/client/View.qc
qcsrc/common/csqcmodel.qc
qcsrc/common/csqcmodel.qh

index a8acc086945887eaed2818afee1419503f962530..37f320b43f73fae993f58bb9286d47147daea36f 100644 (file)
@@ -398,11 +398,7 @@ void CSQC_UpdateView(float w, float h)
 
        WaypointSprite_Load();
 
-       if((e = findfloat(world, entnum, player_localentnum)))
-       {
-               R_SetView3fv(VF_ORIGIN, e.origin + e.view_ofs);
-               R_SetView3fv(VF_ANGLES, e.angles);
-       }
+       CSQCModel_SetCamera();
 
        if(spectatee_status)
                myteam = GetPlayerColor(spectatee_status - 1);
index cf5bce68c20e917029f872710741faec32a363e0..688ba7daf03d5c0a695acc3f8be9bc4c08ba8e9d 100644 (file)
@@ -78,12 +78,32 @@ void CSQCModel_LinkEntity()
 
 #ifdef CSQC
 
+void CSQCModel_Draw()
+{
+       InterpolateOrigin_Do();
+}
+
+entity csqcmodel_me;
+void CSQCModel_SetCamera()
+{
+       if(csqcmodel_me)
+       {
+               entity oldself;
+               oldself = self;
+               self = csqcmodel_me;
+               InterpolateOrigin_Do();
+               self = oldself;
+               R_SetView3fv(VF_ORIGIN, csqcmodel_me.origin + csqcmodel_me.view_ofs);
+               //R_SetView3fv(VF_ANGLES, e.angles);
+       }
+}
+
 void CSQCModel_Read()
 {
        float sf;
        sf = ReadShort();
 
-       print("Read an update of flags: ", ftos(sf), "\n");
+       InterpolateOrigin_Undo();
 
 #define PROPERTY(flag,r,w,f) \
        if(sf & flag) \
@@ -96,11 +116,18 @@ void CSQCModel_Read()
 #undef PROPERTY
        
        // if it is the local player, prediction
+
        // interpolation
+       InterpolateOrigin_Note();
 
        // CSQC_UpdateView has to set camera to this if this is the local player
 
        // draw it
+       self.renderflags = RF_EXTERNALMODEL;
+       if(self.entnum == player_localentnum)
+               csqcmodel_me = self;
+       self.drawmask = MASK_NORMAL;
+       self.predraw = CSQCModel_Draw;
 }
 
 #endif
index e8387a2684c12970f09429ef9f52e716db8a6bc4..f1b4c1c68c8a875ff900dce1d07aa5bb3fc01dca 100644 (file)
@@ -6,5 +6,6 @@ void CSQCModel_LinkEntity();
 #endif
 
 #ifdef CSQC
+void CSQCModel_SetCamera();
 void CSQCModel_Read();
 #endif