Merge branch 'dev' of git://github.com/jacksonmj/The-Powder-Toy

This commit is contained in:
Simon 2011-01-28 19:56:44 +00:00
commit 079d35f1a0
65 changed files with 73 additions and 63 deletions

8
includes/element.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef ELEMENT_H
#define ELEMENT_H
// This header should be included by all files in src/elements/
#include "powder.h"
#include "misc.h"
#endif

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_ACID(UPDATE_FUNC_ARGS) { int update_ACID(UPDATE_FUNC_ARGS) {
int r,rx,ry; int r,rx,ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_AMTR(UPDATE_FUNC_ARGS) { int update_AMTR(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_ARAY(UPDATE_FUNC_ARGS) { int update_ARAY(UPDATE_FUNC_ARGS) {
int r, nxx, nyy, docontinue, nxi, nyi, rx, ry, nr; int r, nxx, nyy, docontinue, nxi, nyi, rx, ry, nr;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_BCLN(UPDATE_FUNC_ARGS) { int update_BCLN(UPDATE_FUNC_ARGS) {
if (!parts[i].life) if (!parts[i].life)

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_BCOL(UPDATE_FUNC_ARGS) { int update_BCOL(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_BMTL(UPDATE_FUNC_ARGS) { int update_BMTL(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt; int r, rx, ry, rt;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_BOMB(UPDATE_FUNC_ARGS) { int update_BOMB(UPDATE_FUNC_ARGS) {
int r, rx, ry, nb; int r, rx, ry, nb;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_BOYL(UPDATE_FUNC_ARGS) { int update_BOYL(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_BTRY(UPDATE_FUNC_ARGS) { int update_BTRY(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt; int r, rx, ry, rt;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_C5(UPDATE_FUNC_ARGS) { int update_C5(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_CLNE(UPDATE_FUNC_ARGS) { int update_CLNE(UPDATE_FUNC_ARGS) {
if (!parts[i].ctype) if (!parts[i].ctype)

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_COAL(UPDATE_FUNC_ARGS) { int update_COAL(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_DEUT(UPDATE_FUNC_ARGS) { int update_DEUT(UPDATE_FUNC_ARGS) {
int r, rx, ry, trade, np; int r, rx, ry, trade, np;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_DSTW(UPDATE_FUNC_ARGS) { int update_DSTW(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_FIRW(UPDATE_FUNC_ARGS) { int update_FIRW(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt; int r, rx, ry, rt;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_FOG(UPDATE_FUNC_ARGS) { int update_FOG(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_FRZW(UPDATE_FUNC_ARGS) { int update_FRZW(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_FRZZ(UPDATE_FUNC_ARGS) { int update_FRZZ(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_FSEP(UPDATE_FUNC_ARGS) { int update_FSEP(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_FUSE(UPDATE_FUNC_ARGS) { int update_FUSE(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_FWRK(UPDATE_FUNC_ARGS) { int update_FWRK(UPDATE_FUNC_ARGS) {
int r, rx, ry, np; int r, rx, ry, np;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_GLAS(UPDATE_FUNC_ARGS) { int update_GLAS(UPDATE_FUNC_ARGS) {
parts[i].pavg[0] = parts[i].pavg[1]; parts[i].pavg[0] = parts[i].pavg[1];

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_GLOW(UPDATE_FUNC_ARGS) { int update_GLOW(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_GOO(UPDATE_FUNC_ARGS) { int update_GOO(UPDATE_FUNC_ARGS) {
if (!parts[i].life) if (!parts[i].life)

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_HSWC(UPDATE_FUNC_ARGS) { int update_HSWC(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_ICEI(UPDATE_FUNC_ARGS) { //currently used for snow as well int update_ICEI(UPDATE_FUNC_ARGS) { //currently used for snow as well
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_IRON(UPDATE_FUNC_ARGS) { int update_IRON(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_ISZ(UPDATE_FUNC_ARGS) { // for both ISZS and ISOZ int update_ISZ(UPDATE_FUNC_ARGS) { // for both ISZS and ISOZ
float rr, rrr; float rr, rrr;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_LCRY(UPDATE_FUNC_ARGS) { int update_LCRY(UPDATE_FUNC_ARGS) {
if (parts[i].life==10) if (parts[i].life==10)

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
// Interactions which only occur when legacy_enable is on // Interactions which only occur when legacy_enable is on
int update_legacy_all(UPDATE_FUNC_ARGS) { int update_legacy_all(UPDATE_FUNC_ARGS) {

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_MISC(UPDATE_FUNC_ARGS) { int update_MISC(UPDATE_FUNC_ARGS) {
int t = parts[i].type; int t = parts[i].type;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_MORT(UPDATE_FUNC_ARGS) { int update_MORT(UPDATE_FUNC_ARGS) {
create_part(-1, x, y-1, PT_SMKE); create_part(-1, x, y-1, PT_SMKE);

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_NEUT(UPDATE_FUNC_ARGS) { int update_NEUT(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_(UPDATE_FUNC_ARGS) { int update_(UPDATE_FUNC_ARGS) {

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_NPTCT(UPDATE_FUNC_ARGS) { int update_NPTCT(UPDATE_FUNC_ARGS) {
if (parts[i].temp>295.0f) if (parts[i].temp>295.0f)

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_PCLN(UPDATE_FUNC_ARGS) { int update_PCLN(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_PHOT(UPDATE_FUNC_ARGS) { int update_PHOT(UPDATE_FUNC_ARGS) {
if (1>rand()%10) update_PYRO(UPDATE_FUNC_SUBCALL_ARGS); if (1>rand()%10) update_PYRO(UPDATE_FUNC_SUBCALL_ARGS);

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_PIPE(UPDATE_FUNC_ARGS) { int update_PIPE(UPDATE_FUNC_ARGS) {
int r, rx, ry, np, trade, q, ctype; int r, rx, ry, np, trade, q, ctype;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_PLNT(UPDATE_FUNC_ARGS) { int update_PLNT(UPDATE_FUNC_ARGS) {
int r, rx, ry, np; int r, rx, ry, np;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_PLUT(UPDATE_FUNC_ARGS) { int update_PLUT(UPDATE_FUNC_ARGS) {
if (1>rand()%100 && ((int)(5.0f*pv[y/CELL][x/CELL]))>(rand()%1000)) if (1>rand()%100 && ((int)(5.0f*pv[y/CELL][x/CELL]))>(rand()%1000))

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_PRTI(UPDATE_FUNC_ARGS) { int update_PRTI(UPDATE_FUNC_ARGS) {
int r, nnx, rx, ry; int r, nnx, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_PRTO(UPDATE_FUNC_ARGS) { int update_PRTO(UPDATE_FUNC_ARGS) {
int r, nnx, rx, ry, np; int r, nnx, rx, ry, np;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_PUMP(UPDATE_FUNC_ARGS) { int update_PUMP(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_PYRO(UPDATE_FUNC_ARGS) { int update_PYRO(UPDATE_FUNC_ARGS) {
int r, rx, ry, rt, t = parts[i].type; int r, rx, ry, rt, t = parts[i].type;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_QRTZ(UPDATE_FUNC_ARGS) { int update_QRTZ(UPDATE_FUNC_ARGS) {
parts[i].pavg[0] = parts[i].pavg[1]; parts[i].pavg[0] = parts[i].pavg[1];

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_RIME(UPDATE_FUNC_ARGS) { int update_RIME(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_SHLD1(UPDATE_FUNC_ARGS) { int update_SHLD1(UPDATE_FUNC_ARGS) {
int r, nnx, nny, rx, ry; int r, nnx, nny, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_SING(UPDATE_FUNC_ARGS) { int update_SING(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_SLTW(UPDATE_FUNC_ARGS) { int update_SLTW(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_SPNG(UPDATE_FUNC_ARGS) { int update_SPNG(UPDATE_FUNC_ARGS) {
int r, trade, rx, ry, tmp; int r, trade, rx, ry, tmp;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_SPRK(UPDATE_FUNC_ARGS) { int update_SPRK(UPDATE_FUNC_ARGS) {
update_PYRO(UPDATE_FUNC_SUBCALL_ARGS); update_PYRO(UPDATE_FUNC_SUBCALL_ARGS);

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_SPAWN(UPDATE_FUNC_ARGS) { int update_SPAWN(UPDATE_FUNC_ARGS) {
ISSPAWN1 = 1; ISSPAWN1 = 1;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_SPAWN2(UPDATE_FUNC_ARGS) { int update_SPAWN2(UPDATE_FUNC_ARGS) {
ISSPAWN2 = 1; ISSPAWN2 = 1;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_SWCH(UPDATE_FUNC_ARGS) { int update_SWCH(UPDATE_FUNC_ARGS) {
int r, rt, rx, ry; int r, rt, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_THDR(UPDATE_FUNC_ARGS) { int update_THDR(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_THRM(UPDATE_FUNC_ARGS) { int update_THRM(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_URAN(UPDATE_FUNC_ARGS) { int update_URAN(UPDATE_FUNC_ARGS) {
if (!legacy_enable && pv[y/CELL][x/CELL]>0.0f) if (!legacy_enable && pv[y/CELL][x/CELL]>0.0f)

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_VINE(UPDATE_FUNC_ARGS) { int update_VINE(UPDATE_FUNC_ARGS) {
int r, np, rx =(rand()%3)-1, ry=(rand()%3)-1; int r, np, rx =(rand()%3)-1, ry=(rand()%3)-1;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_WARP(UPDATE_FUNC_ARGS) { int update_WARP(UPDATE_FUNC_ARGS) {
int trade, r, rx, ry; int trade, r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_WATR(UPDATE_FUNC_ARGS) { int update_WATR(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_WIFI(UPDATE_FUNC_ARGS) { int update_WIFI(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_WTRV(UPDATE_FUNC_ARGS) { int update_WTRV(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1,4 +1,4 @@
#include <powder.h> #include <element.h>
int update_YEST(UPDATE_FUNC_ARGS) { int update_YEST(UPDATE_FUNC_ARGS) {
int r, rx, ry; int r, rx, ry;

View File

@ -1565,6 +1565,7 @@ void update_particles_i(pixel *vid, int start, int inc)
} }
else s = 0; else s = 0;
if (s) { // particle type change occurred if (s) { // particle type change occurred
parts[i].life = 0;
if (t==PT_ICEI||t==PT_LAVA) if (t==PT_ICEI||t==PT_LAVA)
parts[i].ctype = parts[i].type; parts[i].ctype = parts[i].type;
if (ptypes[t].state==ST_GAS&&ptypes[parts[i].type].state!=ST_GAS) if (ptypes[t].state==ST_GAS&&ptypes[parts[i].type].state!=ST_GAS)
@ -1672,6 +1673,7 @@ void update_particles_i(pixel *vid, int start, int inc)
} }
else s = 0; else s = 0;
if (s) { // particle type change occurred if (s) { // particle type change occurred
parts[i].life = 0;
part_change_type(i,x,y,t); part_change_type(i,x,y,t);
if (t==PT_FIRE) if (t==PT_FIRE)
parts[i].life = rand()%50+120; parts[i].life = rand()%50+120;