gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > sprite question

#17530 - garfunkalow - Tue Mar 09, 2004 11:04 pm

can you put more than 1 sprite in a header file?

such as if i have 10 animations for each (4) direction for a sprite to 'walk' would i really have to have 40 include statements for all of the header files for it?
_________________
Computers are to Computer Science as Telescopes are to Astronomers

#17538 - garfunkalow - Tue Mar 09, 2004 11:42 pm

ok.. yeah i found out you can,

now i have a question about how to use the header file that gif2sprite makes

i have been following the guides over at thepernproject and the headers which pcx2gba are different than the ones gif2sprite makes. g2s has an RGB value for the pallette...

another question is if i am NOT using a 64x64 pixel sprite, how do i copy the data into the OAM and the such, can i have a 32x32 pixel sprite? smaller? mine is currently 24x25 should this be a problem?
_________________
Computers are to Computer Science as Telescopes are to Astronomers

#17542 - yaustar - Wed Mar 10, 2004 12:51 am

the gba handles sprites widths and heights of 8, 16, 32, 64 (see Cowbite Spec for the full expanded list)

If you want a 24x25 sprite drawing then you must resize it to 32x32 for the GBA to process and show it.

As for the RGB value..it is ok, there is a macro on the top of the file that converts it back to a representation that the GBA understands so you can load it straight into the memory.
_________________
[Blog] [Portfolio]

#17551 - sajiimori - Wed Mar 10, 2004 3:42 am

You should put exactly 0 sprite images in headers. See the FAQ.

#17565 - garfunkalow - Wed Mar 10, 2004 8:42 am

sajimori,

where in the FAQ does it say stuff on how to manipulate sprites?
_________________
Computers are to Computer Science as Telescopes are to Astronomers

#17579 - poslundc - Wed Mar 10, 2004 3:47 pm

The FAQ doesn't actually mention specifically that you shouldn't use .h files for data.

These threads do, however. I am toying with the notion of writing an auxillary FAQ on common pitfalls for beginners.

Dan.

#17582 - tepples - Wed Mar 10, 2004 5:48 pm

In fact, don't output data to .c/.h at all. It's inefficient to compile. Find the switches that get your data conversion tool to output to .s (assembly) instead, or just use GBFS.

And yes, another FAQ might work well.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#17586 - sajiimori - Wed Mar 10, 2004 7:22 pm

Sorry, my bad.

#17589 - garfunkalow - Wed Mar 10, 2004 7:52 pm

ok, gbfs seems pretty cool, coupla questions.. one: is there a tutorial for using it with dka?

two: with gbfs how would i reference an image? in openGL when i pull in a bitmap i have to load it... would it be like this?

three: AGBTTY seems like a pretty cool little thing... is it? and how would i get it to compile in with dka?

sorry about the questions, i will also search the forums about these!
_________________
Computers are to Computer Science as Telescopes are to Astronomers

#17613 - tepples - Thu Mar 11, 2004 3:16 am

garfunkalow wrote:
ok, gbfs seems pretty cool, coupla questions.. one: is there a tutorial for using it with dka?

You mean other than the README that comes with GBFS?

Quote:
two: with gbfs how would i reference an image? in openGL when i pull in a bitmap i have to load it... would it be like this?

Usually, you convert it to GBA native format before you stick it in a GBFS file. Then you can just copy the data into VRAM when you need it.
Code:
const unsigned int tile_size;  /* in bytes */
const unsigned int *tile_data = gbfs_get_obj(g_gbfs, "font.chr", &tile_size);
dma_memcpy(VRAM, tile_data, tile_size);


Quote:
three: AGBTTY seems like a pretty cool little thing... is it? and how would i get it to compile in with dka?

What problems have you had by following the instructions in the README?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#17614 - garfunkalow - Thu Mar 11, 2004 3:19 am

tepples.. sorry i am still really new to this kind of stuff, i have looked over them and i am utterly confused, i am not use make files and i am not too knowledgable about them, i am a *nix sysadmin but i don't generally compile my programs, sorry :(
_________________
Computers are to Computer Science as Telescopes are to Astronomers

#17615 - crossraleigh - Thu Mar 11, 2004 3:52 am

Quote:
i am not use make files and i am not too knowledgable about them, i am a *nix sysadmin but i don't generally compile my programs


Gee, a Unix system administrator that doesn't ever compile programs? Simply type make at the command prompt to build a program in the way specified by the makefile in the current directory. You will probably need to change a few variables in AGBTTY's makefile to compile it properly.

headspin does it fact have [url=http://members.iinet.net.au/~freeaxs/gbacomp/#GBFS%20(Gameboy%20File%20System)]a tutorial of sorts for GBFS[/url].

#17620 - garfunkalow - Thu Mar 11, 2004 5:36 am

right.. i know how to type in ./make and whatnot, just NOT how to make the 'make' file (on a side note: everheard of apt-get install or rpm -Uvh ??? ) anyway

thank-you for the link!
_________________
Computers are to Computer Science as Telescopes are to Astronomers

#17646 - crossraleigh - Thu Mar 11, 2004 9:26 pm

Quote:
right.. i know how to type in ./make and whatnot, just NOT how to make the 'make' file

But you don't type ./make, you type make which starts the GNU Make program which will parse the the makefile in the current directory (./Makefile).

You may be thinking of ./configure which is an executable in the current directory that will generate a makefile that will work on your system.

#17650 - garfunkalow - Thu Mar 11, 2004 10:39 pm

yeah... ./configure
make
make file

word yo
_________________
Computers are to Computer Science as Telescopes are to Astronomers

#17661 - sajiimori - Fri Mar 12, 2004 12:54 am

Quote:

everheard of apt-get install or rpm -Uvh ???

Ever heard of portability?