diff options
| -rw-r--r-- | src/common/bit_field.h | 4 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 21 | ||||
| -rw-r--r-- | src/yuzu/main.h | 1 |
3 files changed, 20 insertions, 6 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 902e668e3..8131d1f95 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h | |||
| @@ -168,11 +168,11 @@ public: | |||
| 168 | constexpr BitField(BitField&&) noexcept = default; | 168 | constexpr BitField(BitField&&) noexcept = default; |
| 169 | constexpr BitField& operator=(BitField&&) noexcept = default; | 169 | constexpr BitField& operator=(BitField&&) noexcept = default; |
| 170 | 170 | ||
| 171 | constexpr FORCE_INLINE operator T() const { | 171 | constexpr operator T() const { |
| 172 | return Value(); | 172 | return Value(); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | constexpr FORCE_INLINE void Assign(const T& value) { | 175 | constexpr void Assign(const T& value) { |
| 176 | storage = (static_cast<StorageType>(storage) & ~mask) | FormatValue(value); | 176 | storage = (static_cast<StorageType>(storage) & ~mask) | FormatValue(value); |
| 177 | } | 177 | } |
| 178 | 178 | ||
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index d6bb18d24..160613ee1 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1839,6 +1839,10 @@ void GMainWindow::OnLoadAmiibo() { | |||
| 1839 | return; | 1839 | return; |
| 1840 | } | 1840 | } |
| 1841 | 1841 | ||
| 1842 | LoadAmiibo(filename); | ||
| 1843 | } | ||
| 1844 | |||
| 1845 | void GMainWindow::LoadAmiibo(const QString& filename) { | ||
| 1842 | Core::System& system{Core::System::GetInstance()}; | 1846 | Core::System& system{Core::System::GetInstance()}; |
| 1843 | Service::SM::ServiceManager& sm = system.ServiceManager(); | 1847 | Service::SM::ServiceManager& sm = system.ServiceManager(); |
| 1844 | auto nfc = sm.GetService<Service::NFP::Module::Interface>("nfp:user"); | 1848 | auto nfc = sm.GetService<Service::NFP::Module::Interface>("nfp:user"); |
| @@ -2189,10 +2193,19 @@ static bool IsSingleFileDropEvent(QDropEvent* event) { | |||
| 2189 | } | 2193 | } |
| 2190 | 2194 | ||
| 2191 | void GMainWindow::dropEvent(QDropEvent* event) { | 2195 | void GMainWindow::dropEvent(QDropEvent* event) { |
| 2192 | if (IsSingleFileDropEvent(event) && ConfirmChangeGame()) { | 2196 | if (!IsSingleFileDropEvent(event)) { |
| 2193 | const QMimeData* mimeData = event->mimeData(); | 2197 | return; |
| 2194 | QString filename = mimeData->urls().at(0).toLocalFile(); | 2198 | } |
| 2195 | BootGame(filename); | 2199 | |
| 2200 | const QMimeData* mime_data = event->mimeData(); | ||
| 2201 | const QString filename = mime_data->urls().at(0).toLocalFile(); | ||
| 2202 | |||
| 2203 | if (emulation_running && QFileInfo(filename).suffix() == QStringLiteral("bin")) { | ||
| 2204 | LoadAmiibo(filename); | ||
| 2205 | } else { | ||
| 2206 | if (ConfirmChangeGame()) { | ||
| 2207 | BootGame(filename); | ||
| 2208 | } | ||
| 2196 | } | 2209 | } |
| 2197 | } | 2210 | } |
| 2198 | 2211 | ||
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index fd4b9ccf5..7f46bea2b 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -142,6 +142,7 @@ private: | |||
| 142 | 142 | ||
| 143 | void ShowTelemetryCallout(); | 143 | void ShowTelemetryCallout(); |
| 144 | void SetDiscordEnabled(bool state); | 144 | void SetDiscordEnabled(bool state); |
| 145 | void LoadAmiibo(const QString& filename); | ||
| 145 | 146 | ||
| 146 | void SelectAndSetCurrentUser(); | 147 | void SelectAndSetCurrentUser(); |
| 147 | 148 | ||