diff --git a/includes/defines.h b/includes/defines.h index f3abed394..8fb8fc85a 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -174,8 +174,10 @@ void thumb_cache_inval(char *id); void thumb_cache_add(char *id, void *thumb, int size); int thumb_cache_find(char *id, void **thumb, int *size); void *build_thumb(int *size, int bzip2); -void *build_save(int *size, int x0, int y0, int w, int h); -int parse_save(void *save, int size, int replace, int x0, int y0); +void *build_save(int *size, int x0, int y0, int w, int h, unsigned char bmap[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr); +int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char bmap[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr, unsigned pmap[YRES][XRES]); +void clear_sim(void); void del_stamp(int d); void sdl_seticon(void); +int process_command(pixel *vid_buf, char *console, char *console_error); #endif diff --git a/includes/graphics.h b/includes/graphics.h index 4d4d438fb..b7bfdfa66 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -121,7 +121,7 @@ void xor_line(int x1, int y1, int x2, int y2, pixel *vid); void xor_rect(pixel *vid, int x, int y, int w, int h); void draw_parts(pixel *vid); - +void draw_wavelengths(pixel *vid, int x, int y, int h, int wl); void render_signs(pixel *vid_buf); void render_fire(pixel *dst); diff --git a/includes/icon.h b/includes/icon.h index 89b2c7f83..4eeff5ec3 100755 --- a/includes/icon.h +++ b/includes/icon.h @@ -18,5 +18,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -static unsigned char app_icon[] = { 0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0xD3,0xD9,0xE0,0xFF,0xD3,0xD9,0xE0,0xFF,0xD3,0xD9,0xE0,0xFF,0xD3,0xD9,0xE0,0xFF,0xD3,0xD9,0xE0,0xFF,0xD3,0xD9,0xE0,0xFF,0xD3,0xD9,0xE0,0xFF,0xD3,0xD9,0xE0,0xFF,0xD3,0xD9,0xE0,0xFF,0x68,0x79,0x91,0xFF,0xD3,0xD9,0xE0,0xFF,0x68,0x79,0x91,0xFF,0xD3,0xD9,0xE0,0xFF,0x68,0x79,0x91,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x05,0x06,0x06,0xFF,0x09,0x09,0x0A,0xFF,0x2F,0x08,0x08,0xFF,0x56,0x06,0x07,0xFF,0x23,0x06,0x06,0xFF,0x85,0x02,0x06,0xFF,0xE5,0x02,0x07,0xFF,0xF2,0x1E,0x08,0xFF,0xED,0x0A,0x08,0xFF,0x60,0x07,0x08,0xFF,0x5F,0x08,0x08,0xFF,0x68,0x08,0x08,0xFF,0x18,0x07,0x08,0xFF,0x05,0x04,0x04,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0xB6,0x00,0x00,0xFF,0xD3,0x00,0x00,0xFF,0xEE,0x00,0x00,0xFF,0xF9,0x00,0x00,0xFF,0x91,0x00,0x00,0xFF,0xDD,0x15,0x00,0xFF,0xFF,0x74,0x00,0xFF,0xFF,0xBF,0x00,0xFF,0xFC,0x37,0x00,0xFF,0xAE,0x00,0x00,0xFF,0xD7,0x00,0x00,0xFF,0xFA,0x00,0x00,0xFF,0xE5,0x01,0x00,0xFF,0xB3,0x00,0x00,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0xF9,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xE9,0x00,0x00,0xFF,0xFA,0x90,0x02,0xFF,0xFF,0xFF,0x1A,0xFF,0xFF,0xFF,0x19,0xFF,0xFF,0xA4,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xF6,0x00,0x00,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0xE8,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xB7,0x2E,0xFF,0xFF,0xFF,0xA1,0xFF,0xFF,0xFF,0x8A,0xFF,0xFF,0xFA,0x3E,0xFF,0xFF,0x63,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xE3,0x00,0x00,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0xE4,0x00,0x00,0xFF,0xFF,0x21,0x00,0xFF,0xFF,0x61,0x00,0xFF,0xFF,0x94,0x00,0xFF,0xFF,0x8C,0x00,0xFF,0xFF,0xE1,0x5C,0xFF,0xFF,0xFF,0xCD,0xFF,0xFF,0xFF,0xAE,0xFF,0xFF,0xFF,0x6F,0xFF,0xFF,0xF9,0x1D,0xFF,0xFF,0xC3,0x00,0xFF,0xFF,0x99,0x00,0xFF,0xFF,0x48,0x00,0xFF,0xDF,0x00,0x00,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0xC5,0x00,0x00,0xFF,0xFF,0x64,0x00,0xFF,0xFF,0xEF,0x09,0xFF,0xFF,0xFF,0x46,0xFF,0xFF,0xFF,0x84,0xFF,0xFF,0xFF,0xD3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBC,0xFF,0xFF,0xFF,0x86,0xFF,0xFF,0xFF,0x69,0xFF,0xFF,0xFF,0x19,0xFF,0xFF,0x81,0x00,0xFF,0xD0,0x01,0x00,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0xB1,0x00,0x00,0xFF,0xEC,0x14,0x00,0xFF,0xFF,0x90,0x13,0xFF,0xFF,0xF9,0x8E,0xFF,0xFF,0xFF,0xE6,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xFF,0xFF,0xF2,0xC9,0xFF,0xFF,0xFA,0xBD,0xFF,0xFF,0xFF,0xA8,0xFF,0xFF,0xFC,0x9A,0xFF,0xFF,0xA4,0x2A,0xFF,0xFD,0x15,0x00,0xFF,0xEB,0x00,0x00,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x00,0x00,0x00,0xFF,0x47,0x14,0x14,0xFF,0x47,0x14,0x14,0xFF,0x00,0x00,0x00,0xFF,0x1F,0x30,0xD5,0xFF,0x1F,0x30,0xD5,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x79,0x79,0x79,0xFF,0x79,0x79,0x79,0xFF,0x00,0x00,0x00,0xFF,0xD7,0xF1,0x00,0xFF,0xD7,0xF1,0x00,0xFF,0x00,0x00,0x00,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF,0x8F,0x92,0x97,0xFF }; +static unsigned char app_icon[] = {0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0xd3,0xd9,0xe0,0xff,0xd3,0xd9,0xe0,0xff,0xd3,0xd9,0xe0,0xff,0xd3,0xd9,0xe0,0xff,0xd3,0xd9,0xe0,0xff,0xd3,0xd9,0xe0,0xff,0xd3,0xd9,0xe0,0xff,0xd3,0xd9,0xe0,0xff,0xd3,0xd9,0xe0,0xff,0x68,0x79,0x91,0xff,0xd3,0xd9,0xe0,0xff,0x68,0x79,0x91,0xff,0xd3,0xd9,0xe0,0xff,0x68,0x79,0x91,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x56,0x03,0x08,0xff,0xdb,0x07,0x05,0xff,0xff,0xc4,0x10,0xff,0xff,0xfe,0x14,0xff,0xff,0xff,0x23,0xff,0xff,0xff,0x16,0xff,0xff,0x9a,0x0a,0xff,0xff,0x64,0x0c,0xff,0xff,0x44,0x0a,0xff,0xff,0x22,0x0b,0xff,0xc0,0x24,0x0d,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0xff,0x24,0x00,0xff,0xff,0x96,0x1c,0xff,0xff,0xff,0x89,0xff,0xff,0xff,0x30,0xff,0xff,0xfd,0x00,0xff,0xff,0xd6,0x03,0xff,0xff,0x63,0x01,0xff,0xff,0x9a,0x00,0xff,0xff,0xbe,0x0a,0xff,0xff,0x5e,0x00,0xff,0xc3,0x0c,0x0c,0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0xff,0xe2,0x41,0xff,0xff,0xff,0xd8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe9,0xff,0xff,0xf3,0x43,0xff,0xff,0xe8,0x00,0xff,0xff,0xfb,0x15,0xff,0xff,0xff,0x62,0xff,0xff,0xff,0xc6,0xff,0xff,0xff,0x5b,0xff,0xc2,0x77,0x08,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0xff,0xff,0xcc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc6,0xff,0xff,0xff,0x99,0xff,0xff,0xff,0xd5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xcf,0xff,0xc4,0xae,0x26,0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0xff,0xda,0x87,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfd,0xfd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xcd,0xff,0xc1,0x89,0x20,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0xff,0x68,0x09,0xff,0xff,0xf5,0x72,0xff,0xff,0xff,0xbf,0xff,0xff,0xff,0xe0,0xff,0xff,0xff,0xe5,0xff,0xff,0xfd,0xcf,0xff,0xff,0xf5,0xcd,0xff,0xff,0xff,0xd4,0xff,0xff,0xff,0xd0,0xff,0xff,0xf2,0x3d,0xff,0xc3,0x48,0x03,0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x98,0x15,0x0f,0xff,0xaf,0x3d,0x09,0xff,0xad,0x4f,0x0d,0xff,0xae,0x6b,0x1b,0xff,0xb0,0x76,0x1e,0xff,0xa1,0x36,0x08,0xff,0x95,0x26,0x07,0xff,0xad,0x5b,0x16,0xff,0xbf,0x99,0x26,0xff,0xad,0x59,0x09,0xff,0x76,0x22,0x16,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff,0x8f,0x92,0x97,0xff}; static unsigned char app_icon_w32[] = { 0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x44,0x47,0x49,0x00,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x44,0x46,0x48,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x86,0x88,0x8A,0xFF,0xD8,0xDE,0xE6,0xFF,0xD1,0xD7,0xDF,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0xD1,0xD7,0xDE,0xFF,0x68,0x79,0x91,0xFF,0xD1,0xD7,0xDE,0xFF,0x68,0x79,0x91,0xFF,0xD1,0xD7,0xDE,0xFF,0x68,0x79,0x91,0xFF,0xD1,0xD7,0xDE,0xFF,0x81,0x84,0x88,0xFF,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x83,0x85,0x89,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x02,0x00,0x00,0xFF,0x06,0x00,0x00,0xFF,0x05,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x1E,0x00,0x00,0xFF,0x07,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x05,0x00,0x00,0xFF,0x03,0x00,0x00,0xFF,0x02,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x14,0x00,0x00,0xFF,0xE1,0x01,0x00,0xFF,0xF4,0x03,0x00,0xFF,0x24,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x7F,0x81,0x86,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x05,0x00,0x00,0xFF,0x0F,0x00,0x00,0xFF,0x05,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x03,0x00,0x00,0xFF,0x36,0x01,0x00,0xFF,0x06,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x02,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x07,0x00,0x00,0xFF,0x06,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x1A,0x00,0x00,0xFF,0xE7,0x0A,0x01,0xFF,0xFF,0x07,0x01,0xFF,0x41,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x7F,0x81,0x85,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x1A,0x00,0x00,0xFF,0x16,0x01,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x0B,0x00,0x00,0xFF,0x55,0x02,0x00,0xFF,0x04,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x02,0x00,0x00,0xFF,0x03,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x39,0x00,0x00,0xFF,0xF8,0x1B,0x02,0xFF,0xFF,0x2F,0x03,0xFF,0x52,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x7F,0x81,0x85,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x1C,0x00,0x00,0xFF,0x5C,0x01,0x00,0xFF,0x09,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x36,0x01,0x00,0xFF,0xAE,0x04,0x01,0xFF,0x02,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x50,0x00,0x00,0xFF,0xFE,0x44,0x02,0xFF,0xFF,0x5C,0x03,0xFF,0x60,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x7F,0x81,0x85,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x12,0x00,0x00,0xFF,0x9F,0x02,0x00,0xFF,0x49,0x01,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x73,0x04,0x00,0xFF,0xEC,0x09,0x01,0xFF,0x2B,0x00,0x00,0xFF,0x06,0x00,0x00,0xFF,0x13,0x00,0x00,0xFF,0x07,0x00,0x00,0xFF,0x04,0x00,0x00,0xFF,0x04,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x4E,0x06,0x00,0xFF,0xFF,0xC1,0x08,0xFF,0xFD,0x9A,0x07,0xFF,0x49,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x7F,0x81,0x85,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x8B,0x01,0x00,0xFF,0xD5,0x03,0x00,0xFF,0x07,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x03,0x00,0x00,0xFF,0xB7,0x0D,0x01,0xFF,0xFF,0x0F,0x02,0xFF,0xDE,0x00,0x00,0xFF,0xAB,0x00,0x00,0xFF,0xA5,0x01,0x00,0xFF,0x3D,0x00,0x00,0xFF,0x02,0x00,0x00,0xFF,0x03,0x00,0x00,0xFF,0x03,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x8B,0x35,0x03,0xFF,0xFF,0xF0,0x0E,0xFF,0xDF,0x4B,0x01,0xFF,0x14,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0x00,0x00,0x00,0xFF,0x55,0x00,0x00,0xFF,0xFF,0x05,0x01,0xFF,0x73,0x01,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x1B,0x00,0x00,0xFF,0xE5,0x0F,0x01,0xFF,0xFF,0x0D,0x02,0xFF,0xFF,0x04,0x01,0xFF,0xFF,0x03,0x00,0xFF,0xFF,0x01,0x00,0xFF,0x8F,0x00,0x00,0xFF,0x02,0x00,0x00,0xFF,0x02,0x00,0x00,0xFF,0x03,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x1B,0x00,0x00,0xFF,0xD9,0x47,0x03,0xFF,0xFF,0x92,0x06,0xFF,0xAF,0x12,0x00,0xFF,0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0x20,0x00,0x00,0xFF,0xE5,0x08,0x01,0xFF,0xD1,0x04,0x01,0xFF,0x0E,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x30,0x01,0x00,0xFF,0xF6,0x47,0x04,0xFF,0xFF,0x1F,0x02,0xFF,0xFF,0x03,0x01,0xFF,0xFF,0x06,0x01,0xFF,0xFF,0x03,0x00,0xFF,0xC7,0x01,0x00,0xFF,0x1F,0x00,0x00,0xFF,0x03,0x00,0x00,0xFF,0x06,0x01,0x00,0xFF,0x00,0x00,0x00,0xFF,0x38,0x02,0x00,0xFF,0xFB,0x72,0x07,0xFF,0xFF,0x5A,0x03,0xFF,0x73,0x01,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0xA1,0x02,0x00,0xFF,0xFF,0x0C,0x03,0xFF,0x7B,0x01,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x3B,0x06,0x00,0xFF,0xFF,0xBB,0x0C,0xFF,0xFF,0x56,0x04,0xFF,0xFF,0x00,0x01,0xFF,0xFF,0x10,0x03,0xFF,0xFF,0x02,0x01,0xFF,0xDE,0x01,0x00,0xFF,0x34,0x00,0x00,0xFF,0x03,0x00,0x00,0xFF,0x05,0x01,0x00,0xFF,0x00,0x00,0x00,0xFF,0x3B,0x03,0x00,0xFF,0xFC,0x83,0x06,0xFF,0xFF,0x71,0x03,0xFF,0x83,0x05,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0xFB,0x18,0x03,0xFF,0xFF,0x0E,0x02,0xFF,0xB9,0x00,0x00,0xFF,0x06,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x21,0x01,0x00,0xFF,0xE8,0xB9,0x0F,0xFF,0xFF,0x8F,0x0C,0xFF,0xFF,0x02,0x00,0xFF,0xFF,0x3C,0x04,0xFF,0xFF,0x16,0x02,0xFF,0xFD,0x00,0x00,0xFF,0x63,0x00,0x00,0xFF,0x02,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x40,0x0B,0x00,0xFF,0xFE,0xAD,0x06,0xFF,0xFF,0xC9,0x06,0xFF,0xCC,0x45,0x02,0xFF,0x08,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0xFF,0x49,0x03,0xFF,0xFF,0x7E,0x03,0xFF,0xFF,0x45,0x01,0xFF,0x67,0x05,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x09,0x00,0x00,0xFF,0xCC,0xA0,0x08,0xFF,0xFB,0xAA,0x0A,0xFF,0xC9,0x00,0x00,0xFF,0xFE,0x6B,0x03,0xFF,0xFF,0x79,0x02,0xFF,0xF9,0x0A,0x00,0xFF,0x4C,0x00,0x00,0xFF,0x02,0x00,0x00,0xFF,0x08,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x3F,0x14,0x00,0xFF,0xFC,0xDF,0x10,0xFF,0xFF,0xFF,0x10,0xFF,0xFA,0xCD,0x14,0xFF,0x46,0x0C,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0xFF,0x7F,0x03,0xFF,0xFF,0xFF,0x06,0xFF,0xFF,0xE7,0x03,0xFF,0xD5,0x39,0x01,0xFF,0x0E,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x1A,0x06,0x00,0xFF,0xEA,0xCF,0x17,0xFF,0xE2,0xA6,0x10,0xFF,0x32,0x00,0x00,0xFF,0xCB,0x80,0x06,0xFF,0xFF,0xF4,0x09,0xFF,0xD8,0x44,0x00,0xFF,0x10,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x07,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x44,0x21,0x00,0xFF,0xFD,0xE9,0x1C,0xFF,0xFF,0xD6,0x09,0xFF,0xFF,0xFF,0x28,0xFF,0xB4,0x75,0x04,0xFF,0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0xFF,0x8D,0x03,0xFF,0xFF,0xFF,0x41,0xFF,0xFF,0xFF,0x3F,0xFF,0xFF,0x7E,0x01,0xFF,0x4C,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x49,0x30,0x04,0xFF,0xFF,0xFC,0x5A,0xFF,0xB0,0x7E,0x14,0xFF,0x00,0x00,0x00,0xFF,0x89,0x66,0x0F,0xFF,0xFF,0xFF,0x6B,0xFF,0xE6,0xA7,0x1E,0xFF,0x1E,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x6F,0x5A,0x18,0xFF,0xFF,0xFE,0x70,0xFF,0xCD,0x6C,0x04,0xFF,0xE8,0xB5,0x27,0xFF,0xFE,0xF3,0x60,0xFF,0x6E,0x3D,0x08,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0xDB,0x8A,0x26,0xFF,0xFF,0xFF,0xD5,0xFF,0xFF,0xFF,0xD8,0xFF,0xFF,0xCF,0x3A,0xFF,0x94,0x12,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x15,0x0A,0x01,0xFF,0xBF,0xAC,0x7E,0xFF,0xFF,0xFF,0xDE,0xFF,0x82,0x5F,0x20,0xFF,0x00,0x00,0x00,0xFF,0x67,0x5B,0x28,0xFF,0xFF,0xFF,0xF3,0xFF,0xFF,0xF1,0xAA,0xFF,0x5D,0x2E,0x07,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x18,0x0D,0x02,0xFF,0xD0,0xC0,0x90,0xFF,0xFF,0xFF,0xF4,0xFF,0x92,0x61,0x27,0xFF,0x72,0x3F,0x0F,0xFF,0xFF,0xFF,0xE2,0xFF,0xFA,0xE5,0xAE,0xFF,0x80,0x4B,0x19,0xFF,0x02,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0xC9,0xA1,0x64,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xB2,0xFF,0xA1,0x33,0x03,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x01,0x00,0x00,0xFF,0x96,0x7E,0x5E,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7E,0x6A,0x41,0xFF,0x00,0x00,0x00,0xFF,0x7F,0x75,0x56,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xA9,0x8D,0x54,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x8C,0x69,0x4F,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x93,0x82,0x58,0xFF,0x16,0x05,0x00,0xFF,0xEB,0xDB,0xB8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF2,0xBD,0xFF,0x62,0x42,0x14,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0xA3,0x7F,0x47,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xDD,0xA4,0xFF,0x51,0x19,0x02,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x04,0x00,0x00,0xFF,0xD0,0xB6,0x88,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x6A,0x5A,0x39,0xFF,0x00,0x00,0x00,0xFF,0x85,0x7D,0x4E,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xB4,0xA5,0x73,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0xB5,0x9B,0x6F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8B,0x78,0x4E,0xFF,0x00,0x00,0x00,0xFF,0xCC,0xAE,0x7E,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x74,0x38,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0x24,0x14,0x03,0xFF,0x8C,0x7E,0x44,0xFF,0xA2,0x8E,0x5D,0xFF,0x5B,0x37,0x17,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x71,0x46,0x1E,0xFF,0xCB,0xA4,0x71,0xFF,0xAC,0x93,0x66,0xFF,0x17,0x0E,0x04,0xFF,0x00,0x00,0x00,0xFF,0x30,0x23,0x0A,0xFF,0xBF,0xA4,0x60,0xFF,0xC4,0xAC,0x78,0xFF,0x43,0x34,0x1A,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x5C,0x3D,0x18,0xFF,0xC9,0xA9,0x6F,0xFF,0xB8,0x94,0x63,0xFF,0x2A,0x19,0x07,0xFF,0x00,0x00,0x00,0xFF,0x53,0x3B,0x16,0xFF,0xC7,0xB6,0x70,0xFF,0xBD,0xA2,0x66,0xFF,0x2C,0x1C,0x09,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0x00,0x00,0x00,0xFF,0x47,0x14,0x14,0xFF,0x47,0x14,0x14,0xFF,0x00,0x00,0x00,0xFF,0x1F,0x30,0xD6,0xFF,0x1F,0x30,0xD6,0xFF,0x00,0x00,0x00,0xFF,0xF7,0x0F,0x00,0xFF,0xF7,0x0F,0x00,0xFF,0x00,0x00,0x00,0xFF,0xC8,0x47,0x0E,0xFF,0xC8,0x47,0x0E,0xFF,0x00,0x00,0x00,0xFF,0x20,0xE6,0x0F,0xFF,0x20,0xE6,0x0F,0xFF,0x00,0x00,0x00,0xFF,0xEB,0xF5,0x22,0xFF,0xEB,0xF5,0x22,0xFF,0x00,0x00,0x00,0xFF,0x40,0x40,0x40,0xFF,0x79,0x79,0x79,0xFF,0x00,0x00,0x00,0xFF,0x79,0x79,0x79,0xFF,0x79,0x79,0x79,0xFF,0x00,0x00,0x00,0xFF,0xD7,0xF1,0x00,0xFF,0xD7,0xF1,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x81,0x84,0x88,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0x81,0x84,0x88,0xFF,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x44,0x46,0x48,0x00,0x7A,0x7D,0x81,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x83,0x86,0x8A,0xFF,0x86,0x89,0x8C,0xFF,0x89,0x8C,0x8F,0xFF,0x87,0x8A,0x8F,0xFF,0x85,0x87,0x8B,0xFF,0x82,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x81,0x84,0x88,0xFF,0x44,0x46,0x48,0x00,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x04,0x03,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00,0x03,0x05,0x04,0x00 }; \ No newline at end of file diff --git a/includes/misc.h b/includes/misc.h index 4094b3931..a929f8c62 100644 --- a/includes/misc.h +++ b/includes/misc.h @@ -71,4 +71,27 @@ void *file_load(char *fn, int *size); int cpu_check(void); +// a b +// c d +struct matrix2d {float a,b,c,d;}; +typedef struct matrix2d matrix2d; + +// column vector +struct vector2d {float x,y;}; +typedef struct vector2d vector2d; + +matrix2d m2d_multiply_m2d(matrix2d m1, matrix2d m2); +vector2d m2d_multiply_v2d(matrix2d m, vector2d v); +matrix2d m2d_multiply_float(matrix2d m, float s); +vector2d v2d_multiply_float(vector2d v, float s); + +vector2d v2d_add(vector2d v1, vector2d v2); +vector2d v2d_sub(vector2d v1, vector2d v2); + +matrix2d m2d_new(float me0, float me1, float me2, float me3); +vector2d v2d_new(float x, float y); + +extern vector2d v2d_zero; +extern matrix2d m2d_identity; + #endif diff --git a/includes/powder.h b/includes/powder.h index 581c8da4a..d7e4daa0e 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -5,6 +5,7 @@ #include "graphics.h" #include "defines.h" #include "interface.h" +#include "misc.h" #define CM_COUNT 11 #define CM_CRACK 10 @@ -863,5 +864,6 @@ int flood_parts(int x, int y, int c, int cm, int bm); int create_parts(int x, int y, int rx, int ry, int c); void create_line(int x1, int y1, int x2, int y2, int rx, int ry, int c); +void *transform_save(void *odata, int *size, matrix2d transform, vector2d translate); #endif diff --git a/src/elements/fwrk.c b/src/elements/fwrk.c index 06390c59d..5095cde5e 100644 --- a/src/elements/fwrk.c +++ b/src/elements/fwrk.c @@ -16,7 +16,7 @@ int update_FWRK(UPDATE_FUNC_ARGS) { } if (parts[i].life>=45) parts[i].life=0; - if ((parts[i].life<3&&parts[i].life>0)||parts[i].vy>6&&parts[i].life>0) + if ((parts[i].life<3&&parts[i].life>0)||(parts[i].vy>6&&parts[i].life>0)) { int q = (rand()%255+1); int w = (rand()%255+1); diff --git a/src/elements/prto.c b/src/elements/prto.c index 8f743e702..fbbd5a13f 100644 --- a/src/elements/prto.c +++ b/src/elements/prto.c @@ -6,8 +6,8 @@ int update_PRTO(UPDATE_FUNC_ARGS) { parts[i].tmp = (int)((parts[i].temp-73.15f)/100+1); if (parts[i].tmp>=CHANNELS) parts[i].tmp = CHANNELS-1; else if (parts[i].tmp<0) parts[i].tmp = 0; - for (rx=-1; rx<2; rx++) - for (ry=-1; ry<2; ry++) + for (rx=1; rx>-2; rx--) + for (ry=1; ry>-2; ry--) if (x+rx>=0 && y+ry>0 && x+rx8) - randomness=8; + if (randomness>9) + randomness=9; if (portal[parts[i].tmp][randomness-1][nnx]==PT_SPRK)// TODO: make it look better { create_part(-1,x+1,y,portal[parts[i].tmp][randomness-1][nnx]); diff --git a/src/elements/stkm.c b/src/elements/stkm.c index 6d6b4ab55..fc6dc55e3 100644 --- a/src/elements/stkm.c +++ b/src/elements/stkm.c @@ -184,9 +184,11 @@ int update_STKM(UPDATE_FUNC_ARGS) { if (x+rx>=0 && y+ry>0 && x+rx>8)>=NPART) + r = photons[y+ry][x+rx]; if (!r || (r>>8)>=NPART) continue; - if (ptypes[r&0xFF].falldown!=0 || (r&0xFF) == PT_NEUT || (r&0xFF) == PT_PHOT) // TODO: photons are not in the pmap. This line may not work as intended. + if (ptypes[r&0xFF].falldown!=0 || (r&0xFF) == PT_NEUT || (r&0xFF) == PT_PHOT) { player[2] = r&0xFF; //Current element } @@ -225,26 +227,27 @@ int update_STKM(UPDATE_FUNC_ARGS) { } else { + int np = -1; if (player[2] == SPC_AIR) create_parts(rx + 3*((((int)player[1])&0x02) == 0x02) - 3*((((int)player[1])&0x01) == 0x01), ry, 4, 4, SPC_AIR); else - create_part(-1, rx, ry, player[2]); - - r = pmap[ry][rx]; - if ( ((r>>8) < NPART) && (r>>8)>=0 && player[2] != PT_PHOT && player[2] != SPC_AIR) - parts[r>>8].vx = parts[r>>8].vx + 5*((((int)player[1])&0x02) == 0x02) - 5*(((int)(player[1])&0x01) == 0x01); - if (((r>>8) < NPART) && (r>>8)>=0 && player[2] == PT_PHOT) + np = create_part(-1, rx, ry, player[2]); + if ( (np < NPART) && np>=0 && player[2] != PT_PHOT && player[2] != SPC_AIR) + parts[np].vx = parts[np].vx + 5*((((int)player[1])&0x02) == 0x02) - 5*(((int)(player[1])&0x01) == 0x01); + if ((np < NPART) && np>=0 && player[2] == PT_PHOT) { int random = abs(rand()%3-1)*3; if (random==0) { - parts[r>>8].life = 0; - parts[r>>8].type = PT_NONE; + kill_part(np); } else { - parts[r>>8].vy = 0; - parts[r>>8].vx = (((((int)player[1])&0x02) == 0x02) - (((int)(player[1])&0x01) == 0x01))*random; + parts[np].vy = 0; + if (((int)player[1])&(0x01|0x02)) + parts[np].vx = (((((int)player[1])&0x02) == 0x02) - (((int)(player[1])&0x01) == 0x01))*random; + else + parts[np].vx = random; } } diff --git a/src/elements/stkm2.c b/src/elements/stkm2.c index 319e388b3..79dbbdfbc 100644 --- a/src/elements/stkm2.c +++ b/src/elements/stkm2.c @@ -184,9 +184,11 @@ int update_STKM2(UPDATE_FUNC_ARGS) { if (x+rx>=0 && y+ry>0 && x+rx>8)>=NPART) + r = photons[y+ry][x+rx]; if (!r || (r>>8)>=NPART) continue; - if (ptypes[r&0xFF].falldown!=0 || (r&0xFF) == PT_NEUT || (r&0xFF) == PT_PHOT) // TODO: photons are not in the pmap. This line may not work as intended. + if (ptypes[r&0xFF].falldown!=0 || (r&0xFF) == PT_NEUT || (r&0xFF) == PT_PHOT) { player2[2] = r&0xFF; //Current element } @@ -225,26 +227,27 @@ int update_STKM2(UPDATE_FUNC_ARGS) { } else { + int np = -1; if (player2[2] == SPC_AIR) create_parts(rx + 3*((((int)player2[1])&0x02) == 0x02) - 3*((((int)player2[1])&0x01) == 0x01), ry, 4, 4, SPC_AIR); else - create_part(-1, rx, ry, player2[2]); - - r = pmap[ry][rx]; - if ( ((r>>8) < NPART) && (r>>8)>=0 && player2[2] != PT_PHOT && player2[2] != SPC_AIR) - parts[r>>8].vx = parts[r>>8].vx + 5*((((int)player2[1])&0x02) == 0x02) - 5*(((int)(player2[1])&0x01) == 0x01); - if (((r>>8) < NPART) && (r>>8)>=0 && player2[2] == PT_PHOT) + np = create_part(-1, rx, ry, player2[2]); + if ((np < NPART) && np>=0 && player2[2] != PT_PHOT && player2[2] != SPC_AIR) + parts[np].vx = parts[np].vx + 5*((((int)player2[1])&0x02) == 0x02) - 5*(((int)(player2[1])&0x01) == 0x01); + if ((np < NPART) && np>=0 && player2[2] == PT_PHOT) { int random = abs(rand()%3-1)*3; if (random==0) { - parts[r>>8].life = 0; - parts[r>>8].type = PT_NONE; + kill_part(np); } else { - parts[r>>8].vy = 0; - parts[r>>8].vx = (((((int)player2[1])&0x02) == 0x02) - (((int)(player2[1])&0x01) == 0x01))*random; + parts[np].vy = 0; + if (((int)player2[1])&(0x01|0x02)) + parts[np].vx = (((((int)player2[1])&0x02) == 0x02) - (((int)(player2[1])&0x01) == 0x01))*random; + else + parts[np].vx = random; } } diff --git a/src/graphics.c b/src/graphics.c index cea2ba72a..fb3d384f5 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1573,31 +1573,27 @@ void draw_parts(pixel *vid) } else if (parts[i].type==PT_GLOW) { - fg = 0; - fb = 0; - fr = 0; - if (pv[ny/CELL][nx/CELL]>0) { - fg = 6 * pv[ny/CELL][nx/CELL]; - fb = 4 * pv[ny/CELL][nx/CELL]; - fr = 2 * pv[ny/CELL][nx/CELL]; - } - vid[ny*(XRES+BARSIZE)+nx] = PIXRGB((int)restrict_flt(0x44 + fr*8, 0, 255), (int)restrict_flt(0x88 + fg*8, 0, 255), (int)restrict_flt(0x44 + fb*8, 0, 255)); + fr = restrict_flt(parts[i].temp-(275.13f+32.0f), 0, 128)/50.0f; + fg = restrict_flt(parts[i].ctype, 0, 128)/50.0f; + fb = restrict_flt(parts[i].tmp, 0, 128)/50.0f; + + cr = restrict_flt(64.0f+parts[i].temp-(275.13f+32.0f), 0, 255); + cg = restrict_flt(64.0f+parts[i].ctype, 0, 255); + cb = restrict_flt(64.0f+parts[i].tmp, 0, 255); - /*x = nx/CELL; + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr, cg, cb); + x = nx/CELL; y = ny/CELL; fg += fire_g[y][x]; - if(fg > 255) fg = 255; - fire_g[y][x] = fg; + if (fg > 255) fg = 255; + fire_g[y][x] = fg; fb += fire_b[y][x]; - if(fb > 255) fb = 255; - fire_b[y][x] = fb; + if (fb > 255) fb = 255; + fire_b[y][x] = fb; fr += fire_r[y][x]; - if(fr > 255) fr = 255; - fire_r[y][x] = fr;*/ + if (fr > 255) fr = 255; + fire_r[y][x] = fr; - cr = (int)restrict_flt(0x44 + fr*8, 0, 255); - cg = (int)restrict_flt(0x88 + fg*8, 0, 255); - cb = (int)restrict_flt(0x44 + fb*8, 0, 255); for (x=-1; x<=1; x++) { for (y=-1; y<=1; y++) @@ -1893,10 +1889,16 @@ void draw_parts(pixel *vid) } if (cr>255) cr=255; + if (cr<0) + cr=0; if (cg>255) cg=255; + if (cg<0) + cg=0; if (cb>255) cb=255; + if (cb<0) + cb=0; blendpixel(vid, nx, ny, cr, cg, cb, 255); } else if (t==PT_WIFI) @@ -2143,6 +2145,7 @@ void draw_parts(pixel *vid) else if (t==PT_BRAY && parts[i].tmp==0) { int trans = parts[i].life * 7; + if (trans>255) trans = 255; if (parts[i].ctype) { cg = 0; cb = 0; @@ -2167,6 +2170,7 @@ void draw_parts(pixel *vid) else if (t==PT_BRAY && parts[i].tmp==1) { int trans = parts[i].life/4; + if (trans>255) trans = 255; if (parts[i].ctype) { cg = 0; cb = 0; @@ -2191,6 +2195,7 @@ void draw_parts(pixel *vid) else if (t==PT_BRAY && parts[i].tmp==2) { int trans = parts[i].life*100; + if (trans>255) trans = 255; blendpixel(vid, nx, ny, 255, 150, 50, trans); } else if (t==PT_PHOT) @@ -2920,6 +2925,36 @@ void draw_parts(pixel *vid) } +void draw_wavelengths(pixel *vid, int x, int y, int h, int wl) +{ + int i,cr,cg,cb,j; + int tmp; + fillrect(vid,x-1,y-1,30+1,h+1,64,64,64,255); // coords -1 size +1 to work around bug in fillrect - TODO: fix fillrect + for (i=0;i<30;i++) + { + if ((wl>>i)&1) + { + // Need a spread of wavelengths to get a smooth spectrum, 5 bits seems to work reasonably well + if (i>2) tmp = 0x1F << (i-2); + else tmp = 0x1F >> (2-i); + cg = 0; + cb = 0; + cr = 0; + for (j=0; j<12; j++) { + cr += (tmp >> (j+18)) & 1; + cb += (tmp >> j) & 1; + } + for (j=0; j<14; j++) + cg += (tmp >> (j+9)) & 1; + tmp = 624/(cr+cg+cb+1); + cr *= tmp; + cg *= tmp; + cb *= tmp; + for (j=0;j255?255:cr,cg>255?255:cg,cb>255?255:cb,255); + } + } +} + void render_signs(pixel *vid_buf) { int i, j, x, y, w, h, dx, dy,mx,my,b=1,bq; diff --git a/src/interface.c b/src/interface.c index b13917dee..8ba00a54f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -479,7 +479,7 @@ void draw_svf_ui(pixel *vid_buf) c = svf_login ? 255 : 128; drawtext(vid_buf, 40, YRES+(MENUSIZE-14), "\x82", c, c, c, 255); if (svf_open) - drawtext(vid_buf, 58, YRES+(MENUSIZE-12), svf_name, c, c, c, 255); + drawtextmax(vid_buf, 58, YRES+(MENUSIZE-12), 125, svf_name, c, c, c, 255); else drawtext(vid_buf, 58, YRES+(MENUSIZE-12), "[untitled simulation]", c, c, c, 255); drawrect(vid_buf, 37, YRES+(MENUSIZE-16), 150, 14, c, c, c, 255); @@ -505,7 +505,7 @@ void draw_svf_ui(pixel *vid_buf) drawtext(vid_buf, 222, YRES+(MENUSIZE-15), "\x83", c, c, c, 255); if (svf_tags[0]) - drawtextmax(vid_buf, 240, YRES+(MENUSIZE-12), 154, svf_tags, c, c, c, 255); + drawtextmax(vid_buf, 240, YRES+(MENUSIZE-12), XRES+BARSIZE-405, svf_tags, c, c, c, 255); else drawtext(vid_buf, 240, YRES+(MENUSIZE-12), "[no tags set]", c, c, c, 255); @@ -516,7 +516,7 @@ void draw_svf_ui(pixel *vid_buf) drawtext(vid_buf, XRES-122+BARSIZE/*388*/, YRES+(MENUSIZE-13), "\x84", 255, 255, 255, 255); if (svf_login) - drawtext(vid_buf, XRES-104+BARSIZE/*406*/, YRES+(MENUSIZE-12), svf_user, 255, 255, 255, 255); + drawtextmax(vid_buf, XRES-104+BARSIZE/*406*/, YRES+(MENUSIZE-12), 66, svf_user, 255, 255, 255, 255); else drawtext(vid_buf, XRES-104+BARSIZE/*406*/, YRES+(MENUSIZE-12), "[sign in]", 255, 255, 255, 255); drawrect(vid_buf, XRES-125+BARSIZE/*385*/, YRES+(MENUSIZE-16), 91, 14, 255, 255, 255, 255); @@ -1203,8 +1203,9 @@ finish: int save_name_ui(pixel *vid_buf) { - int x0=(XRES-420)/2,y0=(YRES-68-YRES/4)/2,b=1,bq,mx,my,ths,nd=0; + int x0=(XRES-420)/2,y0=(YRES-68-YRES/4)/2,b=1,bq,mx,my,ths,idtxtwidth,nd=0; void *th; + char *save_id_text; ui_edit ed; ui_edit ed2; ui_checkbox cb; @@ -1240,6 +1241,10 @@ int save_name_ui(pixel *vid_buf) ed2.cursor = strlen(svf_description); ed2.multiline = 1; strcpy(ed2.str, svf_description); + + save_id_text = malloc(strlen("Current save id: ")+strlen(svf_id)+1); + sprintf(save_id_text,"Current save id: %s",svf_id); + idtxtwidth = textwidth(save_id_text); cb.x = x0+10; cb.y = y0+53+YRES/4; @@ -1275,6 +1280,12 @@ int save_name_ui(pixel *vid_buf) drawrect(vid_buf, x0, y0+74+YRES/4, 192, 16, 192, 192, 192, 255); draw_line(vid_buf, x0+192, y0, x0+192, y0+90+YRES/4, 150, 150, 150, XRES+BARSIZE); + + if (svf_id[0]) + { + fillrect(vid_buf, (XRES+BARSIZE-idtxtwidth)/2-5, YRES+(MENUSIZE-16), idtxtwidth+10, 14, 0, 0, 0, 255); + drawtext(vid_buf, (XRES+BARSIZE-idtxtwidth)/2, YRES+MENUSIZE-12, save_id_text, 255, 255, 255, 255); + } sdl_blit(0, 0, (XRES+BARSIZE), YRES+MENUSIZE, vid_buf, (XRES+BARSIZE)); @@ -1332,6 +1343,7 @@ int save_name_ui(pixel *vid_buf) } } free(th); + if (save_id_text) free(save_id_text); return 0; } @@ -2732,7 +2744,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) int nyd,nyu,ry,lv; float ryf; - char *uri, *uri_2, *o_uri; + char *uri, *uri_2, *o_uri, *save_id_text; void *data, *info_data; save_info *info = malloc(sizeof(save_info)); void *http = NULL, *http_2 = NULL; @@ -2750,6 +2762,9 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) drawrect(vid_buf, 50, 50, (XRES/2)+1, (YRES/2)+1, 255, 255, 255, 155); drawrect(vid_buf, 50+(XRES/2)+1, 50, XRES+BARSIZE-100-((XRES/2)+1), YRES+MENUSIZE-100, 155, 155, 155, 255); drawtext(vid_buf, 50+(XRES/4)-textwidth("Loading...")/2, 50+(YRES/4), "Loading...", 255, 255, 255, 128); + + save_id_text = malloc(strlen("Save id: ")+strlen(save_id)+1); + sprintf(save_id_text,"Save id: %s",save_id); ed.x = 57+(XRES/2)+1; ed.y = YRES+MENUSIZE-118; @@ -2825,11 +2840,12 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) data = http_async_req_stop(http, &status, &data_size); if (status == 200) { + pixel *full_save; if (!data||!data_size) { error_ui(vid_buf, 0, "Save data is empty (may be corrupt)"); break; } - pixel *full_save = prerender_save(data, data_size, &imgw, &imgh); + full_save = prerender_save(data, data_size, &imgw, &imgh); if (full_save!=NULL) { save_pic = rescale_img(full_save, imgw, imgh, &thumb_w, &thumb_h, 2); data_ready = 1; @@ -2939,6 +2955,10 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) drawrect(vid_buf, XRES+BARSIZE-100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 255); drawtext(vid_buf, XRES+BARSIZE-90, YRES+MENUSIZE-63, "Submit", 255, 255, 255, 255); } + + cix = textwidth(save_id_text); + fillrect(vid_buf, (XRES+BARSIZE-cix)/2-5, YRES+(MENUSIZE-16), cix+10, 14, 0, 0, 0, 255); + drawtext(vid_buf, (XRES+BARSIZE-cix)/2, YRES+MENUSIZE-12, save_id_text, 255, 255, 255, 255); //Open Button bc = openable?255:150; @@ -3056,7 +3076,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) if (queue_open) { if (info_ready && data_ready) { // Do Open! - status = parse_save(data, data_size, 1, 0, 0); + status = parse_save(data, data_size, 1, 0, 0, bmap, fvx, fvy, signs, parts, pmap); if (!status) { //if(svf_last) //free(svf_last); @@ -3125,6 +3145,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) if (!b) break; } + if (save_id_text) free(save_id_text); //Close open connections if (http) http_async_req_close(http); @@ -3577,7 +3598,7 @@ void execute_save(pixel *vid_buf) plens[0] = strlen(svf_name); parts[1] = svf_description; plens[1] = strlen(svf_description); - parts[2] = build_save(plens+2, 0, 0, XRES, YRES); + parts[2] = build_save(plens+2, 0, 0, XRES, YRES, bmap, fvx, fvy, signs, parts); parts[3] = build_thumb(plens+3, 1); parts[4] = (svf_publish==1)?"Public":"Private"; plens[4] = strlen((svf_publish==1)?"Public":"Private"); diff --git a/src/main.c b/src/main.c index 165742512..7f49d9b0a 100644 --- a/src/main.c +++ b/src/main.c @@ -210,7 +210,7 @@ void sdl_seticon(void) //SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(app_icon_w32, 32, 32, 32, 128, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); //SDL_WM_SetIcon(icon, NULL/*app_icon_mask*/); #else - SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(app_icon, 16, 16, 32, 128, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); + SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(app_icon, 16, 16, 32, 64, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); SDL_WM_SetIcon(icon, NULL/*app_icon_mask*/); #endif #endif @@ -296,11 +296,12 @@ void *build_thumb(int *size, int bzip2) return d; } -void *build_save(int *size, int x0, int y0, int w, int h) +void *build_save(int *size, int x0, int y0, int w, int h, unsigned char bmap[YRES/CELL][XRES/CELL], float fvx[YRES/CELL][XRES/CELL], float fvy[YRES/CELL][XRES/CELL], sign signs[MAXSIGNS], void* partsptr) { unsigned char *d=calloc(1,3*(XRES/CELL)*(YRES/CELL)+(XRES*YRES)*11+MAXSIGNS*262), *c; int i,j,x,y,p=0,*m=calloc(XRES*YRES, sizeof(int)); int bx0=x0/CELL, by0=y0/CELL, bw=(w+CELL-1)/CELL, bh=(h+CELL-1)/CELL; + particle *parts = partsptr; // normalize coordinates x0 = bx0*CELL; @@ -339,7 +340,8 @@ void *build_save(int *size, int x0, int y0, int w, int h) y = (int)(parts[i].y+0.5f); if (x>=x0 && x=y0 && y 50) it = 50; @@ -1657,7 +1671,7 @@ int main(int argc, char *argv[]) bsy = 0; } } - if (sdl_key=='d'&&(sdl_mod & (KMOD_CTRL)) || (sdl_key=='d' && !isplayer2)) + if ((sdl_key=='d'&&(sdl_mod & (KMOD_CTRL))) || (sdl_key=='d' && !isplayer2)) DEBUG_MODE = !DEBUG_MODE; if (sdl_key=='i') { @@ -1783,17 +1797,41 @@ int main(int argc, char *argv[]) } } } - if (sdl_key=='r'&&(sdl_mod & (KMOD_CTRL))&&(sdl_mod & (KMOD_SHIFT))) + if (load_mode==1) { - save_mode = 1; - copy_mode = 4;//invert + matrix2d transform = m2d_identity; + vector2d translate = v2d_zero; + void *ndata; + int doTransform = 0; + if (sdl_key=='r'&&(sdl_mod & (KMOD_CTRL))&&(sdl_mod & (KMOD_SHIFT))) + { + transform = m2d_new(-1,0,0,1); //horizontal invert + doTransform = 1; + } + else if (sdl_key=='r'&&(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))) + { + transform = m2d_new(0,1,-1,0); //rotate anticlockwise 90 degrees + doTransform = 1; + } + else if (sdl_mod & (KMOD_CTRL)) + { + doTransform = 1; + if (sdl_key==SDLK_LEFT) translate = v2d_new(-1,0); + else if (sdl_key==SDLK_RIGHT) translate = v2d_new(1,0); + else if (sdl_key==SDLK_UP) translate = v2d_new(0,-1); + else if (sdl_key==SDLK_DOWN) translate = v2d_new(0,1); + else doTransform = 0; + } + if (doTransform) + { + ndata = transform_save(load_data, &load_size, transform, translate); + if (ndata!=load_data) free(load_data); + free(load_img); + load_data = ndata; + load_img = prerender_save(load_data, load_size, &load_w, &load_h); + } } - else if (sdl_key=='r'&&(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))) - { - save_mode = 1; - copy_mode = 3;//rotate - } - else if (sdl_key=='r') + if (sdl_key=='r'&&!(sdl_mod & (KMOD_CTRL|KMOD_SHIFT))) GENERATION = 0; if (sdl_key=='x'&&(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))) { @@ -1944,8 +1982,13 @@ int main(int argc, char *argv[]) if (DEBUG_MODE) { int tctype = parts[cr>>8].ctype; - if (tctype>=PT_NUM) + if (tctype>=PT_NUM || (cr&0xFF)==PT_PHOT) tctype = 0; + if ((cr&0xFF)==PT_PIPE) + { + if (parts[cr>>8].tmp>8].tmp; + else tctype = 0; + } sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); sprintf(coordtext, "#%d, X:%d Y:%d", cr>>8, x/sdl_scale, y/sdl_scale); } else { @@ -1955,6 +1998,7 @@ int main(int argc, char *argv[]) sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f); #endif } + if ((cr&0xFF)==PT_PHOT) wavelength_gfx = parts[cr>>8].ctype; } else { @@ -2128,7 +2172,7 @@ int main(int argc, char *argv[]) if (load_y<0) load_y=0; if (bq==1 && !b) { - parse_save(load_data, load_size, 0, load_x, load_y); + parse_save(load_data, load_size, 0, load_x, load_y, bmap, fvx, fvy, signs, parts, pmap); free(load_data); free(load_img); load_mode = 0; @@ -2170,35 +2214,19 @@ int main(int argc, char *argv[]) { if (copy_mode==1) { - clipboard_data=build_save(&clipboard_length, save_x*CELL, save_y*CELL, save_w*CELL, save_h*CELL); + clipboard_data=build_save(&clipboard_length, save_x*CELL, save_y*CELL, save_w*CELL, save_h*CELL, bmap, fvx, fvy, signs, parts); clipboard_ready = 1; save_mode = 0; copy_mode = 0; } else if (copy_mode==2) { - clipboard_data=build_save(&clipboard_length, save_x*CELL, save_y*CELL, save_w*CELL, save_h*CELL); + clipboard_data=build_save(&clipboard_length, save_x*CELL, save_y*CELL, save_w*CELL, save_h*CELL, bmap, fvx, fvy, signs, parts); clipboard_ready = 1; save_mode = 0; copy_mode = 0; clear_area(save_x*CELL, save_y*CELL, save_w*CELL, save_h*CELL); } - else if (copy_mode==3)//rotation - { - if (save_h>save_w) - save_w = save_h; - rotate_area(save_x*CELL, save_y*CELL, save_w*CELL, save_w*CELL,0);//just do squares for now - save_mode = 0; - copy_mode = 0; - } - else if (copy_mode==4)//invertion - { - if (save_h>save_w) - save_w = save_h; - rotate_area(save_x*CELL, save_y*CELL, save_w*CELL, save_w*CELL,1);//just do squares for now - save_mode = 0; - copy_mode = 0; - } else { stamp_save(save_x*CELL, save_y*CELL, save_w*CELL, save_h*CELL); @@ -2256,19 +2284,7 @@ int main(int argc, char *argv[]) } if (x>=(XRES+BARSIZE-(510-367)) && x<=(XRES+BARSIZE-(510-383)) && !bq) { - memset(signs, 0, sizeof(signs)); - memset(pv, 0, sizeof(pv)); - memset(vx, 0, sizeof(vx)); - memset(vy, 0, sizeof(vy)); - memset(fvx, 0, sizeof(fvx)); - memset(fvy, 0, sizeof(fvy)); - memset(bmap, 0, sizeof(bmap)); - memset(emap, 0, sizeof(emap)); - memset(parts, 0, sizeof(particle)*NPART); - memset(photons, 0, sizeof(photons)); - memset(wireless, 0, sizeof(wireless)); - memset(gol2, 0, sizeof(gol2)); - memset(portal, 0, sizeof(portal)); + clear_sim(); for (i=0; i=(XRES+BARSIZE-(510-385)) && x<=(XRES+BARSIZE-(510-476))) { @@ -2330,7 +2337,7 @@ int main(int argc, char *argv[]) } if (x>=19 && x<=35 && svf_last && svf_open && !bq) { //int tpval = sys_pause; - parse_save(svf_last, svf_lsize, 1, 0, 0); + parse_save(svf_last, svf_lsize, 1, 0, 0, bmap, fvx, fvy, signs, parts, pmap); //sys_pause = tpval; } if (x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) @@ -2420,7 +2427,7 @@ int main(int argc, char *argv[]) { for (j=-bsy; j<=bsy; j++) for (i=-bsx; i<=bsx; i++) - if ((CURRENT_BRUSH==CIRCLE_BRUSH && (pow(i,2))/(pow(bsx,2))+(pow(j,2))/(pow(bsy,2))<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=bsy*bsx)) + if (x+i>0 && y+j>0 && x+isave_w) - save_w = save_h; - xor_rect(vid_buf, save_x*CELL, save_y*CELL, save_w*CELL, save_w*CELL); - } - else - xor_rect(vid_buf, save_x*CELL, save_y*CELL, save_w*CELL, save_h*CELL); + xor_rect(vid_buf, save_x*CELL, save_y*CELL, save_w*CELL, save_h*CELL); da = 51; db = 269; } @@ -2703,6 +2703,8 @@ int main(int argc, char *argv[]) fillrect(vid_buf, XRES-20-textwidth(coordtext), 280, textwidth(coordtext)+8, 13, 0, 0, 0, 140); drawtext(vid_buf, XRES-16-textwidth(coordtext), 282, coordtext, 255, 255, 255, 200); } + if (wavelength_gfx) + draw_wavelengths(vid_buf,XRES-20-textwidth(heattext),265,2,wavelength_gfx); } else { @@ -2713,6 +2715,8 @@ int main(int argc, char *argv[]) fillrect(vid_buf, 12, 280, textwidth(coordtext)+8, 13, 0, 0, 0, 140); drawtext(vid_buf, 16, 282, coordtext, 255, 255, 255, 200); } + if (wavelength_gfx) + draw_wavelengths(vid_buf,12,265,2,wavelength_gfx); } } else @@ -2724,7 +2728,10 @@ int main(int argc, char *argv[]) fillrect(vid_buf, XRES-20-textwidth(coordtext), 26, textwidth(coordtext)+8, 11, 0, 0, 0, 140); drawtext(vid_buf, XRES-16-textwidth(coordtext), 27, coordtext, 255, 255, 255, 200); } + if (wavelength_gfx) + draw_wavelengths(vid_buf,XRES-20-textwidth(heattext),11,2,wavelength_gfx); } + wavelength_gfx = 0; fillrect(vid_buf, 12, 12, textwidth(uitext)+8, 15, 0, 0, 0, 140); drawtext(vid_buf, 16, 16, uitext, 32, 216, 255, 200); @@ -2738,7 +2745,7 @@ int main(int argc, char *argv[]) console = console_ui(vid_buf,console_error); console = mystrdup(console); strcpy(console_error,""); - if(process_command(vid_buf,console,&console_error)==-1) + if(process_command(vid_buf,console,console_error)==-1) { free(console); break; @@ -2788,7 +2795,7 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { { return -1; } - else if(strcmp(console2, "file")==0 && console3) + else if(strcmp(console2, "file")==0) { if(file_script){ FILE *f=fopen(console3, "r"); @@ -2802,8 +2809,7 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { ny = 0; j = 0; m = 0; - if(console4) - console_parse_coords(console4, &nx , &ny, console_error); + console_parse_coords(console4, &nx , &ny, console_error); memset(pch,0,sizeof(pch)); memset(fileread,0,sizeof(fileread)); fread(fileread,1,5000,f); @@ -2878,12 +2884,12 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { } } - else if(strcmp(console2, "sound")==0 && console3) + else if(strcmp(console2, "sound")==0) { if (sound_enable) play_sound(console3); else strcpy(console_error, "Audio device not available - cannot play sounds"); } - else if(strcmp(console2, "load")==0 && console3) + else if(strcmp(console2, "load")==0) { j = atoi(console3); if(j) @@ -2892,7 +2898,7 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { console_mode = 0; } } - else if(strcmp(console2, "if")==0 && console3) + else if(strcmp(console2, "if")==0) { if(strcmp(console3, "type")==0)//TODO: add more than just type, and be able to check greater/less than { @@ -2908,7 +2914,7 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { return 0; } } - else if (strcmp(console2, "create")==0 && console3 && console4) + else if (strcmp(console2, "create")==0) { if (console_parse_type(console3, &j, console_error) && console_parse_coords(console4, &nx, &ny, console_error)) @@ -2919,12 +2925,12 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { strcpy(console_error, "Could not create particle"); } } - else if ((strcmp(console2, "delete")==0 || strcmp(console2, "kill")==0) && console3) + else if (strcmp(console2, "delete")==0 || strcmp(console2, "kill")==0) { if (console_parse_partref(console3, &i, console_error)) kill_part(i); } - else if(strcmp(console2, "reset")==0 && console3) + else if(strcmp(console2, "reset")==0) { if(strcmp(console3, "pressure")==0) { @@ -2965,7 +2971,7 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { } } } - else if(strcmp(console2, "set")==0 && console3 && console4 && console5) + else if(strcmp(console2, "set")==0) { if(strcmp(console3, "life")==0) { @@ -3230,7 +3236,7 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { } } else - sprintf(console_error, "Invalid Command", console2); + strcpy(console_error, "Invalid Command"); } return 1; } diff --git a/src/misc.c b/src/misc.c index c98c5a3c0..eb54dfb0e 100644 --- a/src/misc.c +++ b/src/misc.c @@ -306,3 +306,68 @@ int cpu_check(void) #endif return 0; } + +matrix2d m2d_multiply_m2d(matrix2d m1, matrix2d m2) +{ + matrix2d result = { + m1.a*m2.a+m1.b*m2.c, m1.a*m2.b+m1.b*m2.d, + m1.c*m2.a+m1.d*m2.c, m1.c*m2.b+m1.d*m2.d + }; + return result; +} +vector2d m2d_multiply_v2d(matrix2d m, vector2d v) +{ + vector2d result = { + m.a*v.x+m.b*v.y, + m.c*v.x+m.d*v.y + }; + return result; +} +matrix2d m2d_multiply_float(matrix2d m, float s) +{ + matrix2d result = { + m.a*s, m.b*s, + m.c*s, m.d*s, + }; + return result; +} + +vector2d v2d_multiply_float(vector2d v, float s) +{ + vector2d result = { + v.x*s, + v.y*s + }; + return result; +} + +vector2d v2d_add(vector2d v1, vector2d v2) +{ + vector2d result = { + v1.x+v2.x, + v1.y+v2.y + }; + return result; +} +vector2d v2d_sub(vector2d v1, vector2d v2) +{ + vector2d result = { + v1.x-v2.x, + v1.y-v2.y + }; + return result; +} + +matrix2d m2d_new(float me0, float me1, float me2, float me3) +{ + matrix2d result = {me0,me1,me2,me3}; + return result; +} +vector2d v2d_new(float x, float y) +{ + vector2d result = {x, y}; + return result; +} + +vector2d v2d_zero = {0,0}; +matrix2d m2d_identity = {1,0,0,1}; diff --git a/src/powder.c b/src/powder.c index e93f88d79..523b99088 100644 --- a/src/powder.c +++ b/src/powder.c @@ -139,6 +139,8 @@ int try_move(int i, int x, int y, int nx, int ny) if (x==nx && y==ny) return 1; + if (nx<0 || ny<0 || nx>=XRES || ny>=YRES) + return 1; e = eval_move(parts[i].type, nx, ny, &r); @@ -253,9 +255,23 @@ int try_move(int i, int x, int y, int nx, int ny) e = r >> 8; if (r && e>8)==e) pmap[ny][nx] = (s&~(0xFF))|parts[s>>8].type; + parts[e].x = x; + parts[e].y = y; + pmap[y][x] = (e<<8)|parts[e].type; + parts[s>>8].x = nx; + parts[s>>8].y = ny; + return 1; + } + if ((pmap[ny][nx]>>8)==e) pmap[ny][nx] = 0; parts[e].x += x-nx; parts[e].y += y-ny; @@ -460,7 +476,7 @@ inline void part_change_type(int i, int x, int y, int t) if (x<0 || y<0 || x>=XRES || y>=YRES || i>=NPART || t<0 || t>=PT_NUM) return; parts[i].type = t; - if (t==PT_PHOT)// || t==PT_NEUT) + if (t==PT_PHOT || t==PT_NEUT) { photons[y][x] = t|(i<<8); if ((pmap[y][x]>>8)==i) @@ -491,7 +507,7 @@ inline int create_n_parts(int n, int x, int y, float vx, float vy, int t) if (x<0 || y<0 || x>=XRES || y>=YRES || t<0 || t>=PT_NUM) return -1; - for (c; c>8].type = PT_STKM; - parts[pmap[y][x]>>8].vx = 0; - parts[pmap[y][x]>>8].vy = 0; - parts[pmap[y][x]>>8].life = 100; - parts[pmap[y][x]>>8].ctype = 0; - parts[pmap[y][x]>>8].temp = ptypes[t].heat; - - } - else - { - parts[i].x = (float)x; - parts[i].y = (float)y; - parts[i].type = PT_STKM; - parts[i].vx = 0; - parts[i].vy = 0; - parts[i].life = 100; - parts[i].ctype = 0; - parts[i].temp = ptypes[t].heat; - } - - + parts[i].x = (float)x; + parts[i].y = (float)y; + parts[i].type = PT_STKM; + parts[i].vx = 0; + parts[i].vy = 0; + parts[i].life = 100; + parts[i].ctype = 0; + parts[i].temp = ptypes[t].heat; player[3] = x-1; //Setting legs positions player[4] = y+6; @@ -794,7 +793,6 @@ inline int create_part(int p, int x, int y, int t) { return -1; } - //kill_part(playerspawn); create_part(-1,x,y,PT_SPAWN); ISSPAWN1 = 1; } @@ -802,29 +800,14 @@ inline int create_part(int p, int x, int y, int t) { if (isplayer2==0) { - if (pmap[y][x]&0xFF==PT_SPAWN2) - { - parts[pmap[y][x]>>8].type = PT_STKM2; - parts[pmap[y][x]>>8].vx = 0; - parts[pmap[y][x]>>8].vy = 0; - parts[pmap[y][x]>>8].life = 100; - parts[pmap[y][x]>>8].ctype = 0; - parts[pmap[y][x]>>8].temp = ptypes[t].heat; - - } - else - { - parts[i].x = (float)x; - parts[i].y = (float)y; - parts[i].type = PT_STKM2; - parts[i].vx = 0; - parts[i].vy = 0; - parts[i].life = 100; - parts[i].ctype = 0; - parts[i].temp = ptypes[t].heat; - } - - + parts[i].x = (float)x; + parts[i].y = (float)y; + parts[i].type = PT_STKM2; + parts[i].vx = 0; + parts[i].vy = 0; + parts[i].life = 100; + parts[i].ctype = 0; + parts[i].temp = ptypes[t].heat; player2[3] = x-1; //Setting legs positions player2[4] = y+6; @@ -852,13 +835,14 @@ inline int create_part(int p, int x, int y, int t) { return -1; } - //kill_part(player2spawn); create_part(-1,x,y,PT_SPAWN2); ISSPAWN2 = 1; } if (t==PT_BIZR||t==PT_BIZRG) parts[i].ctype = 0x47FFFF; - if (t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT)// && t!=PT_NEUT) is this needed? it breaks floodfill, Yes photons should not be placed in the PMAP + if (t==PT_PHOT||t==PT_NEUT) + photons[y][x] = t|(i<<8); + if (t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT && t!=PT_NEUT) // is this needed? it breaks floodfill, Yes photons should not be placed in the PMAP pmap[y][x] = t|(i<<8); return i; @@ -1342,7 +1326,7 @@ void update_particles_i(pixel *vid, int start, int inc) { r = pmap[ny][nx]; neighbors = gol2[nx][ny][0]; - if(neighbors==0 || !(ptypes[r&0xFF].properties&PROP_LIFE || !r&0xFF) || (r>>8)>=NPART) + if(neighbors==0 || !(ptypes[r&0xFF].properties&PROP_LIFE || !(r&0xFF)) || (r>>8)>=NPART) continue; for ( golnum = 1; golnum<=NGOL; golnum++) for ( goldelete = 0; goldelete<9; goldelete++) @@ -2054,13 +2038,13 @@ killed: if (ny!=y || nx!=x) { if ((pmap[y][x]>>8)==i) pmap[y][x] = 0; - else if (t==PT_PHOT&&(photons[y][x]>>8)==i) photons[y][x] = 0; + else if ((photons[y][x]>>8)==i) photons[y][x] = 0; if (nx=XRES-CELL || ny=YRES-CELL) { kill_part(i); continue; } - if (t==PT_PHOT) + if (t==PT_PHOT||t==PT_NEUT) photons[ny][nx] = t|(i<<8); else pmap[ny][nx] = t|(i<<8); @@ -2095,12 +2079,13 @@ void update_particles(pixel *vid) t = parts[i].type; x = (int)(parts[i].x+0.5f); y = (int)(parts[i].y+0.5f); - if (x>=0 && y>=0 && x=0 && y>=0 && x>8)<=NPART&&rtpmap[cy][cx]) - { - parts[rtpmap[(int)(cy+0.5f)][(int)(cx+0.5f)]>>8].x = area_x +cx; - parts[rtpmap[(int)(cy+0.5f)][(int)(cx+0.5f)]>>8].y = area_y +cy; - } - bmap[(area_y+cy)/CELL][(area_x+cx)/CELL] = rtbmap[cy/CELL][cx/CELL]; - fvy[(area_y+cy)/CELL][(area_x+cx)/CELL] = tfvy[cy/CELL][cx/CELL]; - fvx[(area_y+cy)/CELL][(area_x+cx)/CELL] = tfvx[cy/CELL][cx/CELL]; - } - } - } -#endif -} - void clear_area(int area_x, int area_y, int area_w, int area_h) { int cx = 0; @@ -2731,14 +2632,10 @@ void create_box(int x1, int y1, int x2, int y2, int c) int flood_parts(int x, int y, int c, int cm, int bm) { int x1, x2, dy = (c=UI_WALLSTART&&c<=UI_WALLSTART+UI_WALLCOUNT) - { - wall = c-100; - } if (cm==-1) { if (c==0) @@ -2754,7 +2651,7 @@ int flood_parts(int x, int y, int c, int cm, int bm) } if (bm==-1) { - if (wall==WL_ERASE) + if (c-UI_WALLSTART+UI_ACTUALSTART==WL_ERASE) { bm = bmap[y/CELL][x/CELL]; if (!bm) @@ -3073,3 +2970,109 @@ void create_line(int x1, int y1, int x2, int y2, int rx, int ry, int c) } } } + +void *transform_save(void *odata, int *size, matrix2d transform, vector2d translate) +{ + void *ndata; + unsigned char bmapo[YRES/CELL][XRES/CELL], bmapn[YRES/CELL][XRES/CELL]; + particle *partst; + sign signst[MAXSIGNS]; + unsigned pmapt[YRES][XRES]; + float fvxo[YRES/CELL][XRES/CELL], fvyo[YRES/CELL][XRES/CELL]; + float fvxn[YRES/CELL][XRES/CELL], fvyn[YRES/CELL][XRES/CELL]; + int i, x, y, nx, ny, w, h, nw, nh; + vector2d pos, tmp, ctl, cbr; + vector2d cornerso[4]; + unsigned char *odatac = odata; + memset(bmapo, 0, sizeof(bmapo)); + memset(bmapn, 0, sizeof(bmapn)); + memset(signst, 0, sizeof(signst)); + memset(pmapt, 0, sizeof(pmapt)); + memset(fvxo, 0, sizeof(fvxo)); + memset(fvxn, 0, sizeof(fvxn)); + memset(fvyo, 0, sizeof(fvyo)); + memset(fvyn, 0, sizeof(fvyn)); + partst = calloc(sizeof(particle), NPART); + if (parse_save(odata, *size, 0, 0, 0, bmapo, fvxo, fvyo, signst, partst, pmapt)) + { + free(partst); + return odata; + } + w = odatac[6]*CELL; + h = odatac[7]*CELL; + // undo any translation caused by rotation + cornerso[0] = v2d_new(0,0); + cornerso[1] = v2d_new(w-1,0); + cornerso[2] = v2d_new(0,h-1); + cornerso[3] = v2d_new(w-1,h-1); + for (i=0;i<4;i++) + { + tmp = m2d_multiply_v2d(transform,cornerso[i]); + if (i==0) ctl = cbr = tmp; // top left, bottom right corner + if (tmp.xcbr.x) cbr.x = tmp.x; + if (tmp.y>cbr.y) cbr.y = tmp.y; + } + // casting as int doesn't quite do what we want with negative numbers, so use floor() + tmp = v2d_new(floor(ctl.x+0.5f),floor(ctl.y+0.5f)); + translate = v2d_sub(translate,tmp); + nw = floor(cbr.x+0.5f)-floor(ctl.x+0.5f)+1; + nh = floor(cbr.y+0.5f)-floor(ctl.y+0.5f)+1; + if (nw>XRES) nw = XRES; + if (nh>YRES) nh = YRES; + // rotate and translate signs, parts, walls + for (i=0; i=nw || ny<0 || ny>=nh) + { + signst[i].text[0] = 0; + continue; + } + signst[i].x = nx; + signst[i].y = ny; + } + for (i=0; i=nw || ny<0 || ny>=nh) + { + partst[i].type = PT_NONE; + continue; + } + partst[i].x = nx; + partst[i].y = ny; + } + for (y=0;y=nw || ny<0 || ny>=nh) + continue; + if (bmapo[y][x]) + { + bmapn[ny][nx] = bmapo[y][x]; + if (bmapo[y][x]==WL_FAN) + { + fvxn[ny][nx] = fvxo[y][x]; + fvyn[ny][nx] = fvyo[y][x]; + } + } + } + ndata = build_save(size,0,0,nw,nh,bmapn,fvxn,fvyn,signst,partst); + free(partst); + return ndata; +} +