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 if (incvar < data[0][i])
178 s_accelVar = incvar / 1000;
180 if (s_speedVar > 5) {
192 s_speedVar += (s_speedVar + i/2);
194 if ((s_speedVar) && (
cycle%9==0)) {
197 if ((s_speedVar) && (
cycle%5==0)) {
198 s_speedVar = (s_speedVar*7)/8;
210 float largfactor = ((float) s_speedVar / 40.0F + (
float) incvar / 50000.0F) / 1.5F;
211 if (largfactor > 1.5F)
224 if ((s_recayIfs == 0)&&(s_ifsIncr<=0))
232 for (i = 1; i * 15 <= s_speedVar + 15; i++) {
233 static int s_loopVar = 0;
234 s_loopVar += s_speedVar*2/3 + 1;
237 ((pointWidth - 6.0F) * largfactor + 5.0F),
238 ((pointHeight - 6.0F) * largfactor + 5.0F),
239 i * 152.0F, 128.0F, s_loopVar + i * 2032);
241 ((pointWidth / 2.0F) * largfactor) / i + 10.0F * i,
242 ((pointHeight / 2.0F) * largfactor) / i + 10.0F * i,
243 96.0F, i * 80.0F, s_loopVar / i);
245 ((pointHeight / 3.0F + 5.0F) * largfactor) / i + 10.0F * i,
246 ((pointHeight / 3.0F + 5.0F) * largfactor) / i + 10.0F * i,
247 i + 122.0F, 134.0F, s_loopVar / i);
249 ((pointHeight / 3.0F) * largfactor + 20.0F),
250 ((pointHeight / 3.0F) * largfactor + 20.0F),
251 58.0F, i * 66.0F, s_loopVar / i);
253 (pointHeight * largfactor + 10.0F * i) / i,
254 (pointHeight * largfactor + 10.0F * i) / i,
255 66.0F, 74.0F, s_loopVar + i * 500); }
265 if (forceMode != 0) {
266 printf (
"forcemode = %d\n", forceMode);
284 if (--s_aBigGoom < 0)
287 if ((!s_aBigGoom) && (s_speedVar > 4) && (s_goomLimit > 4) &&
288 ((s_accelVar > s_goomLimit*9/8+7)||(s_accelVar < -s_goomLimit*9/8-7))) {
289 static int s_couleur =
296 for (
int j=0;j<size;j++)
301 if ((s_accelVar > s_goomLimit) || (s_accelVar < -s_goomLimit) || (forceMode > 0)
314 switch (
iRAND (32)) {
396 if (s_lockVar == 0) {
399 if ((s_accelVar > s_goomLimit) || (s_accelVar < -s_goomLimit)) {
400 static int s_rndn = 0;
401 static int s_blocker = 0;
404 if ((!s_blocker)&&(
iRAND(3))) {
408 else if (s_blocker) s_blocker--;
411 auto goodstate = [&](
auto state)
412 {
return (s_rndn >= state.m_rangeMin) &&
413 (s_rndn <= state.m_rangeMax); };
429 s_lineMode = DRAWLINES;
439 if ((s_zfd.
reverse) && (!(
cycle % 13)) && (rand () % 5 == 0)) {
444 if (
iRAND (10) == 0) {
455 switch (
iRAND (25)) {
564 if (s_lockVar > 150) {
565 s_switchIncr = SWITCHINCR;
570 if (
iRAND (700) == 0) {
576 s_switchIncr = SWITCHINCR;
611 if ((forceMode > 0) && (forceMode <=
NB_FX)) {
613 pzfd->
mode = forceMode - 1;
616 if (forceMode == -1) {
623 if (pzfd !=
nullptr) {
624 static int s_exvit = 128;
628 s_switchIncr = SWITCHINCR;
630 int dif = s_zfd.
vitesse - s_exvit;
635 s_switchIncr *= (dif + 2) / 2;
640 if (((s_accelVar > s_goomLimit) && (s_totalGoom < 2)) || (forceMode > 0)) {
642 s_switchMult = SWITCHMULT;
656 printf (
"GOOM: pzfd->mode = %d\n", pzfd->
mode);
733 float amplitude = NAN;
742 s_stopLines &= 0x0fff;
748 if (s_lineMode != DRAWLINES) {
750 if (s_lineMode == -1)
757 if ((
cycle % 120 == 0)
761 s_lineMode = DRAWLINES;
762 else if (s_lineMode == DRAWLINES) {
765 float amplitude = NAN;
773 couleur2 = 5-couleur1;
788 if ((s_lineMode != 0) || (s_aGoom > 15)) {
795 && ((s_lineMode == 0) || (s_lineMode == DRAWLINES))) {
798 float amplitude = NAN;
804 couleur2 = 5-couleur1;
829 if (s_totalGoom > 4) {
832 if (s_totalGoom > 7) {
836 if ((s_totalGoom == 0) && (s_goomLimit > 1))
838 if ((s_totalGoom == 1) && (s_goomLimit > 1))
846 if (
pixel !=
nullptr)
859 void choose_a_goom_line (
float *param1,
float *param2,
int *couleur,
int *mode,
float *amplitude,
int far) {
865 *param1 = *param2 = 0.47F;
869 if (
iRAND (3) == 0) {
870 *param1 = *param2 = 0;
873 else if (
iRAND (2)) {
878 *param1 = *param2 =
c_resoly * 0.35;
882 if (
iRAND (4) || far) {
887 *param1 = *param2 =
c_resoly / 2.0F;
892 if (
iRAND (3) || far) {
894 *param2 = 6.0F *
resolx / 7.0F;
897 *param1 = *param2 =
resolx / 2.0F;
903 *couleur =
iRAND (6);
973 static std::random_device rd;
974 static std::mt19937 mt(rd());