Jump to content
Sign in to follow this  
flux

16x16 1bit sprite won't show up

Recommended Posts

I got stuck on this issue a while back and decided to get back into it and still wasn't able to come up with a solution so I'm going to try reaching out. I have a 1 bit 16x16 single frame sprite that refuses to show up. I tried making a 64x64 1 bit sprite using the same program and method and it seems to load ok (the palette seems off but it's there at least). But the 16x16 version inexplicably refuses to appear.

 

The changes I make in rapinit.s between the two are on these lines:

dc.l	16	; sprite_width	; width of sprite (in pixels)
dc.l	16	; sprite_height	; height of sprite (in pixels)
dc.l	1	; (BIT DEPTH)	; bitmap depth (1/2/4/8/16/24)
dc.l	16*16/8	; sprite_framesz	; size per frame in bytes of sprite data
dc.l	16/8	; sprite_bytewid	; width in bytes of one line of sprite data
dc.l	16/8	; sprite_gwidth	; GFX width (of data)

dc.l	64	; sprite_width	; width of sprite (in pixels)
dc.l	64	; sprite_height	; height of sprite (in pixels)
dc.l	1	; (BIT DEPTH)	; bitmap depth (1/2/4/8/64/24)
dc.l	64*64/8	; sprite_framesz	; size per frame in bytes of sprite data
dc.l	64/8	; sprite_bytewid	; width in bytes of one line of sprite data
dc.l	64/8	; sprite_gwidth	; GFX width (of data)

Besides specifying a different filename in assets.txt, that's really the only thing that changes and I'm not sure why it would show up in one instance and not the other. I did clear out the build files and everything when switching between the two different files. I'm still not 100% clear on the whole dividing by 8 or 2 thing but I feel like I have it correct there. Once, when playing around with those numbers I did get my sprite to appear when I changed sprite_bytewid to 16/2. It was as tall as it should be but was maybe 4 or 5 times as wide, like a big rectangle instead of a square with the graphic all distorted and messed around (not simply stretched). Both 16/16 and 16/4 left me with my sprite still not appearing, and 16/1 gave me an even wider rectangle, perhaps twice as wide. So it may well be the case that I'm doing something wrong in that rapinit.s file but as I have it there in the code paste, it simply doesn't appear at all.

 

(It might also be worth noting I don't have transparency turned on for that sprite or anything like that.)

Share this post


Link to post
Share on other sites

Objects have to be at least one phrase-wide, which is 64 pixels in 1-bit mode. If the width is less, you have to pad it to 64 pixels.

  • Like 2

Share this post


Link to post
Share on other sites

You could try using using blank space around your 16x16 sprite to make it up to 64 pixels wide by 16 pixels high. I think you should be okay with using 16 pixels for the height!

Share this post


Link to post
Share on other sites

Alternatively you could change your object to 4bit colour depth, so each line then would need 16x4=64 bits (one phrase)

Share this post


Link to post
Share on other sites

I think that if you want to draw a lot 16x16 pixels sprites, it's better to use a 4bits sprite because the OP don't waste time drawing empty pixels.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...