From 55e1ea4fe99432015c0e971dd7e02d4f4589b62a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 16 Nov 2018 09:45:18 +1100 Subject: [PATCH] fixed gles bugs --- effects/bulge.frag | 5 +++-- effects/fisheye.frag | 6 +++--- effects/toonify.frag | 2 +- mainwindow.cpp | 19 +++++++++++-------- mainwindow.h | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/effects/bulge.frag b/effects/bulge.frag index 316002bb6..3569eaa4d 100644 --- a/effects/bulge.frag +++ b/effects/bulge.frag @@ -1,6 +1,7 @@ #version 120 + uniform sampler2D tex0; -varying vec4 vTexCoord; +varying vec2 vTexCoord; const float PI = 3.1415926535; uniform vec2 resolution; @@ -19,7 +20,7 @@ vec2 distort(vec2 p, vec2 offset) { void main(void) { vec2 offset = vec2(xoff/resolution.x, yoff/resolution.y); - vec2 xy = 2.0 * vTexCoord.xy - 1.0 - offset; + vec2 xy = 2.0 * vTexCoord - 1.0 - offset; vec2 uv; float d = length(xy); uv = distort(xy, offset); diff --git a/effects/fisheye.frag b/effects/fisheye.frag index 9e8aa1e3b..18689ccc8 100644 --- a/effects/fisheye.frag +++ b/effects/fisheye.frag @@ -1,6 +1,6 @@ #version 120 uniform sampler2D tex0; -varying vec4 vTexCoord; +varying vec2 vTexCoord; #define M_PI 3.1415926535897932384626433832795 uniform float size; @@ -9,7 +9,7 @@ void main(void) { float maxFactor = 2.0 - (size * 0.01); vec2 uv; - vec2 xy = 2.0 * vTexCoord.xy - 1.0; + vec2 xy = 2.0 * vTexCoord - 1.0; float d = length(xy); if (d < (2.0-maxFactor)) { d = length(xy * maxFactor); @@ -20,7 +20,7 @@ void main(void) { uv.x = r * cos(phi) + 0.5; uv.y = r * sin(phi) + 0.5; } else { - uv = vTexCoord.xy; + uv = vTexCoord; } vec4 c = texture2D(tex0, uv); gl_FragColor = c; diff --git a/effects/toonify.frag b/effects/toonify.frag index 9a7061e32..e34103ca1 100644 --- a/effects/toonify.frag +++ b/effects/toonify.frag @@ -1,6 +1,6 @@ #version 150 uniform sampler2D tex0; -in vec4 vTexCoord; +in vec2 vTexCoord; out vec4 FragColor; uniform float colors; // 12.0 diff --git a/mainwindow.cpp b/mainwindow.cpp index 9a27225aa..e18a459f5 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -50,20 +50,23 @@ QString config_dir; QString appName = "Olive (November 2018 | Alpha)"; bool demoNoticeShown = false; -void MainWindow::setup_layout() { +void MainWindow::setup_layout(bool reset) { panel_project->show(); panel_effect_controls->show(); + panel_footage_viewer->show(); panel_sequence_viewer->show(); panel_timeline->show(); bool load_default = true; - QFile panel_config(get_data_path() + "/layout"); - if (panel_config.exists() && panel_config.open(QFile::ReadOnly)) { - if (restoreState(panel_config.readAll(), 0)) { - load_default = false; + if (!reset) { + QFile panel_config(get_data_path() + "/layout"); + if (panel_config.exists() && panel_config.open(QFile::ReadOnly)) { + if (restoreState(panel_config.readAll(), 0)) { + load_default = false; + } + panel_config.close(); } - panel_config.close(); } if (load_default) { @@ -131,7 +134,7 @@ MainWindow::MainWindow(QWidget *parent) : panel_effect_controls = new EffectControls(this); panel_timeline = new Timeline(this); - setup_layout(); + setup_layout(false); connect(ui->menuWindow, SIGNAL(aboutToShow()), this, SLOT(windowMenu_About_To_Be_Shown())); connect(ui->menu_View, SIGNAL(aboutToShow()), this, SLOT(viewMenu_About_To_Be_Shown())); @@ -515,7 +518,7 @@ void MainWindow::on_actionDeselect_All_triggered() void MainWindow::on_actionReset_to_default_layout_triggered() { - setup_layout(); + setup_layout(true); } void MainWindow::on_actionGo_to_start_triggered() diff --git a/mainwindow.h b/mainwindow.h index 9f304c530..2f0bed97f 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -206,7 +206,7 @@ private slots: private: Ui::MainWindow *ui; - void setup_layout(); + void setup_layout(bool reset); bool save_project_as(); bool save_project(); bool can_close_project();