mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Unify ISOFile (wx) with GameFile (Qt) and put it in UICommon
The original reason I wanted to do this was so that we can replace the Android-specific code with this in the future, but of course, just deduplicating between DolphinWX and DolphinQt2 is nice too. Fixes: - DolphinQt2 showing the wrong size for split WBFS disc images. - DolphinQt2 being case sensitive when checking if a file is a DOL/ELF. - DolphinQt2 not detecting when a Wii banner has become available after the game list cache was created. Removes: - DolphinWX's ability to load PNGs as custom banners. But it was already rather broken (see https://bugs.dolphin-emu.org/issues/10365 and https://bugs.dolphin-emu.org/issues/10366). The reason I removed this was because PNG decoding relied on wx code and we don't have any good non-wx/Qt code for loading PNG files right now (let's not use SOIL), but we should be able to use libpng directly to implement PNG loading in the future. - DolphinQt2's ability to ignore a cached game if the last modified time differs. We currently don't have a non-wx/Qt way to get the time.
This commit is contained in:
@ -5,10 +5,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <wx/colour.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/string.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
class wxControl;
|
||||
class wxBitmap;
|
||||
class wxImage;
|
||||
@ -18,6 +22,11 @@ class wxToolBar;
|
||||
class wxTopLevelWindow;
|
||||
class wxWindow;
|
||||
|
||||
namespace UICommon
|
||||
{
|
||||
struct GameBanner;
|
||||
}
|
||||
|
||||
namespace WxUtils
|
||||
{
|
||||
// Launch a file according to its mime type
|
||||
@ -95,6 +104,9 @@ constexpr LSIFlags operator&(LSIFlags left, LSIFlags right)
|
||||
return static_cast<LSIFlags>(static_cast<unsigned int>(left) & right);
|
||||
}
|
||||
|
||||
wxImage ToWxImage(const UICommon::GameBanner& banner);
|
||||
wxImage ToWxImage(const std::vector<u32>& buffer, int width, int height);
|
||||
|
||||
// Swiss army knife loader function for preparing a scaled resource image file.
|
||||
// Only the path and context are mandatory, other parameters can be ignored.
|
||||
// NOTE: All size parameters are in window pixels, not DIPs or framebuffer pixels.
|
||||
|
Reference in New Issue
Block a user