Repository navigation
Add QuickDraw's utility calls to libQuickDraw - #73
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libQuickDraw gains the small utility calls ordinary programs use, built on what Mac OS 9.2.2 did with a new probe (
ReferenceTests/Retro68/UtilitiesCapture.c).What changed
Random,StuffHex,PtToAngle.Fix2SmallFract,SmallFract2Fixand the conversions between RGB and CMY, HSL and HSV.GetPortBounds,GetPortVisibleRegion,GetPortTextFont,GetPortTextSize,GetPortTextFace,GetPortBitMapForCopyBits,GetRegionBounds,GetQDGlobalsScreenBits.stuffHex(GraphiteCore),Rect.angle(to:)andCMYColor/HSVColor/HSLColor(Graphite2D).19 more functions, so 168 of 305 are implemented.
Worth knowing
PtToAngleis not a rounded arctangent. The probe found thatAngleFromSlopemoves to the next degree 501 pastSlopeFromAngle's fixed-point slope, soPointAngle.swiftholds the 90 slopes as measured.Randomuses the engine's existing generator, which already matched.Testing
UtilitiesCaptureTestsreplays the probe; every line matches except the slope calls', which are skipped because they are not QuickDraw's.drawing.cchecksGetPortBounds,GetPortBitMapForCopyBitsandGetQDGlobalsScreenBits, and the others have no check.swift testpasses on macOS.swift:6.4-trixie, FreeType off): 305 exports as declared,pure.c26 checks anddrawing.c65 checks pass.Commits are one file each, so intermediate ones may not build on their own.