Cursors
cursorHandles: ARRAY Cursors.CursorType OF Cursors.CursorHandle ← ALL[NIL];
cursorSampleMaps: ARRAY Cursors.CursorType OF SampleMap ← ALL[NIL];
CursorArray: TYPE ~ ARRAY [0..16) OF PACKED ARRAY [0..16) OF [0..1];
EnsureSampleMapForCursor:
PROC [cursor: Cursors.CursorType] ~ {
IF cursorSampleMaps[cursor]=NIL THEN ERROR;
};
CreateCursor:
PROC [hotX, hotY:
INTEGER, bits: CursorArray]
RETURNS [t: Cursors.CursorType] ~ {
h: Cursors.CursorHandle ← NEW[Cursors.CursorRec];
h.bits ← LOOPHOLE[bits];
h.info ← [
type: Cursors.NewCursor[h.bits, hotX, hotY],
hotX: hotX,
hotY: hotY
];
t ← h.info.type;
cursorHandles[t] ← h;
cursorSampleMaps[t] ← SampleMapOps.Create[sSize: 16, fSize: 16, bitsPerSample: 1];
SampleMapOps.Clear[cursorSampleMaps[t]];
FOR s: [0..16)
IN [0..16)
DO
FOR f: [0..16)
IN [0..16)
DO
IF bits[s][f]=1 THEN SampleMapOps.PutSample[cursorSampleMaps[t], [s, f], 1];
ENDLOOP;
ENDLOOP;
};
contourCursor: Cursors.CursorType ~ CreateCursor[hotX: -7, hotY: -7, bits: [
[0,0,1,1,1,0,0,0,0,0,0,1,1,1,0,0],
[0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0],
[1,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0],
[0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0],
[0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,0],
[0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,0],
[0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0],
[0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0],
[1,0,0,0,0,0,0,0,0,0,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