Try to automerge with this, haha

This commit is contained in:
Felix Wallin 2010-09-27 12:54:56 +02:00
parent 58d710b224
commit 99e2782ebc
21 changed files with 0 additions and 12929 deletions

141
air.c
View File

@ -1,141 +0,0 @@
#include <math.h>
#include "air.h"
#include "powder.h"
#include "defines.h"
float kernel[9];
float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL];
float vy[YRES/CELL][XRES/CELL], ovy[YRES/CELL][XRES/CELL];
float pv[YRES/CELL][XRES/CELL], opv[YRES/CELL][XRES/CELL];
float cb_vx[YRES/CELL][XRES/CELL], cb_ovx[YRES/CELL][XRES/CELL];
float cb_vy[YRES/CELL][XRES/CELL], cb_ovy[YRES/CELL][XRES/CELL];
float cb_pv[YRES/CELL][XRES/CELL], cb_opv[YRES/CELL][XRES/CELL];
float fvx[YRES/CELL][XRES/CELL], fvy[YRES/CELL][XRES/CELL];
void make_kernel(void)
{
int i, j;
float s = 0.0f;
for(j=-1; j<2; j++)
for(i=-1; i<2; i++)
{
kernel[(i+1)+3*(j+1)] = expf(-2.0f*(i*i+j*j));
s += kernel[(i+1)+3*(j+1)];
}
s = 1.0f / s;
for(j=-1; j<2; j++)
for(i=-1; i<2; i++)
kernel[(i+1)+3*(j+1)] *= s;
}
void update_air(void)
{
int x, y, i, j;
float dp, dx, dy, f, tx, ty;
for(y=1; y<YRES/CELL; y++)
for(x=1; x<XRES/CELL; x++)
{
dp = 0.0f;
dp += vx[y][x-1] - vx[y][x];
dp += vy[y-1][x] - vy[y][x];
pv[y][x] *= PLOSS;
pv[y][x] += dp*TSTEPP;
}
for(y=0; y<YRES/CELL-1; y++)
for(x=0; x<XRES/CELL-1; x++)
{
dx = dy = 0.0f;
dx += pv[y][x] - pv[y][x+1];
dy += pv[y][x] - pv[y+1][x];
vx[y][x] *= VLOSS;
vy[y][x] *= VLOSS;
vx[y][x] += dx*TSTEPV;
vy[y][x] += dy*TSTEPV;
if(bmap[y][x]==1 || bmap[y][x+1]==1 ||
bmap[y][x]==8 || bmap[y][x+1]==8 ||
(bmap[y][x]==7 && !emap[y][x]) ||
(bmap[y][x+1]==7 && !emap[y][x+1]))
vx[y][x] = 0;
if(bmap[y][x]==1 || bmap[y+1][x]==1 ||
bmap[y][x]==8 || bmap[y+1][x]==8 ||
(bmap[y][x]==7 && !emap[y][x]) ||
(bmap[y+1][x]==7 && !emap[y+1][x]))
vy[y][x] = 0;
}
for(y=0; y<YRES/CELL; y++)
for(x=0; x<XRES/CELL; x++)
{
dx = 0.0f;
dy = 0.0f;
dp = 0.0f;
for(j=-1; j<2; j++)
for(i=-1; i<2; i++)
if(y+j>0 && y+j<YRES/CELL-1 &&
x+i>0 && x+i<XRES/CELL-1 &&
bmap[y+j][x+i]!=1 &&
bmap[y+j][x+i]!=8 &&
(bmap[y+j][x+i]!=7 || emap[y+j][x+i]))
{
f = kernel[i+1+(j+1)*3];
dx += vx[y+j][x+i]*f;
dy += vy[y+j][x+i]*f;
dp += pv[y+j][x+i]*f;
}
else
{
f = kernel[i+1+(j+1)*3];
dx += vx[y][x]*f;
dy += vy[y][x]*f;
dp += pv[y][x]*f;
}
tx = x - dx*0.7f;
ty = y - dy*0.7f;
i = (int)tx;
j = (int)ty;
tx -= i;
ty -= j;
if(i>=2 && i<XRES/CELL-3 &&
j>=2 && j<YRES/CELL-3)
{
dx *= 1.0f - VADV;
dy *= 1.0f - VADV;
dx += VADV*(1.0f-tx)*(1.0f-ty)*vx[j][i];
dy += VADV*(1.0f-tx)*(1.0f-ty)*vy[j][i];
dx += VADV*tx*(1.0f-ty)*vx[j][i+1];
dy += VADV*tx*(1.0f-ty)*vy[j][i+1];
dx += VADV*(1.0f-tx)*ty*vx[j+1][i];
dy += VADV*(1.0f-tx)*ty*vy[j+1][i];
dx += VADV*tx*ty*vx[j+1][i+1];
dy += VADV*tx*ty*vy[j+1][i+1];
}
if(bmap[y][x] == 4)
{
dx += fvx[y][x];
dy += fvy[y][x];
}
if(dp > 256.0f) dp = 256.0f;
if(dp < -256.0f) dp = -256.0f;
if(dx > 256.0f) dx = 256.0f;
if(dx < -256.0f) dx = -256.0f;
if(dy > 256.0f) dy = 256.0f;
if(dy < -256.0f) dy = -256.0f;
ovx[y][x] = dx;
ovy[y][x] = dy;
opv[y][x] = dp;
}
memcpy(vx, ovx, sizeof(vx));
memcpy(vy, ovy, sizeof(vy));
memcpy(pv, opv, sizeof(pv));
}

21
air.h
View File

@ -1,21 +0,0 @@
#ifndef AIR_H
#define AIR_H
#include "defines.h"
extern float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL];
extern float vy[YRES/CELL][XRES/CELL], ovy[YRES/CELL][XRES/CELL];
extern float pv[YRES/CELL][XRES/CELL], opv[YRES/CELL][XRES/CELL];
extern float cb_vx[YRES/CELL][XRES/CELL], cb_ovx[YRES/CELL][XRES/CELL];
extern float cb_vy[YRES/CELL][XRES/CELL], cb_ovy[YRES/CELL][XRES/CELL];
extern float cb_pv[YRES/CELL][XRES/CELL], cb_opv[YRES/CELL][XRES/CELL];
extern float fvx[YRES/CELL][XRES/CELL], fvy[YRES/CELL][XRES/CELL];
extern float kernel[9];
void make_kernel(void);
void update_air(void);
#endif

118
defines.h
View File

@ -1,118 +0,0 @@
#ifndef DEFINE_H
#define DEFINE_H
#ifdef WIN32
#define PATH_SEP "\\"
#else
#define PATH_SEP "/"
#endif
#define SAVE_VERSION 43
#define MINOR_VERSION 0
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
#define BETA
#define SERVER "powdertoy.co.uk"
#undef PLOSS
#define THUMB_CACHE_SIZE 256
#define IMGCONNS 3
#define TIMEOUT 100
#define HTTP_TIMEOUT 10
#define MENUSIZE 40
#define BARSIZE 14
#define XRES 612
#define YRES 384
#define NPART XRES*YRES
#define MAXSIGNS 16
#define TAG_MAX 256
#define ZSIZE_D 16
#define ZFACTOR_D 8
extern unsigned char ZFACTOR;
extern unsigned char ZSIZE;
#define CELL 4
#define ISTP (CELL/2)
#define CFDS (4.0f/CELL)
#define TSTEPP 0.3f
#define TSTEPV 0.4f
#define VADV 0.3f
#define VLOSS 0.999f
#define PLOSS 0.9999f
#define GRID_X 5
#define GRID_Y 4
#define GRID_P 3
#define GRID_S 6
#define GRID_Z 3
#define STAMP_X 4
#define STAMP_Y 4
#define STAMP_MAX 120
#ifdef PIX16
typedef unsigned short pixel;
#else
typedef unsigned int pixel;
#endif
typedef unsigned char uint8;
extern int amd;
extern int FPSB;
extern int legacy_enable;
extern int sys_pause;
extern int framerender;
extern int mousex, mousey;
extern int death;
struct sign
{
int x,y,ju;
char text[256];
};
typedef struct sign sign;
struct stamp
{
char name[11];
pixel *thumb;
int thumb_w, thumb_h, dodelete;
};
typedef struct stamp stamp;
extern sign signs[MAXSIGNS];
extern stamp stamps[STAMP_MAX];
extern int stamp_count;
extern int itc;
extern char itc_msg[64];
extern int do_open;
extern int sys_pause;
extern int legacy_enable; //Used to disable new features such as heat, will be set by commandline or save.
extern int death, framerender;
extern unsigned char last_major, last_minor, update_flag;
extern char http_proxy_string[256];
//Functions in main.c
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 del_stamp(int d);
void sdl_seticon(void);
#endif

