loadmodel->animscenes[i].firstframe = i;
loadmodel->animscenes[i].framecount = 1;
loadmodel->animscenes[i].loop = true;
- loadmodel->animscenes[i].framerate = 10;
+ loadmodel->animscenes[i].framerate = anims[index].fps;
}
}
dpsnprintf(loadmodel->animscenes[j].name, sizeof(loadmodel->animscenes[i].name), "%s_%d", &text[anim[i].name], j - anim[i].first_frame);
loadmodel->animscenes[j].firstframe = j;
loadmodel->animscenes[j].framecount = 1;
- loadmodel->animscenes[j].loop = true;
- loadmodel->animscenes[j].framerate = 10;
+ loadmodel->animscenes[i].loop = ((anim[i].flags & IQM_LOOP) != 0);
+ loadmodel->animscenes[j].framerate = anim[i].framerate;
}
}
char animname2[MAX_QPATH];
char zymtextbuffer[16384];
char dpmtextbuffer[16384];
+ char framegroupstextbuffer[16384];
int zymtextsize = 0;
int dpmtextsize = 0;
+ int framegroupstextsize = 0;
if (Cmd_Argc() != 2)
{
Mod_Decompile_SMD(mod, outname, first, count, false);
if (zymtextsize < (int)sizeof(zymtextbuffer) - 100)
{
- l = dpsnprintf(zymtextbuffer + zymtextsize, sizeof(zymtextbuffer) - zymtextsize, "scene %s.smd fps %g\n", animname, mod->animscenes[i].framerate);
+ l = dpsnprintf(zymtextbuffer + zymtextsize, sizeof(zymtextbuffer) - zymtextsize, "scene %s.smd fps %g %s\n", animname, mod->animscenes[i].framerate, mod->animscenes[i].loop ? "" : " noloop");
if (l > 0) zymtextsize += l;
}
if (dpmtextsize < (int)sizeof(dpmtextbuffer) - 100)
{
- l = dpsnprintf(dpmtextbuffer + dpmtextsize, sizeof(dpmtextbuffer) - dpmtextsize, "scene %s.smd\n", animname);
+ l = dpsnprintf(dpmtextbuffer + dpmtextsize, sizeof(dpmtextbuffer) - dpmtextsize, "scene %s.smd fps %g %s\n", animname, mod->animscenes[i].framerate, mod->animscenes[i].loop ? "" : " noloop");
if (l > 0) dpmtextsize += l;
}
+ if (framegroupstextsize < (int)sizeof(framegroupstextbuffer) - 100)
+ {
+ l = dpsnprintf(framegroupstextbuffer + framegroupstextsize, sizeof(framegroupstextbuffer) - framegroupstextsize, "%d %d %f %d // %s\n", first, count, mod->animscenes[i].framerate, mod->animscenes[i].loop, animname);
+ if (l > 0) framegroupstextsize += l;
+ }
}
if (zymtextsize)
FS_WriteFile(va("%s_decompiled/out_zym.txt", basename), zymtextbuffer, (fs_offset_t)zymtextsize);
if (dpmtextsize)
FS_WriteFile(va("%s_decompiled/out_dpm.txt", basename), dpmtextbuffer, (fs_offset_t)dpmtextsize);
+ if (framegroupstextsize)
+ FS_WriteFile(va("%s_decompiled.framegroups", basename), framegroupstextbuffer, (fs_offset_t)framegroupstextsize);
}
}