#118445 - Kheldar - Tue Feb 13, 2007 3:10 pm
I've just started writing code for the DS and am trying to make a rain effect for the hell of it. I've got rain working fine and now I want to add lightning as well.
I want to randomly decide if lightning should start, then quickly change the background colour from black through grey to white then back again. I've got the random chance done but my fillScreen() function it seems way to slow. It causes rain not to be drawn to random parts of the screen (I assume I'm talking too long in the Vblank to finish drawing?)
This is how I'm filling the screen with a colour:
Is there a way I could just fill the whole of VRAM with one colour (like memset?) instead of doing it per pixel? Do I need double buffering?
Thankyou!
I want to randomly decide if lightning should start, then quickly change the background colour from black through grey to white then back again. I've got the random chance done but my fillScreen() function it seems way to slow. It causes rain not to be drawn to random parts of the screen (I assume I'm talking too long in the Vblank to finish drawing?)
This is how I'm filling the screen with a colour:
Code: |
void fillScreen()
{ int i; for(i = 0; i < 256 * 192; i++) { VRAM_A[i] = RGB15(0,0,0); } } |
Is there a way I could just fill the whole of VRAM with one colour (like memset?) instead of doing it per pixel? Do I need double buffering?
Thankyou!