flux Posted January 2, 2019 Share Posted January 2, 2019 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.) Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted January 3, 2019 Share Posted January 3, 2019 I might be wrong, but afair 64 wide is the smallest a 1-bit image can be. 2 Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted January 3, 2019 Share Posted January 3, 2019 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. 2 Quote Link to comment Share on other sites More sharing options...
joeyaage Posted January 4, 2019 Share Posted January 4, 2019 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! Quote Link to comment Share on other sites More sharing options...
ggn Posted January 4, 2019 Share Posted January 4, 2019 Alternatively you could change your object to 4bit colour depth, so each line then would need 16x4=64 bits (one phrase) Quote Link to comment Share on other sites More sharing options...
swapd0 Posted January 4, 2019 Share Posted January 4, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.