本文整理汇总了C++中PLAYBACK::restartPlaybackFromZeroGround方法的典型用法代码示例。如果您正苦于以下问题:C++ PLAYBACK::restartPlaybackFromZeroGround方法的具体用法?C++ PLAYBACK::restartPlaybackFromZeroGround怎么用?C++ PLAYBACK::restartPlaybackFromZeroGround使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PLAYBACK
的用法示例。
在下文中一共展示了PLAYBACK::restartPlaybackFromZeroGround方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createNewProject
void createNewProject()
{
if (!askToSaveProject()) return;
static struct NewProjectParameters params;
if (DialogBoxParam(fceu_hInstance, MAKEINTRESOURCE(IDD_TASEDITOR_NEWPROJECT), taseditorWindow.hwndTASEditor, newProjectProc, (LPARAM)¶ms) > 0)
{
FCEUMOV_CreateCleanMovie();
// apply selected options
setInputType(currMovieData, params.inputType);
applyMovieInputConfig();
if (params.copyCurrentInput)
// copy Input from current snapshot (from history)
history.getCurrentSnapshot().inputlog.toMovie(currMovieData);
if (!params.copyCurrentMarkers)
markersManager.reset();
if (params.authorName != L"") currMovieData.comments.push_back(L"author " + params.authorName);
// reset Taseditor
project.init(); // new project has blank name
greenzone.reset();
if (params.copyCurrentInput)
// copy LagLog from current snapshot (from history)
greenzone.lagLog = history.getCurrentSnapshot().laglog;
playback.reset();
playback.restartPlaybackFromZeroGround();
bookmarks.reset();
branches.reset();
history.reset();
pianoRoll.reset();
selection.reset();
editor.reset();
splicer.reset();
recorder.reset();
popupDisplay.reset();
taseditorWindow.redraw();
taseditorWindow.updateCaption();
}
}
示例2: load
// returns true if couldn't load
bool GREENZONE::load(EMUFILE *is, unsigned int offset)
{
free();
if (offset)
{
if (is->fseek(offset, SEEK_SET)) goto error;
} else
{
reset();
playback.restartPlaybackFromZeroGround(); // reset Playback cursor to frame 0
return false;
}
int frame = 0, prev_frame = -1, size = 0;
int last_tick = 0;
// read "GREENZONE" string
char save_id[GREENZONE_ID_LEN];
if ((int)is->fread(save_id, GREENZONE_ID_LEN) < GREENZONE_ID_LEN) goto error;
if (!strcmp(greenzone_skipsave_id, save_id))
{
// string says to skip loading Greenzone
// read LagLog
lagLog.load(is);
// read Playback cursor position
if (read32le(&frame, is))
{
currFrameCounter = frame;
greenzoneSize = currFrameCounter + 1;
savestates.resize(greenzoneSize);
if (currFrameCounter)
{
// there must be one savestate in the file
if (read32le(&size, is) && size >= 0)
{
savestates[frame].resize(size);
if (is->fread(&savestates[frame][0], size) == size)
{
if (loadSavestateOfFrame(currFrameCounter))
{
FCEU_printf("No Greenzone in the file\n");
return false;
}
}
}
} else
{
// literally no Greenzone in the file, but this is still not a error
reset();
playback.restartPlaybackFromZeroGround(); // reset Playback cursor to frame 0
FCEU_printf("No Greenzone in the file, Playback at frame 0\n");
return false;
}
}
goto error;
}
if (strcmp(greenzone_save_id, save_id)) goto error; // string is not valid
// read LagLog
lagLog.load(is);
// read size
if (read32le(&size, is) && size >= 0 && size <= currMovieData.getNumRecords())
{
greenzoneSize = size;
savestates.resize(greenzoneSize);
// read Playback cursor position
if (read32le(&frame, is))
{
currFrameCounter = frame;
int greenzone_tail_frame = currFrameCounter - taseditorConfig.greenzoneCapacity;
int greenzone_tail_frame2 = greenzone_tail_frame - 2 * taseditorConfig.greenzoneCapacity;
int greenzone_tail_frame4 = greenzone_tail_frame - 4 * taseditorConfig.greenzoneCapacity;
int greenzone_tail_frame8 = greenzone_tail_frame - 8 * taseditorConfig.greenzoneCapacity;
int greenzone_tail_frame16 = greenzone_tail_frame - 16 * taseditorConfig.greenzoneCapacity;
// read savestates
while(1)
{
if (!read32le(&frame, is)) break;
if (frame < 0) break; // -1 = eof
// update TASEditor progressbar from time to time
if (frame / PROGRESSBAR_UPDATE_RATE > last_tick)
{
playback.setProgressbar(frame, greenzoneSize);
last_tick = frame / PROGRESSBAR_UPDATE_RATE;
}
// read savestate
if (!read32le(&size, is)) break;
if (size < 0) break;
if (frame <= greenzone_tail_frame16
|| (frame <= greenzone_tail_frame8 && (frame & 0xF))
|| (frame <= greenzone_tail_frame4 && (frame & 0x7))
|| (frame <= greenzone_tail_frame2 && (frame & 0x3))
|| (frame <= greenzone_tail_frame && (frame & 0x1)))
{
// skip loading this savestate
if (is->fseek(size, SEEK_CUR) != 0) break;
} else
{
// load this savestate
if ((int)savestates.size() <= frame)
savestates.resize(frame + 1);
savestates[frame].resize(size);
//.........这里部分代码省略.........
示例3: enterTASEditor
// returns true if Taseditor is engaged at the end of the function
bool enterTASEditor()
{
if (taseditorWindow.hwndTASEditor)
{
// TAS Editor is already engaged, just set focus to its window
if (!taseditorConfig.windowIsMaximized)
ShowWindow(taseditorWindow.hwndTASEditor, SW_SHOWNORMAL);
SetForegroundWindow(taseditorWindow.hwndTASEditor);
return true;
} else if (FCEU_IsValidUI(FCEUI_TASEDITOR))
{
// start TAS Editor
// create window
taseditorWindow.init();
if (taseditorWindow.hwndTASEditor)
{
enableGeneralKeyboardInput();
// save "eoptions"
saved_eoptions = eoptions;
// set "Run in background"
eoptions |= EO_BGRUN;
// "Set high-priority thread"
eoptions |= EO_HIGHPRIO;
DoPriority();
// switch off autosaves
saved_EnableAutosave = EnableAutosave;
EnableAutosave = 0;
// switch on frame_display
saved_frame_display = frame_display;
frame_display = 1;
UpdateCheckedMenuItems();
// init modules
editor.init();
pianoRoll.init();
selection.init();
splicer.init();
playback.init();
greenzone.init();
recorder.init();
markersManager.init();
project.init();
bookmarks.init();
branches.init();
popupDisplay.init();
history.init();
taseditor_lua.init();
// either start new movie or use current movie
if (!FCEUMOV_Mode(MOVIEMODE_RECORD|MOVIEMODE_PLAY) || currMovieData.savestate.size() != 0)
{
if (currMovieData.savestate.size() != 0)
FCEUD_PrintError("This version of TAS Editor doesn't work with movies starting from savestate.");
// create new movie
FCEUI_StopMovie();
movieMode = MOVIEMODE_TASEDITOR;
FCEUMOV_CreateCleanMovie();
playback.restartPlaybackFromZeroGround();
} else
{
// use current movie to create a new project
FCEUI_StopMovie();
movieMode = MOVIEMODE_TASEDITOR;
}
// if movie length is less or equal to currFrame, pad it with empty frames
if (((int)currMovieData.records.size() - 1) < currFrameCounter)
currMovieData.insertEmpty(-1, currFrameCounter - ((int)currMovieData.records.size() - 1));
// ensure that movie has correct set of ports/fourscore
setInputType(currMovieData, getInputType(currMovieData));
// force the input configuration stored in the movie to apply to FCEUX config
applyMovieInputConfig();
// reset some modules that need MovieData info
pianoRoll.reset();
recorder.reset();
// create initial snapshot in history
history.reset();
// reset Taseditor variables
mustCallManualLuaFunction = false;
SetFocus(history.hwndHistoryList); // set focus only once, to show blue selection cursor
SetFocus(pianoRoll.hwndList);
FCEU_DispMessage("TAS Editor engaged", 0);
taseditorWindow.redraw();
return true;
} else
{
// couldn't init window
return false;
}
} else
{
// right now TAS Editor launch is not allowed by emulator
return true;
}
}