numsprites = check-namelist;
if (!numsprites) return;
sprites = Z_Malloc(numsprites *sizeof(*sprites), PU_STATIC, NULL);
start = firstspritelump-1; end = lastspritelump+1;
//scan all the lump names for each of the names,
//noting the highest frame letter.
//Just compare 4 characters as ints
for (i=0 ; i<numsprites ; i++)
{
spritename = namelist[i];
memset (sprtemp,-1, sizeof(sprtemp));
maxframe = -1;
intname = *(int *)namelist[i];
//scan the lumps,
//filling in the frames for whatever is found for (l=start+1 ; l<end ; l++)
{
if (*(int *)lumpinfo[l].name == intname)
{
frame = lumpinfo[l].name[4] - ’A’; rotation = lumpinfo[l].name[5] - ’0’;
if (modifiedgame)
patched = W_GetNumForName (lumpinfo[l].name);
else
patched = l;
R_InstallSpriteLump (patched, frame, rotation, false);
if (lumpinfo[l].name[6])
{
frame = lumpinfo[l].name[6] - ’A’; rotation = lumpinfo[l].name[7] - ’0’;
R_InstallSpriteLump (l, frame, rotation, true);
}
}
}
// check the frames that were found for completeness if (maxframe == -1)
{
sprites[i].numframes = 0; continue;
}
maxframe++;
for (frame = 0 ; frame < maxframe ; frame++)
{
switch ((int)sprtemp[frame].rotate)
{
case -1:
// no rotations were found for that frame at all I_Error ("R_InitSprites: No patches found "
"for %s frame %c", namelist[i], frame+’A’);
break;