mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Add default hotkey to swap primary screens.
Also minor style changes
This commit is contained in:
		
							parent
							
								
									5f72aade77
								
							
						
					
					
						commit
						d9305b0a07
					
				
					 10 changed files with 27 additions and 13 deletions
				
			
		|  | @ -200,7 +200,7 @@ public: | |||
|     } | ||||
| 
 | ||||
|     /**
 | ||||
|      * Convenience method to update the VideoCore EmuWindow | ||||
|      * Convenience method to update the current frame layout | ||||
|      * Read from the current settings to determine which layout to use. | ||||
|      */ | ||||
|     void UpdateCurrentFramebufferLayout(unsigned width, unsigned height); | ||||
|  |  | |||
|  | @ -51,11 +51,15 @@ FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height, bool swapp | |||
|             bot_screen.TranslateX((screen_window_area.GetWidth() - bot_screen.GetWidth()) / 2); | ||||
|     } else { | ||||
|         // Window is narrower than the emulation content => apply borders to the top and bottom
 | ||||
|         top_screen = top_screen.TranslateY(height / 2 - top_screen.GetHeight()); | ||||
|         // Recalculate the bottom screen to account for the width difference between top and bottom
 | ||||
|         screen_window_area = {0, 0, width, top_screen.GetHeight()}; | ||||
|         bot_screen = maxRectangle(screen_window_area, BOT_SCREEN_ASPECT_RATIO); | ||||
|         bot_screen = bot_screen.TranslateX((top_screen.GetWidth() - bot_screen.GetWidth()) / 2); | ||||
|         if (swapped) { | ||||
|             bot_screen = bot_screen.TranslateY(height / 2 - bot_screen.GetHeight()); | ||||
|         } else { | ||||
|             top_screen = top_screen.TranslateY(height / 2 - top_screen.GetHeight()); | ||||
|         } | ||||
|     } | ||||
|     // Move the top screen to the bottom if we are swapped.
 | ||||
|     res.top_screen = swapped ? top_screen.TranslateY(height / 2) : top_screen; | ||||
|  |  | |||
|  | @ -33,7 +33,8 @@ FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height, bool is_sw | |||
| FramebufferLayout SingleFrameLayout(unsigned width, unsigned height, bool is_swapped); | ||||
| 
 | ||||
| /**
 | ||||
|  * Factory method for constructing a Frame with the a 4x size Top screen with a 1x size bottom screen on the right | ||||
|  * Factory method for constructing a Frame with the a 4x size Top screen with a 1x size bottom | ||||
|  * screen on the right | ||||
|  * This is useful in particular because it matches well with a 1920x1080 resolution monitor | ||||
|  * @param width Window framebuffer width in pixels | ||||
|  * @param height Window framebuffer height in pixels | ||||
|  |  | |||
|  | @ -45,10 +45,8 @@ struct Rectangle { | |||
|         return Rectangle{left, top + y, right, bottom + y}; | ||||
|     } | ||||
|     Rectangle<T> Scale(const float s) const { | ||||
|         ASSERT(s > 0); | ||||
|         return Rectangle { | ||||
|             left, top, static_cast<T>((right + left) * s), static_cast<T>((top + bottom) * s) | ||||
|         }; | ||||
|         return Rectangle{left, top, static_cast<T>((right + left) * s), | ||||
|                          static_cast<T>((top + bottom) * s)}; | ||||
|     } | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue