mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-02 09:03:37 +00:00
Added gfx_force_43
to switch the aspect ratio to 4:3 on the fly.
I had to add a new method `forceResizeWindow` for this. Also added NO_LOAD_PROGRESS_DISPLAY.
This commit is contained in:
parent
88f7de3e2b
commit
f42ee1e7f8
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
void displayLoadProgress(const wchar_t *format, ...)
|
void displayLoadProgress(const wchar_t *format, ...)
|
||||||
{
|
{
|
||||||
|
#ifndef NO_LOAD_PROGRESS_DISPLAY
|
||||||
va_list args;
|
va_list args;
|
||||||
wchar_t wbuf[INFO_BUF];
|
wchar_t wbuf[INFO_BUF];
|
||||||
char buf[INFO_BUF];
|
char buf[INFO_BUF];
|
||||||
|
@ -46,4 +47,5 @@ void displayLoadProgress(const wchar_t *format, ...)
|
||||||
|
|
||||||
if (pBuffer != nullptr)
|
if (pBuffer != nullptr)
|
||||||
gfxContext.bindFramebuffer(graphics::bufferTarget::DRAW_FRAMEBUFFER, pBuffer->m_FBO);
|
gfxContext.bindFramebuffer(graphics::bufferTarget::DRAW_FRAMEBUFFER, pBuffer->m_FBO);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ public:
|
||||||
bool isFullscreen() const { return m_bFullscreen; }
|
bool isFullscreen() const { return m_bFullscreen; }
|
||||||
bool isAdjustScreen() const { return m_bAdjustScreen; }
|
bool isAdjustScreen() const { return m_bAdjustScreen; }
|
||||||
bool isResizeWindow() const { return m_bResizeWindow; }
|
bool isResizeWindow() const { return m_bResizeWindow; }
|
||||||
|
void forceResizeWindow() { _resizeWindow(); }
|
||||||
|
|
||||||
GraphicsDrawer & getDrawer() { return m_drawer; }
|
GraphicsDrawer & getDrawer() { return m_drawer; }
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
#define START_WIDTH 1280
|
#define START_WIDTH 1280
|
||||||
#define START_HEIGHT 720
|
#define START_HEIGHT 720
|
||||||
|
|
||||||
static u64 g_width = START_WIDTH;
|
static u64 g_originalWidth = START_WIDTH;//Size set by the end-user
|
||||||
|
static u64 g_width = START_WIDTH;//Current size
|
||||||
static u64 g_height = START_HEIGHT;
|
static u64 g_height = START_HEIGHT;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -92,8 +93,10 @@ N64Regs::~N64Regs() {
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
//Called when the end-user changes the window size
|
||||||
void gfx_resize(long width, long height)
|
void gfx_resize(long width, long height)
|
||||||
{
|
{
|
||||||
|
g_originalWidth = width;
|
||||||
g_width = width;
|
g_width = width;
|
||||||
g_height = height;
|
g_height = height;
|
||||||
config.video.windowedWidth = g_width;
|
config.video.windowedWidth = g_width;
|
||||||
|
@ -133,6 +136,23 @@ extern "C" {
|
||||||
api().RomOpen(romName);
|
api().RomOpen(romName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gfx_force_43(bool enable) {
|
||||||
|
const u32 newAspectRatio = enable ? 1 : 3;
|
||||||
|
|
||||||
|
if (config.frameBufferEmulation.aspect == newAspectRatio)
|
||||||
|
return;//Already set
|
||||||
|
|
||||||
|
config.frameBufferEmulation.aspect = enable ? 1 : 3;
|
||||||
|
dwnd().forceResizeWindow();//Inform GLideN64 about the change
|
||||||
|
|
||||||
|
//Calculate new width
|
||||||
|
auto newWidth = g_originalWidth;
|
||||||
|
if (enable)
|
||||||
|
newWidth = (g_height * 4) / 3;
|
||||||
|
|
||||||
|
g_width = newWidth;
|
||||||
|
}
|
||||||
|
|
||||||
void gfx_shutdown() {
|
void gfx_shutdown() {
|
||||||
RDRAMSize = 0;
|
RDRAMSize = 0;
|
||||||
api().RomClosed();
|
api().RomClosed();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user