mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 18:31:27 +00:00
Pseudo merge gl and sw Mod_LoadAliasGroup.
Interestingly, this didn't break gl alias model renderering (but then, it does weird things to the data anyway).
This commit is contained in:
parent
1f8db5fe3a
commit
c0d37ddc1e
2 changed files with 27 additions and 20 deletions
libs/models/alias
|
@ -143,7 +143,9 @@ Mod_LoadAliasGroup (void *pin, int *posenum, maliasframedesc_t *frame,
|
|||
{
|
||||
daliasgroup_t *pingroup;
|
||||
daliasinterval_t *pin_intervals;
|
||||
float *poutintervals;
|
||||
int i, numframes;
|
||||
maliasgroup_t *paliasgroup;
|
||||
void *ptemp;
|
||||
|
||||
pingroup = (daliasgroup_t *) pin;
|
||||
|
@ -153,6 +155,11 @@ Mod_LoadAliasGroup (void *pin, int *posenum, maliasframedesc_t *frame,
|
|||
frame->firstpose = (*posenum);
|
||||
frame->numposes = numframes;
|
||||
|
||||
paliasgroup = Hunk_AllocName (field_offset (maliasgroup_t,
|
||||
frames[numframes]), loadname);
|
||||
paliasgroup->numframes = numframes;
|
||||
frame->frame = (byte *) paliasgroup - (byte *) pheader;
|
||||
|
||||
// these are byte values, so we don't have to worry about endianness
|
||||
VectorCopy (pingroup->bboxmin.v, frame->bboxmin.v);
|
||||
VectorCopy (pingroup->bboxmax.v, frame->bboxmax.v);
|
||||
|
@ -160,23 +167,25 @@ Mod_LoadAliasGroup (void *pin, int *posenum, maliasframedesc_t *frame,
|
|||
VectorCompMax (frame->bboxmax.v, aliasbboxmaxs, aliasbboxmaxs);
|
||||
|
||||
pin_intervals = (daliasinterval_t *) (pingroup + 1);
|
||||
|
||||
poutintervals = Hunk_AllocName (numframes * sizeof (float), loadname);
|
||||
paliasgroup->intervals = (byte *) poutintervals - (byte *) pheader;
|
||||
frame->interval = LittleFloat (pin_intervals->interval);
|
||||
|
||||
pin_intervals += numframes;
|
||||
for (i = 0; i < numframes; i++) {
|
||||
*poutintervals = LittleFloat (pin_intervals->interval);
|
||||
if (*poutintervals <= 0.0)
|
||||
Sys_Error ("Mod_LoadAliasGroup: interval<=0");
|
||||
poutintervals++;
|
||||
pin_intervals++;
|
||||
}
|
||||
|
||||
ptemp = (void *) pin_intervals;
|
||||
|
||||
for (i = 0; i < numframes; i++) {
|
||||
poseverts[(*posenum)] = (trivertx_t *) ((daliasframe_t *) ptemp + 1);
|
||||
(*posenum)++;
|
||||
if (extra)
|
||||
ptemp = (trivertx_t *) ((daliasframe_t *) ptemp + 1)
|
||||
+ pheader->mdl.numverts * 2;
|
||||
else
|
||||
ptemp = (trivertx_t *) ((daliasframe_t *) ptemp + 1)
|
||||
+ pheader->mdl.numverts;
|
||||
maliasframedesc_t temp_frame;
|
||||
ptemp = Mod_LoadAliasFrame (ptemp, posenum, &temp_frame, extra);
|
||||
memcpy (&paliasgroup->frames[i], &temp_frame,
|
||||
sizeof (paliasgroup->frames[i]));
|
||||
}
|
||||
|
||||
return ptemp;
|
||||
}
|
||||
|
||||
|
|
|
@ -178,9 +178,13 @@ Mod_LoadAliasGroup (void *pin, int *posenum, maliasframedesc_t *frame,
|
|||
|
||||
numframes = LittleLong (pingroup->numframes);
|
||||
|
||||
frame->firstpose = (*posenum);
|
||||
frame->numposes = numframes;
|
||||
|
||||
paliasgroup = Hunk_AllocName (field_offset (maliasgroup_t,
|
||||
frames[numframes]), loadname);
|
||||
paliasgroup->numframes = numframes;
|
||||
frame->frame = (byte *) paliasgroup - (byte *) pheader;
|
||||
|
||||
// these are byte values, so we don't have to worry about endianness
|
||||
VectorCopy (pingroup->bboxmin.v, frame->bboxmin.v);
|
||||
|
@ -188,30 +192,24 @@ Mod_LoadAliasGroup (void *pin, int *posenum, maliasframedesc_t *frame,
|
|||
VectorCompMin (frame->bboxmin.v, aliasbboxmins, aliasbboxmins);
|
||||
VectorCompMax (frame->bboxmax.v, aliasbboxmaxs, aliasbboxmaxs);
|
||||
|
||||
frame->frame = (byte *) paliasgroup - (byte *) pheader;
|
||||
|
||||
pin_intervals = (daliasinterval_t *) (pingroup + 1);
|
||||
|
||||
poutintervals = Hunk_AllocName (numframes * sizeof (float), loadname);
|
||||
|
||||
paliasgroup->intervals = (byte *) poutintervals - (byte *) pheader;
|
||||
|
||||
frame->interval = LittleFloat (pin_intervals->interval);
|
||||
for (i = 0; i < numframes; i++) {
|
||||
*poutintervals = LittleFloat (pin_intervals->interval);
|
||||
if (*poutintervals <= 0.0)
|
||||
Sys_Error ("Mod_LoadAliasGroup: interval<=0");
|
||||
|
||||
poutintervals++;
|
||||
pin_intervals++;
|
||||
}
|
||||
|
||||
ptemp = (void *) pin_intervals;
|
||||
|
||||
for (i = 0; i < numframes; i++) {
|
||||
maliasframedesc_t temp_frame;
|
||||
ptemp = Mod_LoadAliasFrame (ptemp, posenum, &temp_frame, extra);
|
||||
memcpy (&paliasgroup->frames[i], &temp_frame,
|
||||
sizeof(paliasgroup->frames[i]));
|
||||
sizeof (paliasgroup->frames[i]));
|
||||
}
|
||||
|
||||
return ptemp;
|
||||
|
|
Loading…
Reference in a new issue