2. Open gl_model.cFind and comment out this:
Since the glquake dir where the .ms2 files used to be output will no longer be used.Code: Select all
// Baker: no longer need this // sprintf (gldir, "%s/glquake", com_gamedir); // Sys_mkdir (gldir);
3. Open gl_mesh.cFind "GL_MakeAliasModelDisplayLists (mod, pheader);"
Delete the yellow text above ^^ so it reads like this:
Code: Select all
GL_MakeAliasModelDisplayLists (pheader);
Compile, delete c:\quake\id1\glquake folder. Start up newly compiled glquake and you'll notice it no longer builds the .ms2 files "meshing something.mdl ..." nor does it read them.Find this ...
Delete and replace with ...Code: Select all
/* ================ GL_MakeAliasModelDisplayLists ================ */ void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr) { int i, j; maliasgroup_t *paliasgroup; int *cmds; trivertx_t *verts; char cache[MAX_QPATH], fullpath[MAX_OSPATH], *c; FILE *f; int len; byte *data; aliasmodel = m; paliashdr = hdr; // (aliashdr_t *)Mod_Extradata (m); // // look for a cached version // strcpy (cache, "glquake/"); COM_StripExtension (m->name+strlen("progs/"), cache+strlen("glquake/")); strcat (cache, ".ms2"); COM_FOpenFile (cache, &f); if (f) { fread (&numcommands, 4, 1, f); fread (&numorder, 4, 1, f); fread (&commands, numcommands * sizeof(commands[0]), 1, f); fread (&vertexorder, numorder * sizeof(vertexorder[0]), 1, f); fclose (f); } else { // // build it from scratch // Con_Printf ("meshing %s...\n",m->name); BuildTris (); // trifans or lists // // save out the cached version // sprintf (fullpath, "%s/%s", com_gamedir, cache); f = fopen (fullpath, "wb"); if (f) { fwrite (&numcommands, 4, 1, f); fwrite (&numorder, 4, 1, f); fwrite (&commands, numcommands * sizeof(commands[0]), 1, f); fwrite (&vertexorder, numorder * sizeof(vertexorder[0]), 1, f); fclose (f); } } // save the data out paliashdr->poseverts = numorder; cmds = Hunk_Alloc (numcommands * 4); paliashdr->commands = (byte *)cmds - (byte *)paliashdr; memcpy (cmds, commands, numcommands * 4); verts = Hunk_Alloc (paliashdr->numposes * paliashdr->poseverts * sizeof(trivertx_t) ); paliashdr->posedata = (byte *)verts - (byte *)paliashdr; for (i=0 ; i<paliashdr->numposes ; i++) for (j=0 ; j<numorder ; j++) *verts++ = poseverts[i][vertexorder[j]]; }
Code: Select all
void GL_MakeAliasModelDisplayLists (aliashdr_t *paliashdr) { int i, j, *cmds; trivertx_t *verts; // Tonik: don't cache anything, because it seems just as fast // (if not faster) to rebuild the tris instead of loading them from disk BuildTris (); // trifans or lists // save the data out paliashdr->poseverts = numorder; cmds = Hunk_Alloc (numcommands * 4); paliashdr->commands = (byte *)cmds - (byte *)paliashdr; memcpy (cmds, commands, numcommands * 4); verts = Hunk_Alloc (paliashdr->numposes * paliashdr->poseverts * sizeof(trivertx_t)); paliashdr->posedata = (byte *)verts - (byte *)paliashdr; for (i=0 ; i<paliashdr->numposes ; i++) for (j=0 ; j<numorder ; j++) *verts++ = poseverts[i][vertexorder[j]]; }