From 6c6d6d43f3dd133dcd01879e3dee3141672149ab Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 15 Apr 2007 22:58:31 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@964 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/Makefile | 1 + source/src/docs.cpp | 3 ++- source/src/md2.h | 2 ++ source/src/renderhud.cpp | 3 ++- source/src/rendermodel.cpp | 8 +++++++- source/src/rendertext.cpp | 3 ++- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/source/src/Makefile b/source/src/Makefile index a8a40b92..79c7ca4c 100644 --- a/source/src/Makefile +++ b/source/src/Makefile @@ -10,6 +10,7 @@ CLIENT_OBJS= \ clients2c.o \ command.o \ console.o \ + docs.o \ editing.o \ entities.o \ hudgun.o \ diff --git a/source/src/docs.cpp b/source/src/docs.cpp index e997862c..3d6f104b 100644 --- a/source/src/docs.cpp +++ b/source/src/docs.cpp @@ -139,4 +139,5 @@ void renderdoc(int x, int y) } } } -} \ No newline at end of file +} + diff --git a/source/src/md2.h b/source/src/md2.h index 0fa1900f..63018783 100644 --- a/source/src/md2.h +++ b/source/src/md2.h @@ -185,7 +185,9 @@ struct md2 : vertmodel glPushMatrix(); glTranslatef(x, y, z); glRotatef(yaw+180, 0, 0, 1); + glTranslatef(0, 0, 1.9f*scale); glRotatef(pitch, 0, -1, 0); + glTranslatef(0, 0, -1.9f*scale); if(anim&ANIM_MIRROR || scale!=1) glScalef(anim&ANIM_MIRROR ? -scale : scale, scale, scale); parts[0]->render(anim, varseed, speed, basetime, d); glPopMatrix(); diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index c0ade773..854c2903 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -454,4 +454,5 @@ void show_out_of_renderloop_progress(float bar1, const char *text1, float bar2, glEnable(GL_DEPTH_TEST); SDL_GL_SwapBuffers(); -} \ No newline at end of file +} + diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 44c5b684..8ceeb02b 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -238,7 +238,13 @@ void renderclient(playerent *d, char *mdlname, char *vwepname, int tex) { anim = ANIM_ATTACK; speed = 300.0f/8; basetime = d->lastaction; } else if(!d->move && !d->strafe) { anim = ANIM_IDLE|ANIM_LOOP; } else { anim = ANIM_RUN|ANIM_LOOP; speed = 1860/d->maxspeed; } - rendermodel(mdlname, anim, tex, 1.5f, d->o.x, d->o.y, mz, d->yaw+90, d->pitch/4, speed, basetime, d, vwepname); + + float pitch = -d->pitch/4; + int animo = ANIM_CROUCH_IDLE; + float secs = lastmillis/1000.0f; + if((int)secs%2) { pitch = 0; animo = anim; } + else { pitch = 360*(secs - (int)secs); } + rendermodel(mdlname, animo|ANIM_LOOP, tex, 1.5f, d->o.x, d->o.y, mz, d->yaw+90, -pitch/*d->pitch/4*/, speed, basetime, d, vwepname); } extern int democlientnum; diff --git a/source/src/rendertext.cpp b/source/src/rendertext.cpp index 5b0a83ba..80b89f6b 100644 --- a/source/src/rendertext.cpp +++ b/source/src/rendertext.cpp @@ -262,4 +262,5 @@ int draw_textblock(char *text, int x, int y, uint width) } } return numlines; -} \ No newline at end of file +} +