diff --git a/CMakeLists.txt b/CMakeLists.txt index 16b49cf08..7de79a43d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1014,4 +1014,4 @@ if (ENABLE_QT_GUI AND CMAKE_SYSTEM_NAME STREQUAL "Linux") install(FILES "dist/net.shadps4.shadPS4.metainfo.xml" DESTINATION "share/metainfo") install(FILES ".github/shadps4.png" DESTINATION "share/icons/hicolor/512x512/apps" RENAME "net.shadps4.shadPS4.png") install(FILES "src/images/net.shadps4.shadPS4.svg" DESTINATION "share/icons/hicolor/scalable/apps") -endif() +endif() \ No newline at end of file diff --git a/REUSE.toml b/REUSE.toml index 5bd21bead..747679c8b 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -12,12 +12,13 @@ path = [ "dist/net.shadps4.shadPS4_metadata.pot", "dist/net.shadps4.shadPS4.metainfo.xml", "dist/net.shadps4.shadPS4.releases.xml", - "documents/changelog.txt", + "documents/changelog.md", "documents/Quickstart/2.png", "documents/Screenshots/*", "scripts/ps4_names.txt", "src/images/about_icon.png", "src/images/controller_icon.png", + "src/images/discord.png", "src/images/dump_icon.png", "src/images/exit_icon.png", "src/images/file_icon.png", @@ -28,8 +29,10 @@ path = [ "src/images/flag_us.png", "src/images/flag_world.png", "src/images/folder_icon.png", + "src/images/github.png", "src/images/grid_icon.png", "src/images/iconsize_icon.png", + "src/images/ko-fi.png", "src/images/list_icon.png", "src/images/list_mode_icon.png", "src/images/pause_icon.png", @@ -43,6 +46,8 @@ path = [ "src/images/net.shadps4.shadPS4.svg", "src/images/themes_icon.png", "src/images/update_icon.png", + "src/images/youtube.png", + "src/images/website.png", "src/shadps4.qrc", "src/shadps4.rc", ] diff --git a/documents/changelog.md b/documents/changelog.md new file mode 100644 index 000000000..766e1a09f --- /dev/null +++ b/documents/changelog.md @@ -0,0 +1,99 @@ +v0.4.0 31/10/2024 - codename divicius +================= + +- Shader recompiler fixes +- Emulated support for cpus that doesn't have SSE4.2a (intel cpus) +- Frame graph + Precise 60 fps timing +- Save data: fix nullptr & concurrent file write +- Auto Update +- Error dialog implementation +- Swapchain recreation and window resizing +- Add playback of background/title music in game list +- Kernel: Quiet sceKernelWaitEventFlag error log on timeout +- Improve keyboard navigation in game list +- core/memory: Pooled memory implementation +- Fix PKG loading +- replace trophy xml assert with error +- Refactor audio handling with range checks, buffer threshold, and lock +- audio_core: Fix return value types and shift some error handling to library +- Devtools: PM4 Explorer +- Initial support of Geometry shaders +- Working touchpad support +- net: Stub sceNetErrnoLoc +- Add support to click touchpad using back button on non PS4/5 controllers +- Multiple Install Folders +- Using a more standard data directory for linux +- video_core: Implement sceGnmInsertPushColorMarker +- ime_dialog: Initial implementation +- Network libs fixes +- Use GetSystemTimePreciseAsFileTime to fix fps timing issues +- Added adaptive mutex initializer +- Small Np + trophy fixes +- Separate Updates from Game Folder +- Minor Fixes for Separate Update Folder +- AvPlayer: Do not align w/h to 16 with vdec2 +- Improve sceSystemServiceReceiveEvent stub +- renderer_vulkan: Commize and adjust buffer bindings +- Add poll interval to libScePad +- Add more surface format mappings. +- vulkan: Report only missing format feature flags. +- IME implementation +- Videodec2 implementation +- path_util: Make sure macOS has current directory set and clean up path code. +- Load LLE modules from sys_modules/GAMEID folder + +v0.3.0 23/09/2024 - codename broamic +================= + +- Cheat/Patching support +- DLC support +- New translations support (26 languages) +- Support for unlocking trophies +- Support for more controllers (Dualshock and Xbox) +- Many GUI improvements +- AVplayer + +v0.2.0 15/08/2024 - codename validptr +================= +- Adding macOS support +- Big shader recompiler improvements +- Core improvements +- GUI improvements + +v0.1.0 01/07/2024 - codename madturtle +================= +- Added a shader recompiler, with this we have a lot of games that starts to work +- Rewrote a big part of core + +v0.0.3 23/03/2024 - codename salad +================= +- Switching to std::thread +- Use unique_ptr where possible +- Replace printf/scanf with type safe fmt +- Implemented sceKernelGetProcessTime +- Implemented sceKernelGetProcessTimeCounter, sceKernelGetProcessTimeCounterFrequency +- Pause emu with P button +- Timers rewrote with std::chrono +- Added sceSystemServiceGetStatus +- Initial FileSystem implementation +- Initial TLS work +- New logging implementation +- Some functions implemented for userService, systemService +- Added sceAudioOut module and output using SDL audio + +v0.0.2 21/10/2023 +================= +- Using cstdint header in variable types +- run_main_entry: Rewrite in asm for stack setup +- Printf libc implementation for work with sysv_abi +- Initial pad emulation (only digital pad atm) +- Implemented sceVideoOutIsFlipPending +- Added auto stubs, now unsupported hle function will resolve as empty stubs +- Rewrote libc_cxa functions +- Libc implementations ( _ZdlPv,_Znwm,rand,_Fsin,qsort,free,strncpy,memmove,atan2f,pow,_Sin) +- ET_SCE_DYNAMIC behaves as valid for execution now +- Initial FileSystem work (not yet usable) + +v0.0.1 29/09/2023 +================= +First public release. Everything is new. \ No newline at end of file diff --git a/documents/changelog.txt b/documents/changelog.txt deleted file mode 100644 index 6df09472d..000000000 --- a/documents/changelog.txt +++ /dev/null @@ -1,55 +0,0 @@ -v0.3.0 23/09/2024 - codename broamic -================= - -- Cheat/Patching support -- DLC support -- New translations support (26 languages) -- Support for unlocking trophies -- Support for more controllers (Dualshock and Xbox) -- Many GUI improvements -- AVplayer - -v0.2.0 15/08/2024 - codename validptr -================= -- Adding macOS support -- Big shader recompiler improvements -- Core improvements -- GUI improvements - -v0.1.0 01/07/2024 - codename madturtle -================= -- Added a shader recompiler, with this we have a lot of games that starts to work -- Rewrote a big part of core - -v0.0.3 23/03/2024 - codename salad -================= -- Switching to std::thread -- Use unique_ptr where possible -- Replace printf/scanf with type safe fmt -- Implemented sceKernelGetProcessTime -- Implemented sceKernelGetProcessTimeCounter, sceKernelGetProcessTimeCounterFrequency -- Pause emu with P button -- Timers rewrote with std::chrono -- Added sceSystemServiceGetStatus -- Initial FileSystem implementation -- Initial TLS work -- New logging implementation -- Some functions implemented for userService, systemService -- Added sceAudioOut module and output using SDL audio - -v0.0.2 21/10/2023 -================= -- Using cstdint header in variable types -- run_main_entry: Rewrite in asm for stack setup -- Printf libc implementation for work with sysv_abi -- Initial pad emulation (only digital pad atm) -- Implemented sceVideoOutIsFlipPending -- Added auto stubs, now unsupported hle function will resolve as empty stubs -- Rewrote libc_cxa functions -- Libc implementations ( _ZdlPv,_Znwm,rand,_Fsin,qsort,free,strncpy,memmove,atan2f,pow,_Sin) -- ET_SCE_DYNAMIC behaves as valid for execution now -- Initial FileSystem work (not yet usable) - -v0.0.1 29/09/2023 -================= -First public release. Everything is new. \ No newline at end of file diff --git a/src/images/discord.png b/src/images/discord.png new file mode 100644 index 000000000..2fa455fd1 Binary files /dev/null and b/src/images/discord.png differ diff --git a/src/images/github.png b/src/images/github.png new file mode 100644 index 000000000..22b101798 Binary files /dev/null and b/src/images/github.png differ diff --git a/src/images/ko-fi.png b/src/images/ko-fi.png new file mode 100644 index 000000000..d19991b5f Binary files /dev/null and b/src/images/ko-fi.png differ diff --git a/src/images/website.png b/src/images/website.png new file mode 100644 index 000000000..9584f6b82 Binary files /dev/null and b/src/images/website.png differ diff --git a/src/images/youtube.png b/src/images/youtube.png new file mode 100644 index 000000000..362ac5781 Binary files /dev/null and b/src/images/youtube.png differ diff --git a/src/qt_gui/about_dialog.cpp b/src/qt_gui/about_dialog.cpp index a932d65a0..90fb14236 100644 --- a/src/qt_gui/about_dialog.cpp +++ b/src/qt_gui/about_dialog.cpp @@ -1,13 +1,194 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include +#include +#include +#include +#include +#include +#include #include "about_dialog.h" +#include "main_window_themes.h" #include "ui_about_dialog.h" AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { ui->setupUi(this); + preloadImages(); + + ui->image_1->setAttribute(Qt::WA_Hover, true); + ui->image_2->setAttribute(Qt::WA_Hover, true); + ui->image_3->setAttribute(Qt::WA_Hover, true); + ui->image_4->setAttribute(Qt::WA_Hover, true); + ui->image_5->setAttribute(Qt::WA_Hover, true); + + ui->image_1->installEventFilter(this); + ui->image_2->installEventFilter(this); + ui->image_3->installEventFilter(this); + ui->image_4->installEventFilter(this); + ui->image_5->installEventFilter(this); } AboutDialog::~AboutDialog() { delete ui; } + +void AboutDialog::preloadImages() { + originalImages[0] = ui->image_1->pixmap().copy(); + originalImages[1] = ui->image_2->pixmap().copy(); + originalImages[2] = ui->image_3->pixmap().copy(); + originalImages[3] = ui->image_4->pixmap().copy(); + originalImages[4] = ui->image_5->pixmap().copy(); + + for (int i = 0; i < 5; ++i) { + QImage image = originalImages[i].toImage(); + for (int y = 0; y < image.height(); ++y) { + for (int x = 0; x < image.width(); ++x) { + QColor color = image.pixelColor(x, y); + color.setRed(255 - color.red()); + color.setGreen(255 - color.green()); + color.setBlue(255 - color.blue()); + image.setPixelColor(x, y, color); + } + } + invertedImages[i] = QPixmap::fromImage(image); + } + updateImagesForCurrentTheme(); +} + +void AboutDialog::updateImagesForCurrentTheme() { + Theme currentTheme = static_cast(Config::getMainWindowTheme()); + bool isDarkTheme = (currentTheme == Theme::Dark || currentTheme == Theme::Green || + currentTheme == Theme::Blue || currentTheme == Theme::Violet); + if (isDarkTheme) { + ui->image_1->setPixmap(invertedImages[0]); + ui->image_2->setPixmap(invertedImages[1]); + ui->image_3->setPixmap(invertedImages[2]); + ui->image_4->setPixmap(invertedImages[3]); + ui->image_5->setPixmap(invertedImages[4]); + } else { + ui->image_1->setPixmap(originalImages[0]); + ui->image_2->setPixmap(originalImages[1]); + ui->image_3->setPixmap(originalImages[2]); + ui->image_4->setPixmap(originalImages[3]); + ui->image_5->setPixmap(originalImages[4]); + } +} + +bool AboutDialog::eventFilter(QObject* obj, QEvent* event) { + if (event->type() == QEvent::Enter) { + if (obj == ui->image_1) { + if (isDarkTheme()) { + ui->image_1->setPixmap(originalImages[0]); + } else { + ui->image_1->setPixmap(invertedImages[0]); + } + applyHoverEffect(ui->image_1); + } else if (obj == ui->image_2) { + if (isDarkTheme()) { + ui->image_2->setPixmap(originalImages[1]); + } else { + ui->image_2->setPixmap(invertedImages[1]); + } + applyHoverEffect(ui->image_2); + } else if (obj == ui->image_3) { + if (isDarkTheme()) { + ui->image_3->setPixmap(originalImages[2]); + } else { + ui->image_3->setPixmap(invertedImages[2]); + } + applyHoverEffect(ui->image_3); + } else if (obj == ui->image_4) { + if (isDarkTheme()) { + ui->image_4->setPixmap(originalImages[3]); + } else { + ui->image_4->setPixmap(invertedImages[3]); + } + applyHoverEffect(ui->image_4); + } else if (obj == ui->image_5) { + if (isDarkTheme()) { + ui->image_5->setPixmap(originalImages[4]); + } else { + ui->image_5->setPixmap(invertedImages[4]); + } + applyHoverEffect(ui->image_5); + } + } else if (event->type() == QEvent::Leave) { + if (obj == ui->image_1) { + if (isDarkTheme()) { + ui->image_1->setPixmap(invertedImages[0]); + } else { + ui->image_1->setPixmap(originalImages[0]); + } + removeHoverEffect(ui->image_1); + } else if (obj == ui->image_2) { + if (isDarkTheme()) { + ui->image_2->setPixmap(invertedImages[1]); + } else { + ui->image_2->setPixmap(originalImages[1]); + } + removeHoverEffect(ui->image_2); + } else if (obj == ui->image_3) { + if (isDarkTheme()) { + ui->image_3->setPixmap(invertedImages[2]); + } else { + ui->image_3->setPixmap(originalImages[2]); + } + removeHoverEffect(ui->image_3); + } else if (obj == ui->image_4) { + if (isDarkTheme()) { + ui->image_4->setPixmap(invertedImages[3]); + } else { + ui->image_4->setPixmap(originalImages[3]); + } + removeHoverEffect(ui->image_4); + } else if (obj == ui->image_5) { + if (isDarkTheme()) { + ui->image_5->setPixmap(invertedImages[4]); + } else { + ui->image_5->setPixmap(originalImages[4]); + } + removeHoverEffect(ui->image_5); + } + } else if (event->type() == QEvent::MouseButtonPress) { + if (obj == ui->image_1) { + QDesktopServices::openUrl(QUrl("https://github.com/shadps4-emu/shadPS4")); + } else if (obj == ui->image_2) { + QDesktopServices::openUrl(QUrl("https://discord.gg/bFJxfftGW6")); + } else if (obj == ui->image_3) { + QDesktopServices::openUrl(QUrl("https://www.youtube.com/@shadPS4/videos")); + } else if (obj == ui->image_4) { + QDesktopServices::openUrl(QUrl("https://ko-fi.com/shadps4")); + } else if (obj == ui->image_5) { + QDesktopServices::openUrl(QUrl("https://shadps4.net")); + } + return true; + } + return QDialog::eventFilter(obj, event); +} + +void AboutDialog::applyHoverEffect(QLabel* label) { + QColor shadowColor = isDarkTheme() ? QColor(0, 0, 0) : QColor(169, 169, 169); + QGraphicsDropShadowEffect* shadow = new QGraphicsDropShadowEffect; + shadow->setBlurRadius(5); + shadow->setXOffset(2); + shadow->setYOffset(2); + shadow->setColor(shadowColor); + label->setGraphicsEffect(shadow); +} + +void AboutDialog::removeHoverEffect(QLabel* label) { + QColor shadowColor = isDarkTheme() ? QColor(50, 50, 50) : QColor(169, 169, 169); + QGraphicsDropShadowEffect* shadow = new QGraphicsDropShadowEffect; + shadow->setBlurRadius(3); + shadow->setXOffset(0); + shadow->setYOffset(0); + shadow->setColor(shadowColor); + label->setGraphicsEffect(shadow); +} + +bool AboutDialog::isDarkTheme() const { + Theme currentTheme = static_cast(Config::getMainWindowTheme()); + return currentTheme == Theme::Dark || currentTheme == Theme::Green || + currentTheme == Theme::Blue || currentTheme == Theme::Violet; +} diff --git a/src/qt_gui/about_dialog.h b/src/qt_gui/about_dialog.h index 8c802221b..42e8d557a 100644 --- a/src/qt_gui/about_dialog.h +++ b/src/qt_gui/about_dialog.h @@ -3,7 +3,11 @@ #pragma once +#include #include +#include +#include +#include namespace Ui { class AboutDialog; @@ -15,7 +19,18 @@ class AboutDialog : public QDialog { public: explicit AboutDialog(QWidget* parent = nullptr); ~AboutDialog(); + bool eventFilter(QObject* obj, QEvent* event); private: Ui::AboutDialog* ui; -}; \ No newline at end of file + + void preloadImages(); + void updateImagesForCurrentTheme(); + void applyHoverEffect(QLabel* label); + void removeHoverEffect(QLabel* label); + + bool isDarkTheme() const; + + QPixmap originalImages[5]; + QPixmap invertedImages[5]; +}; diff --git a/src/qt_gui/about_dialog.ui b/src/qt_gui/about_dialog.ui index e2e76f4c4..19840e452 100644 --- a/src/qt_gui/about_dialog.ui +++ b/src/qt_gui/about_dialog.ui @@ -9,7 +9,7 @@ 0 0 780 - 320 + 310 @@ -22,14 +22,14 @@ - 10 - 30 + 15 + 15 271 - 261 + 271 - QFrame::Shape::NoFrame + QFrame::NoFrame @@ -45,7 +45,7 @@ 310 - 40 + 15 171 41 @@ -64,9 +64,9 @@ 310 - 90 + 60 451 - 101 + 70 @@ -85,9 +85,9 @@ 310 - 180 + 130 451 - 101 + 70 @@ -102,6 +102,131 @@ true + + + + 310 + 210 + 80 + 80 + + + + ArrowCursor + + + QFrame::NoFrame + + + + + + :/images/github.png + + + true + + + + + + 400 + 210 + 80 + 80 + + + + ArrowCursor + + + QFrame::NoFrame + + + + + + :/images/discord.png + + + true + + + + + + 490 + 210 + 80 + 80 + + + + ArrowCursor + + + QFrame::NoFrame + + + + + + :/images/youtube.png + + + true + + + + + + 580 + 210 + 80 + 80 + + + + ArrowCursor + + + QFrame::NoFrame + + + + + + :/images/ko-fi.png + + + true + + + + + + 670 + 210 + 80 + 80 + + + + ArrowCursor + + + QFrame::NoFrame + + + + + + :/images/website.png + + + true + + diff --git a/src/shadps4.qrc b/src/shadps4.qrc index e328f2c42..30f234ed8 100644 --- a/src/shadps4.qrc +++ b/src/shadps4.qrc @@ -25,5 +25,10 @@ images/flag_us.png images/flag_world.png images/flag_china.png + images/github.png + images/discord.png + images/ko-fi.png + images/youtube.png + images/website.png