Refactored frames

This commit is contained in:
Filippo Scognamiglio 2013-12-25 18:44:46 +01:00
parent c80c73f591
commit 750d03979c
12 changed files with 70 additions and 37 deletions

View File

@ -21,9 +21,28 @@ OTHER_FILES += \
$$PWD/qml/cool-old-term/HighlightArea.qml \
$$PWD/qml/cool-old-term/ShaderSettings.qml \
$$PWD/qml/images/frame.png \
qml/cool-old-term/SettingsWindow.qml \
qml/cool-old-term/SettingComponent.qml \
qml/cool-old-term/ColorButton.qml \
qml/cool-old-term/TerminalFrame.qml \
qml/cool-old-term/WhiteFrameShader.qml \
qml/cool-old-term/NoFrameShader.qml
$$PWD/qml/cool-old-term/SettingsWindow.qml \
$$PWD/qml/cool-old-term/SettingComponent.qml \
$$PWD/qml/cool-old-term/ColorButton.qml \
$$PWD/qml/cool-old-term/TerminalFrame.qml \
$$PWD/qml/cool-old-term/WhiteFrameShader.qml \
$$PWD/qml/cool-old-term/NoFrameShader.qml \
$$PWD/qml/cool-old-term/WhiteSimpleFrame.qml \
qml/cool-old-term/BlackRoughFrame.qml \
qml/cool-old-term/Frames/BlackRoughFrame.qml \
qml/cool-old-term/Frames/NoFrameShader.qml \
qml/cool-old-term/Frames/WhiteFrameShader.qml \
qml/cool-old-term/Frames/WhiteSimpleFrame.qml \
qml/cool-old-term/Frames/TerminalFrame.qml \
qml/cool-old-term/Frames/utils/NoFrameShader.qml \
qml/cool-old-term/Frames/utils/TerminalFrame.qml \
qml/cool-old-term/Frames/utils/WhiteFrameShader.qml \
qml/cool-old-term/frames/WhiteSimpleFrame.qml \
qml/cool-old-term/frames/BlackRoughFrame.qml \
qml/cool-old-term/frames/utils/NoFrameShader.qml \
qml/cool-old-term/frames/utils/TerminalFrame.qml \
qml/cool-old-term/frames/utils/WhiteFrameShader.qml \
qml/cool-old-term/frames/images/screen-frame.png \
qml/cool-old-term/frames/images/screen-frame-normals.png \
qml/cool-old-term/frames/images/black-frame.png \
qml/cool-old-term/frames/images/black-frame-normals.png

View File

@ -1,4 +1,4 @@
import QtQuick 2.0
import QtQuick 2.1
Item{
property real ambient_light: 0.2

View File

@ -0,0 +1,19 @@
import QtQuick 2.1
import "utils"
TerminalFrame{
id: frame
z: 2.1
anchors.fill: parent
addedWidth: 200
addedHeight: 370
borderLeft: 148
borderRight: 148
borderTop: 232
borderBottom: 232
imageSource: "../images/black-frame.png"
normalsSource: "../images/black-frame-normals.png"
sourceRect: Qt.rect(-80, -90, terminal.width + 160, terminal.height + 180 )
shaderString: "WhiteFrameShader.qml"
}

View File

@ -0,0 +1,19 @@
import QtQuick 2.0
import "utils"
TerminalFrame{
id: frame
z: 2.1
anchors.fill: parent
addedWidth: 140
addedHeight: 140
borderLeft: 116
borderRight: 116
borderTop: 116
borderBottom: 116
imageSource: "../images/screen-frame.png"
normalsSource: "../images/screen-frame-normals.png"
sourceRect: Qt.rect(-65, -75, terminal.width + 130, terminal.height + 150)
shaderString: "WhiteFrameShader.qml"
}

View File

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

Before

Width:  |  Height:  |  Size: 646 KiB

After

Width:  |  Height:  |  Size: 646 KiB

View File

Before

Width:  |  Height:  |  Size: 571 KiB

After

Width:  |  Height:  |  Size: 571 KiB

View File

@ -180,7 +180,7 @@ ApplicationWindow{
//vec4 color = texture2D(source, coords);
float color = (blurredColor(source, coords).r + texture2D(source, coords).r) * 0.5;
float scanline_alpha = getScanlineIntensity(coords) * scanlines;
//float inside = step(0.0, coords.x) * step(-1.0, -coords.x) * step(0.0, coords.y) * step(-1.0, -coords.y);
//float inside = step(0.0, coords.x) * step(-1.0, -coords.x) * step(0.0, coords.y) * step(-1.0, -coords.y);
float noise = stepNoise(coords) * noise_strength;
float randomPass = randomPass(coords) * glowing_line_strength;
color += noise + randomPass;
@ -190,38 +190,14 @@ ApplicationWindow{
}"
}
// TerminalFrame{
// id: frame
// z: 2.1
// anchors.fill: parent
// addedWidth: 140
// addedHeight: 140
// borderLeft: 116
// borderRight: 116
// borderTop: 116
// borderBottom: 116
// imageSource: "../images/screen-frame.png"
// normalsSource: "../images/screen-frame-normals.png"
// sourceRect: Qt.rect(-65, -75, terminal.width + 130, terminal.height + 150)
Loader{
property rect sourceRect
// shaderString: "WhiteFrameShader.qml"
// }
TerminalFrame{
id: frame
z: 2.1
anchors.fill: parent
addedWidth: 200
addedHeight: 370
borderLeft: 148
borderRight: 148
borderTop: 232
borderBottom: 232
imageSource: "../images/black-frame.png"
normalsSource: "../images/black-frame-normals.png"
sourceRect: Qt.rect(-80, -90, terminal.width + 160, terminal.height + 180 )
shaderString: "WhiteFrameShader.qml"
z: 2.1
source: "./frames/WhiteSimpleFrame.qml"
onLoaded: sourceRect = item.sourceRect;
}
TerminalScreen {