~rabbits/oekaki

b6b502e30f04b48952302c351155c0d87b0114bd — neauoire 1 year, 3 months ago d89da4a
Fixed boundary checks for tile redraw
1 files changed, 4 insertions(+), 7 deletions(-)

M src/oekaki.tal
M src/oekaki.tal => src/oekaki.tal +4 -7
@@ 317,8 317,8 @@

@<set-pixel> ( x* y* color -- x* y* )
	#01 STH2
	( within x ) OVR2 INC2 .canvas/width LDZ2 GTH2 ?&outside
	( within y ) DUP2 .canvas/height LDZ2 GTH2 ?&outside
	( bounds x ) OVR2 INC2 .canvas/width LDZ2 GTH2 ?&outside
	( bounds y ) DUP2 .canvas/height LDZ2 GTH2 ?&outside
	( get tile addr ) get-tile-addr STH2
	( get glyph vertical offset ) DUP2 #0007 AND2 STH2 ADD2r
	( make bit mask ) OVR2 NIP #07 AND #80 SWP SFT


@@ 429,9 429,6 @@
@<make-file> ( -- )
	;pict .canvas/length LDZ2 mclr !<redraw-all>

@<paste-file> ( -- )
	JMP2r

@<save-file> ( name* -- )
	;dict/save <pstr>
	DUP2 <pstr>


@@ 614,8 611,8 @@
	.menu/hide LDZ ?{
		OVR2 .canvas/x LDZ2 ADD2 #0010 GTH2 ?{ <hide-menu> }
		}
	DUP2 .canvas/height LDZ2 GTH2 ?&skip
	OVR2 .canvas/width LDZ2 GTH2 ?&skip
	( bounds y ) INC2k .canvas/height LDZ2 GTH2 ?&skip
	( bounds x ) OVR2 INC2 .canvas/width LDZ2 GTH2 ?&skip
	get-tile-addr .Screen/addr DEO2
	#33 SFT2 .canvas/y LDZ2 ADD2 .Screen/y DEO2
	#33 SFT2 .canvas/x LDZ2 ADD2 .Screen/x DEO2