void MDFNI_SaveMovie(char *fname, uint32 *fb, MDFN_Rect *LineWidths) { gzFile fp; if(current < 0) /* Can't interrupt playback.*/ return; if(current > 0) /* Stop saving. */ { StopRecording(); return; } memset(&RewindBuffer, 0, sizeof(StateMem)); RewindBuffer.initial_malloc = 16; current=CurrentMovie; if(fname) fp = gzopen(fname, "wb3"); else { fp=gzopen(MDFN_MakeFName(MDFNMKF_MOVIE,CurrentMovie,0).c_str(),"wb3"); } if(!fp) return; MDFNSS_SaveFP(fp, fb, LineWidths); gzseek(fp, 0, SEEK_END); gzflush(fp, Z_SYNC_FLUSH); // Flush output so that previews will still work right while // the movie is being recorded. Purely cosmetic. :) slots[current] = fp; current++; MDFN_DispMessage(_("Movie recording started.")); }
void MDFNI_SaveMovie(char *fname, const MDFN_Surface *surface, const MDFN_Rect *DisplayRect, const int32 *LineWidths) { gzFile fp; if(!MDFNGameInfo->StateAction) return; if(MDFNnetplay && (MDFNGameInfo->SaveStateAltersState == true)) { char sb[256]; trio_snprintf(sb, sizeof(sb), _("Module %s is not compatible with manual movie save starting/stopping during netplay."), MDFNGameInfo->shortname); MDFND_NetplayText((const uint8*)sb, false); return; } if(current < 0) /* Can't interrupt playback.*/ return; if(current > 0) /* Stop saving. */ { StopRecording(); return; } memset(&RewindBuffer, 0, sizeof(StateMem)); RewindBuffer.initial_malloc = 16; current = CurrentMovie; if(fname) fp = gzopen(fname, "wb3"); else { fp=gzopen(MDFN_MakeFName(MDFNMKF_MOVIE,CurrentMovie,0).c_str(),"wb3"); } if(!fp) return; MDFNSS_SaveFP(fp, surface, DisplayRect, LineWidths); gzseek(fp, 0, SEEK_END); gzflush(fp, Z_SYNC_FLUSH); // Flush output so that previews will still work right while // the movie is being recorded. Purely cosmetic. :) slots[current] = fp; current++; MDFN_DispMessage(_("Movie recording started.")); }