Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!mips!apple!sat!farren From: farren@sat.com (Michael J. Farren) Newsgroups: comp.sys.amiga.programmer Subject: Re: Superbitmaps Message-ID: <1991Mar21.185704.25773@sat.com> Date: 21 Mar 91 18:57:04 GMT References: <1991Mar20.214447.7754@eecs.wsu.edu> Organization: SAT Lines: 39 pcooper@eecs.wsu.edu writes: > > I have a bunch of questions for the experts on this net. I am >currently working on a wargame, and I have run into several problems >using the superbitmap window type. > ... how do you keep track of the current position of the display in > reference to the superbitmap? Maintain an absolute coordinate relative to the big map. When you're filling the superbitmap, set a couple of variables to the offset of the superbitmap with respect to the "big" map. Your current display position with respect to the big map can be figured by something like this: AbsoluteCoord - SuperBitMapOffset - DisplayOffset = DisplayCoord. >Also, when the the superbitmap window is initially opened, >where is the display located on the superbitmap? Should be at 0,0, I would think. Might could be that you can pre-initialize the OffsetX and OffsetY coords in the superbitmap's Window struct, I don't know right offhand. >I'm trying desperately to be intuition friendly, but scrolllayer() and >scrollraster() are pitifully, PITIFULLY slow. Any suggestions? Well, you don't really need them, do you? These routines actually move the pixel data around in memory, and the point of a superbitmap is that you can cause the screen to scroll by simply changing the offsets - no data need move. There's a nice Leo Schwab hack that's pretty old that demonstrates using a superbitmap - it's on an early Fish disk, can't remember the name. As for your LoadRGB4 problem, I haven't a clue - that routine has always worked as advertised for me. -- +-----------------------------------------------------------------------+ | Michael J. Farren farren@sat.com | | He's moody, but he's cute. | +-----------------------------------------------------------------------+