some minor cleanups and a probably fix for gl alias models with more than 4

skin groups (blah, arbitryary limits)
This commit is contained in:
Bill Currie 2000-09-27 16:54:38 +00:00
parent d339f14e64
commit f846917a38
2 changed files with 7 additions and 9 deletions

View file

@ -217,7 +217,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinind
for (j=0 ; j<groupskins ; j++) for (j=0 ; j<groupskins ; j++)
{ {
skin = Mod_LoadSkin (skin, skinsize, i, j, true); skin = Mod_LoadSkin (skin, skinsize, i, j&3, true);
} }
k = j; k = j;
for (/* */; j < 4; j++) { for (/* */; j < 4; j++) {

View file

@ -63,9 +63,9 @@ extern int posenum;
void *Mod_LoadSkin (byte *skin, int skinsize, int *pskinindex, int snum, int gnum) void *Mod_LoadSkin (byte *skin, int skinsize, int *pskinindex, int snum, int gnum)
{ {
byte *pskin; byte *pskin;
ushort *pusskin; unsigned short *pusskin;
int i; int i;
pskin = Hunk_AllocName (skinsize * r_pixbytes, loadname); pskin = Hunk_AllocName (skinsize * r_pixbytes, loadname);
*pskinindex = (byte *)pskin - (byte *)pheader; *pskinindex = (byte *)pskin - (byte *)pheader;
@ -75,7 +75,7 @@ void *Mod_LoadSkin (byte *skin, int skinsize, int *pskinindex, int snum, int gnu
memcpy (pskin, skin, skinsize); memcpy (pskin, skin, skinsize);
break; break;
case 2: case 2:
pusskin = (ushort*)skin; pusskin = (unsigned short*)skin;
for (i=0; i<skinsize; i++) for (i=0; i<skinsize; i++)
pusskin[i] = d_8to16table[skin[i]]; pusskin[i] = d_8to16table[skin[i]];
break; break;
@ -104,8 +104,6 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinind
maliasskingroup_t *paliasskingroup; maliasskingroup_t *paliasskingroup;
float *poutskinintervals; float *poutskinintervals;
skin = (byte *)pskintype;
if (numskins < 1 || numskins > MAX_SKINS) if (numskins < 1 || numskins > MAX_SKINS)
Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins); Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins);
@ -117,7 +115,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinind
for (snum=0 ; snum<numskins ; snum++) for (snum=0 ; snum<numskins ; snum++)
{ {
if (pskintype->type == ALIAS_SKIN_SINGLE) { if (pskintype->type == ALIAS_SKIN_SINGLE) {
skin+=4; skin = (byte*)(pskintype+1);
skin = Mod_LoadSkin (skin, skinsize, &pskindesc[snum].skin, snum, 0); skin = Mod_LoadSkin (skin, skinsize, &pskindesc[snum].skin, snum, 0);
} else { } else {
pskintype++; pskintype++;
@ -150,7 +148,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinind
skin = Mod_LoadSkin (skin, skinsize, &paliasskingroup->skindescs[snum].skin, snum, gnum); skin = Mod_LoadSkin (skin, skinsize, &paliasskingroup->skindescs[snum].skin, snum, gnum);
} }
} }
pskintype = (void*)skin; pskintype = (daliasskintype_t*)skin;
} }
return pskintype; return pskintype;