mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-11-01 15:42:12 +00:00
Improve QML syntax and update license headers.
This commit is contained in:
@@ -1,3 +1,22 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013-2021 "Filippo Scognamiglio"
|
||||
* https://github.com/Swordfish90/cool-retro-term
|
||||
*
|
||||
* This file is part of cool-retro-term.
|
||||
*
|
||||
* cool-retro-term is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*******************************************************************************/
|
||||
import QtQuick 2.2
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
@@ -15,36 +34,35 @@ ShaderTerminal {
|
||||
slowBurnInEffect: terminal.slowBurnInEffect
|
||||
virtual_resolution: terminal.virtualResolution
|
||||
|
||||
TimeManager{
|
||||
TimeManager {
|
||||
id: timeManager
|
||||
enableTimer: terminalWindow.visible
|
||||
}
|
||||
|
||||
PreprocessedTerminal{
|
||||
PreprocessedTerminal {
|
||||
id: terminal
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
// EFFECTS ////////////////////////////////////////////////////////////////
|
||||
|
||||
Loader{
|
||||
Loader {
|
||||
id: bloomEffectLoader
|
||||
active: appSettings.bloom
|
||||
asynchronous: true
|
||||
width: parent.width * appSettings.bloomQuality
|
||||
height: parent.height * appSettings.bloomQuality
|
||||
|
||||
sourceComponent: FastBlur{
|
||||
radius: Utils.lint(16, 64, appSettings.bloomQuality);
|
||||
sourceComponent: FastBlur {
|
||||
radius: Utils.lint(16, 64, appSettings.bloomQuality)
|
||||
source: terminal.mainSource
|
||||
transparentBorder: true
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
Loader {
|
||||
id: bloomSourceLoader
|
||||
active: appSettings.bloom !== 0
|
||||
asynchronous: true
|
||||
sourceComponent: ShaderEffectSource{
|
||||
sourceComponent: ShaderEffectSource {
|
||||
id: _bloomEffectSource
|
||||
sourceItem: bloomEffectLoader.item
|
||||
hideSource: true
|
||||
@@ -54,71 +72,4 @@ ShaderTerminal {
|
||||
}
|
||||
|
||||
bloomSource: bloomSourceLoader.item
|
||||
|
||||
// NewTerminalFrame {
|
||||
// id: terminalFrame
|
||||
// anchors.fill: parent
|
||||
// blending: true
|
||||
// }
|
||||
|
||||
// This shader might be useful in the future. Since we used it only for a couple
|
||||
// of calculations is probably best to move those in the main shader. If in the future
|
||||
// we need to store another fullScreen channel this might be handy.
|
||||
|
||||
// ShaderEffect {
|
||||
// id: rasterizationEffect
|
||||
// width: parent.width
|
||||
// height: parent.height
|
||||
// property real outColor: 0.0
|
||||
// property real dispX: (5 / width) * appSettings.windowScaling
|
||||
// property real dispY: (5 / height) * appSettings.windowScaling
|
||||
// property size virtual_resolution: terminal.virtualResolution
|
||||
|
||||
// blending: false
|
||||
|
||||
// fragmentShader:
|
||||
// "uniform lowp float qt_Opacity;" +
|
||||
|
||||
// "varying highp vec2 qt_TexCoord0;
|
||||
// uniform highp vec2 virtual_resolution;
|
||||
// uniform highp float dispX;
|
||||
// uniform highp float dispY;
|
||||
// uniform mediump float outColor;
|
||||
|
||||
// highp float getScanlineIntensity(vec2 coords) {
|
||||
// highp float result = 1.0;" +
|
||||
|
||||
// (appSettings.rasterization != appSettings.no_rasterization ?
|
||||
// "result *= abs(sin(coords.y * virtual_resolution.y * "+Math.PI+"));" : "") +
|
||||
// (appSettings.rasterization == appSettings.pixel_rasterization ?
|
||||
// "result *= abs(sin(coords.x * virtual_resolution.x * "+Math.PI+"));" : "") + "
|
||||
|
||||
// return result;
|
||||
// }" +
|
||||
|
||||
// "void main() {" +
|
||||
// "highp float color = getScanlineIntensity(qt_TexCoord0);" +
|
||||
|
||||
// "float distance = length(vec2(0.5) - qt_TexCoord0);" +
|
||||
// "color = mix(color, 0.0, 1.2 * distance * distance);" +
|
||||
|
||||
// "color *= outColor + smoothstep(0.00, dispX, qt_TexCoord0.x) * (1.0 - outColor);" +
|
||||
// "color *= outColor + smoothstep(0.00, dispY, qt_TexCoord0.y) * (1.0 - outColor);" +
|
||||
// "color *= outColor + (1.0 - smoothstep(1.00 - dispX, 1.00, qt_TexCoord0.x)) * (1.0 - outColor);" +
|
||||
// "color *= outColor + (1.0 - smoothstep(1.00 - dispY, 1.00, qt_TexCoord0.y)) * (1.0 - outColor);" +
|
||||
|
||||
// "gl_FragColor.a = color;" +
|
||||
// "}"
|
||||
|
||||
// onStatusChanged: if (log) console.log(log) //Print warning messages
|
||||
// }
|
||||
|
||||
// rasterizationSource: ShaderEffectSource{
|
||||
// id: rasterizationEffectSource
|
||||
// sourceItem: rasterizationEffect
|
||||
// hideSource: true
|
||||
// smooth: true
|
||||
// wrapMode: ShaderEffectSource.ClampToEdge
|
||||
// visible: false
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user