---------------------------------------------------------------------------------------------- following functions use function parameters to determine range of frames
| 153 | // ---------------------------------------------------------------------------------------------- |
| 154 | // following functions use function parameters to determine range of frames |
| 155 | void EDITOR::toggleInput(int start, int end, int joy, int button, int consecutivenessTag) |
| 156 | { |
| 157 | if (joy < 0 || joy >= joysticksPerFrame[getInputType(currMovieData)]) return; |
| 158 | |
| 159 | int check_frame = end; |
| 160 | if (start > end) |
| 161 | { |
| 162 | // swap |
| 163 | int temp_start = start; |
| 164 | start = end; |
| 165 | end = temp_start; |
| 166 | } |
| 167 | if (start < 0) start = end; |
| 168 | if (end >= currMovieData.getNumRecords()) |
| 169 | return; |
| 170 | |
| 171 | if (currMovieData.records[check_frame].checkBit(joy, button)) |
| 172 | { |
| 173 | // clear range |
| 174 | for (int i = start; i <= end; ++i) |
| 175 | currMovieData.records[i].clearBit(joy, button); |
| 176 | greenzone.invalidateAndUpdatePlayback(history.registerChanges(MODTYPE_UNSET, start, end, 0, NULL, consecutivenessTag)); |
| 177 | } else |
| 178 | { |
| 179 | // set range |
| 180 | for (int i = start; i <= end; ++i) |
| 181 | currMovieData.records[i].setBit(joy, button); |
| 182 | greenzone.invalidateAndUpdatePlayback(history.registerChanges(MODTYPE_SET, start, end, 0, NULL, consecutivenessTag)); |
| 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; |
no test coverage detected