Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: "Antony Arciuolo" Newsgroups: scea.yaroze.programming.2d_graphics Subject: GsBG and the associated mess Date: 14 Jul 1998 02:22:41 GMT Organization: SCEA News Server Lines: 47 Message-ID: <01bdaecf$f87d5ab0$0100fc9d@skynet> NNTP-Posting-Host: nac-btr3-s38.nac.net X-Newsreader: Microsoft Internet News 4.70.1161 I am trying to set up a scrolling map based on tiles. Right now I just want it all of one cell type (it's supposed to be a flat grass field) I can do the following (I confirm I can do it via many "dump" programs that output the members of the various structures to the console using printf): - load a cell with the proper image. - convert that cell into a sprite and display the sprite to confirm that this works. - Init a map. - Set the map up to have the proper information and allocate the base and index members correctly. - Set an GsBG structure. The problem is setting the map pointer. GsBG has a member "GsMAP *map". First I set up a map, allocating the base and index. I set it to be configured (index accessing the correct base indices). then I set do this: GsBG Background; GsMAP map; ... // Here I set up the map and confirm that all data members are as they should be. ... Background.map = ↦ ... Now when I do a dump of Background.map->index[i] to see the values there is garbage there. Why is it doing this. Do I have to dynamically allocate the map, and then under that dynamically allocation base and index? Also, what is the general procedure for registering a GsBG? First I allocate a workspace using the equation in the book, then I run GsFixBg16 once. (I end up deallocating the workspace). Later in main, I allocate another workspace according to the same equation, then I run the GsSortBg16 with similar params as compared to GsSortSprites. Is this the proper method? Are there any example source codes for making backgrounds in this manner?