mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-02-02 04:32:24 +00:00
fix a potentially nasty situation with meshes that need to be re-meshed
This commit is contained in:
parent
26a2d6a3de
commit
a19b49d83c
1 changed files with 8 additions and 4 deletions
|
@ -331,15 +331,17 @@ GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s)
|
|||
unsigned char d1[MDFOUR_DIGEST_BYTES];
|
||||
unsigned char d2[MDFOUR_DIGEST_BYTES];
|
||||
struct mdfour md;
|
||||
int c[8192];
|
||||
int nc;
|
||||
int vo[8192];
|
||||
int no;
|
||||
|
||||
memset (d1, 0, sizeof (d1));
|
||||
memset (d2, 0, sizeof (d2));
|
||||
Qread (f, &nc, 4);
|
||||
Qread (f, &no, 4);
|
||||
Qread (f, &commands, nc * sizeof (commands[0]));
|
||||
Qread (f, &vertexorder, no * sizeof (vertexorder[0]));
|
||||
Qread (f, &c, nc * sizeof (c[0]));
|
||||
Qread (f, &vo, no * sizeof (vo[0]));
|
||||
Qread (f, d1, MDFOUR_DIGEST_BYTES);
|
||||
Qread (f, d2, MDFOUR_DIGEST_BYTES);
|
||||
Qclose (f);
|
||||
|
@ -347,8 +349,8 @@ GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s)
|
|||
mdfour_begin (&md);
|
||||
mdfour_update (&md, (unsigned char*)&nc, 4);
|
||||
mdfour_update (&md, (unsigned char*)&no, 4);
|
||||
mdfour_update (&md, (unsigned char*)&commands, nc * sizeof (commands[0]));
|
||||
mdfour_update (&md, (unsigned char*)&vertexorder, no * sizeof (vertexorder[0]));
|
||||
mdfour_update (&md, (unsigned char*)&c, nc * sizeof (c[0]));
|
||||
mdfour_update (&md, (unsigned char*)&vo, no * sizeof (vo[0]));
|
||||
mdfour_update (&md, d1, MDFOUR_DIGEST_BYTES);
|
||||
mdfour_result (&md, mesh_digest);
|
||||
|
||||
|
@ -356,6 +358,8 @@ GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s)
|
|||
remesh = false;
|
||||
numcommands = nc;
|
||||
numorder = no;
|
||||
memcpy (commands, c, numcommands * sizeof (c[0]));
|
||||
memcpy (vertexorder, vo, numorder * sizeof (vo[0]));
|
||||
}
|
||||
}
|
||||
if (remesh) {
|
||||
|
|
Loading…
Reference in a new issue