Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
Bonzomatic
Commits
79827623
Commit
79827623
authored
Mar 07, 2015
by
Gargaj
Browse files
add smoothing factor to config
parent
b0ba577a
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
79827623
...
...
@@ -20,6 +20,9 @@ Create a ```config.json``` with e.g. the following contents: (all fields are opt
"
file
"
:
"
Input-Regular_(InputMono-Medium).ttf
"
,
"
size
"
:
16
,
},
"
rendering
"
:{
"
fftSmoothFactor
"
:
0.9
,
// 0.0 means there's no smoothing at all, 1.0 means the FFT is completely smoothed flat
},
"
textures
"
:{
/* the keys below will become the shader variable names */
"
texChecker
"
:
"
textures/checker.png
"
,
"
texNoise
"
:
"
textures/noise.png
"
,
...
...
main.cpp
View file @
79827623
...
...
@@ -81,7 +81,7 @@ int main()
int
nDebugOutputHeight
=
200
;
int
nTexPreviewWidth
=
64
;
float
fFFTSmoothingFactor
=
0.9
f
;
float
fFFTSmoothingFactor
=
0.9
f
;
// higher value, smoother FFT
char
szConfig
[
65535
];
FILE
*
fConf
=
fopen
(
"config.json"
,
"rb"
);
...
...
@@ -94,6 +94,12 @@ int main()
jsonxx
::
Object
o
;
o
.
parse
(
szConfig
);
if
(
o
.
has
<
jsonxx
::
Object
>
(
"rendering"
))
{
if
(
o
.
get
<
jsonxx
::
Object
>
(
"rendering"
).
has
<
jsonxx
::
Number
>
(
"fftSmoothFactor"
))
fFFTSmoothingFactor
=
o
.
get
<
jsonxx
::
Object
>
(
"rendering"
).
get
<
jsonxx
::
Number
>
(
"fftSmoothFactor"
);
}
if
(
o
.
has
<
jsonxx
::
Object
>
(
"textures"
))
{
printf
(
"Loading textures...
\n
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment