mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-04-15 23:30:50 +01:00
Merge pull request #184 from Swordfish90/refactoring
Many many fixes and optimizations. Texture scaling now dramatically improve performances, various shader optimizations, improved static noise and horizontal distortion and more...
This commit is contained in:
commit
9fc73468a2
@ -37,6 +37,7 @@ int main(int argc, char *argv[])
|
|||||||
qDebug() << " --fullscreen Run cool-retro-term in fullscreen.";
|
qDebug() << " --fullscreen Run cool-retro-term in fullscreen.";
|
||||||
qDebug() << " -p|--profile <prof> Run cool-retro-term with the given profile.";
|
qDebug() << " -p|--profile <prof> Run cool-retro-term with the given profile.";
|
||||||
qDebug() << " -h|--help Print this help.";
|
qDebug() << " -h|--help Print this help.";
|
||||||
|
qDebug() << " --verbose Print additional informations such as profiles and settings.";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ import QtQuick.Window 2.0
|
|||||||
Window{
|
Window{
|
||||||
id: dialogwindow
|
id: dialogwindow
|
||||||
title: qsTr("About")
|
title: qsTr("About")
|
||||||
width: 450
|
width: 600
|
||||||
height: 300
|
height: 400
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -64,20 +64,18 @@ Window{
|
|||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 10
|
spacing: 10
|
||||||
Item{
|
Image{
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Image{
|
Layout.fillHeight: true
|
||||||
anchors.fill: parent
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source: "images/crt256.png"
|
source: "images/crt256.png"
|
||||||
smooth: true
|
smooth: true
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Text{
|
Text{
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: shadersettings.version + "\n" +
|
text: appSettings.version + "\n" +
|
||||||
qsTr("Author: ") + "Filippo Scognamiglio\n" +
|
qsTr("Author: ") + "Filippo Scognamiglio\n" +
|
||||||
qsTr("Email: ") + "flscogna@gmail.com\n" +
|
qsTr("Email: ") + "flscogna@gmail.com\n" +
|
||||||
qsTr("Source: ") + "https://github.com/Swordfish90/cool-retro-term\n"
|
qsTr("Source: ") + "https://github.com/Swordfish90/cool-retro-term\n"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
|
|
||||||
|
import "utils.js" as Utils
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
property string version: "0.9"
|
property string version: "0.9"
|
||||||
@ -36,32 +36,20 @@ Item{
|
|||||||
property real brightness: 0.5
|
property real brightness: 0.5
|
||||||
|
|
||||||
property bool show_terminal_size: true
|
property bool show_terminal_size: true
|
||||||
|
|
||||||
property real window_scaling: 1.0
|
property real window_scaling: 1.0
|
||||||
onWindow_scalingChanged: handleFontChanged();
|
|
||||||
|
|
||||||
property real fps: 24
|
property real fps: 24
|
||||||
|
property bool verbose: false
|
||||||
|
|
||||||
function mix(c1, c2, alpha){
|
onWindow_scalingChanged: handleFontChanged();
|
||||||
return Qt.rgba(c1.r * alpha + c2.r * (1-alpha),
|
|
||||||
c1.g * alpha + c2.g * (1-alpha),
|
|
||||||
c1.b * alpha + c2.b * (1-alpha),
|
|
||||||
c1.a * alpha + c2.a * (1-alpha))
|
|
||||||
}
|
|
||||||
function strToColor(s){
|
|
||||||
var r = parseInt(s.substring(1,3), 16) / 256;
|
|
||||||
var g = parseInt(s.substring(3,5), 16) / 256;
|
|
||||||
var b = parseInt(s.substring(5,7), 16) / 256;
|
|
||||||
return Qt.rgba(r, g, b, 1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// PROFILE SETTINGS ///////////////////////////////////////////////////////
|
// PROFILE SETTINGS ///////////////////////////////////////////////////////
|
||||||
|
|
||||||
property string _background_color: "#000000"
|
property string _background_color: "#000000"
|
||||||
property string _font_color: "#ff8100"
|
property string _font_color: "#ff8100"
|
||||||
property string saturated_color: mix(strToColor("#FFFFFF"), strToColor(_font_color), saturation_color * 0.5)
|
property string saturated_color: Utils.mix(Utils.strToColor("#FFFFFF"), Utils.strToColor(_font_color), saturation_color * 0.5)
|
||||||
property color font_color: mix(strToColor(saturated_color), strToColor(_background_color), 0.7 + (contrast * 0.3))
|
property color font_color: Utils.mix(Utils.strToColor(saturated_color), Utils.strToColor(_background_color), 0.7 + (contrast * 0.3))
|
||||||
property color background_color: mix(strToColor(_background_color), strToColor(saturated_color), 0.7 + (contrast * 0.3))
|
property color background_color: Utils.mix(Utils.strToColor(_background_color), Utils.strToColor(saturated_color), 0.7 + (contrast * 0.3))
|
||||||
|
|
||||||
property real noise_strength: 0.1
|
property real noise_strength: 0.1
|
||||||
property real screen_distortion: 0.1
|
property real screen_distortion: 0.1
|
||||||
@ -69,7 +57,7 @@ Item{
|
|||||||
property real motion_blur: 0.40
|
property real motion_blur: 0.40
|
||||||
property real bloom_strength: 0.65
|
property real bloom_strength: 0.65
|
||||||
|
|
||||||
property real bloom_quality: 1.0
|
property real bloom_quality: 0.5
|
||||||
|
|
||||||
property real chroma_color: 0.0
|
property real chroma_color: 0.0
|
||||||
property real saturation_color: 0.0
|
property real saturation_color: 0.0
|
||||||
@ -87,9 +75,6 @@ Item{
|
|||||||
|
|
||||||
property int rasterization: no_rasterization
|
property int rasterization: no_rasterization
|
||||||
|
|
||||||
property int scanline_quality: 2
|
|
||||||
onScanline_qualityChanged: handleFontChanged();
|
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: framelist
|
id: framelist
|
||||||
ListElement{text: "No frame"; source: "./frames/NoFrame.qml"; reflections: false}
|
ListElement{text: "No frame"; source: "./frames/NoFrame.qml"; reflections: false}
|
||||||
@ -104,7 +89,13 @@ Item{
|
|||||||
|
|
||||||
// FONTS //////////////////////////////////////////////////////////////////
|
// FONTS //////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
signal terminalFontChanged(string fontSource, int pixelSize, int lineSpacing, real screenScaling)
|
property real fontScaling: 1.0
|
||||||
|
property real fontWidth: 1.0
|
||||||
|
|
||||||
|
property var fontIndexes: [0,0,0]
|
||||||
|
property var fontlist: fontManager.item.fontlist
|
||||||
|
|
||||||
|
signal terminalFontChanged(string fontSource, int pixelSize, int lineSpacing, real screenScaling, real fontWidth)
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
id: fontManager
|
id: fontManager
|
||||||
@ -121,8 +112,8 @@ Item{
|
|||||||
onLoaded: handleFontChanged()
|
onLoaded: handleFontChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
property real fontScaling: 1.0
|
|
||||||
onFontScalingChanged: handleFontChanged();
|
onFontScalingChanged: handleFontChanged();
|
||||||
|
onFontWidthChanged: handleFontChanged();
|
||||||
|
|
||||||
function incrementScaling(){
|
function incrementScaling(){
|
||||||
fontScaling = Math.min(fontScaling + 0.05, 2.50);
|
fontScaling = Math.min(fontScaling + 0.05, 2.50);
|
||||||
@ -134,12 +125,6 @@ Item{
|
|||||||
handleFontChanged();
|
handleFontChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
property real fontWidth: 1.0
|
|
||||||
onFontWidthChanged: handleFontChanged();
|
|
||||||
|
|
||||||
property var fontIndexes: [0,0,0]
|
|
||||||
property var fontlist: fontManager.item.fontlist
|
|
||||||
|
|
||||||
function handleFontChanged(){
|
function handleFontChanged(){
|
||||||
if(!fontManager.item) return;
|
if(!fontManager.item) return;
|
||||||
fontManager.item.selectedFontIndex = fontIndexes[rasterization];
|
fontManager.item.selectedFontIndex = fontIndexes[rasterization];
|
||||||
@ -149,8 +134,9 @@ Item{
|
|||||||
var pixelSize = fontManager.item.pixelSize;
|
var pixelSize = fontManager.item.pixelSize;
|
||||||
var lineSpacing = fontManager.item.lineSpacing;
|
var lineSpacing = fontManager.item.lineSpacing;
|
||||||
var screenScaling = fontManager.item.screenScaling;
|
var screenScaling = fontManager.item.screenScaling;
|
||||||
|
var fontWidth = fontManager.item.defaultFontWidth * appSettings.fontWidth;
|
||||||
|
|
||||||
terminalFontChanged(fontSource, pixelSize, lineSpacing, screenScaling);
|
terminalFontChanged(fontSource, pixelSize, lineSpacing, screenScaling, fontWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FRAMES /////////////////////////////////////////////////////////////////
|
// FRAMES /////////////////////////////////////////////////////////////////
|
||||||
@ -166,6 +152,13 @@ Item{
|
|||||||
|
|
||||||
Storage{id: storage}
|
Storage{id: storage}
|
||||||
|
|
||||||
|
function stringify(obj) {
|
||||||
|
var replacer = function(key, val) {
|
||||||
|
return val.toFixed ? Number(val.toFixed(4)) : val;
|
||||||
|
}
|
||||||
|
return JSON.stringify(obj, replacer, 2);
|
||||||
|
}
|
||||||
|
|
||||||
function composeSettingsString(){
|
function composeSettingsString(){
|
||||||
var settings = {
|
var settings = {
|
||||||
fps: fps,
|
fps: fps,
|
||||||
@ -175,10 +168,9 @@ Item{
|
|||||||
fontIndexes: fontIndexes,
|
fontIndexes: fontIndexes,
|
||||||
frameReflections: _frameReflections,
|
frameReflections: _frameReflections,
|
||||||
showMenubar: showMenubar,
|
showMenubar: showMenubar,
|
||||||
scanline_quality: scanline_quality,
|
|
||||||
bloom_quality: bloom_quality
|
bloom_quality: bloom_quality
|
||||||
}
|
}
|
||||||
return JSON.stringify(settings);
|
return stringify(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
function composeProfileString(){
|
function composeProfileString(){
|
||||||
@ -205,7 +197,7 @@ Item{
|
|||||||
fontIndex: fontIndexes[rasterization],
|
fontIndex: fontIndexes[rasterization],
|
||||||
fontWidth: fontWidth
|
fontWidth: fontWidth
|
||||||
}
|
}
|
||||||
return JSON.stringify(settings);
|
return stringify(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadSettings(){
|
function loadSettings(){
|
||||||
@ -218,7 +210,8 @@ Item{
|
|||||||
loadSettingsString(settingsString);
|
loadSettingsString(settingsString);
|
||||||
loadProfileString(profileString);
|
loadProfileString(profileString);
|
||||||
|
|
||||||
console.log("Loading settings: " + settingsString + profileString);
|
if (verbose)
|
||||||
|
console.log("Loading settings: " + settingsString + profileString);
|
||||||
}
|
}
|
||||||
|
|
||||||
function storeSettings(){
|
function storeSettings(){
|
||||||
@ -228,8 +221,10 @@ Item{
|
|||||||
storage.setSetting("_CURRENT_SETTINGS", settingsString);
|
storage.setSetting("_CURRENT_SETTINGS", settingsString);
|
||||||
storage.setSetting("_CURRENT_PROFILE", profileString);
|
storage.setSetting("_CURRENT_PROFILE", profileString);
|
||||||
|
|
||||||
console.log("Storing settings: " + settingsString);
|
if (verbose) {
|
||||||
console.log("Storing profile: " + profileString);
|
console.log("Storing settings: " + settingsString);
|
||||||
|
console.log("Storing profile: " + profileString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadSettingsString(settingsString){
|
function loadSettingsString(settingsString){
|
||||||
@ -247,7 +242,6 @@ Item{
|
|||||||
|
|
||||||
showMenubar = settings.showMenubar !== undefined ? settings.showMenubar : showMenubar;
|
showMenubar = settings.showMenubar !== undefined ? settings.showMenubar : showMenubar;
|
||||||
|
|
||||||
scanline_quality = settings.scanline_quality !== undefined ? settings.scanline_quality : scanline_quality;
|
|
||||||
bloom_quality = settings.bloom_quality !== undefined ? settings.bloom_quality : bloom_quality;
|
bloom_quality = settings.bloom_quality !== undefined ? settings.bloom_quality : bloom_quality;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +293,7 @@ Item{
|
|||||||
var customProfiles = JSON.parse(customProfilesString);
|
var customProfiles = JSON.parse(customProfilesString);
|
||||||
for (var i=0; i<customProfiles.length; i++) {
|
for (var i=0; i<customProfiles.length; i++) {
|
||||||
var profile = customProfiles[i];
|
var profile = customProfiles[i];
|
||||||
console.log("Loading custom profile: " + JSON.stringify(profile));
|
console.log("Loading custom profile: " + stringify(profile));
|
||||||
profiles_list.append(profile);
|
profiles_list.append(profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -311,7 +305,7 @@ Item{
|
|||||||
if(profile.builtin) continue;
|
if(profile.builtin) continue;
|
||||||
customProfiles.push({text: profile.text, obj_string: profile.obj_string, builtin: false})
|
customProfiles.push({text: profile.text, obj_string: profile.obj_string, builtin: false})
|
||||||
}
|
}
|
||||||
return JSON.stringify(customProfiles);
|
return stringify(customProfiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadCurrentProfile(){
|
function loadCurrentProfile(){
|
||||||
@ -390,6 +384,9 @@ Item{
|
|||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// Manage the arguments from the QML side.
|
// Manage the arguments from the QML side.
|
||||||
var args = Qt.application.arguments;
|
var args = Qt.application.arguments;
|
||||||
|
if (args.indexOf("--verbose") !== -1) {
|
||||||
|
verbose = true;
|
||||||
|
}
|
||||||
if (args.indexOf("--default-settings") === -1) {
|
if (args.indexOf("--default-settings") === -1) {
|
||||||
loadSettings();
|
loadSettings();
|
||||||
}
|
}
|
||||||
|
@ -31,12 +31,12 @@ MenuBar {
|
|||||||
title: qsTr("Profiles")
|
title: qsTr("Profiles")
|
||||||
visible: defaultMenuBar.visible
|
visible: defaultMenuBar.visible
|
||||||
Instantiator{
|
Instantiator{
|
||||||
model: shadersettings.profiles_list
|
model: appSettings.profiles_list
|
||||||
delegate: MenuItem {
|
delegate: MenuItem {
|
||||||
text: model.text
|
text: model.text
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
shadersettings.loadProfileString(obj_string);
|
appSettings.loadProfileString(obj_string);
|
||||||
shadersettings.handleFontChanged();
|
appSettings.handleFontChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onObjectAdded: profilesMenu.insertItem(index, object)
|
onObjectAdded: profilesMenu.insertItem(index, object)
|
||||||
|
@ -29,6 +29,7 @@ Item{
|
|||||||
property int pixelSize: _font.pixelSize
|
property int pixelSize: _font.pixelSize
|
||||||
property int lineSpacing: _font.lineSpacing
|
property int lineSpacing: _font.lineSpacing
|
||||||
property real screenScaling: scaling * _font.baseScaling
|
property real screenScaling: scaling * _font.baseScaling
|
||||||
|
property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: fontlist
|
id: fontlist
|
||||||
@ -38,6 +39,7 @@ Item{
|
|||||||
lineSpacing: 2
|
lineSpacing: 2
|
||||||
pixelSize: 8
|
pixelSize: 8
|
||||||
baseScaling: 4.0
|
baseScaling: 4.0
|
||||||
|
fontWidth: 0.8
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Apple ][ (1977)"
|
text: "Apple ][ (1977)"
|
||||||
@ -45,6 +47,7 @@ Item{
|
|||||||
lineSpacing: 2
|
lineSpacing: 2
|
||||||
pixelSize: 8
|
pixelSize: 8
|
||||||
baseScaling: 4.0
|
baseScaling: 4.0
|
||||||
|
fontWidth: 0.9
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Atari 400-800 (1979)"
|
text: "Atari 400-800 (1979)"
|
||||||
@ -52,6 +55,7 @@ Item{
|
|||||||
lineSpacing: 3
|
lineSpacing: 3
|
||||||
pixelSize: 8
|
pixelSize: 8
|
||||||
baseScaling: 4.0
|
baseScaling: 4.0
|
||||||
|
fontWidth: 0.8
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Commodore 64 (1982)"
|
text: "Commodore 64 (1982)"
|
||||||
@ -59,6 +63,7 @@ Item{
|
|||||||
lineSpacing: 3
|
lineSpacing: 3
|
||||||
pixelSize: 8
|
pixelSize: 8
|
||||||
baseScaling: 4.0
|
baseScaling: 4.0
|
||||||
|
fontWidth: 0.8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ Item{
|
|||||||
property int pixelSize: _font.pixelSize
|
property int pixelSize: _font.pixelSize
|
||||||
property int lineSpacing: _font.lineSpacing
|
property int lineSpacing: _font.lineSpacing
|
||||||
property real screenScaling: scaling * _font.baseScaling
|
property real screenScaling: scaling * _font.baseScaling
|
||||||
|
property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: fontlist
|
id: fontlist
|
||||||
@ -38,6 +39,7 @@ Item{
|
|||||||
lineSpacing: 2
|
lineSpacing: 2
|
||||||
pixelSize: 8
|
pixelSize: 8
|
||||||
baseScaling: 4.0
|
baseScaling: 4.0
|
||||||
|
fontWidth: 0.7
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Apple ][ (1977)"
|
text: "Apple ][ (1977)"
|
||||||
@ -45,6 +47,7 @@ Item{
|
|||||||
lineSpacing: 2
|
lineSpacing: 2
|
||||||
pixelSize: 8
|
pixelSize: 8
|
||||||
baseScaling: 4.0
|
baseScaling: 4.0
|
||||||
|
fontWidth: 0.8
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Atari 400-800 (1979)"
|
text: "Atari 400-800 (1979)"
|
||||||
@ -52,6 +55,7 @@ Item{
|
|||||||
lineSpacing: 3
|
lineSpacing: 3
|
||||||
pixelSize: 8
|
pixelSize: 8
|
||||||
baseScaling: 4.0
|
baseScaling: 4.0
|
||||||
|
fontWidth: 0.7
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Commodore 64 (1982)"
|
text: "Commodore 64 (1982)"
|
||||||
@ -59,6 +63,7 @@ Item{
|
|||||||
lineSpacing: 3
|
lineSpacing: 3
|
||||||
pixelSize: 8
|
pixelSize: 8
|
||||||
baseScaling: 4.0
|
baseScaling: 4.0
|
||||||
|
fontWidth: 0.7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ Item{
|
|||||||
property int pixelSize: _font.pixelSize * scaling
|
property int pixelSize: _font.pixelSize * scaling
|
||||||
property int lineSpacing: pixelSize * _font.lineSpacing
|
property int lineSpacing: pixelSize * _font.lineSpacing
|
||||||
property real screenScaling: 1.0
|
property real screenScaling: 1.0
|
||||||
|
property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth
|
||||||
|
|
||||||
//In this configuration lineSpacing is proportional to pixelSize.
|
//In this configuration lineSpacing is proportional to pixelSize.
|
||||||
|
|
||||||
@ -39,54 +40,56 @@ Item{
|
|||||||
source: "fonts/modern-terminus/TerminusTTF-Bold-4.38.2.ttf"
|
source: "fonts/modern-terminus/TerminusTTF-Bold-4.38.2.ttf"
|
||||||
lineSpacing: 0.2
|
lineSpacing: 0.2
|
||||||
pixelSize: 35
|
pixelSize: 35
|
||||||
|
fontWidth: 1.0
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Commodore PET (1977)"
|
text: "Commodore PET (1977)"
|
||||||
source: "fonts/1977-commodore-pet/COMMODORE_PET.ttf"
|
source: "fonts/1977-commodore-pet/COMMODORE_PET.ttf"
|
||||||
lineSpacing: 0.2
|
lineSpacing: 0.2
|
||||||
pixelSize: 24
|
pixelSize: 26
|
||||||
}
|
fontWidth: 0.7
|
||||||
ListElement{
|
|
||||||
text: "Commodore PET 2Y (1977)"
|
|
||||||
source: "fonts/1977-commodore-pet/COMMODORE_PET_2y.ttf"
|
|
||||||
lineSpacing: 0.2
|
|
||||||
pixelSize: 32
|
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Apple ][ (1977)"
|
text: "Apple ][ (1977)"
|
||||||
source: "fonts/1977-apple2/PrintChar21.ttf"
|
source: "fonts/1977-apple2/PrintChar21.ttf"
|
||||||
lineSpacing: 0.2
|
lineSpacing: 0.2
|
||||||
pixelSize: 24
|
pixelSize: 26
|
||||||
|
fontWidth: 0.8
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Atari 400-800 (1979)"
|
text: "Atari 400-800 (1979)"
|
||||||
source: "fonts/1979-atari-400-800/ATARI400800_original.TTF"
|
source: "fonts/1979-atari-400-800/ATARI400800_original.TTF"
|
||||||
lineSpacing: 0.3
|
lineSpacing: 0.3
|
||||||
pixelSize: 24
|
pixelSize: 26
|
||||||
|
fontWidth: 0.7
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Commodore 64 (1982)"
|
text: "Commodore 64 (1982)"
|
||||||
source: "fonts/1982-commodore64/C64_User_Mono_v1.0-STYLE.ttf"
|
source: "fonts/1982-commodore64/C64_User_Mono_v1.0-STYLE.ttf"
|
||||||
lineSpacing: 0.3
|
lineSpacing: 0.3
|
||||||
pixelSize: 24
|
pixelSize: 26
|
||||||
|
fontWidth: 0.7
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Atari ST (1985)"
|
text: "Atari ST (1985)"
|
||||||
source: "fonts/1985-atari-st/AtariST8x16SystemFont.ttf"
|
source: "fonts/1985-atari-st/AtariST8x16SystemFont.ttf"
|
||||||
lineSpacing: 0.2
|
lineSpacing: 0.2
|
||||||
pixelSize: 32
|
pixelSize: 32
|
||||||
|
fontWidth: 1.0
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "IBM DOS (1985)"
|
text: "IBM DOS (1985)"
|
||||||
source: "fonts/1985-ibm-pc-vga/Perfect DOS VGA 437.ttf"
|
source: "fonts/1985-ibm-pc-vga/Perfect DOS VGA 437.ttf"
|
||||||
lineSpacing: 0.2
|
lineSpacing: 0.2
|
||||||
pixelSize: 32
|
pixelSize: 32
|
||||||
|
fontWidth: 1.0
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "IBM 3278 (1971)"
|
text: "IBM 3278 (1971)"
|
||||||
source: "fonts/1971-ibm-3278/3270Medium.ttf"
|
source: "fonts/1971-ibm-3278/3270Medium.ttf"
|
||||||
lineSpacing: 0.2
|
lineSpacing: 0.2
|
||||||
pixelSize: 32
|
pixelSize: 32
|
||||||
|
fontWidth: 1.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ Window{
|
|||||||
}
|
}
|
||||||
|
|
||||||
function validateName(name){
|
function validateName(name){
|
||||||
var profile_list = shadersettings.profiles_list;
|
var profile_list = appSettings.profiles_list;
|
||||||
if (name === "")
|
if (name === "")
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphicalEffects 1.0
|
|
||||||
import QtQuick.Controls 1.1
|
import QtQuick.Controls 1.1
|
||||||
|
|
||||||
import QMLTermWidget 1.0
|
import QMLTermWidget 1.0
|
||||||
@ -27,44 +26,27 @@ import QMLTermWidget 1.0
|
|||||||
Item{
|
Item{
|
||||||
id: terminalContainer
|
id: terminalContainer
|
||||||
|
|
||||||
//Frame displacement properties. This makes the terminal the same size of the texture.
|
property size virtualResolution: Qt.size(kterminal.width, kterminal.height)
|
||||||
property real dtop: frame.item.displacementTop
|
property alias mainTerminal: kterminal
|
||||||
property real dleft:frame.item.displacementLeft
|
property ShaderEffectSource mainSource: mBlur !== 0 ? blurredSourceLoader.item : kterminalSource
|
||||||
property real dright: frame.item.displacementRight
|
|
||||||
property real dbottom: frame.item.displacementBottom
|
|
||||||
|
|
||||||
|
property real scaleTexture: 1.0
|
||||||
property alias title: ksession.title
|
property alias title: ksession.title
|
||||||
|
|
||||||
anchors.leftMargin: dleft
|
|
||||||
anchors.rightMargin: dright
|
|
||||||
anchors.topMargin: dtop
|
|
||||||
anchors.bottomMargin: dbottom
|
|
||||||
|
|
||||||
property variant theSource: mBlur !== 0 ? blurredSourceLoader.item : kterminalSource
|
|
||||||
property variant bloomSource: bloomSourceLoader.item
|
|
||||||
property variant rasterizationSource: rasterizationEffectSource
|
|
||||||
property variant staticNoiseSource: staticNoiseSource
|
|
||||||
|
|
||||||
property alias kterminal: kterminal
|
property alias kterminal: kterminal
|
||||||
|
|
||||||
signal sizeChanged
|
anchors.leftMargin: frame.item.displacementLeft * appSettings.window_scaling
|
||||||
onWidthChanged: sizeChanged()
|
anchors.rightMargin: frame.item.displacementRight * appSettings.window_scaling
|
||||||
onHeightChanged: sizeChanged()
|
anchors.topMargin: frame.item.displacementTop * appSettings.window_scaling
|
||||||
|
anchors.bottomMargin: frame.item.displacementBottom * appSettings.window_scaling
|
||||||
|
|
||||||
//The blur effect has to take into account the framerate
|
//The blur effect has to take into account the framerate
|
||||||
property real mBlur: shadersettings.motion_blur
|
property real mBlur: appSettings.motion_blur
|
||||||
property real motionBlurCoefficient: (_maxBlurCoefficient * mBlur + _minBlurCoefficient * (1 - mBlur))
|
property real motionBlurCoefficient: (_maxBlurCoefficient * mBlur + _minBlurCoefficient * (1 - mBlur))
|
||||||
property real _minBlurCoefficient: 0.70
|
property real _minBlurCoefficient: 0.70
|
||||||
property real _maxBlurCoefficient: 0.90
|
property real _maxBlurCoefficient: 0.90
|
||||||
|
|
||||||
property real mBloom: shadersettings.bloom_strength
|
|
||||||
property int mScanlines: shadersettings.rasterization
|
|
||||||
onMScanlinesChanged: restartBlurredSource()
|
|
||||||
|
|
||||||
property size terminalSize: kterminal.terminalSize
|
property size terminalSize: kterminal.terminalSize
|
||||||
property size paintedTextSize
|
property size fontMetrics: kterminal.fontMetrics
|
||||||
|
|
||||||
onMBlurChanged: restartBlurredSource()
|
|
||||||
|
|
||||||
// Manage copy and paste
|
// Manage copy and paste
|
||||||
Connections{
|
Connections{
|
||||||
@ -76,14 +58,9 @@ Item{
|
|||||||
onTriggered: kterminal.pasteClipboard()
|
onTriggered: kterminal.pasteClipboard()
|
||||||
}
|
}
|
||||||
|
|
||||||
function restartBlurredSource(){
|
|
||||||
if(!blurredSourceLoader.item) return;
|
|
||||||
blurredSourceLoader.item.restartBlurSource();
|
|
||||||
}
|
|
||||||
|
|
||||||
//When settings are updated sources need to be redrawn.
|
//When settings are updated sources need to be redrawn.
|
||||||
Connections{
|
Connections{
|
||||||
target: shadersettings
|
target: appSettings
|
||||||
onFontScalingChanged: terminalContainer.updateSources();
|
onFontScalingChanged: terminalContainer.updateSources();
|
||||||
onFontWidthChanged: terminalContainer.updateSources();
|
onFontWidthChanged: terminalContainer.updateSources();
|
||||||
}
|
}
|
||||||
@ -105,6 +82,7 @@ Item{
|
|||||||
|
|
||||||
smooth: false
|
smooth: false
|
||||||
enableBold: false
|
enableBold: false
|
||||||
|
fullCursorHeight: true
|
||||||
|
|
||||||
session: QMLTermSession {
|
session: QMLTermSession {
|
||||||
id: ksession
|
id: ksession
|
||||||
@ -115,6 +93,7 @@ Item{
|
|||||||
}
|
}
|
||||||
|
|
||||||
QMLTermScrollbar {
|
QMLTermScrollbar {
|
||||||
|
id: kterminalScrollbar
|
||||||
terminal: kterminal
|
terminal: kterminal
|
||||||
anchors.margins: width * 0.5
|
anchors.margins: width * 0.5
|
||||||
width: terminal.fontMetrics.width * 0.75
|
width: terminal.fontMetrics.width * 0.75
|
||||||
@ -124,33 +103,24 @@ Item{
|
|||||||
radius: width * 0.25
|
radius: width * 0.25
|
||||||
opacity: 0.7
|
opacity: 0.7
|
||||||
}
|
}
|
||||||
onOpacityChanged: restartBlurredSource();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FontLoader{ id: fontLoader }
|
FontLoader{ id: fontLoader }
|
||||||
|
|
||||||
function handleFontChange(fontSource, pixelSize, lineSpacing, screenScaling){
|
function handleFontChange(fontSource, pixelSize, lineSpacing, screenScaling, fontWidth){
|
||||||
fontLoader.source = fontSource;
|
fontLoader.source = fontSource;
|
||||||
font.pixelSize = pixelSize;
|
font.pixelSize = pixelSize;
|
||||||
font.family = fontLoader.name;
|
font.family = fontLoader.name;
|
||||||
|
|
||||||
var fontWidth = 1.0 / shadersettings.fontWidth;
|
width = Qt.binding(function() {return Math.floor(terminalContainer.width / (screenScaling * fontWidth));});
|
||||||
|
|
||||||
width = Qt.binding(function() {return Math.floor(fontWidth * terminalContainer.width / screenScaling);});
|
|
||||||
height = Qt.binding(function() {return Math.floor(terminalContainer.height / screenScaling);});
|
height = Qt.binding(function() {return Math.floor(terminalContainer.height / screenScaling);});
|
||||||
|
|
||||||
var scaleTexture = Math.max(Math.round(screenScaling / shadersettings.scanline_quality), 1.0);
|
scaleTexture = Math.max(1.0, Math.round(screenScaling / 2));
|
||||||
|
|
||||||
kterminalSource.textureSize = Qt.binding(function () {
|
|
||||||
return Qt.size(kterminal.width * scaleTexture, kterminal.height * scaleTexture);
|
|
||||||
});
|
|
||||||
|
|
||||||
kterminal.lineSpacing = lineSpacing;
|
kterminal.lineSpacing = lineSpacing;
|
||||||
//update();
|
|
||||||
restartBlurredSource();
|
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
shadersettings.terminalFontChanged.connect(handleFontChange);
|
appSettings.terminalFontChanged.connect(handleFontChange);
|
||||||
|
|
||||||
// Retrieve the variable set in main.cpp if arguments are passed.
|
// Retrieve the variable set in main.cpp if arguments are passed.
|
||||||
if (shellProgram)
|
if (shellProgram)
|
||||||
@ -169,14 +139,12 @@ Item{
|
|||||||
MenuSeparator{visible: Qt.platform.os !== "osx"}
|
MenuSeparator{visible: Qt.platform.os !== "osx"}
|
||||||
MenuItem{action: fullscreenAction; visible: Qt.platform.os !== "osx"}
|
MenuItem{action: fullscreenAction; visible: Qt.platform.os !== "osx"}
|
||||||
MenuItem{action: showMenubarAction; visible: Qt.platform.os !== "osx"}
|
MenuItem{action: showMenubarAction; visible: Qt.platform.os !== "osx"}
|
||||||
MenuSeparator{visible: !shadersettings.showMenubar}
|
MenuSeparator{visible: !appSettings.showMenubar}
|
||||||
CRTMainMenuBar{visible: !shadersettings.showMenubar}
|
CRTMainMenuBar{visible: !appSettings.showMenubar}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
||||||
// This is incredibly ugly. All this file should be reorganized.
|
anchors.fill: parent
|
||||||
width: (parent.width + dleft + dright) / shadersettings.window_scaling - dleft -dright
|
|
||||||
height: (parent.height + dtop + dbottom) / shadersettings.window_scaling - dtop - dbottom
|
|
||||||
onWheel:{
|
onWheel:{
|
||||||
if(wheel.modifiers & Qt.ControlModifier){
|
if(wheel.modifiers & Qt.ControlModifier){
|
||||||
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
|
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
|
||||||
@ -211,7 +179,7 @@ Item{
|
|||||||
y = y / height;
|
y = y / height;
|
||||||
|
|
||||||
var cc = Qt.size(0.5 - x, 0.5 - y);
|
var cc = Qt.size(0.5 - x, 0.5 - y);
|
||||||
var distortion = (cc.height * cc.height + cc.width * cc.width) * shadersettings.screen_distortion;
|
var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screen_distortion;
|
||||||
|
|
||||||
return Qt.point((x - cc.width * (1+distortion) * distortion) * kterminal.width,
|
return Qt.point((x - cc.width * (1+distortion) * distortion) * kterminal.width,
|
||||||
(y - cc.height * (1+distortion) * distortion) * kterminal.height)
|
(y - cc.height * (1+distortion) * distortion) * kterminal.height)
|
||||||
@ -222,6 +190,8 @@ Item{
|
|||||||
sourceItem: kterminal
|
sourceItem: kterminal
|
||||||
hideSource: true
|
hideSource: true
|
||||||
wrapMode: ShaderEffectSource.ClampToEdge
|
wrapMode: ShaderEffectSource.ClampToEdge
|
||||||
|
visible: false
|
||||||
|
textureSize: Qt.size(kterminal.width * scaleTexture, kterminal.height * scaleTexture);
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
id: blurredSourceLoader
|
id: blurredSourceLoader
|
||||||
@ -236,6 +206,8 @@ Item{
|
|||||||
hideSource: true
|
hideSource: true
|
||||||
wrapMode: kterminalSource.wrapMode
|
wrapMode: kterminalSource.wrapMode
|
||||||
|
|
||||||
|
visible: false
|
||||||
|
|
||||||
function restartBlurSource(){
|
function restartBlurSource(){
|
||||||
livetimer.restart();
|
livetimer.restart();
|
||||||
}
|
}
|
||||||
@ -243,21 +215,25 @@ Item{
|
|||||||
Timer{
|
Timer{
|
||||||
id: livetimer
|
id: livetimer
|
||||||
running: true
|
running: true
|
||||||
onRunningChanged: {
|
onTriggered: _blurredSourceEffect.live = false;
|
||||||
running ?
|
|
||||||
_blurredSourceEffect.live = true :
|
|
||||||
_blurredSourceEffect.live = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Connections{
|
Connections{
|
||||||
target: kterminal
|
target: kterminal
|
||||||
onImagePainted:{
|
onImagePainted:{
|
||||||
|
_blurredSourceEffect.live = true;
|
||||||
livetimer.restart();
|
livetimer.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Restart blurred source settings change.
|
||||||
Connections{
|
Connections{
|
||||||
target: shadersettings
|
target: appSettings
|
||||||
onScanline_qualityChanged: restartBlurredSource();
|
onMotion_blurChanged: _blurredSourceEffect.restartBlurSource();
|
||||||
|
onTerminalFontChanged: _blurredSourceEffect.restartBlurSource();
|
||||||
|
onRasterizationChanged: _blurredSourceEffect.restartBlurSource();
|
||||||
|
}
|
||||||
|
Connections {
|
||||||
|
target: kterminalScrollbar
|
||||||
|
onOpacityChanged: _blurredSourceEffect.restartBlurSource();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -304,143 +280,4 @@ Item{
|
|||||||
onStatusChanged: if (log) console.log(log) //Print warning messages
|
onStatusChanged: if (log) console.log(log) //Print warning messages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// EFFECTS //////////////////////////////////////////////////////////////
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// BLOOM ////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
Loader{
|
|
||||||
property real scaling: shadersettings.bloom_quality * shadersettings.window_scaling
|
|
||||||
id: bloomEffectLoader
|
|
||||||
active: mBloom != 0
|
|
||||||
asynchronous: true
|
|
||||||
width: parent.width * scaling
|
|
||||||
height: parent.height * scaling
|
|
||||||
sourceComponent: FastBlur{
|
|
||||||
radius: 48 * scaling
|
|
||||||
source: kterminal
|
|
||||||
transparentBorder: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loader{
|
|
||||||
id: bloomSourceLoader
|
|
||||||
active: mBloom != 0
|
|
||||||
asynchronous: true
|
|
||||||
sourceComponent: ShaderEffectSource{
|
|
||||||
id: _bloomEffectSource
|
|
||||||
sourceItem: bloomEffectLoader.item
|
|
||||||
hideSource: true
|
|
||||||
smooth: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOISE ////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ShaderEffect {
|
|
||||||
id: staticNoiseEffect
|
|
||||||
anchors.fill: parent
|
|
||||||
property real element_size: shadersettings.rasterization == shadersettings.no_rasterization ? 2 : 1
|
|
||||||
property size virtual_resolution: Qt.size(kterminal.width / element_size, kterminal.height / element_size)
|
|
||||||
|
|
||||||
blending: false
|
|
||||||
|
|
||||||
fragmentShader:
|
|
||||||
"uniform lowp float qt_Opacity;
|
|
||||||
varying highp vec2 qt_TexCoord0;
|
|
||||||
uniform highp vec2 virtual_resolution;" +
|
|
||||||
|
|
||||||
"highp float noise(vec2 co)
|
|
||||||
{
|
|
||||||
highp float a = 12.9898;
|
|
||||||
highp float b = 78.233;
|
|
||||||
highp float c = 43758.5453;
|
|
||||||
highp float dt= dot(co.xy ,vec2(a,b));
|
|
||||||
highp float sn= mod(dt,3.14);
|
|
||||||
return fract(sin(sn) * c);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec2 sw(vec2 p) {return vec2( floor(p.x) , floor(p.y) );}
|
|
||||||
vec2 se(vec2 p) {return vec2( ceil(p.x) , floor(p.y) );}
|
|
||||||
vec2 nw(vec2 p) {return vec2( floor(p.x) , ceil(p.y) );}
|
|
||||||
vec2 ne(vec2 p) {return vec2( ceil(p.x) , ceil(p.y) );}
|
|
||||||
|
|
||||||
float smoothNoise(vec2 p) {
|
|
||||||
vec2 inter = smoothstep(0., 1., fract(p));
|
|
||||||
float s = mix(noise(sw(p)), noise(se(p)), inter.x);
|
|
||||||
float n = mix(noise(nw(p)), noise(ne(p)), inter.x);
|
|
||||||
return mix(s, n, inter.y);
|
|
||||||
}" +
|
|
||||||
|
|
||||||
"void main() {" +
|
|
||||||
"gl_FragColor.a = smoothNoise(qt_TexCoord0 * virtual_resolution);" +
|
|
||||||
"}"
|
|
||||||
|
|
||||||
onStatusChanged: if (log) console.log(log) //Print warning messages
|
|
||||||
}
|
|
||||||
ShaderEffectSource{
|
|
||||||
id: staticNoiseSource
|
|
||||||
sourceItem: staticNoiseEffect
|
|
||||||
textureSize: Qt.size(parent.width, parent.height)
|
|
||||||
wrapMode: ShaderEffectSource.Repeat
|
|
||||||
smooth: true
|
|
||||||
hideSource: true
|
|
||||||
}
|
|
||||||
|
|
||||||
// RASTERIZATION //////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ShaderEffect {
|
|
||||||
id: rasterizationEffect
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
property real outColor: 0.0
|
|
||||||
property real dispX: 5 / width
|
|
||||||
property real dispY: 5 / height
|
|
||||||
property size virtual_resolution: Qt.size(kterminal.width, kterminal.height)
|
|
||||||
|
|
||||||
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;" +
|
|
||||||
|
|
||||||
(mScanlines != shadersettings.no_rasterization ?
|
|
||||||
"result *= abs(sin(coords.y * virtual_resolution.y * "+Math.PI+"));" : "") +
|
|
||||||
(mScanlines == shadersettings.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
|
|
||||||
}
|
|
||||||
ShaderEffectSource{
|
|
||||||
id: rasterizationEffectSource
|
|
||||||
sourceItem: rasterizationEffect
|
|
||||||
hideSource: true
|
|
||||||
smooth: true
|
|
||||||
wrapMode: ShaderEffectSource.ClampToEdge
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -30,55 +30,55 @@ Tab{
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Bloom")
|
name: qsTr("Bloom")
|
||||||
onNewValue: shadersettings.bloom_strength = newValue
|
onNewValue: appSettings.bloom_strength = newValue
|
||||||
value: shadersettings.bloom_strength
|
value: appSettings.bloom_strength
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Motion Blur")
|
name: qsTr("Motion Blur")
|
||||||
onNewValue: shadersettings.motion_blur = newValue
|
onNewValue: appSettings.motion_blur = newValue
|
||||||
value: shadersettings.motion_blur
|
value: appSettings.motion_blur
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Noise")
|
name: qsTr("Noise")
|
||||||
onNewValue: shadersettings.noise_strength = newValue
|
onNewValue: appSettings.noise_strength = newValue
|
||||||
value: shadersettings.noise_strength
|
value: appSettings.noise_strength
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Jitter")
|
name: qsTr("Jitter")
|
||||||
onNewValue: shadersettings.jitter = newValue
|
onNewValue: appSettings.jitter = newValue
|
||||||
value: shadersettings.jitter
|
value: appSettings.jitter
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Glow")
|
name: qsTr("Glow")
|
||||||
onNewValue: shadersettings.glowing_line_strength = newValue;
|
onNewValue: appSettings.glowing_line_strength = newValue;
|
||||||
value: shadersettings.glowing_line_strength
|
value: appSettings.glowing_line_strength
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Screen distortion")
|
name: qsTr("Screen distortion")
|
||||||
onNewValue: shadersettings.screen_distortion = newValue;
|
onNewValue: appSettings.screen_distortion = newValue;
|
||||||
value: shadersettings.screen_distortion;
|
value: appSettings.screen_distortion;
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Ambient light")
|
name: qsTr("Ambient light")
|
||||||
onNewValue: shadersettings.ambient_light = newValue;
|
onNewValue: appSettings.ambient_light = newValue;
|
||||||
value: shadersettings.ambient_light
|
value: appSettings.ambient_light
|
||||||
enabled: shadersettings.frames_index !== 0
|
enabled: appSettings.frames_index !== 0
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Brightness flickering")
|
name: qsTr("Brightness flickering")
|
||||||
onNewValue: shadersettings.brightness_flickering = newValue;
|
onNewValue: appSettings.brightness_flickering = newValue;
|
||||||
value: shadersettings.brightness_flickering;
|
value: appSettings.brightness_flickering;
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Horizontal flickering")
|
name: qsTr("Horizontal flickering")
|
||||||
onNewValue: shadersettings.horizontal_sincronization = newValue;
|
onNewValue: appSettings.horizontal_sincronization = newValue;
|
||||||
value: shadersettings.horizontal_sincronization;
|
value: appSettings.horizontal_sincronization;
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("RGB shift")
|
name: qsTr("RGB shift")
|
||||||
onNewValue: shadersettings.rgb_shift = newValue;
|
onNewValue: appSettings.rgb_shift = newValue;
|
||||||
value: shadersettings.rgb_shift;
|
value: appSettings.rgb_shift;
|
||||||
enabled: shadersettings.chroma_color !== 0
|
enabled: appSettings.chroma_color !== 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ Tab{
|
|||||||
ComboBox{
|
ComboBox{
|
||||||
id: profilesbox
|
id: profilesbox
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
model: shadersettings.profiles_list
|
model: appSettings.profiles_list
|
||||||
currentIndex: shadersettings.profiles_index
|
currentIndex: appSettings.profiles_index
|
||||||
}
|
}
|
||||||
RowLayout{
|
RowLayout{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -42,9 +42,9 @@ Tab{
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: qsTr("Load")
|
text: qsTr("Load")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
shadersettings.profiles_index = profilesbox.currentIndex
|
appSettings.profiles_index = profilesbox.currentIndex
|
||||||
shadersettings.loadCurrentProfile();
|
appSettings.loadCurrentProfile();
|
||||||
shadersettings.handleFontChanged();
|
appSettings.handleFontChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button{
|
Button{
|
||||||
@ -55,16 +55,16 @@ Tab{
|
|||||||
Button{
|
Button{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: qsTr("Remove Selected")
|
text: qsTr("Remove Selected")
|
||||||
enabled: !shadersettings.profiles_list.get(profilesbox.currentIndex).builtin
|
enabled: !appSettings.profiles_list.get(profilesbox.currentIndex).builtin
|
||||||
onClicked: {
|
onClicked: {
|
||||||
shadersettings.profiles_list.remove(profilesbox.currentIndex)
|
appSettings.profiles_list.remove(profilesbox.currentIndex)
|
||||||
profilesbox.currentIndex = profilesbox.currentIndex - 1
|
profilesbox.currentIndex = profilesbox.currentIndex - 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InsertNameDialog{
|
InsertNameDialog{
|
||||||
id: insertname
|
id: insertname
|
||||||
onNameSelected: shadersettings.addNewCustomProfile(name)
|
onNameSelected: appSettings.addNewCustomProfile(name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,18 +76,18 @@ Tab{
|
|||||||
columns: 2
|
columns: 2
|
||||||
Text{ text: qsTr("Brightness") }
|
Text{ text: qsTr("Brightness") }
|
||||||
SimpleSlider{
|
SimpleSlider{
|
||||||
onValueChanged: shadersettings.brightness = value
|
onValueChanged: appSettings.brightness = value
|
||||||
value: shadersettings.brightness
|
value: appSettings.brightness
|
||||||
}
|
}
|
||||||
Text{ text: qsTr("Contrast") }
|
Text{ text: qsTr("Contrast") }
|
||||||
SimpleSlider{
|
SimpleSlider{
|
||||||
onValueChanged: shadersettings.contrast = value
|
onValueChanged: appSettings.contrast = value
|
||||||
value: shadersettings.contrast
|
value: appSettings.contrast
|
||||||
}
|
}
|
||||||
Text{ text: qsTr("Opacity") }
|
Text{ text: qsTr("Opacity") }
|
||||||
SimpleSlider{
|
SimpleSlider{
|
||||||
onValueChanged: shadersettings.windowOpacity = value
|
onValueChanged: appSettings.windowOpacity = value
|
||||||
value: shadersettings.windowOpacity
|
value: appSettings.windowOpacity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,9 +99,9 @@ Tab{
|
|||||||
ComboBox{
|
ComboBox{
|
||||||
id: framescombobox
|
id: framescombobox
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
model: shadersettings.frames_list
|
model: appSettings.frames_list
|
||||||
currentIndex: shadersettings.frames_index
|
currentIndex: appSettings.frames_index
|
||||||
onCurrentIndexChanged: shadersettings.frames_index = currentIndex
|
onCurrentIndexChanged: appSettings.frames_index = currentIndex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,8 @@ Tab{
|
|||||||
columns: 3
|
columns: 3
|
||||||
CheckBox{
|
CheckBox{
|
||||||
property int fps: checked ? slider.value : 0
|
property int fps: checked ? slider.value : 0
|
||||||
onFpsChanged: shadersettings.fps = fps
|
onFpsChanged: appSettings.fps = fps
|
||||||
checked: shadersettings.fps !== 0
|
checked: appSettings.fps !== 0
|
||||||
text: qsTr("Limit FPS")
|
text: qsTr("Limit FPS")
|
||||||
}
|
}
|
||||||
Slider{
|
Slider{
|
||||||
@ -46,63 +46,22 @@ Tab{
|
|||||||
stepSize: 1
|
stepSize: 1
|
||||||
maximumValue: 60
|
maximumValue: 60
|
||||||
minimumValue: 1
|
minimumValue: 1
|
||||||
enabled: shadersettings.fps !== 0
|
enabled: appSettings.fps !== 0
|
||||||
value: shadersettings.fps !== 0 ? shadersettings.fps : 60
|
value: appSettings.fps !== 0 ? appSettings.fps : 60
|
||||||
}
|
}
|
||||||
Text{text: slider.value}
|
Text{text: slider.value}
|
||||||
Text{text: qsTr("Texture Quality")}
|
Text{text: qsTr("Texture Quality")}
|
||||||
Slider{
|
Slider{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
id: txtslider
|
id: txtslider
|
||||||
onValueChanged: shadersettings.window_scaling = value;
|
onValueChanged: appSettings.window_scaling = value;
|
||||||
value: shadersettings.window_scaling
|
value: appSettings.window_scaling
|
||||||
stepSize: 0.10
|
stepSize: 0.10
|
||||||
Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5
|
Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5
|
||||||
}
|
}
|
||||||
Text{text: Math.round(txtslider.value * 100) + "%"}
|
Text{text: Math.round(txtslider.value * 100) + "%"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GroupBox{
|
|
||||||
title: qsTr("Rasterization")
|
|
||||||
Layout.fillWidth: true
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
GridLayout{
|
|
||||||
id: scanlineQualityContainer
|
|
||||||
anchors.fill: parent
|
|
||||||
columns: 3
|
|
||||||
property alias valsIndex: scanlineQualitySlider.value
|
|
||||||
property var vals: [4,3,2]
|
|
||||||
property var valsStrings: [
|
|
||||||
qsTr("Low"),
|
|
||||||
qsTr("Medium"),
|
|
||||||
qsTr("High")
|
|
||||||
]
|
|
||||||
|
|
||||||
onValsIndexChanged: shadersettings.scanline_quality = vals[valsIndex];
|
|
||||||
|
|
||||||
Text{text: qsTr("Scanlines Quality")}
|
|
||||||
Slider{
|
|
||||||
id: scanlineQualitySlider
|
|
||||||
Layout.fillWidth: true
|
|
||||||
onValueChanged: parent.valsIndex = value;
|
|
||||||
stepSize: 1
|
|
||||||
Component.onCompleted: {
|
|
||||||
minimumValue = 0;
|
|
||||||
maximumValue = 2;
|
|
||||||
value = parent.vals.indexOf(shadersettings.scanline_quality);
|
|
||||||
}
|
|
||||||
Connections{
|
|
||||||
target: shadersettings
|
|
||||||
onScanline_qualityChanged:
|
|
||||||
scanlineQualityContainer.valsIndex = scanlineQualityContainer.vals.indexOf(shadersettings.scanline_quality);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Text{
|
|
||||||
text: parent.valsStrings[parent.valsIndex];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GroupBox{
|
GroupBox{
|
||||||
title: qsTr("Bloom")
|
title: qsTr("Bloom")
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -111,37 +70,17 @@ Tab{
|
|||||||
GridLayout{
|
GridLayout{
|
||||||
id: bloomQualityContainer
|
id: bloomQualityContainer
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
columns: 3
|
|
||||||
property alias valsIndex: bloomQualitySlider.value
|
|
||||||
property var vals: [0.25, 0.50, 1.00]
|
|
||||||
property var valsStrings: [
|
|
||||||
qsTr("Low"),
|
|
||||||
qsTr("Medium"),
|
|
||||||
qsTr("High")
|
|
||||||
]
|
|
||||||
|
|
||||||
onValsIndexChanged: shadersettings.bloom_quality = vals[valsIndex];
|
|
||||||
|
|
||||||
Text{text: qsTr("Bloom Quality")}
|
Text{text: qsTr("Bloom Quality")}
|
||||||
Slider{
|
Slider{
|
||||||
id: bloomQualitySlider
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onValueChanged: parent.valsIndex = value;
|
id: bloomSlider
|
||||||
stepSize: 1
|
onValueChanged: appSettings.bloom_quality = value;
|
||||||
Component.onCompleted: {
|
value: appSettings.bloom_quality
|
||||||
minimumValue = 0;
|
stepSize: 0.10
|
||||||
maximumValue = 2;
|
Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5
|
||||||
value = parent.vals.indexOf(shadersettings.bloom_quality);
|
|
||||||
}
|
|
||||||
Connections{
|
|
||||||
target: shadersettings
|
|
||||||
onBloom_qualityChanged:
|
|
||||||
bloomQualityContainer.valsIndex = bloomQualityContainer.vals.indexOf(shadersettings.bloom_quality);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Text{
|
|
||||||
text: parent.valsStrings[parent.valsIndex];
|
|
||||||
}
|
}
|
||||||
|
Text{text: Math.round(bloomSlider.value * 100) + "%"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GroupBox{
|
GroupBox{
|
||||||
@ -150,9 +89,9 @@ Tab{
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
CheckBox{
|
CheckBox{
|
||||||
checked: shadersettings._frameReflections
|
checked: appSettings._frameReflections
|
||||||
text: qsTr("Frame Reflections")
|
text: qsTr("Frame Reflections")
|
||||||
onCheckedChanged: shadersettings._frameReflections = checked
|
onCheckedChanged: appSettings._frameReflections = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,9 @@ Tab{
|
|||||||
property string selectedElement: model[currentIndex]
|
property string selectedElement: model[currentIndex]
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
|
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
|
||||||
currentIndex: shadersettings.rasterization
|
currentIndex: appSettings.rasterization
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
shadersettings.rasterization = currentIndex
|
appSettings.rasterization = currentIndex
|
||||||
fontChanger.updateIndex();
|
fontChanger.updateIndex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,14 +50,14 @@ Tab{
|
|||||||
ComboBox{
|
ComboBox{
|
||||||
id: fontChanger
|
id: fontChanger
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
model: shadersettings.fontlist
|
model: appSettings.fontlist
|
||||||
currentIndex: updateIndex()
|
currentIndex: updateIndex()
|
||||||
onActivated: {
|
onActivated: {
|
||||||
shadersettings.fontIndexes[shadersettings.rasterization] = index;
|
appSettings.fontIndexes[appSettings.rasterization] = index;
|
||||||
shadersettings.handleFontChanged();
|
appSettings.handleFontChanged();
|
||||||
}
|
}
|
||||||
function updateIndex(){
|
function updateIndex(){
|
||||||
currentIndex = shadersettings.fontIndexes[shadersettings.rasterization];
|
currentIndex = appSettings.fontIndexes[appSettings.rasterization];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text{ text: qsTr("Scaling") }
|
Text{ text: qsTr("Scaling") }
|
||||||
@ -66,18 +66,18 @@ Tab{
|
|||||||
Slider{
|
Slider{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
id: fontScalingChanger
|
id: fontScalingChanger
|
||||||
onValueChanged: if(enabled) shadersettings.fontScaling = value
|
onValueChanged: if(enabled) appSettings.fontScaling = value
|
||||||
stepSize: 0.05
|
stepSize: 0.05
|
||||||
enabled: false // Another trick to fix initial bad behavior.
|
enabled: false // Another trick to fix initial bad behavior.
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
minimumValue = 0.5;
|
minimumValue = 0.5;
|
||||||
maximumValue = 2.5;
|
maximumValue = 2.5;
|
||||||
value = shadersettings.fontScaling;
|
value = appSettings.fontScaling;
|
||||||
enabled = true;
|
enabled = true;
|
||||||
}
|
}
|
||||||
Connections{
|
Connections{
|
||||||
target: shadersettings
|
target: appSettings
|
||||||
onFontScalingChanged: fontScalingChanger.value = shadersettings.fontScaling;
|
onFontScalingChanged: fontScalingChanger.value = appSettings.fontScaling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text{
|
Text{
|
||||||
@ -90,10 +90,14 @@ Tab{
|
|||||||
Slider{
|
Slider{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
id: widthChanger
|
id: widthChanger
|
||||||
onValueChanged: shadersettings.fontWidth = value;
|
onValueChanged: appSettings.fontWidth = value;
|
||||||
value: shadersettings.fontWidth
|
value: appSettings.fontWidth
|
||||||
stepSize: 0.05
|
stepSize: 0.05
|
||||||
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
|
Component.onCompleted: {
|
||||||
|
// This is needed to avoid unnecessary chnaged events.
|
||||||
|
minimumValue = 0.5;
|
||||||
|
maximumValue = 1.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Text{
|
Text{
|
||||||
text: Math.round(widthChanger.value * 100) + "%"
|
text: Math.round(widthChanger.value * 100) + "%"
|
||||||
@ -112,29 +116,29 @@ Tab{
|
|||||||
name: qsTr("Font")
|
name: qsTr("Font")
|
||||||
height: 50
|
height: 50
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onColorSelected: shadersettings._font_color = color;
|
onColorSelected: appSettings._font_color = color;
|
||||||
button_color: shadersettings._font_color
|
button_color: appSettings._font_color
|
||||||
}
|
}
|
||||||
ColorButton{
|
ColorButton{
|
||||||
name: qsTr("Background")
|
name: qsTr("Background")
|
||||||
height: 50
|
height: 50
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onColorSelected: shadersettings._background_color = color;
|
onColorSelected: appSettings._background_color = color;
|
||||||
button_color: shadersettings._background_color
|
button_color: appSettings._background_color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Chroma Color")
|
name: qsTr("Chroma Color")
|
||||||
onNewValue: shadersettings.chroma_color = newValue
|
onNewValue: appSettings.chroma_color = newValue
|
||||||
value: shadersettings.chroma_color
|
value: appSettings.chroma_color
|
||||||
}
|
}
|
||||||
CheckableSlider{
|
CheckableSlider{
|
||||||
name: qsTr("Saturation Color")
|
name: qsTr("Saturation Color")
|
||||||
onNewValue: shadersettings.saturation_color = newValue
|
onNewValue: appSettings.saturation_color = newValue
|
||||||
value: shadersettings.saturation_color
|
value: appSettings.saturation_color
|
||||||
enabled: shadersettings.chroma_color !== 0
|
enabled: appSettings.chroma_color !== 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,37 +21,41 @@
|
|||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
|
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
property color font_color: shadersettings.font_color
|
property ShaderEffectSource source
|
||||||
property color background_color: shadersettings.background_color
|
property ShaderEffectSource bloomSource
|
||||||
property variant source: terminal.theSource
|
|
||||||
property variant bloomSource: terminal.bloomSource
|
|
||||||
property variant rasterizationSource: terminal.rasterizationSource
|
|
||||||
property variant noiseSource: terminal.staticNoiseSource
|
|
||||||
property real bloom_strength: shadersettings.bloom_strength * 2.5
|
|
||||||
|
|
||||||
property real jitter: shadersettings.jitter * 0.007
|
property color font_color: appSettings.font_color
|
||||||
|
property color background_color: appSettings.background_color
|
||||||
|
property real bloom_strength: appSettings.bloom_strength * 2.5
|
||||||
|
|
||||||
property real noise_strength: shadersettings.noise_strength
|
property real jitter: appSettings.jitter * 0.007
|
||||||
property real screen_distorsion: shadersettings.screen_distortion
|
property real noise_strength: appSettings.noise_strength
|
||||||
property real glowing_line_strength: shadersettings.glowing_line_strength
|
property size scaleNoiseSize: Qt.size((width) / (noiseTexture.width * appSettings.window_scaling * appSettings.fontScaling),
|
||||||
|
(height) / (noiseTexture.height * appSettings.window_scaling * appSettings.fontScaling))
|
||||||
|
|
||||||
property real chroma_color: shadersettings.chroma_color;
|
property real screen_distorsion: appSettings.screen_distortion
|
||||||
|
property real glowing_line_strength: appSettings.glowing_line_strength
|
||||||
|
|
||||||
property real rgb_shift: shadersettings.rgb_shift * 0.2
|
property real chroma_color: appSettings.chroma_color;
|
||||||
|
|
||||||
property real brightness_flickering: shadersettings.brightness_flickering
|
property real rgb_shift: appSettings.rgb_shift * 0.2
|
||||||
property real horizontal_sincronization: shadersettings.horizontal_sincronization
|
|
||||||
|
|
||||||
property bool frameReflections: shadersettings.frameReflections
|
property real brightness_flickering: appSettings.brightness_flickering
|
||||||
|
property real horizontal_sincronization: appSettings.horizontal_sincronization
|
||||||
|
|
||||||
property real disp_top: (frame.item.displacementTop * shadersettings.window_scaling) / height
|
property bool frameReflections: appSettings.frameReflections
|
||||||
property real disp_bottom: (frame.item.displacementBottom * shadersettings.window_scaling) / height
|
|
||||||
property real disp_left: (frame.item.displacementLeft * shadersettings.window_scaling) / width
|
|
||||||
property real disp_right: (frame.item.displacementRight * shadersettings.window_scaling) / width
|
|
||||||
|
|
||||||
property real screen_brightness: shadersettings.brightness * 1.5 + 0.5
|
property real disp_top: (frame.item.displacementTop * appSettings.window_scaling) / height
|
||||||
|
property real disp_bottom: (frame.item.displacementBottom * appSettings.window_scaling) / height
|
||||||
|
property real disp_left: (frame.item.displacementLeft * appSettings.window_scaling) / width
|
||||||
|
property real disp_right: (frame.item.displacementRight * appSettings.window_scaling) / width
|
||||||
|
|
||||||
|
property real screen_brightness: appSettings.brightness * 1.5 + 0.5
|
||||||
|
|
||||||
|
property real dispX
|
||||||
|
property real dispY
|
||||||
|
property size virtual_resolution
|
||||||
|
|
||||||
TimeManager{
|
TimeManager{
|
||||||
id: timeManager
|
id: timeManager
|
||||||
@ -59,7 +63,7 @@ ShaderEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property alias time: timeManager.time
|
property alias time: timeManager.time
|
||||||
property variant randomFunctionSource: randfuncsource
|
property variant noiseSource: noiseShaderSource
|
||||||
|
|
||||||
// If something goes wrong activate the fallback version of the shader.
|
// If something goes wrong activate the fallback version of the shader.
|
||||||
property bool fallBack: false
|
property bool fallBack: false
|
||||||
@ -68,20 +72,19 @@ ShaderEffect {
|
|||||||
|
|
||||||
//Smooth random texture used for flickering effect.
|
//Smooth random texture used for flickering effect.
|
||||||
Image{
|
Image{
|
||||||
id: randtexture
|
id: noiseTexture
|
||||||
source: "frames/images/randfunction.png"
|
source: "images/allNoise512.png"
|
||||||
width: 512
|
width: 512
|
||||||
height: 512
|
height: 512
|
||||||
sourceSize.width: 512
|
fillMode: Image.Tile
|
||||||
sourceSize.height: 256
|
visible: false
|
||||||
fillMode: Image.TileVertically
|
|
||||||
}
|
}
|
||||||
ShaderEffectSource{
|
ShaderEffectSource{
|
||||||
id: randfuncsource
|
id: noiseShaderSource
|
||||||
sourceItem: randtexture
|
sourceItem: noiseTexture
|
||||||
live: false
|
|
||||||
hideSource: true
|
|
||||||
wrapMode: ShaderEffectSource.Repeat
|
wrapMode: ShaderEffectSource.Repeat
|
||||||
|
visible: false
|
||||||
|
smooth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
//Print the number with a reasonable precision for the shader.
|
//Print the number with a reasonable precision for the shader.
|
||||||
@ -104,27 +107,33 @@ ShaderEffect {
|
|||||||
varying highp vec2 qt_TexCoord0;" +
|
varying highp vec2 qt_TexCoord0;" +
|
||||||
|
|
||||||
(!fallBack ? "
|
(!fallBack ? "
|
||||||
uniform sampler2D randomFunctionSource;" : "") +
|
uniform sampler2D noiseSource;" : "") +
|
||||||
|
|
||||||
(!fallBack && brightness_flickering !== 0.0 ?"
|
(!fallBack && brightness_flickering !== 0.0 ?"
|
||||||
varying lowp float brightness;
|
varying lowp float brightness;
|
||||||
uniform lowp float brightness_flickering;" : "") +
|
uniform lowp float brightness_flickering;" : "") +
|
||||||
(!fallBack && horizontal_sincronization !== 0.0 ?"
|
(!fallBack && horizontal_sincronization !== 0.0 ?"
|
||||||
varying lowp float horizontal_distortion;
|
uniform lowp float horizontal_sincronization;
|
||||||
uniform lowp float horizontal_sincronization;" : "") +
|
varying lowp float distortionScale;
|
||||||
|
varying lowp float distortionFreq;" : "") +
|
||||||
|
|
||||||
"
|
"
|
||||||
void main() {
|
void main() {
|
||||||
qt_TexCoord0.x = (qt_MultiTexCoord0.x - disp_left) / (1.0 - disp_left - disp_right);
|
qt_TexCoord0.x = (qt_MultiTexCoord0.x - disp_left) / (1.0 - disp_left - disp_right);
|
||||||
qt_TexCoord0.y = (qt_MultiTexCoord0.y - disp_top) / (1.0 - disp_top - disp_bottom);
|
qt_TexCoord0.y = (qt_MultiTexCoord0.y - disp_top) / (1.0 - disp_top - disp_bottom);
|
||||||
vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" +
|
vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" +
|
||||||
|
|
||||||
|
(!fallBack && (brightness_flickering !== 0.0 || horizontal_sincronization !== 0.0) ?
|
||||||
|
"vec4 initialNoiseTexel = texture2D(noiseSource, coords);"
|
||||||
|
: "") +
|
||||||
(!fallBack && brightness_flickering !== 0.0 ? "
|
(!fallBack && brightness_flickering !== 0.0 ? "
|
||||||
brightness = 1.0 + (texture2D(randomFunctionSource, coords).g - 0.5) * brightness_flickering;"
|
brightness = 1.0 + (initialNoiseTexel.g - 0.5) * brightness_flickering;"
|
||||||
: "") +
|
: "") +
|
||||||
|
|
||||||
(!fallBack && horizontal_sincronization !== 0.0 ? "
|
(!fallBack && horizontal_sincronization !== 0.0 ? "
|
||||||
float randval = 1.5 * texture2D(randomFunctionSource,(vec2(1.0) -coords) * 0.5).g;
|
float randval = horizontal_sincronization - initialNoiseTexel.r;
|
||||||
float negsinc = 1.0 - 0.6 * horizontal_sincronization;" + "
|
distortionScale = step(0.0, randval) * randval * horizontal_sincronization;
|
||||||
horizontal_distortion = step(negsinc, randval) * (randval - negsinc) * 0.3*horizontal_sincronization;"
|
distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
|
||||||
: "") +
|
: "") +
|
||||||
|
|
||||||
"gl_Position = qt_Matrix * qt_Vertex;
|
"gl_Position = qt_Matrix * qt_Vertex;
|
||||||
@ -138,16 +147,21 @@ ShaderEffect {
|
|||||||
|
|
||||||
uniform highp vec4 font_color;
|
uniform highp vec4 font_color;
|
||||||
uniform highp vec4 background_color;
|
uniform highp vec4 background_color;
|
||||||
uniform highp sampler2D rasterizationSource;
|
uniform lowp float screen_brightness;
|
||||||
uniform lowp float screen_brightness;" +
|
|
||||||
|
uniform highp vec2 virtual_resolution;
|
||||||
|
uniform highp float dispX;
|
||||||
|
uniform highp float dispY;" +
|
||||||
|
|
||||||
(bloom_strength !== 0 ? "
|
(bloom_strength !== 0 ? "
|
||||||
uniform highp sampler2D bloomSource;
|
uniform highp sampler2D bloomSource;
|
||||||
uniform lowp float bloom_strength;" : "") +
|
uniform lowp float bloom_strength;" : "") +
|
||||||
(noise_strength !== 0 ? "
|
(noise_strength !== 0 ? "
|
||||||
uniform highp float noise_strength;" : "") +
|
uniform highp float noise_strength;" : "") +
|
||||||
(noise_strength !== 0 || jitter !== 0 || rgb_shift ? "
|
(((noise_strength !== 0 || jitter !== 0 || rgb_shift)
|
||||||
uniform lowp sampler2D noiseSource;" : "") +
|
||(fallBack && (brightness_flickering || horizontal_sincronization))) ? "
|
||||||
|
uniform lowp sampler2D noiseSource;
|
||||||
|
uniform highp vec2 scaleNoiseSize;" : "") +
|
||||||
(screen_distorsion !== 0 ? "
|
(screen_distorsion !== 0 ? "
|
||||||
uniform highp float screen_distorsion;" : "") +
|
uniform highp float screen_distorsion;" : "") +
|
||||||
(glowing_line_strength !== 0 ? "
|
(glowing_line_strength !== 0 ? "
|
||||||
@ -159,23 +173,34 @@ ShaderEffect {
|
|||||||
(rgb_shift !== 0 ? "
|
(rgb_shift !== 0 ? "
|
||||||
uniform lowp float rgb_shift;" : "") +
|
uniform lowp float rgb_shift;" : "") +
|
||||||
|
|
||||||
(fallBack && (brightness_flickering || horizontal_sincronization) ? "
|
|
||||||
uniform lowp sampler2D randomFunctionSource;" : "") +
|
|
||||||
(fallBack && horizontal_sincronization !== 0 ? "
|
(fallBack && horizontal_sincronization !== 0 ? "
|
||||||
uniform lowp float horizontal_sincronization;" : "") +
|
uniform lowp float horizontal_sincronization;" : "") +
|
||||||
(fallBack && brightness_flickering !== 0.0 ?"
|
(fallBack && brightness_flickering !== 0.0 ?"
|
||||||
uniform lowp float brightness_flickering;" : "") +
|
uniform lowp float brightness_flickering;" : "") +
|
||||||
(!fallBack && brightness_flickering !== 0 ? "
|
(!fallBack && brightness_flickering !== 0 ? "
|
||||||
varying lowp float brightness;" : "") +
|
varying lowp float brightness;"
|
||||||
|
: "") +
|
||||||
(!fallBack && horizontal_sincronization !== 0 ? "
|
(!fallBack && horizontal_sincronization !== 0 ? "
|
||||||
varying lowp float horizontal_distortion;" : "") +
|
varying lowp float distortionScale;
|
||||||
|
varying lowp float distortionFreq;" : "") +
|
||||||
|
|
||||||
(glowing_line_strength !== 0 ? "
|
(glowing_line_strength !== 0 ? "
|
||||||
float randomPass(vec2 coords){
|
float randomPass(vec2 coords){
|
||||||
return fract(smoothstep(-0.2, 0.0, coords.y - 3.0 * fract(time * 0.0001))) * glowing_line_strength;
|
return fract(smoothstep(-0.2, 0.0, coords.y - 3.0 * fract(time * 0.0001))) * glowing_line_strength;
|
||||||
}" : "") +
|
}" : "") +
|
||||||
|
|
||||||
"float rgb2grey(vec3 v){
|
"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;
|
||||||
|
}
|
||||||
|
|
||||||
|
float rgb2grey(vec3 v){
|
||||||
return dot(v, vec3(0.21, 0.72, 0.04));
|
return dot(v, vec3(0.21, 0.72, 0.04));
|
||||||
}" +
|
}" +
|
||||||
|
|
||||||
@ -183,18 +208,18 @@ ShaderEffect {
|
|||||||
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
|
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
|
||||||
"float distance = length(cc);" +
|
"float distance = length(cc);" +
|
||||||
|
|
||||||
//FallBack if there are problem
|
//FallBack if there are problems
|
||||||
(fallBack && (brightness_flickering || horizontal_sincronization) ? "
|
(fallBack && (brightness_flickering !== 0.0 || horizontal_sincronization !== 0.0) ?
|
||||||
vec2 randCoords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" : "") +
|
"vec2 initialCoords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));
|
||||||
|
vec4 initialNoiseTexel = texture2D(noiseSource, initialCoords);"
|
||||||
|
: "") +
|
||||||
(fallBack && brightness_flickering !== 0.0 ? "
|
(fallBack && brightness_flickering !== 0.0 ? "
|
||||||
float brightness = 1.0 + (texture2D(randomFunctionSource, randCoords).g - 0.5) * brightness_flickering;"
|
float brightness = 1.0 + (initialNoiseTexel.g - 0.5) * brightness_flickering;"
|
||||||
: "") +
|
: "") +
|
||||||
|
|
||||||
(fallBack && horizontal_sincronization !== 0.0 ? "
|
(fallBack && horizontal_sincronization !== 0.0 ? "
|
||||||
float randval = 1.5 * texture2D(randomFunctionSource,(vec2(1.0) - randCoords) * 0.5).g;
|
float randval = horizontal_sincronization - initialNoiseTexel.r;
|
||||||
float negsinc = 1.0 - 0.6 * horizontal_sincronization;" + "
|
float distortionScale = step(0.0, randval) * randval * horizontal_sincronization;
|
||||||
float horizontal_distortion = step(negsinc, randval) * (randval - negsinc) * 0.3*horizontal_sincronization;"
|
float distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
|
||||||
: "") +
|
: "") +
|
||||||
|
|
||||||
(noise_strength ? "
|
(noise_strength ? "
|
||||||
@ -207,23 +232,23 @@ ShaderEffect {
|
|||||||
vec2 coords = qt_TexCoord0;") +
|
vec2 coords = qt_TexCoord0;") +
|
||||||
|
|
||||||
(horizontal_sincronization !== 0 ? "
|
(horizontal_sincronization !== 0 ? "
|
||||||
float h_distortion = 0.5 * sin(time*0.001 + coords.y*10.0*fract(time/10.0));
|
float dst = sin((coords.y + time * 0.001) * distortionFreq);
|
||||||
h_distortion += 0.5 * cos(time*0.04 + 0.03 + coords.y*50.0*fract(time/10.0 + 0.4));
|
coords.x += dst * distortionScale;"
|
||||||
coords.x = coords.x + h_distortion * horizontal_distortion;" +
|
: "") +
|
||||||
(noise_strength ? "
|
|
||||||
noise += horizontal_distortion;" : "")
|
(jitter !== 0 || noise_strength !== 0 ?
|
||||||
|
"vec4 noiseTexel = texture2D(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 51.0), fract(time / 237.0)));"
|
||||||
: "") +
|
: "") +
|
||||||
|
|
||||||
(jitter !== 0 ? "
|
(jitter !== 0 ? "
|
||||||
vec2 offset = vec2(texture2D(noiseSource, coords + fract(time / 57.0)).a,
|
vec2 offset = vec2(noiseTexel.b, noiseTexel.a) - vec2(0.5);
|
||||||
texture2D(noiseSource, coords + fract(time / 251.0)).a) - 0.5;
|
|
||||||
vec2 txt_coords = coords + offset * jitter;"
|
vec2 txt_coords = coords + offset * jitter;"
|
||||||
: "vec2 txt_coords = coords;") +
|
: "vec2 txt_coords = coords;") +
|
||||||
|
|
||||||
"float color = 0.0;" +
|
"float color = 0.0;" +
|
||||||
|
|
||||||
(noise_strength !== 0 ? "
|
(noise_strength !== 0 ? "
|
||||||
float noiseVal = texture2D(noiseSource, coords + vec2(fract(time / 51.0), fract(time / 237.0))).a;
|
float noiseVal = noiseTexel.a;
|
||||||
color += noiseVal * noise * (1.0 - distance * 1.3);" : "") +
|
color += noiseVal * noise * (1.0 - distance * 1.3);" : "") +
|
||||||
|
|
||||||
(glowing_line_strength !== 0 ? "
|
(glowing_line_strength !== 0 ? "
|
||||||
@ -248,7 +273,9 @@ ShaderEffect {
|
|||||||
:
|
:
|
||||||
"vec3 finalColor = mix(background_color.rgb, font_color.rgb, greyscale_color);") +
|
"vec3 finalColor = mix(background_color.rgb, font_color.rgb, greyscale_color);") +
|
||||||
|
|
||||||
"finalColor *= texture2D(rasterizationSource, coords).a;" +
|
"finalColor *= getScanlineIntensity(coords);
|
||||||
|
finalColor *= smoothstep(-dispX, 0.0, coords.x) - smoothstep(1.0, 1.0 + dispX, coords.x);
|
||||||
|
finalColor *= smoothstep(-dispY, 0.0, coords.y) - smoothstep(1.0, 1.0 + dispY, coords.y);" +
|
||||||
|
|
||||||
(bloom_strength !== 0 ?
|
(bloom_strength !== 0 ?
|
||||||
"vec4 bloomFullColor = texture2D(bloomSource, coords);
|
"vec4 bloomFullColor = texture2D(bloomSource, coords);
|
||||||
|
@ -1,57 +1,119 @@
|
|||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
Item{
|
ShaderTerminal{
|
||||||
property alias title: terminal.title
|
property alias title: terminal.title
|
||||||
|
property alias terminalSize: terminal.terminalSize
|
||||||
|
|
||||||
Item{
|
id: mainShader
|
||||||
id: scalableContent
|
opacity: appSettings.windowOpacity * 0.3 + 0.7
|
||||||
width: parent.width * shadersettings.window_scaling
|
|
||||||
height: parent.height * shadersettings.window_scaling
|
|
||||||
|
|
||||||
Loader{
|
blending: false
|
||||||
id: frame
|
|
||||||
anchors.fill: parent
|
source: terminal.mainSource
|
||||||
z: 2.1
|
dispX: (12 / width) * appSettings.window_scaling
|
||||||
source: shadersettings.frame_source
|
dispY: (12 / height) * appSettings.window_scaling
|
||||||
}
|
virtual_resolution: terminal.virtualResolution
|
||||||
PreprocessedTerminal{
|
|
||||||
id: terminal
|
Loader{
|
||||||
anchors.fill: parent
|
id: frame
|
||||||
}
|
anchors.fill: parent
|
||||||
ShaderTerminal{
|
z: 2.1
|
||||||
id: shadercontainer
|
source: appSettings.frame_source
|
||||||
anchors.fill: parent
|
|
||||||
opacity: shadersettings.windowOpacity * 0.3 + 0.7
|
|
||||||
z: 1.9
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is used to render the texture to a lower resolution then scale it up.
|
PreprocessedTerminal{
|
||||||
|
id: terminal
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
// EFFECTS ////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
id: scalableContentSource
|
id: bloomEffectLoader
|
||||||
active: shadersettings.window_scaling < 1
|
active: appSettings.bloom_strength
|
||||||
|
asynchronous: true
|
||||||
|
width: parent.width * appSettings.bloom_quality
|
||||||
|
height: parent.height * appSettings.bloom_quality
|
||||||
|
sourceComponent: FastBlur{
|
||||||
|
radius: 48 * appSettings.bloom_quality * appSettings.window_scaling
|
||||||
|
source: terminal.mainTerminal
|
||||||
|
transparentBorder: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loader{
|
||||||
|
id: bloomSourceLoader
|
||||||
|
active: appSettings.bloom_strength !== 0
|
||||||
|
asynchronous: true
|
||||||
sourceComponent: ShaderEffectSource{
|
sourceComponent: ShaderEffectSource{
|
||||||
sourceItem: scalableContent
|
id: _bloomEffectSource
|
||||||
|
sourceItem: bloomEffectLoader.item
|
||||||
hideSource: true
|
hideSource: true
|
||||||
smooth: true
|
smooth: true
|
||||||
}
|
visible: false
|
||||||
}
|
|
||||||
Loader{
|
|
||||||
active: shadersettings.window_scaling < 1
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceComponent: ShaderEffect{
|
|
||||||
property var source: scalableContentSource.item
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Terminal size overlay. Shown when terminal size changes.
|
bloomSource: bloomSourceLoader.item
|
||||||
Loader{
|
|
||||||
id: sizeoverlayloader
|
// This shader might be useful in the future. Since we used it only for a couple
|
||||||
z: 3
|
// of calculations is probably best to move those in the main shader. If in
|
||||||
anchors.centerIn: parent
|
// we will need to store another fullScreen channel this might be handy.
|
||||||
active: shadersettings.show_terminal_size
|
|
||||||
sourceComponent: SizeOverlay{
|
// ShaderEffect {
|
||||||
terminalSize: terminal.terminalSize
|
// id: rasterizationEffect
|
||||||
}
|
// width: parent.width
|
||||||
}
|
// height: parent.height
|
||||||
|
// property real outColor: 0.0
|
||||||
|
// property real dispX: (5 / width) * appSettings.window_scaling
|
||||||
|
// property real dispY: (5 / height) * appSettings.window_scaling
|
||||||
|
// 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
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
@ -27,13 +27,13 @@ Timer{
|
|||||||
NumberAnimation on time {
|
NumberAnimation on time {
|
||||||
from: 0
|
from: 0
|
||||||
to: 100000
|
to: 100000
|
||||||
running: shadersettings.fps === 0 && enableTimer
|
running: appSettings.fps === 0 && enableTimer
|
||||||
duration: 100000
|
duration: 100000
|
||||||
loops: Animation.Infinite
|
loops: Animation.Infinite
|
||||||
}
|
}
|
||||||
|
|
||||||
onTriggered: time += interval
|
onTriggered: time += interval
|
||||||
running: shadersettings.fps !== 0 && enableTimer
|
running: appSettings.fps !== 0 && enableTimer
|
||||||
interval: Math.round(1000 / shadersettings.fps)
|
interval: Math.round(1000 / appSettings.fps)
|
||||||
repeat: true
|
repeat: true
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 132 KiB |
@ -4,16 +4,16 @@ import QtGraphicalEffects 1.0
|
|||||||
ShaderEffect{
|
ShaderEffect{
|
||||||
property variant source: framesource
|
property variant source: framesource
|
||||||
property variant normals: framesourcenormals
|
property variant normals: framesourcenormals
|
||||||
property real screen_distorsion: shadersettings.screen_distortion * framecontainer.distortionCoefficient
|
property real screen_distorsion: appSettings.screen_distortion * framecontainer.distortionCoefficient
|
||||||
property real ambient_light: shadersettings.ambient_light
|
property real ambient_light: appSettings.ambient_light
|
||||||
property color font_color: shadersettings.font_color
|
property color font_color: appSettings.font_color
|
||||||
property color background_color: shadersettings.background_color
|
property color background_color: appSettings.background_color
|
||||||
property real brightness: shadersettings.brightness * 1.5 + 0.5
|
property real brightness: appSettings.brightness * 1.5 + 0.5
|
||||||
|
|
||||||
property bool frameReflections: shadersettings.frameReflections
|
property bool frameReflections: appSettings.frameReflections
|
||||||
property variant lightSource: reflectionEffectSourceLoader.item
|
property variant lightSource: reflectionEffectSourceLoader.item
|
||||||
|
|
||||||
property real chroma_color: shadersettings.chroma_color
|
property real chroma_color: appSettings.chroma_color
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
id: reflectionEffectLoader
|
id: reflectionEffectLoader
|
||||||
@ -37,6 +37,7 @@ ShaderEffect{
|
|||||||
sourceItem: reflectionEffectLoader.item
|
sourceItem: reflectionEffectLoader.item
|
||||||
hideSource: true
|
hideSource: true
|
||||||
smooth: true
|
smooth: true
|
||||||
|
visible: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,12 +56,14 @@ Item{
|
|||||||
sourceItem: frameimage
|
sourceItem: frameimage
|
||||||
hideSource: true
|
hideSource: true
|
||||||
textureSize: Qt.size(parent.width, parent.height)
|
textureSize: Qt.size(parent.width, parent.height)
|
||||||
|
visible: false
|
||||||
}
|
}
|
||||||
ShaderEffectSource{
|
ShaderEffectSource{
|
||||||
id: framesourcenormals
|
id: framesourcenormals
|
||||||
sourceItem: framenormals
|
sourceItem: framenormals
|
||||||
hideSource: true
|
hideSource: true
|
||||||
textureSize: Qt.size(parent.width, parent.height)
|
textureSize: Qt.size(parent.width, parent.height)
|
||||||
|
visible: false
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
BIN
app/qml/images/allNoise512.png
Normal file
BIN
app/qml/images/allNoise512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 608 KiB |
@ -33,13 +33,13 @@ ApplicationWindow{
|
|||||||
|
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
property bool fullscreen: shadersettings.fullscreen
|
property bool fullscreen: appSettings.fullscreen
|
||||||
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
|
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
|
||||||
|
|
||||||
//Workaround: if menubar is assigned ugly margins are visible.
|
//Workaround: if menubar is assigned ugly margins are visible.
|
||||||
menuBar: Qt.platform.os === "osx"
|
menuBar: Qt.platform.os === "osx"
|
||||||
? defaultMenuBar
|
? defaultMenuBar
|
||||||
: shadersettings.showMenubar ? defaultMenuBar : null
|
: appSettings.showMenubar ? defaultMenuBar : null
|
||||||
|
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
title: terminalContainer.title || qsTr("cool-retro-term")
|
title: terminalContainer.title || qsTr("cool-retro-term")
|
||||||
@ -50,17 +50,17 @@ ApplicationWindow{
|
|||||||
enabled: Qt.platform.os !== "osx"
|
enabled: Qt.platform.os !== "osx"
|
||||||
shortcut: "Ctrl+Shift+M"
|
shortcut: "Ctrl+Shift+M"
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: shadersettings.showMenubar
|
checked: appSettings.showMenubar
|
||||||
onTriggered: shadersettings.showMenubar = !shadersettings.showMenubar
|
onTriggered: appSettings.showMenubar = !appSettings.showMenubar
|
||||||
}
|
}
|
||||||
Action {
|
Action {
|
||||||
id: fullscreenAction
|
id: fullscreenAction
|
||||||
text: qsTr("Fullscreen")
|
text: qsTr("Fullscreen")
|
||||||
enabled: Qt.platform.os !== "osx"
|
enabled: Qt.platform.os !== "osx"
|
||||||
shortcut: "Alt+F11"
|
shortcut: "Alt+F11"
|
||||||
onTriggered: shadersettings.fullscreen = !shadersettings.fullscreen;
|
onTriggered: appSettings.fullscreen = !appSettings.fullscreen;
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: shadersettings.fullscreen
|
checked: appSettings.fullscreen
|
||||||
}
|
}
|
||||||
Action {
|
Action {
|
||||||
id: quitAction
|
id: quitAction
|
||||||
@ -87,13 +87,13 @@ ApplicationWindow{
|
|||||||
id: zoomIn
|
id: zoomIn
|
||||||
text: qsTr("Zoom In")
|
text: qsTr("Zoom In")
|
||||||
shortcut: "Ctrl++"
|
shortcut: "Ctrl++"
|
||||||
onTriggered: shadersettings.incrementScaling();
|
onTriggered: appSettings.incrementScaling();
|
||||||
}
|
}
|
||||||
Action{
|
Action{
|
||||||
id: zoomOut
|
id: zoomOut
|
||||||
text: qsTr("Zoom Out")
|
text: qsTr("Zoom Out")
|
||||||
shortcut: "Ctrl+-"
|
shortcut: "Ctrl+-"
|
||||||
onTriggered: shadersettings.decrementScaling();
|
onTriggered: appSettings.decrementScaling();
|
||||||
}
|
}
|
||||||
Action{
|
Action{
|
||||||
id: showAboutAction
|
id: showAboutAction
|
||||||
@ -106,11 +106,17 @@ ApplicationWindow{
|
|||||||
id: defaultMenuBar
|
id: defaultMenuBar
|
||||||
}
|
}
|
||||||
ApplicationSettings{
|
ApplicationSettings{
|
||||||
id: shadersettings
|
id: appSettings
|
||||||
}
|
}
|
||||||
TerminalContainer{
|
TerminalContainer{
|
||||||
id: terminalContainer
|
id: terminalContainer
|
||||||
anchors.fill: parent
|
width: parent.width * appSettings.window_scaling
|
||||||
|
height: parent.height * appSettings.window_scaling
|
||||||
|
|
||||||
|
transform: Scale {
|
||||||
|
xScale: 1 / appSettings.window_scaling
|
||||||
|
yScale: 1 / appSettings.window_scaling
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SettingsWindow{
|
SettingsWindow{
|
||||||
id: settingswindow
|
id: settingswindow
|
||||||
@ -120,5 +126,13 @@ ApplicationWindow{
|
|||||||
id: aboutDialog
|
id: aboutDialog
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
Component.onCompleted: shadersettings.handleFontChanged();
|
Loader{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
active: appSettings.show_terminal_size
|
||||||
|
sourceComponent: SizeOverlay{
|
||||||
|
z: 3
|
||||||
|
terminalSize: terminalContainer.terminalSize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Component.onCompleted: appSettings.handleFontChanged();
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<file>frames/images/black-frame-normals.png</file>
|
<file>frames/images/black-frame-normals.png</file>
|
||||||
<file>frames/images/screen-frame.png</file>
|
<file>frames/images/screen-frame.png</file>
|
||||||
<file>frames/images/black-frame-original.png</file>
|
<file>frames/images/black-frame-original.png</file>
|
||||||
<file>frames/images/randfunction.png</file>
|
|
||||||
<file>frames/images/screen-frame-original.png</file>
|
<file>frames/images/screen-frame-original.png</file>
|
||||||
<file>frames/WhiteSimpleFrame.qml</file>
|
<file>frames/WhiteSimpleFrame.qml</file>
|
||||||
<file>frames/utils/FrameShader.qml</file>
|
<file>frames/utils/FrameShader.qml</file>
|
||||||
@ -66,5 +65,7 @@
|
|||||||
<file>SettingsPerformanceTab.qml</file>
|
<file>SettingsPerformanceTab.qml</file>
|
||||||
<file>TerminalContainer.qml</file>
|
<file>TerminalContainer.qml</file>
|
||||||
<file>images/crt256.png</file>
|
<file>images/crt256.png</file>
|
||||||
|
<file>utils.js</file>
|
||||||
|
<file>images/allNoise512.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
14
app/qml/utils.js
Normal file
14
app/qml/utils.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.pragma library
|
||||||
|
|
||||||
|
function mix(c1, c2, alpha){
|
||||||
|
return Qt.rgba(c1.r * alpha + c2.r * (1-alpha),
|
||||||
|
c1.g * alpha + c2.g * (1-alpha),
|
||||||
|
c1.b * alpha + c2.b * (1-alpha),
|
||||||
|
c1.a * alpha + c2.a * (1-alpha))
|
||||||
|
}
|
||||||
|
function strToColor(s){
|
||||||
|
var r = parseInt(s.substring(1,3), 16) / 256;
|
||||||
|
var g = parseInt(s.substring(3,5), 16) / 256;
|
||||||
|
var b = parseInt(s.substring(5,7), 16) / 256;
|
||||||
|
return Qt.rgba(r, g, b, 1.0);
|
||||||
|
}
|
@ -1 +1 @@
|
|||||||
Subproject commit 02bb99b446a51052f7e950029cf331117ac78ab6
|
Subproject commit fb04792ae3dfbbc40a8d957a7b7300a98862bb9d
|
Loading…
x
Reference in New Issue
Block a user