From b3fd547888aac2b6e68961406ff4cf334aed7605 Mon Sep 17 00:00:00 2001 From: craftablescience Date: Sat, 25 May 2024 20:03:13 -0400 Subject: [PATCH 1/2] fix(gui): allow viewing the first frame and face when multiple are present --- cmake_scripts/Qt.cmake | 3 +-- src/gui/viewer.hpp | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmake_scripts/Qt.cmake b/cmake_scripts/Qt.cmake index 76e98f3..cf5e4e2 100644 --- a/cmake_scripts/Qt.cmake +++ b/cmake_scripts/Qt.cmake @@ -9,7 +9,7 @@ if(WIN32) # CMake has an odd policy that links a special link lib for Qt on newer versions of CMake. Enable it so we don't get spammed, and I get to write less cmake_policy(SET CMP0020 NEW) else() - message(FATAL_ERROR "--!@ Please define your QT install dir with -DQT_BASEDIR=C:/your/qt5/here") + message(FATAL_ERROR "--!@ Please define your QT install dir with -DQT_BASEDIR=C:/your/qt6/here") endif() message("Using ${QT_INCLUDE} as our Qt include dir") endif() @@ -17,4 +17,3 @@ endif() set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) - diff --git a/src/gui/viewer.hpp b/src/gui/viewer.hpp index 3584894..6144812 100644 --- a/src/gui/viewer.hpp +++ b/src/gui/viewer.hpp @@ -136,20 +136,22 @@ namespace vtfview void paintEvent(QPaintEvent* event) override; void set_frame(int f) { - frame_ = util::clamp(f, 1, file_ ? file_->GetFrameCount() : 1); + frame_ = file_ ? util::clamp(f, 1, file_->GetFrameCount()) : 1; + frame_--; repaint(); } void set_face(int f) { - face_ = util::clamp(f, 1, file_ ? file_->GetFaceCount() : 1); + face_ = file_ ? util::clamp(f, 1, file_->GetFaceCount()) : 1; + face_--; repaint(); } // Sets the current mip // This is in the range 1-mipcount, in vtflib it's 0-based index void set_mip(int f) { - mip_ = util::clamp(f, 1, file_ ? file_->GetMipmapCount() : 1); - mip_ -= 1; + mip_ = file_ ? util::clamp(f, 1, file_->GetMipmapCount()) : 1; + mip_--; repaint(); } From 0bd823d6930fe0b934aa3d647db57feef69d148b Mon Sep 17 00:00:00 2001 From: craftablescience Date: Sat, 25 May 2024 20:03:32 -0400 Subject: [PATCH 2/2] chore: change github link in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42474c6..a9c2c69 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ Options: The first step is to clone the repository. Make sure to do a recursive clone! ``` -git clone https://github.com/ChaosInitiative/vtex2.git --recursive +git clone https://github.com/StrataSource/vtex2.git --recursive ``` ### Linux