mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	address more comments
This commit is contained in:
		
							parent
							
								
									3534ad0835
								
							
						
					
					
						commit
						c2a32e942b
					
				
					 15 changed files with 87 additions and 56 deletions
				
			
		|  | @ -140,7 +140,7 @@ | |||
|    <header>configuration/configure_graphics.h</header> | ||||
|    <container>1</container> | ||||
|   </customwidget> | ||||
|     <customwidget> | ||||
|   <customwidget> | ||||
|    <class>ConfigureEnhancements</class> | ||||
|    <extends>QWidget</extends> | ||||
|    <header>configuration/configure_enhancements.h</header> | ||||
|  |  | |||
|  | @ -458,6 +458,9 @@ void GameList::AddGamePopup(QMenu& context_menu, const QString& path, u64 progra | |||
|     QAction* open_extdata_location = context_menu.addAction(tr("Open Extra Data Location")); | ||||
|     QAction* open_application_location = context_menu.addAction(tr("Open Application Location")); | ||||
|     QAction* open_update_location = context_menu.addAction(tr("Open Update Data Location")); | ||||
|     QAction* open_texture_dump_location = context_menu.addAction(tr("Open Texture Dump Location")); | ||||
|     QAction* open_texture_load_location = | ||||
|         context_menu.addAction(tr("Open Custom Texture Location")); | ||||
|     QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry")); | ||||
| 
 | ||||
|     const bool is_application = | ||||
|  | @ -484,6 +487,10 @@ void GameList::AddGamePopup(QMenu& context_menu, const QString& path, u64 progra | |||
|                                                                      program_id + 0xe00000000) + | ||||
|                                            "content/")); | ||||
|     auto it = FindMatchingCompatibilityEntry(compatibility_list, program_id); | ||||
| 
 | ||||
|     open_texture_dump_location->setVisible(is_application); | ||||
|     open_texture_load_location->setVisible(is_application); | ||||
| 
 | ||||
|     navigate_to_gamedb_entry->setVisible(it != compatibility_list.end()); | ||||
| 
 | ||||
|     connect(open_save_location, &QAction::triggered, [this, program_id] { | ||||
|  | @ -498,6 +505,18 @@ void GameList::AddGamePopup(QMenu& context_menu, const QString& path, u64 progra | |||
|     connect(open_update_location, &QAction::triggered, [this, program_id] { | ||||
|         emit OpenFolderRequested(program_id, GameListOpenTarget::UPDATE_DATA); | ||||
|     }); | ||||
|     connect(open_texture_dump_location, &QAction::triggered, [this, program_id] { | ||||
|         if (FileUtil::CreateFullPath(fmt::format("{}textures/{:016X}/", | ||||
|                                                  FileUtil::GetUserPath(FileUtil::UserPath::DumpDir), | ||||
|                                                  program_id))) | ||||
|             emit OpenFolderRequested(program_id, GameListOpenTarget::TEXTURE_DUMP); | ||||
|     }); | ||||
|     connect(open_texture_load_location, &QAction::triggered, [this, program_id] { | ||||
|         if (FileUtil::CreateFullPath(fmt::format("{}textures/{:016X}/", | ||||
|                                                  FileUtil::GetUserPath(FileUtil::UserPath::LoadDir), | ||||
|                                                  program_id))) | ||||
|             emit OpenFolderRequested(program_id, GameListOpenTarget::TEXTURE_LOAD); | ||||
|     }); | ||||
|     connect(navigate_to_gamedb_entry, &QAction::triggered, [this, program_id]() { | ||||
|         emit NavigateToGamedbEntryRequested(program_id, compatibility_list); | ||||
|     }); | ||||
|  |  | |||
|  | @ -29,7 +29,14 @@ class QTreeView; | |||
| class QToolButton; | ||||
| class QVBoxLayout; | ||||
| 
 | ||||
| enum class GameListOpenTarget { SAVE_DATA = 0, EXT_DATA = 1, APPLICATION = 2, UPDATE_DATA = 3 }; | ||||
| enum class GameListOpenTarget { | ||||
|     SAVE_DATA = 0, | ||||
|     EXT_DATA = 1, | ||||
|     APPLICATION = 2, | ||||
|     UPDATE_DATA = 3, | ||||
|     TEXTURE_DUMP = 4, | ||||
|     TEXTURE_LOAD = 5 | ||||
| }; | ||||
| 
 | ||||
| class GameList : public QWidget { | ||||
|     Q_OBJECT | ||||
|  |  | |||
|  | @ -1081,6 +1081,16 @@ void GMainWindow::OnGameListOpenFolder(u64 data_id, GameListOpenTarget target) { | |||
|         path = Service::AM::GetTitlePath(Service::FS::MediaType::SDMC, data_id + 0xe00000000) + | ||||
|                "content/"; | ||||
|         break; | ||||
|     case GameListOpenTarget::TEXTURE_DUMP: | ||||
|         open_target = "Dumped Textures"; | ||||
|         path = fmt::format("{}textures/{:016X}/", | ||||
|                            FileUtil::GetUserPath(FileUtil::UserPath::DumpDir), data_id); | ||||
|         break; | ||||
|     case GameListOpenTarget::TEXTURE_LOAD: | ||||
|         open_target = "Custom Textures"; | ||||
|         path = fmt::format("{}textures/{:016X}/", | ||||
|                            FileUtil::GetUserPath(FileUtil::UserPath::LoadDir), data_id); | ||||
|         break; | ||||
|     default: | ||||
|         LOG_ERROR(Frontend, "Unexpected target {}", static_cast<int>(target)); | ||||
|         return; | ||||
|  |  | |||
|  | @ -2,12 +2,10 @@ | |||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include <QBuffer> | ||||
| #include <QImage> | ||||
| #include <QString> | ||||
| #include "citra_qt/qt_image_interface.h" | ||||
| #include "common/logging/log.h" | ||||
| #include "core/frontend/image_interface.h" | ||||
| #include "qt_image_interface.h" | ||||
| 
 | ||||
| bool QtImageInterface::DecodePNG(std::vector<u8>& dst, u32& width, u32& height, | ||||
|                                  const std::string& path) { | ||||
|  | @ -20,16 +18,10 @@ bool QtImageInterface::DecodePNG(std::vector<u8>& dst, u32& width, u32& height, | |||
|     width = image.width(); | ||||
|     height = image.height(); | ||||
| 
 | ||||
|     image = image.convertToFormat(QImage::Format_RGBA8888); | ||||
| 
 | ||||
|     // Write RGBA8 to vector
 | ||||
|     for (int y = 0; y < image.height(); y++) { | ||||
|         for (int x = 0; x < image.width(); x++) { | ||||
|             const QColor pixel(image.pixelColor(x, y)); | ||||
|             dst.push_back(pixel.red()); | ||||
|             dst.push_back(pixel.green()); | ||||
|             dst.push_back(pixel.blue()); | ||||
|             dst.push_back(pixel.alpha()); | ||||
|         } | ||||
|     } | ||||
|     dst = std::vector<u8>(image.constBits(), image.constBits() + (width * height * 4)); | ||||
| 
 | ||||
|     return true; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue