home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!paladin.american.edu!gatech!nscf!lakes!rock
- From: rock@lakes.trenton.sc.us (Rockerboy)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: ScrollVPort vs ScrollRaster
- Message-ID: <ki21wB2w165w@lakes.trenton.sc.us>
- Date: Thu, 07 Jan 93 16:57:31 EST
- References: <1993Jan6.143558.20449@cis.ohio-state.edu>
- Reply-To: rock@lakes.trenton.sc.us (Rockerboy)
- Organization: Lakes Public Access
- Lines: 28
-
- juncewic@dodo.cis.ohio-state.edu (thomas michael juncewicz) writes:
-
- >
- > Calling all gurus,
- > I wish to write a game that uses 8-directional smooth-scrolling. I've
- > looked into ScrollVPort() and ScrollRaster(), but I'm confused (and
- > the RKM manual I have has 1 sentence about each function). The way I think
- > I understand it, ScrollRaster() actually moves data thru the BitMap(raster)
- > while ScrollVPort() just moves the ViewPort "window" around over different
- > parts of a BitMap. Is this right? If so, then ScrollRaster would seem
- > too slow to do the job (like if I had to scroll an entire screen of stuff)
- > and ScrollVPort wouldn't work either as my 'playfield' will be quite
- > large and therefore couldn't fit into 1 raster (1024 x 1024). So what do you
- > you all recommend? Oh, BTW, I want to be as system friendly as possible, so
- > I'd like suggestions that will work on other Amigas, from 1.3-3.0 KS and
- > 68000-68040. Plus, I'd prefer a C solution but I can work with assembly
- > if necessary...Thanx in advance.
-
- You simply make an enormous (or as close as you like) raster, then define
- your viewport as screen size. Then, by using scrollviewport and the
- offset addresses, you can move the viewport to another part of the raster
- smoothely. You just have to change the values in RxOffset and RyOffset
- in the viewport structure. Calling scrollviewport() makes the system
- re-eval the view according to the new offsets. This is all perfectly
- system friendly (well, of you're multi tasking, you should protect other
- stuff by setting up and IDCMP for rmb trap and requester traps in case
- some screen hopping window comes up, so you don't draw all over it with
- low level gfx commmands.)
-