summaryrefslogtreecommitdiff
path: root/src/yuzu
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-31 12:21:34 -0400
committerLioncash <mathew1800@gmail.com>2018-08-31 16:30:14 -0400
commit4a587b81b285bcd41246329e89591be7cfe37c8a (patch)
tree8eda46d4aac083d23a52223e1a3fc46bc6690a6c /src/yuzu
parent42588493d5ad5d824fc557ac936e64e5e7fd7e44 (diff)
core/core: Replace includes with forward declarations where applicable
The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, which replaces most of the includes in the core header with forward declarations. This makes it so that if any of the headers the core header was previously including change, then no one will need to rebuild the bulk of the core, due to core.h being quite a prevalent inclusion. This should make turnaround for changes much faster for developers.
Diffstat (limited to 'src/yuzu')
-rw-r--r--src/yuzu/debugger/wait_tree.cpp20
-rw-r--r--src/yuzu/debugger/wait_tree.h30
-rw-r--r--src/yuzu/game_list.cpp16
-rw-r--r--src/yuzu/game_list.h12
-rw-r--r--src/yuzu/game_list_p.h18
-rw-r--r--src/yuzu/main.cpp9
-rw-r--r--src/yuzu/main.h7
7 files changed, 93 insertions, 19 deletions
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp
index eac0c05f2..6c2cd967e 100644
--- a/src/yuzu/debugger/wait_tree.cpp
+++ b/src/yuzu/debugger/wait_tree.cpp
@@ -9,11 +9,14 @@
#include "core/core.h"
#include "core/hle/kernel/event.h"
#include "core/hle/kernel/handle_table.h"
+#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/mutex.h"
+#include "core/hle/kernel/scheduler.h"
#include "core/hle/kernel/thread.h"
#include "core/hle/kernel/timer.h"
#include "core/hle/kernel/wait_object.h"
+WaitTreeItem::WaitTreeItem() = default;
WaitTreeItem::~WaitTreeItem() = default;
QColor WaitTreeItem::GetColor() const {
@@ -71,6 +74,7 @@ std::vector<std::unique_ptr<WaitTreeThread>> WaitTreeItem::MakeThreadItemList()
}
WaitTreeText::WaitTreeText(const QString& t) : text(t) {}
+WaitTreeText::~WaitTreeText() = default;
QString WaitTreeText::GetText() const {
return text;
@@ -84,6 +88,8 @@ WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address) : mutex_address(mutex_
owner = handle_table.Get<Kernel::Thread>(owner_handle);
}
+WaitTreeMutexInfo::~WaitTreeMutexInfo() = default;
+
QString WaitTreeMutexInfo::GetText() const {
return tr("waiting for mutex 0x%1").arg(mutex_address, 16, 16, QLatin1Char('0'));
}
@@ -102,6 +108,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeMutexInfo::GetChildren() cons
}
WaitTreeCallstack::WaitTreeCallstack(const Kernel::Thread& thread) : thread(thread) {}
+WaitTreeCallstack::~WaitTreeCallstack() = default;
QString WaitTreeCallstack::GetText() const {
return tr("Call stack");
@@ -126,6 +133,10 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons
}
WaitTreeWaitObject::WaitTreeWaitObject(const Kernel::WaitObject& o) : object(o) {}
+WaitTreeWaitObject::~WaitTreeWaitObject() = default;
+
+WaitTreeExpandableItem::WaitTreeExpandableItem() = default;
+WaitTreeExpandableItem::~WaitTreeExpandableItem() = default;
bool WaitTreeExpandableItem::IsExpandable() const {
return true;
@@ -180,6 +191,8 @@ WaitTreeObjectList::WaitTreeObjectList(
const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list, bool w_all)
: object_list(list), wait_all(w_all) {}
+WaitTreeObjectList::~WaitTreeObjectList() = default;
+
QString WaitTreeObjectList::GetText() const {
if (wait_all)
return tr("waiting for all objects");
@@ -194,6 +207,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeObjectList::GetChildren() con
}
WaitTreeThread::WaitTreeThread(const Kernel::Thread& thread) : WaitTreeWaitObject(thread) {}
+WaitTreeThread::~WaitTreeThread() = default;
QString WaitTreeThread::GetText() const {
const auto& thread = static_cast<const Kernel::Thread&>(object);
@@ -312,6 +326,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
}
WaitTreeEvent::WaitTreeEvent(const Kernel::Event& object) : WaitTreeWaitObject(object) {}
+WaitTreeEvent::~WaitTreeEvent() = default;
std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeEvent::GetChildren() const {
std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren());
@@ -323,6 +338,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeEvent::GetChildren() const {
}
WaitTreeTimer::WaitTreeTimer(const Kernel::Timer& object) : WaitTreeWaitObject(object) {}
+WaitTreeTimer::~WaitTreeTimer() = default;
std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeTimer::GetChildren() const {
std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren());
@@ -340,6 +356,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeTimer::GetChildren() const {
WaitTreeThreadList::WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list)
: thread_list(list) {}
+WaitTreeThreadList::~WaitTreeThreadList() = default;
QString WaitTreeThreadList::GetText() const {
return tr("waited by thread");
@@ -353,6 +370,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThreadList::GetChildren() con
}
WaitTreeModel::WaitTreeModel(QObject* parent) : QAbstractItemModel(parent) {}
+WaitTreeModel::~WaitTreeModel() = default;
QModelIndex WaitTreeModel::index(int row, int column, const QModelIndex& parent) const {
if (!hasIndex(row, column, parent))
@@ -421,6 +439,8 @@ WaitTreeWidget::WaitTreeWidget(QWidget* parent) : QDockWidget(tr("Wait Tree"), p
setEnabled(false);
}
+WaitTreeWidget::~WaitTreeWidget() = default;
+
void WaitTreeWidget::OnDebugModeEntered() {
if (!Core::System::GetInstance().IsPoweredOn())
return;
diff --git a/src/yuzu/debugger/wait_tree.h b/src/yuzu/debugger/wait_tree.h
index 513b3c45d..defbf734f 100644
--- a/src/yuzu/debugger/wait_tree.h
+++ b/src/yuzu/debugger/wait_tree.h
@@ -4,11 +4,15 @@
#pragma once
+#include <cstddef>
+#include <memory>
+#include <vector>
+
#include <QAbstractItemModel>
#include <QDockWidget>
#include <QTreeView>
#include <boost/container/flat_set.hpp>
-#include "core/core.h"
+#include "common/common_types.h"
#include "core/hle/kernel/object.h"
class EmuThread;
@@ -25,6 +29,7 @@ class WaitTreeThread;
class WaitTreeItem : public QObject {
Q_OBJECT
public:
+ WaitTreeItem();
~WaitTreeItem() override;
virtual bool IsExpandable() const;
@@ -49,6 +54,8 @@ class WaitTreeText : public WaitTreeItem {
Q_OBJECT
public:
explicit WaitTreeText(const QString& text);
+ ~WaitTreeText() override;
+
QString GetText() const override;
private:
@@ -58,6 +65,9 @@ private:
class WaitTreeExpandableItem : public WaitTreeItem {
Q_OBJECT
public:
+ WaitTreeExpandableItem();
+ ~WaitTreeExpandableItem() override;
+
bool IsExpandable() const override;
};
@@ -65,6 +75,8 @@ class WaitTreeMutexInfo : public WaitTreeExpandableItem {
Q_OBJECT
public:
explicit WaitTreeMutexInfo(VAddr mutex_address);
+ ~WaitTreeMutexInfo() override;
+
QString GetText() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -79,6 +91,8 @@ class WaitTreeCallstack : public WaitTreeExpandableItem {
Q_OBJECT
public:
explicit WaitTreeCallstack(const Kernel::Thread& thread);
+ ~WaitTreeCallstack() override;
+
QString GetText() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -90,6 +104,8 @@ class WaitTreeWaitObject : public WaitTreeExpandableItem {
Q_OBJECT
public:
explicit WaitTreeWaitObject(const Kernel::WaitObject& object);
+ ~WaitTreeWaitObject() override;
+
static std::unique_ptr<WaitTreeWaitObject> make(const Kernel::WaitObject& object);
QString GetText() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -105,6 +121,8 @@ class WaitTreeObjectList : public WaitTreeExpandableItem {
public:
WaitTreeObjectList(const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list,
bool wait_all);
+ ~WaitTreeObjectList() override;
+
QString GetText() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -117,6 +135,8 @@ class WaitTreeThread : public WaitTreeWaitObject {
Q_OBJECT
public:
explicit WaitTreeThread(const Kernel::Thread& thread);
+ ~WaitTreeThread() override;
+
QString GetText() const override;
QColor GetColor() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -126,6 +146,8 @@ class WaitTreeEvent : public WaitTreeWaitObject {
Q_OBJECT
public:
explicit WaitTreeEvent(const Kernel::Event& object);
+ ~WaitTreeEvent() override;
+
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
};
@@ -133,6 +155,8 @@ class WaitTreeTimer : public WaitTreeWaitObject {
Q_OBJECT
public:
explicit WaitTreeTimer(const Kernel::Timer& object);
+ ~WaitTreeTimer() override;
+
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
};
@@ -140,6 +164,8 @@ class WaitTreeThreadList : public WaitTreeExpandableItem {
Q_OBJECT
public:
explicit WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list);
+ ~WaitTreeThreadList() override;
+
QString GetText() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -152,6 +178,7 @@ class WaitTreeModel : public QAbstractItemModel {
public:
explicit WaitTreeModel(QObject* parent = nullptr);
+ ~WaitTreeModel() override;
QVariant data(const QModelIndex& index, int role) const override;
QModelIndex index(int row, int column, const QModelIndex& parent) const override;
@@ -171,6 +198,7 @@ class WaitTreeWidget : public QDockWidget {
public:
explicit WaitTreeWidget(QWidget* parent = nullptr);
+ ~WaitTreeWidget() override;
public slots:
void OnDebugModeEntered();
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 27525938a..d15242d59 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -23,10 +23,12 @@
#include "core/file_sys/registered_cache.h"
#include "core/file_sys/romfs.h"
#include "core/file_sys/vfs_real.h"
+#include "core/hle/service/filesystem/filesystem.h"
#include "core/loader/loader.h"
-#include "game_list.h"
-#include "game_list_p.h"
-#include "ui_settings.h"
+#include "yuzu/game_list.h"
+#include "yuzu/game_list_p.h"
+#include "yuzu/main.h"
+#include "yuzu/ui_settings.h"
GameList::SearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist) : gamelist{gamelist} {}
@@ -481,6 +483,14 @@ static void GetMetadataFromControlNCA(const std::shared_ptr<FileSys::NCA>& nca,
}
}
+GameListWorker::GameListWorker(
+ FileSys::VirtualFilesystem vfs, QString dir_path, bool deep_scan,
+ const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list)
+ : vfs(std::move(vfs)), dir_path(std::move(dir_path)), deep_scan(deep_scan),
+ compatibility_list(compatibility_list) {}
+
+GameListWorker::~GameListWorker() = default;
+
void GameListWorker::AddInstalledTitlesToGameList(std::shared_ptr<FileSys::RegisteredCache> cache) {
const auto installed_games = cache->ListEntriesFilter(FileSys::TitleType::Application,
FileSys::ContentRecordType::Program);
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h
index c01351dc9..6a5c2f5f8 100644
--- a/src/yuzu/game_list.h
+++ b/src/yuzu/game_list.h
@@ -4,6 +4,8 @@
#pragma once
+#include <unordered_map>
+
#include <QFileSystemWatcher>
#include <QHBoxLayout>
#include <QLabel>
@@ -17,9 +19,13 @@
#include <QTreeView>
#include <QVBoxLayout>
#include <QWidget>
-#include "main.h"
class GameListWorker;
+class GMainWindow;
+
+namespace FileSys {
+class VfsFilesystem;
+}
enum class GameListOpenTarget { SaveData };
@@ -62,7 +68,7 @@ public:
QToolButton* button_filter_close = nullptr;
};
- explicit GameList(FileSys::VirtualFilesystem vfs, GMainWindow* parent = nullptr);
+ explicit GameList(std::shared_ptr<FileSys::VfsFilesystem> vfs, GMainWindow* parent = nullptr);
~GameList() override;
void clearFilter();
@@ -97,7 +103,7 @@ private:
void PopupContextMenu(const QPoint& menu_location);
void RefreshGameDirectory();
- FileSys::VirtualFilesystem vfs;
+ std::shared_ptr<FileSys::VfsFilesystem> vfs;
SearchField* search_field;
GMainWindow* main_window = nullptr;
QVBoxLayout* layout = nullptr;
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h
index b9676d069..3624cb21a 100644
--- a/src/yuzu/game_list_p.h
+++ b/src/yuzu/game_list_p.h
@@ -18,10 +18,15 @@
#include <QString>
#include "common/logging/log.h"
#include "common/string_util.h"
-#include "core/file_sys/content_archive.h"
-#include "ui_settings.h"
+#include "yuzu/ui_settings.h"
#include "yuzu/util/util.h"
+namespace FileSys {
+class NCA;
+class RegisteredCache;
+class VfsFilesystem;
+} // namespace FileSys
+
/**
* Gets the default icon (for games without valid SMDH)
* @param large If true, returns large icon (48x48), otherwise returns small icon (24x24)
@@ -196,10 +201,9 @@ class GameListWorker : public QObject, public QRunnable {
public:
GameListWorker(
- FileSys::VirtualFilesystem vfs, QString dir_path, bool deep_scan,
- const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list)
- : vfs(std::move(vfs)), dir_path(std::move(dir_path)), deep_scan(deep_scan),
- compatibility_list(compatibility_list) {}
+ std::shared_ptr<FileSys::VfsFilesystem> vfs, QString dir_path, bool deep_scan,
+ const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list);
+ ~GameListWorker() override;
public slots:
/// Starts the processing of directory tree information.
@@ -222,7 +226,7 @@ signals:
void Finished(QStringList watch_list);
private:
- FileSys::VirtualFilesystem vfs;
+ std::shared_ptr<FileSys::VfsFilesystem> vfs;
std::map<u64, std::shared_ptr<FileSys::NCA>> nca_control_map;
QStringList watch_list;
QString dir_path;
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 1501aedc4..e11ba7854 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -21,22 +21,22 @@
#include "common/logging/backend.h"
#include "common/logging/filter.h"
#include "common/logging/log.h"
-#include "common/logging/text_formatter.h"
#include "common/microprofile.h"
#include "common/scm_rev.h"
#include "common/scope_exit.h"
#include "common/string_util.h"
+#include "common/telemetry.h"
#include "core/core.h"
#include "core/crypto/key_manager.h"
-#include "core/file_sys/bis_factory.h"
#include "core/file_sys/card_image.h"
#include "core/file_sys/registered_cache.h"
#include "core/file_sys/savedata_factory.h"
#include "core/file_sys/vfs_real.h"
-#include "core/gdbstub/gdbstub.h"
+#include "core/hle/service/filesystem/filesystem.h"
#include "core/loader/loader.h"
+#include "core/perf_stats.h"
#include "core/settings.h"
-#include "game_list_p.h"
+#include "core/telemetry_session.h"
#include "video_core/debug_utils/debug_utils.h"
#include "yuzu/about_dialog.h"
#include "yuzu/bootmanager.h"
@@ -48,6 +48,7 @@
#include "yuzu/debugger/profiler.h"
#include "yuzu/debugger/wait_tree.h"
#include "yuzu/game_list.h"
+#include "yuzu/game_list_p.h"
#include "yuzu/hotkeys.h"
#include "yuzu/main.h"
#include "yuzu/ui_settings.h"
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index fd2436f4d..0b97e8220 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -5,6 +5,7 @@
#pragma once
#include <memory>
+#include <unordered_map>
#include <QMainWindow>
#include <QTimer>
#include "core/core.h"
@@ -23,6 +24,10 @@ class ProfilerWidget;
class WaitTreeWidget;
enum class GameListOpenTarget;
+namespace FileSys {
+class VfsFilesystem;
+}
+
namespace Tegra {
class DebugContext;
}
@@ -169,7 +174,7 @@ private:
QString game_path;
// FS
- FileSys::VirtualFilesystem vfs;
+ std::shared_ptr<FileSys::VfsFilesystem> vfs;
// Debugger panes
ProfilerWidget* profilerWidget;