本文整理汇总了C++中PLAYBACK::ensurePlaybackIsInsideGreenzone方法的典型用法代码示例。如果您正苦于以下问题:C++ PLAYBACK::ensurePlaybackIsInsideGreenzone方法的具体用法?C++ PLAYBACK::ensurePlaybackIsInsideGreenzone怎么用?C++ PLAYBACK::ensurePlaybackIsInsideGreenzone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PLAYBACK
的用法示例。
在下文中一共展示了PLAYBACK::ensurePlaybackIsInsideGreenzone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: adjustUp
// -------------------------------------------------------------------------------------------------
void GREENZONE::adjustUp()
{
int at = currFrameCounter - 1; // at = the frame above currFrameCounter
// find how many consequent lag frames there are
int num_frames_to_erase = 0;
while (lagLog.getLagInfoAtFrame(at++) == LAGGED_YES)
num_frames_to_erase++;
if (num_frames_to_erase > 0)
{
bool markers_changed = false;
// delete these frames of lag
currMovieData.eraseRecords(currFrameCounter - 1, num_frames_to_erase);
lagLog.eraseFrame(currFrameCounter - 1, num_frames_to_erase);
if (taseditorConfig.bindMarkersToInput)
{
if (markersManager.eraseMarker(currFrameCounter - 1, num_frames_to_erase))
markers_changed = true;
}
// update movie data size, because Playback cursor must always be inside the movie
// 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));
// update Piano Roll (reduce it if needed)
pianoRoll.updateLinesCount();
// register changes
int first_input_changes = history.registerAdjustLag(currFrameCounter - 1, 0 - num_frames_to_erase);
// if Input in the frame above currFrameCounter has changed then invalidate Greenzone (rewind 1 frame back)
// also if the frame above currFrameCounter is lag frame then rewind 1 frame (invalidate Greenzone), because maybe this frame also needs lag removal
if ((first_input_changes >= 0 && first_input_changes < currFrameCounter) || (lagLog.getLagInfoAtFrame(currFrameCounter - 1) != LAGGED_NO))
{
// custom invalidation procedure, not retriggering LostPosition/PauseFrame
invalidate(first_input_changes);
bool emu_was_paused = (FCEUI_EmulationPaused() != 0);
int saved_pause_frame = playback.getPauseFrame();
playback.ensurePlaybackIsInsideGreenzone();
if (saved_pause_frame >= 0)
playback.startSeekingToFrame(saved_pause_frame);
if (emu_was_paused)
playback.pauseEmulation();
} else
{
// just invalidate Greenzone after currFrameCounter (this is necessary in order to force user to re-emulate everything after the point, because the lag log data after the currFrameCounter is now in unknown state and it should be collected again)
invalidate(currFrameCounter);
}
if (markers_changed)
selection.mustFindCurrentMarker = playback.mustFindCurrentMarker = true;
}
}
示例2: invalidateAndUpdatePlayback
// invalidate and restore playback
void GREENZONE::invalidateAndUpdatePlayback(int after)
{
if (after >= 0)
{
if (after >= currMovieData.getNumRecords())
after = currMovieData.getNumRecords() - 1;
// clear all savestates that became irrelevant
for (int i = savestates.size() - 1; i > after; i--)
clearSavestateOfFrame(i);
if (greenzoneSize > after + 1 || currFrameCounter > after)
{
greenzoneSize = after + 1;
FCEUMOV_IncrementRerecordCount();
// either set Playback cursor to be inside the Greenzone or run seeking to restore Playback cursor position
if (currFrameCounter >= greenzoneSize)
{
if (playback.getPauseFrame() >= 0 && !FCEUI_EmulationPaused())
{
// emulator was running, so continue seeking, but don't follow the Playback cursor
playback.jump(playback.getPauseFrame(), false, true, false);
} else
{
playback.setLastPosition(currFrameCounter);
if (taseditorConfig.autoRestoreLastPlaybackPosition)
// start seeking to the green arrow, but don't follow the Playback cursor
playback.jump(playback.getLastPosition(), false, true, false);
else
playback.ensurePlaybackIsInsideGreenzone();
}
}
}
}
// redraw Piano Roll even if Greenzone didn't change
pianoRoll.redraw();
bookmarks.redrawBookmarksList();
}
示例3: adjustDown
void GREENZONE::adjustDown()
{
int at = currFrameCounter - 1;
bool markers_changed = false;
// clone frame and insert lag
currMovieData.cloneRegion(at, 1);
lagLog.insertFrame(at, true, 1);
if (taseditorConfig.bindMarkersToInput)
{
if (markersManager.insertEmpty(at, 1))
markers_changed = true;
}
// register changes
int first_input_changes = history.registerAdjustLag(at, +1);
// If Input in the frame above currFrameCounter has changed then invalidate Greenzone (rewind 1 frame back)
// This should never actually happen, because we clone the frame, so the Input doesn't change
// But the check should remain, in case we decide to insert blank frame instead of cloning
if (first_input_changes >= 0 && first_input_changes < currFrameCounter)
{
// custom invalidation procedure, not retriggering LostPosition/PauseFrame
invalidate(first_input_changes);
bool emu_was_paused = (FCEUI_EmulationPaused() != 0);
int saved_pause_frame = playback.getPauseFrame();
playback.ensurePlaybackIsInsideGreenzone();
if (saved_pause_frame >= 0)
playback.startSeekingToFrame(saved_pause_frame);
if (emu_was_paused)
playback.pauseEmulation();
} else
{
// just invalidate Greenzone after currFrameCounter
invalidate(currFrameCounter);
}
if (markers_changed)
selection.mustFindCurrentMarker = playback.mustFindCurrentMarker = true;
}