43 const std::array<const GoomState,STATES_NB>
kStates {{
44 {1,0,0,1,4, 000, 100},
45 {1,0,0,1,1, 101, 140},
46 {1,0,0,1,2, 141, 200},
47 {0,1,0,1,2, 201, 260},
48 {0,1,0,1,0, 261, 330},
49 {0,1,1,1,4, 331, 400},
50 {0,0,1,1,5, 401, 450},
62 void choose_a_goom_line (
float *param1,
float *param2,
int *couleur,
int *mode,
float *amplitude,
int far);
66 printf (
"GOOM: init (%d, %d);\n", resx, resy);
83 srand ((uintptr_t)
pixel);
85 for (
size_t i = 0; i <
NB_RAND; i++)
134 static int s_lockVar = 0;
135 static int s_totalGoom = 0;
136 static int s_aGoom = 0;
137 static int s_aBigGoom = 0;
138 static int s_speedVar = 0;
141 static constexpr
int DRAWLINES { 80 };
142 static int s_lineMode = DRAWLINES;
143 static int s_nombreCddc = 0;
144 static int s_accelVar=0;
145 static int s_stopLines = 0;
148 static int s_ifsIncr = 1;
149 static int s_decayIfs = 0;
150 static int s_recayIfs = 0;
152 static constexpr
float SWITCHMULT { 29.0F/30.0F };
153 static constexpr
int SWITCHINCR { 0x7f };
154 static float s_switchMult = 1.0F;
155 static int s_switchIncr = SWITCHINCR;
157 static char s_goomLimit = 2;
161 0, 0,
false,
false, 0
172 for (
int i = 0; i < 512; i++) {
173 incvar = std::max<int>(incvar, data[0][i]);
177 s_accelVar = incvar / 1000;
179 if (s_speedVar > 5) {
183 s_speedVar = std::min(s_speedVar, 40);
190 s_speedVar += (s_speedVar + i/2);
192 if ((s_speedVar) && (
cycle%9==0)) {
195 if ((s_speedVar) && (
cycle%5==0)) {
196 s_speedVar = (s_speedVar*7)/8;
205 float largfactor = ((float) s_speedVar / 40.0F + (
float) incvar / 50000.0F) / 1.5F;
206 largfactor = std::min(largfactor, 1.5F);
218 if ((s_recayIfs == 0)&&(s_ifsIncr<=0))
226 for (i = 1; i * 15 <= s_speedVar + 15; i++) {
227 static int s_loopVar = 0;
228 s_loopVar += s_speedVar*2/3 + 1;
231 (((pointWidth - 6.0F) * largfactor) + 5.0F),
232 (((pointHeight - 6.0F) * largfactor) + 5.0F),
233 i * 152.0F, 128.0F, s_loopVar + (i * 2032));
235 (((pointWidth / 2.0F) * largfactor) / i) + (10.0F * i),
236 (((pointHeight / 2.0F) * largfactor) / i) + (10.0F * i),
237 96.0F, i * 80.0F, s_loopVar / i);
239 (((pointHeight / 3.0F + 5.0F) * largfactor) / i) + (10.0F * i),
240 (((pointHeight / 3.0F + 5.0F) * largfactor) / i) + (10.0F * i),
241 i + 122.0F, 134.0F, s_loopVar / i);
243 (((pointHeight / 3.0F) * largfactor) + 20.0F),
244 (((pointHeight / 3.0F) * largfactor) + 20.0F),
245 58.0F, i * 66.0F, s_loopVar / i);
247 (pointHeight * largfactor + 10.0F * i) / i,
248 (pointHeight * largfactor + 10.0F * i) / i,
249 66.0F, 74.0F, s_loopVar + (i * 500)); }
259 if (forceMode != 0) {
260 printf (
"forcemode = %d\n", forceMode);
278 if (--s_aBigGoom < 0)
281 if ((!s_aBigGoom) && (s_speedVar > 4) && (s_goomLimit > 4) &&
282 ((s_accelVar > s_goomLimit*9/8+7)||(s_accelVar < -s_goomLimit*9/8-7))) {
283 static int s_couleur =
290 for (
int j=0;j<size;j++)
295 if ((s_accelVar > s_goomLimit) || (s_accelVar < -s_goomLimit) || (forceMode > 0)
308 switch (
iRAND (32)) {
390 if (s_lockVar == 0) {
393 if ((s_accelVar > s_goomLimit) || (s_accelVar < -s_goomLimit)) {
394 static int s_rndn = 0;
395 static int s_blocker = 0;
398 if ((!s_blocker)&&(
iRAND(3))) {
408 auto goodstate = [&](
auto state)
409 {
return (s_rndn >= state.m_rangeMin) &&
410 (s_rndn <= state.m_rangeMax); };
426 s_lineMode = DRAWLINES;
436 if ((s_zfd.
reverse) && (!(
cycle % 13)) && (rand () % 5 == 0)) {
441 if (
iRAND (10) == 0) {
452 switch (
iRAND (25)) {
561 if (s_lockVar > 150) {
562 s_switchIncr = SWITCHINCR;
567 if (
iRAND (700) == 0) {
573 s_switchIncr = SWITCHINCR;
608 if ((forceMode > 0) && (forceMode <=
NB_FX)) {
610 pzfd->
mode = forceMode - 1;
613 if (forceMode == -1) {
620 if (pzfd !=
nullptr) {
621 static int s_exvit = 128;
625 s_switchIncr = SWITCHINCR;
627 int dif = s_zfd.
vitesse - s_exvit;
632 s_switchIncr *= (dif + 2) / 2;
637 if (((s_accelVar > s_goomLimit) && (s_totalGoom < 2)) || (forceMode > 0)) {
639 s_switchMult = SWITCHMULT;
655 printf (
"GOOM: pzfd->mode = %d\n", pzfd->
mode);
732 float amplitude = NAN;
741 s_stopLines &= 0x0fff;
747 if (s_lineMode != DRAWLINES) {
749 if (s_lineMode == -1)
758 if ((
cycle % 120 == 0)
762 s_lineMode = DRAWLINES;
763 else if (s_lineMode == DRAWLINES) {
766 float amplitude = NAN;
774 couleur2 = 5-couleur1;
789 if ((s_lineMode != 0) || (s_aGoom > 15)) {
796 && ((s_lineMode == 0) || (s_lineMode == DRAWLINES))) {
799 float amplitude = NAN;
805 couleur2 = 5-couleur1;
830 if (s_totalGoom > 4) {
833 if (s_totalGoom > 7) {
837 if ((s_totalGoom == 0) && (s_goomLimit > 1))
839 if ((s_totalGoom == 1) && (s_goomLimit > 1))
847 if (
pixel !=
nullptr)
860 void choose_a_goom_line (
float *param1,
float *param2,
int *couleur,
int *mode,
float *amplitude,
int far) {
866 *param1 = *param2 = 0.47F;
870 if (
iRAND (3) == 0) {
871 *param1 = *param2 = 0;
874 else if (
iRAND (2)) {
879 *param1 = *param2 =
c_resoly * 0.35;
883 if (
iRAND (4) || far) {
888 *param1 = *param2 =
c_resoly / 2.0F;
893 if (
iRAND (3) || far) {
895 *param2 = 6.0F *
resolx / 7.0F;
898 *param1 = *param2 =
resolx / 2.0F;
904 *couleur =
iRAND (6);
974 static std::random_device rd;
975 static std::mt19937 mt(rd());