mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Merge pull request #16506 from xuzhen/master
Fix the Qt/SDL window icon path
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <QApplication>
|
||||
#include <QDesktopServices>
|
||||
#include <QDesktopWidget>
|
||||
#include <QFile>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
@@ -26,7 +27,14 @@ MainWindow::MainWindow(QWidget *parent, bool fullscreen) :
|
||||
nextState(CORE_POWERDOWN),
|
||||
lastUIState(UISTATE_MENU)
|
||||
{
|
||||
#if defined(ASSETS_DIR)
|
||||
if (QFile::exists(ASSETS_DIR "icon_regular_72.png"))
|
||||
setWindowIcon(QIcon(ASSETS_DIR "icon_regular_72.png"));
|
||||
else
|
||||
setWindowIcon(QIcon(qApp->applicationDirPath() + "/assets/icon_regular_72.png"));
|
||||
#else
|
||||
setWindowIcon(QIcon(qApp->applicationDirPath() + "/assets/icon_regular_72.png"));
|
||||
#endif
|
||||
|
||||
SetGameTitle("");
|
||||
emugl = new MainUI(this);
|
||||
|
||||
@@ -773,7 +773,13 @@ int main(int argc, char *argv[]) {
|
||||
SDL_SetWindowTitle(window, (app_name_nice + " " + PPSSPP_GIT_VERSION).c_str());
|
||||
|
||||
char iconPath[PATH_MAX];
|
||||
#if defined(ASSETS_DIR)
|
||||
snprintf(iconPath, PATH_MAX, "%sicon_regular_72.png", ASSETS_DIR);
|
||||
if (access(iconPath, F_OK) != 0)
|
||||
snprintf(iconPath, PATH_MAX, "%sassets/icon_regular_72.png", SDL_GetBasePath() ? SDL_GetBasePath() : "");
|
||||
#else
|
||||
snprintf(iconPath, PATH_MAX, "%sassets/icon_regular_72.png", SDL_GetBasePath() ? SDL_GetBasePath() : "");
|
||||
#endif
|
||||
int width = 0, height = 0;
|
||||
unsigned char *imageData;
|
||||
if (pngLoad(iconPath, &width, &height, &imageData) == 1) {
|
||||
|
||||
Reference in New Issue
Block a user