mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-10-30 22:54:21 +00:00 
			
		
		
		
	small optimization: brightness timer is managed with loader
This commit is contained in:
		| @@ -99,17 +99,21 @@ ApplicationWindow{ | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             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; | ||||
|             Loader{ | ||||
|                 active: shadersettings.brightness_flickering != 0 | ||||
|                 sourceComponent: Timer{ | ||||
|                     property real randval | ||||
|                     id: flickertimer | ||||
|                     interval: 500 | ||||
|                     onTriggered: { | ||||
|                         console.log("Timer triggered") | ||||
|                         randval = Math.random(); | ||||
|                         if(randval < shadersettings.brightness_flickering) | ||||
|                             shadercontainer.brightness = Math.random() * 0.5 + 0.5; | ||||
|                     } | ||||
|                     repeat: true | ||||
|                     running: true | ||||
|                 } | ||||
|                 running: true | ||||
|                 repeat: true | ||||
|             } | ||||
|  | ||||
|             property real deltay: 3 / terminal.height | ||||
|   | ||||
		Reference in New Issue
	
	Block a user