diff --git a/src/nostalgia/CMakeLists.txt b/src/nostalgia/CMakeLists.txt index c314abd2..55c8dc7f 100644 --- a/src/nostalgia/CMakeLists.txt +++ b/src/nostalgia/CMakeLists.txt @@ -3,8 +3,8 @@ if(NOSTALGIA_BUILD_TYPE STREQUAL "Native") if(NOSTALGIA_BUILD_STUDIO) - find_package(Qt5Widgets REQUIRED) - find_package(Qt5QuickWidgets REQUIRED) + find_package(Qt6Widgets REQUIRED) + find_package(Qt6QuickWidgets REQUIRED) endif() endif() diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index 6f1f671b..14975ea7 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -56,7 +56,6 @@ ox::Error modelRead(T *io, GbaPaletteTarget *t) { template ox::Error modelRead(T *io, GbaTileMapTarget *t) { io->template setTypeInfo(); - uint8_t bpp; int dummy; oxReturnError(io->field("bpp", &bpp)); diff --git a/src/nostalgia/core/studio/CMakeLists.txt b/src/nostalgia/core/studio/CMakeLists.txt index e3e66aa5..c4800466 100644 --- a/src/nostalgia/core/studio/CMakeLists.txt +++ b/src/nostalgia/core/studio/CMakeLists.txt @@ -21,8 +21,8 @@ endif() target_link_libraries( NostalgiaCore-Studio - Qt5::Core - Qt5::QuickWidgets + Qt6::Core + Qt6::QuickWidgets NostalgiaStudio NostalgiaCore-Qt NostalgiaCore diff --git a/src/nostalgia/core/studio/tilesheeteditor.cpp b/src/nostalgia/core/studio/tilesheeteditor.cpp index c29bae5c..83718ccb 100644 --- a/src/nostalgia/core/studio/tilesheeteditor.cpp +++ b/src/nostalgia/core/studio/tilesheeteditor.cpp @@ -630,7 +630,7 @@ void SheetData::modGteCmd(int color, int mod) { for (int i = 0; i < m_pixels.size(); ++i) { const auto p = m_pixels[i]; if (p >= color) { - const auto mx = (m_palette.size() - p) - 1; + const int mx = (m_palette.size() - p) - 1; cmd->addPixel(i, std::clamp(mod, -p, mx)); } } @@ -666,15 +666,15 @@ std::unique_ptr SheetData::toNostalgiaGraphic() const { ng->pixels.resize(pixelCount / 2); for (std::size_t i = 0; i < pixelCount && i < static_cast(m_pixels.size()); ++i) { if (i & 1) { - ng->pixels[i / 2] |= static_cast(m_pixels[i]) << 4; + ng->pixels[i / 2] |= static_cast(m_pixels[static_cast(i)]) << 4; } else { - ng->pixels[i / 2] = static_cast(m_pixels[i]); + ng->pixels[i / 2] = static_cast(m_pixels[static_cast(i)]); } } } else { ng->pixels.resize(pixelCount); for (std::size_t i = 0; i < ng->pixels.size(); ++i) { - ng->pixels[i] = static_cast(m_pixels[i]); + ng->pixels[i] = static_cast(m_pixels[static_cast(i)]); } } return ng; diff --git a/src/nostalgia/studio/CMakeLists.txt b/src/nostalgia/studio/CMakeLists.txt index c50d5037..48b42387 100644 --- a/src/nostalgia/studio/CMakeLists.txt +++ b/src/nostalgia/studio/CMakeLists.txt @@ -53,7 +53,7 @@ add_executable( target_link_libraries( NostalgiaStudioJsonTest OxStd - Qt5::Widgets + Qt6::Widgets ) add_test("[nostalgia/studio] NostalgiaStudioJson" NostalgiaStudioJsonTest) diff --git a/src/nostalgia/studio/lib/CMakeLists.txt b/src/nostalgia/studio/lib/CMakeLists.txt index 112cb770..4d56074a 100644 --- a/src/nostalgia/studio/lib/CMakeLists.txt +++ b/src/nostalgia/studio/lib/CMakeLists.txt @@ -17,7 +17,7 @@ target_include_directories(NostalgiaStudio PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries( NostalgiaStudio PUBLIC - Qt5::Widgets + Qt6::Widgets OxFS OxClaw ) diff --git a/src/nostalgia/studio/main.cpp b/src/nostalgia/studio/main.cpp index 4c2907c3..5eb334ba 100644 --- a/src/nostalgia/studio/main.cpp +++ b/src/nostalgia/studio/main.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -17,18 +18,17 @@ using namespace nostalgia::studio; int main(int argc, char **args) { ox::trace::init(); + // get profile path from command args ox::ClArgs clargs(argc, const_cast(args)); QString argProfilePath = clargs.getString("profile", ":/profiles/nostalgia-studio.json").c_str(); - - QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, args); - // load theme if constexpr(ox::defines::OS != ox::defines::OS::Darwin) { qdark::load(&app); } - + // force QtQuick to use OpenGL (https://doc.qt.io/qt-6/quick-changes-qt6.html#changes-to-qquickwidget) + QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi); + // open window try { MainWindow w(argProfilePath); app.setApplicationName(w.windowTitle()); diff --git a/src/nostalgia/studio/mainwindow.cpp b/src/nostalgia/studio/mainwindow.cpp index 2e22cd0d..61d34684 100644 --- a/src/nostalgia/studio/mainwindow.cpp +++ b/src/nostalgia/studio/mainwindow.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include diff --git a/src/nostalgia/world/studio/CMakeLists.txt b/src/nostalgia/world/studio/CMakeLists.txt index 583f64b0..58053cea 100644 --- a/src/nostalgia/world/studio/CMakeLists.txt +++ b/src/nostalgia/world/studio/CMakeLists.txt @@ -9,8 +9,8 @@ add_library( target_link_libraries( NostalgiaWorld-Studio - Qt5::Core - Qt5::Widgets + Qt6::Core + Qt6::Widgets NostalgiaStudio )