15 struct dust_mote motes[N_DUST_MOTES];
21 for(i=0; i<N_DUST_MOTES; i++) {
22 motes[i].x = frnd()*(XSIZE-5);
23 motes[i].y = frnd()*(YSIZE-5);
24 motes[i].z = MAX_DUST_DEPTH*sqrt(frnd());
25 b = (MAX_DUST_DEPTH - motes[i].z) * 255.0 / MAX_DUST_DEPTH;
26 motes[i].color = SDL_MapRGB(surf_screen->format, b, b, b);
34 float xscroll = screendx * t_frame;
35 float yscroll = screendy * t_frame;
37 for(i=0; i<N_DUST_MOTES; i++) {
38 motes[i].x -= xscroll / (1.3 + motes[i].z);
39 motes[i].x = fwrap(motes[i].x, XSIZE);
41 motes[i].y -= yscroll / (1.3 + motes[i].z);
42 motes[i].y = fwrap(motes[i].y, YSIZE);
50 uint16_t *pixels = surf_screen->pixels;
51 for(i=0; i<N_DUST_MOTES; i++) {
52 pixels[surf_screen->pitch/2*(int)motes[i].y + (int)motes[i].x] = motes[i].color;