mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-11-04 09:02:14 +00:00 
			
		
		
		
	Texture quality is actually working. (And also quite useful for high-dpi screens).
This commit is contained in:
		@@ -143,7 +143,7 @@ Item{
 | 
				
			|||||||
    function handleFontChanged(){
 | 
					    function handleFontChanged(){
 | 
				
			||||||
        if(!fontManager.item) return;
 | 
					        if(!fontManager.item) return;
 | 
				
			||||||
        fontManager.item.selectedFontIndex = fontIndexes[rasterization];
 | 
					        fontManager.item.selectedFontIndex = fontIndexes[rasterization];
 | 
				
			||||||
        fontManager.item.scaling = fontScaling;
 | 
					        fontManager.item.scaling = fontScaling * window_scaling;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var fontSource = fontManager.item.source;
 | 
					        var fontSource = fontManager.item.source;
 | 
				
			||||||
        var pixelSize = fontManager.item.pixelSize;
 | 
					        var pixelSize = fontManager.item.pixelSize;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -160,7 +160,9 @@ Item{
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    MouseArea{
 | 
					    MouseArea{
 | 
				
			||||||
        acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
 | 
					        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:{
 | 
					        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();
 | 
				
			||||||
@@ -313,7 +315,7 @@ Item{
 | 
				
			|||||||
    //  BLOOM  ////////////////////////////////////////////////////////////////
 | 
					    //  BLOOM  ////////////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Loader{
 | 
					    Loader{
 | 
				
			||||||
        property real scaling: shadersettings.bloom_quality
 | 
					        property real scaling: shadersettings.bloom_quality * shadersettings.window_scaling
 | 
				
			||||||
        id: bloomEffectLoader
 | 
					        id: bloomEffectLoader
 | 
				
			||||||
        active: mBloom != 0
 | 
					        active: mBloom != 0
 | 
				
			||||||
        asynchronous: true
 | 
					        asynchronous: true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -56,8 +56,8 @@ Tab{
 | 
				
			|||||||
                    id: txtslider
 | 
					                    id: txtslider
 | 
				
			||||||
                    onValueChanged: shadersettings.window_scaling = value;
 | 
					                    onValueChanged: shadersettings.window_scaling = value;
 | 
				
			||||||
                    value: shadersettings.window_scaling
 | 
					                    value: shadersettings.window_scaling
 | 
				
			||||||
                    stepSize: 0.25
 | 
					                    stepSize: 0.10
 | 
				
			||||||
                    Component.onCompleted: minimumValue = 0.5 //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) + "%"}
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,10 +46,10 @@ ShaderEffect {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    property bool frameReflections: shadersettings.frameReflections
 | 
					    property bool frameReflections: shadersettings.frameReflections
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    property real disp_top: frame.item.displacementTop / height
 | 
					    property real disp_top: (frame.item.displacementTop * shadersettings.window_scaling) / height
 | 
				
			||||||
    property real disp_bottom: frame.item.displacementBottom / height
 | 
					    property real disp_bottom: (frame.item.displacementBottom * shadersettings.window_scaling) / height
 | 
				
			||||||
    property real disp_left: frame.item.displacementLeft / width
 | 
					    property real disp_left: (frame.item.displacementLeft * shadersettings.window_scaling) / width
 | 
				
			||||||
    property real disp_right: frame.item.displacementRight / width
 | 
					    property real disp_right: (frame.item.displacementRight * shadersettings.window_scaling) / width
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    property real screen_brightness: shadersettings.brightness * 1.5 + 0.5
 | 
					    property real screen_brightness: shadersettings.brightness * 1.5 + 0.5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										55
									
								
								app/qml/TerminalContainer.qml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								app/qml/TerminalContainer.qml
									
									
									
									
									
										Normal 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
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -113,29 +113,8 @@ ApplicationWindow{
 | 
				
			|||||||
        id: timeManager
 | 
					        id: timeManager
 | 
				
			||||||
        enableTimer: terminalWindow.visible
 | 
					        enableTimer: terminalWindow.visible
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    Item{
 | 
					    TerminalContainer{
 | 
				
			||||||
        id: maincontainer
 | 
					        anchors.fill: parent
 | 
				
			||||||
        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
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    SettingsWindow{
 | 
					    SettingsWindow{
 | 
				
			||||||
        id: settingswindow
 | 
					        id: settingswindow
 | 
				
			||||||
@@ -145,14 +124,5 @@ ApplicationWindow{
 | 
				
			|||||||
        id: aboutDialog
 | 
					        id: aboutDialog
 | 
				
			||||||
        visible: false
 | 
					        visible: false
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    Loader{
 | 
					 | 
				
			||||||
        id: sizeoverlayloader
 | 
					 | 
				
			||||||
        z: 3
 | 
					 | 
				
			||||||
        anchors.centerIn: parent
 | 
					 | 
				
			||||||
        active: shadersettings.show_terminal_size
 | 
					 | 
				
			||||||
        sourceComponent: SizeOverlay{
 | 
					 | 
				
			||||||
            terminalSize: terminal.terminalSize
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    Component.onCompleted: shadersettings.handleFontChanged();
 | 
					    Component.onCompleted: shadersettings.handleFontChanged();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,5 +65,6 @@
 | 
				
			|||||||
        <file>Storage.qml</file>
 | 
					        <file>Storage.qml</file>
 | 
				
			||||||
        <file>CRTMainMenuBar.qml</file>
 | 
					        <file>CRTMainMenuBar.qml</file>
 | 
				
			||||||
        <file>SettingsPerformanceTab.qml</file>
 | 
					        <file>SettingsPerformanceTab.qml</file>
 | 
				
			||||||
 | 
					        <file>TerminalContainer.qml</file>
 | 
				
			||||||
    </qresource>
 | 
					    </qresource>
 | 
				
			||||||
</RCC>
 | 
					</RCC>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user