Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!gatech!lll-lcc!well!brent From: brent@well.UUCP Newsgroups: comp.sys.amiga Subject: VSprites: Fact or Fiction? Message-ID: <2492@well.UUCP> Date: Thu, 29-Jan-87 00:57:49 EST Article-I.D.: well.2492 Posted: Thu Jan 29 00:57:49 1987 Date-Received: Fri, 30-Jan-87 04:42:22 EST Lines: 42 Keywords: Amiga, VSprites, Bobs, Intuition, GELS I'm looking for help with VSprites, and I wonder if anyone has had any luck with them at all. I've tried creating and moving 4 VSprites around the display, both with a homemade View, and within the Intuition/Workbench envi- ronment. In both cases, I encounter no compilation or execution errors, but I never get any VSprites. Here is a summary of the major steps I take (using Intuition here): 1) Declare an extern struct Custom custom. For ON_DISPLAY & ON_SPRITE macros. 2) Open intuition.library and graphics.library. 3) Open a window on the workbench screen to get a pointer to the screen (could also be done by studying IntuitionBase, but this isn't important...). 4) Call InitGels() to initialize a GelsInfo structure (after reserving the first sprite for Intuition's use with the sprRsrvd byte). 5) Link the GelsInfo structure into the screen's RastPort. 6) Initialize the 4 VSprite structures with Height, X, Y, SprColors, ImageData, and VSPRITE Flag data. 7) Call AddVSprite() for each VSprite structure. 8) Loop until the window is closed, moving the VSprites together with the mouse by doing th following for each new mouse position (for each VSprite): a) Update the VSprite's X and Y members. b) Do an ON_DISPLAY and ON_SPRITE. These seem optional with the WB screen. c) Call SortGList() and DrawGList() for the screen's RastPort and ViewPort. d) Call MakeScreen() for WB screen and RethinkDisplay(). (For a custom View I substitute MrgCop() and LoadView() here) e) Call WaitTOF() and even WaitBlit() for good measure. 9) When the user closes the window, call RemVSprite() for all 4 VSprites. 10) Close the window and libraries, clean up any other allocated memory. As I said, I get no errors with this procedure, but neither do I see any VSprites. I created my Sprite images with DPaint, then used GetImage to get the data, and massaged the data into Sprite Image format. Everything is done as prescribed by the 1.1 developers' RKM manuals (with obvious corrections), and by the AMIGA Programmer's Handbook, 2nd edition. So far I've found no examples of VSprite code which works, except for when they are used in Bobs. I really don't see what's going wrong, but perhaps somebody has had better luck. If you can help me before my brain becomes Jello (R), please do! Thankee, brent