Compare commits
18 Commits
382b13b5b9
...
nmariusp/w
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52527b8b55 | ||
| e3c2e024bb | |||
|
|
b69610d7f3 | ||
| 92a768d6f1 | |||
|
|
5ecd7d754d | ||
|
|
e3161f64f6 | ||
|
|
5b0b091ab6 | ||
|
|
4fdf28fb79 | ||
| 49213a1cf0 | |||
| e30db231f6 | |||
| 6609c4867f | |||
|
|
84c5e8bca6 | ||
| 1a25749315 | |||
|
|
3852f5995d | ||
| 9093b7a16e | |||
| afead1c2c0 | |||
| 1b2572f381 | |||
|
|
27ca6b3f73 |
18
app/app.pro
18
app/app.pro
@@ -16,23 +16,29 @@ macx:ICON = icons/crt.icns
|
|||||||
RESOURCES += qml/resources.qrc
|
RESOURCES += qml/resources.qrc
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
## INTALLS
|
## INSTALLS
|
||||||
#########################################
|
#########################################
|
||||||
|
|
||||||
target.path += /usr/bin/
|
PREFIX = $$(PREFIX) # Pass the make install PREFIX via environment variable. E.g. "PREFIX=/path/to/my/dir qmake".
|
||||||
|
isEmpty(PREFIX) {
|
||||||
|
message(No prefix given. Using /usr.)
|
||||||
|
PREFIX=/usr
|
||||||
|
}
|
||||||
|
|
||||||
|
target.path = $$PREFIX/bin
|
||||||
|
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
|
|
||||||
# Install icons
|
# Install icons
|
||||||
unix {
|
unix {
|
||||||
icon32.files = icons/32x32/cool-retro-term.png
|
icon32.files = icons/32x32/cool-retro-term.png
|
||||||
icon32.path = /usr/share/icons/hicolor/32x32/apps
|
icon32.path = $$PREFIX/share/icons/hicolor/32x32/apps
|
||||||
icon64.files = icons/64x64/cool-retro-term.png
|
icon64.files = icons/64x64/cool-retro-term.png
|
||||||
icon64.path = /usr/share/icons/hicolor/64x64/apps
|
icon64.path = $$PREFIX/share/icons/hicolor/64x64/apps
|
||||||
icon128.files = icons/128x128/cool-retro-term.png
|
icon128.files = icons/128x128/cool-retro-term.png
|
||||||
icon128.path = /usr/share/icons/hicolor/128x128/apps
|
icon128.path = $$PREFIX/share/icons/hicolor/128x128/apps
|
||||||
icon256.files = icons/256x256/cool-retro-term.png
|
icon256.files = icons/256x256/cool-retro-term.png
|
||||||
icon256.path = /usr/share/icons/hicolor/256x256/apps
|
icon256.path = $$PREFIX/share/icons/hicolor/256x256/apps
|
||||||
|
|
||||||
INSTALLS += icon32 icon64 icon128 icon256
|
INSTALLS += icon32 icon64 icon128 icon256
|
||||||
}
|
}
|
||||||
|
|||||||
20
app/main.cpp
20
app/main.cpp
@@ -49,15 +49,15 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) {
|
if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) {
|
||||||
QTextStream cout(stdout, QIODevice::WriteOnly);
|
QTextStream cout(stdout, QIODevice::WriteOnly);
|
||||||
cout << "Usage: " << argv[0] << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << endl;
|
cout << "Usage: " << argv[0] << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << '\n';
|
||||||
cout << " --default-settings Run cool-retro-term with the default settings" << endl;
|
cout << " --default-settings Run cool-retro-term with the default settings" << '\n';
|
||||||
cout << " --workdir <dir> Change working directory to 'dir'" << endl;
|
cout << " --workdir <dir> Change working directory to 'dir'" << '\n';
|
||||||
cout << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option." << endl;
|
cout << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option." << '\n';
|
||||||
cout << " -T <title> Set window title to 'title'." << endl;
|
cout << " -T <title> Set window title to 'title'." << '\n';
|
||||||
cout << " --fullscreen Run cool-retro-term in fullscreen." << endl;
|
cout << " --fullscreen Run cool-retro-term in fullscreen." << '\n';
|
||||||
cout << " -p|--profile <prof> Run cool-retro-term with the given profile." << endl;
|
cout << " -p|--profile <prof> Run cool-retro-term with the given profile." << '\n';
|
||||||
cout << " -h|--help Print this help." << endl;
|
cout << " -h|--help Print this help." << '\n';
|
||||||
cout << " --verbose Print additional information such as profiles and settings." << endl;
|
cout << " --verbose Print additional information such as profiles and settings." << '\n';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
|
if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
|
||||||
QTextStream cout(stdout, QIODevice::WriteOnly);
|
QTextStream cout(stdout, QIODevice::WriteOnly);
|
||||||
cout << "cool-retro-term " << appVersion << endl;
|
cout << "cool-retro-term " << appVersion << '\n';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ QtObject {
|
|||||||
readonly property real maximumFontScaling: 2.50
|
readonly property real maximumFontScaling: 2.50
|
||||||
|
|
||||||
readonly property real minBurnInFadeTime: 160
|
readonly property real minBurnInFadeTime: 160
|
||||||
readonly property real maxBurnInFadeTime: 1600
|
readonly property real maxBurnInFadeTime: 160000
|
||||||
|
|
||||||
property bool isMacOS: Qt.platform.os === "osx"
|
property bool isMacOS: Qt.platform.os === "osx"
|
||||||
|
|
||||||
@@ -632,7 +632,7 @@ QtObject {
|
|||||||
builtin: true
|
builtin: true
|
||||||
}
|
}
|
||||||
ListElement {
|
ListElement {
|
||||||
text: "IBM Dos"
|
text: "IBM DOS"
|
||||||
obj_string: '{
|
obj_string: '{
|
||||||
"ambientLight": 0.151,
|
"ambientLight": 0.151,
|
||||||
"backgroundColor": "#000000",
|
"backgroundColor": "#000000",
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ Loader {
|
|||||||
property real lastUpdate: 0
|
property real lastUpdate: 0
|
||||||
property real prevLastUpdate: 0
|
property real prevLastUpdate: 0
|
||||||
|
|
||||||
property real burnIn: appSettings.burnIn
|
property real burnIn: appSettings.burnIn;
|
||||||
property real burnInFadeTime: 1 / Utils.lint(_minBurnInFadeTime, _maxBurnInFadeTime, burnIn)
|
property real burnInFadeTime: (1 / Utils.lint(_minBurnInFadeTime, _maxBurnInFadeTime, burnIn))*64
|
||||||
property real _minBurnInFadeTime: appSettings.minBurnInFadeTime
|
property real _minBurnInFadeTime: appSettings.minBurnInFadeTime
|
||||||
property real _maxBurnInFadeTime: appSettings.maxBurnInFadeTime
|
property real _maxBurnInFadeTime: appSettings.maxBurnInFadeTime
|
||||||
|
|
||||||
@@ -146,9 +146,8 @@ Loader {
|
|||||||
float prevMask = accColor.a;
|
float prevMask = accColor.a;
|
||||||
float currMask = rgb2grey(txtColor);
|
float currMask = rgb2grey(txtColor);
|
||||||
|
|
||||||
highp float blurDecay = clamp((lastUpdate - prevLastUpdate) * burnInTime, 0.0, 1.0);
|
highp float blurDecay = clamp(pow(0.5, burnInTime * (lastUpdate - prevLastUpdate)), 0.0, 1.0);
|
||||||
blurDecay = max(0.0, blurDecay - prevMask);
|
vec3 blurColor = accColor.rgb * vec3(blurDecay);
|
||||||
vec3 blurColor = accColor.rgb - vec3(blurDecay);
|
|
||||||
vec3 color = max(blurColor, txtColor);
|
vec3 color = max(blurColor, txtColor);
|
||||||
|
|
||||||
gl_FragColor = vec4(color, currMask);
|
gl_FragColor = vec4(color, currMask);
|
||||||
|
|||||||
@@ -247,6 +247,17 @@ Item {
|
|||||||
" return outColor;
|
" return outColor;
|
||||||
}" +
|
}" +
|
||||||
|
|
||||||
|
//pseudo-random vector
|
||||||
|
//https://stackoverflow.com/a/10625698
|
||||||
|
"float random( vec2 p )
|
||||||
|
{
|
||||||
|
vec2 K1 = vec2(
|
||||||
|
23.14069263277926, // e^pi (Gelfond's constant)
|
||||||
|
2.665144142690225 // 2^sqrt(2) (Gelfond-Schneider constant)
|
||||||
|
);
|
||||||
|
return fract( cos( dot(p,K1) ) * 12345.6789 );
|
||||||
|
}" +
|
||||||
|
|
||||||
"void main() {" +
|
"void main() {" +
|
||||||
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
|
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
|
||||||
"float distance = length(cc);" +
|
"float distance = length(cc);" +
|
||||||
@@ -285,7 +296,11 @@ Item {
|
|||||||
: "") +
|
: "") +
|
||||||
|
|
||||||
(jitter !== 0 || staticNoise !== 0 ?
|
(jitter !== 0 || staticNoise !== 0 ?
|
||||||
"vec4 noiseTexel = texture2D(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 51.0), fract(time / 237.0)));"
|
"vec4 noiseTexel = texture2D(
|
||||||
|
noiseSource, scaleNoiseSize * coords
|
||||||
|
+ vec2(0.0, random(vec2(fract(time / 237.0), 822.9582)))
|
||||||
|
+ vec2(fract(time / 31.0), fract(time / 177.0))
|
||||||
|
);"
|
||||||
: "") +
|
: "") +
|
||||||
|
|
||||||
(jitter !== 0 ? "
|
(jitter !== 0 ? "
|
||||||
@@ -306,8 +321,8 @@ Item {
|
|||||||
|
|
||||||
(burnIn !== 0 ? "
|
(burnIn !== 0 ? "
|
||||||
vec4 txt_blur = texture2D(burnInSource, staticCoords);
|
vec4 txt_blur = texture2D(burnInSource, staticCoords);
|
||||||
float blurDecay = clamp((time - burnInLastUpdate) * burnInTime, 0.0, 1.0);
|
float blurDecay = clamp(pow(0.5, burnInTime * (time - burnInLastUpdate)), 0.0, 1.0);
|
||||||
vec3 burnInColor = 0.65 * (txt_blur.rgb - vec3(blurDecay));
|
vec3 burnInColor = txt_blur.rgb * vec3(blurDecay);
|
||||||
txt_color = max(txt_color, convertWithChroma(burnInColor));"
|
txt_color = max(txt_color, convertWithChroma(burnInColor));"
|
||||||
: "") +
|
: "") +
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ ShaderEffect {
|
|||||||
float alpha = 0.0;
|
float alpha = 0.0;
|
||||||
|
|
||||||
float frameShadow = max2(positiveLog(-coords * frameShadowCoeff + vec2(1.0)) + positiveLog(coords * frameShadowCoeff - (vec2(frameShadowCoeff) - vec2(1.0))));
|
float frameShadow = max2(positiveLog(-coords * frameShadowCoeff + vec2(1.0)) + positiveLog(coords * frameShadowCoeff - (vec2(frameShadowCoeff) - vec2(1.0))));
|
||||||
frameShadow = max(sqrt(frameShadow), 0.0);
|
frameShadow = clamp(sqrt(frameShadow), 0.0, 1.0);
|
||||||
color *= frameShadow;
|
color *= frameShadow;
|
||||||
alpha = sum2(1.0 - step(vec2(0.0), coords) + step(vec2(1.0), coords));
|
alpha = sum2(1.0 - step(vec2(0.0), coords) + step(vec2(1.0), coords));
|
||||||
alpha = clamp(alpha, 0.0, 1.0);
|
alpha = clamp(alpha, 0.0, 1.0);
|
||||||
|
|||||||
@@ -5,7 +5,17 @@ CONFIG += ordered
|
|||||||
SUBDIRS += qmltermwidget
|
SUBDIRS += qmltermwidget
|
||||||
SUBDIRS += app
|
SUBDIRS += app
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
## INSTALLS
|
||||||
|
#########################################
|
||||||
|
|
||||||
|
PREFIX = $$(PREFIX) # Pass the make install PREFIX via environment variable. E.g. "PREFIX=/path/to/my/dir qmake".
|
||||||
|
isEmpty(PREFIX) {
|
||||||
|
message(No prefix given. Using /usr.)
|
||||||
|
PREFIX=/usr
|
||||||
|
}
|
||||||
|
|
||||||
desktop.files += cool-retro-term.desktop
|
desktop.files += cool-retro-term.desktop
|
||||||
desktop.path += /usr/share/applications
|
desktop.path += $$PREFIX/share/applications
|
||||||
|
|
||||||
INSTALLS += desktop
|
INSTALLS += desktop
|
||||||
|
|||||||
Reference in New Issue
Block a user