Texture quality is actually working. (And also quite useful for high-dpi screens).

This commit is contained in:
Filippo Scognamiglio 2014-10-11 01:24:20 +02:00
parent d4ca781e90
commit 438c50d775
7 changed files with 70 additions and 42 deletions

View File

@ -143,7 +143,7 @@ Item{
function handleFontChanged(){
if(!fontManager.item) return;
fontManager.item.selectedFontIndex = fontIndexes[rasterization];
fontManager.item.scaling = fontScaling;
fontManager.item.scaling = fontScaling * window_scaling;
var fontSource = fontManager.item.source;
var pixelSize = fontManager.item.pixelSize;

View File

@ -160,10 +160,12 @@ Item{
}
MouseArea{
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
anchors.fill: parent
// This is incredibly ugly. All this file should be reorganized.
width: (parent.width + dleft + dright) / shadersettings.window_scaling - dleft -dright
height: (parent.height + dtop + dbottom) / shadersettings.window_scaling - dtop - dbottom
onWheel:{
if(wheel.modifiers & Qt.ControlModifier){
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
} else {
var coord = correctDistortion(wheel.x, wheel.y);
var lines = wheel.angleDelta.y > 0 ? -1 : 1;
@ -313,7 +315,7 @@ Item{
// BLOOM ////////////////////////////////////////////////////////////////
Loader{
property real scaling: shadersettings.bloom_quality
property real scaling: shadersettings.bloom_quality * shadersettings.window_scaling
id: bloomEffectLoader
active: mBloom != 0
asynchronous: true

View File

@ -56,8 +56,8 @@ Tab{
id: txtslider
onValueChanged: shadersettings.window_scaling = value;
value: shadersettings.window_scaling
stepSize: 0.25
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
stepSize: 0.10
Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5
}
Text{text: Math.round(txtslider.value * 100) + "%"}
}

View File

@ -46,10 +46,10 @@ ShaderEffect {
property bool frameReflections: shadersettings.frameReflections
property real disp_top: frame.item.displacementTop / height
property real disp_bottom: frame.item.displacementBottom / height
property real disp_left: frame.item.displacementLeft / width
property real disp_right: frame.item.displacementRight / width
property real disp_top: (frame.item.displacementTop * shadersettings.window_scaling) / height
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

View File

@ -0,0 +1,55 @@
import QtQuick 2.2
Item{
Item{
id: scalableContent
width: parent.width * shadersettings.window_scaling
height: parent.height * shadersettings.window_scaling
Loader{
id: frame
anchors.fill: parent
z: 2.1
source: shadersettings.frame_source
}
PreprocessedTerminal{
id: terminal
anchors.fill: parent
}
ShaderTerminal{
id: shadercontainer
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.
Loader{
id: scalableContentSource
active: shadersettings.window_scaling < 1
sourceComponent: ShaderEffectSource{
sourceItem: scalableContent
hideSource: true
smooth: true
}
}
Loader{
active: shadersettings.window_scaling < 1
anchors.fill: parent
sourceComponent: ShaderEffect{
property var source: scalableContentSource.item
}
}
// Terminal size overlay. Shown when terminal size changes.
Loader{
id: sizeoverlayloader
z: 3
anchors.centerIn: parent
active: shadersettings.show_terminal_size
sourceComponent: SizeOverlay{
terminalSize: terminal.terminalSize
}
}
}

View File

@ -113,29 +113,8 @@ ApplicationWindow{
id: timeManager
enableTimer: terminalWindow.visible
}
Item{
id: maincontainer
anchors.centerIn: parent
width: parent.width * shadersettings.window_scaling
height: parent.height * shadersettings.window_scaling
scale: 1.0 / shadersettings.window_scaling
opacity: shadersettings.windowOpacity * 0.3 + 0.7
Loader{
id: frame
anchors.fill: parent
z: 2.1
source: shadersettings.frame_source
}
PreprocessedTerminal{
id: terminal
anchors.fill: parent
}
ShaderTerminal{
id: shadercontainer
anchors.fill: parent
z: 1.9
}
TerminalContainer{
anchors.fill: parent
}
SettingsWindow{
id: settingswindow
@ -145,14 +124,5 @@ ApplicationWindow{
id: aboutDialog
visible: false
}
Loader{
id: sizeoverlayloader
z: 3
anchors.centerIn: parent
active: shadersettings.show_terminal_size
sourceComponent: SizeOverlay{
terminalSize: terminal.terminalSize
}
}
Component.onCompleted: shadersettings.handleFontChanged();
}

View File

@ -65,5 +65,6 @@
<file>Storage.qml</file>
<file>CRTMainMenuBar.qml</file>
<file>SettingsPerformanceTab.qml</file>
<file>TerminalContainer.qml</file>
</qresource>
</RCC>