From 350372af0711b9bb12259448d528b00ae21443dc Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sat, 24 Mar 2007 17:57:43 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@866 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/vertmodel.h | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/source/src/vertmodel.h b/source/src/vertmodel.h index a0f3496d..f785b909 100644 --- a/source/src/vertmodel.h +++ b/source/src/vertmodel.h @@ -382,33 +382,11 @@ struct vertmodel : model { }; - void genshadow(int frame, float height, float rad) + void genshadow(int aasize, int frame) { - extern int scr_w, scr_h; - int aasize = 1<<(dynshadowsize + aadynshadow); - while(aasize > scr_w || aasize > scr_h) aasize /= 2; - - glViewport(0, 0, aasize, aasize); - glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-rad, rad, -rad, rad, 0.15f, height); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glRotatef(-90, -1, 0, 0); - - glDisable(GL_FOG); - glColor3f(1, 1, 1); - - glTranslatef(0, -height, 0); - begingenshadow(); render(ANIM_ALL|ANIM_NOINTERP|ANIM_NOSKIN, 0, 1, lastmillis-frame, NULL); - endgenshadow(); - - glEnable(GL_FOG); uchar *pixels = new uchar[aasize*aasize]; glReadPixels(0, 0, aasize, aasize, GL_RED, GL_UNSIGNED_BYTE, pixels); @@ -423,8 +401,6 @@ struct vertmodel : model if(aasize > 1< scr_w || aasize > scr_h) aasize /= 2; + + glViewport(0, 0, aasize, aasize); + glClearColor(0, 0, 0, 1); + glDisable(GL_FOG); + glColor3f(1, 1, 1); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-rad, rad, -rad, rad, 0.15f, height); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glRotatef(-90, -1, 0, 0); + + glTranslatef(0, -height, 0); + begingenshadow(); + loopi(numframes) genshadow(aasize, i); + endgenshadow(); + + glEnable(GL_FOG); + glViewport(0, 0, scr_w, scr_h); }; void rendershadow(int anim, int varseed, float speed, int basetime, const vec &o, float rad, float yaw)