#include "m_logo.h" #include "jdraw.h" #include "jinput.h" #include namespace modules { namespace logo { struct pixel_t { int x, y; float distance; float angle; float di, dd, ai, ad; }; pixel_t pixels[200]; int num_pixels = 0; float d = 1; float a = 0; void get_dist_angle_from_xy(int pixel); void calculate_coords_from_dist_angle(int pixel); void init() { srand(SDL_GetTicks()); num_pixels = 0; draw::surface *surf = draw::getSurface("jailgames.gif"); for (int y=0; yh; ++y) for (int x=0; xw; ++x) if (surf->pixels[x+y*surf->w]!=0) { pixels[num_pixels].x = x; pixels[num_pixels].y = y; get_dist_angle_from_xy(num_pixels); pixels[num_pixels].dd = float((rand()%5)+1)/100.0f; pixels[num_pixels].ad = float((rand()%10)+1); pixels[num_pixels].di = 1; pixels[num_pixels].ai = 0; for (int i=0; i<40; ++i) { pixels[num_pixels].di += pixels[num_pixels].dd; pixels[num_pixels].ai += pixels[num_pixels].ad; } num_pixels++; } } int steps=0; bool loop() { if (input::keyDown(SDL_SCANCODE_ESCAPE)) { return false; } draw::cls(2); draw::color(1); if (steps < 40) { for (int i=0; i