How to fill-in a diamond without PAINT
#16
(08-15-2022, 02:42 AM)vince Wrote: nice mod, B+.  you know what is interesting?  I think that horizontal lines along with LINE ... ,BF with the BF flag included, is faster than vertical lines with or without the BF flag.  maybe someone can benchmark to know for sure

Since I know so little about benchmarking, take this with a grain of salt, but this is just comparing horizontals with and without BF. The length of the line seems to make a big difference too. A 2 long line was something like ten times faster in the following:

Code: (Select All)
SCREEN _NEWIMAGE(1024, 512, 32)
DIM t!(10)
DIM m AS _MEM
m = _MEM(t!())

CLS
FOR it% = 1 TO 5
    _MEMPUT m, m.OFFSET + m.ELEMENTSIZE * it%, TIMER AS SINGLE
    FOR y% = 0 TO 511
        FOR x% = 0 TO 1024
            LINE (x%, y%)-(x% + 200, y%)
    NEXT x%, y%
    _MEMPUT m, m.OFFSET + m.ELEMENTSIZE * (it% + 5), TIMER AS SINGLE
    CLS
NEXT it%
FOR a% = 1 TO 5
    av## = av## + (t!(a% + 5) - t!(a%))
NEXT a%
av## = av## / 5

_MEMFILL m, m.OFFSET, 40, 0 AS _BYTE
FOR it% = 1 TO 5
    _MEMPUT m, m.OFFSET + m.ELEMENTSIZE * it%, TIMER AS SINGLE
    FOR y% = 0 TO 511
        FOR x% = 0 TO 1024
            LINE (x%, y%)-(x% + 200, y%), , BF
    NEXT x%, y%
    _MEMPUT m, m.OFFSET + m.ELEMENTSIZE * (it% + 5), TIMER AS SINGLE
    CLS
NEXT it%
FOR a% = 1 TO 5
    av2## = av2## + (t!(a% + 5) - t!(a%))
NEXT a%
av2## = av2## / 5
CLS
PRINT av##; " without BF"
PRINT av2##; " with BF"
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply


Messages In This Thread
RE: How to fill-in a diamond without PAINT - by OldMoses - 08-15-2022, 11:21 AM



Users browsing this thread: 5 Guest(s)