diff --git a/app/PreprocessedTerminal.qml b/app/PreprocessedTerminal.qml index be09d22..3673f38 100644 --- a/app/PreprocessedTerminal.qml +++ b/app/PreprocessedTerminal.qml @@ -346,6 +346,7 @@ Item{ } // RASTERIZATION ////////////////////////////////////////////////////////// + ShaderEffect{ id: rasterizationContainer width: frame.sourceRect.width diff --git a/app/ShaderTerminal.qml b/app/ShaderTerminal.qml index d4ed889..ad3b1d7 100644 --- a/app/ShaderTerminal.qml +++ b/app/ShaderTerminal.qml @@ -56,6 +56,25 @@ ShaderEffect { blending: false + //Smooth random texture used for flickering effect. + Image{ + id: randtexture + source: "frames/images/randfunction.png" + width: 512 + height: 512 + sourceSize.width: 512 + sourceSize.height: 256 + fillMode: Image.TileVertically + } + ShaderEffectSource{ + id: randfuncsource + sourceItem: randtexture + live: false + hideSource: true + wrapMode: ShaderEffectSource.Repeat + } + + //Print the number with a reasonable precision for the shader. function str(num){ return num.toFixed(8); } diff --git a/app/TimeManager.qml b/app/TimeManager.qml index 19b6062..b5dd5be 100644 --- a/app/TimeManager.qml +++ b/app/TimeManager.qml @@ -21,18 +21,19 @@ import QtQuick 2.2 Timer{ + default property bool enableTimer: false property real time NumberAnimation on time { from: 0 to: 100000 - running: shadersettings.fps === 0 + running: shadersettings.fps === 0 && enableTimer duration: 100000 loops: Animation.Infinite } onTriggered: time += interval - running: shadersettings.fps !== 0 + running: shadersettings.fps !== 0 && enableTimer interval: Math.round(1000 / shadersettings.fps) repeat: true } diff --git a/app/app.qmlproject.user b/app/app.qmlproject.user deleted file mode 100644 index aad3915..0000000 --- a/app/app.qmlproject.user +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - true - 1 - true - 0 - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop - {821020a0-a534-46a2-aed8-40a3bc73356b} - -1 - 0 - 0 - 0 - - - 0 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Deploy locally - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - 0 - - QML_DISABLE_OPTIMIZER=1 - <VARIABLE>=<VALUE> - - - QML Scene - QmlProjectManager.QmlRunConfiguration.QmlScene - CurrentFile - - 3768 - false - true - false - true - false - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.EnvironmentId - {ce9500eb-fe4b-414b-b912-5f93dee048a3} - - - ProjectExplorer.Project.Updater.FileVersion - 15 - - diff --git a/app/frames/utils/TerminalFrame.qml b/app/frames/utils/TerminalFrame.qml index 0406b48..3c0b9b1 100644 --- a/app/frames/utils/TerminalFrame.qml +++ b/app/frames/utils/TerminalFrame.qml @@ -2,8 +2,8 @@ import QtQuick 2.2 Item{ id: framecontainer - property int textureWidth - property int textureHeight + property int textureWidth: terminalWindow.width + property int textureHeight: terminalWindow.height property int addedWidth property int addedHeight @@ -13,7 +13,6 @@ Item{ property int borderBottom property string imageSource property string normalsSource - property rect sourceRect property string shaderString //Value used to create the rect used to add the border to the texture @@ -28,6 +27,11 @@ Item{ property real distortionCoefficient + property rect sourceRect: Qt.rect(-rectX * shadersettings.window_scaling, + -rectY * shadersettings.window_scaling, + terminal.width + 2*rectX * shadersettings.window_scaling, + terminal.height + 2*rectY * shadersettings.window_scaling) + BorderImage{ id: frameimage anchors.centerIn: parent diff --git a/app/main.qml b/app/main.qml index 9f312e8..c1bc791 100644 --- a/app/main.qml +++ b/app/main.qml @@ -27,15 +27,16 @@ import org.kde.konsole 0.1 ApplicationWindow{ id: terminalWindow + width: 1024 height: 768 - minimumWidth: 320 minimumHeight: 240 + property bool fullscreen: shadersettings.fullscreen + onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed) + title: qsTr("cool-old-term") - visible: true - visibility: shadersettings.fullscreen ? Window.FullScreen : Window.Windowed Action { id: fullscreenAction @@ -90,11 +91,13 @@ ApplicationWindow{ MenuItem {action: fullscreenAction} } } - ApplicationSettings{ id: shadersettings } - + TimeManager{ + id: timeManager + enableTimer: terminalWindow.visible + } Item{ id: maincontainer anchors.centerIn: parent @@ -106,38 +109,12 @@ ApplicationWindow{ Loader{ id: frame - property rect sourceRect: Qt.rect(-item.rectX * shadersettings.window_scaling, - -item.rectY * shadersettings.window_scaling, - terminal.width + 2*item.rectX * shadersettings.window_scaling, - terminal.height + 2*item.rectY * shadersettings.window_scaling) anchors.fill: parent + + property rect sourceRect: item.sourceRect + z: 2.1 source: shadersettings.frame_source - opacity: 1.0 - onLoaded: { - item.textureWidth = Qt.binding(function() { return terminalWindow.width;}) - item.textureHeight = Qt.binding(function () {return terminalWindow.height;}) - console.log(terminalWindow.width); - } - } - Image{ - id: randtexture - source: "frames/images/randfunction.png" - width: 512 - height: 512 - sourceSize.width: 512 - sourceSize.height: 256 - fillMode: Image.TileVertically - } - ShaderEffectSource{ - id: randfuncsource - sourceItem: randtexture - live: false - hideSource: true - wrapMode: ShaderEffectSource.Repeat - } - TimeManager{ - id: timeManager } PreprocessedTerminal{ id: terminal