32
font.h

File diff suppressed because one or more lines are too long

2567
graphics.c

File diff suppressed because it is too large Load Diff

View File

@ -1,144 +0,0 @@
#ifndef GRAPHICS_H
#define GRAPHICS_H
#include <SDL/SDL.h>
#include "defines.h"
#include "hmap.h"
#ifdef PIX16
#define PIXELSIZE 2
#define PIXPACK(x) ((((x)>>8)&0xF800)|(((x)>>5)&0x07E0)|(((x)>>3)&0x001F))
#define PIXRGB(r,g,b) ((((r)<<8)&0xF800)|(((g)<<3)&0x07E0)|(((b)>>3)&0x001F))
#define PIXR(x) (((x)>>8)&0xF8)
#define PIXG(x) (((x)>>3)&0xFC)
#define PIXB(x) (((x)<<3)&0xF8)
#else
#define PIXELSIZE 4
#ifdef PIX32BGR
#define PIXPACK(x) ((((x)>>16)&0x0000FF)|((x)&0x00FF00)|(((x)<<16)&0xFF0000))
#define PIXRGB(r,g,b) (((b)<<16)|((g)<<8)|((r)))// (((b)<<16)|((g)<<8)|(r))
#define PIXR(x) ((x)&0xFF)
#define PIXG(x) (((x)>>8)&0xFF)
#define PIXB(x) ((x)>>16)
#else
#ifdef PIX32BGRA
#define PIXPACK(x) ((((x)>>8)&0x0000FF00)|(((x)<<8)&0x00FF0000)|(((x)<<24)&0xFF000000))
#define PIXRGB(r,g,b) (((b)<<24)|((g)<<16)|((r)<<8))
#define PIXR(x) (((x)>>8)&0xFF)
#define PIXG(x) (((x)>>16)&0xFF)
#define PIXB(x) (((x)>>24))
#else
#define PIXPACK(x) (x)
#define PIXRGB(r,g,b) (((r)<<16)|((g)<<8)|(b))
#define PIXR(x) ((x)>>16)
#define PIXG(x) (((x)>>8)&0xFF)
#define PIXB(x) ((x)&0xFF)
#endif
#endif
#endif
extern unsigned cmode;
extern SDL_Surface *sdl_scrn;
extern int sdl_scale;
extern unsigned char fire_r[YRES/CELL][XRES/CELL];
extern unsigned char fire_g[YRES/CELL][XRES/CELL];
extern unsigned char fire_b[YRES/CELL][XRES/CELL];
extern unsigned int fire_alpha[CELL*3][CELL*3];
extern pixel *fire_bg;
pixel *rescale_img(pixel *src, int sw, int sh, int *qw, int *qh, int f);
void sdl_blit_1(int x, int y, int w, int h, pixel *src, int pitch);
void sdl_blit_2(int x, int y, int w, int h, pixel *src, int pitch);
void sdl_blit(int x, int y, int w, int h, pixel *src, int pitch);
void drawblob(pixel *vid, int x, int y, unsigned char cr, unsigned char cg, unsigned char cb);
void draw_tool(pixel *vid_buf, int b, int sl, int sr, unsigned pc, unsigned iswall);
int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc);
void draw_menu(pixel *vid_buf, int i, int hover);
#ifdef WIN32
_inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
#else
extern inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
#endif
#ifdef WIN32
_inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a);
#else
extern inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a);
#endif
int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a);
void drawrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a);
void fillrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a);
void clearrect(pixel *vid, int x, int y, int w, int h);
void drawdots(pixel *vid, int x, int y, int h, int r, int g, int b, int a);
int textwidth(char *s);
int drawtextmax(pixel *vid, int x, int y, int w, char *s, int r, int g, int b, int a);
int textnwidth(char *s, int n);
int textwidthx(char *s, int w);
#ifdef WIN32
_inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
#else
inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
#endif
void draw_icon(pixel *vid_buf, int x, int y, char ch, int flag);
void draw_air(pixel *vid);
void draw_line(pixel *vid, int x1, int y1, int x2, int y2, int r, int g, int b, int a);
void addpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
void xor_pixel(int x, int y, pixel *vid);
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 render_signs(pixel *vid_buf);
void render_fire(pixel *dst);
void prepare_alpha(void);
void draw_image(pixel *vid, pixel *img, int x, int y, int w, int h, int a);
void dim_copy(pixel *dst, pixel *src);
void render_zoom(pixel *img);
pixel *prerender_save(void *save, int size, int *width, int *height);
int render_thumb(void *thumb, int size, int bzip2, pixel *vid_buf, int px, int py, int scl);
void render_cursor(pixel *vid, int x, int y, int t, int r);
void sdl_open(void);
#ifdef OpenGL
void Enable2D ();
void RenderScene ();
void ClearScreen();
#endif
#endif

33
hmap.h

File diff suppressed because one or more lines are too long

43
http.h
View File

