| 183 | } |
| 184 | } |
| 185 | void EDITOR::setInputUsingPattern(int start, int end, int joy, int button, int consecutivenessTag) |
| 186 | { |
| 187 | if (joy < 0 || joy >= joysticksPerFrame[getInputType(currMovieData)]) return; |
| 188 | |
| 189 | if (start > end) |
| 190 | { |
| 191 | // swap |
| 192 | int temp_start = start; |
| 193 | start = end; |
| 194 | end = temp_start; |
| 195 | } |
| 196 | if (start < 0) start = end; |
| 197 | if (end >= currMovieData.getNumRecords()) |
| 198 | return; |
| 199 | |
| 200 | int pattern_offset = 0, current_pattern = taseditorConfig.currentPattern; |
| 201 | bool changes_made = false; |
| 202 | bool value; |
| 203 | |
| 204 | for (int i = start; i <= end; ++i) |
| 205 | { |
| 206 | // skip lag frames |
| 207 | if (taseditorConfig.autofirePatternSkipsLag && greenzone.lagLog.getLagInfoAtFrame(i) == LAGGED_YES) |
| 208 | continue; |
| 209 | value = (patterns[current_pattern][pattern_offset] != 0); |
| 210 | if (currMovieData.records[i].checkBit(joy, button) != value) |
| 211 | { |
| 212 | changes_made = true; |
| 213 | currMovieData.records[i].setBitValue(joy, button, value); |
| 214 | } |
| 215 | pattern_offset++; |
| 216 | if (pattern_offset >= (int)patterns[current_pattern].size()) |
| 217 | pattern_offset -= patterns[current_pattern].size(); |
| 218 | } |
| 219 | if (changes_made) |
| 220 | greenzone.invalidateAndUpdatePlayback(history.registerChanges(MODTYPE_PATTERN, start, end, 0, patternsNames[current_pattern].c_str(), consecutivenessTag)); |
| 221 | } |
| 222 | |
| 223 | // following functions use current Selection to determine range of frames |
| 224 | bool EDITOR::handleColumnSet() |
no test coverage detected