Xref: utzoo comp.sys.amiga.tech:180 comp.sys.amiga:17217 Path: utzoo!mnetor!uunet!husc6!uwvax!puff!avery From: avery@puff.cs.wisc.edu (Aaron Avery) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga Subject: Re: How to smooth scroll left? Message-ID: <1540@puff.cs.wisc.edu> Date: 5 Apr 88 18:48:08 GMT References: <4861@ecsvax.UUCP> <3313@csli.STANFORD.EDU> Reply-To: avery@puff.WISC.EDU (Aaron Avery) Organization: U of Wisconsin CS Dept Lines: 28 In article <3313@csli.STANFORD.EDU> kasper@csli.UUCP (Kasper Osterbye) writes: > Scroll of screen rasterport 1 to the left > Using the build in rasterscroll. Yes, ScrollRaster() is slow, since it has to move data in memory. >- Apply amiga-guru trick #71.4 for smooth scrolling backgrounds, only I OK, I'll tell you the best way I know of to do this and remain system- compatible. What you want to do is set up (and allocate) a BitMap which is the correct size for your entire background (if it's not too large). You then open your screen with CUSTOMBITMAP set, putting the BitMap into the NewScreen structure. Now, to actually do the scrolling, you find the screen's RasInfo structure, which is in its ViewPort structure, which can be found in its Screen structure. The value you want to manipulate is RasInfo->RxOffset. This controls the X offset into the bitmap at which the left edge of the screen begins. To update the display after changing the RxOffset, you might want to use ScrollVPort(), as it's the most system-compatible method, but I've found that it has flashing problems when there are many (more than 2) bitplanes present. You'll want to try it and see, tho. The other, faster, method is to call MakeVPort(), then MrgCop(), and then LoadView(). Hope this helps. Also, if your background is too large, you'll want to make a bitmap at least twice the width of the display, and do some judicious copying into it to effect a circular buffer. If you want more on this, please mail me. -- Aaron Avery (avery@puff.cs.wisc.edu) ({seismo,caip,allegra,harvard,rutgers,ihnp4}!uwvax!puff!avery)