*** empty log message ***
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@982 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+2
-3
@@ -235,13 +235,12 @@ struct md2 : vertmodel
|
||||
}
|
||||
};
|
||||
|
||||
void md2anim(char *anim, char *frame, char *range, char *s)
|
||||
void md2anim(char *anim, char *frame, char *range, char *speed)
|
||||
{
|
||||
if(!loadingmd2 || loadingmd2->parts.empty()) { conoutf("not loading an md2"); return; }
|
||||
int num = findanim(anim);
|
||||
if(num<0) { conoutf("could not find animation %s", anim); return; }
|
||||
float speed = s[0] ? atof(s) : 100.0f;
|
||||
loadingmd2->parts.last()->setanim(num, atoi(frame), atoi(range), speed);
|
||||
loadingmd2->parts.last()->setanim(num, atoi(frame), atoi(range), atof(speed));
|
||||
}
|
||||
|
||||
COMMAND(md2anim, ARG_4STR);
|
||||
|
||||
+2
-3
@@ -240,13 +240,12 @@ void md3skin(char *objname, char *skin)
|
||||
}
|
||||
}
|
||||
|
||||
void md3anim(char *anim, char *startframe, char *range, char *s)
|
||||
void md3anim(char *anim, char *startframe, char *range, char *speed)
|
||||
{
|
||||
if(!loadingmd3 || loadingmd3->parts.empty()) { conoutf("not loading an md3"); return; };
|
||||
float speed = s[0] ? atof(s) : 100.0f;
|
||||
int num = findanim(anim);
|
||||
if(num<0) { conoutf("could not find animation %s", anim); return; };
|
||||
loadingmd3->parts.last()->setanim(num, atoi(startframe), atoi(range), speed);
|
||||
loadingmd3->parts.last()->setanim(num, atoi(startframe), atoi(range), atof(speed));
|
||||
}
|
||||
|
||||
void md3link(char *parentno, char *childno, char *tagname)
|
||||
|
||||
@@ -150,7 +150,7 @@ void rendermenumdl()
|
||||
s_sprintfd(skin)("packages/models/%s.jpg", m.mdl);
|
||||
tex = -(int)textureload(skin)->id;
|
||||
}
|
||||
rendermodel(isplayermodel ? (char *)"playermodels" : m.mdl, m.anim, tex, 0, pos.x, pos.y, pos.z, yaw, 0, 100, 0, NULL, isplayermodel ? (char*)"weapons/subgun/world" : NULL, m.scale ? m.scale/25.0f : 1.0f);
|
||||
rendermodel(isplayermodel ? (char *)"playermodels" : m.mdl, m.anim, tex, 0, pos.x, pos.y, pos.z, yaw, 0, 0, 0, NULL, isplayermodel ? (char*)"weapons/subgun/world" : NULL, m.scale ? m.scale/25.0f : 1.0f);
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ extern void music(char *name);
|
||||
|
||||
// rendermodel
|
||||
extern void rendershadow(playerent *d);
|
||||
extern void rendermodel(char *mdl, int anim, int tex, float rad, float x, float y, float z, float yaw, float pitch, float speed, int basetime = 0, playerent *d = NULL, char *vwepmdl = NULL, float scale = 1.0f);
|
||||
extern void rendermodel(char *mdl, int anim, int tex, float rad, float x, float y, float z, float yaw, float pitch, float speed = 0, int basetime = 0, playerent *d = NULL, char *vwepmdl = NULL, float scale = 1.0f);
|
||||
extern mapmodelinfo &getmminfo(int i);
|
||||
extern int findanim(const char *name);
|
||||
extern void loadskin(const char *dir, const char *altdir, Texture *&skin, model *m);
|
||||
|
||||
@@ -206,7 +206,7 @@ void renderclient(playerent *d, char *mdlname, char *vwepname, int tex)
|
||||
{
|
||||
int varseed = (int)(size_t)d;
|
||||
int anim = ANIM_IDLE|ANIM_LOOP;
|
||||
float speed = 100.0f;
|
||||
float speed = 0.0;
|
||||
float mz = d->o.z-d->eyeheight;
|
||||
int basetime = -((int)(size_t)d&0xFFF);
|
||||
if(d->state==CS_DEAD)
|
||||
|
||||
+6
-12
@@ -248,22 +248,21 @@ struct vertmodel : model
|
||||
loopv(meshes) meshes[i]->gendyn();
|
||||
}
|
||||
|
||||
virtual void getdefaultanim(animstate &as, int anim, int varseed, float speed)
|
||||
virtual void getdefaultanim(animstate &as, int anim, int varseed)
|
||||
{
|
||||
as.frame = 0;
|
||||
as.range = 1;
|
||||
as.speed = speed;
|
||||
}
|
||||
|
||||
bool calcanimstate(int anim, int varseed, float speed, int basetime, dynent *d, animstate &as)
|
||||
{
|
||||
as.anim = anim;
|
||||
as.speed = speed<=0 ? 100.0f : speed;
|
||||
as.basetime = basetime;
|
||||
if((anim&ANIM_INDEX)==ANIM_ALL)
|
||||
{
|
||||
as.frame = 0;
|
||||
as.range = numframes;
|
||||
as.speed = speed;
|
||||
}
|
||||
else if(anims)
|
||||
{
|
||||
@@ -273,16 +272,11 @@ struct vertmodel : model
|
||||
animinfo &ai = ais[varseed%ais.length()];
|
||||
as.frame = ai.frame;
|
||||
as.range = ai.range;
|
||||
as.speed = speed*100.0f/ai.speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
as.frame = 0;
|
||||
as.range = 1;
|
||||
as.speed = speed;
|
||||
if(ai.speed>0) as.speed = 1000.0f/ai.speed;
|
||||
}
|
||||
else getdefaultanim(as, anim&ANIM_INDEX, varseed);
|
||||
}
|
||||
else getdefaultanim(as, anim&ANIM_INDEX, varseed, speed);
|
||||
else getdefaultanim(as, anim&ANIM_INDEX, varseed);
|
||||
if(anim&(ANIM_START|ANIM_END))
|
||||
{
|
||||
if(anim&ANIM_END) as.frame += as.range-1;
|
||||
@@ -315,7 +309,7 @@ struct vertmodel : model
|
||||
|
||||
void render(int anim, int varseed, float speed, int basetime, dynent *d)
|
||||
{
|
||||
if(meshes.length() <= 0) return;
|
||||
if(meshes.empty()) return;
|
||||
animstate as;
|
||||
if(!calcanimstate(anim, varseed, speed, basetime, d, as)) return;
|
||||
|
||||
|
||||
@@ -409,7 +409,7 @@ void renderbounceents()
|
||||
}
|
||||
}
|
||||
path(model);
|
||||
rendermodel(model, ANIM_MAPMODEL|ANIM_LOOP, 0, 1.1f, p->o.x, p->o.y, z, p->yaw+90, p->pitch, 10.0f);
|
||||
rendermodel(model, ANIM_MAPMODEL|ANIM_LOOP, 0, 1.1f, p->o.x, p->o.y, z, p->yaw+90, p->pitch);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user