+jedimatt42 Posted October 17, 2021 Share Posted October 17, 2021 This was a fun exercise... I always find I have to do some rework to get sprite definitions from some editor format to C anyway.. or take the assembly, and add an .asm module to the project.. that's usually the easiest... I'm sure I have magellen installed somewhere... but my needs are trivial... so how about trivial editing inline with my C code... Using VIM, I '/1' search for 1, and it highlights all them... that sticks around until I search for something else... The macro math is all performed at compile time, so it is just a chunk of bytes, in the correct order for the 16x16 pixel sprite... #define SPR16X(a,b,c,d, e,f,g,h, i,j,k,l, m,n,o,p) { \ a >> 8, b >> 8, c >> 8, d >> 8, e >> 8, f >> 8, g >> 8, h >> 8, \ i >> 8, j >> 8, k >> 8, l >> 8, m >> 8, n >> 8, o >> 8, p >> 8, \ a & 0xff, b & 0xff, c & 0xff, d & 0xff, e & 0xff, f & 0xff, g & 0xff, h & 0xff, \ i & 0xff, j & 0xff, k & 0xff, l & 0xff, m & 0xff, n & 0xff, o & 0xff, p & 0xff \ } 10 Quote Link to comment Share on other sites More sharing options...
matthew180 Posted October 17, 2021 Share Posted October 17, 2021 Pretty slick. I wish I was writing some code where I was needing to embed graphics. 2 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.