antoine-source/appleworksgs/Pict/Src/picture.aii

1 line
29 KiB
Plaintext
Raw Normal View History

2023-03-04 02:45:20 +00:00
LOAD 'Macros.dump' INCLUDE 'Pict.equ' INCLUDE 'Driver.equ' IMPORT D_MemoryError IMPORT D_BeachBall IMPORT Q_BgColor IMPORT Q_ChExtra IMPORT Q_DhDvText IMPORT Q_DhText IMPORT Q_DvText IMPORT Q_FgColor IMPORT D_GrowHandle IMPORT Q_LongText IMPORT D_NeedHandle IMPORT Q_PixRect IMPORT Q_PixRgn IMPORT Q_Region IMPORT Q_SpExtra IMPORT Q_Text IMPORT Q_TxFace IMPORT Q_TxFont IMPORT Q_TxMode IMPORT Q_TxSize IMPORT Q_addbytes IMPORT Q_center IMPORT Q_gotPScomm IMPORT Q_op IMPORT Q_pictSCB IMPORT Q_picterr IMPORT Q_theBGcolor IMPORT Q_theChExtra IMPORT Q_theFGcolor IMPORT Q_theMask IMPORT Q_thePnLoc IMPORT Q_thePnSize IMPORT Q_theSpExtra IMPORT Q_theTxFont IMPORT Q_theTxLoc IMPORT Q_theTxMode ENTRY Q_Angles ENTRY Q_Arc ENTRY Q_Arcs ENTRY Q_ChangePictSize ENTRY Q_Comments ENTRY Q_Copy2 ENTRY Q_Copy4 ENTRY Q_CopyPt ENTRY Q_DhDv ENTRY Q_FakeDhDv ENTRY Q_JustRect ENTRY Q_linetext ENTRY Q_manglePt ENTRY Q_Mask ENTRY Q_Nop ENTRY Q_NudgePt ENTRY Q_OvalSize ENTRY Pict_pattern ENTRY Q_PenSize ENTRY Q_Pixels ENTRY Q_Point ENTRY Q_Poly ENTRY Q_Polys ENTRY Q_Rect ENTRY Q_Rects ENTRY Q_Regions ENTRY Q_ShiftPen ENTRY Q_Undef ENTRY Q_Lfrom ENTRY Q_Line ENTRY Q_Slfrom ENTRY Q_Sline **************************************************************** * ; * Picture mangling routines ; *______________________________________________________________* * ; * Some things should be brought to the attention of ; * whoever tries to D_Read this piece of spaghetti code. ; * ; * First of all, all pictures are flipped and rotated ; * ;as if* the picture were defined in 320-mode. The actual ; * SCB for the D_New picture is no different from that of the ; * old picture, but rectangles which look approximately ; * Q_square will still look approximately Q_square when rotated. ; * Such a rectangle will in fact be twice as wide as tall if ; * it's defined in 640 mode, so before rotation, horizontal ; * values are doubled and vertical values are halved. This ; * can introduce a bit of round-off error, but it's ; * unavoidable. ; * ; * A result of this mode-faking is that occasionally, ; * a 'ShortLine' opcode will have to be translated into a ; * 'Q_Line' opcode, or a 'SLineFrom' into 'LineFrom'. For ; * this reason (and to place mangled Q_Text), the location of ; * the pen is maintained throughout the source picture. ; * ; * Secondly, naively rotated and flipped lines will not ; * appear to be mangled correctly, due to the somewhat ; * inconsistent way QuickDraw handles pensizes. Thus, the ; * pen size is also maintained, and used in Q_NudgePt. ; * ; * Third, there is some number-hacking in Q_Point rotation ; * to prevent rotated pictures from creeping up and to the ; * left. There's a comment in Q_CopyPt describing the hack. ; * ; * Other notes concerning the mangling of pixel maps, ; * Q_Text, and Q_Regions can be found in their respective files. ; * ; * -- jge, 2/4/88 ; * ; **************************************************************** **************************************************************** * * Q_ManglePict(oldpict:l,what:w) -> newpict:l -- the guts of the * picture routines. Interprets the opcodes, distributing * the work to other routines. * **************************************************************** Q_ManglePict PROC EXPORT ;Using Q_PictData EXPORT Q_linetext EXPORT Q_Rects EXPORT Q_Arcs EXPORT Q_Polys EXPORT Q_Regions EXPORT Q_Pixels EXPORT Q_Comments EXPORT Q_Nop EXPORT Q_Copy2 EXPORT Q_Copy4 EXPORT Q_Copy6 EXPORT Q_Point EXPORT Q_OvalSize EXPORT Q_PenSize EXPORT Q_Line EXPORT Q_Lfrom EXPORT Q_Sline EXPORT Q_Slfrom EXPORT Q_Rect EXPORT Q_JustRect EXPORT Q_FixRect EXPORT Q_Arc EXPORT Q_Poly EXPORT Q_DhDv EXPORT Q_ShiftPen EXPORT Q_FakeDhDv EXPORT Q_CopyPt EXPORT Q_manglePt EXPORT Q_NudgePt