Removing dependencies on MainWindow.

This commit is contained in:
Ben Vanik
2015-07-01 08:02:22 -07:00
parent 4732378ba9
commit 9efccc5f4a
17 changed files with 123 additions and 98 deletions

View File

@@ -53,7 +53,7 @@ GL4GraphicsSystem::GL4GraphicsSystem(Emulator* emulator)
GL4GraphicsSystem::~GL4GraphicsSystem() = default;
X_STATUS GL4GraphicsSystem::Setup(cpu::Processor* processor,
ui::PlatformLoop* target_loop,
ui::Loop* target_loop,
ui::PlatformWindow* target_window) {
auto result = GraphicsSystem::Setup(processor, target_loop, target_window);
if (result) {

View File

@@ -29,7 +29,7 @@ class GL4GraphicsSystem : public GraphicsSystem {
static std::unique_ptr<GraphicsSystem> Create(Emulator* emulator);
X_STATUS Setup(cpu::Processor* processor, ui::PlatformLoop* target_loop,
X_STATUS Setup(cpu::Processor* processor, ui::Loop* target_loop,
ui::PlatformWindow* target_window) override;
void Shutdown() override;

View File

@@ -38,19 +38,11 @@ std::unique_ptr<GraphicsSystem> GraphicsSystem::Create(Emulator* emulator) {
}
}
GraphicsSystem::GraphicsSystem(Emulator* emulator)
: emulator_(emulator),
memory_(nullptr),
processor_(nullptr),
target_loop_(nullptr),
target_window_(nullptr),
interrupt_callback_(0),
interrupt_callback_data_(0) {}
GraphicsSystem::GraphicsSystem(Emulator* emulator) : emulator_(emulator) {}
GraphicsSystem::~GraphicsSystem() = default;
X_STATUS GraphicsSystem::Setup(cpu::Processor* processor,
ui::PlatformLoop* target_loop,
X_STATUS GraphicsSystem::Setup(cpu::Processor* processor, ui::Loop* target_loop,
ui::PlatformWindow* target_window) {
processor_ = processor;
memory_ = processor->memory();

View File

@@ -16,7 +16,8 @@
#include "xenia/cpu/processor.h"
#include "xenia/memory.h"
#include "xenia/ui/main_window.h"
#include "xenia/ui/loop.h"
#include "xenia/ui/platform.h"
#include "xenia/xbox.h"
namespace xe {
@@ -36,8 +37,7 @@ class GraphicsSystem {
Memory* memory() const { return memory_; }
cpu::Processor* processor() const { return processor_; }
virtual X_STATUS Setup(cpu::Processor* processor,
ui::PlatformLoop* target_loop,
virtual X_STATUS Setup(cpu::Processor* processor, ui::Loop* target_loop,
ui::PlatformWindow* target_window);
virtual void Shutdown();
@@ -64,14 +64,14 @@ class GraphicsSystem {
protected:
GraphicsSystem(Emulator* emulator);
Emulator* emulator_;
Memory* memory_;
cpu::Processor* processor_;
ui::PlatformLoop* target_loop_;
ui::PlatformWindow* target_window_;
Emulator* emulator_ = nullptr;
Memory* memory_ = nullptr;
cpu::Processor* processor_ = nullptr;
ui::Loop* target_loop_ = nullptr;
ui::PlatformWindow* target_window_ = nullptr;
uint32_t interrupt_callback_;
uint32_t interrupt_callback_data_;
uint32_t interrupt_callback_ = 0;
uint32_t interrupt_callback_data_ = 0;
};
} // namespace gpu

View File

@@ -24,7 +24,6 @@
#include "xenia/gpu/xenos.h"
#include "xenia/profiling.h"
#include "xenia/ui/gl/gl_context.h"
#include "xenia/ui/main_window.h"
// HACK: until we have another impl, we just use gl4 directly.
#include "xenia/gpu/gl4/command_processor.h"
@@ -843,7 +842,7 @@ class TracePlayer : public TraceReader {
int current_command_index_;
};
void DrawControllerUI(xe::ui::MainWindow* window, TracePlayer& player,
void DrawControllerUI(xe::ui::PlatformWindow* window, TracePlayer& player,
Memory* memory) {
ImGui::SetNextWindowPos(ImVec2(5, 5), ImGuiSetCond_FirstUseEver);
if (!ImGui::Begin("Controller", nullptr, ImVec2(340, 60))) {
@@ -884,7 +883,7 @@ void DrawControllerUI(xe::ui::MainWindow* window, TracePlayer& player,
ImGui::End();
}
void DrawCommandListUI(xe::ui::MainWindow* window, TracePlayer& player,
void DrawCommandListUI(xe::ui::PlatformWindow* window, TracePlayer& player,
Memory* memory) {
ImGui::SetNextWindowPos(ImVec2(5, 70), ImGuiSetCond_FirstUseEver);
if (!ImGui::Begin("Command List", nullptr, ImVec2(200, 640))) {
@@ -1028,7 +1027,7 @@ ShaderDisplayType DrawShaderTypeUI() {
return shader_display_type;
}
void DrawShaderUI(xe::ui::MainWindow* window, TracePlayer& player,
void DrawShaderUI(xe::ui::PlatformWindow* window, TracePlayer& player,
Memory* memory, gl4::GL4Shader* shader,
ShaderDisplayType display_type) {
// Must be prepared for advanced display modes.
@@ -1394,7 +1393,7 @@ static const char* kEndiannessNames[] = {
"unspecified endianness", "8-in-16", "8-in-32", "16-in-32",
};
void DrawStateUI(xe::ui::MainWindow* window, TracePlayer& player,
void DrawStateUI(xe::ui::PlatformWindow* window, TracePlayer& player,
Memory* memory) {
auto gs = static_cast<gl4::GL4GraphicsSystem*>(player.graphics_system());
auto cp = gs->command_processor();
@@ -2034,8 +2033,8 @@ void DrawStateUI(xe::ui::MainWindow* window, TracePlayer& player,
ImGui::End();
}
void DrawPacketDisassemblerUI(xe::ui::MainWindow* window, TracePlayer& player,
Memory* memory) {
void DrawPacketDisassemblerUI(xe::ui::PlatformWindow* window,
TracePlayer& player, Memory* memory) {
ImGui::SetNextWindowCollapsed(true, ImGuiSetCond_FirstUseEver);
ImGui::SetNextWindowPos(ImVec2(float(window->width()) - 500 - 5, 5),
ImGuiSetCond_FirstUseEver);
@@ -2176,7 +2175,8 @@ void DrawPacketDisassemblerUI(xe::ui::MainWindow* window, TracePlayer& player,
ImGui::End();
}
void DrawUI(xe::ui::MainWindow* window, TracePlayer& player, Memory* memory) {
void DrawUI(xe::ui::PlatformWindow* window, TracePlayer& player,
Memory* memory) {
// ImGui::ShowTestWindow();
DrawControllerUI(window, player, memory);
@@ -2212,7 +2212,7 @@ int trace_viewer_main(std::vector<std::wstring>& args) {
// Normalize the path and make absolute.
auto abs_path = xe::to_absolute_path(path);
auto window = emulator->main_window();
auto window = emulator->display_window();
auto loop = window->loop();
auto file_name = xe::find_name_from_path(path);
window->set_title(std::wstring(L"Xenia GPU Trace Viewer: ") + file_name);
@@ -2306,7 +2306,7 @@ int trace_viewer_main(std::vector<std::wstring>& args) {
graphics_system->RequestSwap();
// Wait until we are exited.
emulator->main_window()->loop()->AwaitQuit();
emulator->display_window()->loop()->AwaitQuit();
ImImpl_Shutdown();
}