home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18350 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  2.1 KB

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