diff --git a/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp b/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp index 733b7fdf1..9981ced45 100644 --- a/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp +++ b/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp @@ -5584,7 +5584,7 @@ bool OGLImage::CanUseShaderBasedFilters() return this->_canUseShaderBasedFilters; } -void OGLImage::GetNormalSize(double &w, double &h) +void OGLImage::GetNormalSize(double &w, double &h) const { w = this->_normalWidth; h = this->_normalHeight; @@ -6736,16 +6736,14 @@ OGLDisplayLayer::OGLDisplayLayer(OGLVideoOutput *oglVO) _needUpdateVertices = true; _useDeposterize = false; - _displayWidth = GPU_DISPLAY_WIDTH; - _displayHeight = GPU_DISPLAY_HEIGHT; - _displayMode = DS_DISPLAY_TYPE_DUAL; - _displayOrder = DS_DISPLAY_ORDER_MAIN_FIRST; - _displayOrientation = DS_DISPLAY_ORIENTATION_VERTICAL; + _displayMode = ClientDisplayMode_Dual; + _displayOrder = ClientDisplayOrder_MainFirst; + _displayOrientation = ClientDisplayLayout_Vertical; _gapScalar = 0.0f; _rotation = 0.0f; - _normalWidth = _displayWidth; - _normalHeight = _displayHeight*2.0 + ((_displayHeight * DS_DISPLAY_VERTICAL_GAP_TO_HEIGHT_RATIO) * _gapScalar); + _normalWidth = GPU_DISPLAY_WIDTH; + _normalHeight = GPU_DISPLAY_HEIGHT*2.0 + (DS_DISPLAY_UNSCALED_GAP*_gapScalar); _vf[0] = new VideoFilter(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT, VideoFilterTypeID_None, 0); _vf[1] = new VideoFilter(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT, VideoFilterTypeID_None, 0); @@ -6832,9 +6830,9 @@ OGLDisplayLayer::OGLDisplayLayer(OGLVideoOutput *oglVO) glGenBuffersARB(1, &_vboTexCoordID); glBindBufferARB(GL_ARRAY_BUFFER_ARB, _vboVertexID); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(GLint) * (2 * 8), NULL, GL_STATIC_DRAW_ARB); + glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(GLfloat) * (4 * 8), NULL, GL_STATIC_DRAW_ARB); glBindBufferARB(GL_ARRAY_BUFFER_ARB, _vboTexCoordID); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(GLfloat) * (2 * 8), NULL, GL_STREAM_DRAW_ARB); + glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(GLfloat) * (4 * 8), NULL, GL_STREAM_DRAW_ARB); glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); // Set up VAO @@ -6844,7 +6842,7 @@ OGLDisplayLayer::OGLDisplayLayer(OGLVideoOutput *oglVO) if (this->_output->GetInfo()->IsShaderSupported()) { glBindBufferARB(GL_ARRAY_BUFFER_ARB, _vboVertexID); - glVertexAttribPointer(OGLVertexAttributeID_Position, 2, GL_INT, GL_FALSE, 0, 0); + glVertexAttribPointer(OGLVertexAttributeID_Position, 2, GL_FLOAT, GL_FALSE, 0, 0); glBindBufferARB(GL_ARRAY_BUFFER_ARB, _vboTexCoordID); glVertexAttribPointer(OGLVertexAttributeID_TexCoord0, 2, GL_FLOAT, GL_FALSE, 0, 0); @@ -6854,7 +6852,7 @@ OGLDisplayLayer::OGLDisplayLayer(OGLVideoOutput *oglVO) else { glBindBufferARB(GL_ARRAY_BUFFER_ARB, _vboVertexID); - glVertexPointer(2, GL_INT, 0, 0); + glVertexPointer(2, GL_FLOAT, 0, 0); glBindBufferARB(GL_ARRAY_BUFFER_ARB, _vboTexCoordID); glTexCoordPointer(2, GL_FLOAT, 0, 0); @@ -7118,66 +7116,48 @@ void OGLDisplayLayer::SetFiltersPreferGPUOGL(bool preferGPU) glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0); } -uint16_t OGLDisplayLayer::GetDisplayWidth() -{ - return this->_displayWidth; -} - -uint16_t OGLDisplayLayer::GetDisplayHeight() -{ - return this->_displayHeight; -} - -void OGLDisplayLayer::SetDisplaySize(uint16_t w, uint16_t h) -{ - this->_displayWidth = w; - this->_displayHeight = h; - this->GetNormalSize(this->_normalWidth, this->_normalHeight); - this->_needUpdateVertices = true; -} - -int OGLDisplayLayer::GetMode() +ClientDisplayMode OGLDisplayLayer::GetMode() const { return this->_displayMode; } -void OGLDisplayLayer::SetMode(int dispMode) +void OGLDisplayLayer::SetMode(const ClientDisplayMode dispMode) { this->_displayMode = dispMode; - this->GetNormalSize(this->_normalWidth, this->_normalHeight); + OGLDisplayLayer::CalculateNormalSize(this->_displayMode, this->_displayOrientation, this->_gapScalar, this->_normalWidth, this->_normalHeight); this->_needUpdateVertices = true; } -int OGLDisplayLayer::GetOrientation() +ClientDisplayLayout OGLDisplayLayer::GetOrientation() const { return this->_displayOrientation; } -void OGLDisplayLayer::SetOrientation(int dispOrientation) +void OGLDisplayLayer::SetOrientation(ClientDisplayLayout dispOrientation) { this->_displayOrientation = dispOrientation; - this->GetNormalSize(this->_normalWidth, this->_normalHeight); + OGLDisplayLayer::CalculateNormalSize(this->_displayMode, this->_displayOrientation, this->_gapScalar, this->_normalWidth, this->_normalHeight); this->_needUpdateVertices = true; } -GLfloat OGLDisplayLayer::GetGapScalar() +double OGLDisplayLayer::GetGapScalar() const { return this->_gapScalar; } -void OGLDisplayLayer::SetGapScalar(GLfloat theScalar) +void OGLDisplayLayer::SetGapScalar(double theScalar) { this->_gapScalar = theScalar; - this->GetNormalSize(this->_normalWidth, this->_normalHeight); + OGLDisplayLayer::CalculateNormalSize(this->_displayMode, this->_displayOrientation, this->_gapScalar, this->_normalWidth, this->_normalHeight); this->_needUpdateVertices = true; } -GLfloat OGLDisplayLayer::GetRotation() +double OGLDisplayLayer::GetRotation() const { return this->_rotation; } -void OGLDisplayLayer::SetRotation(GLfloat theRotation) +void OGLDisplayLayer::SetRotation(double theRotation) { this->_rotation = theRotation; } @@ -7192,12 +7172,12 @@ void OGLDisplayLayer::SetSourceDeposterize(bool useDeposterize) this->_useDeposterize = (this->_canUseShaderBasedFilters) ? useDeposterize : false; } -int OGLDisplayLayer::GetOrder() +ClientDisplayOrder OGLDisplayLayer::GetOrder() const { return this->_displayOrder; } -void OGLDisplayLayer::SetOrder(int dispOrder) +void OGLDisplayLayer::SetOrder(ClientDisplayOrder dispOrder) { this->_displayOrder = dispOrder; this->_needUpdateVertices = true; @@ -7205,50 +7185,129 @@ void OGLDisplayLayer::SetOrder(int dispOrder) void OGLDisplayLayer::UpdateVerticesOGL() { - const size_t f = (this->_displayOrder == DS_DISPLAY_ORDER_MAIN_FIRST) ? 0 : 8; - const GLfloat w = this->_displayWidth; - const GLfloat h = this->_displayHeight; - const GLfloat gap = (h * DS_DISPLAY_VERTICAL_GAP_TO_HEIGHT_RATIO) * this->_gapScalar / 2.0; + const GLfloat w = this->_normalWidth / 2.0f; + const GLfloat h = this->_normalHeight / 2.0f; + const size_t f = (this->_displayOrder == ClientDisplayOrder_MainFirst) ? 0 : 8; glBindBufferARB(GL_ARRAY_BUFFER_ARB, this->_vboVertexID); - GLint *vtxBufferPtr = (GLint *)glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + GLfloat *vtxBufferPtr = (GLfloat *)glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); - if (this->_displayMode == DS_DISPLAY_TYPE_DUAL) + if (this->_displayMode == ClientDisplayMode_Dual) { - // displayOrder == DS_DISPLAY_ORDER_MAIN_FIRST - if (this->_displayOrientation == DS_DISPLAY_ORIENTATION_VERTICAL) + switch (this->_displayOrientation) { - vtxBufferPtr[0+f] = -w/2; vtxBufferPtr[1+f] = h+gap; // Top display, top left - vtxBufferPtr[2+f] = w/2; vtxBufferPtr[3+f] = h+gap; // Top display, top right - vtxBufferPtr[4+f] = -w/2; vtxBufferPtr[5+f] = gap; // Top display, bottom left - vtxBufferPtr[6+f] = w/2; vtxBufferPtr[7+f] = gap; // Top display, bottom right - - vtxBufferPtr[8-f] = -w/2; vtxBufferPtr[9-f] = -gap; // Bottom display, top left - vtxBufferPtr[10-f] = w/2; vtxBufferPtr[11-f] = -gap; // Bottom display, top right - vtxBufferPtr[12-f] = -w/2; vtxBufferPtr[13-f] = -(h+gap); // Bottom display, bottom left - vtxBufferPtr[14-f] = w/2; vtxBufferPtr[15-f] = -(h+gap); // Bottom display, bottom right - } - else // displayOrientationID == DS_DISPLAY_ORIENTATION_HORIZONTAL - { - vtxBufferPtr[0+f] = -(w+gap); vtxBufferPtr[1+f] = h/2; // Left display, top left - vtxBufferPtr[2+f] = -gap; vtxBufferPtr[3+f] = h/2; // Left display, top right - vtxBufferPtr[4+f] = -(w+gap); vtxBufferPtr[5+f] = -h/2; // Left display, bottom left - vtxBufferPtr[6+f] = -gap; vtxBufferPtr[7+f] = -h/2; // Left display, bottom right - - vtxBufferPtr[8-f] = gap; vtxBufferPtr[9-f] = h/2; // Right display, top left - vtxBufferPtr[10-f] = w+gap; vtxBufferPtr[11-f] = h/2; // Right display, top right - vtxBufferPtr[12-f] = gap; vtxBufferPtr[13-f] = -h/2; // Right display, bottom left - vtxBufferPtr[14-f] = w+gap; vtxBufferPtr[15-f] = -h/2; // Right display, bottom right + case ClientDisplayLayout_Horizontal: + { + vtxBufferPtr[0+f] = -w; vtxBufferPtr[1+f] = h; // Left display, top left + vtxBufferPtr[2+f] = 0.0f; vtxBufferPtr[3+f] = h; // Left display, top right + vtxBufferPtr[4+f] = -w; vtxBufferPtr[5+f] = -h; // Left display, bottom left + vtxBufferPtr[6+f] = 0.0f; vtxBufferPtr[7+f] = -h; // Left display, bottom right + + vtxBufferPtr[8-f] = 0.0f; vtxBufferPtr[9-f] = h; // Right display, top left + vtxBufferPtr[10-f] = w; vtxBufferPtr[11-f] = h; // Right display, top right + vtxBufferPtr[12-f] = 0.0f; vtxBufferPtr[13-f] = -h; // Right display, bottom left + vtxBufferPtr[14-f] = w; vtxBufferPtr[15-f] = -h; // Right display, bottom right + + memcpy(vtxBufferPtr + (2 * 8), vtxBufferPtr + (0 * 8), sizeof(GLfloat) * (2 * 8)); // Unused displays + break; + } + + case ClientDisplayLayout_Hybrid_3_2: + { + vtxBufferPtr[0] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[1] = -h + (96.0f * 2.0f); // Minor top display, top left + vtxBufferPtr[2] = w; vtxBufferPtr[3] = -h + (96.0f * 2.0f); // Minor top display, top right + vtxBufferPtr[4] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[5] = -h + 96.0f; // Minor top display, bottom left + vtxBufferPtr[6] = w; vtxBufferPtr[7] = -h + 96.0f; // Minor top display, bottom right + + vtxBufferPtr[8] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[9] = -h + 96.0f; // Minor bottom display, top left + vtxBufferPtr[10] = w; vtxBufferPtr[11] = -h + 96.0f; // Minor bottom display, top right + vtxBufferPtr[12] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[13] = -h; // Minor bottom display, bottom left + vtxBufferPtr[14] = w; vtxBufferPtr[15] = -h; // Minor bottom display, bottom right + + vtxBufferPtr[16] = -w; vtxBufferPtr[17] = h; // Major display, top left + vtxBufferPtr[18] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[19] = h; // Major display, top right + vtxBufferPtr[20] = -w; vtxBufferPtr[21] = -h; // Major display, bottom left + vtxBufferPtr[22] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[23] = -h; // Major display, bottom right + + memcpy(vtxBufferPtr + (3 * 8), vtxBufferPtr + (2 * 8), sizeof(GLfloat) * (1 * 8)); // Major display (bottom screen) + break; + } + + case ClientDisplayLayout_Hybrid_16_9: + { + const GLfloat g = (GLfloat)DS_DISPLAY_UNSCALED_GAP * this->_gapScalar * (this->_normalWidth - (GLfloat)GPU_DISPLAY_WIDTH) / (GLfloat)GPU_DISPLAY_WIDTH; + + vtxBufferPtr[0] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[1] = -h + g + (64.0f * 2.0f); // Minor top display, top left + vtxBufferPtr[2] = w; vtxBufferPtr[3] = -h + g + (64.0f * 2.0f); // Minor top display, top right + vtxBufferPtr[4] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[5] = -h + g + 64.0f; // Minor top display, bottom left + vtxBufferPtr[6] = w; vtxBufferPtr[7] = -h + g + 64.0f; // Minor top display, bottom right + + vtxBufferPtr[8] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[9] = -h + 64.0f; // Minor bottom display, top left + vtxBufferPtr[10] = w; vtxBufferPtr[11] = -h + 64.0f; // Minor bottom display, top right + vtxBufferPtr[12] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[13] = -h; // Minor bottom display, bottom left + vtxBufferPtr[14] = w; vtxBufferPtr[15] = -h; // Minor bottom display, bottom right + + vtxBufferPtr[16] = -w; vtxBufferPtr[17] = h; // Major display, top left + vtxBufferPtr[18] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[19] = h; // Major display, top right + vtxBufferPtr[20] = -w; vtxBufferPtr[21] = -h; // Major display, bottom left + vtxBufferPtr[22] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[23] = -h; // Major display, bottom right + + memcpy(vtxBufferPtr + (3 * 8), vtxBufferPtr + (2 * 8), sizeof(GLfloat) * (1 * 8)); // Major display (bottom screen) + break; + } + + case ClientDisplayLayout_Hybrid_16_10: + { + const GLfloat g = (GLfloat)DS_DISPLAY_UNSCALED_GAP * this->_gapScalar * (this->_normalWidth - (GLfloat)GPU_DISPLAY_WIDTH) / (GLfloat)GPU_DISPLAY_WIDTH; + + vtxBufferPtr[0] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[1] = -h + g + (38.4f * 2.0f); // Minor top display, top left + vtxBufferPtr[2] = w; vtxBufferPtr[3] = -h + g + (38.4f * 2.0f); // Minor top display, top right + vtxBufferPtr[4] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[5] = -h + g + 38.4f; // Minor top display, bottom left + vtxBufferPtr[6] = w; vtxBufferPtr[7] = -h + g + 38.4f; // Minor top display, bottom right + + vtxBufferPtr[8] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[9] = -h + 38.4f; // Minor bottom display, top left + vtxBufferPtr[10] = w; vtxBufferPtr[11] = -h + 38.4f; // Minor bottom display, top right + vtxBufferPtr[12] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[13] = -h; // Minor bottom display, bottom left + vtxBufferPtr[14] = w; vtxBufferPtr[15] = -h; // Minor bottom display, bottom right + + vtxBufferPtr[16] = -w; vtxBufferPtr[17] = h; // Major display, top left + vtxBufferPtr[18] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[19] = h; // Major display, top right + vtxBufferPtr[20] = -w; vtxBufferPtr[21] = -h; // Major display, bottom left + vtxBufferPtr[22] = -w + (GLfloat)GPU_DISPLAY_WIDTH; vtxBufferPtr[23] = -h; // Major display, bottom right + + memcpy(vtxBufferPtr + (3 * 8), vtxBufferPtr + (2 * 8), sizeof(GLfloat) * (1 * 8)); // Major display (bottom screen) + break; + } + + default: // Default to vertical orientation. + { + const GLfloat g = (GLfloat)DS_DISPLAY_UNSCALED_GAP * this->_gapScalar; + + vtxBufferPtr[0+f] = -w; vtxBufferPtr[1+f] = h; // Top display, top left + vtxBufferPtr[2+f] = w; vtxBufferPtr[3+f] = h; // Top display, top right + vtxBufferPtr[4+f] = -w; vtxBufferPtr[5+f] = g/2.0f; // Top display, bottom left + vtxBufferPtr[6+f] = w; vtxBufferPtr[7+f] = g/2.0f; // Top display, bottom right + + vtxBufferPtr[8-f] = -w; vtxBufferPtr[9-f] = -g/2.0f; // Bottom display, top left + vtxBufferPtr[10-f] = w; vtxBufferPtr[11-f] = -g/2.0f; // Bottom display, top right + vtxBufferPtr[12-f] = -w; vtxBufferPtr[13-f] = -h; // Bottom display, bottom left + vtxBufferPtr[14-f] = w; vtxBufferPtr[15-f] = -h; // Bottom display, bottom right + + memcpy(vtxBufferPtr + (2 * 8), vtxBufferPtr + (0 * 8), sizeof(GLfloat) * (2 * 8)); // Unused displays + break; + } } } - else // displayModeID == DS_DISPLAY_TYPE_MAIN || displayModeID == DS_DISPLAY_TYPE_TOUCH + else // displayModeID == ClientDisplayMode_Main || displayModeID == ClientDisplayMode_Touch { - vtxBufferPtr[0] = -w/2; vtxBufferPtr[1] = h/2; // First display, top left - vtxBufferPtr[2] = w/2; vtxBufferPtr[3] = h/2; // First display, top right - vtxBufferPtr[4] = -w/2; vtxBufferPtr[5] = -h/2; // First display, bottom left - vtxBufferPtr[6] = w/2; vtxBufferPtr[7] = -h/2; // First display, bottom right + vtxBufferPtr[0] = -w; vtxBufferPtr[1] = h; // First display, top left + vtxBufferPtr[2] = w; vtxBufferPtr[3] = h; // First display, top right + vtxBufferPtr[4] = -w; vtxBufferPtr[5] = -h; // First display, bottom left + vtxBufferPtr[6] = w; vtxBufferPtr[7] = -h; // First display, bottom right - memcpy(vtxBufferPtr + (1 * 8), vtxBufferPtr + (0 * 8), sizeof(GLint) * (1 * 8)); // Second display + memcpy(vtxBufferPtr + (1 * 8), vtxBufferPtr + (0 * 8), sizeof(GLfloat) * (1 * 8)); // Second display + memcpy(vtxBufferPtr + (2 * 8), vtxBufferPtr + (0 * 8), sizeof(GLfloat) * (1 * 8)); // Unused display + memcpy(vtxBufferPtr + (3 * 8), vtxBufferPtr + (0 * 8), sizeof(GLfloat) * (1 * 8)); // Unused display } glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); @@ -7262,23 +7321,10 @@ bool OGLDisplayLayer::CanUseShaderBasedFilters() return this->_canUseShaderBasedFilters; } -void OGLDisplayLayer::GetNormalSize(double &w, double &h) +void OGLDisplayLayer::GetNormalSize(double &outWidth, double &outHeight) const { - if (this->_displayMode != DS_DISPLAY_TYPE_DUAL) - { - w = this->_displayWidth; - h = this->_displayHeight; - } - else if (this->_displayOrientation == DS_DISPLAY_ORIENTATION_VERTICAL) - { - w = this->_displayWidth; - h = this->_displayHeight * 2.0 + ((this->_displayHeight * DS_DISPLAY_VERTICAL_GAP_TO_HEIGHT_RATIO) * this->_gapScalar); - } - else - { - w = this->_displayWidth * 2.0 + ((this->_displayHeight * DS_DISPLAY_VERTICAL_GAP_TO_HEIGHT_RATIO) * this->_gapScalar); - h = this->_displayHeight; - } + outWidth = this->_normalWidth; + outHeight = this->_normalHeight; } void OGLDisplayLayer::ResizeCPUPixelScalerOGL(const size_t srcWidthMain, const size_t srcHeightMain, const size_t srcWidthTouch, const size_t srcHeightTouch, const size_t scaleMultiply, const size_t scaleDivide) @@ -7350,6 +7396,7 @@ void OGLDisplayLayer::UploadTransformationOGL() } glViewport(0, 0, this->_viewportWidth, this->_viewportHeight); + this->_needUpdateVertices = true; } int OGLDisplayLayer::GetOutputFilter() @@ -7750,8 +7797,8 @@ void OGLDisplayLayer::SetCPUPixelScalerOGL(const VideoFilterTypeID filterID) void OGLDisplayLayer::LoadFrameOGL(bool isMainSizeNative, bool isTouchSizeNative) { const bool isUsingCPUPixelScaler = (this->_pixelScaler != VideoFilterTypeID_None) && !this->_useShaderBasedPixelScaler; - const bool loadMainScreen = (this->_displayMode == DS_DISPLAY_TYPE_MAIN) || (this->_displayMode == DS_DISPLAY_TYPE_DUAL); - const bool loadTouchScreen = (this->_displayMode == DS_DISPLAY_TYPE_TOUCH) || (this->_displayMode == DS_DISPLAY_TYPE_DUAL); + const bool loadMainScreen = (this->_displayMode == ClientDisplayMode_Main) || (this->_displayMode == ClientDisplayMode_Dual); + const bool loadTouchScreen = (this->_displayMode == ClientDisplayMode_Touch) || (this->_displayMode == ClientDisplayMode_Dual); this->_isTexVideoInputDataNative[0] = isMainSizeNative; this->_isTexVideoInputDataNative[1] = isTouchSizeNative; @@ -7860,7 +7907,7 @@ void OGLDisplayLayer::ProcessOGL() GLfloat w1 = this->_texLoadedWidth[1]; GLfloat h1 = this->_texLoadedHeight[1]; - if (this->_isTexVideoInputDataNative[0] && (displayMode == DS_DISPLAY_TYPE_MAIN || displayMode == DS_DISPLAY_TYPE_DUAL)) + if (this->_isTexVideoInputDataNative[0] && (displayMode == ClientDisplayMode_Main || displayMode == ClientDisplayMode_Dual)) { if (this->_useDeposterize) { @@ -7873,7 +7920,7 @@ void OGLDisplayLayer::ProcessOGL() if (isUsingCPUPixelScaler) // Hybrid CPU/GPU-based path (may cause a performance hit on pixel download) { - if ( this->_isTexVideoInputDataNative[0] && ((displayMode == DS_DISPLAY_TYPE_MAIN) || (displayMode == DS_DISPLAY_TYPE_DUAL)) ) + if ( this->_isTexVideoInputDataNative[0] && ((displayMode == ClientDisplayMode_Main) || (displayMode == ClientDisplayMode_Dual)) ) { this->_filterDeposterize[0]->DownloadDstBufferOGL(this->_vf[0]->GetSrcBufferPtr(), 0, this->_filterDeposterize[0]->GetSrcHeight()); } @@ -7905,7 +7952,7 @@ void OGLDisplayLayer::ProcessOGL() } } - if (this->_isTexVideoInputDataNative[1] && (displayMode == DS_DISPLAY_TYPE_TOUCH || displayMode == DS_DISPLAY_TYPE_DUAL)) + if (this->_isTexVideoInputDataNative[1] && (displayMode == ClientDisplayMode_Touch || displayMode == ClientDisplayMode_Dual)) { if (this->_useDeposterize) { @@ -7915,7 +7962,7 @@ void OGLDisplayLayer::ProcessOGL() if (isUsingCPUPixelScaler) // Hybrid CPU/GPU-based path (may cause a performance hit on pixel download) { - if ( this->_isTexVideoInputDataNative[1] && ((displayMode == DS_DISPLAY_TYPE_TOUCH) || (displayMode == DS_DISPLAY_TYPE_DUAL)) ) + if ( this->_isTexVideoInputDataNative[1] && ((displayMode == ClientDisplayMode_Touch) || (displayMode == ClientDisplayMode_Dual)) ) { this->_filterDeposterize[1]->DownloadDstBufferOGL(this->_vf[1]->GetSrcBufferPtr(), 0, this->_filterDeposterize[1]->GetSrcHeight()); } @@ -7953,7 +8000,7 @@ void OGLDisplayLayer::ProcessOGL() // Update the texture coordinates glBindBufferARB(GL_ARRAY_BUFFER_ARB, this->_vboTexCoordID); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, (2 * 8) * sizeof(GLfloat), NULL, GL_STREAM_DRAW_ARB); + glBufferDataARB(GL_ARRAY_BUFFER_ARB, (4 * 8) * sizeof(GLfloat), NULL, GL_STREAM_DRAW_ARB); GLfloat *texCoordBufferPtr = (GLfloat *)glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); texCoordBufferPtr[0] = 0.0f; texCoordBufferPtr[1] = 0.0f; @@ -7966,6 +8013,8 @@ void OGLDisplayLayer::ProcessOGL() texCoordBufferPtr[12] = 0.0f; texCoordBufferPtr[13] = h1; texCoordBufferPtr[14] = w1; texCoordBufferPtr[15] = h1; + memcpy(texCoordBufferPtr + (2 * 8), texCoordBufferPtr + (0 * 8), sizeof(GLfloat) * (2 * 8)); + glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); @@ -7985,23 +8034,42 @@ void OGLDisplayLayer::RenderOGL() // Enable vertex attributes glBindVertexArrayDESMUME(this->_vaoMainStatesID); - switch (this->GetMode()) + switch (this->_displayMode) { - case DS_DISPLAY_TYPE_MAIN: + case ClientDisplayMode_Main: glBindTexture(GL_TEXTURE_RECTANGLE_ARB, this->_texVideoOutputID[0]); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[0]); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, this->_displayTexFilter[0]); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); break; - case DS_DISPLAY_TYPE_TOUCH: + case ClientDisplayMode_Touch: glBindTexture(GL_TEXTURE_RECTANGLE_ARB, this->_texVideoOutputID[1]); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[1]); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, this->_displayTexFilter[1]); glDrawArrays(GL_TRIANGLE_STRIP, 4, 4); break; - case DS_DISPLAY_TYPE_DUAL: + case ClientDisplayMode_Dual: + { + const size_t majorDisplayTex = (this->_displayOrder == ClientDisplayOrder_MainFirst) ? 0 : 1; + const size_t majorDisplayVtx = (this->_displayOrder == ClientDisplayOrder_MainFirst) ? 8 : 12; + + switch (this->_displayOrientation) + { + case ClientDisplayLayout_Hybrid_3_2: + case ClientDisplayLayout_Hybrid_16_9: + case ClientDisplayLayout_Hybrid_16_10: + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, this->_texVideoOutputID[majorDisplayTex]); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[majorDisplayTex]); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, this->_displayTexFilter[majorDisplayTex]); + glDrawArrays(GL_TRIANGLE_STRIP, majorDisplayVtx, 4); + break; + + default: + break; + } + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, this->_texVideoOutputID[0]); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[0]); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, this->_displayTexFilter[0]); @@ -8011,7 +8079,7 @@ void OGLDisplayLayer::RenderOGL() glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[1]); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, this->_displayTexFilter[1]); glDrawArrays(GL_TRIANGLE_STRIP, 4, 4); - break; + } default: break; @@ -8029,3 +8097,42 @@ void OGLDisplayLayer::FinishOGL() glFinishObjectAPPLE(GL_TEXTURE_RECTANGLE_ARB, (isUsingCPUPixelScaler) ? this->_texCPUFilterDstID[0] : ( (this->_isTexVideoInputDataNative[0]) ? this->_texVideoInputDataNativeID[0] : this->_texVideoInputDataCustomID[0]) ); glFinishObjectAPPLE(GL_TEXTURE_RECTANGLE_ARB, (isUsingCPUPixelScaler) ? this->_texCPUFilterDstID[1] : ( (this->_isTexVideoInputDataNative[1]) ? this->_texVideoInputDataNativeID[1] : this->_texVideoInputDataCustomID[1]) ); } + +void OGLDisplayLayer::CalculateNormalSize(const ClientDisplayMode mode, const ClientDisplayLayout layout, const double gapScalar, double &outWidth, double &outHeight) +{ + if (mode == ClientDisplayMode_Dual) + { + switch (layout) + { + case ClientDisplayLayout_Horizontal: + outWidth = GPU_DISPLAY_WIDTH*2.0; + outHeight = GPU_DISPLAY_HEIGHT; + break; + + case ClientDisplayLayout_Hybrid_3_2: + outWidth = (float)GPU_DISPLAY_WIDTH + (128.0); + outHeight = GPU_DISPLAY_HEIGHT; + break; + + case ClientDisplayLayout_Hybrid_16_9: + outWidth = (float)GPU_DISPLAY_WIDTH + (64.0 * 4.0 / 3.0); + outHeight = GPU_DISPLAY_HEIGHT; + break; + + case ClientDisplayLayout_Hybrid_16_10: + outWidth = (float)GPU_DISPLAY_WIDTH + (51.2); + outHeight = GPU_DISPLAY_HEIGHT; + break; + + default: // Default to vertical orientation. + outWidth = GPU_DISPLAY_WIDTH; + outHeight = GPU_DISPLAY_HEIGHT*2.0 + (DS_DISPLAY_UNSCALED_GAP*gapScalar); + break; + } + } + else + { + outWidth = GPU_DISPLAY_WIDTH; + outHeight = GPU_DISPLAY_HEIGHT; + } +} diff --git a/desmume/src/frontend/cocoa/OGLDisplayOutput.h b/desmume/src/frontend/cocoa/OGLDisplayOutput.h index 7cafcba6c..c1dcf8577 100644 --- a/desmume/src/frontend/cocoa/OGLDisplayOutput.h +++ b/desmume/src/frontend/cocoa/OGLDisplayOutput.h @@ -43,7 +43,29 @@ class OGLVideoOutput; struct NDSFrameInfo; -enum +enum ClientDisplayMode +{ + ClientDisplayMode_Main = 0, + ClientDisplayMode_Touch, + ClientDisplayMode_Dual +}; + +enum ClientDisplayLayout +{ + ClientDisplayLayout_Vertical = 0, + ClientDisplayLayout_Horizontal = 1, + ClientDisplayLayout_Hybrid_3_2 = 1000, + ClientDisplayLayout_Hybrid_16_9 = 1001, + ClientDisplayLayout_Hybrid_16_10 = 1002 +}; + +enum ClientDisplayOrder +{ + ClientDisplayOrder_MainFirst = 0, + ClientDisplayOrder_TouchFirst +}; + +enum OutputFilterTypeID { OutputFilterTypeID_NearestNeighbor = 0, OutputFilterTypeID_Bilinear = 1, @@ -251,7 +273,7 @@ public: void SetSourceDeposterize(bool useDeposterize); bool CanUseShaderBasedFilters(); - void GetNormalSize(double &w, double &h); + void GetNormalSize(double &w, double &h) const; int GetOutputFilter(); virtual void SetOutputFilterOGL(const int filterID); @@ -411,15 +433,13 @@ protected: VideoFilter *_vf[2]; GLuint _texCPUFilterDstID[2]; - uint16_t _displayWidth; - uint16_t _displayHeight; - int _displayMode; - int _displayOrder; - int _displayOrientation; + ClientDisplayMode _displayMode; + ClientDisplayOrder _displayOrder; + ClientDisplayLayout _displayOrientation; double _normalWidth; double _normalHeight; - GLfloat _gapScalar; - GLfloat _rotation; + double _gapScalar; + double _rotation; GLuint _texLQ2xLUT; GLuint _texHQ2xLUT; @@ -457,24 +477,21 @@ public: bool GetFiltersPreferGPU(); void SetFiltersPreferGPUOGL(bool preferGPU); - uint16_t GetDisplayWidth(); - uint16_t GetDisplayHeight(); - void SetDisplaySize(uint16_t w, uint16_t h); - int GetMode(); - void SetMode(int dispMode); - int GetOrientation(); - void SetOrientation(int dispOrientation); - int GetOrder(); - void SetOrder(int dispOrder); - GLfloat GetGapScalar(); - void SetGapScalar(GLfloat theScalar); - GLfloat GetRotation(); - void SetRotation(GLfloat theRotation); + ClientDisplayMode GetMode() const; + void SetMode(ClientDisplayMode dispMode); + ClientDisplayLayout GetOrientation() const; + void SetOrientation(ClientDisplayLayout dispOrientation); + ClientDisplayOrder GetOrder() const; + void SetOrder(ClientDisplayOrder dispOrder); + double GetGapScalar() const; + void SetGapScalar(double theScalar); + double GetRotation() const; + void SetRotation(double theRotation); bool GetSourceDeposterize(); void SetSourceDeposterize(bool useDeposterize); bool CanUseShaderBasedFilters(); - void GetNormalSize(double &w, double &h); + void GetNormalSize(double &w, double &h) const; int GetOutputFilter(); virtual void SetOutputFilterOGL(const int filterID); @@ -487,6 +504,8 @@ public: virtual void ProcessOGL(); virtual void RenderOGL(); virtual void FinishOGL(); + + static void CalculateNormalSize(const ClientDisplayMode mode, const ClientDisplayLayout layout, const double gapScalar, double &outWidth, double &outHeight); }; class OGLVideoOutput diff --git a/desmume/src/frontend/cocoa/cocoa_globals.h b/desmume/src/frontend/cocoa/cocoa_globals.h index e5f566255..9d4f04574 100644 --- a/desmume/src/frontend/cocoa/cocoa_globals.h +++ b/desmume/src/frontend/cocoa/cocoa_globals.h @@ -445,34 +445,12 @@ enum MESSAGE_COPY_TO_PASTEBOARD }; -/* - DS DISPLAY TYPES - */ -enum -{ - DS_DISPLAY_TYPE_MAIN = 0, - DS_DISPLAY_TYPE_TOUCH, - DS_DISPLAY_TYPE_DUAL -}; - enum { VIDEO_SOURCE_INTERNAL = 0, VIDEO_SOURCE_EMULATOR = 1 }; -enum -{ - DS_DISPLAY_ORIENTATION_VERTICAL = 0, - DS_DISPLAY_ORIENTATION_HORIZONTAL -}; - -enum -{ - DS_DISPLAY_ORDER_MAIN_FIRST = 0, - DS_DISPLAY_ORDER_TOUCH_FIRST -}; - /* COCOA DS CORE STATES */ diff --git a/desmume/src/frontend/cocoa/cocoa_output.h b/desmume/src/frontend/cocoa/cocoa_output.h index 7ef2b4347..1bdd023ec 100644 --- a/desmume/src/frontend/cocoa/cocoa_output.h +++ b/desmume/src/frontend/cocoa/cocoa_output.h @@ -108,9 +108,6 @@ typedef struct - (void) doFinishFrame; - (void) doDisplayModeChanged:(NSInteger)displayModeID; -@optional -- (void) doDisplaySizeChanged:(NSSize)displaySize; - @end @protocol CocoaDSDisplayVideoDelegate @@ -149,8 +146,6 @@ typedef struct id delegate; NSSize displaySize; NSInteger displayMode; - size_t _gpuCurrentWidth; - size_t _gpuCurrentHeight; uint32_t _receivedFrameIndex; uint32_t _currentReceivedFrameIndex; diff --git a/desmume/src/frontend/cocoa/cocoa_output.mm b/desmume/src/frontend/cocoa/cocoa_output.mm index a1c0d9624..49bde44fc 100644 --- a/desmume/src/frontend/cocoa/cocoa_output.mm +++ b/desmume/src/frontend/cocoa/cocoa_output.mm @@ -32,6 +32,8 @@ #include "../../metaspu/metaspu.h" #include "../../rtc.h" +#include "OGLDisplayOutput.h" + #import #undef BOOL @@ -520,9 +522,7 @@ spinlockCPULoadAverage = OS_SPINLOCK_INIT; delegate = nil; - displayMode = DS_DISPLAY_TYPE_DUAL; - _gpuCurrentWidth = GPU_DISPLAY_WIDTH; - _gpuCurrentHeight = GPU_DISPLAY_HEIGHT; + displayMode = ClientDisplayMode_Dual; _receivedFrameIndex = 0; _currentReceivedFrameIndex = 0; @@ -547,7 +547,7 @@ - (NSSize) displaySize { pthread_rwlock_rdlock(self.rwlockProducer); - NSSize size = NSMakeSize((CGFloat)GPU->GetCustomFramebufferWidth(), (displayMode == DS_DISPLAY_TYPE_DUAL) ? (CGFloat)(GPU->GetCustomFramebufferHeight() * 2): (CGFloat)GPU->GetCustomFramebufferHeight()); + NSSize size = NSMakeSize((CGFloat)GPU->GetCustomFramebufferWidth(), (displayMode == ClientDisplayMode_Dual) ? (CGFloat)(GPU->GetCustomFramebufferHeight() * 2): (CGFloat)GPU->GetCustomFramebufferHeight()); pthread_rwlock_unlock(self.rwlockProducer); return size; @@ -559,15 +559,15 @@ switch (displayModeID) { - case DS_DISPLAY_TYPE_MAIN: + case ClientDisplayMode_Main: newDispString = NSSTRING_DISPLAYMODE_MAIN; break; - case DS_DISPLAY_TYPE_TOUCH: + case ClientDisplayMode_Touch: newDispString = NSSTRING_DISPLAYMODE_TOUCH; break; - case DS_DISPLAY_TYPE_DUAL: + case ClientDisplayMode_Dual: newDispString = NSSTRING_DISPLAYMODE_DUAL; break; @@ -726,7 +726,7 @@ const NSInteger dispMode = [self displayMode]; NSUInteger w = (NSUInteger)dispInfo.customWidth; - NSUInteger h = (dispMode == DS_DISPLAY_TYPE_DUAL) ? (NSUInteger)(dispInfo.customHeight * 2) : (NSUInteger)dispInfo.customHeight; + NSUInteger h = (dispMode == ClientDisplayMode_Dual) ? (NSUInteger)(dispInfo.customHeight * 2) : (NSUInteger)dispInfo.customHeight; NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:w @@ -895,20 +895,6 @@ pthread_rwlock_rdlock(self.rwlockProducer); const NDSDisplayInfo &dispInfo = GPU->GetDisplayInfo(); - const uint16_t newGpuWidth = dispInfo.customWidth; - const uint16_t newGpuHeight = dispInfo.customHeight; - - if (newGpuWidth != _gpuCurrentWidth || newGpuHeight != _gpuCurrentHeight) - { - if (delegate != nil && [delegate respondsToSelector:@selector(doDisplaySizeChanged:)]) - { - [(id)delegate doDisplaySizeChanged:NSMakeSize(newGpuWidth, newGpuHeight)]; - } - - _gpuCurrentWidth = newGpuWidth; - _gpuCurrentHeight = newGpuHeight; - } - const bool isMainSizeNative = !dispInfo.didPerformCustomRender[NDSDisplayID_Main]; const bool isTouchSizeNative = !dispInfo.didPerformCustomRender[NDSDisplayID_Touch]; diff --git a/desmume/src/frontend/cocoa/openemu/NDSGameCore.mm b/desmume/src/frontend/cocoa/openemu/NDSGameCore.mm index 5a0722fc1..570241ac0 100644 --- a/desmume/src/frontend/cocoa/openemu/NDSGameCore.mm +++ b/desmume/src/frontend/cocoa/openemu/NDSGameCore.mm @@ -114,7 +114,7 @@ volatile bool execute = true; SPU_SetVolume(100); // Set up the DS display - displayMode = DS_DISPLAY_TYPE_DUAL; + displayMode = ClientDisplayMode_Dual; displayRect = OEIntRectMake(0, 0, GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT * 2); displayAspectRatio = OEIntSizeMake(2, 3); @@ -153,17 +153,17 @@ volatile bool execute = true; switch (theMode) { - case DS_DISPLAY_TYPE_MAIN: + case ClientDisplayMode_Main: newDisplayRect = OEIntRectMake(0, 0, GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT); newDisplayAspectRatio = OEIntSizeMake(4, 3); break; - case DS_DISPLAY_TYPE_TOUCH: + case ClientDisplayMode_Touch: newDisplayRect = OEIntRectMake(0, GPU_DISPLAY_HEIGHT + 1, GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT); newDisplayAspectRatio = OEIntSizeMake(4, 3); break; - case DS_DISPLAY_TYPE_DUAL: + case ClientDisplayMode_Dual: newDisplayRect = OEIntRectMake(0, 0, GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT * 2); newDisplayAspectRatio = OEIntSizeMake(2, 3); break; @@ -312,16 +312,16 @@ volatile bool execute = true; { switch (displayMode) { - case DS_DISPLAY_TYPE_MAIN: - [self setDisplayMode:DS_DISPLAY_TYPE_TOUCH]; + case ClientDisplayMode_Main: + [self setDisplayMode:ClientDisplayMode_Touch]; break; - case DS_DISPLAY_TYPE_TOUCH: - [self setDisplayMode:DS_DISPLAY_TYPE_DUAL]; + case ClientDisplayMode_Touch: + [self setDisplayMode:ClientDisplayMode_Dual]; break; - case DS_DISPLAY_TYPE_DUAL: - [self setDisplayMode:DS_DISPLAY_TYPE_MAIN]; + case ClientDisplayMode_Dual: + [self setDisplayMode:ClientDisplayMode_Main]; break; default: @@ -386,15 +386,15 @@ volatile bool execute = true; switch (dispMode) { - case DS_DISPLAY_TYPE_MAIN: + case ClientDisplayMode_Main: isTouchPressed = NO; // Reject touch input if showing only the main screen. break; - case DS_DISPLAY_TYPE_TOUCH: + case ClientDisplayMode_Touch: isTouchPressed = YES; break; - case DS_DISPLAY_TYPE_DUAL: + case ClientDisplayMode_Dual: isTouchPressed = YES; aPoint.y -= GPU_DISPLAY_HEIGHT; // Normalize the y-coordinate to the DS. break; diff --git a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.strings b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.strings index 61fc35837..fef2b3dcd 100644 Binary files a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.strings and b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.strings differ diff --git a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib index 059ab2679..593ed96eb 100644 --- a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib +++ b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib @@ -1158,6 +1158,33 @@ 1 + + + Hybrid (3:2) + + 2147483647 + + + 1000 + + + + Hybrid (16:9) + + 2147483647 + + + 1001 + + + + Hybrid (16:10) + + 2147483647 + + + 1002 + @@ -4425,7 +4452,7 @@ L3d3dy5hZHZhbnNjZW5lLmNvbS9vZmZsaW5lL2RhdGFzL0FEVkFOc0NFbmVfUlRvb2xEUy56aXA - {{6, 218}, {431, 116}} + {{6, 238}, {431, 116}} @@ -4467,13 +4494,13 @@ L3d3dy5hZHZhbnNjZW5lLmNvbS9vZmZsaW5lL2RhdGFzL0FEVkFOc0NFbmVfUlRvb2xEUy56aXA 268 - {{18, 14}, {100, 38}} + {{18, 14}, {126, 98}} YES NO - 2 + 5 1 YES @@ -4599,8 +4626,47 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 400 75 + + 67108864 + 0 + Hybrid (3:2) + + + 1000 + 1211912448 + 0 + + 400 + 75 + + + 67108864 + 0 + Hybrid (16:9) + + + 1001 + 1211912448 + 0 + + 400 + 75 + + + 67108864 + 0 + Hybrid (16:10) + + + 1002 + 1211912448 + 0 + + 400 + 75 + - {100, 18} + {126, 18} {4, 2} 1151868928 NSActionCell @@ -4715,13 +4781,13 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{1, 1}, {194, 62}} + {{1, 1}, {194, 122}} - {{15, 53}, {196, 78}} + {{15, 53}, {196, 138}} @@ -5005,7 +5071,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{218, 53}, {196, 78}} + {{218, 113}, {196, 78}} @@ -5257,13 +5323,13 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 1 - {{1, 1}, {429, 141}} + {{1, 1}, {429, 201}} - {{6, 57}, {431, 157}} + {{6, 17}, {431, 217}} @@ -6109,7 +6175,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NSView - + 268 YES @@ -6118,7 +6184,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{163, 329}, {220, 26}} - YES @@ -6178,7 +6243,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{17, 335}, {144, 17}} - YES @@ -6208,7 +6272,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 12}, {153, 18}} - YES @@ -6231,13 +6294,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {364, 38}} - {{17, 209}, {366, 54}} - {0, 0} @@ -6269,7 +6330,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{18, 15}, {180, 46}} - YES NO @@ -6518,7 +6578,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{145, 10}, {204, 26}} - YES -2076180416 @@ -6586,13 +6645,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {364, 71}} - {{17, 16}, {366, 87}} - {0, 0} @@ -6624,7 +6681,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{18, 14}, {328, 58}} - YES NO @@ -6884,13 +6940,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {364, 82}} - {{17, 107}, {366, 98}} - {0, 0} @@ -6922,7 +6976,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{40, 13}, {246, 21}} - YES @@ -6946,7 +6999,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{287, 17}, {62, 17}} - YES @@ -7047,7 +7099,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{18, 16}, {16, 16}} - YES @@ -7068,13 +7119,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {364, 44}} - {{17, 267}, {366, 60}} - {0, 0} @@ -7093,13 +7142,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {400, 373} - - NSView - + 268 YES @@ -7115,7 +7162,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{13, 10}, {528, 441}} - YES @@ -7140,7 +7186,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 32}, {198, 18}} - YES @@ -7165,7 +7210,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 12}, {217, 18}} - YES @@ -7188,13 +7232,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {494, 58}} - {{6, 301}, {496, 74}} - {0, 0} @@ -7226,7 +7268,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{18, 14}, {165, 38}} - YES NO @@ -7474,7 +7515,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{242, 15}, {73, 17}} - YES @@ -7494,7 +7534,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{320, 13}, {50, 22}} - YES @@ -7573,7 +7612,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{371, 10}, {19, 27}} - YES @@ -7592,13 +7630,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {494, 62}} - {{6, 219}, {496, 78}} - {0, 0} @@ -7630,7 +7666,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{337, 17}, {141, 18}} - _NS:9 YES @@ -7657,7 +7692,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 14}, {66, 17}} - _NS:526 {251, 750} @@ -7680,7 +7714,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{86, 12}, {176, 26}} - _NS:9 YES @@ -7706,7 +7739,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{266, 14}, {52, 17}} - _NS:526 {251, 750} @@ -7781,7 +7813,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{83, 36}, {26, 14}} - _NS:526 {251, 750} @@ -7804,7 +7835,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{161, 36}, {26, 14}} - _NS:526 {251, 750} @@ -7827,7 +7857,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{236, 36}, {31, 14}} - _NS:526 {251, 750} @@ -7848,14 +7877,12 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {494, 60}} - _NS:11 {{6, 139}, {496, 76}} - _NS:9 {0, 0} @@ -7888,7 +7915,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 12}, {462, 18}} - YES @@ -7911,13 +7937,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {494, 38}} - {{6, 81}, {496, 54}} - {0, 0} @@ -7949,7 +7973,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 32}, {146, 18}} - YES @@ -7974,7 +7997,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 12}, {118, 18}} - YES 67108864 @@ -7996,13 +8018,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {494, 58}} - {{6, 3}, {496, 74}} - {0, 0} @@ -8022,7 +8042,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{10, 33}, {508, 395}} - General Settings @@ -9369,8 +9388,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {554, 465} - - NSView @@ -22506,7 +22523,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {1.7976931348623157e+308, 1.7976931348623157e+308} - + 256 YES @@ -22525,7 +22542,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 109}, {206, 18}} - YES @@ -22550,7 +22566,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{185, 39}, {45, 19}} - YES @@ -22635,7 +22650,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 41}, {165, 14}} - YES @@ -22655,7 +22669,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 15}, {109, 14}} - YES @@ -22675,7 +22688,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{231, 34}, {19, 27}} - YES @@ -22694,7 +22706,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 89}, {115, 18}} - YES @@ -22719,7 +22730,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 69}, {195, 18}} - YES @@ -22744,7 +22754,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{126, 10}, {124, 22}} - _NS:791 YES @@ -22856,13 +22865,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {265, 134}} - {{17, 107}, {267, 150}} - {0, 0} @@ -22884,7 +22891,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{69, 7}, {162, 19}} - YES -2080374784 @@ -22916,7 +22922,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{18, 14}, {107, 58}} - YES NO @@ -23176,13 +23181,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {265, 82}} - {{17, 425}, {267, 98}} - {0, 0} @@ -23214,7 +23217,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 52}, {108, 18}} - YES @@ -23239,7 +23241,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 32}, {135, 18}} - YES @@ -23264,7 +23265,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 12}, {82, 18}} - YES @@ -23289,7 +23289,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 119}, {112, 14}} - _NS:526 {251, 750} @@ -23312,7 +23311,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{134, 117}, {48, 19}} - _NS:9 YES @@ -23391,7 +23389,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{187, 113}, {19, 27}} - _NS:1592 YES @@ -23412,7 +23409,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 72}, {137, 18}} - YES 67108864 @@ -23436,7 +23432,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 96}, {127, 14}} - YES 68157504 @@ -23455,7 +23450,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{187, 89}, {19, 27}} - YES 67895328 @@ -23475,7 +23469,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{161, 96}, {19, 14}} - _NS:4068 YES @@ -23548,13 +23541,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {265, 144}} - {{17, 261}, {267, 160}} - {0, 0} @@ -23586,7 +23577,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 32}, {192, 18}} - YES @@ -23611,7 +23601,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 12}, {114, 18}} - YES 67108864 @@ -23633,13 +23622,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {265, 58}} - {{17, 29}, {267, 74}} - {0, 0} @@ -23658,8 +23645,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {301, 543} - - {{0, 0}, {1920, 1177}} @@ -43318,6 +43303,30 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 10250 + + + changeDisplayOrientation: + + + + 10254 + + + + changeDisplayOrientation: + + + + 10255 + + + + changeDisplayOrientation: + + + + 10257 + @@ -48894,6 +48903,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 YES + + + @@ -49006,6 +49018,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 + + + @@ -58625,6 +58640,36 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 + + 10251 + + + + + 10252 + + + + + 10253 + + + + + 10258 + + + + + 10259 + + + + + 10260 + + + @@ -58813,6 +58858,12 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 10247.IBPluginDependency 10247.IBViewBoundsToFrameTransform 10248.IBPluginDependency + 10251.IBPluginDependency + 10252.IBPluginDependency + 10253.IBPluginDependency + 10258.IBAttributePlaceholdersKey + 10259.IBAttributePlaceholdersKey + 10260.IBAttributePlaceholdersKey 1034.IBPluginDependency 1035.IBPluginDependency 1036.IBPluginDependency @@ -59833,9 +59884,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 6161.IBPluginDependency 6162.IBPluginDependency 6168.IBPluginDependency + 6169.IBEditorWindowLastContentRect 6169.IBPluginDependency 6170.IBPluginDependency 6171.IBPluginDependency + 6172.IBEditorWindowLastContentRect 6172.IBPluginDependency 6173.IBPluginDependency 6174.IBPluginDependency @@ -60258,6 +60311,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 7766.IBPluginDependency 7767.IBPluginDependency 7771.IBPluginDependency + 7772.IBEditorWindowLastContentRect 7772.IBPluginDependency 7773.IBPluginDependency 7774.IBPluginDependency @@ -60309,6 +60363,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 7837.IBPluginDependency 7838.IBPluginDependency 7839.IBPluginDependency + 784.IBEditorWindowLastContentRect 784.IBPluginDependency 7840.IBNumberFormatterBehaviorMetadataKey 7840.IBNumberFormatterLocalizesFormatMetadataKey @@ -60348,6 +60403,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 7875.IBPluginDependency 7876.IBPluginDependency 7879.IBPluginDependency + 788.IBEditorWindowLastContentRect 788.IBPluginDependency 7880.IBPluginDependency 7881.IBPluginDependency @@ -61476,6 +61532,33 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + By default, arranges the NDS screens where the top and bottom screens are displayed on the right side, along with a larger major screen on the left side. This display orientation does not use the display separation setting. It is best suited for users who want a balanced size ratio between the minor screens and the major screen. + + + + ToolTip + + ToolTip + + By default, arranges the NDS screens where the top and bottom screens are displayed on the right side, along with a larger major screen on the left side. This display orientation uses the display separation setting. It is best suited for host displays running a 16:9 resolution. + + + + ToolTip + + ToolTip + + By default, arranges the NDS screens where the top and bottom screens are displayed on the right side, along with a larger major screen on the left side. This display orientation uses the display separation setting. It is best suited for host displays running a 16:10 resolution. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -61564,7 +61647,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{310, 296}, {489, 437}} + {{585, 358}, {489, 437}} {796.5, 896.5} com.apple.InterfaceBuilder.CocoaPlugin @@ -61968,14 +62051,14 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{616, 836}, {512, 20}} + {{411, 836}, {512, 20}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{288, 552}, {315, 473}} + {{685, 363}, {315, 473}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -62446,7 +62529,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{603, 962}, {132, 63}} + {{1000, 773}, {132, 63}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -63191,9 +63274,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{1000, 673}, {151, 103}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{1000, 713}, {178, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -63207,7 +63292,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 ToolTip - If the display orientation is vertical, the main screen will be arranged above the touch screen by default. If the display layout is horizontal, the main screen will be arranged left of the touch screen by default. + If the display orientation is Vertical, then the main screen will be arranged above the touch screen by default. If the display orientation is Horizontal, then the main screen will be arranged left of the touch screen by default. If the display orientation is Hybrid, then the main screen will be the major display by default. com.apple.InterfaceBuilder.CocoaPlugin @@ -63216,7 +63301,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 ToolTip - If the display orientation is vertical, the touch screen will be arranged above the main screen by default. If the display layout is horizontal, the touch screen will be arranged left of the main screen by default. + If the display orientation is Vertical, then the touch screen will be arranged above the main screen by default. If the display orientation is Horizontal, then the touch screen will be arranged left of the main screen by default. If the display orientation is Hybrid, then the touch screen will be the major display by default. com.apple.InterfaceBuilder.CocoaPlugin @@ -63228,7 +63313,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 ToolTip - Arranges the NDS screens where one screen is to the left of the other screen by default. + By default, arranges the NDS screens where one screen is to the left of the other screen. This display orientation does not use the display separation setting. com.apple.InterfaceBuilder.CocoaPlugin @@ -63237,7 +63322,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 ToolTip - Arranges the NDS screens where one screen is above the other screen by default. + By default, arranges the NDS screens where one screen is above the other screen, just like a hardware NDS. This display orientation uses the display separation setting. com.apple.InterfaceBuilder.CocoaPlugin @@ -63771,6 +63856,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{1000, 603}, {118, 133}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -63836,6 +63922,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{1000, 633}, {136, 163}} com.apple.InterfaceBuilder.CocoaPlugin @@ -63917,6 +64004,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{1000, 713}, {70, 103}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -64935,7 +65023,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - 10250 + 10260 diff --git a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h index e41f32b54..f1136aa4a 100644 --- a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h +++ b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.h @@ -18,6 +18,7 @@ #import #import #include +#include #import "InputManager.h" #import "cocoa_output.h" @@ -26,6 +27,7 @@ @class EmuControllerDelegate; class OGLVideoOutput; +typedef std::map InitialTouchPressMap; // Key = An ID number of the host input, Value = Flag that indicates if the initial touch press was in the major display // Subclass NSWindow for full screen windows so that we can override some methods. @interface DisplayFullScreenWindow : NSWindow @@ -35,8 +37,8 @@ class OGLVideoOutput; @interface DisplayView : NSView { InputManager *inputManager; + InitialTouchPressMap *_initialTouchInMajorDisplay; OGLVideoOutput *oglv; - CGFloat _displayRotation; BOOL canUseShaderBasedFilters; BOOL _useVerticalSync; @@ -54,6 +56,7 @@ class OGLVideoOutput; } @property (retain) InputManager *inputManager; +@property (readonly) NSSize normalSize; @property (readonly) BOOL canUseShaderBasedFilters; @property (assign) BOOL isHUDVisible; @property (assign) BOOL isHUDVideoFPSVisible; @@ -70,12 +73,14 @@ class OGLVideoOutput; - (void) setScaleFactor:(float)theScaleFactor; - (void) drawVideoFrame; -- (NSPoint) dsPointFromEvent:(NSEvent *)theEvent; -- (NSPoint) convertPointToDS:(NSPoint)clickLoc; +- (NSPoint) dsPointFromEvent:(NSEvent *)theEvent inputID:(const NSInteger)inputID; +- (NSPoint) convertPointToDS:(NSPoint)clickLoc inputID:(const NSInteger)inputID initialTouchPress:(BOOL)isInitialTouchPress; - (BOOL) handleKeyPress:(NSEvent *)theEvent keyPressed:(BOOL)keyPressed; - (BOOL) handleMouseButton:(NSEvent *)theEvent buttonPressed:(BOOL)buttonPressed; - (void) requestScreenshot:(NSURL *)fileURL fileType:(NSBitmapImageFileType)fileType; ++ (NSSize) calculateNormalSizeUsingMode:(const NSInteger)mode layout:(const NSInteger)layout gapScalar:(const double)gapScalar; + @end #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 diff --git a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.mm b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.mm index 83ea5a24f..6bbbcf1ad 100644 --- a/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.mm +++ b/desmume/src/frontend/cocoa/userinterface/DisplayWindowController.mm @@ -107,8 +107,8 @@ static std::unordered_map _screenMap; // // These need to be initialized first since there are dependencies on these. _displayGap = 0.0; - _displayMode = DS_DISPLAY_TYPE_DUAL; - _displayOrientation = DS_DISPLAY_ORIENTATION_VERTICAL; + _displayMode = ClientDisplayMode_Dual; + _displayOrientation = ClientDisplayLayout_Vertical; _minDisplayViewSize = NSMakeSize(GPU_DISPLAY_WIDTH, (GPU_DISPLAY_HEIGHT*2.0) + (DS_DISPLAY_UNSCALED_GAP*_displayGap)); _isMinSizeNormal = YES; @@ -202,7 +202,8 @@ static std::unordered_map _screenMap; // // Resize the window. const NSSize oldBounds = [theWindow frame].size; - const double constrainedScale = [self resizeWithTransform:[self normalSize] scalar:[self displayScale] rotation:newAngleDegrees]; + const NSSize newNormalSize = [DisplayView calculateNormalSizeUsingMode:[self displayMode] layout:[self displayOrientation] gapScalar:[self displayGap]]; + const double constrainedScale = [self resizeWithTransform:newNormalSize scalar:[self displayScale] rotation:newAngleDegrees]; const NSSize newBounds = [theWindow frame].size; OSSpinLockLock(&spinlockScale); @@ -243,15 +244,15 @@ static std::unordered_map _screenMap; // switch (displayModeID) { - case DS_DISPLAY_TYPE_MAIN: + case ClientDisplayMode_Main: modeString = NSSTRING_DISPLAYMODE_MAIN; break; - case DS_DISPLAY_TYPE_TOUCH: + case ClientDisplayMode_Touch: modeString = NSSTRING_DISPLAYMODE_TOUCH; break; - case DS_DISPLAY_TYPE_DUAL: + case ClientDisplayMode_Dual: modeString = NSSTRING_DISPLAYMODE_DUAL; break; @@ -263,8 +264,9 @@ static std::unordered_map _screenMap; // _displayMode = displayModeID; OSSpinLockUnlock(&spinlockDisplayMode); + const NSSize newNormalSize = [DisplayView calculateNormalSizeUsingMode:[self displayMode] layout:[self displayOrientation] gapScalar:[self displayGap]]; [self setIsMinSizeNormal:[self isMinSizeNormal]]; - [self resizeWithTransform:[self normalSize] scalar:[self displayScale] rotation:[self displayRotation]]; + [self resizeWithTransform:newNormalSize scalar:[self displayScale] rotation:[self displayRotation]]; [CocoaDSUtil messageSendOneWayWithInteger:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_CHANGE_DISPLAY_TYPE integerValue:displayModeID]; } @@ -284,10 +286,11 @@ static std::unordered_map _screenMap; // _displayOrientation = theOrientation; OSSpinLockUnlock(&spinlockDisplayOrientation); - if ([self displayMode] == DS_DISPLAY_TYPE_DUAL) + if ([self displayMode] == ClientDisplayMode_Dual) { + const NSSize newNormalSize = [DisplayView calculateNormalSizeUsingMode:[self displayMode] layout:[self displayOrientation] gapScalar:[self displayGap]]; [self setIsMinSizeNormal:[self isMinSizeNormal]]; - [self resizeWithTransform:[self normalSize] scalar:[self displayScale] rotation:[self displayRotation]]; + [self resizeWithTransform:newNormalSize scalar:[self displayScale] rotation:[self displayRotation]]; } [CocoaDSUtil messageSendOneWayWithInteger:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_CHANGE_DISPLAY_ORIENTATION integerValue:theOrientation]; @@ -326,10 +329,11 @@ static std::unordered_map _screenMap; // _displayGap = gapScalar; OSSpinLockUnlock(&spinlockDisplayGap); - if ([self displayMode] == DS_DISPLAY_TYPE_DUAL) + if ([self displayMode] == ClientDisplayMode_Dual) { + const NSSize newNormalSize = [DisplayView calculateNormalSizeUsingMode:[self displayMode] layout:[self displayOrientation] gapScalar:[self displayGap]]; [self setIsMinSizeNormal:[self isMinSizeNormal]]; - [self resizeWithTransform:[self normalSize] scalar:[self displayScale] rotation:[self displayRotation]]; + [self resizeWithTransform:newNormalSize scalar:[self displayScale] rotation:[self displayRotation]]; } [CocoaDSUtil messageSendOneWayWithFloat:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_CHANGE_DISPLAY_GAP floatValue:(float)gapScalar]; @@ -390,30 +394,8 @@ static std::unordered_map _screenMap; // - (void) setIsMinSizeNormal:(BOOL)theState { - OSSpinLockLock(&spinlockDisplayGap); - const double gapScalar = _displayGap; - OSSpinLockUnlock(&spinlockDisplayGap); - _isMinSizeNormal = theState; - - if ([self displayMode] == DS_DISPLAY_TYPE_DUAL) - { - if ([self displayOrientation] == DS_DISPLAY_ORIENTATION_HORIZONTAL) - { - _minDisplayViewSize.width = GPU_DISPLAY_WIDTH*2.0 + (DS_DISPLAY_UNSCALED_GAP*gapScalar); - _minDisplayViewSize.height = GPU_DISPLAY_HEIGHT; - } - else - { - _minDisplayViewSize.width = GPU_DISPLAY_WIDTH; - _minDisplayViewSize.height = GPU_DISPLAY_HEIGHT*2.0 + (DS_DISPLAY_UNSCALED_GAP*gapScalar); - } - } - else - { - _minDisplayViewSize.width = GPU_DISPLAY_WIDTH; - _minDisplayViewSize.height = GPU_DISPLAY_HEIGHT; - } + _minDisplayViewSize = [DisplayView calculateNormalSizeUsingMode:[self displayMode] layout:[self displayOrientation] gapScalar:[self displayGap]]; if (!_isMinSizeNormal) { @@ -505,21 +487,7 @@ static std::unordered_map _screenMap; // - (NSSize) normalSize { - NSSize normalSize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT); - - if ([self displayMode] == DS_DISPLAY_TYPE_DUAL) - { - if ([self displayOrientation] == DS_DISPLAY_ORIENTATION_VERTICAL) - { - normalSize.height = GPU_DISPLAY_HEIGHT * 2.0 + (DS_DISPLAY_UNSCALED_GAP * _displayGap); - } - else - { - normalSize.width = GPU_DISPLAY_WIDTH * 2.0 + (DS_DISPLAY_UNSCALED_GAP * _displayGap); - } - } - - return normalSize; + return [[self view] normalSize]; } - (BOOL) masterStatusBarState @@ -965,7 +933,7 @@ static std::unordered_map _screenMap; // - (IBAction) toggleNDSDisplays:(id)sender { - [self setDisplayOrder:([self displayOrder] == DS_DISPLAY_ORDER_MAIN_FIRST) ? DS_DISPLAY_ORDER_TOUCH_FIRST : DS_DISPLAY_ORDER_MAIN_FIRST]; + [self setDisplayOrder:([self displayOrder] == ClientDisplayOrder_MainFirst) ? ClientDisplayOrder_TouchFirst : ClientDisplayOrder_MainFirst]; } - (IBAction) writeDefaultsDisplayRotation:(id)sender @@ -1597,6 +1565,7 @@ static std::unordered_map _screenMap; // #endif inputManager = nil; + _initialTouchInMajorDisplay = new InitialTouchPressMap; // Initialize the OpenGL context NSOpenGLPixelFormatAttribute attributes[] = { @@ -1670,6 +1639,7 @@ static std::unordered_map _screenMap; // delete oglv; CGLSetCurrentContext(prevContext); + delete _initialTouchInMajorDisplay; [self setInputManager:nil]; [context clearDrawable]; [context release]; @@ -1679,6 +1649,16 @@ static std::unordered_map _screenMap; // #pragma mark Dynamic Property Methods +- (NSSize) normalSize +{ + double w; + double h; + + oglv->GetDisplayLayer()->GetNormalSize(w, h); + + return NSMakeSize(w, h); +} + - (void) setIsHUDVisible:(BOOL)theState { OSSpinLockLock(&spinlockIsHUDVisible); @@ -1955,18 +1935,21 @@ static std::unordered_map _screenMap; // CGLFlushDrawable(cglDisplayContext); } -- (NSPoint) dsPointFromEvent:(NSEvent *)theEvent +- (NSPoint) dsPointFromEvent:(NSEvent *)theEvent inputID:(const NSInteger)inputID { + const NSEventType eventType = [theEvent type]; + const BOOL isInitialMouseDown = (eventType == NSLeftMouseDown) || (eventType == NSRightMouseDown) || (eventType == NSOtherMouseDown); + // Convert the clicked location from window coordinates, to view coordinates, // and finally to DS touchscreen coordinates. NSPoint touchLoc = [theEvent locationInWindow]; touchLoc = [self convertPoint:touchLoc fromView:nil]; - touchLoc = [self convertPointToDS:touchLoc]; + touchLoc = [self convertPointToDS:touchLoc inputID:inputID initialTouchPress:isInitialMouseDown]; return touchLoc; } -- (NSPoint) convertPointToDS:(NSPoint)clickLoc +- (NSPoint) convertPointToDS:(NSPoint)clickLoc inputID:(const NSInteger)inputID initialTouchPress:(BOOL)isInitialTouchPress { DisplayWindowController *windowController = (DisplayWindowController *)[[self window] delegate]; @@ -1978,7 +1961,7 @@ static std::unordered_map _screenMap; // const NSSize normalBounds = [windowController normalSize]; const NSSize viewSize = [self bounds].size; - const CGSize transformBounds = GetTransformedBounds(normalBounds.width, normalBounds.height, 1.0, _displayRotation); + const CGSize transformBounds = GetTransformedBounds(normalBounds.width, normalBounds.height, 1.0, oglv->GetDisplayLayer()->GetRotation()); const double s = GetMaxScalarInBounds(transformBounds.width, transformBounds.height, viewSize.width, viewSize.height); CGPoint touchLoc = GetNormalPointFromTransformedPoint(clickLoc.x, clickLoc.y, @@ -1988,19 +1971,51 @@ static std::unordered_map _screenMap; // viewAngle); // Normalize the touch location to the DS. - if ([windowController displayMode] == DS_DISPLAY_TYPE_DUAL) + if ([windowController displayMode] == ClientDisplayMode_Dual) { - const NSInteger theOrientation = [windowController displayOrientation]; - const NSInteger theOrder = [windowController displayOrder]; - const double gap = DS_DISPLAY_UNSCALED_GAP * [windowController displayGap]; + const ClientDisplayLayout theOrientation = (ClientDisplayLayout)[windowController displayOrientation]; + const ClientDisplayOrder theOrder = (ClientDisplayOrder)[windowController displayOrder]; - if (theOrientation == DS_DISPLAY_ORIENTATION_VERTICAL && theOrder == DS_DISPLAY_ORDER_TOUCH_FIRST) + switch (theOrientation) { - touchLoc.y -= (GPU_DISPLAY_HEIGHT+gap); - } - else if (theOrientation == DS_DISPLAY_ORIENTATION_HORIZONTAL && theOrder == DS_DISPLAY_ORDER_MAIN_FIRST) - { - touchLoc.x -= (GPU_DISPLAY_WIDTH+gap); + case ClientDisplayLayout_Horizontal: + { + if (theOrder == ClientDisplayOrder_MainFirst) + { + touchLoc.x -= GPU_DISPLAY_WIDTH; + } + break; + } + + case ClientDisplayLayout_Hybrid_3_2: + case ClientDisplayLayout_Hybrid_16_9: + case ClientDisplayLayout_Hybrid_16_10: + { + if (isInitialTouchPress) + { + const bool isClickWithinMajorDisplay = (theOrder == ClientDisplayOrder_TouchFirst) && (touchLoc.x >= 0.0) && (touchLoc.x < 256.0); + (*_initialTouchInMajorDisplay)[(int)inputID] = isClickWithinMajorDisplay; + } + + const bool handleClickInMajorDisplay = (*_initialTouchInMajorDisplay)[(int)inputID]; + if (!handleClickInMajorDisplay) + { + const double minorDisplayScale = (normalBounds.width - (GLfloat)GPU_DISPLAY_WIDTH) / (GLfloat)GPU_DISPLAY_WIDTH; + touchLoc.x = (touchLoc.x - GPU_DISPLAY_WIDTH) / minorDisplayScale; + touchLoc.y = touchLoc.y / minorDisplayScale; + } + break; + } + + default: // Default to vertical orientation. + { + if (theOrder == ClientDisplayOrder_TouchFirst) + { + const double gap = DS_DISPLAY_UNSCALED_GAP * [windowController displayGap]; + touchLoc.y -= (GPU_DISPLAY_HEIGHT+gap); + } + break; + } } } @@ -2097,12 +2112,13 @@ static std::unordered_map _screenMap; // // Convert the clicked location from window coordinates, to view coordinates, // and finally to DS touchscreen coordinates. - const NSPoint touchLoc = (displayModeID == DS_DISPLAY_TYPE_MAIN) ? NSMakePoint(0.0, 0.0) : [self dsPointFromEvent:theEvent]; - const InputAttributes inputAttr = InputManagerEncodeMouseButtonInput([theEvent buttonNumber], touchLoc, buttonPressed); + const NSInteger buttonNumber = [theEvent buttonNumber]; + const NSPoint touchLoc = (displayModeID == ClientDisplayMode_Main) ? NSMakePoint(0.0, 0.0) : [self dsPointFromEvent:theEvent inputID:buttonNumber]; + const InputAttributes inputAttr = InputManagerEncodeMouseButtonInput(buttonNumber, touchLoc, buttonPressed); if (buttonPressed && [theEvent window] != nil) { - NSString *newStatusText = (displayModeID == DS_DISPLAY_TYPE_MAIN) ? [NSString stringWithFormat:@"%s:%s", inputAttr.deviceName, inputAttr.elementName] : [NSString stringWithFormat:@"%s:%s X:%i Y:%i", inputAttr.deviceName, inputAttr.elementName, (int)inputAttr.intCoordX, (int)inputAttr.intCoordY]; + NSString *newStatusText = (displayModeID == ClientDisplayMode_Main) ? [NSString stringWithFormat:@"%s:%s", inputAttr.deviceName, inputAttr.elementName] : [NSString stringWithFormat:@"%s:%s X:%i Y:%i", inputAttr.deviceName, inputAttr.elementName, (int)inputAttr.intCoordX, (int)inputAttr.intCoordY]; [[windowController emuControl] setStatusText:newStatusText]; } @@ -2369,9 +2385,7 @@ static std::unordered_map _screenMap; // } - (void)doTransformView:(const DisplayOutputTransformData *)transformData -{ - _displayRotation = (GLfloat)transformData->rotation; - +{ OGLDisplayLayer *display = oglv->GetDisplayLayer(); display->SetRotation((GLfloat)transformData->rotation); [self doRedraw]; @@ -2385,26 +2399,19 @@ static std::unordered_map _screenMap; // CGLUnlockContext(cglDisplayContext); } -- (void)doDisplaySizeChanged:(NSSize)displaySize -{ - OGLDisplayLayer *display = oglv->GetDisplayLayer(); - display->SetDisplaySize((uint16_t)displaySize.width, (uint16_t)displaySize.height); - [self doRedraw]; -} - - (void)doDisplayModeChanged:(NSInteger)displayModeID { OGLDisplayLayer *display = oglv->GetDisplayLayer(); - display->SetMode(displayModeID); + display->SetMode((ClientDisplayMode)displayModeID); [self doRedraw]; } - (void)doDisplayOrientationChanged:(NSInteger)displayOrientationID { OGLDisplayLayer *display = oglv->GetDisplayLayer(); - display->SetOrientation(displayOrientationID); + display->SetOrientation((ClientDisplayLayout)displayOrientationID); - if (display->GetMode() == DS_DISPLAY_TYPE_DUAL) + if (display->GetMode() == ClientDisplayMode_Dual) { [self doRedraw]; } @@ -2413,9 +2420,9 @@ static std::unordered_map _screenMap; // - (void)doDisplayOrderChanged:(NSInteger)displayOrderID { OGLDisplayLayer *display = oglv->GetDisplayLayer(); - display->SetOrder(displayOrderID); + display->SetOrder((ClientDisplayOrder)displayOrderID); - if (display->GetMode() == DS_DISPLAY_TYPE_DUAL) + if (display->GetMode() == ClientDisplayMode_Dual) { [self doRedraw]; } @@ -2426,12 +2433,22 @@ static std::unordered_map _screenMap; // OGLDisplayLayer *display = oglv->GetDisplayLayer(); display->SetGapScalar((GLfloat)displayGapScalar); - if (display->GetMode() == DS_DISPLAY_TYPE_DUAL) + if (display->GetMode() == ClientDisplayMode_Dual) { [self doRedraw]; } } ++ (NSSize) calculateNormalSizeUsingMode:(const NSInteger)mode layout:(const NSInteger)layout gapScalar:(const double)gapScalar +{ + double w; + double h; + + OGLDisplayLayer::CalculateNormalSize((ClientDisplayMode)mode, (ClientDisplayLayout)layout, gapScalar, w, h); + + return NSMakeSize(w, h); +} + @end #pragma mark - diff --git a/desmume/src/frontend/cocoa/userinterface/EmuControllerDelegate.mm b/desmume/src/frontend/cocoa/userinterface/EmuControllerDelegate.mm index 6035401aa..de9317bb6 100644 --- a/desmume/src/frontend/cocoa/userinterface/EmuControllerDelegate.mm +++ b/desmume/src/frontend/cocoa/userinterface/EmuControllerDelegate.mm @@ -32,6 +32,7 @@ #import "cocoa_rom.h" #import "cocoa_slot2.h" +#include "../OGLDisplayOutput.h" @implementation EmuControllerDelegate @@ -1272,24 +1273,24 @@ const NSInteger displayMode = [theWindow displayMode]; switch (displayMode) { - case DS_DISPLAY_TYPE_MAIN: - [theWindow setDisplayMode:DS_DISPLAY_TYPE_TOUCH]; + case ClientDisplayMode_Main: + [theWindow setDisplayMode:ClientDisplayMode_Touch]; break; - case DS_DISPLAY_TYPE_TOUCH: - [theWindow setDisplayMode:DS_DISPLAY_TYPE_MAIN]; + case ClientDisplayMode_Touch: + [theWindow setDisplayMode:ClientDisplayMode_Main]; break; - case DS_DISPLAY_TYPE_DUAL: + case ClientDisplayMode_Dual: { const NSInteger displayOrder = [theWindow displayOrder]; - if (displayOrder == DS_DISPLAY_ORDER_MAIN_FIRST) + if (displayOrder == ClientDisplayOrder_MainFirst) { - [theWindow setDisplayOrder:DS_DISPLAY_ORDER_TOUCH_FIRST]; + [theWindow setDisplayOrder:ClientDisplayOrder_TouchFirst]; } else { - [theWindow setDisplayOrder:DS_DISPLAY_ORDER_MAIN_FIRST]; + [theWindow setDisplayOrder:ClientDisplayOrder_MainFirst]; } break; }