mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-22 12:58:39 +00:00
Merge pull request #131 from Swordfish90/2yscanlines
Much improved scanlines rendering. Font width can be customized. Redisigned settings. Bloom and scanline quality can be selected.
This commit is contained in:
commit
f8db912f5f
@ -69,6 +69,8 @@ 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 chroma_color: 0.0
|
property real chroma_color: 0.0
|
||||||
property real saturation_color: 0.0
|
property real saturation_color: 0.0
|
||||||
|
|
||||||
@ -85,6 +87,9 @@ Item{
|
|||||||
|
|
||||||
property int rasterization: no_rasterization
|
property int rasterization: no_rasterization
|
||||||
|
|
||||||
|
property int scanline_quality: 3
|
||||||
|
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}
|
||||||
@ -116,27 +121,29 @@ Item{
|
|||||||
onLoaded: handleFontChanged()
|
onLoaded: handleFontChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
signal fontScalingChanged
|
property real fontScaling: 1.0
|
||||||
property var fontScalingList: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5]
|
onFontScalingChanged: handleFontChanged();
|
||||||
property int fontScalingIndex: 5
|
|
||||||
|
|
||||||
function setScalingIndex(newScaling){
|
function incrementScaling(){
|
||||||
fontScalingIndex = newScaling;
|
fontScaling = Math.min(fontScaling + 0.05, 2.50);
|
||||||
fontScalingChanged();
|
|
||||||
handleFontChanged();
|
handleFontChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getScalingIndex(){
|
function decrementScaling(){
|
||||||
return fontScalingIndex;
|
fontScaling = Math.max(fontScaling - 0.05, 0.50);
|
||||||
|
handleFontChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property real fontWidth: 1.0
|
||||||
|
onFontWidthChanged: handleFontChanged();
|
||||||
|
|
||||||
property var fontIndexes: [0,0,0]
|
property var fontIndexes: [0,0,0]
|
||||||
property var fontlist: fontManager.item.fontlist
|
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];
|
||||||
fontManager.item.scaling = fontScalingList[fontScalingIndex];
|
fontManager.item.scaling = fontScaling;
|
||||||
|
|
||||||
var fontSource = fontManager.item.source;
|
var fontSource = fontManager.item.source;
|
||||||
var pixelSize = fontManager.item.pixelSize;
|
var pixelSize = fontManager.item.pixelSize;
|
||||||
@ -164,10 +171,12 @@ Item{
|
|||||||
fps: fps,
|
fps: fps,
|
||||||
window_scaling: window_scaling,
|
window_scaling: window_scaling,
|
||||||
show_terminal_size: show_terminal_size,
|
show_terminal_size: show_terminal_size,
|
||||||
fontScalingIndex: fontScalingIndex,
|
fontScaling: fontScaling,
|
||||||
fontIndexes: fontIndexes,
|
fontIndexes: fontIndexes,
|
||||||
frameReflections: _frameReflections,
|
frameReflections: _frameReflections,
|
||||||
showMenubar: showMenubar
|
showMenubar: showMenubar,
|
||||||
|
scanline_quality: scanline_quality,
|
||||||
|
bloom_quality: bloom_quality
|
||||||
}
|
}
|
||||||
return JSON.stringify(settings);
|
return JSON.stringify(settings);
|
||||||
}
|
}
|
||||||
@ -193,7 +202,8 @@ Item{
|
|||||||
contrast: contrast,
|
contrast: contrast,
|
||||||
ambient_light: ambient_light,
|
ambient_light: ambient_light,
|
||||||
windowOpacity: windowOpacity,
|
windowOpacity: windowOpacity,
|
||||||
fontIndex: fontIndexes[rasterization]
|
fontIndex: fontIndexes[rasterization],
|
||||||
|
fontWidth: fontWidth
|
||||||
}
|
}
|
||||||
return JSON.stringify(settings);
|
return JSON.stringify(settings);
|
||||||
}
|
}
|
||||||
@ -231,11 +241,14 @@ Item{
|
|||||||
window_scaling = settings.window_scaling !== undefined ? settings.window_scaling : window_scaling
|
window_scaling = settings.window_scaling !== undefined ? settings.window_scaling : window_scaling
|
||||||
|
|
||||||
fontIndexes = settings.fontIndexes !== undefined ? settings.fontIndexes : fontIndexes
|
fontIndexes = settings.fontIndexes !== undefined ? settings.fontIndexes : fontIndexes
|
||||||
fontScalingIndex = settings.fontScalingIndex !== undefined ? settings.fontScalingIndex : fontScalingIndex
|
fontScaling = settings.fontScaling !== undefined ? settings.fontScaling : fontScaling
|
||||||
|
|
||||||
_frameReflections = settings.frameReflections !== undefined ? settings.frameReflections : _frameReflections;
|
_frameReflections = settings.frameReflections !== undefined ? settings.frameReflections : _frameReflections;
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadProfileString(profileString){
|
function loadProfileString(profileString){
|
||||||
@ -269,6 +282,7 @@ Item{
|
|||||||
windowOpacity = settings.windowOpacity !== undefined ? settings.windowOpacity : windowOpacity;
|
windowOpacity = settings.windowOpacity !== undefined ? settings.windowOpacity : windowOpacity;
|
||||||
|
|
||||||
fontIndexes[rasterization] = settings.fontIndex !== undefined ? settings.fontIndex : fontIndexes[rasterization];
|
fontIndexes[rasterization] = settings.fontIndex !== undefined ? settings.fontIndex : fontIndexes[rasterization];
|
||||||
|
fontWidth = settings.fontWidth !== undefined ? settings.fontWidth : fontWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
function storeCustomProfiles(){
|
function storeCustomProfiles(){
|
||||||
@ -320,47 +334,47 @@ Item{
|
|||||||
id: profileslist
|
id: profileslist
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Default Amber"
|
text: "Default Amber"
|
||||||
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.65,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.4,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0}'
|
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.65,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.4,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
|
||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Default Green"
|
text: "Default Green"
|
||||||
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.45,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0}'
|
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.45,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
|
||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Default Scanlines"
|
text: "Default Scanlines"
|
||||||
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#00ff5b","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.07,"jitter":0.11,"motion_blur":0.4,"noise_strength":0.05,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0}'
|
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#00ff5b","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.07,"jitter":0.11,"motion_blur":0.4,"noise_strength":0.05,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
|
||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Default Pixelated"
|
text: "Default Pixelated"
|
||||||
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.1,"jitter":0,"motion_blur":0.45,"noise_strength":0.14,"rasterization":2,"screen_distortion":0.05,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0}'
|
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.1,"jitter":0,"motion_blur":0.45,"noise_strength":0.14,"rasterization":2,"screen_distortion":0.05,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
|
||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Apple ]["
|
text: "Apple ]["
|
||||||
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.5,"brightness":0.5,"brightness_flickering":0.2,"contrast":0.85,"fontIndex":2,"font_color":"#2fff91","frames_index":1,"glowing_line_strength":0.22,"horizontal_sincronization":0.08,"jitter":0.1,"motion_blur":0.65,"noise_strength":0.08,"rasterization":1,"screen_distortion":0.18,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0}'
|
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.5,"brightness":0.5,"brightness_flickering":0.2,"contrast":0.85,"fontIndex":2,"font_color":"#2fff91","frames_index":1,"glowing_line_strength":0.22,"horizontal_sincronization":0.08,"jitter":0.1,"motion_blur":0.65,"noise_strength":0.08,"rasterization":1,"screen_distortion":0.18,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
|
||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Vintage"
|
text: "Vintage"
|
||||||
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.54,"contrast":0.85,"fontIndex":0,"font_color":"#00ff3e","frames_index":2,"glowing_line_strength":0.3,"horizontal_sincronization":0.2,"jitter":0.4,"motion_blur":0.75,"noise_strength":0.2,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0}'
|
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.54,"contrast":0.85,"fontIndex":0,"font_color":"#00ff3e","frames_index":2,"glowing_line_strength":0.3,"horizontal_sincronization":0.2,"jitter":0.4,"motion_blur":0.75,"noise_strength":0.2,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
|
||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "IBM Dos"
|
text: "IBM Dos"
|
||||||
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.07,"contrast":0.85,"fontIndex":7,"font_color":"#ffffff","frames_index":1,"glowing_line_strength":0.13,"horizontal_sincronization":0,"jitter":0.08,"motion_blur":0.3,"noise_strength":0.03,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":1,"saturation_color":0,"rgb_shift":0.5}'
|
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.07,"contrast":0.85,"fontIndex":7,"font_color":"#ffffff","frames_index":1,"glowing_line_strength":0.13,"horizontal_sincronization":0,"jitter":0.08,"motion_blur":0.3,"noise_strength":0.03,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":1,"saturation_color":0,"rgb_shift":0.5,"fontWidth":1.0}'
|
||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "IBM 3278"
|
text: "IBM 3278"
|
||||||
obj_string: '{"ambient_light":0.1,"background_color":"#000000","bloom_strength":0.15,"brightness":0.5,"brightness_flickering":0,"contrast":0.95,"fontIndex":8,"font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0,"horizontal_sincronization":0,"jitter":0,"motion_blur":0.6,"noise_strength":0,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0}'
|
obj_string: '{"ambient_light":0.1,"background_color":"#000000","bloom_strength":0.15,"brightness":0.5,"brightness_flickering":0,"contrast":0.95,"fontIndex":8,"font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0,"horizontal_sincronization":0,"jitter":0,"motion_blur":0.6,"noise_strength":0,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
|
||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
text: "Transparent Green"
|
text: "Transparent Green"
|
||||||
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4549689440993788,"brightness":0.5,"brightness_flickering":0.20341614906832298,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":0,"glowing_line_strength":0.15993788819875776,"horizontal_sincronization":0.05045871559633028,"jitter":0.20341614906832298,"motion_blur":0.24999999999999997,"noise_strength":0.20031055900621117,"rasterization":0,"screen_distortion":0.05045871559633028,"windowOpacity":0.5956221198156681,"chroma_color":0,"saturation_color":0,"rgb_shift":0}'
|
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4549689440993788,"brightness":0.5,"brightness_flickering":0.20341614906832298,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":0,"glowing_line_strength":0.15993788819875776,"horizontal_sincronization":0.05045871559633028,"jitter":0.20341614906832298,"motion_blur":0.24999999999999997,"noise_strength":0.20031055900621117,"rasterization":0,"screen_distortion":0.05045871559633028,"windowOpacity":0.5956221198156681,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
|
||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,13 +32,6 @@ Item{
|
|||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: fontlist
|
id: fontlist
|
||||||
ListElement{
|
|
||||||
text: "Commodore PET 2Y (1977)"
|
|
||||||
source: "fonts/1977-commodore-pet/COMMODORE_PET_2y.ttf"
|
|
||||||
lineSpacing: 2
|
|
||||||
pixelSize: 16
|
|
||||||
baseScaling: 3.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"
|
||||||
|
@ -32,13 +32,6 @@ Item{
|
|||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id: fontlist
|
id: fontlist
|
||||||
ListElement{
|
|
||||||
text: "Commodore PET 2Y (1977)"
|
|
||||||
source: "fonts/1977-commodore-pet/COMMODORE_PET_2y.ttf"
|
|
||||||
lineSpacing: 2
|
|
||||||
pixelSize: 16
|
|
||||||
baseScaling: 3.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"
|
||||||
|
@ -77,6 +77,23 @@ Item{
|
|||||||
kterminal.copyClipboard();
|
kterminal.copyClipboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//When settings are updated sources need to be redrawn.
|
||||||
|
Connections{
|
||||||
|
target: shadersettings
|
||||||
|
onFontScalingChanged: terminalContainer.updateSources();
|
||||||
|
onFontWidthChanged: terminalContainer.updateSources();
|
||||||
|
}
|
||||||
|
Connections{
|
||||||
|
target: terminalContainer
|
||||||
|
onWidthChanged: terminalContainer.updateSources();
|
||||||
|
onHeightChanged: terminalContainer.updateSources();
|
||||||
|
}
|
||||||
|
function updateSources() {
|
||||||
|
kterminal.update();
|
||||||
|
kterminal.updateImage();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
KTerminal {
|
KTerminal {
|
||||||
id: kterminal
|
id: kterminal
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@ -84,6 +101,8 @@ Item{
|
|||||||
|
|
||||||
colorScheme: "cool-retro-term"
|
colorScheme: "cool-retro-term"
|
||||||
|
|
||||||
|
smooth: false
|
||||||
|
|
||||||
session: KSession {
|
session: KSession {
|
||||||
id: ksession
|
id: ksession
|
||||||
kbScheme: "xterm"
|
kbScheme: "xterm"
|
||||||
@ -93,9 +112,6 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onWidthChanged: update();
|
|
||||||
onHeightChanged: update();
|
|
||||||
|
|
||||||
FontLoader{ id: fontLoader }
|
FontLoader{ id: fontLoader }
|
||||||
Text{id: fontMetrics; text: "B"; visible: false}
|
Text{id: fontMetrics; text: "B"; visible: false}
|
||||||
|
|
||||||
@ -104,9 +120,17 @@ Item{
|
|||||||
font.pixelSize = pixelSize;
|
font.pixelSize = pixelSize;
|
||||||
font.family = fontLoader.name;
|
font.family = fontLoader.name;
|
||||||
|
|
||||||
width = Qt.binding(function() {return Math.floor(terminalContainer.width / screenScaling);});
|
var fontWidth = 1.0 / shadersettings.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);
|
||||||
|
|
||||||
|
kterminalSource.textureSize = Qt.binding(function () {
|
||||||
|
return Qt.size(kterminal.width * scaleTexture, kterminal.height * scaleTexture);
|
||||||
|
});
|
||||||
|
|
||||||
setLineSpacing(lineSpacing);
|
setLineSpacing(lineSpacing);
|
||||||
update();
|
update();
|
||||||
restartBlurredSource();
|
restartBlurredSource();
|
||||||
@ -174,7 +198,6 @@ Item{
|
|||||||
id: kterminalSource
|
id: kterminalSource
|
||||||
sourceItem: kterminal
|
sourceItem: kterminal
|
||||||
hideSource: true
|
hideSource: true
|
||||||
smooth: mScanlines == shadersettings.no_rasterization
|
|
||||||
wrapMode: ShaderEffectSource.ClampToEdge
|
wrapMode: ShaderEffectSource.ClampToEdge
|
||||||
live: false
|
live: false
|
||||||
|
|
||||||
@ -190,6 +213,7 @@ Item{
|
|||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
id: blurredSourceLoader
|
id: blurredSourceLoader
|
||||||
|
asynchronous: true
|
||||||
active: mBlur !== 0
|
active: mBlur !== 0
|
||||||
|
|
||||||
sourceComponent: ShaderEffectSource{
|
sourceComponent: ShaderEffectSource{
|
||||||
@ -200,8 +224,6 @@ Item{
|
|||||||
hideSource: true
|
hideSource: true
|
||||||
wrapMode: kterminalSource.wrapMode
|
wrapMode: kterminalSource.wrapMode
|
||||||
|
|
||||||
smooth: mScanlines == shadersettings.no_rasterization
|
|
||||||
|
|
||||||
function restartBlurSource(){
|
function restartBlurSource(){
|
||||||
livetimer.restart();
|
livetimer.restart();
|
||||||
}
|
}
|
||||||
@ -228,13 +250,19 @@ Item{
|
|||||||
livetimer.restart();
|
livetimer.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Connections{
|
||||||
|
target: shadersettings
|
||||||
|
onScanline_qualityChanged: restartBlurredSource();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
id: blurredTerminalLoader
|
id: blurredTerminalLoader
|
||||||
anchors.fill: kterminal
|
width: kterminalSource.textureSize.width
|
||||||
|
height: kterminalSource.textureSize.height
|
||||||
active: mBlur !== 0
|
active: mBlur !== 0
|
||||||
|
asynchronous: true
|
||||||
|
|
||||||
sourceComponent: ShaderEffect {
|
sourceComponent: ShaderEffect {
|
||||||
property variant txt_source: kterminalSource
|
property variant txt_source: kterminalSource
|
||||||
@ -277,23 +305,32 @@ Item{
|
|||||||
// BLOOM ////////////////////////////////////////////////////////////////
|
// BLOOM ////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
|
property real scaling: shadersettings.bloom_quality
|
||||||
id: bloomEffectLoader
|
id: bloomEffectLoader
|
||||||
active: mBloom != 0
|
active: mBloom != 0
|
||||||
anchors.fill: parent
|
asynchronous: true
|
||||||
|
width: parent.width * scaling
|
||||||
|
height: parent.height * scaling
|
||||||
sourceComponent: FastBlur{
|
sourceComponent: FastBlur{
|
||||||
radius: 48
|
radius: 48 * scaling
|
||||||
source: kterminal
|
source: kterminal
|
||||||
transparentBorder: true
|
transparentBorder: true
|
||||||
smooth: false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loader{
|
Loader{
|
||||||
id: bloomSourceLoader
|
id: bloomSourceLoader
|
||||||
active: mBloom != 0
|
active: mBloom != 0
|
||||||
|
asynchronous: true
|
||||||
sourceComponent: ShaderEffectSource{
|
sourceComponent: ShaderEffectSource{
|
||||||
|
id: _bloomEffectSource
|
||||||
sourceItem: bloomEffectLoader.item
|
sourceItem: bloomEffectLoader.item
|
||||||
hideSource: true
|
hideSource: true
|
||||||
smooth: false
|
live: false
|
||||||
|
smooth: true
|
||||||
|
Connections{
|
||||||
|
target: kterminalSource
|
||||||
|
onSourceUpdate: _bloomEffectSource.scheduleUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,49 +92,17 @@ Tab{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
GroupBox{
|
GroupBox{
|
||||||
title: qsTr("Performace")
|
title: qsTr("Frame")
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.columnSpan: 2
|
RowLayout{
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
GridLayout{
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
rows: 3
|
ComboBox{
|
||||||
columns: 3
|
id: framescombobox
|
||||||
CheckBox{
|
|
||||||
Layout.columnSpan: 3
|
|
||||||
checked: !shadersettings._frameReflections
|
|
||||||
text: qsTr("Disable reflections")
|
|
||||||
onCheckedChanged: shadersettings._frameReflections = !checked
|
|
||||||
enabled: shadersettings.reflectionsAllowed
|
|
||||||
}
|
|
||||||
CheckBox{
|
|
||||||
property int fps: checked ? slider.value : 0
|
|
||||||
onFpsChanged: shadersettings.fps = fps
|
|
||||||
checked: shadersettings.fps !== 0
|
|
||||||
text: qsTr("Limit FPS")
|
|
||||||
}
|
|
||||||
Slider{
|
|
||||||
id: slider
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
stepSize: 1
|
model: shadersettings.frames_list
|
||||||
maximumValue: 60
|
currentIndex: shadersettings.frames_index
|
||||||
minimumValue: 1
|
onCurrentIndexChanged: shadersettings.frames_index = currentIndex
|
||||||
enabled: shadersettings.fps !== 0
|
|
||||||
value: shadersettings.fps !== 0 ? shadersettings.fps : 60
|
|
||||||
}
|
}
|
||||||
Text{text: slider.value}
|
|
||||||
Text{text: qsTr("Texture quality")}
|
|
||||||
Slider{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
id: txtslider
|
|
||||||
onValueChanged: shadersettings.window_scaling = value;
|
|
||||||
value: shadersettings.window_scaling
|
|
||||||
tickmarksEnabled: true
|
|
||||||
stepSize: 0.25
|
|
||||||
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
|
|
||||||
}
|
|
||||||
Text{text: Math.round(txtslider.value * 100) + "%"}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
160
app/qml/SettingsPerformanceTab.qml
Normal file
160
app/qml/SettingsPerformanceTab.qml
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2013 "Filippo Scognamiglio"
|
||||||
|
* https://github.com/Swordfish90/cool-retro-term
|
||||||
|
*
|
||||||
|
* This file is part of cool-retro-term.
|
||||||
|
*
|
||||||
|
* cool-retro-term is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Controls 1.1
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
|
Tab{
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.fill: parent
|
||||||
|
GroupBox{
|
||||||
|
title: qsTr("General")
|
||||||
|
Layout.fillWidth: true
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
GridLayout{
|
||||||
|
anchors.fill: parent
|
||||||
|
rows: 2
|
||||||
|
columns: 3
|
||||||
|
CheckBox{
|
||||||
|
property int fps: checked ? slider.value : 0
|
||||||
|
onFpsChanged: shadersettings.fps = fps
|
||||||
|
checked: shadersettings.fps !== 0
|
||||||
|
text: qsTr("Limit FPS")
|
||||||
|
}
|
||||||
|
Slider{
|
||||||
|
id: slider
|
||||||
|
Layout.fillWidth: true
|
||||||
|
stepSize: 1
|
||||||
|
maximumValue: 60
|
||||||
|
minimumValue: 1
|
||||||
|
enabled: shadersettings.fps !== 0
|
||||||
|
value: shadersettings.fps !== 0 ? shadersettings.fps : 60
|
||||||
|
}
|
||||||
|
Text{text: slider.value}
|
||||||
|
Text{text: qsTr("Texture Quality")}
|
||||||
|
Slider{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: txtslider
|
||||||
|
onValueChanged: shadersettings.window_scaling = value;
|
||||||
|
value: shadersettings.window_scaling
|
||||||
|
tickmarksEnabled: true
|
||||||
|
stepSize: 0.25
|
||||||
|
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
|
||||||
|
}
|
||||||
|
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{
|
||||||
|
title: qsTr("Bloom")
|
||||||
|
Layout.fillWidth: true
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
GridLayout{
|
||||||
|
id: bloomQualityContainer
|
||||||
|
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")}
|
||||||
|
Slider{
|
||||||
|
id: bloomQualitySlider
|
||||||
|
Layout.fillWidth: true
|
||||||
|
onValueChanged: parent.valsIndex = value;
|
||||||
|
stepSize: 1
|
||||||
|
Component.onCompleted: {
|
||||||
|
minimumValue = 0;
|
||||||
|
maximumValue = 2;
|
||||||
|
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];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupBox{
|
||||||
|
title: qsTr("Frame")
|
||||||
|
Layout.fillWidth: true
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
CheckBox{
|
||||||
|
checked: shadersettings._frameReflections
|
||||||
|
text: qsTr("Frame Reflections")
|
||||||
|
onCheckedChanged: shadersettings._frameReflections = checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -35,11 +35,8 @@ Tab{
|
|||||||
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
|
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
|
||||||
currentIndex: shadersettings.rasterization
|
currentIndex: shadersettings.rasterization
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
scalingChanger.enabled = false;
|
|
||||||
shadersettings.rasterization = currentIndex
|
shadersettings.rasterization = currentIndex
|
||||||
fontChanger.updateIndex();
|
fontChanger.updateIndex();
|
||||||
scalingChanger.updateIndex();
|
|
||||||
scalingChanger.enabled = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -67,24 +64,39 @@ Tab{
|
|||||||
RowLayout{
|
RowLayout{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Slider{
|
Slider{
|
||||||
id: scalingChanger
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
minimumValue: 0
|
id: fontScalingChanger
|
||||||
maximumValue: shadersettings.fontScalingList.length - 1
|
onValueChanged: if(enabled) shadersettings.fontScaling = value
|
||||||
stepSize: 1
|
stepSize: 0.05
|
||||||
tickmarksEnabled: true
|
enabled: false // Another trick to fix initial bad behavior.
|
||||||
value: updateIndex()
|
Component.onCompleted: {
|
||||||
onValueChanged: {
|
minimumValue = 0.5;
|
||||||
if(!enabled) return; //Ugly and hacky solution. Look for a better solution.
|
maximumValue = 2.5;
|
||||||
shadersettings.setScalingIndex(value);
|
value = shadersettings.fontScaling;
|
||||||
|
enabled = true;
|
||||||
}
|
}
|
||||||
function updateIndex(){
|
Connections{
|
||||||
value = shadersettings.getScalingIndex();
|
target: shadersettings
|
||||||
|
onFontScalingChanged: fontScalingChanger.value = shadersettings.fontScaling;
|
||||||
}
|
}
|
||||||
Component.onCompleted: shadersettings.fontScalingChanged.connect(updateIndex);
|
|
||||||
}
|
}
|
||||||
Text{
|
Text{
|
||||||
text: shadersettings.fontScalingList[scalingChanger.value].toFixed(2)
|
text: Math.round(fontScalingChanger.value * 100) + "%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Text{ text: qsTr("Font Width") }
|
||||||
|
RowLayout{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Slider{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: widthChanger
|
||||||
|
onValueChanged: shadersettings.fontWidth = value;
|
||||||
|
value: shadersettings.fontWidth
|
||||||
|
stepSize: 0.05
|
||||||
|
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
|
||||||
|
}
|
||||||
|
Text{
|
||||||
|
text: Math.round(widthChanger.value * 100) + "%"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,19 +139,5 @@ Tab{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GroupBox{
|
|
||||||
title: qsTr("Frame")
|
|
||||||
Layout.fillWidth: true
|
|
||||||
RowLayout{
|
|
||||||
anchors.fill: parent
|
|
||||||
ComboBox{
|
|
||||||
id: framescombobox
|
|
||||||
Layout.fillWidth: true
|
|
||||||
model: shadersettings.frames_list
|
|
||||||
currentIndex: shadersettings.frames_index
|
|
||||||
onCurrentIndexChanged: shadersettings.frames_index = currentIndex
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,27 +28,37 @@ Window {
|
|||||||
id: settings_window
|
id: settings_window
|
||||||
title: qsTr("Settings")
|
title: qsTr("Settings")
|
||||||
width: 640
|
width: 640
|
||||||
height: 450
|
height: 440
|
||||||
|
|
||||||
property int tabmargins: 15
|
property int tabmargins: 15
|
||||||
|
|
||||||
TabView{
|
TabView{
|
||||||
|
id: tabView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
SettingsGeneralTab{
|
SettingsGeneralTab{
|
||||||
|
id: generalTab
|
||||||
title: qsTr("General")
|
title: qsTr("General")
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: tabmargins
|
anchors.margins: tabmargins
|
||||||
}
|
}
|
||||||
SettingsTerminalTab{
|
SettingsTerminalTab{
|
||||||
|
id: terminalTab
|
||||||
title: qsTr("Terminal")
|
title: qsTr("Terminal")
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: tabmargins
|
anchors.margins: tabmargins
|
||||||
}
|
}
|
||||||
SettingsEffectsTab{
|
SettingsEffectsTab{
|
||||||
|
id: effectsTab
|
||||||
title: qsTr("Effects")
|
title: qsTr("Effects")
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: tabmargins
|
anchors.margins: tabmargins
|
||||||
}
|
}
|
||||||
|
SettingsPerformanceTab{
|
||||||
|
id: performanceTab
|
||||||
|
title: qsTr("Performance")
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: tabmargins
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,20 +85,13 @@ ApplicationWindow{
|
|||||||
id: zoomIn
|
id: zoomIn
|
||||||
text: qsTr("Zoom In")
|
text: qsTr("Zoom In")
|
||||||
shortcut: "Ctrl++"
|
shortcut: "Ctrl++"
|
||||||
onTriggered: {
|
onTriggered: shadersettings.incrementScaling();
|
||||||
var oldScaling = shadersettings.fontScalingIndex;
|
|
||||||
var maxScalingIndex = shadersettings.fontScalingList.length - 1;
|
|
||||||
shadersettings.setScalingIndex(Math.min(oldScaling + 1, maxScalingIndex));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Action{
|
Action{
|
||||||
id: zoomOut
|
id: zoomOut
|
||||||
text: qsTr("Zoom Out")
|
text: qsTr("Zoom Out")
|
||||||
shortcut: "Ctrl+-"
|
shortcut: "Ctrl+-"
|
||||||
onTriggered: {
|
onTriggered: shadersettings.decrementScaling();
|
||||||
var oldScaling = shadersettings.fontScalingIndex;
|
|
||||||
shadersettings.setScalingIndex(Math.max(oldScaling - 1, 0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Action{
|
Action{
|
||||||
id: showAboutAction
|
id: showAboutAction
|
||||||
|
@ -64,5 +64,6 @@
|
|||||||
<file>fonts/1985-ibm-pc-vga/dos437.txt</file>
|
<file>fonts/1985-ibm-pc-vga/dos437.txt</file>
|
||||||
<file>Storage.qml</file>
|
<file>Storage.qml</file>
|
||||||
<file>CRTMainMenuBar.qml</file>
|
<file>CRTMainMenuBar.qml</file>
|
||||||
|
<file>SettingsPerformanceTab.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user