#144254 - felix123 - Tue Oct 30, 2007 10:40 pm
I'm having a problem with scaling. I want to shrink something at a constant rate from double size to half size in one second, and assuming a framerate of 60fps, I worked out the following code:
However, math.h doesn't seem to be supported, and with no floating point hardware, I assume this would be too time-consuming. Is there a better way to do this?
_________________
Nintendo DS homebrew on Wikipedia
Code: |
function spriteScale(u8 spriteindex, u16 scale) { // modify OAM } // ... int main() { // ... u8 x=1; spriteScale(0, 128); while (true) { // ... spritescale(0, (u16)pow(2,7+(x/30)); x++; swiWaitForVblank(); } return 0; } |
However, math.h doesn't seem to be supported, and with no floating point hardware, I assume this would be too time-consuming. Is there a better way to do this?
_________________
Nintendo DS homebrew on Wikipedia