huge weapon-code cleanup (buggy!), pch, demo fix

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1475 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-12-24 21:38:53 +00:00
parent 8ace59243e
commit 9c3e74cbdf
47 changed files with 795 additions and 627 deletions
+4 -3
View File
@@ -1,3 +1,4 @@
#include "pch.h"
#include "cube.h"
VARP(animationinterpolationtime, 0, 150, 1000);
@@ -294,7 +295,7 @@ void preload_playermodels()
if(dynshadow && playermdl) playermdl->genshadows(8.0f, 4.0f);
loopi(NUMGUNS)
{
s_sprintfd(vwep)("weapons/%s/world", gunnames[i]);
s_sprintfd(vwep)("weapons/%s/world", guns[i].modelname);
model *vwepmdl = loadmodel(vwep);
if(dynshadow && vwepmdl) vwepmdl->genshadows(8.0f, 4.0f);
}
@@ -360,7 +361,7 @@ void renderclient(playerent *d, char *mdlname, char *vwepname, int tex)
else if(d->state==CS_LAGGED) { anim = ANIM_SALUTE|ANIM_LOOP; }
else if(lastmillis-d->lastpain<300) { anim = d->crouching ? ANIM_CROUCH_PAIN : ANIM_PAIN; speed = 300.0f/4; varseed += d->lastpain; basetime = d->lastpain; }
else if(!d->onfloor && d->timeinair>50) { anim = ANIM_JUMP|ANIM_END; }
else if(d->gunselect==d->lastattackgun && lastmillis-d->lastaction<300) { anim = d->crouching ? ANIM_CROUCH_ATTACK : ANIM_ATTACK; speed = 300.0f/8; basetime = d->lastaction; }
else if(d->weaponsel==d->lastattackweapon && lastmillis-d->lastaction<300) { anim = d->crouching ? ANIM_CROUCH_ATTACK : ANIM_ATTACK; speed = 300.0f/8; basetime = d->lastaction; }
else if(!d->move && !d->strafe) { anim = (d->crouching ? ANIM_CROUCH_IDLE : ANIM_IDLE)|ANIM_LOOP; }
else { anim = (d->crouching ? ANIM_CROUCH_WALK : ANIM_RUN)|ANIM_LOOP; speed = 1860/d->maxspeed; }
@@ -383,7 +384,7 @@ void renderclient(playerent *d)
case 2: default: s_sprintf(skin)("%s/%s/%s.jpg", skinbase, team_string(team), team ? "blue" : "red"); break;
}
string vwep;
if(d->gunselect>=0 && d->gunselect<NUMGUNS) s_sprintf(vwep)("weapons/%s/world", gunnames[d->gunselect]);
if(d->weaponsel) s_sprintf(vwep)("weapons/%s/world", d->weaponsel->info.modelname);
else vwep[0] = 0;
renderclient(d, "playermodels", vwep[0] ? vwep : NULL, -(int)textureload(skin)->id);
}