Adds support for new Nintendo DS controller skin

This commit is contained in:
Riley Testut 2020-02-11 16:34:57 -08:00
parent 8b5ac435a6
commit 4ba2fa8d21
4 changed files with 13 additions and 10 deletions

@ -1 +1 @@
Subproject commit 88037a5745399074cedb665f435564bb5d89ba91
Subproject commit 23abf633559dac471fa3b38a3cfcc12ffa68ab6e

@ -1 +1 @@
Subproject commit 5570db1dfe95d6e08b0abaefe63b89a9cac211fc
Subproject commit 3e5331fd79663791bbe456499517047f8d75f4f2

View File

@ -91,6 +91,11 @@ extension ControllerSkin: ControllerSkinProtocol
return self.controllerSkin?.gameScreenFrame(for: traits)
}
public func screens(for traits: DeltaCore.ControllerSkin.Traits) -> [DeltaCore.ControllerSkin.Screen]?
{
return self.controllerSkin?.screens(for: traits)
}
public func aspectRatio(for traits: DeltaCore.ControllerSkin.Traits) -> CGSize?
{
return self.controllerSkin?.aspectRatio(for: traits)

View File

@ -267,14 +267,12 @@ extension GameViewController
// Lays out self.gameView, so we can pin self.sustainButtonsContentView to it without resulting in a temporary "cannot satisfy constraints".
self.view.layoutIfNeeded()
let gameViewContainerView = self.gameView.superview!
self.controllerView.translucentControllerSkinOpacity = Settings.translucentControllerSkinOpacity
self.sustainButtonsContentView = UIView(frame: CGRect(x: 0, y: 0, width: self.gameView.bounds.width, height: self.gameView.bounds.height))
self.sustainButtonsContentView.translatesAutoresizingMaskIntoConstraints = false
self.sustainButtonsContentView.isHidden = true
self.view.insertSubview(self.sustainButtonsContentView, aboveSubview: gameViewContainerView)
self.view.insertSubview(self.sustainButtonsContentView, aboveSubview: self.gameView)
let blurEffect = UIBlurEffect(style: .dark)
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
@ -300,10 +298,10 @@ extension GameViewController
vibrancyView.contentView.addSubview(self.sustainButtonsBackgroundView)
// Auto Layout
self.sustainButtonsContentView.leadingAnchor.constraint(equalTo: gameViewContainerView.leadingAnchor).isActive = true
self.sustainButtonsContentView.trailingAnchor.constraint(equalTo: gameViewContainerView.trailingAnchor).isActive = true
self.sustainButtonsContentView.topAnchor.constraint(equalTo: gameViewContainerView.topAnchor).isActive = true
self.sustainButtonsContentView.bottomAnchor.constraint(equalTo: gameViewContainerView.bottomAnchor).isActive = true
self.sustainButtonsContentView.leadingAnchor.constraint(equalTo: self.gameView.leadingAnchor).isActive = true
self.sustainButtonsContentView.trailingAnchor.constraint(equalTo: self.gameView.trailingAnchor).isActive = true
self.sustainButtonsContentView.topAnchor.constraint(equalTo: self.gameView.topAnchor).isActive = true
self.sustainButtonsContentView.bottomAnchor.constraint(equalTo: self.gameView.bottomAnchor).isActive = true
self.updateControllerSkin()
self.updateControllers()
@ -729,7 +727,7 @@ extension GameViewController: SaveStatesViewControllerDelegate
self.emulatorCore?.saveSaveState(to: saveState.fileURL)
}
if let snapshot = self.gameView.snapshot(), let data = snapshot.pngData()
if let snapshot = self.emulatorCore?.videoManager.snapshot(), let data = snapshot.pngData()
{
do
{