X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcsqcmodellib%2Fcl_model.qc;h=ab93b0172370f1998d6fde329b8a5b65fad7ea43;hb=ef74e1ba8e890befb4a4892a96d244a66c05fd48;hp=e04b92ecc8d81f1a587a9959e3e135d97303ba67;hpb=df2cf141547e4df971d310e2e09bbf1e8d008963;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/csqcmodellib/cl_model.qc b/qcsrc/csqcmodellib/cl_model.qc index e04b92ecc..ab93b0172 100644 --- a/qcsrc/csqcmodellib/cl_model.qc +++ b/qcsrc/csqcmodellib/cl_model.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Rudolf Polzer + * Copyright (c) 2011 Rudolf PolzerCSQCModel_InterpolateAnimation_2To4_PreNote * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -19,17 +19,30 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ - -var float autocvar_cl_lerpanim_maxdelta_framegroups = 0.1; -var float autocvar_cl_nolerp = 0; + #if defined(CSQC) + #include "../dpdefs/csprogsdefs.qh" + #include "../client/defs.qh" + #include "../common/util.qh" + #include "../common/animdecide.qh" + #include "interpolate.qh" + #include "../common/csqcmodel_settings.qh" + #include "common.qh" + #include "cl_model.qh" + #include "cl_player.qh" + #elif defined(MENUQC) + #elif defined(SVQC) + #endif + +float autocvar_cl_lerpanim_maxdelta_framegroups = 0.1; +float autocvar_cl_nolerp = 0; .float csqcmodel_lerpfrac; .float csqcmodel_lerpfrac2; .float csqcmodel_lerpfractime; .float csqcmodel_lerpfrac2time; -void CSQCModel_InterpolateAnimation_2To4_PreNote(float sf) -{ +void CSQCModel_InterpolateAnimation_2To4_PreNote(int sf) +{SELFPARAM(); if(sf & CSQCMODEL_PROPERTY_FRAME) { self.frame3 = self.frame; @@ -47,15 +60,15 @@ void CSQCModel_InterpolateAnimation_2To4_PreNote(float sf) self.lerpfrac = self.csqcmodel_lerpfrac; } } -void CSQCModel_InterpolateAnimation_1To2_PreNote(float sf) -{ +void CSQCModel_InterpolateAnimation_1To2_PreNote(int sf) +{SELFPARAM(); if(sf & CSQCMODEL_PROPERTY_FRAME) { self.frame2 = self.frame; self.frame2time = self.frame1time; } } -void CSQCModel_InterpolateAnimation_PreNote(float sf) +void CSQCModel_InterpolateAnimation_PreNote(int sf) { #ifdef CSQCMODEL_HAVE_TWO_FRAMES CSQCModel_InterpolateAnimation_2To4_PreNote(sf); @@ -64,8 +77,8 @@ void CSQCModel_InterpolateAnimation_PreNote(float sf) #endif } -void CSQCModel_InterpolateAnimation_2To4_Note(float sf, float set_times) -{ +void CSQCModel_InterpolateAnimation_2To4_Note(int sf, float set_times) +{SELFPARAM(); if(sf & CSQCMODEL_PROPERTY_FRAME) { if(set_times) @@ -83,25 +96,25 @@ void CSQCModel_InterpolateAnimation_2To4_Note(float sf, float set_times) self.csqcmodel_lerpfractime = time; } } -void CSQCModel_InterpolateAnimation_1To2_Note(float sf, float set_times) -{ +void CSQCModel_InterpolateAnimation_1To2_Note(int sf, float set_times) +{SELFPARAM(); if(sf & CSQCMODEL_PROPERTY_FRAME) { if(set_times) self.frame1time = time; } } -void CSQCModel_InterpolateAnimation_Note(float sf) +void CSQCModel_InterpolateAnimation_Note(int sf) { #ifdef CSQCMODEL_HAVE_TWO_FRAMES - CSQCModel_InterpolateAnimation_2To4_Note(sf, TRUE); + CSQCModel_InterpolateAnimation_2To4_Note(sf, true); #else - CSQCModel_InterpolateAnimation_1To2_Note(sf, TRUE); + CSQCModel_InterpolateAnimation_1To2_Note(sf, true); #endif } void CSQCModel_InterpolateAnimation_2To4_Do() -{ +{SELFPARAM(); if(autocvar_cl_nolerp || (autocvar_cl_lerpanim_maxdelta_framegroups == 0)) { self.lerpfrac = self.csqcmodel_lerpfrac; @@ -148,7 +161,7 @@ void CSQCModel_InterpolateAnimation_2To4_Do() } } void CSQCModel_InterpolateAnimation_1To2_Do() -{ +{SELFPARAM(); if(autocvar_cl_nolerp || (autocvar_cl_lerpanim_maxdelta_framegroups == 0)) { self.lerpfrac = 0; @@ -171,11 +184,11 @@ void CSQCModel_InterpolateAnimation_Do() } void CSQCModel_Draw() -{ +{SELFPARAM(); // some nice flags for CSQCMODEL_IF and the hooks - local noref float isplayer = (self.entnum >= 1 && self.entnum <= maxclients); - local noref float islocalplayer = (self.entnum == player_localnum + 1); - local noref float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1)); + bool isplayer = (self.entnum >= 1 && self.entnum <= maxclients); + noref bool islocalplayer = (self.entnum == player_localnum + 1); + noref bool isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1)); // we don't do this for the local player as that one is already handled // by CSQCPlayer_SetCamera() @@ -200,15 +213,14 @@ void CSQCModel_Draw() self.csqcmodel_teleported = 0; } -void CSQCModel_Read(float isnew) -{ - float sf; - sf = ReadInt24_t(); +void CSQCModel_Read(bool isnew) +{SELFPARAM(); + int sf = ReadInt24_t(); // some nice flags for CSQCMODEL_IF and the hooks - local noref float isplayer = (self.entnum >= 1 && self.entnum <= maxclients); - local noref float islocalplayer = (self.entnum == player_localnum + 1); - local noref float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1)); + bool isplayer = (self.entnum >= 1 && self.entnum <= maxclients); + bool islocalplayer = (self.entnum == player_localnum + 1); + noref bool isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1)); self.classname = "csqcmodel"; self.iflags |= IFLAG_ORIGIN; // interpolate origin too @@ -263,11 +275,7 @@ void CSQCModel_Read(float isnew) setorigin(self, self.origin); // set obvious render flags -#ifdef COMPAT_XON050_ENGINE - if(self.entnum == player_localentnum || self.entnum == spectatee_status) -#else if(self.entnum == player_localentnum) -#endif self.renderflags |= RF_EXTERNALMODEL; else self.renderflags &= ~RF_EXTERNALMODEL;