Proper 4:3 support
This commit is contained in:
committed by
Radosław Gliński
parent
49166f0bd1
commit
c4e930ed4c
@@ -161,11 +161,12 @@ const std::string kRecentlyPlayedTitlesFilename = "recent.toml";
|
||||
const std::string kBaseTitle = "Xenia-canary";
|
||||
|
||||
EmulatorWindow::EmulatorWindow(Emulator* emulator,
|
||||
ui::WindowedAppContext& app_context)
|
||||
ui::WindowedAppContext& app_context,
|
||||
uint32_t width, uint32_t height)
|
||||
: emulator_(emulator),
|
||||
app_context_(app_context),
|
||||
window_listener_(*this),
|
||||
window_(ui::Window::Create(app_context, kBaseTitle, 1280, 720)),
|
||||
window_(ui::Window::Create(app_context, kBaseTitle, width, height)),
|
||||
imgui_drawer_(
|
||||
std::make_unique<ui::ImGuiDrawer>(window_.get(), kZOrderImGui)),
|
||||
display_config_game_config_load_callback_(
|
||||
@@ -190,10 +191,11 @@ EmulatorWindow::EmulatorWindow(Emulator* emulator,
|
||||
}
|
||||
|
||||
std::unique_ptr<EmulatorWindow> EmulatorWindow::Create(
|
||||
Emulator* emulator, ui::WindowedAppContext& app_context) {
|
||||
Emulator* emulator, ui::WindowedAppContext& app_context, uint32_t width,
|
||||
uint32_t height) {
|
||||
assert_true(app_context.IsInUIThread());
|
||||
std::unique_ptr<EmulatorWindow> emulator_window(
|
||||
new EmulatorWindow(emulator, app_context));
|
||||
new EmulatorWindow(emulator, app_context, width, height));
|
||||
if (!emulator_window->Initialize()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ class EmulatorWindow {
|
||||
virtual ~EmulatorWindow();
|
||||
|
||||
static std::unique_ptr<EmulatorWindow> Create(
|
||||
Emulator* emulator, ui::WindowedAppContext& app_context);
|
||||
Emulator* emulator, ui::WindowedAppContext& app_context, uint32_t width,
|
||||
uint32_t height);
|
||||
|
||||
std::unique_ptr<xe::threading::Thread> Gamepad_HotKeys_Listener;
|
||||
|
||||
@@ -183,7 +184,8 @@ class EmulatorWindow {
|
||||
};
|
||||
|
||||
explicit EmulatorWindow(Emulator* emulator,
|
||||
ui::WindowedAppContext& app_context);
|
||||
ui::WindowedAppContext& app_context, uint32_t width,
|
||||
uint32_t height);
|
||||
|
||||
bool Initialize();
|
||||
|
||||
|
||||
@@ -103,6 +103,8 @@ DECLARE_bool(debug);
|
||||
|
||||
DEFINE_bool(discord, true, "Enable Discord rich presence", "General");
|
||||
|
||||
DECLARE_bool(widescreen);
|
||||
|
||||
namespace xe {
|
||||
namespace app {
|
||||
|
||||
@@ -445,8 +447,17 @@ bool EmulatorApp::OnInitialize() {
|
||||
emulator_ =
|
||||
std::make_unique<Emulator>("", storage_root, content_root, cache_root);
|
||||
|
||||
// Determine window size based on user widescreen setting.
|
||||
uint32_t window_w = 1280;
|
||||
uint32_t window_h = 720;
|
||||
if (!cvars::widescreen) {
|
||||
window_w = 1024;
|
||||
window_h = 768;
|
||||
}
|
||||
|
||||
// Main emulator display window.
|
||||
emulator_window_ = EmulatorWindow::Create(emulator_.get(), app_context());
|
||||
emulator_window_ = EmulatorWindow::Create(emulator_.get(), app_context(),
|
||||
window_w, window_h);
|
||||
if (!emulator_window_) {
|
||||
XELOGE("Failed to create the main emulator window");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user