@ -1,43 +0,0 @@
/**
* Powder Toy - HTTP Library (Header)
*
* Copyright (c) 2008 - 2010 Stanislaw Skowronek.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef HTTP_H
#define HTTP_H
void http_init(char *proxy);
void http_done(void);
char *http_simple_get(char *uri, int *ret, int *len);
char *http_auth_get(char *uri, char *user, char *pass, int *ret, int *len);
char *http_simple_post(char *uri, char *data, int dlen, int *ret, int *len);
void http_auth_headers(void *ctx, char *user, char *pass);
void *http_async_req_start(void *ctx, char *uri, char *data, int dlen, int keep);
void http_async_add_header(void *ctx, char *name, char *data);
int http_async_req_status(void *ctx);
void http_async_get_length(void *ctx, int *total, int *done);
char *http_async_req_stop(void *ctx, int *ret, int *len);
void http_async_req_close(void *ctx);
char *http_multipart_post(char *uri, char **names, char **parts, int *plens, char *user, char *pass, int *ret, int *len);
char *http_ret_text(int ret);
#endif

22
icon.h

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,183 +0,0 @@
#ifndef INTERFACE_H
#define INTERFACE_H
#include <SDL/SDL.h>
#include "graphics.h"
struct menu_section
{
char *icon;
const char *name;
int itemcount;
};
typedef struct menu_section menu_section;
struct menu_wall
{
pixel colour;
const char *descs;
};
typedef struct menu_wall menu_wall;
static menu_wall mwalls[] =
{
{PIXPACK(0xC0C0C0), "Wall. Indestructible. Blocks everything. Conductive."},
{PIXPACK(0x808080), "E-Wall. Becomes transparent when electricity is connected."},
{PIXPACK(0xFF8080), "Detector. Generates electricity when a particle is inside."},
{PIXPACK(0x808080), "Streamline. Set start point of a streamline."},
{PIXPACK(0x808080), "Sign. Click on a sign to edit it or anywhere else to place a new one."},
{PIXPACK(0x8080FF), "Fan. Accelerates air. Use line tool to set direction and strength."},
{PIXPACK(0xC0C0C0), "Wall. Blocks most particles but lets liquids through. Conductive."},
{PIXPACK(0x808080), "Wall. Absorbs particles but lets air currents through."},
{PIXPACK(0x808080), "Erases walls."},
{PIXPACK(0x808080), "Wall. Indestructible. Blocks everything."},
{PIXPACK(0x3C3C3C), "Wall. Indestructible. Blocks particles, allows air"},
{PIXPACK(0x575757), "Wall. Indestructible. Blocks liquids and gasses, allows solids"},
{PIXPACK(0xFFFF22), "Conductor, allows particles, conducts electricity"},
{PIXPACK(0x242424), "E-Hole, absorbs particles, release them when powered"},
{PIXPACK(0xFFFFFF), "Air, creates airflow and pressure"},
{PIXPACK(0xFFBB00), "Heats the targetted element."},
{PIXPACK(0x00BBFF), "Cools the targetted element."},
{PIXPACK(0x303030), "Vacuum, reduces air pressure."},
{PIXPACK(0x579777), "Wall. Indestructible. Blocks liquids and solids, allows gasses"},
};
#define SC_WALL 0
#define SC_SPECIAL 8
#define SC_POWDERS 5
#define SC_SOLIDS 6
#define SC_ELEC 1
#define SC_EXPLOSIVE 2
#define SC_GAS 3
#define SC_LIQUID 4
#define SC_NUCLEAR 7
#define SC_TOTAL 9
static menu_section msections[] =
{
{"\xC1", "Walls", 0},
{"\xC2", "Electronics", 0},
{"\xC3", "Explosives", 0},
{"\xC5", "Gasses", 0},
{"\xC4", "Liquids", 0},
{"\xD0", "Powders", 0},
{"\xD1", "Solids", 0},
{"\xC6", "Radioactive", 0},
{"\xCC", "Special", 0},
};
struct ui_edit
{
int x, y, w, nx;
char str[256],*def;
int focus, cursor, hide;
};
typedef struct ui_edit ui_edit;
struct ui_checkbox
{
int x, y;
int focus, checked;
};
typedef struct ui_checkbox ui_checkbox;
extern SDLMod sdl_mod;
extern int sdl_key, sdl_wheel, sdl_caps, sdl_ascii, sdl_zoom_trig;
extern char *shift_0;
extern char *shift_1;
extern int svf_login;
extern int svf_admin;
extern int svf_mod;
extern char svf_user[64];
extern char svf_pass[64];
extern int svf_open;
extern int svf_own;
extern int svf_myvote;
extern int svf_publish;
extern char svf_id[16];
extern char svf_name[64];
extern char svf_tags[256];
extern void *svf_last;
extern int svf_lsize;
extern char *search_ids[GRID_X*GRID_Y];
extern char *search_dates[GRID_X*GRID_Y];
extern int search_votes[GRID_X*GRID_Y];
extern int search_publish[GRID_X*GRID_Y];
extern int search_scoredown[GRID_X*GRID_Y];
extern int search_scoreup[GRID_X*GRID_Y];
extern char *search_names[GRID_X*GRID_Y];
extern char *search_owners[GRID_X*GRID_Y];
extern void *search_thumbs[GRID_X*GRID_Y];
extern int search_thsizes[GRID_X*GRID_Y];
extern int search_own;
extern int search_date;
extern int search_page;
extern char search_expr[256];
extern char *tag_names[TAG_MAX];
extern int tag_votes[TAG_MAX];
extern int Z_keysym;
extern int zoom_en;
extern int zoom_x, zoom_y;
extern int zoom_wx, zoom_wy;
void menu_count(void);
void get_sign_pos(int i, int *x0, int *y0, int *w, int *h);
void add_sign_ui(pixel *vid_buf, int mx, int my);
void ui_edit_draw(pixel *vid_buf, ui_edit *ed);
void ui_edit_process(int mx, int my, int mb, ui_edit *ed);
void ui_checkbox_draw(pixel *vid_buf, ui_checkbox *ed);
void ui_checkbox_process(int mx, int my, int mb, int mbq, ui_checkbox *ed);
void draw_svf_ui(pixel *vid_buf);
void error_ui(pixel *vid_buf, int err, char *txt);
void info_ui(pixel *vid_buf, char *top, char *txt);
void info_box(pixel *vid_buf, char *msg);
int confirm_ui(pixel *vid_buf, char *top, char *msg, char *btn);
void login_ui(pixel *vid_buf);
int stamp_ui(pixel *vid_buf);
void tag_list_ui(pixel *vid_buf);
int save_name_ui(pixel *vid_buf);
void menu_ui(pixel *vid_buf, int i, int *sl, int *sr);
void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, int my);
int sdl_poll(void);
void set_cmode(int cm);
char *download_ui(pixel *vid_buf, char *uri, int *len);
int search_ui(pixel *vid_buf);
int search_results(char *str, int votes);
int execute_tagop(pixel *vid_buf, char *op, char *tag);
void execute_save(pixel *vid_buf);
void execute_delete(pixel *vid_buf, char *id);
int execute_vote(pixel *vid_buf, char *id, char *action);
#endif

2096
main.c

File diff suppressed because it is too large Load Diff

231
md5.c
View File

@ -1,231 +0,0 @@
// based on public-domain code from Colin Plumb (1993)
#include <string.h>
#include "md5.h"
static unsigned getu32(const unsigned char *addr)
{
return (((((unsigned long)addr[3] << 8) | addr[2]) << 8) | addr[1]) << 8 | addr[0];
}
static void putu32(unsigned data, unsigned char *addr)
{
addr[0] = (unsigned char)data;
addr[1] = (unsigned char)(data >> 8);
addr[2] = (unsigned char)(data >> 16);
addr[3] = (unsigned char)(data >> 24);
}
void md5_init(struct md5_context *ctx)
{
ctx->buf[0] = 0x67452301;
ctx->buf[1] = 0xefcdab89;
ctx->buf[2] = 0x98badcfe;
ctx->buf[3] = 0x10325476;
ctx->bits[0] = 0;
ctx->bits[1] = 0;
}
void md5_update(struct md5_context *ctx, unsigned char const *buf, unsigned len)
{
unsigned t;
// update bit count
t = ctx->bits[0];
if((ctx->bits[0] = (t + ((unsigned)len << 3)) & 0xffffffff) < t)
ctx->bits[1]++; // carry
ctx->bits[1] += len >> 29;
t = (t >> 3) & 0x3f;
// use leading data to top up the buffer
if(t)
{
unsigned char *p = ctx->in + t;
t = 64-t;
if (len < t)
{
memcpy(p, buf, len);
return;
}
memcpy(p, buf, t);
md5_transform(ctx->buf, ctx->in);
buf += t;
len -= t;
}
// following 64-byte chunks
while(len >= 64)
{
memcpy(ctx->in, buf, 64);
md5_transform(ctx->buf, ctx->in);
buf += 64;
len -= 64;
}
// save rest of bytes for later
memcpy(ctx->in, buf, len);
}
void md5_final(unsigned char digest[16], struct md5_context *ctx)
{
unsigned count;
unsigned char *p;
// #bytes mod64
count = (ctx->bits[0] >> 3) & 0x3F;
// first char of padding = 0x80
p = ctx->in + count;
*p++ = 0x80;
// calculate # of bytes to pad
count = 64 - 1 - count;
// Pad out to 56 mod 64
if(count < 8)
{
// we need to finish a whole block before padding
memset(p, 0, count);
md5_transform(ctx->buf, ctx->in);
memset(ctx->in, 0, 56);
}
else
{
// just pad to 56 bytes
memset(p, 0, count-8);
}
// append length & final transform
putu32(ctx->bits[0], ctx->in + 56);
putu32(ctx->bits[1], ctx->in + 60);
md5_transform(ctx->buf, ctx->in);
putu32(ctx->buf[0], digest);
putu32(ctx->buf[1], digest + 4);
putu32(ctx->buf[2], digest + 8);
putu32(ctx->buf[3], digest + 12);
memset(ctx, 0, sizeof(ctx));
}
#define F1(x, y, z) (z ^ (x & (y ^ z)))
#define F2(x, y, z) F1(z, x, y)
#define F3(x, y, z) (x ^ y ^ z)
#define F4(x, y, z) (y ^ (x | ~z))
#define MD5STEP(f, w, x, y, z, data, s) \
( w += f(x, y, z) + data, w &= 0xffffffff, w = w<<s | w>>(32-s), w += x )
void md5_transform(unsigned buf[4], const unsigned char inraw[64])
{
unsigned a, b, c, d;
unsigned in[16];
int i;
for (i = 0; i < 16; ++i)
in[i] = getu32 (inraw + 4 * i);
a = buf[0];
b = buf[1];
c = buf[2];
d = buf[3];
MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478, 7);
MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12);
MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17);
MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22);
MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf, 7);
MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12);
MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17);
MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22);
MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8, 7);
MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12);
MD5STEP(F1, c, d, a, b, in[10]+0xffff5bb1, 17);
MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22);
MD5STEP(F1, a, b, c, d, in[12]+0x6b901122, 7);
MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12);
MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17);
MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22);
MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562, 5);
MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340, 9);
MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14);
MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20);
MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d, 5);
MD5STEP(F2, d, a, b, c, in[10]+0x02441453, 9);
MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14);
MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20);
MD5STEP(F2, a, b, c, d, in[ 9]+0x21e1cde6, 5);
MD5STEP(F2, d, a, b, c, in[14]+0xc33707d6, 9);
MD5STEP(F2, c, d, a, b, in[ 3]+0xf4d50d87, 14);
MD5STEP(F2, b, c, d, a, in[ 8]+0x455a14ed, 20);
MD5STEP(F2, a, b, c, d, in[13]+0xa9e3e905, 5);
MD5STEP(F2, d, a, b, c, in[ 2]+0xfcefa3f8, 9);
MD5STEP(F2, c, d, a, b, in[ 7]+0x676f02d9, 14);
MD5STEP(F2, b, c, d, a, in[12]+0x8d2a4c8a, 20);
MD5STEP(F3, a, b, c, d, in[ 5]+0xfffa3942, 4);
MD5STEP(F3, d, a, b, c, in[ 8]+0x8771f681, 11);
MD5STEP(F3, c, d, a, b, in[11]+0x6d9d6122, 16);
MD5STEP(F3, b, c, d, a, in[14]+0xfde5380c, 23);
MD5STEP(F3, a, b, c, d, in[ 1]+0xa4beea44, 4);
MD5STEP(F3, d, a, b, c, in[ 4]+0x4bdecfa9, 11);
MD5STEP(F3, c, d, a, b, in[ 7]+0xf6bb4b60, 16);
MD5STEP(F3, b, c, d, a, in[10]+0xbebfbc70, 23);
MD5STEP(F3, a, b, c, d, in[13]+0x289b7ec6, 4);
MD5STEP(F3, d, a, b, c, in[ 0]+0xeaa127fa, 11);
MD5STEP(F3, c, d, a, b, in[ 3]+0xd4ef3085, 16);
MD5STEP(F3, b, c, d, a, in[ 6]+0x04881d05, 23);
MD5STEP(F3, a, b, c, d, in[ 9]+0xd9d4d039, 4);
MD5STEP(F3, d, a, b, c, in[12]+0xe6db99e5, 11);
MD5STEP(F3, c, d, a, b, in[15]+0x1fa27cf8, 16);
MD5STEP(F3, b, c, d, a, in[ 2]+0xc4ac5665, 23);
MD5STEP(F4, a, b, c, d, in[ 0]+0xf4292244, 6);
MD5STEP(F4, d, a, b, c, in[ 7]+0x432aff97, 10);
MD5STEP(F4, c, d, a, b, in[14]+0xab9423a7, 15);
MD5STEP(F4, b, c, d, a, in[ 5]+0xfc93a039, 21);
MD5STEP(F4, a, b, c, d, in[12]+0x655b59c3, 6);
MD5STEP(F4, d, a, b, c, in[ 3]+0x8f0ccc92, 10);
MD5STEP(F4, c, d, a, b, in[10]+0xffeff47d, 15);
MD5STEP(F4, b, c, d, a, in[ 1]+0x85845dd1, 21);
MD5STEP(F4, a, b, c, d, in[ 8]+0x6fa87e4f, 6);
MD5STEP(F4, d, a, b, c, in[15]+0xfe2ce6e0, 10);
MD5STEP(F4, c, d, a, b, in[ 6]+0xa3014314, 15);
MD5STEP(F4, b, c, d, a, in[13]+0x4e0811a1, 21);
MD5STEP(F4, a, b, c, d, in[ 4]+0xf7537e82, 6);
MD5STEP(F4, d, a, b, c, in[11]+0xbd3af235, 10);
MD5STEP(F4, c, d, a, b, in[ 2]+0x2ad7d2bb, 15);
MD5STEP(F4, b, c, d, a, in[ 9]+0xeb86d391, 21);
buf[0] += a;
buf[1] += b;
buf[2] += c;
buf[3] += d;
}
static char hex[] = "0123456789abcdef";
void md5_ascii(char *result, unsigned char const *buf, unsigned len)
{
struct md5_context md5;
unsigned char hash[16];
int i;
if(len==0)
len = strlen((char *)buf);
md5_init(&md5);
md5_update(&md5, buf, len);
md5_final(hash, &md5);
for(i=0; i<16; i++)
{
result[i*2] = hex[(hash[i]>>4)&0xF];
result[i*2+1] = hex[hash[i]&0x0F];
}
result[32] = 0;
}

18
md5.h
View File

@ -1,18 +0,0 @@
#ifndef MD5_H
#define MD5_H
struct md5_context
{
unsigned buf[4];
unsigned bits[2];
unsigned char in[64];
};
void md5_init(struct md5_context *context);
void md5_update(struct md5_context *context, unsigned char const *buf, unsigned len);
void md5_final(unsigned char digest[16], struct md5_context *context);
void md5_transform(unsigned buf[4], const unsigned char in[64]);
void md5_ascii(char *result, unsigned char const *buf, unsigned len);
#endif

283
misc.c
View File

@ -1,283 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc.h"
#include "defines.h"
#include "interface.h"
#include "graphics.h"
//Signum function
#ifdef WIN32
_inline int isign(float i)
#else
inline int isign(float i)
#endif
{
if (i<0)
return -1;
if (i>0)
return 1;
return 0;
}
#ifdef WIN32
_inline unsigned clamp_flt(float f, float min, float max)
#else
inline unsigned clamp_flt(float f, float min, float max)
#endif
{
if(f<min)
return 0;
if(f>max)
return 255;
return (int)(255.0f*(f-min)/(max-min));
}
#ifdef WIN32
_inline float restrict_flt(float f, float min, float max)
#else
inline float restrict_flt(float f, float min, float max)
#endif
{
if(f<min)
return min;
if(f>max)
return max;
return f;
}
char *mystrdup(char *s)
{
char *x;
if(s)
{
x = (char*)malloc(strlen(s)+1);
strcpy(x, s);
return x;
}
return s;
}
void strlist_add(struct strlist **list, char *str)
{
struct strlist *item = malloc(sizeof(struct strlist));
item->str = mystrdup(str);
item->next = *list;
*list = item;
}
int strlist_find(struct strlist **list, char *str)
{
struct strlist *item;
for(item=*list; item; item=item->next)
if(!strcmp(item->str, str))
return 1;
return 0;
}
void strlist_free(struct strlist **list)
{
struct strlist *item;
while(*list)
{
item = *list;
*list = (*list)->next;
free(item);
}
}
void save_presets(int do_update)
{
FILE *f=fopen("powder.def", "wb");
unsigned char sig[4] = {0x50, 0x44, 0x65, 0x66};
unsigned char tmp = sdl_scale;
if(!f)
return;
fwrite(sig, 1, 4, f);
save_string(f, svf_user);
save_string(f, svf_pass);
fwrite(&tmp, 1, 1, f);
tmp = cmode;
fwrite(&tmp, 1, 1, f);
tmp = svf_admin;
fwrite(&tmp, 1, 1, f);
tmp = svf_mod;
fwrite(&tmp, 1, 1, f);
save_string(f, http_proxy_string);
tmp = SAVE_VERSION;
fwrite(&tmp, 1, 1, f);
tmp = MINOR_VERSION;
fwrite(&tmp, 1, 1, f);
tmp = do_update;
fwrite(&tmp, 1, 1, f);
fclose(f);
}
void load_presets(void)
{
FILE *f=fopen("powder.def", "rb");
unsigned char sig[4], tmp;
if(!f)
return;
fread(sig, 1, 4, f);
if(sig[0]!=0x50 || sig[1]!=0x44 || sig[2]!=0x65 || sig[3]!=0x66)
{
if(sig[0]==0x4D && sig[1]==0x6F && sig[2]==0x46 && sig[3]==0x6F)
{
if(fseek(f, -3, SEEK_END))
{
remove("powder.def");
return;
}
if(fread(sig, 1, 3, f) != 3)
{
remove("powder.def");
goto fail;
}
last_major = sig[0];
last_minor = sig[1];
update_flag = sig[2];
}
fclose(f);
remove("powder.def");
return;
}
if(load_string(f, svf_user, 63))
goto fail;
if(load_string(f, svf_pass, 63))
goto fail;
svf_login = !!svf_user[0];
if(fread(&tmp, 1, 1, f) != 1)
goto fail;
sdl_scale = (tmp == 2) ? 2 : 1;
if(fread(&tmp, 1, 1, f) != 1)
goto fail;
cmode = tmp%7;
if(fread(&tmp, 1, 1, f) != 1)
goto fail;
svf_admin = tmp;
if(fread(&tmp, 1, 1, f) != 1)
goto fail;
svf_mod = tmp;
if(load_string(f, http_proxy_string, 255))
goto fail;
if(fread(sig, 1, 3, f) != 3)
goto fail;
last_major = sig[0];
last_minor = sig[1];
update_flag = sig[2];
fail:
fclose(f);
}
void save_string(FILE *f, char *str)
{
int li = strlen(str);
unsigned char lb[2];
lb[0] = li;
lb[1] = li >> 8;
fwrite(lb, 2, 1, f);
fwrite(str, li, 1, f);
}
int load_string(FILE *f, char *str, int max)
{
int li;
unsigned char lb[2];
fread(lb, 2, 1, f);
li = lb[0] | (lb[1] << 8);
if(li > max)
{
str[0] = 0;
return 1;
}
fread(str, li, 1, f);
str[li] = 0;
return 0;
}
void strcaturl(char *dst, char *src)
{
char *d;
unsigned char *s;
for(d=dst; *d; d++) ;
for(s=(unsigned char *)src; *s; s++)
{
if((*s>='0' && *s<='9') ||
(*s>='a' && *s<='z') ||
(*s>='A' && *s<='Z'))
*(d++) = *s;
else
{
*(d++) = '%';
*(d++) = hex[*s>>4];
*(d++) = hex[*s&15];
}
}
*d = 0;
}
void strappend(char *dst, char *src)
{
char *d;
unsigned char *s;
for(d=dst; *d; d++) ;
for(s=(unsigned char *)src; *s; s++)
{
*(d++) = *s;
}
*d = 0;
}
void *file_load(char *fn, int *size)
{
FILE *f = fopen(fn, "rb");
void *s;
if(!f)
return NULL;
fseek(f, 0, SEEK_END);
*size = ftell(f);
fseek(f, 0, SEEK_SET);
s = malloc(*size);
if(!s)
{
fclose(f);
return NULL;
}
fread(s, *size, 1, f);
fclose(f);
return s;
}
int cpu_check(void)
{
#ifdef MACOSX
return 0;
#else
#ifdef X86
unsigned af,bf,cf,df;
x86_cpuid(0, af, bf, cf, df);
if(bf==0x68747541 && cf==0x444D4163 && df==0x69746E65)
amd = 1;
x86_cpuid(1, af, bf, cf, df);
#ifdef X86_SSE
if(!(df&(1<<25)))
return 1;
#endif
#ifdef X86_SSE2
if(!(df&(1<<26)))
return 1;
#endif
#ifdef X86_SSE3
if(!(cf&1))
return 1;
#endif
#endif
#endif
return 0;
}

72
misc.h
View File

@ -1,72 +0,0 @@
#ifndef UTILS_H
#define UTILS_H
#include <stdio.h>
#include <stdlib.h>
#ifdef WIN32
#define x86_cpuid(func,af,bf,cf,df) \
do {\
__asm mov eax, func\
__asm cpuid\
__asm mov af, eax\
__asm mov bf, ebx\
__asm mov cf, ecx\
__asm mov df, edx\
} while(0)
#else
#define x86_cpuid(func,af,bf,cf,df) \
__asm__ __volatile ("cpuid":\
"=a" (af), "=b" (bf), "=c" (cf), "=d" (df) : "a" (func));
#endif
static char hex[] = "0123456789ABCDEF";
//Signum function
#ifdef WIN32
extern _inline int isign(float i);
#else
extern inline int isign(float i);
#endif
#ifdef WIN32
extern _inline unsigned clamp_flt(float f, float min, float max);
#else
extern inline unsigned clamp_flt(float f, float min, float max);
#endif
#ifdef WIN32
extern _inline float restrict_flt(float f, float min, float max);
#else
extern inline float restrict_flt(float f, float min, float max);
#endif
char *mystrdup(char *s);
struct strlist
{
char *str;
struct strlist *next;
};
void strlist_add(struct strlist **list, char *str);
int strlist_find(struct strlist **list, char *str);
void strlist_free(struct strlist **list);
void save_presets(int do_update);
void load_presets(void);
void save_string(FILE *f, char *str);
int load_string(FILE *f, char *str, int max);
void strcaturl(char *dst, char *src);
void strappend(char *dst, char *src);
void *file_load(char *fn, int *size);
int cpu_check(void);
#endif

3199
powder.c

File diff suppressed because it is too large Load Diff

512
powder.h
View File

@ -1,512 +0,0 @@
#ifndef POWDER_H
#define POWDER_H
#include "graphics.h"
#include "defines.h"
#include "interface.h"
#define CM_COUNT 7
#define CM_FANCY 6
#define CM_HEAT 5
#define CM_BLOB 4
#define CM_FIRE 3
#define CM_PERS 2
#define CM_PRESS 1
#define CM_VEL 0
#define UI_WALLSTART 37
#define UI_WALLCOUNT 19
#define SPC_AIR 136
#define SPC_HEAT 137
#define SPC_COOL 138
#define SPC_VACUUM 139
#define WL_WALLELEC 22
#define WL_EWALL 23
#define WL_DETECT 24
#define WL_STREAM 25
#define WL_SIGN 26
#define WL_FAN 27
#define WL_ALLOWLIQUID 28
#define WL_DESTROYALL 29
#define WL_ERASE 30
#define WL_WALL 31
#define WL_ALLOWAIR 32
#define WL_ALLOWSOLID 33
#define WL_ALLOWALLELEC 34
#define WL_EHOLE 35
#define WL_ALLOWGAS 40
#define PT_NONE 0
#define PT_DUST 1
#define PT_WATR 2
#define PT_OIL 3
#define PT_FIRE 4
#define PT_STNE 5
#define PT_LAVA 6
#define PT_GUNP 7
#define PT_NITR 8
#define PT_CLNE 9
#define PT_GAS 10
#define PT_PLEX 11
#define PT_GOO 12
#define PT_ICEI 13
#define PT_METL 14
#define PT_SPRK 15
#define PT_SNOW 16
#define PT_WOOD 17
#define PT_NEUT 18
#define PT_PLUT 19
#define PT_PLNT 20
#define PT_ACID 21
#define PT_VOID 22
#define PT_WTRV 23
#define PT_CNCT 24
#define PT_DSTW 25
#define PT_SALT 26
#define PT_SLTW 27
#define PT_DMND 28
#define PT_BMTL 29
#define PT_BRMT 30
#define PT_PHOT 31
#define PT_URAN 32
#define PT_WAX 33
#define PT_MWAX 34
#define PT_PSCN 35
#define PT_NSCN 36
#define PT_LNTG 37
#define PT_INSL 38
#define PT_BHOL 39
#define PT_WHOL 40
#define PT_RBDM 41
#define PT_LRBD 42
#define PT_NTCT 43
#define PT_SAND 44
#define PT_GLAS 45
#define PT_PTCT 46
#define PT_BGLA 47
#define PT_THDR 48
#define PT_PLSM 49
#define PT_ETRD 50
#define PT_NICE 51
#define PT_NBLE 52
#define PT_BTRY 53
#define PT_LCRY 54
#define PT_STKM 55
#define PT_SWCH 56
#define PT_SMKE 57
#define PT_DESL 58
#define PT_COAL 59
#define PT_LO2 60
#define PT_O2 61
#define PT_INWR 62
#define PT_YEST 63
#define PT_DYST 64
#define PT_THRM 65
#define PT_GLOW 66
#define PT_BRCK 67
#define PT_HFLM 68
#define PT_FIRW 69
#define PT_FUSE 70
#define PT_FSEP 71
#define PT_AMTR 72
#define PT_PCLN 73
#define PT_HSWC 74
#define PT_NUM 75
#define R_TEMP 22
#define MAX_TEMP 9999
#define MIN_TEMP 0
#define O_MAX_TEMP 3500
#define O_MIN_TEMP -273
#define ST_NONE 0
#define ST_SOLID 1
#define ST_LIQUID 2
#define ST_GAS 3
/*
We should start to implement these.
*/
static const unsigned short TYPE_PART = 0x01; //1
static const unsigned short TYPE_LIQUID = 0x02; //2
static const unsigned short TYPE_SOLID = 0x04; //4
static const unsigned short TYPE_GAS = 0x08; //8
static const unsigned short PROP_CONDUCTS = 0x10; //16
static const unsigned short PROP_DEADLY = 0x12; //18 Is deadly for stickman.
#define FLAG_STAGNANT 1
struct particle
{
int type;
int life, ctype;
float x, y, vx, vy;
float temp;
float pavg[2];
int flags;
int tmp;
};
typedef struct particle particle;
struct part_type
{
const char *name;
pixel pcolors;
float advection;
float airdrag;
float airloss;
float loss;
float collision;
float gravity;
float diffusion;
float hotair;
int falldown;
int flammable;
int explosive;
int meltable;
int hardness;
int menu;
int menusection;
float heat;
unsigned char hconduct;
const char *descs;
const unsigned short properties;
};
typedef struct part_type part_type;
struct part_state
{
char state;
int solid;
float stemp;
int liquid;
float ltemp;
int gas;
float gtemp;
int burn;
float btemp;
};
typedef struct part_state part_state;
//Should probably be const.
static const part_type ptypes[PT_NUM] =
{
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description
{"", PIXPACK(0x000000), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Erases particles."},
{"DUST", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable."},
{"WATR", PIXPACK(0x2030D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, SC_LIQUID, R_TEMP+-2.0f+273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires."},
{"OIL", PIXPACK(0x404010), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 20, 0, 0, 5, 1, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable."},
{"FIRE", PIXPACK(0xFF1000), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, SC_EXPLOSIVE, R_TEMP+400.0f+273.15f, 88, "Ignites flammable materials. Heats air."},
{"STNE", PIXPACK(0xA0A0A0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Heavy particles. Meltable."},
{"LAVA", PIXPACK(0xE05010), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.0003f * CFDS, 2, 0, 0, 0, 2, 1, SC_LIQUID, R_TEMP+1500.0f+273.15f, 60, "Heavy liquid. Ignites flammable materials. Solidifies when cold."},
{"GUN", PIXPACK(0xC0C0D0), 0.7f, 0.02f * CFDS, 0.94f, 0.80f, -0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 600, 1, 0, 10, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 97, "Light dust. Explosive."},
{"NITR", PIXPACK(0x20E010), 0.5f, 0.02f * CFDS, 0.92f, 0.97f, 0.0f, 0.2f, 0.00f, 0.000f * CFDS, 2, 1000, 2, 0, 3, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 50, "Liquid. Pressure sensitive explosive."},
{"CLNE", PIXPACK(0xFFD010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Duplicates any particles it touches."},
{"GAS", PIXPACK(0xE0FF20), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 600, 0, 0, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Gas. Diffuses. Flammable. Liquifies under pressure."},
{"C-4", PIXPACK(0xD080E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 2, 50, 1, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive."},
{"GOO", PIXPACK(0x804000), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure."},
{"ICE", PIXPACK(0xA0C0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air."},
{"METL", PIXPACK(0x404060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Conducts electricity. Meltable."},
{"SPRK", PIXPACK(0xFFFF80), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electricity. Conducted by metal and water."},
{"SNOW", PIXPACK(0xC0E0FF), 0.7f, 0.01f * CFDS, 0.96f, 0.90f, -0.1f, 0.05f, 0.01f, -0.00005f* CFDS,1, 0, 0, 0, 20, 1, SC_POWDERS, R_TEMP+-30.0f+273.15f, 46, "Light particles."},
{"WOOD", PIXPACK(0xC0A040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 15, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Solid. Flammable. Can be pressurised into COAL"},
{"NEUT", PIXPACK(0x20E0FF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Neutrons. Interact with matter in odd ways."},
{"PLUT", PIXPACK(0x407020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 251, "Heavy particles. Fissile. Generates neutrons under pressure."},
{"PLNT", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Plant, drinks water and grows."},
{"ACID", PIXPACK(0xed55ff), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 40, 0, 0, 1, 1, SC_LIQUID, R_TEMP+0.0f +273.15f, 34, "Dissolves almost everything."},
{"VOID", PIXPACK(0x790B0B), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Hole, will drain away any particles."},
{"WTRV", PIXPACK(0xA0A0FF), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, -0.1f, 0.75f, 0.0003f * CFDS, 0, 0, 0, 0, 4, 1, SC_GAS, R_TEMP+100.0f+273.15f, 48, "Steam, heats up air, produced from hot water."},
{"CNCT", PIXPACK(0xC0C0C0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 25, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 100, "Concrete, stronger than stone."},
{"DSTW", PIXPACK(0x1020C0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, SC_LIQUID, R_TEMP+-2.0f+273.15f, 23, "Distilled water, does not conduct electricity."},
{"SALT", PIXPACK(0xFFFFFF), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 110, "Salt, dissolves in water."},
{"SLTW", PIXPACK(0x4050F0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, SC_LIQUID, R_TEMP+0.0f +273.15f, 75, "Saltwater, conducts electricity, difficult to freeze."},
{"DMND", PIXPACK(0xCCFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 186, "Diamond. Indestructable."}, //ief015 - Added diamond. Because concrete blocks are kinda pointless.
{"BMTL", PIXPACK(0x505070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Breakable metal."},
{"BRMT", PIXPACK(0x705060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken metal."},
{"PHOT", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, SC_ELEC, R_TEMP+900.0f+273.15f, 251, "Photons. Travel in straight lines."},
{"URAN", PIXPACK(0x707020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+30.0f+273.15f, 251, "Heavy particles. Generates heat under pressure."},
{"WAX", PIXPACK(0xF0F0BB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures."},
{"MWAX", PIXPACK(0xE0E0AA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 5, 0, 0, 2, 1, SC_LIQUID, R_TEMP+28.0f+273.15f, 44, "Liquid Wax."},
{"PSCN", PIXPACK(0x805050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "P-Type Silicon, Will transfer current to any conductor."},
{"NSCN", PIXPACK(0x505080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "N-Type Silicon, Will only transfer current to P-Type Silicon."},
{"LN2", PIXPACK(0x80A0DF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 0, 1, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold."},
{"INSL", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 7, 0, 0, 10, 1, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Insulator, does not conduct heat or electricity."},
{"BHOL", PIXPACK(0x202020), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, -0.01f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+70.0f+273.15f, 255, "Black hole, sucks in other particles and heats up."},
{"WHOL", PIXPACK(0xEFEFEF), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.010f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP-16.0f+273.15f, 255, "White hole, pushes other particles away."},
{"RBDM", PIXPACK(0xCCCCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 1, 50, 1, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 240, "Rubidium, explosive, especially on contact with water, low melting point"},
{"LRBD", PIXPACK(0xAAAAAA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 1000, 1, 0, 2, 1, SC_EXPLOSIVE, R_TEMP+45.0f+273.15f, 170, "Liquid Rubidium."},
{"NTCT", PIXPACK(0x505040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when hot (More than 100C)"},
{"SAND", PIXPACK(0xFFD090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Sand, Heavy particles. Meltable."},
{"GLAS", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure"},
{"PTCT", PIXPACK(0x405050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when cold (Less than 120C)"},
{"BGLA", PIXPACK(0x606060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Glass, Heavy particles. Meltable. Bagels."},
{"THDR", PIXPACK(0xFFFFA0), 0.0f, 0.00f * CFDS, 1.0f, 0.30f, -0.99f, 0.6f, 0.62f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, SC_ELEC, 9000.0f +273.15f, 251, "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals."},
{"PLSM", PIXPACK(0xBB99FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.30f, 0.001f * CFDS, 0, 0, 0, 0, 0, 1, SC_GAS, 9000.0f +273.15f, 115, "Plasma, extremely hot."},
{"ETRD", PIXPACK(0x404040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)"},
{"NICE", PIXPACK(0xC0E0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0005f* CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, 35.0f, 46, "Nitrogen Ice."},
{"NBLE", PIXPACK(0xEB4917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 106, "Noble Gas. Diffuses. Conductive. Ionizes into plasma when intruduced to electricity"},
{"BTRY", PIXPACK(0x858505), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Generates Electricity."},
{"LCRY", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)"},
{"STKM", PIXPACK(0x000000), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!"},
{"SWCH", PIXPACK(0x103B11), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)"},
{"SMKE", PIXPACK(0x222222), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, SC_GAS, R_TEMP+320.0f+273.15f, 88, "Smoke"},
{"DESL", PIXPACK(0x440000), 1.0f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.0f, 0.0f * CFDS, 2, 2, 0, 0, 5, 1, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Vaporises under low pressure, explodes under high pressure and temperatures"},
{"COAL", PIXPACK(0x222222), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly."},
{"LO2", PIXPACK(0x80A0EF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 5000, 0, 0, 0, 1, SC_LIQUID, 80.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire"},
{"O2", PIXPACK(0x80A0FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 3.0f, 0.000f * CFDS, 0, 1000, 0, 0, 0, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Gas. Ignites easily."},
{"INWR", PIXPACK(0x544141), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Insulated Wire. Doesn't conduct to metal or semiconductors."},
{"YEST", PIXPACK(0xEEE0C0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 15, 0, 0, 30, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Yeast, grows when warm (~37C)."},
{"DYST", PIXPACK(0xBBB0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 20, 0, 0, 30, 0, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Deat Yeast."},
{"THRM", PIXPACK(0xA08090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 211, "Thermite. Burns at extremly high temperature."},
{"GLOW", PIXPACK(0x445544), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 2, 1, SC_LIQUID, R_TEMP+20.0f+273.15f, 44, "Glow, Glows under pressure"},
{"BRCK", PIXPACK(0x808080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Brick, breakable building material."},
{"CFLM", PIXPACK(0x8080FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.0005f * CFDS, 1, 0, 0, 0, 1, 1, SC_SPECIAL, 0.0f, 88, "Sub-zero flame."},
{"FIRW", PIXPACK(0xFFA040), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, -0.99f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 70, "Fireworks!"},
{"FUSE", PIXPACK(0x0A5706), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity."},
{"FSEP", PIXPACK(0x63AD5F), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Fuse Powder. See FUSE."},
{"AMTR", PIXPACK(0x808080), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.00f, 0.10f, 1.00f, 0.0000f * CFDS, 0, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Anti-Matter, Destroys a majority of particles"},
{"PCLN", PIXPACK(0x3B3B10), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches."},
{"HSWC", PIXPACK(0x3B1010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated"},
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description
};
static part_state pstates[PT_NUM] =
{
// Name Solid Frzp Liquid Mpnt Gas Bpoint
/* NONE */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* DUST */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* WATR */ {ST_LIQUID, PT_ICEI, 273.15f, PT_NONE, 0.0f, PT_WTRV, 373.0f, PT_NONE, 0.0f},
/* OIL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_GAS, 333.0f, PT_NONE, 0.0f},
/* FIRE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_PLSM, 2773.0f},
/* STNE */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 983.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* LAVA */ {ST_LIQUID, PT_STNE, 973.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* GUN */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f},
/* NITR */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f},
/* CLNE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* GAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 50.0f, PT_FIRE, 573.0f},
/* C-4 */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f},
/* GOO */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* ICE */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 274.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* METL */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SPRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SNOW */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* WOOD */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 873.0f},
/* NEUT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* PLUT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* PLNT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 573.0f},
/* ACID */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* VOID */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* WTRV */ {ST_GAS, PT_ICEI, 273.0f, PT_DSTW, 371.0f, PT_NONE, 373.0f, PT_NONE, 0.0f},
/* CNCT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1123.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* DSTW */ {ST_LIQUID, PT_ICEI, 273.15f, PT_NONE, 0.0f, PT_WTRV, 373.0f, PT_NONE, 0.0f},
/* SALT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1173.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SLTW */ {ST_LIQUID, PT_ICEI, 233.0f, PT_NONE, 0.0f, PT_WTRV, 483.0f, PT_NONE, 0.0f},
/* DMND */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* BMTL */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* BRMT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* PHOT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* URAN */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 2373.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* WAX */ {ST_SOLID, PT_NONE, 0.0f, PT_MWAX, 319.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* MWAX */ {ST_LIQUID, PT_WAX, 318.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f},
/* PSCN */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* NSCN */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* LNTG */ {ST_SOLID, PT_NICE, 63.0f, PT_NONE, 0.0f, PT_NONE, 77.0f, PT_NONE, 0.0f},
/* FOAM */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* BHOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* WHOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* RBDM */ {ST_SOLID, PT_NONE, 0.0f, PT_LRBD, 312.0f, PT_NONE, 0.0f, PT_FIRE, 961.0f},
/* LRBD */ {ST_LIQUID, PT_RBDM, 311.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 961.0f},
/* HSCN */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SAND */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1973.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* GLAS */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1973.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* CSCN */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1414.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* BGLA */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1973.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* THDR */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* PLSM */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* ETRD */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* NICE */ {ST_SOLID, PT_NONE, 0.0f, PT_LNTG, 63.1f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* NBLE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* BTRY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_PLSM, 2273.0f},
/* LCRY */ {ST_SOLID, PT_NONE, 0.0f, PT_BGLA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* STKM */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 620.0f},
/* SWCH */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SMKE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 625.0f},
/* DESL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 335.0f},
/* COAL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 90.1f, PT_NONE, 0.0f},
/* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 90.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* INWR */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* YEST */ {ST_SOLID, PT_NONE, 0.0f, PT_DYST, 373.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* DYST */ {ST_SOLID, PT_NONE, 0.0f, PT_DUST, 473.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* THRM */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* GLOW */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* BRCK */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1223.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* HFLM */ {ST_GAS, PT_NONE, 0.0f, PT_NONE,0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* FIRW */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE,0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* FUSE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* FSEP */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* AMtr */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* PCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* HSWC */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
};
static unsigned char can_move[PT_NUM][PT_NUM] =
{
/* A B */
/* A 0 1 | B ligher than A */
/* B 1 0 | A heavier than B */
/* N D W O F S L G N C G P D I M S S W N P P A V W C D S S D B B P U W M P N L I B W R L H S G C B T P E N N B L S S S D C L O I Y D T G B H F F F A P H */
/* o u a i i t a u i l a l f c e p n o e l l c o t n s a l m m r h r a W S S N N H H b R S a l s G h l t i B t C T W M e o O 2 N E Y H L R F I U S M C S */
/* n s t l r n v n t n s e r e t r o o u u n i i r c t l t n t m o a x a c c 2 S o o d b C n a c l d s r c L r r K C K s a X W S S R O C L R S E T L W */
/* e t r l e e a p r e s x m i l k w d t t t d d v t w t w d l t t n x n n U l l m d N d s n a r m d e E y y M H E l l R T T M W K M W E P R N C */
/* NONE */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* HSWC */
/* N D W O F S L G N C G P D I M S S W N P P A V W C D S S D B B P U W M P N L I B W R L H S G C B T P E N N B L S S S D C L O I Y D T G B H F F F A P H */
/* o u a i i t a u i l a l f c e p n o e l l c o t n s a l m m r h r a W S S N N H H b R S a l s G h l t i B t C T W M e o O 2 N E Y H L R F I U S M C S */
/* n s t l r n v n t n s e r e t r o o u u n i i r c t l t n t m o a x a c c 2 S o o d b C n a c l d s r c L r r K C K s a X W S S R O C L R S E T L W */
/* e t r l e e a p r e s x m i l k w d t t t d d v t w t w d l t t n x n n U l l m d N d s n a r m d e E y y M H E l l R T T M W K M W E P R N C */
};
extern int isplayer;
extern float player[27];
extern particle *parts;
extern particle *cb_parts;
extern unsigned char bmap[YRES/CELL][XRES/CELL];
extern unsigned char emap[YRES/CELL][XRES/CELL];
extern unsigned char cb_bmap[YRES/CELL][XRES/CELL];
extern unsigned char cb_emap[YRES/CELL][XRES/CELL];
extern int pfree;
extern unsigned pmap[YRES][XRES];
unsigned cb_pmap[YRES][XRES];
int try_move(int i, int x, int y, int nx, int ny);
void kill_part(int i);
#ifdef WIN32
extern _inline int create_part(int p, int x, int y, int t);
#else
extern inline int create_part(int p, int x, int y, int t);
#endif
#ifdef WIN32
extern _inline void delete_part(int x, int y);
#else
extern inline void delete_part(int x, int y);
#endif
#ifdef WIN32
extern _inline int is_wire(int x, int y);
#else
extern inline int is_wire(int x, int y);
#endif
#ifdef WIN32
extern _inline int is_wire_off(int x, int y);
#else
extern inline int is_wire_off(int x, int y);
#endif
void set_emap(int x, int y);
#ifdef WIN32
_inline int parts_avg(int ci, int ni);
#else
inline int parts_avg(int ci, int ni);
#endif
int nearest_part(int ci, int t);
void update_particles_i(pixel *vid, int start, int inc);
void update_particles(pixel *vid);
void clear_area(int area_x, int area_y, int area_w, int area_h);
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 create_parts(int x, int y, int r, int c);
void create_line(int x1, int y1, int x2, int y2, int r, int c);
#endif

201
update.c
View File

@ -1,201 +0,0 @@
/**
* Powder Toy - Update Helper
*
* Copyright (c) 2008 - 2010 Stanislaw Skowronek.
* Copyright (c) 2010 Simon Robertshaw
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#include <stdio.h>
#ifndef MACOSX
#include <malloc.h>
#endif
#include <string.h>
#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#include <sys/stat.h>
#endif
#ifdef MACOSX
#include <mach-o/dyld.h>
#include <errno.h>
#include <sys/param.h>
#endif
#include "update.h"
static char *exe_name(void)
{
#if defined WIN32
char *name= (char *)malloc(64), max=64, res;
while((res = (char)GetModuleFileName(NULL, name, max)) >= max)
{
#elif defined MACOSX
char *fn=malloc(64),*name=malloc(PATH_MAX), max=64, res;
if(_NSGetExecutablePath(fn, &max) != 0)
{
fn = realloc(fn, max);
_NSGetExecutablePath(fn, &max);
}
if(realpath(fn, name) == NULL)
{
free(fn);
free(name);
return NULL;
}
res = 1;
#else
char fn[64], *name=malloc(64), max=64, res;
sprintf(fn, "/proc/self/exe");
memset(name, 0, max);
while((res = readlink(fn, name, max)) >= max-1)
{
#endif
#ifndef MACOSX
max *= 2;
name = realloc(name, max);
memset(name, 0, max);
}
#endif
if(res <= 0)
{
free(name);
return NULL;
}
return name;
}
int update_start(char *data, int len)
{
char *self=exe_name(), *temp;
#ifdef WIN32
char *p;
#endif
FILE *f;
int res = 1;
if(!self)
return 1;
#ifdef WIN32
temp = malloc(strlen(self)+12);
strcpy(temp, self);
p = temp + strlen(temp) - 4;
if(_stricmp(p, ".exe"))
p += 4;
strcpy(p, "_update.exe");
if(!MoveFile(self, temp))
goto fail;
f = fopen(self, "wb");
if(!f)
goto fail;
if(fwrite(data, 1, len, f) != len)
{
fclose(f);
DeleteFile(self);
goto fail;
}
fclose(f);
if((int)ShellExecute(NULL, "open", self, NULL, NULL, SW_SHOWNORMAL) <= 32)
{
DeleteFile(self);
goto fail;
}
return 0;
#else
temp = malloc(strlen(self)+8);
strcpy(temp, self);
strcat(temp, "-update");
f = fopen(temp, "w");
if(!f)
goto fail;
if(fwrite(data, 1, len, f) != len)
{
fclose(f);
unlink(temp);
goto fail;
}
fclose(f);
if(chmod(temp, 0755))
{
unlink(temp);
goto fail;
}
if(rename(temp, self))
{
unlink(temp);
goto fail;
}
execl(self, "powder-update", NULL);
#endif
fail:
free(temp);
free(self);
return res;
}
int update_finish(void)
{
#ifdef WIN32
char *temp, *self=exe_name(), *p;
int timeout = 60, err;
temp = malloc(strlen(self)+12);
strcpy(temp, self);
p = temp + strlen(temp) - 4;
if(_stricmp(p, ".exe"))
p += 4;
strcpy(p, "_update.exe");
while(!DeleteFile(temp))
{
err = GetLastError();
if(err == ERROR_FILE_NOT_FOUND)
{
// just as well, then
free(temp);
return 0;
}
Sleep(500);
timeout--;
if(timeout <= 0)
{
free(temp);
return 1;
}
}
free(temp);
#endif
return 0;
}
void update_cleanup(void)
{
#ifdef WIN32
update_finish();
#endif
}

View File

@ -1,27 +0,0 @@
/**
* Powder Toy - Main source
*
* Copyright (c) 2008 - 2010 Stanislaw Skowronek.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef UPDATE_H
#define UPDATE_H
int update_start(char *data, int len);
int update_finish(void);
void update_cleanup(void);
#endif

View File

@ -1,25 +0,0 @@
/**
* Powder Toy - Version (Header)
*
* Copyright (c) 2008 - 2010 Stanislaw Skowronek.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef VERSION_H
#define VERSION_H
#endif