Skip to content

Commit 72f4ef7

Browse files
authored
Reorder switch blocks to have default come after case (#156)
1 parent 0421675 commit 72f4ef7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎GLSL/FastNoiseLite.glsl‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,14 +2178,14 @@ float fnlGetNoise2D(fnl_state state, FNLfloat x, FNLfloat y)
21782178

21792179
switch (state.fractal_type)
21802180
{
2181-
default:
2182-
return _fnlGenNoiseSingle2D(state, state.seed, x, y);
21832181
case FNL_FRACTAL_FBM:
21842182
return _fnlGenFractalFBM2D(state, x, y);
21852183
case FNL_FRACTAL_RIDGED:
21862184
return _fnlGenFractalRidged2D(state, x, y);
21872185
case FNL_FRACTAL_PINGPONG:
21882186
return _fnlGenFractalPingPong2D(state, x, y);
2187+
default:
2188+
return _fnlGenNoiseSingle2D(state, state.seed, x, y);
21892189
}
21902190
}
21912191

@@ -2198,14 +2198,14 @@ float fnlGetNoise3D(fnl_state state, FNLfloat x, FNLfloat y, FNLfloat z)
21982198
// Select a noise type
21992199
switch (state.fractal_type)
22002200
{
2201-
default:
2202-
return _fnlGenNoiseSingle3D(state, state.seed, x, y, z);
22032201
case FNL_FRACTAL_FBM:
22042202
return _fnlGenFractalFBM3D(state, x, y, z);
22052203
case FNL_FRACTAL_RIDGED:
22062204
return _fnlGenFractalRidged3D(state, x, y, z);
22072205
case FNL_FRACTAL_PINGPONG:
22082206
return _fnlGenFractalPingPong3D(state, x, y, z);
2207+
default:
2208+
return _fnlGenNoiseSingle3D(state, state.seed, x, y, z);
22092209
}
22102210
}
22112211

@@ -2220,15 +2220,15 @@ void fnlDomainWarp2D(fnl_state state, inout FNLfloat x, inout FNLfloat y)
22202220
{
22212221
switch (state.fractal_type)
22222222
{
2223-
default:
2224-
_fnlDomainWarpSingle2D(state, x, y);
2225-
break;
22262223
case FNL_FRACTAL_DOMAIN_WARP_PROGRESSIVE:
22272224
_fnlDomainWarpFractalProgressive2D(state, x, y);
22282225
break;
22292226
case FNL_FRACTAL_DOMAIN_WARP_INDEPENDENT:
22302227
_fnlDomainWarpFractalIndependent2D(state, x, y);
22312228
break;
2229+
default:
2230+
_fnlDomainWarpSingle2D(state, x, y);
2231+
break;
22322232
}
22332233
}
22342234

@@ -2244,14 +2244,14 @@ void fnlDomainWarp3D(fnl_state state, inout FNLfloat x, inout FNLfloat y, inout
22442244

22452245
switch (state.fractal_type)
22462246
{
2247-
default:
2248-
_fnlDomainWarpSingle3D(state, x, y, z);
2249-
break;
22502247
case FNL_FRACTAL_DOMAIN_WARP_PROGRESSIVE:
22512248
_fnlDomainWarpFractalProgressive3D(state, x, y, z);
22522249
break;
22532250
case FNL_FRACTAL_DOMAIN_WARP_INDEPENDENT:
22542251
_fnlDomainWarpFractalIndependent3D(state, x, y, z);
22552252
break;
2253+
default:
2254+
_fnlDomainWarpSingle3D(state, x, y, z);
2255+
break;
22562256
}
22572257
}

0 commit comments

Comments
 (0)