From 352f93c0662516f4a9170e1e46912c95118f46a7 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 3 Jun 2018 17:46:23 +0300 Subject: [PATCH] - deleted now useless code from Cocoa backend Let's rely on cross-platform code to manage window dimensions and screen resolution --- src/posix/cocoa/i_common.h | 16 ---------------- src/posix/cocoa/i_video.mm | 27 --------------------------- 2 files changed, 43 deletions(-) diff --git a/src/posix/cocoa/i_common.h b/src/posix/cocoa/i_common.h index be395cf76..f60d82ced 100644 --- a/src/posix/cocoa/i_common.h +++ b/src/posix/cocoa/i_common.h @@ -37,22 +37,6 @@ #import -struct RenderBufferOptions -{ - float pixelScale; - - float shiftX; - float shiftY; - - float width; - float height; - - bool dirty; -}; - -extern RenderBufferOptions rbOpts; - - // Version of AppKit framework we are interested in // The following values are needed to build with earlier SDKs diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 5104a043c..8593f86e7 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -115,9 +115,6 @@ CUSTOM_CVAR(Bool, vid_autoswitch, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_ EXTERN_CVAR(Bool, gl_smooth_rendered) -RenderBufferOptions rbOpts; - - // --------------------------------------------------------------------------- @@ -544,20 +541,6 @@ void CocoaVideo::SetFullscreenMode(const int width, const int height) ? [screen convertRectToBacking:screenFrame] : screenFrame; - const float displayWidth = displayRect.size.width; - const float displayHeight = displayRect.size.height; - - const float pixelScaleFactorX = displayWidth / static_cast(width ); - const float pixelScaleFactorY = displayHeight / static_cast(height); - - rbOpts.pixelScale = MIN(pixelScaleFactorX, pixelScaleFactorY); - - rbOpts.width = width * rbOpts.pixelScale; - rbOpts.height = height * rbOpts.pixelScale; - - rbOpts.shiftX = (displayWidth - rbOpts.width ) / 2.0f; - rbOpts.shiftY = (displayHeight - rbOpts.height) / 2.0f; - if (!m_fullscreen) { [m_window setLevel:LEVEL_FULLSCREEN]; @@ -571,14 +554,6 @@ void CocoaVideo::SetFullscreenMode(const int width, const int height) void CocoaVideo::SetWindowedMode(const int width, const int height) { - rbOpts.pixelScale = 1.0f; - - rbOpts.width = static_cast(width ); - rbOpts.height = static_cast(height); - - rbOpts.shiftX = 0.0f; - rbOpts.shiftY = 0.0f; - const NSSize windowPixelSize = NSMakeSize(width, height); const NSSize windowSize = vid_hidpi ? [[m_window contentView] convertSizeFromBacking:windowPixelSize] @@ -621,8 +596,6 @@ void CocoaVideo::SetMode(const int width, const int height, const bool fullscree SetWindowedMode(width, height); } - rbOpts.dirty = true; - const NSSize viewSize = I_GetContentViewSize(m_window); glViewport(0, 0, static_cast(viewSize.width), static_cast(viewSize.height));