MCPcopy Create free account
hub / github.com/TASEmulators/fceux / handleInputColumnSetUsingPattern

Method handleInputColumnSetUsingPattern

src/drivers/win/taseditor/editor.cpp:360–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358 return false;
359}
360bool EDITOR::handleInputColumnSetUsingPattern(int joy, int button)
361{
362 if (joy < 0 || joy >= joysticksPerFrame[getInputType(currMovieData)]) return false;
363
364 RowsSelection* current_selection = selection.getCopyOfCurrentRowsSelection();
365 if (current_selection->size() == 0) return false;
366 RowsSelection::iterator current_selection_begin(current_selection->begin());
367 RowsSelection::iterator current_selection_end(current_selection->end());
368 int pattern_offset = 0, current_pattern = taseditorConfig.currentPattern;
369
370 for(RowsSelection::iterator it(current_selection_begin); it != current_selection_end; it++)
371 {
372 // skip lag frames
373 if (taseditorConfig.autofirePatternSkipsLag && greenzone.lagLog.getLagInfoAtFrame(*it) == LAGGED_YES)
374 continue;
375 currMovieData.records[*it].setBitValue(joy, button, patterns[current_pattern][pattern_offset] != 0);
376 pattern_offset++;
377 if (pattern_offset >= (int)patterns[current_pattern].size())
378 pattern_offset -= patterns[current_pattern].size();
379 }
380 int first_changes = history.registerChanges(MODTYPE_PATTERN, *current_selection_begin, *current_selection->rbegin(), 0, patternsNames[current_pattern].c_str());
381 if (first_changes >= 0)
382 {
383 greenzone.invalidateAndUpdatePlayback(first_changes);
384 return true;
385 } else
386 return false;
387}
388void EDITOR::setMarkers()
389{
390 RowsSelection* current_selection = selection.getCopyOfCurrentRowsSelection();

Callers 1

handleColumnSetMethod · 0.45

Calls 8

setBitValueMethod · 0.80
getInputTypeFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
getLagInfoAtFrameMethod · 0.45
registerChangesMethod · 0.45

Tested by

no test coverage detected