1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2024-10-06 11:00:49 +01:00

readded an improved screen flickering

This commit is contained in:
Filippo Scognamiglio 2013-12-25 21:04:10 +01:00
parent 35ffbe91a7
commit 5a158f6c65
2 changed files with 23 additions and 8 deletions

View File

@ -72,6 +72,11 @@ ApplicationWindow {
onValueChanged: shadersettings.screen_distortion = value; onValueChanged: shadersettings.screen_distortion = value;
Component.onCompleted: _value = shadersettings.screen_distortion; Component.onCompleted: _value = shadersettings.screen_distortion;
} }
SettingComponent{
name: "Screen flickering"
onValueChanged: shadersettings.brightness_flickering = value;
Component.onCompleted: _value = shadersettings.brightness_flickering;
}
} }
} }
} }

View File

@ -91,15 +91,25 @@ ApplicationWindow{
property real scanlines: shadersettings.scanlines ? 1.0 : 0.0 property real scanlines: shadersettings.scanlines ? 1.0 : 0.0
NumberAnimation on brightness{ Behavior on brightness {
property real randval: 0 NumberAnimation{
to: 1.0 duration: 250
duration: 300 onRunningChanged:
onStopped: { if(!running) shadercontainer.brightness = 1.0;
to = 1 - Math.random() * shadersettings.brightness_flickering;
start();
} }
running: false }
Timer{
property real randval
id: flickertimer
interval: 500
onTriggered: {
randval = Math.random();
if(randval < shadersettings.brightness_flickering)
shadercontainer.brightness = Math.random() * 0.5 + 0.5;
}
running: true
repeat: true
} }
property real deltay: 3 / terminal.height property real deltay: 3 / terminal.height