Article View: comp.sys.amiga.tech
Article #13678Re: How do you draw to the screen quickly? (The real solution)
From: Neil Weinstock
Date: Tue, 13 Feb 1990 03:24
Date: Tue, 13 Feb 1990 03:24
20 lines
1558 bytes
1558 bytes
In article <1092@mindlink.UUCP> a464@mindlink.UUCP (Bruce Dawson) writes:
>
> One way of speeding this up is to write your own WritePixel() routine.
[ ... ]
Geez, you guys are all missing the obvious and correct solution. The
answer, as it almost always is, is to use a lookup table. Use the data for
each scan line as the lookup index (simply concatenate the pixel values into
one long binary value), and put the corresponding Image structure into that
table entry. So, you just take the data, look up the appropriate scan line,
and use DrawImage(). Only one operation per scan line. How much quicker
can you get?
Extending this method to the entire screen is left as an exercise for the
reader.
________________ __________________ _________________________
//// \\// \\// \\\\
\\\\ Neil Weinstock //\\ att!cord!nsw or //\\ "Your hair is so... ////
//// AT&T Bell Labs \\// nsw@cord.att.com \\// lustre-laden." - Moss \\\\
\\\\________________//\\__________________//\\_________________________////
Technical Details
Message-ID:
<9231@cbnewsm.ATT.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!cbnewsm!nswReferences:
<1092@mindlink.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!cbnewsm!nsw From: nsw@cbnewsm.ATT.COM (Neil Weinstock) Newsgroups: comp.sys.amiga.tech Subject: Re: How do you draw to the screen quickly? (The real solution) Summary: ?YlsUoIreS SiHt ekAt Message-ID: <9231@cbnewsm.ATT.COM> Date: 13 Feb 90 03:24:09 GMT References: <1092@mindlink.UUCP> Reply-To: nsw@cbnewsm.ATT.COM (Neil Weinstock) Distribution: na Organization: The Flying Squid Patrol Lines: 20