Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow viewing all faces/frames in vtf #45

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions cmake_scripts/Qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ 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()

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

10 changes: 6 additions & 4 deletions src/gui/viewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down