Skip to content

Commit

Permalink
Fix saving resolutions in Release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Belyaev committed Sep 4, 2018
1 parent 3409a7c commit 31f7a6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RDM.xcodeproj/xcshareddata/xcschemes/RDM.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
5 changes: 3 additions & 2 deletions ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ import Cocoa
@IBAction func save(_ sender: Any) {
let resArray = resolutions.map { (r : Resolution) -> NSData in
var d = Data()
d.append(UnsafeBufferPointer(start: &r.width, count: 1))
d.append(UnsafeBufferPointer(start: &r.height, count: 1))
var w : UInt32 = r.width, h : UInt32 = r.height
d.append(UnsafeBufferPointer(start: &w, count: 1))
d.append(UnsafeBufferPointer(start: &h, count: 1))
if r.hiDPI {
var hiDPIFlag : [UInt32] = [0x1, 0x200000]
d.append(UnsafeBufferPointer(start: &hiDPIFlag, count: 2))
Expand Down

0 comments on commit 31f7a6a

Please sign in to comment.