Skip to content

Commit f2107bc

Browse files
committed
animartrix bugfix: segment options changes not considered
* changing segment options (mirror, transpose) must lead to new call of "init" * indentation fixes
1 parent 501a1ec commit f2107bc

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

usermods/usermod_v2_animartrix/usermod_v2_animartrix.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,15 @@ class ANIMartRIXMod:public ANIMartRIX {
128128
bool use_gamma = false;
129129
public:
130130
void initEffect() {
131-
if (SEGENV.call == 0) {
132-
init(SEGMENT.virtualWidth(), SEGMENT.virtualHeight(), false);
131+
if ((SEGENV.call == 0) || (SEGMENT.virtualWidth() != num_x) || (SEGMENT.virtualHeight() != num_y)) {
132+
init(SEGMENT.virtualWidth(), SEGMENT.virtualHeight(), false);
133133
}
134134
float speedFactor = 1.0;
135135
if (SEGMENT.speed < 128) {
136-
speedFactor = (float) map(SEGMENT.speed, 0, 127, 1, 100) / 100.0f;
136+
speedFactor = (float) map(SEGMENT.speed, 0, 127, 1, 100) / 100.0f;
137+
} else {
138+
speedFactor = (float) map(SEGMENT.speed, 128, 255, 10, 100) / 10.0f;
137139
}
138-
else{
139-
speedFactor = (float) map(SEGMENT.speed, 128, 255, 10, 100) / 10.0f;
140-
}
141140
use_gamma = SEGENV.check2;
142141
setSpeedFactor(speedFactor);
143142
}

0 commit comments

Comments
 (0)