Skip to content

Commit

Permalink
Merge branch 'shadps4-emu:main' into new-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolix29 authored Dec 9, 2024
2 parents 20a445e + f623613 commit fd99fa3
Show file tree
Hide file tree
Showing 15 changed files with 433 additions and 49 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1020,4 +1020,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()
7 changes: 6 additions & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
]
Expand Down
44 changes: 44 additions & 0 deletions documents/changelog.txt → documents/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
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
=================

Expand Down
Binary file added src/images/discord.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/ko-fi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/website.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/youtube.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
181 changes: 181 additions & 0 deletions src/qt_gui/about_dialog.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,194 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#include <QDesktopServices>
#include <QEvent>
#include <QGraphicsDropShadowEffect>
#include <QImage>
#include <QLabel>
#include <QPixmap>
#include <common/config.h>
#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<Theme>(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<Theme>(Config::getMainWindowTheme());
return currentTheme == Theme::Dark || currentTheme == Theme::Green ||
currentTheme == Theme::Blue || currentTheme == Theme::Violet;
}
17 changes: 16 additions & 1 deletion src/qt_gui/about_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#pragma once

#include <QDesktopServices>
#include <QDialog>
#include <QLabel>
#include <QPixmap>
#include <QUrl>

namespace Ui {
class AboutDialog;
Expand All @@ -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;
};

void preloadImages();
void updateImagesForCurrentTheme();
void applyHoverEffect(QLabel* label);
void removeHoverEffect(QLabel* label);

bool isDarkTheme() const;

QPixmap originalImages[5];
QPixmap invertedImages[5];
};
Loading

0 comments on commit fd99fa3

Please sign in to comment.