generalize power start-from-1

starting output is determined by (gain) offset
This commit is contained in:
a1xd 2021-09-18 05:20:53 -04:00
parent 1fd8881608
commit 115030165d
21 changed files with 317 additions and 411 deletions

View file

@ -50,16 +50,20 @@ namespace rawaccel {
error("data size > max");
}
if (args.offset < 0) {
if (args.input_offset < 0) {
error("offset can not be negative");
}
else if (args.mode == accel_mode::jump && args.offset == 0) {
else if (args.mode == accel_mode::jump && args.input_offset == 0) {
error("offset can not be 0");
}
if (args.output_offset < 0) {
error("offset can not be negative");
}
bool jump_or_io_cap =
(args.mode == accel_mode::jump ||
(args.mode == accel_mode::classic &&
((args.mode == accel_mode::classic || args.mode == accel_mode::power) &&
args.cap_mode == classic_cap_mode::io));
if (args.cap.x < 0) {
@ -76,6 +80,11 @@ namespace rawaccel {
error("cap (output) can not be 0");
}
if (args.cap.x > 0 && args.cap.x < args.input_offset ||
args.cap.y > 0 && args.cap.y < args.output_offset) {
error("cap < offset");
}
if (args.growth_rate <= 0 ||
args.decay_rate <= 0 ||
args.acceleration <= 0) {