Mickcy⑨⑨⑨
Junior Member
⑨⑨⑨
Cirno! Cirno! Cirno!
Posts: 59
|
Post by Mickcy⑨⑨⑨ on Jul 2, 2009 6:07:16 GMT -5
#include <SDL/SDL.h> int main(int,char**){SDL_Surface*s=SDL_SetVideoMode(640,480,8,0);SDL_Event e; int r,u,x,y,a=-1,b,h=s->h,z=s->pitch,q[]={0,r=91,u=140,200};Uint8*o,*p=(Uint8*) s->pixels+z;SDL_WM_SetCaption("MicroSand 2 by Max Nagl",0);while(!SDL_Flip(s)) {for(x=0;++x<s->w;p[x-z]=p[(h-2)*z+x]=1);for(o=p+(h-2)*z;--o>p;){if(*o-200)if ((*o>(b=*(o+z)))&&((r*=5)%((*o-b)/5+2)>5)){*(o+z)=*o;*o=b-1?b:0;}else if((b=*o) >*(o+(y=1))&&((r*=7)%97)>1||b>*(o+(y=a))){*o=*(o+y);*(o+y)=b-1?b:0;}}while( SDL_PollEvent(&e)){switch(e.type){case 2:u=q[e.key.keysym.sym%4];break;case 12: return 0;case 4:case 5:SDL_MouseMotionEvent m=e.motion;for(y=m.y-9;y++<m.y+9&& m.state;)for(x=m.x-9;x++<m.x+9;)if((x>a)*(x<s->w)*(y>a)*(y<h))p[y*z+x]=u;}}}} Does that make any sense to you?
|
|
|
Post by Will on Jul 2, 2009 13:49:52 GMT -5
No.
|
|
Mickcy⑨⑨⑨
Junior Member
⑨⑨⑨
Cirno! Cirno! Cirno!
Posts: 59
|
Post by Mickcy⑨⑨⑨ on Jul 3, 2009 2:44:22 GMT -5
It's the source code of a game(not mine), This one
|
|