home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!cs.utexas.edu!sun-barr!olivea!apple!goofy!kip-56.apple.com!chris_russo
- From: chris_russo@gateway.qm.apple.com (Christopher Russo)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Fast copies from offscreen buffer to screen.
- Message-ID: <34529@goofy.apple.COM>
- Date: 13 Jan 93 00:38:33 GMT
- References: <1993Jan10.031829.25011@samba.oit.unc.edu>
- Sender: usenet@goofy.apple.COM
- Organization: Apple
- Lines: 32
-
- In article <1993Jan10.031829.25011@samba.oit.unc.edu> Michael Kohne,
- Michael.Kohne@launchpad.unc.edu writes:
- >I am currently involved with a friend of mine in writing a game. The
- >intent is for the game to be in full-color, and so we need a fast way to
- >copy large off-screen pixmaps to the screen. We've tried using copybits
- >(making sure to setup the offscreen ports with the same color table and
- >ctseed as the screen), but that has proven too slow for our uses. I've had
- >a go at writing my own fixed-depth copybits, but I've not yet found a way
- >to get it much faster than copybits is (on small images, my overhead is
- >so much lower that I beat copybits by a mile, but on screen-sized images
- >my stuff is only slightly better than copybits).
-
- Some things off the top of my head:
- - Try to keep both images a multiple of 4 bytes so that you're moving all longs.
- - Make sure that your images offscreen and onscreen are on longword boundaries.
- - Use large chunks of MOVEM.L d0-d7, (a0)+ to move the image. If possible, try
- to make your loop as large as possible (do as many MOVEM's as you can before you
- test for the end of the line.). This'll reduce your flexibility when it comes to variable
- image sizes, but it will speed things up.
-
-
- >Currently we are considering a 'dirty-rectangles' system, however, it is
- >likely that most of the screen will change on each frame (lots of moving
- >objects.) I know this sort of thing IS possible, I own hellcats over the
- >pacific and it looks like it's updating the whole screen each frame.
-
- I haven't seen hellcats, and I've never actually written a flight simulator, but I'd
- guess that games that draw large single-colored polygonal areas benefit
- tremendously from not having to read in a bit image.
- -----Christopher Russo
- ----- I admire a clever .sig message. Wish I had one. <sigh>
- ----- day 408.974.6070
-