From: Seth G. <sga...@li...> - 2002-01-05 03:37:18
|
I have commited the code that renders high precison models in software. GL rendering should be easy, and fortunately my sister's car broke down and I can't drive so I don't have to fix her computer tommorow and can work on QF instead :-) Also I want to remove the last vestiges of hard coded vertex limits from sw_ralias.c and sw32_ralias.c. In both cases it's these two temporary arrays in R_AliasDrawModel. In fact here's the whole function: #define MAXALIASVERTS 1024 void R_AliasDrawModel (alight_t *plighting) { finalvert_t finalverts[MAXALIASVERTS + ((CACHE_SIZE - 1) / sizeof (finalvert_t)) + 1]; auxvert_t auxverts[MAXALIASVERTS]; r_amodels_drawn++; // cache align pfinalverts = (finalvert_t *) (((long) &finalverts[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1)); pauxverts = &auxverts[0]; paliashdr = Cache_Get (¤tentity->model->cache); pmdl = (mdl_t *) ((byte *) paliashdr + paliashdr->model); R_AliasSetupSkin (); R_AliasSetUpTransform (currententity->trivial_accept); R_AliasSetupLighting (plighting); R_AliasSetupFrame (); if (!currententity->colormap) Sys_Error ("R_AliasDrawModel: !currententity->colormap"); acolormap = currententity->colormap; if (acolormap == &vid.colormap8 && r_pixbytes != 1) { if (r_pixbytes == 2) acolormap = vid.colormap16; else if (r_pixbytes == 4) acolormap = vid.colormap32; else Sys_Error("R_AliasDrawmodel: unsupported r_pixbytes %i\n", r_pixbytes); } if (currententity != r_view_model) ziscale = (float) 0x8000 *(float) 0x10000; else ziscale = (float) 0x8000 *(float) 0x10000 *3.0; if (currententity->trivial_accept && pmdl->ident != POLYHEADER16) R_AliasPrepareUnclippedPoints (); else R_AliasPreparePoints (); Cache_Release (¤tentity->model->cache); } I'd like these arrays to be either dynamically sized or resized, with no hardcoded limit. What is the best way to do that? __ __ _ _ __ __ _/ \__/ \__/ Seth Galbraith "The Serpent Lord" \__/ \__/ \_ \__/ \__/ \_ sga...@kr... #2244199 on ICQ _/ \__/ \__/ _/ \__/ \__/ http://www.planetquake.com/gg \__/ \__/ \_ |