mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-09 04:30:49 -04:00
Add "lock aspect ratio" setting
Uses new Aurora functionality: https://github.com/encounter/aurora/pull/97 Fixes #138
This commit is contained in:
@@ -5,4 +5,12 @@
|
||||
|
||||
extern AuroraInfo auroraInfo;
|
||||
|
||||
constexpr u32 defaultWindowWidth = 608;
|
||||
constexpr u32 defaultWindowHeight = 448;
|
||||
|
||||
constexpr u32 defaultAspectRatioW = 19;
|
||||
constexpr u32 defaultAspectRatioH = 14;
|
||||
|
||||
static_assert(defaultWindowWidth / defaultAspectRatioW == defaultWindowHeight / defaultAspectRatioH);
|
||||
|
||||
#endif // DUSK_DUSK_H
|
||||
|
||||
@@ -11,6 +11,7 @@ struct UserSettings {
|
||||
struct {
|
||||
// Video
|
||||
bool enableFullscreen;
|
||||
bool lockAspectRatio;
|
||||
} video;
|
||||
|
||||
struct {
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "dusk/audio/DuskDsp.hpp"
|
||||
#include "dusk/audio/DuskAudioSystem.h"
|
||||
#include "dusk/audio/DuskDsp.hpp"
|
||||
#include "dusk/dusk.h"
|
||||
#include "dusk/hotkeys.h"
|
||||
#include "dusk/settings.h"
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
@@ -29,6 +30,15 @@ namespace dusk {
|
||||
VISetWindowFullscreen(getSettings().video.enableFullscreen);
|
||||
}
|
||||
|
||||
bool& lockAspect = getSettings().video.lockAspectRatio;
|
||||
if (ImGui::Checkbox("Lock Aspect Ratio", &lockAspect)) {
|
||||
if (lockAspect) {
|
||||
VILockAspectRatio(defaultAspectRatioW, defaultAspectRatioH);
|
||||
} else {
|
||||
VIUnlockAspectRatio();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ UserSettings g_userSettings = {
|
||||
// Video
|
||||
.video = {
|
||||
.enableFullscreen = false,
|
||||
.lockAspectRatio = false,
|
||||
},
|
||||
|
||||
// Audio
|
||||
|
||||
@@ -269,8 +269,8 @@ int game_main(int argc, char* argv[]) {
|
||||
config.appName = "Dusk";
|
||||
config.windowPosX = -1;
|
||||
config.windowPosY = -1;
|
||||
config.windowWidth = 608 * 2;
|
||||
config.windowHeight = 448 * 2;
|
||||
config.windowWidth = defaultWindowWidth * 2;
|
||||
config.windowHeight = defaultWindowHeight * 2;
|
||||
config.desiredBackend = ParseAuroraBackend(parsed_arg_options["backend"].as<std::string>());
|
||||
config.logCallback = &aurora_log_callback;
|
||||
config.logLevel = (AuroraLogLevel)parsed_arg_options["log-level"].as<uint8_t>();
|
||||
|
||||
Reference in New Issue
Block a user