From 8bbc488caabf0ce98fb7385dbd9731d179f87cc9 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 9 Nov 2006 21:02:15 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@550 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/hudgun.cpp | 2 +- source/src/md2.h | 3 ++- source/src/md3.h | 3 ++- source/src/vertmodel.h | 18 +++++++++--------- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/source/src/hudgun.cpp b/source/src/hudgun.cpp index dd251cc5..5978e8eb 100644 --- a/source/src/hudgun.cpp +++ b/source/src/hudgun.cpp @@ -111,7 +111,7 @@ void renderhudgun(int gun, int lastaction, int index = 0) lastanim[index] = wm.anim|(gun<<16); lastswitch[index] = lastmillis; }; - rendermodel(path, wm.anim|(index ? ANIM_MIRROR : 0), 0, 0, wm.pos.x, wm.pos.z, wm.pos.y, player1->yaw + 90, player1->pitch+wm.k_rot, 40.0f, lastswitch[index]); + rendermodel(path, wm.anim|(index ? ANIM_MIRROR : 0), 0, 0, wm.pos.x, wm.pos.z, wm.pos.y, player1->yaw + 90, player1->pitch+wm.k_rot, 40.0f, lastswitch[index], NULL, NULL, 1.28f); }; void renderhudgun() diff --git a/source/src/md2.h b/source/src/md2.h index d9d11d8d..e3e29f70 100644 --- a/source/src/md2.h +++ b/source/src/md2.h @@ -178,7 +178,8 @@ struct md2 : vertmodel glTranslatef(x, y, z); glRotatef(yaw+180, 0, -1, 0); glRotatef(pitch, 0, 0, 1); - parts[0]->render(anim, varseed, speed, basetime, d, scale); + if(scale!=1) glScalef(scale, scale, scale); + parts[0]->render(anim, varseed, speed, basetime, d); glPopMatrix(); if(vwepmdl) diff --git a/source/src/md3.h b/source/src/md3.h index 03b88385..7a073097 100644 --- a/source/src/md3.h +++ b/source/src/md3.h @@ -155,7 +155,8 @@ struct md3 : vertmodel glRotatef(pitch, 0, 0, 1); glRotatef(-90, 0, 1, 0); glRotatef(-90, 1, 0, 0); - parts[0]->render(anim, varseed, speed, basetime, d, scale); + if(scale!=1) glScalef(scale, scale, scale); + parts[0]->render(anim, varseed, speed, basetime, d); glPopMatrix(); }; diff --git a/source/src/vertmodel.h b/source/src/vertmodel.h index 7404de71..d1080eff 100644 --- a/source/src/vertmodel.h +++ b/source/src/vertmodel.h @@ -111,7 +111,7 @@ struct vertmodel : model }; }; - void render(animstate &as, anpos &cur, anpos *prev, float ai_t, float scale) + void render(animstate &as, anpos &cur, anpos *prev, float ai_t) { if(!dynbuf) return; @@ -123,10 +123,10 @@ struct vertmodel : model }; glBindTexture(GL_TEXTURE_2D, id); - if(as.anim&ANIM_MIRROR || scale!=1) + if(as.anim&ANIM_MIRROR) { glPushMatrix(); - glScalef(as.anim&ANIM_MIRROR ? -scale : scale, scale, scale); + glScalef(-1, 1, 1); }; bool isstat = as.frame==0 && as.range==1; if(isstat && statlist) @@ -160,7 +160,7 @@ struct vertmodel : model }; xtraverts += dynlen; }; - if(as.anim&ANIM_MIRROR || scale!=1) glPopMatrix(); + if(as.anim&ANIM_MIRROR) glPopMatrix(); }; }; @@ -299,7 +299,7 @@ struct vertmodel : model return true; }; - void render(int anim, int varseed, float speed, int basetime, dynent *d, float scale) + void render(int anim, int varseed, float speed, int basetime, dynent *d) { if(meshes.length() <= 0) return; animstate as; @@ -318,7 +318,7 @@ struct vertmodel : model ai_t = (lastmillis-d->lastanimswitchtime[index])/(float)animationinterpolationtime; }; - loopv(meshes) meshes[i]->render(as, cur, doai ? &prev : NULL, ai_t, scale); + loopv(meshes) meshes[i]->render(as, cur, doai ? &prev : NULL, ai_t); loopi(numtags) if(links[i]) // render the linked models - interpolate rotation and position of the 'link-tags' { @@ -336,14 +336,14 @@ struct vertmodel : model loopj(3) matrix[j] = ip_ai_tag(transform[0][j]); // transform loopj(3) matrix[4 + j] = ip_ai_tag(transform[1][j]); loopj(3) matrix[8 + j] = ip_ai_tag(transform[2][j]); - loopj(3) matrix[12 + j] = scale*ip_ai_tag(pos[j]); // position + loopj(3) matrix[12 + j] = ip_ai_tag(pos[j]); // position } else { loopj(3) matrix[j] = ip(tag1->transform[0][j], tag2->transform[0][j], cur.t); // transform loopj(3) matrix[4 + j] = ip(tag1->transform[1][j], tag2->transform[1][j], cur.t); loopj(3) matrix[8 + j] = ip(tag1->transform[2][j], tag2->transform[2][j], cur.t); - loopj(3) matrix[12 + j] = scale*ip(tag1->pos[j], tag2->pos[j], cur.t); // position + loopj(3) matrix[12 + j] = ip(tag1->pos[j], tag2->pos[j], cur.t); // position }; #undef ip_ai_tag #undef ip @@ -351,7 +351,7 @@ struct vertmodel : model matrix[15] = 1.0f; glPushMatrix(); glMultMatrixf(matrix); - link->render(anim, varseed, speed, basetime, d, scale); + link->render(anim, varseed, speed, basetime, d); glPopMatrix(); }; };