From c5e80b4d8ec90e2126372b868382320c7f446d32 Mon Sep 17 00:00:00 2001 From: Phil Date: Sat, 4 Sep 2010 20:23:58 -0400 Subject: [PATCH 01/79] should be all in K now, semi-conductors might be buggy, not sure why --- graphics.c | 6 +++--- main.c | 4 ++-- powder.c | 26 +++++++++++++------------- powder.h | 38 +++++++++++++++++++------------------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/graphics.c b/graphics.c index 7b9672043..f35bffedf 100644 --- a/graphics.c +++ b/graphics.c @@ -1640,7 +1640,7 @@ void draw_parts(pixel *vid) } else if(t==PT_PLSM) { float ttemp = (float)parts[i].life; - int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); + int caddress = restrict_flt(restrict_flt(ttemp, 273.0f, 473.0f)*3, 273.0f, (473.0f*3)-3); uint8 R = plasma_data[caddress]; uint8 G = plasma_data[caddress+1]; uint8 B = plasma_data[caddress+2]; @@ -1785,7 +1785,7 @@ void draw_parts(pixel *vid) else { float ttemp = parts[i].temp+(-MIN_TEMP); - int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/512) ) *3, 0.0f, (512.0f*3)-3); + int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, 3773+(-MIN_TEMP)) / ((3773+(-MIN_TEMP))/512) ) *3, 0.0f, (512.0f*3)-3); uint8 R = color_data[caddress]; uint8 G = color_data[caddress+1]; uint8 B = color_data[caddress+2]; @@ -1871,7 +1871,7 @@ void render_signs(pixel *vid_buf) if((pmap[signs[i].y][signs[i].x]>>8)>0 && (pmap[signs[i].y][signs[i].x]>>8)>8].temp); //...tempirature else - sprintf(buff, "Temp: 0.00"); //...tempirature + sprintf(buff, "Temp: N/A"); //...tempirature drawtext(vid_buf, x+3, y+3, buff, 255, 255, 255, 255); } diff --git a/main.c b/main.c index 8d37a88d3..76619456b 100644 --- a/main.c +++ b/main.c @@ -1355,9 +1355,9 @@ int main(int argc, char *argv[]) if(!((cr>>8)>=NPART || !cr)) { #ifdef BETA - sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp, parts[cr>>8].life); + sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f K, Life: %d", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp, parts[cr>>8].life); #else - 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); + sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f K", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp); #endif } else diff --git a/powder.c b/powder.c index 58fed0cb9..acbc9544f 100644 --- a/powder.c +++ b/powder.c @@ -809,7 +809,7 @@ void update_particles_i(pixel *vid, int start, int inc) } if(t==PT_LAVA) { - parts[i].life = restrict_flt((pt-700)/7, 0.0f, 400.0f); + parts[i].life = restrict_flt((pt-700)/7, 273.0f, 673.0f); if(parts[i].ctype==PT_THRM&&parts[i].tmp>0) { parts[i].tmp--; @@ -819,11 +819,11 @@ void update_particles_i(pixel *vid, int start, int inc) pt = parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP); } } - if(t==PT_PTCT&&parts[i].temp>24.0f) + if(t==PT_PTCT&&parts[i].temp>297.0f) { pt = parts[i].temp -= 2.5f; } - if(t==PT_NTCT&&parts[i].temp>24.0f) + if(t==PT_NTCT&&parts[i].temp>297.0f) { pt = parts[i].temp -= 2.5f; } @@ -938,7 +938,7 @@ void update_particles_i(pixel *vid, int start, int inc) continue; if((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_METL) { - parts[i].temp = 200.0f; + parts[i].temp = 473.0f; } } } @@ -1399,19 +1399,19 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_SPRK && (rt==PT_METL||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)=100.0f)&&parts[i].ctype==PT_NTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp<=100.0f)&&parts[i].ctype==PT_PTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN)&&parts[i].ctype==PT_INWR) && pavg != PT_INSL &&!(parts[i].ctype==PT_SWCH&&(rt==PT_PSCN||rt==PT_NSCN)) ) + if(!(rt==PT_PSCN&&parts[i].ctype==PT_NSCN)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp>=373.0f)&&parts[i].ctype==PT_NTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp<=373.0f)&&parts[i].ctype==PT_PTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN)&&parts[i].ctype==PT_INWR) && pavg != PT_INSL &&!(parts[i].ctype==PT_SWCH&&(rt==PT_PSCN||rt==PT_NSCN)) ) { parts[r>>8].type = PT_SPRK; parts[r>>8].life = 4; parts[r>>8].ctype = rt; - if(parts[r>>8].temp+10.0f<400.0f&&!legacy_enable&&!(rt==PT_LRBD||rt==PT_RBDM||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR)) + if(parts[r>>8].temp+10.0f<673.0f&&!legacy_enable&&!(rt==PT_LRBD||rt==PT_RBDM||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR)) parts[r>>8].temp = parts[r>>8].temp+10.0f; } } if(t==PT_SPRK && rt==PT_NTCT && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)>8].temp>100.0f))&&pavg != PT_INSL) + if((parts[i].ctype==PT_NSCN||parts[i].ctype==PT_NTCT||(parts[i].ctype==PT_PSCN&&parts[r>>8].temp>373.0f))&&pavg != PT_INSL) { parts[r>>8].type = PT_SPRK; parts[r>>8].life = 4; @@ -1421,7 +1421,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_SPRK && rt==PT_PTCT && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)>8].temp<100.0f))&&pavg != PT_INSL) + if((parts[i].ctype==PT_NSCN||parts[i].ctype==PT_PTCT||(parts[i].ctype==PT_PSCN&&parts[r>>8].temp<373.0f))&&pavg != PT_INSL) { parts[r>>8].type = PT_SPRK; parts[r>>8].life = 4; @@ -1487,9 +1487,9 @@ killed: if(t==PT_STKM) { //Tempirature handling - if(parts[i].temp<-30) + if(parts[i].temp<243) parts[i].life -= 0.2; - if((parts[i].temp<36.6f) && (parts[i].temp>=-30)) + if((parts[i].temp<309.6f) && (parts[i].temp>=243)) parts[i].temp += 1; //Death @@ -1811,7 +1811,7 @@ killed: if (r>0 && (r>>8)>8].temp>=50 || parts[r>>8].temp<=-30) + if(parts[r>>8].temp>=323 || parts[r>>8].temp<=243) { parts[i].life -= 2; player[16] -= 1; @@ -1832,7 +1832,7 @@ killed: if(r>0 && (r>>8)>8].temp>=50 || parts[r>>8].temp<=-30) + if(parts[r>>8].temp>=323 || parts[r>>8].temp<=243) { parts[i].life -= 2; player[8] -= 1; @@ -1866,7 +1866,7 @@ killed: } if(t==PT_YEST) { - if(parts[i].temp>30&&parts[i].temp<44){ + if(parts[i].temp>303&&parts[i].temp<317){ create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_YEST); } } diff --git a/powder.h b/powder.h index dc65f16ce..5b2f7c43f 100644 --- a/powder.h +++ b/powder.h @@ -106,7 +106,7 @@ #define PT_THRM 65 #define PT_NUM 66 -#define R_TEMP 22 +#define R_TEMP 295 #define MAX_TEMP 9999 #define MIN_TEMP 0 @@ -217,21 +217,21 @@ static const part_type ptypes[PT_NUM] = {"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, 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, 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, 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, -205.0f, 70, "Liquid Nitrogen. Very cold."}, + {"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, 68.0f, 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, 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, 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, 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, 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, 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, 251, "Semi-conductor. Only conducts electricity when hot (More than 100C)"}, + {"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, 251, "Semi-conductor. Only conducts electricity when hot (More than 373K)"}, {"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, 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, 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, 251, "Semi-conductor. Only conducts electricity when cold (Less than 120C)"}, + {"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, 251, "Semi-conductor. Only conducts electricity when cold (Less than 373K)"}, {"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, 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, 3500.0f, 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, 3500.0f, 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, 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, -250.0f, 46, "Nitrogen Ice."}, + {"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, 23.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, 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, 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, 251, "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)"}, @@ -240,10 +240,10 @@ static const part_type ptypes[PT_NUM] = {"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+400.0f, 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, 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, 10, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f, 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, -210.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire"}, + {"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, 63.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, 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, 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, 70, "Yeast, grows when warm (~37C)."}, + {"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, 70, "Yeast, grows when warm (~310K)."}, {"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, 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_POWDERS, R_TEMP+0.0f, 211, "Thermite."}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description @@ -254,7 +254,7 @@ 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, 0.0f, PT_NONE, 0.0f, PT_WTRV, 373.0f, PT_NONE, 0.0f}, + /* WATR */ {ST_LIQUID, PT_ICEI, 273.0f, 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}, @@ -262,30 +262,30 @@ static part_state pstates[PT_NUM] = /* 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}, + /* GAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 323.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, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* ICE */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 273.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, 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, 0.0f, PT_DSTW, 371.0f, PT_NONE, 373.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, 0.0f, PT_NONE, 0.0f, PT_WTRV, 373.0f, PT_NONE, 0.0f}, + /* DSTW */ {ST_LIQUID, PT_ICEI, 273.0f, 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, 1000.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* BRMT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1000.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, 46.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}, @@ -311,11 +311,11 @@ static part_state pstates[PT_NUM] = /* 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_NONE, 0.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_FIRE, 673.0f}, - /* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 453.0f, PT_NONE, 0.0f}, + /* COAL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 873.0f}, + /* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 53.0f, PT_NONE, 0.0f}, /* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 50.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, 273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* YEST */ {ST_SOLID, PT_NONE, 0.0f, PT_DYST, 333.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}, }; From 0749981503eabb6dd3ed3795dcc07c7d340ff83b Mon Sep 17 00:00:00 2001 From: Phil Date: Sat, 4 Sep 2010 22:01:10 -0400 Subject: [PATCH 02/79] Fixed some K errors --- powder.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/powder.h b/powder.h index 5b2f7c43f..44fc20d1a 100644 --- a/powder.h +++ b/powder.h @@ -279,7 +279,7 @@ static part_state pstates[PT_NUM] = /* 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.0f, 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}, + /* SLTW */ {ST_LIQUID, PT_ICEI, 233.0f, PT_NONE, 0.0f, PT_WTRV, 383.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}, @@ -289,7 +289,7 @@ static part_state pstates[PT_NUM] = /* 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, 75.0f, PT_NONE, 0.0f, PT_NONE, 78.0f, PT_NONE, 0.0f}, + /* LNTG */ {ST_SOLID, PT_NICE, 63.0f, PT_NONE, 0.0f, PT_NONE, 77.2f, 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}, @@ -303,7 +303,7 @@ static part_state pstates[PT_NUM] = /* 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, 77.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* NICE */ {ST_SOLID, PT_NONE, 0.0f, PT_LNTG, 64.0f, 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}, @@ -312,8 +312,8 @@ static part_state pstates[PT_NUM] = /* SMKE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.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_FIRE, 873.0f}, - /* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 53.0f, PT_NONE, 0.0f}, - /* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 50.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 93.0f, PT_NONE, 0.0f}, + /* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 83.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, 333.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}, From 2c4b08696d23ddedab4edf1ac24dce1d4413e39d Mon Sep 17 00:00:00 2001 From: Phil Date: Mon, 6 Sep 2010 22:41:51 -0400 Subject: [PATCH 03/79] updating --- defines.h | 2 + graphics.c | 98 +++++++++++------ main.c | 37 ++++--- powder.c | 224 +++++++++++++++++++++----------------- powder.h | 308 +++++++++++++++++++++++++++-------------------------- 5 files changed, 381 insertions(+), 288 deletions(-) diff --git a/defines.h b/defines.h index 3599d37a6..f59eb4ed6 100644 --- a/defines.h +++ b/defines.h @@ -66,6 +66,8 @@ typedef unsigned char uint8; extern int amd; +extern int FPSB; + extern int legacy_enable; extern int sys_pause; diff --git a/graphics.c b/graphics.c index f35bffedf..f576f905f 100644 --- a/graphics.c +++ b/graphics.c @@ -1163,6 +1163,7 @@ void draw_parts(pixel *vid) { int i, x, y, t, nx, ny, r, s; int cr, cg, cb; + float fr, fg, fb; float pt = R_TEMP; for(i = 0; i(nx-3) && mousex<(nx+3) && mousey<(ny+3) && mousey>(ny-3)) //If mous is in the head { - sprintf(buff, "%3d", (int)parts[i].life); //Show HP + sprintf(buff, "%3d", parts[i].life); //Show HP drawtext(vid, mousex-8-2*(parts[i].life<100)-2*(parts[i].life<10), mousey-12, buff, 255, 255, 255, 255); } @@ -1608,39 +1609,66 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); } } - else if(t==PT_LCRY) + else if(t==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)); if(cmode == 3||cmode==4 || cmode==6) { - //cr = R/8; - //cg = G/8; - //cb = B/8; - vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(0x50+(parts[i].life*10), 0x50+(parts[i].life*10), 0x50+(parts[i].life*10)); - //x = nx/CELL; - //y = ny/CELL; - //cg += fire_g[y][x]; if(cg > 255) cg = 255; fire_g[y][x] = cg; - //cb += fire_b[y][x]; if(cb > 255) cb = 255; fire_b[y][x] = cb; - //cr += fire_r[y][x]; if(cr > 255) cr = 255; fire_r[y][x] = cr; - } - else - { - cr = 0x50+(parts[i].life*10); - cg = 0x50+(parts[i].life*10); - cb = 0x50+(parts[i].life*10); - blendpixel(vid, nx, ny, cr, cg, cb, 192); - blendpixel(vid, nx+1, ny, cr, cg, cb, 96); - blendpixel(vid, nx-1, ny, cr, cg, cb, 96); - blendpixel(vid, nx, ny+1, cr, cg, cb, 96); - blendpixel(vid, nx, ny-1, cr, cg, cb, 96); - blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32); - blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32); - blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); - blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); + x = nx/CELL; + y = ny/CELL; + fg += fire_g[y][x]; + 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; + fr += fire_r[y][x]; + if(fr > 255) fr = 255; + fire_r[y][x] = fr; } + if(cmode == 4){ + uint8 R = (int)restrict_flt(0x44 + fr*8, 0, 255); + uint8 G = (int)restrict_flt(0x88 + fg*8, 0, 255); + uint8 B = (int)restrict_flt(0x44 + fb*8, 0, 255); + + blendpixel(vid, nx+1, ny, R, G, B, 223); + blendpixel(vid, nx-1, ny, R, G, B, 223); + blendpixel(vid, nx, ny+1, R, G, B, 223); + blendpixel(vid, nx, ny-1, R, G, B, 223); + + blendpixel(vid, nx+1, ny-1, R, G, B, 112); + blendpixel(vid, nx-1, ny-1, R, G, B, 112); + blendpixel(vid, nx+1, ny+1, R, G, B, 112); + blendpixel(vid, nx-1, ny+1, R, G, B, 112); + } + } + else if(t==PT_LCRY) + { + uint8 GR = 0x50+(parts[i].life*10); + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, GR); + if(cmode == 4){ + blendpixel(vid, nx+1, ny, GR, GR, GR, 223); + blendpixel(vid, nx-1, ny, GR, GR, GR, 223); + blendpixel(vid, nx, ny+1, GR, GR, GR, 223); + blendpixel(vid, nx, ny-1, GR, GR, GR, 223); + + blendpixel(vid, nx+1, ny-1, GR, GR, GR, 112); + blendpixel(vid, nx-1, ny-1, GR, GR, GR, 112); + blendpixel(vid, nx+1, ny+1, GR, GR, GR, 112); + blendpixel(vid, nx-1, ny+1, GR, GR, GR, 112); + } } else if(t==PT_PLSM) { float ttemp = (float)parts[i].life; - int caddress = restrict_flt(restrict_flt(ttemp, 273.0f, 473.0f)*3, 273.0f, (473.0f*3)-3); + int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); uint8 R = plasma_data[caddress]; uint8 G = plasma_data[caddress+1]; uint8 B = plasma_data[caddress+2]; @@ -1785,7 +1813,7 @@ void draw_parts(pixel *vid) else { float ttemp = parts[i].temp+(-MIN_TEMP); - int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, 3773+(-MIN_TEMP)) / ((3773+(-MIN_TEMP))/512) ) *3, 0.0f, (512.0f*3)-3); + int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/512) ) *3, 0.0f, (512.0f*3)-3); uint8 R = color_data[caddress]; uint8 G = color_data[caddress+1]; uint8 B = color_data[caddress+2]; @@ -1796,7 +1824,7 @@ void draw_parts(pixel *vid) if(mousex>(nx-3) && mousex<(nx+3) && mousey<(ny+3) && mousey>(ny-3)) //If mous is in the head { - sprintf(buff, "%3d", (int)parts[i].life); //Show HP + sprintf(buff, "%3d", parts[i].life); //Show HP drawtext(vid, mousex-8-2*(parts[i].life<100)-2*(parts[i].life<10), mousey-12, buff, 255, 255, 255, 255); } @@ -1812,6 +1840,8 @@ void draw_parts(pixel *vid) draw_line(vid , player[3], player[4], player[7], player[8], R, G, B, s); draw_line(vid , nx, ny+3, player[11], player[12], R, G, B, s); draw_line(vid , player[11], player[12], player[15], player[16], R, G, B, s); + + isplayer = 1; //It's a secret. Tssss... } else { @@ -1819,7 +1849,7 @@ void draw_parts(pixel *vid) //blendpixel(vid, nx+1, ny, R, G, B, 255); } } - if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_NONE&&t!=PT_ACID) + if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH) { uint8 R = PIXR(ptypes[t].pcolors); uint8 G = PIXG(ptypes[t].pcolors); @@ -1871,7 +1901,7 @@ void render_signs(pixel *vid_buf) if((pmap[signs[i].y][signs[i].x]>>8)>0 && (pmap[signs[i].y][signs[i].x]>>8)>8].temp); //...tempirature else - sprintf(buff, "Temp: N/A"); //...tempirature + sprintf(buff, "Temp: 0.00"); //...tempirature drawtext(vid_buf, x+3, y+3, buff, 255, 255, 255, 255); } @@ -2354,6 +2384,12 @@ void Enable2D () glMatrixMode (GL_MODELVIEW); glPushMatrix (); glLoadIdentity (); + + glEnable (GL_BLEND); + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glHint( GL_LINE_SMOOTH_HINT, GL_NICEST); + glHint( GL_POINT_SMOOTH_HINT, GL_NICEST); } void RenderScene () { diff --git a/main.c b/main.c index 76619456b..854fbf369 100644 --- a/main.c +++ b/main.c @@ -98,8 +98,9 @@ float mheat = 0.0f; int do_open = 0; int sys_pause = 0; int legacy_enable = 0; //Used to disable new features such as heat, will be set by commandline or save. -int death = 1, framerender = 0; +int death = 0, framerender = 0; int amd = 1; +int FPSB = 0; sign signs[MAXSIGNS]; @@ -533,7 +534,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) parts[i].vy = (d[p++]-127.0f)/16.0f; if(parts[i].type == PT_STKM) { - player[2] = PT_DUST; + //player[2] = PT_DUST; player[3] = parts[i].x-1; //Setting legs positions player[4] = parts[i].y+6; @@ -588,7 +589,11 @@ int parse_save(void *save, int size, int replace, int x0, int y0) } if(i <= NPART) { - parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP; + if(ver>=42){ + parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP; + } else { + parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273; + } } else { @@ -943,7 +948,7 @@ int main(int argc, char *argv[]) char uitext[48] = ""; char heattext[64] = ""; int currentTime = 0; - int FPS = 0, FPSB = 0; + int FPS = 0; int pastFPS = 0; int past = 0; pixel *vid_buf=calloc((XRES+BARSIZE)*(YRES+MENUSIZE), PIXELSIZE); @@ -1155,9 +1160,10 @@ int main(int argc, char *argv[]) break; } } - if(sdl_key=='d') + if(sdl_key=='d' && isplayer) { - death = !(death); + death = 1; + //death = !(death); } if(sdl_key=='f') { @@ -1355,9 +1361,9 @@ int main(int argc, char *argv[]) if(!((cr>>8)>=NPART || !cr)) { #ifdef BETA - sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f K, Life: %d", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp, parts[cr>>8].life); + sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); #else - sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f K", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp); + 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 } else @@ -1979,6 +1985,7 @@ int main(int argc, char *argv[]) { #ifdef BETA sprintf(uitext, "Version %d (Beta %d) FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); + //printf("%s\n", uitext); #else sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); #endif @@ -2009,11 +2016,15 @@ int main(int argc, char *argv[]) } sdl_blit(0, 0, XRES+BARSIZE, YRES+MENUSIZE, vid_buf, XRES+BARSIZE); - //Setting an element for the stick man - if(ptypes[sr].falldown>0) - player[2] = sr; - else - player[2] = PT_DUST; + //Setting an element for the stick man + if(isplayer==0) + { + if(ptypes[sr].falldown>0 || sr == PT_NEUT || sr == PT_PHOT) + player[2] = sr; + else + player[2] = PT_DUST; + } + } http_done(); diff --git a/powder.c b/powder.c index acbc9544f..bfe432921 100644 --- a/powder.c +++ b/powder.c @@ -5,7 +5,7 @@ #include "misc.h" int isplayer = 0; -float player[20]; //[0] is a command cell, [3]-[18] are legs positions, [19] is index +float player[27]; //[0] is a command cell, [3]-[18] are legs positions, [19] is index, [19]-[26] are accelerations particle *parts; particle *cb_parts; @@ -485,7 +485,7 @@ void update_particles_i(pixel *vid, int start, int inc) { t = parts[i].ctype; if(t!=PT_METL&&t!=PT_BMTL&&t!=PT_BRMT&&t!=PT_LRBD&&t!=PT_RBDM&&t!=PT_BTRY&&t!=PT_NBLE) - parts[i].temp = R_TEMP; + parts[i].temp = R_TEMP + 273.15f; if(!t) t = PT_METL; parts[i].type = t; @@ -644,21 +644,23 @@ void update_particles_i(pixel *vid, int start, int inc) { if(t==PT_WTRV && pv[y/CELL][x/CELL]>4.0f) t = parts[i].type = PT_DSTW; - if(t==PT_DESL && pv[y/CELL][x/CELL]<-6.0f) + if(t==PT_OIL && pv[y/CELL][x/CELL]<-6.0f) t = parts[i].type = PT_GAS; if(t==PT_GAS && pv[y/CELL][x/CELL]>6.0f) - t = parts[i].type = PT_DESL; + t = parts[i].type = PT_OIL; if(t==PT_DESL && pv[y/CELL][x/CELL]>12.0f) t = parts[i].type = PT_FIRE; } - if(t==PT_DESL && pv[y/CELL][x/CELL]<-20.0f) - t = parts[i].type = PT_GAS; - if(t==PT_DESL && pv[y/CELL][x/CELL]>50.0f) // Only way I know to make it + if(t==PT_GAS && pv[y/CELL][x/CELL]<-6.0f) + t = parts[i].type = PT_OIL; + if(t==PT_DESL && pv[y/CELL][x/CELL]>12.0f) // Only way I know to make it t = parts[i].type = PT_FIRE; // combust under pressure. - if(t==PT_GAS && pv[y/CELL][x/CELL]>20.0f) - t = parts[i].type = PT_DESL; + if(t==PT_GAS && pv[y/CELL][x/CELL]>6.0f) + t = parts[i].type = PT_OIL; if(t==PT_BMTL && pv[y/CELL][x/CELL]>2.5f) t = parts[i].type = PT_BRMT; + if(t==PT_BRCK && pv[y/CELL][x/CELL]>2.8f) + t = parts[i].type = PT_STNE; //if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f) // t = parts[i].type = PT_BGLA; if(t==PT_GLAS) @@ -809,7 +811,7 @@ void update_particles_i(pixel *vid, int start, int inc) } if(t==PT_LAVA) { - parts[i].life = restrict_flt((pt-700)/7, 273.0f, 673.0f); + parts[i].life = restrict_flt((pt-700)/7, 0.0f, 400.0f); if(parts[i].ctype==PT_THRM&&parts[i].tmp>0) { parts[i].tmp--; @@ -819,11 +821,11 @@ void update_particles_i(pixel *vid, int start, int inc) pt = parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP); } } - if(t==PT_PTCT&&parts[i].temp>297.0f) + if(t==PT_PTCT&&parts[i].temp>249.0f) { pt = parts[i].temp -= 2.5f; } - if(t==PT_NTCT&&parts[i].temp>297.0f) + if(t==PT_NTCT&&parts[i].temp>249.0f) { pt = parts[i].temp -= 2.5f; } @@ -936,7 +938,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_METL) + if((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_METL && parts_avg(i, r>>8)!=PT_INSL) { parts[i].temp = 473.0f; } @@ -1161,10 +1163,10 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx; parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy; } - pv[y/CELL][x/CELL] += 20.0f * CFDS; //Used to be 2, some people said nukes weren't powerful enough + pv[y/CELL][x/CELL] += 10.0f * CFDS; //Used to be 2, some people said nukes weren't powerful enough fe ++; } - /*if((r&0xFF)==PT_GUNP && 15>(rand()%1000)) + if((r&0xFF)==PT_GUNP && 15>(rand()%1000)) parts[r>>8].type = PT_DUST; if((r&0xFF)==PT_DYST && 15>(rand()%1000)) parts[r>>8].type = PT_YEST; @@ -1186,9 +1188,13 @@ void update_particles_i(pixel *vid, int start, int inc) if((r&0xFF)==PT_DESL && 15>(rand()%1000)) parts[r>>8].type = PT_GAS; if((r&0xFF)==PT_COAL && 5>(rand()%100)) - parts[r>>8].type = PT_WOOD;*/ - if(parts[r>>8].type>1 && parts[r>>8].type!=PT_NEUT && parts[r>>8].type-1!=PT_NEUT && parts[r>>8].type-1!=PT_STKM && 15>(rand()%1000)) - parts[r>>8].type--; + parts[r>>8].type = PT_WOOD; + /*if(parts[r>>8].type>1 && parts[r>>8].type!=PT_NEUT && parts[r>>8].type-1!=PT_NEUT && parts[r>>8].type-1!=PT_STKM && + (ptypes[parts[r>>8].type-1].menusection==SC_LIQUID|| + ptypes[parts[r>>8].type-1].menusection==SC_EXPLOSIVE|| + ptypes[parts[r>>8].type-1].menusection==SC_GAS|| + ptypes[parts[r>>8].type-1].menusection==SC_POWDERS) && 15>(rand()%1000)) + parts[r>>8].type--;*/ } } else if(t==PT_PHOT) @@ -1486,15 +1492,17 @@ killed: } if(t==PT_STKM) { + float dt = 0.9;///(FPSB*FPSB); //Delta time in square //Tempirature handling if(parts[i].temp<243) - parts[i].life -= 0.2; + parts[i].life -= 1; if((parts[i].temp<309.6f) && (parts[i].temp>=243)) parts[i].temp += 1; //Death - if(parts[i].life<0 && (death == 1)) //If his HP is less that 0 or there is very big wind... + if(parts[i].life<1 || death == 1 || (pv[y/CELL][x/CELL]>=4.5f && player[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind... { + death = 0; for(r=-2; r<=1; r++) { create_part(-1, x+r, y-2, player[2]); @@ -1506,112 +1514,138 @@ killed: goto killed; } + parts[i].vy += -0.7*dt; //Head up! + //Verlet integration - pp = 2*player[3]-player[5]; + pp = 2*player[3]-player[5]+player[19]*dt*dt;; player[5] = player[3]; player[3] = pp; - pp = 2*player[4]-player[6]; + pp = 2*player[4]-player[6]+player[20]*dt*dt;; player[6] = player[4]; player[4] = pp; - pp = 2*player[7]-player[9]; + pp = 2*player[7]-player[9]+player[21]*dt*dt;; player[9] = player[7]; player[7] = pp; - pp = 2*player[8]-player[10]+1; + pp = 2*player[8]-player[10]+(player[22]+1)*dt*dt;; player[10] = player[8]; player[8] = pp; - pp = 2*player[11]-player[13]; + pp = 2*player[11]-player[13]+player[23]*dt*dt;; player[13] = player[11]; player[11] = pp; - pp = 2*player[12]-player[14]; + pp = 2*player[12]-player[14]+player[24]*dt*dt;; player[14] = player[12]; player[12] = pp; - pp = 2*player[15]-player[17]; + pp = 2*player[15]-player[17]+player[25]*dt*dt;; player[17] = player[15]; player[15] = pp; - pp = 2*player[16]-player[18]+1; + pp = 2*player[16]-player[18]+(player[26]+1)*dt*dt;; player[18] = player[16]; player[16] = pp; + //Setting acceleration to 0 + player[19] = 0; + player[20] = 0; + + player[21] = 0; + player[22] = 0; + + player[23] = 0; + player[24] = 0; + + player[25] = 0; + player[26] = 0; + //Go left - if (((int)(player[0])&0x01) == 0x01) + if (((int)(player[0])&0x01) == 0x01 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS) { if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF) != PT_LNTG) { if (pmap[(int)(player[8]-1)][(int)(player[7])]) { - player[9] += 3; - player[10] += 2; - player[5] += 2; + player[21] = -3; + player[22] = -2; + player[19] = -2; } if (pmap[(int)(player[16]-1)][(int)(player[15])]) { - player[17] += 3; - player[18] += 2; - player[13] +=2; + player[25] = -3; + player[26] = -2; + player[23] = -2; } } else { if (pmap[(int)(player[8]-1)][(int)(player[7])]) //It should move another way in liquids { - player[9] += 1; - player[10] += 1; - player[5] += 1; + player[21] = -1; + player[22] = -1; + player[19] = -1; } if (pmap[(int)(player[16]-1)][(int)(player[15])]) { - player[17] += 1; - player[18] += 1; - player[13] +=1; + player[25] = -1; + player[26] = -1; + player[23] = -1; } } } //Go right - if (((int)(player[0])&0x02) == 0x02) + if (((int)(player[0])&0x02) == 0x02 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS) { if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF) != PT_LNTG) { if (pmap[(int)(player[8]-1)][(int)(player[7])]) { - player[9] -= 3; - player[10] += 2; - player[5] -= 2; +player[21] = 3; +player[22] = -2; +player[19] = 2; } if (pmap[(int)(player[16]-1)][(int)(player[15])]) { - player[17] -= 3; - player[18] += 2; - player[13] -= 2; +player[25] = 3; +player[26] = -2; +player[23] = 2; } } else { if (pmap[(int)(player[8]-1)][(int)(player[7])]) { - player[9] -= 1; - player[10] += 1; - player[5] -= 1; +player[21] = 1; +player[22] = -1; +player[19] = 1; } if (pmap[(int)(player[16]-1)][(int)(player[15])]) { - player[17] -= 1; - player[18] += 1; - player[13] -= 1; +player[25] = 1; +player[26] = -1; +player[23] = 1; } } } + //Jump + if (((int)(player[0])&0x04) == 0x04 && (pstates[pmap[(int)(player[8]-0.5)][(int)(player[7])]&0xFF].state != ST_GAS || pstates[pmap[(int)(player[16]-0.5)][(int)(player[15])]&0xFF].state != ST_GAS)) + { + if (pmap[(int)(player[8]-0.5)][(int)(player[7])] || pmap[(int)(player[16]-0.5)][(int)(player[15])]) + { + parts[i].vy = -5; + player[22] -= 1; + player[26] -= 1; + } + } + //Charge detector wall if foot inside if(bmap[(int)(player[8]+0.5)/CELL][(int)(player[7]+0.5)/CELL]==6) set_emap((int)player[7]/CELL, (int)player[8]/CELL); @@ -1624,12 +1658,10 @@ killed: { if(!pmap[ny+y][nx+x] || (pmap[ny+y][nx+x]>>8)>=NPART) continue; - if((pstates[pmap[ny+y][nx+x]&0xFF].state != ST_SOLID && (pmap[ny+y][nx+x]&0xFF)!=PT_STKM - && (pmap[ny+y][nx+x]&0xFF)!=PT_WHOL && (pmap[ny+y][nx+x]&0xFF)!=PT_BHOL) - || (pmap[ny+y][nx+x]&0xFF) == PT_LNTG) - { - player[2] = pmap[ny+y][nx+x]&0xFF; //Current element - } + if(ptypes[pmap[ny+y][nx+x]&0xFF].falldown!=0 || (pmap[ny+y][nx+x]&0xFF) == PT_NEUT || (pmap[ny+y][nx+x]&0xFF) == PT_PHOT) + { + player[2] = pmap[ny+y][nx+x]&0xFF; //Current element + } if((pmap[ny+y][nx+x]&0xFF) == PT_PLNT && parts[i].life<100) //Plant gives him 5 HP { if(parts[i].life<=95) @@ -1644,6 +1676,8 @@ killed: parts[i].life -= (102-parts[i].life)/2; kill_part(pmap[ny+y][nx+x]>>8); } + if(bmap[(ny+y)/CELL][(nx+x)/CELL]==4) + player[2] = SPC_AIR; } //Head position @@ -1663,9 +1697,13 @@ killed: } else { - create_part(-1, nx, ny, player[2]); + if(player[2] == SPC_AIR) + create_parts(nx + 3*((((int)player[1])&0x02) == 0x02) - 3*((((int)player[1])&0x01) == 0x01), ny, 4, SPC_AIR); + else + create_part(-1, nx, ny, player[2]); + r = pmap[ny][nx]; - if( ((r>>8) < NPART) && (r>>8)>=0 && player[2]!=PT_PHOT) + 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) { @@ -1686,18 +1724,6 @@ killed: } } - //Jump - if (((int)(player[0])&0x04) == 0x04) - { - if (pmap[(int)(player[8]-0.5)][(int)(player[7])] || pmap[(int)(player[16]-0.5)][(int)(player[15])]) - { - parts[i].vy = -5; - player[10] += 1; - player[18] += 1; - } - - } - //Simulation of joints d = 25/(pow((player[3]-player[7]), 2) + pow((player[4]-player[8]), 2)+25) - 0.5; //Fast distance player[7] -= (player[3]-player[7])*d; @@ -1726,10 +1752,12 @@ killed: //Side collisions checking for(nx = -3; nx <= 3; nx++) { - if(pmap[(int)(player[16]-2)][(int)(player[15]+nx)]) + r = pmap[(int)(player[16]-2)][(int)(player[15]+nx)]; + if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) player[15] -= nx; - if(pmap[(int)(player[8]-2)][(int)(player[7]+nx)]) + r = pmap[(int)(player[8]-2)][(int)(player[7]+nx)]; + if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) player[7] -= nx; } @@ -1741,19 +1769,22 @@ killed: //For left leg if (r && (r&0xFF)!=PT_STKM) { - if(pstates[r&0xFF].state == ST_LIQUID || pstates[r&0xFF].state == ST_GAS || (r&0xFF)==PT_LNTG) //Liquid checks + if(pstates[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG) //Liquid checks //Liquid checks { if(parts[i].y<(player[8]-10)) - parts[i].vy = 1; + parts[i].vy = 1*dt; else parts[i].vy = 0; if(abs(parts[i].vx)>1) - parts[i].vx *= 0.5; + parts[i].vx *= 0.5*dt; } else { - player[8] += ny-1; - parts[i].vy -= 0.5*parts[i].vy; + if(pstates[r&0xFF].state != ST_GAS) + { + player[8] += ny-1; + parts[i].vy -= 0.5*parts[i].vy*dt; + } } player[9] = player[7]; } @@ -1763,19 +1794,22 @@ killed: //For right leg if (r && (r&0xFF)!=PT_STKM) { - if(pstates[r&0xFF].state == ST_LIQUID || pstates[r&0xFF].state == ST_GAS || (r&0xFF)==PT_LNTG) + if(pstates[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG) { if(parts[i].y<(player[16]-10)) - parts[i].vy = 1; + parts[i].vy = 1*dt; else parts[i].vy = 0; if(abs(parts[i].vx)>1) - parts[i].vx *= 0.5; + parts[i].vx *= 0.5*dt; } else { - player[16] += ny-1; - parts[i].vy -= 0.5*parts[i].vy; + if(pstates[r&0xFF].state != ST_GAS) + { + player[16] += ny-1; + parts[i].vy -= 0.5*parts[i].vy*dt; + } } player[17] = player[15]; } @@ -1783,8 +1817,8 @@ killed: //If it falls too fast if (parts[i].vy>=30) { - parts[i].y -= 10+ny; - parts[i].vy = -10; + parts[i].y -= (10+ny)*dt; + parts[i].vy = -10*dt; } } @@ -1792,14 +1826,14 @@ killed: //Keeping legs distance if (pow((player[7] - player[15]), 2)<16 && pow((player[8]-player[16]), 2)<1) { - player[7] += 0.2; - player[15] -= 0.2; + player[21] -= 0.2; + player[25] += 0.2; } if (pow((player[3] - player[11]), 2)<16 && pow((player[4]-player[12]), 2)<1) { - player[3] += 0.2; - player[11] -= 0.2; + player[19] -= 0.2; + player[23] += 0.2; } //If legs touch something @@ -1814,7 +1848,7 @@ killed: if(parts[r>>8].temp>=323 || parts[r>>8].temp<=243) { parts[i].life -= 2; - player[16] -= 1; + player[26] -= 1; } } @@ -1835,7 +1869,7 @@ killed: if(parts[r>>8].temp>=323 || parts[r>>8].temp<=243) { parts[i].life -= 2; - player[8] -= 1; + player[22] -= 1; } } @@ -1875,7 +1909,7 @@ killed: parts[i].type = PT_NBLE; parts[i].life = 0; } - if (t==PT_FIRE && parts[i].life <=1) + if (t==PT_FIRE && parts[i].life <=1 && parts[i].temp<673) { t = parts[i].type = PT_SMKE; parts[i].life = rand()%20+250; diff --git a/powder.h b/powder.h index 44fc20d1a..866015f13 100644 --- a/powder.h +++ b/powder.h @@ -104,11 +104,15 @@ #define PT_YEST 63 #define PT_DYST 64 #define PT_THRM 65 -#define PT_NUM 66 +#define PT_GLOW 66 +#define PT_BRCK 67 +#define PT_NUM 68 -#define R_TEMP 295 +#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 @@ -180,72 +184,74 @@ typedef struct part_state part_state; 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, 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, 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, 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, 42, "Liquid. Flammable. Solidifies under pressure"}, - {"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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 68.0f, 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, 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, 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, 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, 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, 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, 251, "Semi-conductor. Only conducts electricity when hot (More than 373K)"}, - {"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, 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, 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, 251, "Semi-conductor. Only conducts electricity when cold (Less than 373K)"}, - {"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, 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, 3500.0f, 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, 3500.0f, 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, 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, 23.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, 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, 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, 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.7f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+14.6f, 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, 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+400.0f, 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, 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, 10, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f, 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, 63.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, 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, 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, 70, "Yeast, grows when warm (~310K)."}, - {"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, 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_POWDERS, R_TEMP+0.0f, 211, "Thermite."}, + {"", 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. Solidifies under pressure"}, + {"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, -205.0f +273.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, 3500.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, 3500.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, -250.0f +273.15f, 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+400.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, 10, 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, -210.0f +273.15f, 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_POWDERS, R_TEMP+0.0f +273.15f, 211, "Thermite."}, + {"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."}, + {"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."}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description }; @@ -254,7 +260,7 @@ 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.0f, PT_NONE, 0.0f, PT_WTRV, 373.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}, @@ -262,24 +268,24 @@ static part_state pstates[PT_NUM] = /* 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, 323.0f, PT_FIRE, 573.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, 273.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}, + /* SNOW */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 0.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}, + /* WTRV */ {ST_GAS, PT_ICEI, 0.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.0f, PT_NONE, 0.0f, PT_WTRV, 373.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, 383.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}, @@ -289,7 +295,7 @@ static part_state pstates[PT_NUM] = /* 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.2f, PT_NONE, 0.0f}, + /* LNTG */ {ST_SOLID, PT_NICE, 75.0f, PT_NONE, 0.0f, PT_NONE, 78.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}, @@ -303,21 +309,23 @@ static part_state pstates[PT_NUM] = /* 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, 64.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* NICE */ {ST_SOLID, PT_NONE, 0.0f, PT_LNTG, 77.0f, 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_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_NONE, 0.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_FIRE, 873.0f}, - /* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 93.0f, PT_NONE, 0.0f}, - /* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 83.0f, PT_NONE, 0.0f, PT_NONE, 0.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, 453.0f, PT_NONE, 0.0f}, + /* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 50.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, 333.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* YEST */ {ST_SOLID, PT_NONE, 0.0f, PT_DYST, 273.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}, }; static unsigned char can_move[PT_NUM][PT_NUM] = { @@ -329,72 +337,74 @@ static unsigned char can_move[PT_NUM][PT_NUM] = /* 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 l e o O 2 N E*/ /* 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 a s a X W S*/ /* 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 s l l R T*/ -/* 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}, /* None */ -/* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0}, /* Dust */ -/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0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,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0}, /* DYST */ +/* THRM */ {0,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,1,1,0,1,0}, /* THRM */ +/* GLOW */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,0,0,0,0,0}, +/* BRCK */ {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}, /* N D W O F M L G N C G P D I W 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 P D C L O I Y*/ /* o u a i i e a u i l a l f c i 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 l e o O 2 N E*/ /* n s t l r t v n t n s e r e r 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 a s a X W S*/ @@ -402,7 +412,7 @@ static unsigned char can_move[PT_NUM][PT_NUM] = }; extern int isplayer; -extern float player[20]; +extern float player[27]; extern particle *parts; extern particle *cb_parts; From a54f5cb7a7f1d977e9675a42529b7e85c6295969 Mon Sep 17 00:00:00 2001 From: Phil Date: Tue, 7 Sep 2010 00:00:26 -0400 Subject: [PATCH 04/79] Fixed some temperature errors in the table, fixed some relative weights, and fixed the names on the sides. Renamed PT_PLEX to PT_C4 to make more sense, fixed ice/snow melting problem. made temp sign say N/A instead of 0 when there is nothing. --- graphics.c | 4 +-- powder.c | 8 ++--- powder.h | 102 ++++++++++++++++++++++++++--------------------------- 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/graphics.c b/graphics.c index f576f905f..34800d238 100644 --- a/graphics.c +++ b/graphics.c @@ -1899,9 +1899,9 @@ void render_signs(pixel *vid_buf) if(strcmp(signs[i].text, "{t}")==0) { if((pmap[signs[i].y][signs[i].x]>>8)>0 && (pmap[signs[i].y][signs[i].x]>>8)>8].temp); //...tempirature + sprintf(buff, "Temp: %4.2f", parts[pmap[signs[i].y][signs[i].x]>>8].temp-273.15f); //...tempirature else - sprintf(buff, "Temp: 0.00"); //...tempirature + sprintf(buff, "Temp: N/A"); //...tempirature drawtext(vid_buf, x+3, y+3, buff, 255, 255, 255, 255); } diff --git a/powder.c b/powder.c index bfe432921..15848e871 100644 --- a/powder.c +++ b/powder.c @@ -456,7 +456,7 @@ void update_particles_i(pixel *vid, int start, int inc) { int i, j, x, y, t, nx, ny, r, a, s, rt, fe, nt, lpv, nearp, pavg; float mv, dx, dy, ix, iy, lx, ly, d, pp; - float pt = R_TEMP; + float pt = R_TEMP + 273.15f; float c_heat = 0.0f; int h_count = 0; int starti = (start*-1); @@ -766,7 +766,7 @@ void update_particles_i(pixel *vid, int start, int inc) t = parts[i].type = pstates[t].solid; } } - else if((pt>=pstates[t].ltemp&&(pt<=pstates[t].gtemp||!pstates[t].gas)&&pstates[t].state==ST_SOLID&&pstates[t].liquid)||(t==PT_ICEI&&pt>pstates[parts[i].ctype].stemp)) + else if((pt>=pstates[t].ltemp&&(pt<=pstates[t].gtemp||!pstates[t].gas)&&pstates[t].state==ST_SOLID&&pstates[t].liquid)||(t==PT_ICEI&&pt(rand()%100)) parts[r>>8].type = PT_DSTW; - if((r&0xFF)==PT_PLEX && 15>(rand()%1000)) + if((r&0xFF)==PT_C4&& 15>(rand()%1000)) parts[r>>8].type = PT_GOO; if((r&0xFF)==PT_NITR && 15>(rand()%1000)) parts[r>>8].type = PT_DESL; diff --git a/powder.h b/powder.h index 866015f13..8c157f752 100644 --- a/powder.h +++ b/powder.h @@ -49,7 +49,7 @@ #define PT_NITR 8 #define PT_CLNE 9 #define PT_GAS 10 -#define PT_PLEX 11 +#define PT_C4 11 #define PT_GOO 12 #define PT_ICEI 13 #define PT_METL 14 @@ -197,10 +197,10 @@ static const part_type ptypes[PT_NUM] = {"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."}, + {"ICE", PIXPACK(0xA0C0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 1, 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."}, + {"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."}, @@ -222,10 +222,10 @@ static const part_type ptypes[PT_NUM] = {"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, -205.0f +273.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."}, + {"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"}, + {"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."}, @@ -274,18 +274,18 @@ static part_state pstates[PT_NUM] = /* 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, 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, 0.0f, PT_DSTW, 371.0f, PT_NONE, 373.0f, PT_NONE, 0.0f}, + /* WTRV */ {ST_GAS, PT_NONE, 0.0f, PT_DSTW, 371.0f, PT_NONE, 0.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}, + /* SLTW */ {ST_LIQUID, PT_ICEI, 233.0f, PT_NONE, 0.0f, PT_WTRV, 383.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}, @@ -295,7 +295,7 @@ static part_state pstates[PT_NUM] = /* 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, 75.0f, PT_NONE, 0.0f, PT_NONE, 78.0f, PT_NONE, 0.0f}, + /* LNTG */ {ST_SOLID, PT_NICE, 63.0f, PT_NONE, 0.0f, PT_NONE, 78.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}, @@ -309,7 +309,7 @@ static part_state pstates[PT_NUM] = /* 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, 77.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* NICE */ {ST_SOLID, PT_NONE, 0.0f, PT_LNTG, 64.0f, 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}, @@ -318,10 +318,10 @@ static part_state pstates[PT_NUM] = /* SMKE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.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, 453.0f, PT_NONE, 0.0f}, - /* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 50.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, 273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* YEST */ {ST_SOLID, PT_NONE, 0.0f, PT_DYST, 353.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}, @@ -333,58 +333,58 @@ static unsigned char can_move[PT_NUM][PT_NUM] = /* 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 P D C L O I Y */ -/* 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 l e o O 2 N E*/ -/* 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 a s a X W S*/ -/* 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 s l l R T*/ +/* N D W O F M L G N C G C G I W 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*/ +/* o u a i i e a u i l a 4 o c i 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*/ +/* n s t l r t v n t n s o e r 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 2 W S S R O C*/ +/* e t r l e l a p r e s i e 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*/ /* 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}, /* None */ /* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0}, /* Dust */ -/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0}, /* Watr */ -/* OILL */ {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,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,1,0,0,0,0,0,0,0,0}, /* Oill */ +/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0}, /* Watr */ +/* OILL */ {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,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}, /* Oill */ /* FIRE */ {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0}, /* YEST */ -/* DYST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0}, /* DYST */ -/* THRM */ {0,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,1,1,0,1,0}, /* THRM */ -/* GLOW */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,0,0,0,0,0}, -/* BRCK */ {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}, -/* N D W O F M L G N C G P D I W 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 P D C L O I Y*/ -/* o u a i i e a u i l a l f c i 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 l e o O 2 N E*/ -/* n s t l r t v n t n s e r e r 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 a s a X W S*/ -/* e t r l e l a p r e s x m i e 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 s l l R T*/ +/* YEST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,1,0}, /* YEST */ +/* DYST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,1,0}, /* DYST */ +/* THRM */ {0,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,1,1,0,1,0}, /* THRM */ +/* GLOW */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0}, /* GLOW*/ +/* BRCK */ {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}, /* BRCK */ +/* N D W O F M L G N C G C G I W 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*/ +/* o u a i i e a u i l a 4 o c i 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*/ +/* n s t l r t v n t n s o e r 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 2 W S S R O C*/ +/* e t r l e l a p r e s i e 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*/ }; extern int isplayer; From d7bb4932e675f31381f36bcc1dd933f875ac9496 Mon Sep 17 00:00:00 2001 From: Phil Date: Tue, 7 Sep 2010 10:03:32 -0400 Subject: [PATCH 05/79] OMFG fireworks, i think they are cool, right now it only shoots hot colored dust, but it can easily be something else, probably will make a special powder for it to explode later. --- graphics.c | 17 +++++++ powder.c | 59 +++++++++++++++++++++- powder.h | 144 ++++++++++++++++++++++++++++------------------------- 3 files changed, 150 insertions(+), 70 deletions(-) diff --git a/graphics.c b/graphics.c index 34800d238..758dd8e8e 100644 --- a/graphics.c +++ b/graphics.c @@ -1402,6 +1402,23 @@ void draw_parts(pixel *vid) x = nx; y = ny; blendpixel(vid,x,y,17,217,24,255); + } + else if(t==PT_DUST && parts[i].life >= 1) + { + x = nx; + y = ny; + if(parts[i].life>=50&&parts[i].life<=250) + blendpixel(vid,x,y,255,5,20,255); + if(parts[i].life>=251&&parts[i].life<=450) + blendpixel(vid,x,y,12,245,2,255); + if(parts[i].life>=451&&parts[i].life<=650) + blendpixel(vid,x,y,1,5,255,255); + if(parts[i].life>=651&&parts[i].life<=850) + blendpixel(vid,x,y,0,139,139,255); + if(parts[i].life>=851&&parts[i].life<=1050) + blendpixel(vid,x,y,238,154,0,255); + if(parts[i].life>=1051&&parts[i].life<=1250) + blendpixel(vid,x,y,24,154,236,255); } else if(t==PT_LNTG&&cmode == 6) { diff --git a/powder.c b/powder.c index 15848e871..e395a7555 100644 --- a/powder.c +++ b/powder.c @@ -1903,7 +1903,64 @@ player[23] = 1; if(parts[i].temp>303&&parts[i].temp<317){ create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_YEST); } - } + } + if(t==PT_FWRK) + { + if(parts[i].temp>400&&10>rand()%10000&&parts[i].life==0&&!pmap[y-1][x]) + { + + create_part(-1, x , y-1 , PT_FWRK); + r = pmap[y-1][x]; + parts[r>>8].vy = rand()%5-10; + parts[r>>8].vx = rand()%5-rand()%5; + parts[r>>8].life=rand()%30+50; + parts[i].type=PT_NONE; + } + if(parts[i].life>1) + { + if(parts[i].life>5) + { + parts[i].vy += rand()%3-rand()%5; + parts[i].vx += rand()%3-rand()%3; + } + parts[i].life--; + } + if(parts[i].life==1||(parts[i].vy>6&&parts[i].life>1)) + { + int q = (rand()%6+1)*200+50; + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx=rand()%8) + { + + create_part(-1, x+nx, y+ny , PT_DUST); + a= pmap[y+ny][x+nx]; + parts[a>>8].vy = rand()%(ny*16+4)-rand()%9; + parts[a>>8].vx = rand()%(nx*16+4)-rand()%9; + parts[a>>8].life= q; + parts[a>>8].temp= rand()%20+600; + parts[i].type=PT_NONE; + } + } + + } + } + if(t==PT_DUST&&!parts[i].life==0) + { + if(parts[i].life>=0) + { + parts[i].life--; + if(parts[i].life<=50||(parts[i].life>248&&parts[i].life<252)||(parts[i].life>448&&parts[i].life<452)||(parts[i].life>648&&parts[i].life<652)|| + (parts[i].life>848&&parts[i].life<852)||(parts[i].life>1048&&parts[i].life<1052)||parts[i].life==rand()%50+50||parts[i].life==rand()%50+10|| + parts[i].life==rand()%50+250||parts[i].life==rand()%50+350||parts[i].life==rand()%50+450||parts[i].life==rand()%50+550||parts[i].life==rand()%50+50||parts[i].life==rand()%50+10|| + parts[i].life==rand()%50+250||parts[i].life==rand()%50+350||parts[i].life==rand()%50+450||parts[i].life==rand()%50+550) + parts[i].type=PT_NONE; + } + + } if(t==PT_PLSM&&parts[i].ctype == PT_NBLE&&parts[i].life <=1) { parts[i].type = PT_NBLE; diff --git a/powder.h b/powder.h index 8c157f752..5bc041fe6 100644 --- a/powder.h +++ b/powder.h @@ -106,7 +106,8 @@ #define PT_THRM 65 #define PT_GLOW 66 #define PT_BRCK 67 -#define PT_NUM 68 +#define PT_FWRK 68 +#define PT_NUM 69 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -252,6 +253,8 @@ static const part_type ptypes[PT_NUM] = {"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_POWDERS, R_TEMP+0.0f +273.15f, 211, "Thermite."}, {"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."}, {"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."}, + {"FWRK", 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_POWDERS, R_TEMP+0.0f+273.15f, 100, "Fireworks!! in progress"}, + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description }; @@ -326,6 +329,8 @@ static part_state pstates[PT_NUM] = /* 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}, + /* FWRK */ {ST_SOLID, 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] = { @@ -337,74 +342,75 @@ static unsigned char can_move[PT_NUM][PT_NUM] = /* o u a i i e a u i l a 4 o c i 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*/ /* n s t l r t v n t n s o e r 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 2 W S S R O C*/ /* e t r l e l a p r e s i e 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*/ -/* 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}, /* None */ -/* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0}, /* Dust */ -/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0}, /* Watr */ -/* OILL */ {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,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}, /* Oill */ -/* FIRE */ {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* Fire */ -/* STNE */ {0,1,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1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0,0,0,0,0,0,0,0,0,0,0}, /* INWR */ +/* YEST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,1,0,0}, /* YEST */ +/* DYST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,0,1,0,0}, /* DYST */ +/* THRM */ {0,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,1,1,0,1,0,0}, /* THRM */ +/* GLOW */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0}, /* GLOW*/ +/* BRCK */ {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,0}, /* BRCK */ +/* FRWK */ {0,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,1,1,0,1,0,0}, /* THRM */ /* N D W O F M L G N C G C G I W 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*/ /* o u a i i e a u i l a 4 o c i 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*/ /* n s t l r t v n t n s o e r 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 2 W S S R O C*/ From eb7206aa304ac46ee08d4d2466b48ffe217f7bcb Mon Sep 17 00:00:00 2001 From: Phil Date: Tue, 7 Sep 2010 20:32:51 -0400 Subject: [PATCH 06/79] Fireworks look much better, and random colors for each firework yay! --- graphics.c | 13 +------------ powder.c | 40 +++++++++++++++++++--------------------- powder.h | 2 +- 3 files changed, 21 insertions(+), 34 deletions(-) diff --git a/graphics.c b/graphics.c index 758dd8e8e..c8eb964f4 100644 --- a/graphics.c +++ b/graphics.c @@ -1407,18 +1407,7 @@ void draw_parts(pixel *vid) { x = nx; y = ny; - if(parts[i].life>=50&&parts[i].life<=250) - blendpixel(vid,x,y,255,5,20,255); - if(parts[i].life>=251&&parts[i].life<=450) - blendpixel(vid,x,y,12,245,2,255); - if(parts[i].life>=451&&parts[i].life<=650) - blendpixel(vid,x,y,1,5,255,255); - if(parts[i].life>=651&&parts[i].life<=850) - blendpixel(vid,x,y,0,139,139,255); - if(parts[i].life>=851&&parts[i].life<=1050) - blendpixel(vid,x,y,238,154,0,255); - if(parts[i].life>=1051&&parts[i].life<=1250) - blendpixel(vid,x,y,24,154,236,255); + blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255); } else if(t==PT_LNTG&&cmode == 6) { diff --git a/powder.c b/powder.c index e395a7555..7e25ce009 100644 --- a/powder.c +++ b/powder.c @@ -1911,41 +1911,42 @@ player[23] = 1; create_part(-1, x , y-1 , PT_FWRK); r = pmap[y-1][x]; - parts[r>>8].vy = rand()%5-10; - parts[r>>8].vx = rand()%5-rand()%5; + parts[r>>8].vy = rand()%10-25; + parts[r>>8].vx = rand()%30-rand()%30; parts[r>>8].life=rand()%30+50; parts[i].type=PT_NONE; } if(parts[i].life>1) { - if(parts[i].life>5) - { - parts[i].vy += rand()%3-rand()%5; - parts[i].vx += rand()%3-rand()%3; - } parts[i].life--; + if(parts[i].life>=90&&parts[i].type==PT_FWRK) + parts[i].life=0; } - if(parts[i].life==1||(parts[i].vy>6&&parts[i].life>1)) + if((parts[i].life<3&&parts[i].life>0)||parts[i].vy>6&&parts[i].life>0) { - int q = (rand()%6+1)*200+50; + int q = (rand()%255+1); + int w = (rand()%255+1); + int e = (rand()%255+1); for(nx=-1; nx<2; nx++) - for(ny=-1; ny<2; ny++) + for(ny=-2; ny<3; ny++) if(x+nx>=0 && y+ny>0 && - x+nx=rand()%8) { - create_part(-1, x+nx, y+ny , PT_DUST); a= pmap[y+ny][x+nx]; - parts[a>>8].vy = rand()%(ny*16+4)-rand()%9; - parts[a>>8].vx = rand()%(nx*16+4)-rand()%9; - parts[a>>8].life= q; + parts[a>>8].vy = -(rand()%8+1); + parts[a>>8].vx = rand()%8-rand()%8+(parts[i].vx)*2; + parts[a>>8].life= rand()%75+175; + parts[a>>8].tmp=q; + parts[a>>8].flags=w; + parts[a>>8].ctype=e; parts[a>>8].temp= rand()%20+600; - parts[i].type=PT_NONE; } + } - + parts[i].type=PT_NONE; } } if(t==PT_DUST&&!parts[i].life==0) @@ -1953,10 +1954,7 @@ player[23] = 1; if(parts[i].life>=0) { parts[i].life--; - if(parts[i].life<=50||(parts[i].life>248&&parts[i].life<252)||(parts[i].life>448&&parts[i].life<452)||(parts[i].life>648&&parts[i].life<652)|| - (parts[i].life>848&&parts[i].life<852)||(parts[i].life>1048&&parts[i].life<1052)||parts[i].life==rand()%50+50||parts[i].life==rand()%50+10|| - parts[i].life==rand()%50+250||parts[i].life==rand()%50+350||parts[i].life==rand()%50+450||parts[i].life==rand()%50+550||parts[i].life==rand()%50+50||parts[i].life==rand()%50+10|| - parts[i].life==rand()%50+250||parts[i].life==rand()%50+350||parts[i].life==rand()%50+450||parts[i].life==rand()%50+550) + if(parts[i].life<1) parts[i].type=PT_NONE; } diff --git a/powder.h b/powder.h index 5bc041fe6..dab31e0bc 100644 --- a/powder.h +++ b/powder.h @@ -253,7 +253,7 @@ static const part_type ptypes[PT_NUM] = {"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_POWDERS, R_TEMP+0.0f +273.15f, 211, "Thermite."}, {"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."}, {"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."}, - {"FWRK", 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_POWDERS, R_TEMP+0.0f+273.15f, 100, "Fireworks!! in progress"}, + {"FWRK", PIXPACK(0x666666), 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_POWDERS, R_TEMP+0.0f+273.15f, 100, "Fireworks!! in progress"}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description }; From d28edfa6a9932b479efa36cdb9448354081c09ab Mon Sep 17 00:00:00 2001 From: Phil Date: Wed, 8 Sep 2010 00:39:22 -0400 Subject: [PATCH 07/79] Fireworks glow in fancy display, fixed some crash errors they could cause. --- graphics.c | 42 +++++++++++++++++++++++++++++++++++++++++- powder.c | 21 ++++++++++++--------- powder.h | 2 +- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/graphics.c b/graphics.c index c8eb964f4..1e5fd5d68 100644 --- a/graphics.c +++ b/graphics.c @@ -1403,11 +1403,51 @@ void draw_parts(pixel *vid) y = ny; blendpixel(vid,x,y,17,217,24,255); } + else if((t==PT_FWRK && parts[i].life >= 1)&&(cmode == 3||cmode==4 || cmode==6)) + { + x = nx; + y = ny; + vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors; + cg = 10; + cb = 10; + cr = 10; + x = nx/CELL; + y = ny/CELL; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else if(t==PT_DUST && parts[i].life >= 1) { x = nx; y = ny; - blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255); + if(cmode == 3||cmode==4 || cmode==6) + { + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(parts[i].tmp,parts[i].ctype,parts[i].flags); + cg = parts[i].tmp/5; + cb = parts[i].ctype/5; + cr = parts[i].flags/5; + x = nx/CELL; + y = ny/CELL; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else + blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255); } else if(t==PT_LNTG&&cmode == 6) { diff --git a/powder.c b/powder.c index 7e25ce009..e7bc8f82e 100644 --- a/powder.c +++ b/powder.c @@ -1911,8 +1911,8 @@ player[23] = 1; create_part(-1, x , y-1 , PT_FWRK); r = pmap[y-1][x]; - parts[r>>8].vy = rand()%10-25; - parts[r>>8].vx = rand()%30-rand()%30; + parts[r>>8].vy = rand()%8-22; + parts[r>>8].vx = rand()%20-rand()%20; parts[r>>8].life=rand()%30+50; parts[i].type=PT_NONE; } @@ -1936,13 +1936,16 @@ player[23] = 1; { create_part(-1, x+nx, y+ny , PT_DUST); a= pmap[y+ny][x+nx]; - parts[a>>8].vy = -(rand()%8+1); - parts[a>>8].vx = rand()%8-rand()%8+(parts[i].vx)*2; - parts[a>>8].life= rand()%75+175; - parts[a>>8].tmp=q; - parts[a>>8].flags=w; - parts[a>>8].ctype=e; - parts[a>>8].temp= rand()%20+600; + if(parts[a>>8].type==PT_DUST) + { + parts[a>>8].vy = -(rand()%10-1); + parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; + parts[a>>8].life= rand()%75+35; + parts[a>>8].tmp=q; + parts[a>>8].flags=w; + parts[a>>8].ctype=e; + parts[a>>8].temp= rand()%20+600; + } } } diff --git a/powder.h b/powder.h index dab31e0bc..27d72ca13 100644 --- a/powder.h +++ b/powder.h @@ -253,7 +253,7 @@ static const part_type ptypes[PT_NUM] = {"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_POWDERS, R_TEMP+0.0f +273.15f, 211, "Thermite."}, {"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."}, {"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."}, - {"FWRK", PIXPACK(0x666666), 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_POWDERS, R_TEMP+0.0f+273.15f, 100, "Fireworks!! in progress"}, + {"FWRK", PIXPACK(0x666666), 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_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "Fireworks!! Glows in fancy"}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description }; From 8e3383909b0301c14eee2b7f3473c4df095d77e0 Mon Sep 17 00:00:00 2001 From: Phil Date: Wed, 8 Sep 2010 19:43:06 -0400 Subject: [PATCH 08/79] Added specific element erase, right click on element in menu, then right click on eraser, the one to be erased will have a light blue box around it. works for walls too. changed some wall code because it looks like someone just put random numbers in. fixed a wall bug --- air.c | 24 +++---- defines.h | 2 + interface.c | 22 +++++- interface.h | 2 +- main.c | 16 ++--- powder.c | 203 +++++++++++++++++++++++++++++++--------------------- 6 files changed, 165 insertions(+), 104 deletions(-) diff --git a/air.c b/air.c index 55108d683..9415bbf06 100644 --- a/air.c +++ b/air.c @@ -54,15 +54,15 @@ void update_air(void) 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])) + if(bmap[y][x]==11 || bmap[y][x+1]==11 || + bmap[y][x]==2 || bmap[y][x+1]==2 || + (bmap[y][x]==3 && !emap[y][x]) || + (bmap[y][x+1]==3 && !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])) + if(bmap[y][x]==11 || bmap[y+1][x]==11 || + bmap[y][x]==2 || bmap[y+1][x]==2 || + (bmap[y][x]==3 && !emap[y][x]) || + (bmap[y+1][x]==3 && !emap[y+1][x])) vy[y][x] = 0; } @@ -76,9 +76,9 @@ void update_air(void) for(i=-1; i<2; i++) if(y+j>0 && y+j0 && x+i=sdl_scale*zoom_wx && y>=sdl_scale*zoom_wy && x=0 && ly>=0 && lx=0 && ly>=0 && lx=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=4) + if(c!=127 || lx<0 || ly<0 || lx>=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=7) create_line(lx, ly, x, y, bs, c); } else diff --git a/powder.c b/powder.c index e7bc8f82e..cb19a5d23 100644 --- a/powder.c +++ b/powder.c @@ -59,30 +59,30 @@ int try_move(int i, int x, int y, int nx, int ny) return 1; } - if(bmap[ny/CELL][nx/CELL]==12 && !emap[y/CELL][x/CELL]) + if(bmap[ny/CELL][nx/CELL]==15 && !emap[y/CELL][x/CELL]) { return 1; } - if(bmap[ny/CELL][nx/CELL]==13 && ptypes[parts[i].type].falldown!=0 && parts[i].type!=PT_FIRE) + if(bmap[ny/CELL][nx/CELL]==20 && ptypes[parts[i].type].falldown!=0 && parts[i].type!=PT_FIRE) { return 0; } - if((bmap[y/CELL][x/CELL]==12 && !emap[y/CELL][x/CELL]) && (bmap[ny/CELL][nx/CELL]!=12 && !emap[ny/CELL][nx/CELL])) + if((bmap[y/CELL][x/CELL]==15 && !emap[y/CELL][x/CELL]) && (bmap[ny/CELL][nx/CELL]!=15 && !emap[ny/CELL][nx/CELL])) { return 0; } - if(ptypes[parts[i].type].falldown!=2 && bmap[ny/CELL][nx/CELL]==3) + if(ptypes[parts[i].type].falldown!=2 && bmap[ny/CELL][nx/CELL]==8) return 0; - if((parts[i].type==PT_NEUT ||parts[i].type==PT_PHOT) && bmap[ny/CELL][nx/CELL]==7 && !emap[ny/CELL][nx/CELL]) + if((parts[i].type==PT_NEUT ||parts[i].type==PT_PHOT) && bmap[ny/CELL][nx/CELL]==3 && !emap[ny/CELL][nx/CELL]) return 0; - if(r && (r>>8)>8)= PT_NUM || !can_move[parts[i].type][(r&0xFF)])) @@ -326,15 +326,20 @@ inline void delete_part(int x, int y) #endif { unsigned i; - if(x<0 || y<0 || x>=XRES || y>=YRES) return; i = pmap[y][x]; if(!i || (i>>8)>=NPART) return; - - kill_part(i>>8); - pmap[y][x] = 0; // just in case + if((parts[i>>8].type==PSR)||PSR==0||PSR==130) + { + kill_part(i>>8); + pmap[y][x] = 0; + } + else + { + return; + } } #ifdef WIN32 @@ -343,7 +348,7 @@ _inline int is_wire(int x, int y) inline int is_wire(int x, int y) #endif { - return bmap[y][x]==6 || bmap[y][x]==7 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==11 || bmap[y][x]==12; + return bmap[y][x]==4 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==2 || bmap[y][x]==14 || bmap[y][x]==15; } #ifdef WIN32 @@ -352,7 +357,7 @@ _inline int is_wire_off(int x, int y) inline int is_wire_off(int x, int y) #endif { - return (bmap[y][x]==6 || bmap[y][x]==7 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==11 || bmap[y][x]==12) && emap[y][x]<8; + return (bmap[y][x]==4 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==2 || bmap[y][x]==14 || bmap[y][x]==15) && emap[y][x]<8; } void set_emap(int x, int y) @@ -508,14 +513,14 @@ void update_particles_i(pixel *vid, int start, int inc) if(x<0 || y<0 || x>=XRES || y>=YRES || - ((bmap[y/CELL][x/CELL]==1 || - bmap[y/CELL][x/CELL]==8 || - bmap[y/CELL][x/CELL]==9 || - (bmap[y/CELL][x/CELL]==2) || - (bmap[y/CELL][x/CELL]==3 && ptypes[t].falldown!=2) || - (bmap[y/CELL][x/CELL]==10 && ptypes[t].falldown!=1) || - (bmap[y/CELL][x/CELL]==6 && (t==PT_METL || t==PT_SPRK)) || - (bmap[y/CELL][x/CELL]==7 && !emap[y/CELL][x/CELL])) && (t!=PT_STKM))) + ((bmap[y/CELL][x/CELL]==11 || + bmap[y/CELL][x/CELL]==2 || + bmap[y/CELL][x/CELL]==12 || + (bmap[y/CELL][x/CELL]==9) || + (bmap[y/CELL][x/CELL]==8 && ptypes[t].falldown!=2) || + (bmap[y/CELL][x/CELL]==13 && ptypes[t].falldown!=1) || + (bmap[y/CELL][x/CELL]==4 && (t==PT_METL || t==PT_SPRK)) || + (bmap[y/CELL][x/CELL]==3 && !emap[y/CELL][x/CELL])) && (t!=PT_STKM))) { kill_part(i); continue; @@ -858,14 +863,14 @@ void update_particles_i(pixel *vid, int start, int inc) t = PT_SPRK; } } - else if(bmap[ny][nx]==6 || bmap[ny][nx]==7 || bmap[ny][nx]==3 || bmap[ny][nx]==8 || bmap[ny][nx]==11 || bmap[ny][nx]==12) + else if(bmap[ny][nx]==4 || bmap[ny][nx]==3 || bmap[ny][nx]==8 || bmap[ny][nx]==2 || bmap[ny][nx]==14 || bmap[ny][nx]==15) set_emap(nx, ny); } } nx = x/CELL; ny = y/CELL; - if(bmap[ny][nx]==6 && emap[ny][nx]<8) + if(bmap[ny][nx]==4 && emap[ny][nx]<8) set_emap(nx, ny); fe = 0; @@ -1647,9 +1652,9 @@ player[23] = 1; } //Charge detector wall if foot inside - if(bmap[(int)(player[8]+0.5)/CELL][(int)(player[7]+0.5)/CELL]==6) + if(bmap[(int)(player[8]+0.5)/CELL][(int)(player[7]+0.5)/CELL]==4) set_emap((int)player[7]/CELL, (int)player[8]/CELL); - if(bmap[(int)(player[16]+0.5)/CELL][(int)(player[15]+0.5)/CELL]==6) + if(bmap[(int)(player[16]+0.5)/CELL][(int)(player[15]+0.5)/CELL]==4) set_emap((int)(player[15]+0.5)/CELL, (int)(player[16]+0.5)/CELL); //Searching for particles near head @@ -1676,7 +1681,7 @@ player[23] = 1; parts[i].life -= (102-parts[i].life)/2; kill_part(pmap[ny+y][nx+x]>>8); } - if(bmap[(ny+y)/CELL][(nx+x)/CELL]==4) + if(bmap[(ny+y)/CELL][(nx+x)/CELL]==7) player[2] = SPC_AIR; } @@ -1935,6 +1940,7 @@ player[23] = 1; if(5>=rand()%8) { create_part(-1, x+nx, y+ny , PT_DUST); + pv[y/CELL][x/CELL] += 2.00f*CFDS; a= pmap[y+ny][x+nx]; if(parts[a>>8].type==PT_DUST) { @@ -2427,18 +2433,18 @@ void update_particles(pixel *vid) { for(x=0; x>1)&1; i>1)&1; i>1)&1; i121&&PSR<141)) + { + r = r/CELL; + x = x/CELL; + y = y/CELL; + x -= r/2; + y -= r/2; + for (ox=x; ox<=x+r; ox++) + { + for (oy=y; oy<=y+r; oy++) + { + if(ox>=0&&ox=0&&oy Date: Thu, 9 Sep 2010 11:55:20 -0400 Subject: [PATCH 09/79] Fixed wall eraser errors and loading of other saves. --- main.c | 33 +++++++++++++++++++++++++++++++++ powder.c | 53 ++++++++++++++++++++++++++++------------------------- 2 files changed, 61 insertions(+), 25 deletions(-) diff --git a/main.c b/main.c index 5bdc03a24..5da2ce0ca 100644 --- a/main.c +++ b/main.c @@ -101,6 +101,7 @@ int legacy_enable = 0; //Used to disable new features such as heat, will be set int death = 0, framerender = 0; int amd = 1; int FPSB = 0; +int cracker = 1; sign signs[MAXSIGNS]; @@ -465,7 +466,38 @@ int parse_save(void *save, int size, int replace, int x0, int y0) for(x=bx0; x400&&10>rand()%10000&&parts[i].life==0&&!pmap[y-1][x]) + if(parts[i].temp>400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x]) { create_part(-1, x , y-1 , PT_FWRK); r = pmap[y-1][x]; - parts[r>>8].vy = rand()%8-22; - parts[r>>8].vx = rand()%20-rand()%20; - parts[r>>8].life=rand()%30+50; - parts[i].type=PT_NONE; + if(parts[r>>8].type==PT_FWRK) + { + parts[r>>8].vy = rand()%8-22; + parts[r>>8].vx = rand()%20-rand()%20; + parts[r>>8].life=rand()%30+50; + parts[i].type=PT_NONE; + } } if(parts[i].life>1) { @@ -1939,6 +1942,8 @@ player[23] = 1; { if(5>=rand()%8) { + if(!pmap[y+ny][x+nx]) + { create_part(-1, x+nx, y+ny , PT_DUST); pv[y/CELL][x/CELL] += 2.00f*CFDS; a= pmap[y+ny][x+nx]; @@ -1952,6 +1957,7 @@ player[23] = 1; parts[a>>8].ctype=e; parts[a>>8].temp= rand()%20+600; } + } } } @@ -2180,7 +2186,7 @@ void update_particles(pixel *vid) { for(x=0; x>1)&1; i>1)&1; i Date: Fri, 10 Sep 2010 22:18:59 -0400 Subject: [PATCH 10/79] New temp saving system, only loads from saves it makes right now, but it allows for much more temp accuracy, less than 1 degree. --- graphics.c | 6 +++--- main.c | 52 +++++++++++++++++++++++++++++++++++++++++++------- powder.c | 56 +++++++++++++++++++++++++++--------------------------- 3 files changed, 76 insertions(+), 38 deletions(-) diff --git a/graphics.c b/graphics.c index 1e5fd5d68..0a83db58c 100644 --- a/graphics.c +++ b/graphics.c @@ -1431,9 +1431,9 @@ void draw_parts(pixel *vid) if(cmode == 3||cmode==4 || cmode==6) { vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(parts[i].tmp,parts[i].ctype,parts[i].flags); - cg = parts[i].tmp/5; - cb = parts[i].ctype/5; - cr = parts[i].flags/5; + cg = parts[i].tmp/4; + cb = parts[i].ctype/4; + cr = parts[i].flags/4; x = nx/CELL; y = ny/CELL; cg += fire_g[y][x]; diff --git a/main.c b/main.c index 5da2ce0ca..b9d188fbd 100644 --- a/main.c +++ b/main.c @@ -311,10 +311,30 @@ void *build_save(int *size, int x0, int y0, int w, int h) i = m[j]; if(i) { - unsigned char tttemp = (unsigned char)((parts[i-1].temp+(-MIN_TEMP))/((MAX_TEMP+(-MIN_TEMP))/255)); + if(cracker) + { + int z; + int temp1 = 0; + int temp = parts[i-1].temp; + int temp2 = temp; + for(z = 15;z>=8;z--) + { + if(temp>0&&temp>=powf(2,z)) + { + temp1 += powf(2,z-8); + temp -= powf(2,z); + } + } + d[p++] = (char)temp1; + d[p++] = (char)temp2; + } + else + { + unsigned char tttemp = (unsigned char)((parts[i-1].temp+(-MIN_TEMP))/((MAX_TEMP+(-MIN_TEMP))/255)); + d[p++] = tttemp; + } //if(tttemp<0) tttemp=0; //if(tttemp>255) tttemp=255; - d[p++] = tttemp; } } for(j=0; j> 16; c[11] = p >> 24; + i -= 12; if(BZ2_bzBuffToBuffCompress((char *)(c+12), (unsigned *)&i, (char *)d, p, 9, 0, 0) != BZ_OK) @@ -468,7 +489,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) if(d[p]) { bmap[y][x] = d[p]; - if(cracker) + if(!cracker) { if(bmap[y][x]==1) bmap[y][x]=11; @@ -620,16 +641,33 @@ int parse_save(void *save, int size, int replace, int x0, int y0) goto corrupt; } if(i <= NPART) - { - if(ver>=42){ + { + if(cracker) + { + int z; + int q = 0; + int temp1 = d[p++]; + int temp2 = d[p++]; + for(z = 7;z>=0;z--) + { + if(temp1>0&&temp1>=powf(2,z)) + { + q += powf(2,z+8); + temp1 -= powf(2,z); + } + } + + parts[i-1].temp = temp2 + q + 0.15; + } + else if(ver>=42){ parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP; } else { - parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273; + parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273.15; } } else { - p++; + p += 2; } } else diff --git a/powder.c b/powder.c index d6e808b42..08f67c681 100644 --- a/powder.c +++ b/powder.c @@ -1936,32 +1936,32 @@ player[23] = 1; int w = (rand()%255+1); int e = (rand()%255+1); for(nx=-1; nx<2; nx++) - for(ny=-2; ny<3; ny++) - if(x+nx>=0 && y+ny>0 && - x+nx=rand()%8) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx=rand()%8) { - create_part(-1, x+nx, y+ny , PT_DUST); - pv[y/CELL][x/CELL] += 2.00f*CFDS; - a= pmap[y+ny][x+nx]; - if(parts[a>>8].type==PT_DUST) - { - parts[a>>8].vy = -(rand()%10-1); - parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; - parts[a>>8].life= rand()%75+35; - parts[a>>8].tmp=q; - parts[a>>8].flags=w; - parts[a>>8].ctype=e; - parts[a>>8].temp= rand()%20+600; - } + if(!pmap[y+ny][x+nx]) + { + create_part(-1, x+nx, y+ny , PT_DUST); + pv[y/CELL][x/CELL] += 2.00f*CFDS; + a= pmap[y+ny][x+nx]; + if(parts[a>>8].type==PT_DUST) + { + parts[a>>8].vy = -(rand()%10-1); + parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; + parts[a>>8].life= rand()%75+35; + parts[a>>8].tmp=q; + parts[a>>8].flags=w; + parts[a>>8].ctype=e; + parts[a>>8].temp= rand()%20+600; + } + } } + } - - } - parts[i].type=PT_NONE; + parts[i].type=PT_NONE; } } if(t==PT_DUST&&!parts[i].life==0) @@ -2450,12 +2450,12 @@ void update_particles(pixel *vid) for(j=0; j>1)&1; i Date: Sat, 11 Sep 2010 18:15:07 -0400 Subject: [PATCH 11/79] Added element type eraser, right click on the menu section to delete and then on the eraser button. the type to erase will have a light blue box also added two wires, PWPO and PWNE purely for no reason, pressure sensitive wires, just ignore them unless you like it. --- defines.h | 1 + graphics.c | 6 +- interface.c | 36 +++++++++-- main.c | 2 +- powder.c | 43 ++++++++++++-- powder.h | 168 +++++++++++++++++++++++++++------------------------- 6 files changed, 163 insertions(+), 93 deletions(-) diff --git a/defines.h b/defines.h index 9b49007e7..558217ab3 100644 --- a/defines.h +++ b/defines.h @@ -67,6 +67,7 @@ typedef unsigned char uint8; extern int amd; unsigned int PSR; +unsigned int SEC; extern int FPSB; diff --git a/graphics.c b/graphics.c index 0a83db58c..44af5fff5 100644 --- a/graphics.c +++ b/graphics.c @@ -744,7 +744,11 @@ 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) { - drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); + if(i==SEC&&SEC!=0) + drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 0, 255, 255, 255); + else + drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); + if(hover==i) { fillrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); diff --git a/interface.c b/interface.c index 5162928b0..c3d2e051e 100644 --- a/interface.c +++ b/interface.c @@ -1402,7 +1402,7 @@ 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 *psr,int b, int bq, int mx, int my) { - int h,x,y,n=0,height,width,sy,rows=0; + int h,x,y,n=0,height,width,sy,rows=0,sec=-1; mx /= sdl_scale; my /= sdl_scale; rows = ceil((float)msections[i].itemcount/16.0f); @@ -1537,7 +1537,11 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, } } } - + if(!bq&&mx>=sdl_scale*(XRES-2) && mx= sdl_scale*((i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16)) && my=0&&i=0) + { + SEC = sec; + PSR = -1; + *psr = -1; + } } int sdl_poll(void) diff --git a/main.c b/main.c index b9d188fbd..15eed7c5d 100644 --- a/main.c +++ b/main.c @@ -1029,7 +1029,7 @@ int main(int argc, char *argv[]) #ifdef INTERNAL int vs = 0; #endif - int x, y, b = 0, sl=1, sr=0,su=0,psr=0, c, lb = 0, lx = 0, ly = 0, lm = 0;//, tx, ty; + int x, y, b = 0, sl=1, sr=0,su=0,psr=-1, c, lb = 0, lx = 0, ly = 0, lm = 0;//, tx, ty; int da = 0, db = 0, it = 2047, mx, my, bs = 2; float nfvx, nfvy; int load_mode=0, load_w=0, load_h=0, load_x=0, load_y=0, load_size=0; diff --git a/powder.c b/powder.c index 08f67c681..9495c16a6 100644 --- a/powder.c +++ b/powder.c @@ -192,7 +192,9 @@ inline int create_part(int p, int x, int y, int t) (pmap[y][x]&0xFF)!=PT_ETRD && (pmap[y][x]&0xFF)!=PT_BRMT && (pmap[y][x]&0xFF)!=PT_NBLE && - (pmap[y][x]&0xFF)!=PT_INWR) + (pmap[y][x]&0xFF)!=PT_INWR && + (pmap[y][x]&0xFF)!=PT_PWPO && + (pmap[y][x]&0xFF)!=PT_PWNE) return -1; parts[pmap[y][x]>>8].type = PT_SPRK; parts[pmap[y][x]>>8].life = 4; @@ -336,6 +338,11 @@ inline void delete_part(int x, int y) kill_part(i>>8); pmap[y][x] = 0; } + if(ptypes[parts[i>>8].type].menusection==SEC) + { + kill_part(i>>8); + pmap[y][x] = 0; + } else { return; @@ -481,7 +488,7 @@ void update_particles_i(pixel *vid, int start, int inc) { if(!(parts[i].life==10&&parts[i].type==PT_LCRY)) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_PWPO && t!=PT_PWNE) { kill_part(i); continue; @@ -835,7 +842,7 @@ void update_particles_i(pixel *vid, int start, int inc) pt = parts[i].temp -= 2.5f; } - if(t==PT_WATR || t==PT_ETRD || t==PT_SLTW || t==PT_METL || t==PT_RBDM || t==PT_LRBD || t==PT_BRMT || t==PT_PSCN || t==PT_NSCN || t==PT_NTCT || t==PT_PTCT || t==PT_BMTL || t==PT_SPRK|| t == PT_NBLE || t==PT_INWR) + if(t==PT_WATR || t==PT_ETRD || t==PT_SLTW || t==PT_METL || t==PT_RBDM || t==PT_LRBD || t==PT_BRMT || t==PT_PSCN || t==PT_NSCN || t==PT_NTCT || t==PT_PTCT || t==PT_BMTL || t==PT_SPRK|| t == PT_NBLE || t==PT_INWR || t==PT_PWPO || t==PT_PWNE) { nx = x % CELL; if(nx == 0) @@ -853,7 +860,7 @@ void update_particles_i(pixel *vid, int start, int inc) ny = y/CELL; if(nx>=0 && ny>=0 && nx>8)>=NPART || !r) continue; - if(((r&0xFF)==PT_METL || (r&0xFF)==PT_ETRD || (r&0xFF)==PT_PSCN || (r&0xFF)==PT_NSCN || (r&0xFF)==PT_NTCT || (r&0xFF)==PT_PTCT || (r&0xFF)==PT_BMTL || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD || (r&0xFF)==PT_BRMT||(r&0xFF)==PT_NBLE) || (r&0xFF)==PT_INWR && parts[r>>8].ctype!=PT_SPRK ) + if(((r&0xFF)==PT_METL || (r&0xFF)==PT_ETRD || (r&0xFF)==PT_PSCN || (r&0xFF)==PT_NSCN || (r&0xFF)==PT_NTCT || (r&0xFF)==PT_PTCT || (r&0xFF)==PT_BMTL || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD || (r&0xFF)==PT_BRMT||(r&0xFF)==PT_NBLE||(r&0xFF)==PT_PWPO||(r&0xFF)==PT_PWNE)|| (r&0xFF)==PT_INWR && parts[r>>8].ctype!=PT_SPRK ) { t = parts[i].type = PT_NONE; parts[r>>8].ctype = parts[r>>8].type; @@ -1194,6 +1201,10 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_GAS; if((r&0xFF)==PT_COAL && 5>(rand()%100)) parts[r>>8].type = PT_WOOD; + if((r&0xFF)==PT_DUST && 5>(rand()%100)) + parts[r>>8].type = PT_FWRK; + if((r&0xFF)==PT_FWRK && 5>(rand()%100)) + parts[r>>8].ctype = PT_DUST; /*if(parts[r>>8].type>1 && parts[r>>8].type!=PT_NEUT && parts[r>>8].type-1!=PT_NEUT && parts[r>>8].type-1!=PT_STKM && (ptypes[parts[r>>8].type-1].menusection==SC_LIQUID|| ptypes[parts[r>>8].type-1].menusection==SC_EXPLOSIVE|| @@ -1448,6 +1459,26 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].life = 4; parts[r>>8].ctype = rt; } + } + if(t==PT_SPRK && rt==PT_PWPO && parts[r>>8].life==0 && + (parts[i].life<3 || ((r>>8)1.0f) + { + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 4; + parts[r>>8].ctype = rt; + } + } + if(t==PT_SPRK && rt==PT_PWNE && parts[r>>8].life==0 && + (parts[i].life<3 || ((r>>8)>8].type = PT_SPRK; + parts[r>>8].life = 4; + parts[r>>8].ctype = rt; + } } if(t==PT_SPRK && rt==PT_WATR && parts[r>>8].life==0 && (parts[i].life<2 || ((r>>8)400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x]) + if((parts[i].temp>400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x])||parts[i].ctype==PT_DUST) { create_part(-1, x , y-1 , PT_FWRK); diff --git a/powder.h b/powder.h index 27d72ca13..63ac2b79a 100644 --- a/powder.h +++ b/powder.h @@ -107,7 +107,9 @@ #define PT_GLOW 66 #define PT_BRCK 67 #define PT_FWRK 68 -#define PT_NUM 69 +#define PT_PWPO 69 +#define PT_PWNE 70 +#define PT_NUM 71 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -254,8 +256,9 @@ static const part_type ptypes[PT_NUM] = {"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."}, {"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."}, {"FWRK", PIXPACK(0x666666), 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_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "Fireworks!! Glows in fancy"}, - - //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description + {"PWPO", PIXPACK(0x555080), 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, "Pressure sensitive wire, turns on when high pressure"}, + {"PWNE", PIXPACK(0x585080), 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, "Pressure sensitive wire, turns on when low pressure"}, + //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] = @@ -330,7 +333,8 @@ static part_state pstates[PT_NUM] = /* 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}, /* FWRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - + /* PWPO */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PWNE */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static unsigned char can_move[PT_NUM][PT_NUM] = { @@ -338,83 +342,85 @@ static unsigned char can_move[PT_NUM][PT_NUM] = /* A 0 1 | B ligher than A */ /* B 1 0 | A heavier than B */ -/* N D W O F M L G N C G C G I W 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*/ -/* o u a i i e a u i l a 4 o c i 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*/ -/* n s t l r t v n t n s o e r 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 2 W S S R O C*/ -/* e t r l e l a p r e s i e 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*/ -/* 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,0}, /* None */ -/* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0}, /* Dust */ -/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,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,1,0,1,1,0,1,0,0,1,1,0,1,0,0}, /* THRM */ -/* N D W O F M L G N C G C G I W 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*/ -/* o u a i i e a u i l a 4 o c i 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*/ -/* n s t l r t v n t n s o e r 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 2 W S S R O C*/ -/* e t r l e l a p r e s i e 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*/ +/* N D W O F M L G N C G C G I W 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 F P P*/ +/* o u a i i e a u i l a 4 o c i 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 W W W*/ +/* n s t l r t v n t n s o e r 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 2 W S S R O C R P N*/ +/* e t r l e l a p r e s i e 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 K O E*/ +/* 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,0,0,0}, /* None */ +/* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0}, /* Dust */ +/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,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0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0}, /* GLOW*/ +/* BRCK */ {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,0,0,0}, /* BRCK */ +/* FRWK */ {0,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,1,1,0,1,0,0,0,0}, /* THRM */ +/* PWPO */ {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,0,0,0}, /* PWPO*/ +/* PWNE */ {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,0,0,0}, /* PWNE*/ +/* N D W O F M L G N C G C G I W 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 F P P*/ +/* o u a i i e a u i l a 4 o c i 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 W W W*/ +/* n s t l r t v n t n s o e r 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 2 W S S R O C R P N*/ +/* e t r l e l a p r e s i e 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 K O E*/ }; extern int isplayer; From f94986a3bacc60bc3b571209130611437fe9dabc Mon Sep 17 00:00:00 2001 From: Phil Date: Sat, 11 Sep 2010 20:17:52 -0400 Subject: [PATCH 12/79] updated to simon's latest --- defines.h | 2 +- graphics.c | 59 +++++++++++++++++- interface.c | 115 +++++++++++++++++++++++++++++----- interface.h | 1 + main.c | 175 ++++++++++++++++++++++++++++++---------------------- powder.c | 11 +++- powder.h | 14 ++--- 7 files changed, 273 insertions(+), 104 deletions(-) diff --git a/defines.h b/defines.h index 558217ab3..d6642c122 100644 --- a/defines.h +++ b/defines.h @@ -8,7 +8,7 @@ #endif #define SAVE_VERSION 42 -#define MINOR_VERSION 0 +#define MINOR_VERSION 1 #define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter. #define BETA diff --git a/graphics.c b/graphics.c index 44af5fff5..f52f5042e 100644 --- a/graphics.c +++ b/graphics.c @@ -971,6 +971,15 @@ inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a) #endif { #ifdef OpenGL + if(x<0 || y<0 || x>=XRES || r>=YRES) + return; + if(a!=255) + { + glBegin (GL_QUADS); + glColor4ub(r,g,b,a); + glVertex2i(x, y); + } + vid[y*(XRES+BARSIZE)+x] = PIXRGB(r,g,b); #else pixel t; if(x<0 || y<0 || x>=XRES || y>=YRES) @@ -1171,6 +1180,48 @@ void draw_parts(pixel *vid) float pt = R_TEMP; for(i = 0; iSAVE_VERSION) return NULL; - + if(c[2]==0x43 && c[1]==0x75 && c[0]==0x66){ + new_format = 1; + } bw = c[6]; bh = c[7]; w = bw*CELL; diff --git a/interface.c b/interface.c index c3d2e051e..6bb0c563d 100644 --- a/interface.c +++ b/interface.c @@ -35,6 +35,7 @@ void *svf_last = NULL; int svf_lsize; char *search_ids[GRID_X*GRID_Y]; +char *search_dates[GRID_X*GRID_Y]; int search_votes[GRID_X*GRID_Y]; int search_publish[GRID_X*GRID_Y]; int search_scoredown[GRID_X*GRID_Y]; @@ -1609,11 +1610,11 @@ int sdl_poll(void) sdl_zoom_trig = 1; Z_keysym = event.key.keysym.sym; } - if( event.key.keysym.sym == SDLK_PLUS || event.key.keysym.sym == SDLK_RIGHTBRACKET) + if( event.key.keysym.sym == SDLK_PLUS) { sdl_wheel++; } - if( event.key.keysym.sym == SDLK_MINUS || event.key.keysym.sym == SDLK_LEFTBRACKET) + if( event.key.keysym.sym == SDLK_MINUS) { sdl_wheel--; } @@ -1834,6 +1835,7 @@ int search_ui(pixel *vid_buf) memset(img_id, 0, sizeof(img_id)); memset(search_ids, 0, sizeof(search_ids)); + memset(search_dates, 0, sizeof(search_dates)); memset(search_names, 0, sizeof(search_names)); memset(search_scoreup, 0, sizeof(search_scoreup)); memset(search_scoredown, 0, sizeof(search_scoredown)); @@ -2008,7 +2010,7 @@ int search_ui(pixel *vid_buf) } else pos = gi+GRID_X*gj; - if(!search_ids[pos]) + if(!search_dates[pos]) break; gx = ((XRES/GRID_X)*gi) + (XRES/GRID_X-XRES/GRID_S)/2; gy = ((((YRES-(MENUSIZE-20))+15)/GRID_Y)*gj) + ((YRES-(MENUSIZE-20))/GRID_Y-(YRES-(MENUSIZE-20))/GRID_S+10)/2 + 18; @@ -2048,6 +2050,9 @@ int search_ui(pixel *vid_buf) dp = pos; } } + drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, YRES/GRID_S+3, 128, 128, 128, 255); + fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, 1+(YRES/GRID_S+3)/2, 0, 107, 10, 255); + fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2), 6, 1+(YRES/GRID_S+3)/2, 107, 10, 0, 255); if(mp==pos && !st) drawrect(vid_buf, gx-2, gy-2, XRES/GRID_S+3, YRES/GRID_S+3, 160, 160, 192, 255); else @@ -2106,11 +2111,10 @@ int search_ui(pixel *vid_buf) nyd = search_scoredown[pos]/ry; } - fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 0, 187, 40, 255); - fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)+1, 4, nyd, 187, 40, 0, 255); - - drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 0, 107, 10, 255); - drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)+1, 4, nyd, 107, 10, 0, 255); + fillrect(vid_buf, gx-1+(XRES/GRID_S)+5, gy-1+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 57, 187, 57, 255); + fillrect(vid_buf, gx-1+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2), 4, nyd, 187, 57, 57, 255); + //drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 0, 107, 10, 255); + // drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)+1, 4, nyd, 107, 10, 0, 255); } } @@ -2202,9 +2206,17 @@ int search_ui(pixel *vid_buf) fillrect(vid_buf, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 255); info_box(vid_buf, "Loading..."); - uri = malloc(strlen(search_ids[mp])*3+strlen(SERVER)+64); - strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); - strcaturl(uri, search_ids[mp]); + if(search_dates[mp]){ + uri = malloc(strlen(search_ids[mp])*3+strlen(search_dates[mp])*3+strlen(SERVER)+71); + strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); + strcaturl(uri, search_ids[mp]); + strcaturl(uri, "&Date="); + strcaturl(uri, search_dates[mp]); + } else { + uri = malloc(strlen(search_ids[mp])*3+strlen(SERVER)+64); + strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); + strcaturl(uri, search_ids[mp]); + } data = http_simple_get(uri, &status, &dlen); free(uri); @@ -2481,7 +2493,7 @@ finish: int search_results(char *str, int votes) { int i,j; - char *p,*q,*r,*s,*vu,*vd,*pu; + char *p,*q,*r,*s,*vu,*vd,*pu,*sd; for(i=0; i=GRID_X*GRID_Y) + break; + if(votes) + { + sd = strchr(str+8, ' '); + if(!sd) + return i; + *(sd++) = 0; + pu = strchr(sd, ' '); + if(!pu) + return i; + *(pu++) = 0; + s = strchr(pu, ' '); + if(!s) + return i; + *(s++) = 0; + vu = strchr(s, ' '); + if(!vu) + return i; + *(vu++) = 0; + vd = strchr(vu, ' '); + if(!vd) + return i; + *(vd++) = 0; + q = strchr(vd, ' '); + } + else + { + sd = strchr(str+8, ' '); + if(!sd) + return i; + *(sd++) = 0; + pu = strchr(sd, ' '); + if(!pu) + return i; + *(pu++) = 0; + vu = strchr(pu, ' '); + if(!vu) + return i; + *(vu++) = 0; + vd = strchr(vu, ' '); + if(!vd) + return i; + *(vd++) = 0; + q = strchr(vd, ' '); + } + if(!q) + return i; + *(q++) = 0; + r = strchr(q, ' '); + if(!r) + return i; + *(r++) = 0; + search_ids[i] = mystrdup(str+8); + search_dates[i] = mystrdup(sd); + search_publish[i] = atoi(pu); + search_scoreup[i] = atoi(vu); + search_scoredown[i] = atoi(vd); + search_owners[i] = mystrdup(q); + search_names[i] = mystrdup(r); + + if(s) + search_votes[i] = atoi(s); + thumb_cache_find(str+8, search_thumbs+i, search_thsizes+i); i++; } else if(!strncmp(str, "TAG ", 4)) diff --git a/interface.h b/interface.h index 5c4e415a3..4afa7a262 100644 --- a/interface.h +++ b/interface.h @@ -101,6 +101,7 @@ 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]; diff --git a/main.c b/main.c index 15eed7c5d..6c8f0e292 100644 --- a/main.c +++ b/main.c @@ -232,7 +232,7 @@ void *build_thumb(int *size, int bzip2) void *build_save(int *size, int x0, int y0, int w, int h) { - unsigned char *d=calloc(1,3*(XRES/CELL)*(YRES/CELL)+(XRES*YRES)*7+MAXSIGNS*262), *c; + unsigned char *d=calloc(1,3*(XRES/CELL)*(YRES/CELL)+(XRES*YRES)*8+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; @@ -311,30 +311,10 @@ void *build_save(int *size, int x0, int y0, int w, int h) i = m[j]; if(i) { - if(cracker) - { - int z; - int temp1 = 0; - int temp = parts[i-1].temp; - int temp2 = temp; - for(z = 15;z>=8;z--) - { - if(temp>0&&temp>=powf(2,z)) - { - temp1 += powf(2,z-8); - temp -= powf(2,z); - } - } - d[p++] = (char)temp1; - d[p++] = (char)temp2; - } - else - { - unsigned char tttemp = (unsigned char)((parts[i-1].temp+(-MIN_TEMP))/((MAX_TEMP+(-MIN_TEMP))/255)); - d[p++] = tttemp; - } - //if(tttemp<0) tttemp=0; - //if(tttemp>255) tttemp=255; + //New Temperature saving uses a 16bit unsigned int for temperatures, giving a precision of 1 degree versus 36 for the old format + int tttemp = (int)parts[i-1].temp; + d[p++] = ((tttemp&0xFF00)>>8); + d[p++] = (tttemp&0x00FF); } } for(j=0; jSAVE_VERSION) - return 2; - ver = c[4]; + if(size<16) + return 1; + if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50)) + return 1; + if(c[2]==0x76 && c[1]==0x53 && c[0]==0x50){ + new_format = 1; + } + if(c[4]>SAVE_VERSION) + return 2; + ver = c[4]; - if(ver<34) - { + if(ver<34) + { legacy_enable = 1; } else @@ -636,40 +623,34 @@ int parse_save(void *save, int size, int replace, int x0, int y0) { if(ver>=34&&legacy_beta==0) { - if(p >= size) - { - goto corrupt; - } - if(i <= NPART) + if(p >= size) { - if(cracker) - { - int z; - int q = 0; - int temp1 = d[p++]; - int temp2 = d[p++]; - for(z = 7;z>=0;z--) - { - if(temp1>0&&temp1>=powf(2,z)) - { - q += powf(2,z+8); - temp1 -= powf(2,z); - } - } + goto corrupt; + } + if(i <= NPART) + { + if(ver>=42){ + if(new_format){ + ttv = (d[p++])<<8; + ttv |= (d[p++]); + parts[i-1].temp = ttv; + } else { - parts[i-1].temp = temp2 + q + 0.15; + parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP; + } } - else if(ver>=42){ - parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP; - } else { + else { parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273.15; } - } - else - { - p += 2; - } - } + } + else + { + p ++; + if(new_format){ + p++; + } + } + } else { parts[i-1].temp = ptypes[parts[i-1].type].heat; @@ -1301,13 +1282,57 @@ int main(int argc, char *argv[]) { set_cmode(5); } - if(sdl_key=='7') - { - set_cmode(6); - } - if(sdl_key==SDLK_SPACE) - sys_pause = !sys_pause; - if(sdl_key=='h') + if(sdl_key=='7') + { + set_cmode(6); + } + if(sdl_key==SDLK_LEFTBRACKET){ + if(sdl_zoom_trig==1) + { + ZSIZE -= 1; + if(ZSIZE>32) + ZSIZE = 32; + if(ZSIZE<2) + ZSIZE = 2; + ZFACTOR = 256/ZSIZE; + } + else + { + if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) + bs -= 1; + else + bs -= ceil((bs/5)+0.5f); + if(bs>1224) + bs = 1224; + if(bs<0) + bs = 0; + } + } + if(sdl_key==SDLK_RIGHTBRACKET){ + if(sdl_zoom_trig==1) + { + ZSIZE += 1; + if(ZSIZE>32) + ZSIZE = 32; + if(ZSIZE<2) + ZSIZE = 2; + ZFACTOR = 256/ZSIZE; + } + else + { + if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) + bs += 1; + else + bs += ceil((bs/5)+0.5f); + if(bs>1224) + bs = 1224; + if(bs<0) + bs = 0; + } + } + if(sdl_key==SDLK_SPACE) + sys_pause = !sys_pause; + if(sdl_key=='h') hud_enable = !hud_enable; if(sdl_key=='p') dump_frame(vid_buf, XRES, YRES, XRES); diff --git a/powder.c b/powder.c index 9495c16a6..e185b0eae 100644 --- a/powder.c +++ b/powder.c @@ -63,7 +63,7 @@ int try_move(int i, int x, int y, int nx, int ny) { return 1; } - if(bmap[ny/CELL][nx/CELL]==20 && ptypes[parts[i].type].falldown!=0 && parts[i].type!=PT_FIRE) + if(bmap[ny/CELL][nx/CELL]==20 && ptypes[parts[i].type].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE) { return 0; } @@ -247,6 +247,8 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = rand()%120+240; if(t==PT_NBLE) parts[i].life = 0; + if(t==PT_ICEI) + parts[i].ctype = PT_WATR; if(t==PT_NEUT) { float r = (rand()%128+128)/127.0f; @@ -526,6 +528,7 @@ void update_particles_i(pixel *vid, int start, int inc) (bmap[y/CELL][x/CELL]==9) || (bmap[y/CELL][x/CELL]==8 && ptypes[t].falldown!=2) || (bmap[y/CELL][x/CELL]==13 && ptypes[t].falldown!=1) || + (bmap[y/CELL][x/CELL]==13 && ptypes[t].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE) || (bmap[y/CELL][x/CELL]==4 && (t==PT_METL || t==PT_SPRK)) || (bmap[y/CELL][x/CELL]==3 && !emap[y/CELL][x/CELL])) && (t!=PT_STKM))) { @@ -712,6 +715,8 @@ void update_particles_i(pixel *vid, int start, int inc) int ctemp = pv[y/CELL][x/CELL]*2; c_heat = 0.0f; h_count = 0; + if(t==PT_ICEI && !parts[i].ctype) + parts[i].ctype = PT_WATR; if(ptypes[t].hconduct>(rand()%250)) { for(nx=-1; nx<2; nx++) @@ -833,11 +838,11 @@ void update_particles_i(pixel *vid, int start, int inc) pt = parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP); } } - if(t==PT_PTCT&&parts[i].temp>249.0f) + if(t==PT_PTCT&&parts[i].temp>295.0f) { pt = parts[i].temp -= 2.5f; } - if(t==PT_NTCT&&parts[i].temp>249.0f) + if(t==PT_NTCT&&parts[i].temp>295.0f) { pt = parts[i].temp -= 2.5f; } diff --git a/powder.h b/powder.h index 63ac2b79a..af3d4ffe7 100644 --- a/powder.h +++ b/powder.h @@ -224,7 +224,7 @@ static const part_type ptypes[PT_NUM] = {"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, -205.0f +273.15f, 70, "Liquid Nitrogen. Very cold."}, + {"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."}, @@ -235,10 +235,10 @@ static const part_type ptypes[PT_NUM] = {"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, 3500.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, 3500.0f +273.15f, 115, "Plasma, extremely hot."}, + {"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, 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, 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, -250.0f +273.15f, 46, "Nitrogen Ice."}, + {"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)"}, @@ -247,7 +247,7 @@ static const part_type ptypes[PT_NUM] = {"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+400.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, 10, 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, -210.0f +273.15f, 70, "Liquid Oxygen. Very cold. Reacts with fire"}, + {"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)."}, @@ -301,7 +301,7 @@ static part_state pstates[PT_NUM] = /* 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, 78.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}, @@ -315,7 +315,7 @@ static part_state pstates[PT_NUM] = /* 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, 64.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}, From ebb784de700240d0f8c2f2c5ffe3d2ab783c6557 Mon Sep 17 00:00:00 2001 From: Phil Date: Sun, 12 Sep 2010 20:34:47 -0400 Subject: [PATCH 13/79] Much better interface for eraser. Doesnt deselect current elements. alt-click on the element/type you want erased, it will be light blue. alt-click in the game will then erase the selected element only. everything else works normally and uneffected if you dont use it. --- interface.c | 79 +++++++++++++++++++++++++++++++++-------------------- powder.c | 24 +++++++++------- 2 files changed, 64 insertions(+), 39 deletions(-) diff --git a/interface.c b/interface.c index 6bb0c563d..fa6c3736b 100644 --- a/interface.c +++ b/interface.c @@ -1425,7 +1425,12 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, mwalls[n-122].colour)+5; - if(!bq && mx>=x+32 && mx=y && my< y+15) + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + h = n; + } + else if(!bq && mx>=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; @@ -1457,7 +1462,12 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, mwalls[n-122].colour)+5; - if(!bq && mx>=x+32 && mx=y && my< y+15) + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + h = n; + } + else if(!bq && mx>=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; @@ -1486,7 +1496,12 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5; - if(!bq && mx>=x+32 && mx=y && my< y+15) + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + h = n; + } + else if(!bq && mx>=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; @@ -1518,7 +1533,12 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5; - if(!bq && mx>=x+32 && mx=y && my< y+15) + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + h = n; + } + else if(!bq && mx>=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; @@ -1558,38 +1578,39 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, if(b==1&&h!=-1) { - *sl = h; - } - if(b==4&&h!=-1) - { - if(h!=0) + if(sdl_mod & (KMOD_LALT|KMOD_RALT)) { - SEC = -1; - PSR = *sr; - *psr = *sr; + PSR=h; + *psr=h; + SEC=-1; } else - { - if(*psr==-2) - { - SEC = -1; - PSR = *sr; - *psr = *sr; - } - else - { - PSR = -1; - *psr = -2; - } - } - *sr = h; + *sl = h; } - else if(b==4&&sec>=0) + else if((b==1&&sec>0)&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) { SEC = sec; - PSR = -1; - *psr = -1; + PSR=-1; + *psr=-1; } + if(b==4&&h!=-1) + { + if(sdl_mod & (KMOD_LALT|KMOD_RALT)) + { + PSR=h; + *psr=h; + SEC=-1; + } + else + *sr = h; + } + else if((b==4&&sec>0)&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) + { + SEC = sec; + PSR=-1; + *psr=-1; + } + } int sdl_poll(void) diff --git a/powder.c b/powder.c index e185b0eae..51b84099d 100644 --- a/powder.c +++ b/powder.c @@ -340,7 +340,7 @@ inline void delete_part(int x, int y) kill_part(i>>8); pmap[y][x] = 0; } - if(ptypes[parts[i>>8].type].menusection==SEC) + else if(ptypes[parts[i>>8].type].menusection==SEC) { kill_part(i>>8); pmap[y][x] = 0; @@ -1426,6 +1426,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_SPRK && (rt==PT_METL||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)=373.0f)&&parts[i].ctype==PT_NTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp<=373.0f)&&parts[i].ctype==PT_PTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN)&&parts[i].ctype==PT_INWR) && pavg != PT_INSL &&!(parts[i].ctype==PT_SWCH&&(rt==PT_PSCN||rt==PT_NSCN)) ) { parts[r>>8].type = PT_SPRK; @@ -1433,8 +1434,10 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].ctype = rt; if(parts[r>>8].temp+10.0f<673.0f&&!legacy_enable&&!(rt==PT_LRBD||rt==PT_RBDM||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR)) parts[r>>8].temp = parts[r>>8].temp+10.0f; + } } + if(t==PT_SPRK && rt==PT_NTCT && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)0||SEC>0))) + { + for(j=-r; j<=r; j++) + for(i=-r; i<=r; i++) + if(i*i+j*j<=r*r) + delete_part(x+i, y+j); + return 1; + } + if(c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM) { for(j=-r; j<=r; j++) @@ -2975,15 +2988,6 @@ int create_parts(int x, int y, int r, int c) return 1; } - if(c == 0) - { - for(j=-r; j<=r; j++) - for(i=-r; i<=r; i++) - if(i*i+j*j<=r*r) - delete_part(x+i, y+j); - return 1; - } - for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) if(i*i+j*j<=r*r) From e4f9f77de906d65264c7d09635761dd05940e1aa Mon Sep 17 00:00:00 2001 From: Philip Date: Mon, 4 Oct 2010 00:27:40 -0400 Subject: [PATCH 14/79] Updating --- Makefile | 12 +- hmap.h | 24 - air.h => includes/air.h | 0 defines.h => includes/defines.h | 7 +- font.h => includes/font.h | 4 +- graphics.h => includes/graphics.h | 0 includes/hmap.h | 34 + http.h => includes/http.h | 0 icon.h => includes/icon.h | 0 interface.h => includes/interface.h | 2 +- md5.h => includes/md5.h | 0 misc.h => includes/misc.h | 4 +- powder.h => includes/powder.h | 269 ++-- update.h => includes/update.h | 0 version.h => includes/version.h | 0 script.sh | 11 + {Resources => src/Resources}/Font-Data | Bin {Resources => src/Resources}/Font-Pointers | Bin {Resources => src/Resources}/Icon-16.png | Bin {Resources => src/Resources}/Icon-32.png | Bin {Resources => src/Resources}/powder-res.rc | 0 {Resources => src/Resources}/powder.icns | Bin {Resources => src/Resources}/powder.ico | Bin air.c => src/air.c | 32 +- graphics.c => src/graphics.c | 522 ++++--- http.c => src/http.c | 6 +- interface.c => src/interface.c | 353 +++-- main.c => src/main.c | 331 ++--- md5.c => src/md5.c | 2 +- misc.c => src/misc.c | 14 + powder.c => src/powder.c | 1523 +++++++++++++------- update.c => src/update.c | 2 +- 32 files changed, 1920 insertions(+), 1232 deletions(-) delete mode 100755 hmap.h rename air.h => includes/air.h (100%) rename defines.h => includes/defines.h (95%) rename font.h => includes/font.h (99%) rename graphics.h => includes/graphics.h (100%) create mode 100755 includes/hmap.h rename http.h => includes/http.h (100%) rename icon.h => includes/icon.h (100%) rename interface.h => includes/interface.h (98%) rename md5.h => includes/md5.h (100%) rename misc.h => includes/misc.h (93%) rename powder.h => includes/powder.h (58%) rename update.h => includes/update.h (100%) rename version.h => includes/version.h (100%) create mode 100755 script.sh rename {Resources => src/Resources}/Font-Data (100%) rename {Resources => src/Resources}/Font-Pointers (100%) rename {Resources => src/Resources}/Icon-16.png (100%) rename {Resources => src/Resources}/Icon-32.png (100%) rename {Resources => src/Resources}/powder-res.rc (100%) rename {Resources => src/Resources}/powder.icns (100%) rename {Resources => src/Resources}/powder.ico (100%) rename air.c => src/air.c (84%) rename graphics.c => src/graphics.c (85%) rename http.c => src/http.c (99%) rename interface.c => src/interface.c (92%) rename main.c => src/main.c (92%) mode change 100644 => 100755 rename md5.c => src/md5.c (99%) rename misc.c => src/misc.c (96%) rename powder.c => src/powder.c (72%) rename update.c => src/update.c (99%) diff --git a/Makefile b/Makefile index 72e2617b7..8a25f401d 100755 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ -SOURCES := *.c +SOURCES := src/*.c -CFLAGS := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L +CFLAGS := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -Iincludes/ OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations LFLAGS := -lSDL -lm -lbz2 -MFLAGS_SSE3 := -march=k8 -DX86 -DX86_SSE3 -msse3 -MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2 -msse2 -MFLAGS_SSE := -march=pentium3 -DX86 -DX86_SSE +MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3 +MFLAGS_SSE2 := -march=native-DX86 -DX86_SSE2 -msse2 +MFLAGS_SSE := -march=native -DX86 -DX86_SSE FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2 COMPILER := gcc LINUX_TARG := powder-64-sse2 powder-sse powder-sse2 @@ -19,6 +19,7 @@ powder-debug: $(SOURCES) powder-sse3: $(SOURCES) $(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32 strip $@ + mv $@ build powder-sse2: $(SOURCES) $(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN32 strip $@ @@ -31,6 +32,7 @@ powder-64-sse3-opengl: $(SOURCES) powder-64-sse3: $(SOURCES) $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 strip $@ + mv $@ build powder-64-sse2: $(SOURCES) $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN64 strip $@ diff --git a/hmap.h b/hmap.h deleted file mode 100755 index 8af6e7168..000000000 --- a/hmap.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Powder Toy - Heatmap Data - * - * 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 - */ -#ifndef HMAP_H -#define HMAP_H -static char color_data[] = {0xD9,0xFF,0xFE,0xD4,0xFB,0xFC,0xCF,0xF6,0xF9,0xC9,0xF1,0xF6,0xC2,0xEB,0xF4,0xBB,0xE5,0xF0,0xB3,0xDE,0xED,0xAA,0xD6,0xE9,0xA1,0xCF,0xE5,0x98,0xC7,0xE2,0x8E,0xBF,0xDD,0x85,0xB6,0xD9,0x7B,0xAD,0xD5,0x71,0xA5,0xD0,0x67,0x9C,0xCC,0x5D,0x93,0xC7,0x53,0x8A,0xC3,0x4A,0x82,0xBE,0x41,0x79,0xB9,0x38,0x71,0xB5,0x30,0x69,0xB0,0x28,0x61,0xAC,0x21,0x5A,0xA8,0x1B,0x53,0xA3,0x16,0x4D,0x9F,0x12,0x47,0x9B,0x0F,0x42,0x98,0x0F,0x3D,0x94,0x0F,0x39,0x90,0x0F,0x34,0x8C,0x0F,0x30,0x89,0x0F,0x2C,0x85,0x0F,0x28,0x81,0x0F,0x24,0x7D,0x0F,0x20,0x7A,0x0F,0x1D,0x76,0x0F,0x1A,0x72,0x0F,0x16,0x6F,0x0F,0x13,0x6B,0x0F,0x11,0x67,0x10,0x0E,0x64,0x12,0x0C,0x60,0x15,0x0A,0x5D,0x18,0x08,0x59,0x1B,0x06,0x56,0x1D,0x04,0x53,0x20,0x03,0x4F,0x23,0x02,0x4C,0x26,0x01,0x49,0x29,0x01,0x46,0x2C,0x00,0x43,0x2F,0x00,0x40,0x30,0x00,0x3F,0x31,0x00,0x3F,0x31,0x00,0x3E,0x32,0x00,0x3E,0x32,0x00,0x3D,0x33,0x00,0x3D,0x33,0x00,0x3C,0x34,0x00,0x3C,0x34,0x00,0x3B,0x35,0x01,0x3B,0x36,0x01,0x3B,0x36,0x01,0x3A,0x37,0x01,0x3A,0x37,0x01,0x39,0x38,0x01,0x39,0x39,0x01,0x38,0x39,0x02,0x38,0x3A,0x02,0x37,0x3B,0x02,0x37,0x3B,0x02,0x36,0x3C,0x02,0x36,0x3C,0x03,0x35,0x3D,0x03,0x35,0x3E,0x03,0x34,0x3F,0x03,0x34,0x3F,0x04,0x34,0x40,0x04,0x33,0x41,0x04,0x33,0x41,0x04,0x32,0x42,0x05,0x32,0x43,0x05,0x31,0x43,0x05,0x31,0x44,0x06,0x30,0x45,0x06,0x30,0x46,0x06,0x30,0x46,0x07,0x2F,0x47,0x07,0x2F,0x48,0x08,0x2E,0x49,0x08,0x2E,0x49,0x08,0x2E,0x4A,0x09,0x2D,0x4B,0x09,0x2D,0x4C,0x09,0x2C,0x4C,0x0A,0x2C,0x4D,0x0A,0x2B,0x4E,0x0B,0x2B,0x4F,0x0B,0x2B,0x4F,0x0C,0x2A,0x50,0x0C,0x2A,0x51,0x0D,0x29,0x52,0x0D,0x29,0x53,0x0D,0x29,0x53,0x0E,0x28,0x54,0x0E,0x28,0x55,0x0F,0x27,0x56,0x0F,0x27,0x57,0x10,0x27,0x58,0x10,0x26,0x58,0x11,0x26,0x59,0x11,0x26,0x5A,0x12,0x25,0x5B,0x13,0x25,0x5C,0x13,0x24,0x5D,0x14,0x24,0x5D,0x14,0x24,0x5E,0x15,0x23,0x5F,0x15,0x23,0x60,0x16,0x23,0x61,0x16,0x22,0x62,0x17,0x22,0x62,0x18,0x22,0x63,0x18,0x21,0x64,0x19,0x21,0x65,0x19,0x21,0x66,0x1A,0x20,0x67,0x1B,0x20,0x67,0x1B,0x20,0x68,0x1C,0x1F,0x69,0x1C,0x1F,0x6A,0x1D,0x1F,0x6B,0x1E,0x1E,0x6C,0x1E,0x1E,0x6D,0x1F,0x1E,0x6D,0x1F,0x1D,0x6E,0x20,0x1D,0x6F,0x21,0x1D,0x70,0x21,0x1C,0x71,0x22,0x1C,0x72,0x23,0x1C,0x73,0x23,0x1B,0x73,0x24,0x1B,0x74,0x25,0x1B,0x75,0x25,0x1A,0x76,0x26,0x1A,0x77,0x27,0x1A,0x78,0x27,0x1A,0x78,0x28,0x19,0x79,0x29,0x19,0x7A,0x29,0x19,0x7B,0x2A,0x18,0x7C,0x2B,0x18,0x7D,0x2B,0x18,0x7E,0x2C,0x18,0x7E,0x2D,0x17,0x7F,0x2D,0x17,0x80,0x2E,0x17,0x81,0x2F,0x16,0x82,0x2F,0x16,0x82,0x30,0x16,0x83,0x31,0x16,0x84,0x31,0x15,0x85,0x32,0x15,0x86,0x33,0x15,0x87,0x33,0x15,0x87,0x34,0x14,0x88,0x35,0x14,0x89,0x36,0x14,0x8A,0x36,0x14,0x8A,0x37,0x13,0x8B,0x38,0x13,0x8C,0x38,0x13,0x8D,0x39,0x13,0x8E,0x3A,0x13,0x8E,0x3A,0x12,0x8F,0x3B,0x12,0x90,0x3C,0x12,0x91,0x3C,0x12,0x91,0x3D,0x11,0x92,0x3E,0x11,0x93,0x3E,0x11,0x94,0x3F,0x11,0x94,0x40,0x11,0x95,0x40,0x10,0x96,0x41,0x10,0x97,0x42,0x10,0x97,0x42,0x10,0x98,0x43,0x10,0x99,0x44,0x0F,0x99,0x44,0x0F,0x9A,0x45,0x0F,0x9A,0x45,0x0F,0x9B,0x46,0x0F,0x9C,0x47,0x0F,0x9C,0x47,0x0E,0x9D,0x48,0x0E,0x9D,0x48,0x0E,0x9E,0x49,0x0E,0x9E,0x49,0x0E,0x9F,0x4A,0x0D,0xA0,0x4B,0x0D,0xA0,0x4B,0x0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,0xDE,0xFE,0xF7,0xE0,0xFE,0xF7,0xE1,0xFE,0xF8,0xE3,0xFE,0xF8,0xE4,0xFE,0xF8,0xE5,0xFE,0xF9,0xE7,0xFE,0xF9,0xE8,0xFE,0xF9,0xE9,0xFE,0xFA,0xEB,0xFE,0xFA,0xEC,0xFE,0xFA,0xED,0xFE,0xFB,0xEF,0xFE,0xFB,0xF0,0xFE,0xFB,0xF1,0xFE,0xFC,0xF2,0xFF,0xFC,0xF3,0xFF,0xFC,0xF5,0xFF,0xFC,0xF6,0xFF,0xFD,0xF7,0xFF,0xFD,0xF8,0xFF,0xFD,0xF9,0xFF,0xFE,0xFA,0xFF,0xFE,0xFB,0xFF,0xFE,0xFC,0xFF,0xFE,0xFC,0xFF,0xFF,0xFD,0xFF,0xFF,0xFE}; -static char plasma_data[] = {0x00,0x00,0x00,0x03,0x00,0x00,0x05,0x00,0x00,0x09,0x00,0x00,0x0E,0x00,0x00,0x12,0x00,0x00,0x17,0x00,0x00,0x1C,0x00,0x00,0x22,0x00,0x00,0x27,0x00,0x00,0x2C,0x00,0x00,0x32,0x00,0x00,0x37,0x00,0x00,0x3C,0x00,0x00,0x41,0x00,0x00,0x45,0x00,0x00,0x4A,0x00,0x00,0x4D,0x00,0x00,0x51,0x00,0x00,0x53,0x00,0x00,0x55,0x00,0x00,0x55,0x00,0x02,0x55,0x02,0x03,0x55,0x03,0x06,0x55,0x03,0x07,0x55,0x05,0x09,0x55,0x06,0x0C,0x55,0x06,0x0F,0x55,0x07,0x10,0x55,0x09,0x13,0x55,0x0A,0x16,0x55,0x0C,0x1A,0x55,0x0C,0x1D,0x54,0x0E,0x20,0x53,0x10,0x23,0x54,0x11,0x26,0x53,0x13,0x2A,0x52,0x14,0x2E,0x51,0x15,0x31,0x50,0x17,0x35,0x50,0x19,0x38,0x4E,0x1A,0x3D,0x4D,0x1C,0x40,0x4D,0x1D,0x44,0x4C,0x1F,0x47,0x4B,0x21,0x4C,0x4A,0x23,0x4F,0x49,0x24,0x54,0x48,0x25,0x57,0x47,0x28,0x5B,0x46,0x29,0x5F,0x45,0x2B,0x62,0x44,0x2D,0x66,0x44,0x2E,0x6A,0x43,0x30,0x6E,0x42,0x32,0x72,0x41,0x33,0x76,0x40,0x35,0x79,0x3F,0x38,0x7C,0x3F,0x39,0x7F,0x3E,0x3B,0x83,0x3D,0x3D,0x86,0x3C,0x3F,0x8A,0x3B,0x40,0x8C,0x3B,0x43,0x8F,0x3B,0x44,0x92,0x3A,0x46,0x95,0x39,0x48,0x98,0x39,0x4A,0x9B,0x39,0x4C,0x9C,0x39,0x4E,0x9F,0x3A,0x4F,0xA1,0x39,0x51,0xA3,0x39,0x52,0xA4,0x39,0x54,0xA6,0x39,0x56,0xA7,0x39,0x57,0xA8,0x39,0x58,0xA8,0x3A,0x5A,0xA9,0x3A,0x5C,0xA8,0x3A,0x5D,0xA8,0x3B,0x5F,0xA8,0x3C,0x61,0xA8,0x3D,0x62,0xA8,0x3D,0x64,0xA9,0x3E,0x66,0xA8,0x3E,0x67,0xA9,0x3F,0x68,0xA8,0x40,0x6A,0xA8,0x41,0x6C,0xA8,0x42,0x6E,0xA8,0x42,0x70,0xA8,0x43,0x71,0xA8,0x44,0x73,0xA8,0x45,0x74,0xA9,0x46,0x76,0xA8,0x48,0x79,0xA8,0x49,0x7A,0xA7,0x4A,0x7C,0xA6,0x4A,0x7D,0xA5,0x4C,0x7F,0xA4,0x4D,0x81,0xA3,0x4E,0x83,0xA2,0x4E,0x85,0xA1,0x50,0x86,0xA0,0x51,0x88,0x9F,0x52,0x8A,0x9D,0x53,0x8B,0x9D,0x55,0x8D,0x9B,0x56,0x8F,0x9A,0x57,0x91,0x98,0x58,0x92,0x98,0x5A,0x94,0x97,0x5B,0x96,0x95,0x5C,0x97,0x94,0x5E,0x99,0x93,0x5F,0x9A,0x91,0x60,0x9C,0x90,0x61,0x9D,0x90,0x62,0x9F,0x8E,0x64,0xA1,0x8D,0x65,0xA2,0x8C,0x67,0xA3,0x8B,0x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0xC4,0xC1,0xC2,0xC4,0xC2,0xC2,0xC4,0xC3,0xC4,0xC4,0xC3,0xC4,0xC4,0xC4}; -#endif \ No newline at end of file diff --git a/air.h b/includes/air.h similarity index 100% rename from air.h rename to includes/air.h diff --git a/defines.h b/includes/defines.h similarity index 95% rename from defines.h rename to includes/defines.h index d6642c122..a324e9f54 100644 --- a/defines.h +++ b/includes/defines.h @@ -7,8 +7,8 @@ #define PATH_SEP "/" #endif -#define SAVE_VERSION 42 -#define MINOR_VERSION 1 +#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 @@ -66,9 +66,6 @@ typedef unsigned char uint8; extern int amd; -unsigned int PSR; -unsigned int SEC; - extern int FPSB; extern int legacy_enable; diff --git a/font.h b/includes/font.h similarity index 99% rename from font.h rename to includes/font.h index f8f9a58c5..38448d146 100644 --- a/font.h +++ b/includes/font.h @@ -21,6 +21,7 @@ #ifndef FONT_H_CHECK #define FONT_H_CHECK #define FONT_H 10 +#ifdef INCLUDE_FONTDATA static char font_data[] = { 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc7, 0x31, 0x0c, 0x02, 0x70, 0x04, 0x00, 0x00, 0x05, 0xcc, 0x74, 0x23, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x80, 0x19, 0xcc, 0xe0, 0x3f, 0xcc, 0xf0, 0x2f, 0xcc, 0x90, 0x09, 0x00, 0x00, 0x00, 0x06, 0x30, 0xd0, 0x3f, 0x33, 0xe1, 0x07, 0xf4, 0x12, 0x33, 0xff, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x2d, 0xce, 0xcc, 0xe1, 0x1d, 0xc0, 0x03, 0x74, 0x4b, 0x33, 0xb3, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x7d, 0x30, 0x0c, 0x13, 0xd0, 0x32, 0xb3, 0x33, 0x1c, 0x7d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, 0x4c, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x34, 0x1d, 0x07, 0x03, 0x07, 0x1d, 0x34, 0x00, 0x00, 0x00, 0x04, 0x07, 0x1d, 0x34, 0x30, 0x34, 0x1d, 0x07, 0x00, 0x00, 0x00, 0x06, 0x44, 0xd0, 0x1c, 0x64, 0xf0, 0x3f, 0x64, 0xd0, 0x1c, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x02, 0x30, 0xe0, 0x2f, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0d, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x40, 0x70, 0x00, 0x00, 0x00, 0x06, 0x80, 0x02, 0x0c, 0xa0, 0x00, 0x03, 0x28, 0xc0, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf8, 0xe0, 0x39, 0x07, 0x33, 0x32, 0x03, 0xb3, 0x38, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x30, 0xf0, 0x60, 0x03, 0x0c, 0x30, 0xc0, 0x40, 0x07, 0x00, 0x00, 0x00, 0x00, 0x06, 0xfc, 0xb1, 0x34, 0x41, 0x03, 0x0a, 0x2c, 0x70, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x06, 0xfc, 0x71, 0x34, 0x01, 0x03, 0x1e, 0x00, 0x33, 0x34, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0xc0, 0x03, 0x37, 0x1c, 0x73, 0x34, 0xbf, 0x03, 0x30, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0x33, 0x00, 0x57, 0xe0, 0x2f, 0x00, 0x13, 0x30, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf4, 0xd3, 0x00, 0x07, 0xf0, 0x1f, 0x03, 0x33, 0x34, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0x07, 0x34, 0x80, 0x03, 0x0e, 0x38, 0xd0, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xfc, 0xb1, 0x34, 0x03, 0xd3, 0x1f, 0x03, 0x73, 0x34, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0xfc, 0xb1, 0x34, 0x03, 0xc3, 0x3f, 0x40, 0x23, 0x30, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x70, 0x04, 0x40, 0x70, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1c, 0x04, 0x00, 0x0c, 0x0d, 0x03, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc0, 0xc3, 0x0b, 0x1b, 0xc0, 0x0b, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0f, 0x80, 0x0f, 0x90, 0x83, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xfd, 0x71, 0x30, 0x81, 0x03, 0x0e, 0x34, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf8, 0x0f, 0x1d, 0x30, 0xe7, 0x37, 0x73, 0x1c, 0xe3, 0x2f, 0x07, 0x00, 0xfd, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, 0xd0, 0x1d, 0x47, 0x33, 0x30, 0xff, 0x33, 0x30, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x06, 0xbf, 0x30, 0x38, 0x43, 0xf3, 0x1f, 0x43, 0x33, 0x34, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf4, 0xd1, 0x34, 0x03, 0x31, 0x00, 0x03, 0x70, 0x34, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x7f, 0x30, 0x1d, 0x43, 0x33, 0x30, 0x03, 0x33, 0x34, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0x32, 0x00, 0x03, 0xf0, 0x0b, 0x03, 0x30, 0x10, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0x33, 0x10, 0x03, 0xf0, 0x0b, 0x03, 0x30, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf4, 0xd1, 0x34, 0x03, 0x30, 0x3e, 0x03, 0x73, 0x34, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x47, 0x33, 0x30, 0x03, 0xf3, 0x3f, 0x03, 0x33, 0x30, 0x47, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04, 0x1d, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x1d, 0x00, 0x00, 0x00, 0x06, 0xd0, 0x01, 0x0c, 0xc0, 0x00, 0x0c, 0xc0, 0x10, 0x0d, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x47, 0xc3, 0x34, 0x70, 0x03, 0xbc, 0x00, 0xb3, 0xc0, 0xb0, 0x70, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x07, 0x30, 0x00, 0x03, 0x30, 0x00, 0x03, 0x30, 0x10, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x03, 0x30, 0x1f, 0x3d, 0x7b, 0x3b, 0xe3, 0x32, 0x83, 0x30, 0x03, 0x30, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0xcd, 0x03, 0x73, 0xc3, 0x8c, 0x32, 0xc3, 0xcd, 0xc0, 0x33, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf4, 0x41, 0xc7, 0x71, 0xd0, 0x0c, 0x30, 0x03, 0xcd, 0xd1, 0xd1, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x7f, 0x30, 0x1d, 0x43, 0x73, 0x34, 0xff, 0x31, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf4, 0x41, 0xd3, 0x71, 0xd0, 0x0c, 0x30, 0xc3, 0xcd, 0xd1, 0xd1, 0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0x31, 0x34, 0x03, 0xf3, 0x0f, 0xd7, 0x30, 0x34, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x06, 0xfc, 0xb1, 0x31, 0x07, 0xd0, 0x0f, 0x90, 0x23, 0x34, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0x13, 0x13, 0x30, 0x00, 0x03, 0x30, 0x00, 0x03, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x03, 0xcc, 0x00, 0x33, 0xc0, 0x0c, 0x30, 0x03, 0xcd, 0xd2, 0xd1, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x03, 0x33, 0x30, 0x03, 0xb3, 0x38, 0xcd, 0xc1, 0x0d, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x03, 0x30, 0x43, 0x30, 0xc7, 0x34, 0xcd, 0x1c, 0xed, 0x1e, 0x2c, 0x0e, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x03, 0x4c, 0xc3, 0x81, 0x3b, 0xd0, 0x03, 0xdc, 0x42, 0xc3, 0x31, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x03, 0xb3, 0x38, 0xdc, 0x40, 0x07, 0x30, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0x0f, 0xd0, 0x02, 0x2c, 0xc0, 0x02, 0x2d, 0xc0, 0x06, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x2f, 0x03, 0x03, 0x03, 0x03, 0x03, 0x2f, 0x00, 0x00, 0x00, 0x05, 0x03, 0x28, 0xc0, 0x00, 0x0a, 0x30, 0x80, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x04, 0x3e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3e, 0x00, 0x00, 0x00, 0x04, 0x1d, 0x37, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03, 0x83, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0x47, 0x30, 0xfc, 0x0c, 0xd3, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x07, 0x0c, 0xf0, 0xc7, 0x35, 0xc3, 0x0c, 0xf3, 0x07, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0xc3, 0x25, 0x03, 0x4c, 0xd2, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0xd0, 0x00, 0x83, 0x8f, 0x33, 0xc3, 0x1c, 0xd3, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0xc7, 0x30, 0xbf, 0x0c, 0xd0, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x04, 0x3d, 0x07, 0x03, 0x2f, 0x03, 0x03, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xc0, 0xcb, 0x32, 0xc3, 0xf4, 0x03, 0x4c, 0x30, 0x7e, 0x00, 0x00, 0x05, 0x03, 0x0c, 0xf0, 0xc7, 0x39, 0xc3, 0x0c, 0x73, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x1c, 0x00, 0x0d, 0x0c, 0x0c, 0x1d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x30, 0x00, 0x34, 0x30, 0x30, 0x30, 0x30, 0x1e, 0x00, 0x05, 0x03, 0x0c, 0x31, 0xce, 0x0e, 0x1f, 0xcc, 0x31, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x47, 0x3d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9b, 0x71, 0x37, 0x33, 0x33, 0x32, 0x43, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xf0, 0xc7, 0x31, 0xc3, 0x0c, 0x33, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0xc7, 0x31, 0xc3, 0x4c, 0xd3, 0x07, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xf0, 0xc7, 0x31, 0xc3, 0x4c, 0xf3, 0xc7, 0x00, 0x03, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0xdf, 0x31, 0xc3, 0x4c, 0xd3, 0x0f, 0x30, 0xc0, 0x00, 0x05, 0x03, 0x00, 0x30, 0x7f, 0xc7, 0x30, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xc0, 0xc7, 0x10, 0x3c, 0x04, 0xf3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0c, 0x0c, 0x3f, 0x0c, 0x0c, 0x1c, 0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x70, 0xdc, 0x30, 0xc3, 0x4c, 0xd3, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x30, 0xcc, 0x30, 0xd3, 0xdc, 0xc2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x47, 0x33, 0x32, 0x33, 0x73, 0x37, 0xcd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x30, 0xcd, 0x32, 0x7d, 0x8c, 0x73, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x30, 0xcc, 0x30, 0xc7, 0x74, 0x43, 0x07, 0x0c, 0x1f, 0x00, 0x00, 0x05, 0x00, 0x00, 0xf0, 0x4f, 0x2c, 0x2c, 0x2c, 0xf1, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x04, 0x38, 0x0c, 0x0c, 0x03, 0x0c, 0x0c, 0x38, 0x00, 0x00, 0x00, 0x02, 0x32, 0x33, 0x33, 0x13, 0x00, 0x04, 0x0b, 0x0c, 0x0c, 0x30, 0x0c, 0x0c, 0x0b, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1d, 0x72, 0x37, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x07, 0x00, 0x1f, 0x00, 0x7f, 0x00, 0xff, 0x01, 0xff, 0x07, 0xff, 0x1f, 0xff, 0x7f, 0xff, 0x1b, 0xbf, 0x01, 0x1b, 0x00, 0x0c, 0x00, 0x40, 0xff, 0x00, 0x00, 0xf8, 0xf0, 0x3f, 0xee, 0x2c, 0x30, 0xcb, 0x0b, 0x30, 0x42, 0xc3, 0x33, 0x00, 0x03, 0x30, 0x00, 0xf3, 0x33, 0x00, 0x03, 0x30, 0x00, 0xff, 0x3f, 0x00, 0x0c, 0xc2, 0x00, 0x00, 0xcb, 0x00, 0x00, 0xee, 0xc0, 0xff, 0xf8, 0xb0, 0xc0, 0xff, 0x2c, 0xc0, 0x00, 0x0c, 0xcf, 0x00, 0x0c, 0xc0, 0x00, 0xcc, 0xcf, 0x00, 0x0c, 0xc0, 0x00, 0xfc, 0xff, 0x0a, 0x00, 0x00, 0x0d, 0x00, 0x70, 0x00, 0x00, 0xf3, 0xff, 0xd3, 0x03, 0xe0, 0x3c, 0x3f, 0x38, 0x03, 0xd0, 0x33, 0xff, 0x38, 0x03, 0xe0, 0xf0, 0xff, 0x03, 0x0c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x8b, 0xf7, 0x0c, 0x13, 0x9f, 0x3b, 0x37, 0x00, 0xc0, 0x23, 0xff, 0xff, 0x8b, 0x03, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xd0, 0x7f, 0x80, 0x03, 0x2c, 0x0d, 0x00, 0x37, 0x00, 0xc0, 0xf3, 0xff, 0x3c, 0xff, 0xcf, 0x03, 0x00, 0xdc, 0x00, 0x70, 0x38, 0xc0, 0x02, 0xfd, 0x07, 0x0a, 0x00, 0x00, 0x00, 0xfc, 0x03, 0xf0, 0xff, 0xc0, 0xff, 0x3f, 0xfc, 0xff, 0xc3, 0xff, 0x3f, 0xfc, 0xff, 0x03, 0xff, 0x0f, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0x03, 0x00, 0x3c, 0xf0, 0xc0, 0xc3, 0x3a, 0x3c, 0x0b, 0xce, 0x2b, 0x80, 0x7e, 0x00, 0xd0, 0x03, 0x00, 0xfc, 0xff, 0xff, 0x0a, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0xfc, 0xff, 0xc3, 0xff, 0x3f, 0xfc, 0xff, 0xc3, 0xff, 0x3f, 0xfc, 0xff, 0xc3, 0xff, 0x3f, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x0a, 0xd0, 0x7f, 0x80, 0x03, 0x2c, 0x0d, 0x0f, 0x37, 0xf0, 0xc0, 0xf3, 0xff, 0x3c, 0xff, 0xcf, 0x03, 0x0f, 0xdc, 0xf0, 0x70, 0x38, 0xc0, 0x02, 0xfd, 0x07, 0x0a, 0x40, 0x1f, 0x00, 0xad, 0x07, 0xb0, 0xc5, 0x00, 0x17, 0x0c, 0x70, 0xd0, 0x00, 0x0c, 0x03, 0xbc, 0xef, 0xb3, 0x11, 0xe0, 0x07, 0x05, 0x3c, 0x52, 0xc8, 0x0a, 0x00, 0x00, 0x00, 0xf0, 0x00, 0xc0, 0x3f, 0x00, 0xfc, 0x03, 0xc0, 0x3f, 0x00, 0xf0, 0x00, 0xc0, 0x30, 0xc0, 0xff, 0x3f, 0xfc, 0xff, 0xc3, 0xff, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0xfc, 0xff, 0x3f, 0xfc, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xb8, 0xe0, 0x2f, 0xff, 0xe3, 0x2f, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xd0, 0x7f, 0x80, 0xff, 0x2f, 0xfd, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0x7f, 0xf8, 0xff, 0x02, 0xfd, 0x07, 0x0a, 0x40, 0x01, 0x00, 0x02, 0x00, 0xc8, 0x07, 0x10, 0xc3, 0x00, 0x31, 0x0d, 0x00, 0xfd, 0x01, 0x00, 0x74, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0xf0, 0xf0, 0x00, 0x0f, 0x0f, 0xf0, 0xf0, 0x00, 0x0f, 0x0f, 0xf0, 0xf0, 0x00, 0x0f, 0x0f, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x0a, 0x40, 0x05, 0x80, 0xff, 0x8b, 0x1e, 0xd0, 0x2e, 0x00, 0xf0, 0x00, 0xe0, 0xff, 0x0b, 0x00, 0x0f, 0x00, 0xb8, 0x03, 0xb0, 0xe2, 0xff, 0x02, 0x50, 0x01, 0x08, 0xff, 0x07, 0x03, 0x1e, 0x03, 0x73, 0x03, 0xef, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0xff, 0xff, 0x0b, 0x00, 0x00, 0x00, 0xe4, 0x2f, 0xe0, 0x1b, 0x0c, 0x1d, 0x00, 0xff, 0x03, 0xbe, 0xf0, 0xc1, 0x01, 0xad, 0x34, 0xc0, 0x36, 0x0b, 0x30, 0xdc, 0xe4, 0x07, 0xfd, 0x1b, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x02, 0xa0, 0xaa, 0x00, 0xa8, 0xc2, 0x0f, 0x2a, 0xff, 0x03, 0xca, 0x3f, 0x80, 0xfc, 0x0f, 0x20, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0xc0, 0x01, 0x00, 0xc0, 0x07, 0xaa, 0xea, 0x1f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xaa, 0xea, 0x1f, 0x00, 0xc0, 0x07, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x40, 0x03, 0x00, 0xd0, 0x03, 0x00, 0xf4, 0xab, 0xaa, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xf4, 0xab, 0xaa, 0xd0, 0x03, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0xfe, 0xff, 0xe3, 0xff, 0x0f, 0xaa, 0x3e, 0x0a, 0xf8, 0x2e, 0xe0, 0xbf, 0x80, 0xff, 0xaa, 0xfe, 0xff, 0xe2, 0xff, 0x02, 0x02, 0x00, 0x00, 0x09, 0x00, 0x80, 0x04, 0xd0, 0xe2, 0xff, 0x02, 0x00, 0x00, 0xff, 0x6f, 0x00, 0x40, 0xe6, 0xaf, 0x50, 0x00, 0x09, 0x00, 0x20, 0x00, 0x64, 0x00, 0x09, 0xe0, 0x3f, 0x70, 0x60, 0x63, 0xc0, 0xe4, 0x80, 0xc2, 0x03, 0x07, 0x0f, 0x1e, 0x6c, 0xff, 0x27, 0xff, 0x3f, 0xe0, 0x2f, 0x00, 0x00, 0x00, 0x09, 0x44, 0x44, 0x00, 0x12, 0x41, 0x88, 0x04, 0x21, 0x21, 0x84, 0x48, 0x20, 0x23, 0xc2, 0xcc, 0x08, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x1d, 0x00, 0x1d, 0x00, 0x78, 0x00, 0xb4, 0x07, 0xf0, 0x2f, 0xc0, 0xfb, 0x00, 0xbe, 0x02, 0xf4, 0x07, 0xfd, 0xff, 0x01, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x01, 0x00, 0x19, 0x00, 0xa8, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0xf0, 0xdc, 0xcb, 0x03, 0x00, 0xff, 0xff, 0x4f, 0x07, 0x40, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0xff, 0x3f, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0x07, 0x00, 0xbd, 0x02, 0xe8, 0xb3, 0xe0, 0x3c, 0xac, 0xc3, 0x03, 0x0f, 0x3c, 0x00, 0xc0, 0x03, 0x00, 0xfc, 0xff, 0xff, 0x0b, 0xc0, 0xc8, 0xc0, 0x91, 0x1b, 0xcd, 0x36, 0xe7, 0x00, 0x47, 0x03, 0xa7, 0x80, 0x36, 0xfd, 0xff, 0xc1, 0x9b, 0xf9, 0xb8, 0xb8, 0xb8, 0xb7, 0x99, 0xf7, 0xff, 0xff, 0x0f, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf0, 0x03, 0x00, 0xfc, 0x00, 0xc0, 0xff, 0x00, 0xf0, 0x3f, 0x00, 0xff, 0x3f, 0xf0, 0xff, 0x3f, 0xfc, 0xff, 0xcf, 0xff, 0xff, 0x0f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x1f, 0xcb, 0x30, 0xc3, 0x3f, 0xc7, 0x00, 0x7e, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xfc, 0xff, 0xc3, 0xff, 0x3f, 0x0c, 0x00, 0xc3, 0xfc, 0x33, 0x0c, 0x24, 0xc3, 0xc0, 0x31, 0x0c, 0x06, 0xc3, 0x30, 0x30, 0x0c, 0x00, 0xc3, 0xff, 0x3f, 0x0a, 0xff, 0x3f, 0x30, 0x00, 0x03, 0xc3, 0x30, 0x30, 0x3f, 0xff, 0xff, 0x3f, 0x3c, 0x00, 0xff, 0xff, 0xff, 0x0c, 0x0c, 0xc3, 0xc0, 0x00, 0x0c, 0xfc, 0xff, 0x0a, 0x00, 0x00, 0xc0, 0xff, 0x00, 0xfc, 0x0f, 0xc0, 0xff, 0x00, 0xfc, 0x0f, 0xc0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x3c, 0x00, 0xc0, 0x03, 0xf0, 0x3f, 0x00, 0xff, 0x03, 0x00, 0x00, 0x09, 0xe0, 0x2f, 0xf0, 0xff, 0xe3, 0xb8, 0xec, 0x9b, 0xf9, 0xbf, 0xf8, 0xbf, 0x99, 0xef, 0xb8, 0x2c, 0xff, 0x3f, 0xe0, 0x2f, 0x00, 0x00, 0x00, 0x04, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x87, 0x87, 0xc3, 0x30, 0x0c, 0xe3, 0xde, 0x01, 0x03, 0x74, 0xbb, 0x0c, 0xc3, 0x30, 0x2c, 0x2d, 0x0d, 0x05, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0f, 0x05, 0x00, 0x00, 0xd0, 0xc7, 0x34, 0xc3, 0x0c, 0x73, 0x4c, 0x1f, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x39, 0xc0, 0x00, 0x43, 0x2f, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0x87, 0x30, 0x60, 0x60, 0x60, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0x87, 0x30, 0xb8, 0x00, 0x23, 0x4c, 0x1f, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0e, 0x36, 0xc6, 0xfc, 0x03, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xf0, 0xcb, 0x00, 0x7f, 0x40, 0x13, 0x8c, 0x1f, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0xcb, 0x10, 0x2f, 0x4c, 0x33, 0x4c, 0x1f, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xf0, 0x0f, 0x30, 0x60, 0x60, 0xc0, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0xc7, 0x30, 0x7d, 0x4c, 0x33, 0x4c, 0x1f, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xd0, 0xc7, 0x30, 0xc6, 0xe0, 0x03, 0x8c, 0x1f, 0x00, 0x00, 0x00, 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x03, 0xc0, 0xf0, 0x3c, 0xcf, 0xf3, 0x3c, 0x03, 0x00, 0x03, 0x00, 0xcc, 0xf3, 0x3c, 0xcf, 0xf3, 0x30, 0x00, 0x05, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x06, 0x74, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x03, 0x30, 0xc0, 0x0f, 0x30, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0xd0, 0x7f, 0x40, 0xff, 0x1f, 0xfc, 0xff, 0x43, 0xff, 0x1f, 0x40, 0x15, 0x00, 0x00, 0x00, 0x0a, 0xe4, 0x06, 0x90, 0x91, 0x01, 0x06, 0x24, 0x30, 0x90, 0x1b, 0x46, 0x6e, 0x96, 0xb9, 0x91, 0xe4, 0x06, 0x0c, 0x18, 0x90, 0x40, 0x46, 0x06, 0x90, 0x1b, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x02, 0xc2, 0xab, 0xaa, 0x3e, 0x20, 0xe0, 0xab, 0xaa, 0x3e, 0x02, 0xc2, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x08, 0x02, 0xc0, 0x30, 0x00, 0x0c, 0x03, 0xf0, 0xff, 0x00, 0xfe, 0x0b, 0xd0, 0x7f, 0x00, 0xa4, 0x01, 0x00, 0x0a, 0x00, 0xa0, 0x00, 0x0a, 0x00, 0x80, 0x00, 0x81, 0x24, 0x10, 0x85, 0x00, 0x20, 0x66, 0x40, 0x15, 0x45, 0x62, 0x90, 0x4d, 0xd0, 0xf1, 0x23, 0x01, 0xfd, 0x41, 0x41, 0x07, 0x00, 0x0a, 0x00, 0x05, 0x00, 0xa0, 0x00, 0x40, 0x1f, 0x00, 0xf8, 0x02, 0xd0, 0x7f, 0x00, 0xfe, 0x0b, 0xf0, 0xff, 0x00, 0xff, 0x0f, 0xd0, 0x7f, 0x00, 0xf4, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0xd4, 0x01, 0xd0, 0x06, 0x40, 0x7f, 0x00, 0xfd, 0x01, 0xf4, 0x07, 0xd0, 0x1f, 0x00, 0x7f, 0x00, 0xd0, 0x01, 0x00, 0x0a, 0x40, 0x15, 0x00, 0xfe, 0x0b, 0x88, 0x2f, 0x52, 0xf0, 0x50, 0x01, 0x0a, 0xd4, 0xaf, 0x7f, 0xfd, 0xf5, 0xc7, 0x0b, 0x3e, 0x70, 0xd0, 0x00, 0xa4, 0x01, 0x0a, 0x80, 0x2f, 0x80, 0x5f, 0x2f, 0x0c, 0x00, 0xc3, 0x00, 0x30, 0x0c, 0x00, 0xc3, 0x01, 0x34, 0x34, 0xc0, 0x01, 0x07, 0x0d, 0xd0, 0x75, 0x00, 0xf4, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0xf4, 0x01, 0xc0, 0x3f, 0x00, 0xf0, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xf0, 0x00, 0xe0, 0xef, 0x00, 0xbb, 0x0b, 0xa0, 0xaa, 0x00, 0xaa, 0x0a, 0x80, 0x19, 0x00, 0x64, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x10, 0x2d, 0x80, 0xe7, 0x0b, 0xbe, 0xf8, 0xfa, 0x02, 0xfe, 0x0b, 0x80, 0x2f, 0x00, 0x50, 0x00, 0x0a, 0x00, 0x05, 0x00, 0xf8, 0x02, 0xe0, 0xbf, 0x80, 0xaf, 0x2f, 0xbe, 0xe0, 0xdb, 0x02, 0x78, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x05, 0x00, 0xa0, 0x00, 0x40, 0x1f, 0x50, 0xfe, 0x5b, 0xfd, 0xff, 0x47, 0xff, 0x1f, 0xe0, 0xbf, 0x00, 0xfe, 0x0b, 0xf0, 0xf5, 0x40, 0x01,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0x0c, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x74, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x74, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x74, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x74, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x74, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x74, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x74, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0xdc, 0xc0, 0x0c, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, @@ -29,4 +30,5 @@ static short font_ptrs[] = { 0x0000, 0x000e, 0x001c, 0x002a, 0x0038, 0x0046, 0x0054, 0x0062, 0x0070, 0x007e, 0x008c, 0x009a, 0x00a8, 0x00b6, 0x00c4, 0x00d2, 0x00e0, 0x00ee, 0x00fc, 0x010a, 0x0118, 0x0126, 0x0134, 0x0142, 0x0150, 0x015e, 0x016c, 0x017a, 0x0188, 0x0196, 0x01a4, 0x01b2, 0x01c0, 0x01ce, 0x01d7, 0x01e5, 0x01f5, 0x0205, 0x0218, 0x0228, 0x0231, 0x023c, 0x0247, 0x0257, 0x0267, 0x0272, 0x0280, 0x0289, 0x0299, 0x02a9, 0x02b7, 0x02c7, 0x02d7, 0x02e7, 0x02f7, 0x0307, 0x0317, 0x0327, 0x0337, 0x0340, 0x034b, 0x035b, 0x036b, 0x037b, 0x038b, 0x03a0, 0x03b0, 0x03c0, 0x03d0, 0x03e0, 0x03f0, 0x0400, 0x0410, 0x0420, 0x042b, 0x043b, 0x044e, 0x045e, 0x0473, 0x0486, 0x0499, 0x04a9, 0x04bc, 0x04cc, 0x04dc, 0x04ec, 0x04ff, 0x050f, 0x0524, 0x0537, 0x0547, 0x055a, 0x0565, 0x0573, 0x057e, 0x0589, 0x0599, 0x05a2, 0x05b0, 0x05be, 0x05cc, 0x05da, 0x05e8, 0x05f3, 0x0601, 0x060f, 0x061a, 0x0625, 0x0633, 0x063e, 0x064e, 0x065c, 0x066a, 0x0678, 0x0686, 0x068f, 0x069d, 0x06a8, 0x06b6, 0x06c4, 0x06d4, 0x06e2, 0x06f0, 0x06fe, 0x0709, 0x070f, 0x071a, 0x072a, 0x0735, 0x074a, 0x0769, 0x0788, 0x07a2, 0x07c1, 0x07db, 0x07f5, 0x080f, 0x0829, 0x0843, 0x085d, 0x0877, 0x0896, 0x08a6, 0x08c0, 0x08da, 0x08f4, 0x090e, 0x0923, 0x0940, 0x095d, 0x097c, 0x099b, 0x09b3, 0x09cb, 0x09e3, 0x09fb, 0x0a13, 0x0a2b, 0x0a43, 0x0a5b, 0x0a73, 0x0a8b, 0x0aa3, 0x0abd, 0x0ada, 0x0af7, 0x0b0c, 0x0b26, 0x0b40, 0x0b5a, 0x0b74, 0x0b8c, 0x0b97, 0x0ba0, 0x0ba9, 0x0bb7, 0x0bc5, 0x0bd3, 0x0be1, 0x0bef, 0x0bfd, 0x0c0b, 0x0c19, 0x0c27, 0x0c35, 0x0c43, 0x0c4e, 0x0c57, 0x0c60, 0x0c6e, 0x0c7e, 0x0c8e, 0x0ca8, 0x0cc2, 0x0cdc, 0x0cf6, 0x0d10, 0x0d2a, 0x0d44, 0x0d5e, 0x0d78, 0x0d92, 0x0dac, 0x0dc6, 0x0de0, 0x0dfa, 0x0e14, 0x0e2e, 0x0e46, 0x0e60, 0x0e7a, 0x0e8a, 0x0e9a, 0x0eaa, 0x0eba, 0x0eca, 0x0eda, 0x0eea, 0x0efa, 0x0f0a, 0x0f1a, 0x0f2a, 0x0f3a, 0x0f4a, 0x0f5a, 0x0f6a, 0x0f7a, 0x0f8a, 0x0f9a, 0x0faa, 0x0fba, 0x0fca, 0x0fda, 0x0fea, 0x0ffa, 0x100a, 0x101a, 0x102a, 0x103a, 0x104a, 0x105a, 0x106a, 0x107a, 0x108a, 0x109a, 0x10aa, 0x10ba, 0x10ca, 0x10da, 0x10ea, 0x10fa, 0x110a, 0x111a, 0x112a, 0x113a, 0x114a, }; -#endif \ No newline at end of file +#endif +#endif diff --git a/graphics.h b/includes/graphics.h similarity index 100% rename from graphics.h rename to includes/graphics.h diff --git a/includes/hmap.h b/includes/hmap.h new file mode 100755 index 000000000..de18061be --- /dev/null +++ b/includes/hmap.h @@ -0,0 +1,34 @@ +/** + * Powder Toy - Heatmap Data + * + * 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 + */ +#ifndef HMAP_H +#define HMAP_H +//Original Heat Scale +//static char color_data[] = {0xD9,0xFF,0xFE,0xD4,0xFB,0xFC,0xCF,0xF6,0xF9,0xC9,0xF1,0xF6,0xC2,0xEB,0xF4,0xBB,0xE5,0xF0,0xB3,0xDE,0xED,0xAA,0xD6,0xE9,0xA1,0xCF,0xE5,0x98,0xC7,0xE2,0x8E,0xBF,0xDD,0x85,0xB6,0xD9,0x7B,0xAD,0xD5,0x71,0xA5,0xD0,0x67,0x9C,0xCC,0x5D,0x93,0xC7,0x53,0x8A,0xC3,0x4A,0x82,0xBE,0x41,0x79,0xB9,0x38,0x71,0xB5,0x30,0x69,0xB0,0x28,0x61,0xAC,0x21,0x5A,0xA8,0x1B,0x53,0xA3,0x16,0x4D,0x9F,0x12,0x47,0x9B,0x0F,0x42,0x98,0x0F,0x3D,0x94,0x0F,0x39,0x90,0x0F,0x34,0x8C,0x0F,0x30,0x89,0x0F,0x2C,0x85,0x0F,0x28,0x81,0x0F,0x24,0x7D,0x0F,0x20,0x7A,0x0F,0x1D,0x76,0x0F,0x1A,0x72,0x0F,0x16,0x6F,0x0F,0x13,0x6B,0x0F,0x11,0x67,0x10,0x0E,0x64,0x12,0x0C,0x60,0x15,0x0A,0x5D,0x18,0x08,0x59,0x1B,0x06,0x56,0x1D,0x04,0x53,0x20,0x03,0x4F,0x23,0x02,0x4C,0x26,0x01,0x49,0x29,0x01,0x46,0x2C,0x00,0x43,0x2F,0x00,0x40,0x30,0x00,0x3F,0x31,0x00,0x3F,0x31,0x00,0x3E,0x32,0x00,0x3E,0x32,0x00,0x3D,0x33,0x00,0x3D,0x33,0x00,0x3C,0x34,0x00,0x3C,0x34,0x00,0x3B,0x35,0x01,0x3B,0x36,0x01,0x3B,0x36,0x01,0x3A,0x37,0x01,0x3A,0x37,0x01,0x39,0x38,0x01,0x39,0x39,0x01,0x38,0x39,0x02,0x38,0x3A,0x02,0x37,0x3B,0x02,0x37,0x3B,0x02,0x36,0x3C,0x02,0x36,0x3C,0x03,0x35,0x3D,0x03,0x35,0x3E,0x03,0x34,0x3F,0x03,0x34,0x3F,0x04,0x34,0x40,0x04,0x33,0x41,0x04,0x33,0x41,0x04,0x32,0x42,0x05,0x32,0x43,0x05,0x31,0x43,0x05,0x31,0x44,0x06,0x30,0x45,0x06,0x30,0x46,0x06,0x30,0x46,0x07,0x2F,0x47,0x07,0x2F,0x48,0x08,0x2E,0x49,0x08,0x2E,0x49,0x08,0x2E,0x4A,0x09,0x2D,0x4B,0x09,0x2D,0x4C,0x09,0x2C,0x4C,0x0A,0x2C,0x4D,0x0A,0x2B,0x4E,0x0B,0x2B,0x4F,0x0B,0x2B,0x4F,0x0C,0x2A,0x50,0x0C,0x2A,0x51,0x0D,0x29,0x52,0x0D,0x29,0x53,0x0D,0x29,0x53,0x0E,0x28,0x54,0x0E,0x28,0x55,0x0F,0x27,0x56,0x0F,0x27,0x57,0x10,0x27,0x58,0x10,0x26,0x58,0x11,0x26,0x59,0x11,0x26,0x5A,0x12,0x25,0x5B,0x13,0x25,0x5C,0x13,0x24,0x5D,0x14,0x24,0x5D,0x14,0x24,0x5E,0x15,0x23,0x5F,0x15,0x23,0x60,0x16,0x23,0x61,0x16,0x22,0x62,0x17,0x22,0x62,0x18,0x22,0x63,0x18,0x21,0x64,0x19,0x21,0x65,0x19,0x21,0x66,0x1A,0x20,0x67,0x1B,0x20,0x67,0x1B,0x20,0x68,0x1C,0x1F,0x69,0x1C,0x1F,0x6A,0x1D,0x1F,0x6B,0x1E,0x1E,0x6C,0x1E,0x1E,0x6D,0x1F,0x1E,0x6D,0x1F,0x1D,0x6E,0x20,0x1D,0x6F,0x21,0x1D,0x70,0x21,0x1C,0x71,0x22,0x1C,0x72,0x23,0x1C,0x73,0x23,0x1B,0x73,0x24,0x1B,0x74,0x25,0x1B,0x75,0x25,0x1A,0x76,0x26,0x1A,0x77,0x27,0x1A,0x78,0x27,0x1A,0x78,0x28,0x19,0x79,0x29,0x19,0x7A,0x29,0x19,0x7B,0x2A,0x18,0x7C,0x2B,0x18,0x7D,0x2B,0x18,0x7E,0x2C,0x18,0x7E,0x2D,0x17,0x7F,0x2D,0x17,0x80,0x2E,0x17,0x81,0x2F,0x16,0x82,0x2F,0x16,0x82,0x30,0x16,0x83,0x31,0x16,0x84,0x31,0x15,0x85,0x32,0x15,0x86,0x33,0x15,0x87,0x33,0x15,0x87,0x34,0x14,0x88,0x35,0x14,0x89,0x36,0x14,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1E,0x00,0x1C,0x22,0x00,0x1F,0x26,0x00,0x22,0x29,0x00,0x26,0x2D,0x00,0x29,0x32,0x00,0x2D,0x36,0x00,0x30,0x3A,0x00,0x34,0x3E,0x00,0x38,0x43,0x00,0x3C,0x47,0x00,0x40,0x4C,0x00,0x44,0x51,0x00,0x48,0x55,0x00,0x4C,0x5A,0x00,0x50,0x5F,0x00,0x54,0x64,0x00,0x59,0x69,0x00,0x5D,0x6E,0x00,0x61,0x73,0x00,0x66,0x77,0x00,0x6A,0x7C,0x00,0x6E,0x81,0x00,0x73,0x86,0x00,0x77,0x8B,0x00,0x7C,0x90,0x00,0x80,0x95,0x00,0x85,0x9A,0x00,0x89,0x9F,0x00,0x8D,0xA3,0x00,0x92,0xA8,0x00,0x96,0xAD,0x00,0x9B,0xB1,0x00,0x9F,0xB6,0x00,0xA3,0xBA,0x00,0xA8,0xBF,0x00,0xAC,0xC3,0x00,0xB0,0xC7,0x00,0xB4,0xCB,0x00,0xB8,0xCF,0x00,0xBD,0xD3,0x00,0xC1,0xD7,0x00,0xC4,0xDB,0x00,0xC8,0xDE,0x00,0xCC,0xE1,0x00,0xD0,0xE5,0x00,0xD4,0xE8,0x00,0xD7,0xEA,0x00,0xDB,0xED,0x00,0xDE,0xF0,0x00,0xE1,0xF2,0x00,0xE4,0xF4,0x00,0xE8,0xF6,0x00,0xEB,0xF8,0x00,0xED,0xFA,0x00,0xF0,0xFB,0x00,0xF3,0xFC,0x00,0xF5,0xFD,0x00,0xF8,0xFE,0x00,0xFA,0xFF,0x00,0xFC,0xFF,0x00,0xFE,0xFF,0x00,0xFF,0xFF,0x00,0xFF,0xFE,0x00,0xFF,0xFE,0x00,0xFF,0xFD,0x00,0xFF,0xFC,0x00,0xFF,0xFB,0x00,0xFF,0xF9,0x00,0xFF,0xF8,0x00,0xFF,0xF6,0x00,0xFF,0xF4,0x00,0xFF,0xF2,0x00,0xFF,0xF0,0x00,0xFF,0xEE,0x00,0xFF,0xEB,0x00,0xFF,0xE9,0x00,0xFF,0xE6,0x00,0xFF,0xE3,0x00,0xFF,0xE0,0x00,0xFF,0xDD,0x00,0xFF,0xD9,0x00,0xFF,0xD6,0x00,0xFF,0xD3,0x00,0xFF,0xCF,0x00,0xFF,0xCB,0x00,0xFF,0xC7,0x00,0xFF,0xC4,0x00,0xFF,0xC0,0x00,0xFF,0xBC,0x00,0xFF,0xB7,0x00,0xFF,0xB3,0x00,0xFF,0xAF,0x00,0xFF,0xAB,0x00,0xFF,0xA6,0x00,0xFF,0xA2,0x00,0xFF,0x9E,0x00,0xFF,0x99,0x00,0xFF,0x95,0x00,0xFF,0x90,0x00,0xFF,0x8B,0x00,0xFF,0x87,0x00,0xFF,0x82,0x00,0xFF,0x7E,0x00,0xFF,0x79,0x00,0xFF,0x74,0x00,0xFF,0x70,0x00,0xFF,0x6B,0x00,0xFF,0x67,0x00,0xFF,0x62,0x00,0xFF,0x5E,0x00,0xFF,0x59,0x00,0xFF,0x55,0x00,0xFF,0x50,0x00,0xFF,0x4C,0x00,0xFF,0x48,0x00,0xFF,0x43,0x00,0xFF,0x3F,0x00,0xFF,0x3B,0x00,0xFF,0x37,0x00,0xFF,0x33,0x00,0xFF,0x2F,0x00,0xFF,0x2B,0x00,0xFF,0x28,0x00,0xFF,0x24,0x00,0xFF,0x21,0x00,0xFF,0x1D,0x00,0xFF,0x1A,0x00,0xFF,0x17,0x00,0xFF,0x14,0x00,0xFF,0x11,0x00,0xFF,0x0E,0x00,0xFF,0x0C,0x00,0xFF,0x09,0x00,0xFF,0x07,0x00,0xFF,0x05,0x00,0xFF,0x03,0x00,0xFF,0x01,0x00,0xFF,0x00,0x01,0xFF,0x00,0x03,0xFF,0x00,0x05,0xFF,0x00,0x07,0xFF,0x00,0x09,0xFF,0x00,0x0C,0xFF,0x00,0x0F,0xFF,0x00,0x11,0xFF,0x00,0x14,0xFF,0x00,0x17,0xFF,0x00,0x1A,0xFF,0x00,0x1D,0xFF,0x00,0x20,0xFF,0x00,0x24,0xFF,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FF,0xCF,0x00,0xFF,0xCB,0x00,0xFF,0xC8,0x00,0xFF,0xC4,0x00,0xFF,0xC0,0x00,0xFF,0xBC,0x00,0xFF,0xB8,0x00,0xFF,0xB4,0x00,0xFF,0xAF,0x00,0xFF,0xAB,0x00,0xFF,0xA7,0x00,0xFF,0xA3,0x00,0xFF,0x9E,0x00,0xFF,0x9A,0x00,0xFF,0x96,0x00,0xFF,0x91,0x00,0xFF,0x8D,0x00,0xFF,0x88,0x00,0xFF,0x84,0x00,0xFF,0x80,0x00,0xFF,0x7B,0x00,0xFF,0x77,0x00,0xFF,0x72,0x00,0xFF,0x6E,0x00,0xFF,0x69,0x00,0xFF,0x65,0x00,0xFF,0x61,0x00,0xFF,0x5C,0x00,0xFF,0x58,0x00,0xFF,0x54,0x00,0xFF,0x50,0x00,0xFF,0x4B,0x00,0xFF,0x47,0x00,0xFF,0x43,0x00,0xFF,0x3F,0x00,0xFF,0x3B,0x00,0xFF,0x37,0x00,0xFF,0x34,0x00,0xFF,0x30,0x00,0xFF,0x2C,0x00,0xFF,0x29,0x00,0xFF,0x25,0x00,0xFF,0x22,0x00,0xFF,0x1E,0x00,0xFF,0x1B,0x00,0xFF,0x18,0x00,0xFF,0x15,0x00,0xFF,0x12,0x00,0xFF,0x10,0x00,0xFF,0x0D,0x00,0xFF,0x0A,0x00,0xFF,0x08,0x00,0xFF,0x06,0x00,0xFF,0x04,0x00,0xFF,0x02,0x00,0xFF,0x00,0x02,0xFD,0x00,0x04,0xFB,0x00,0x06,0xF9,0x00,0x09,0xF6,0x00,0x0B,0xF3,0x00,0x0E,0xF1,0x00,0x10,0xEE,0x00,0x13,0xEB,0x00,0x16,0xE7,0x00,0x19,0xE4,0x00,0x1C,0xE0,0x00,0x1F,0xDD,0x00,0x23,0xD9,0x00,0x26,0xD5,0x00,0x29,0xD1,0x00,0x2D,0xCD,0x00,0x31,0xC9,0x00,0x35,0xC4,0x00,0x38,0xC0,0x00,0x3C,0xBC,0x00,0x40,0xB7,0x00,0x44,0xB2,0x00,0x48,0xAE,0x00,0x4C,0xA9,0x00,0x51,0xA4,0x00,0x55,0x9F,0x00,0x59,0x9B,0x00,0x5D,0x96,0x00,0x62,0x91,0x00,0x66,0x8C,0x00,0x6A,0x87,0x00,0x6F,0x82,0x00,0x73,0x7D,0x00,0x78,0x78,0x00,0x7C,0x73,0x00,0x81,0x6E,0x00,0x85,0x69,0x00,0x8A,0x65,0x00,0x8E,0x60,0x00,0x92,0x5B,0x00,0x97,0x56,0x00,0x9B,0x52,0x00,0xA0,0x4D,0x00,0xA4,0x49,0x00,0xA8,0x44,0x00,0xAC,0x40,0x00,0xB1,0x3B,0x00,0xB5,0x37,0x00,0xB9,0x33,0x00,0xBD,0x2F,0x00,0xC1,0x2B,0x00,0xC5,0x28,0x00,0xC9,0x24,0x00,0xCD,0x21,0x00,0xD0,0x1D,0x00,0xD4,0x1A,0x00,0xD8,0x17,0x00,0xDB,0x14,0x00,0xDE,0x11,0x00,0xE2,0x0F,0x00,0xE5,0x0D,0x00,0xE8,0x0A,0x00,0xEB,0x08,0x00,0xEE,0x07,0x00,0xF0,0x05,0x00,0xF3,0x04,0x00,0xF6,0x02,0x00,0xF8,0x01,0x00,0xFA,0x01,0x00,0xFC,0x00,0x00,0xFE,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0x01,0x00,0xFF,0x01,0x00,0xFF,0x02,0x00,0xFF,0x03,0x00,0xFF,0x04,0x00,0xFF,0x06,0x00,0xFF,0x07,0x00,0xFF,0x09,0x00,0xFF,0x0B,0x00,0xFF,0x0D,0x00,0xFF,0x0F,0x00,0xFF,0x12,0x00,0xFF,0x14,0x00,0xFF,0x17,0x00,0xFF,0x1A,0x00,0xFF,0x1C,0x00,0xFF,0x1F,0x00,0xFF,0x23,0x00,0xFF,0x26,0x00,0xFF,0x29,0x00,0xFF,0x2D,0x00,0xFF,0x31,0x00,0xFF,0x34,0x00,0xFF,0x38,0x00,0xFF,0x3C,0x00,0xFF,0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1,0x00,0xFF,0xCE,0x00,0xFF,0xCC,0x00,0xFF,0xC9,0x00,0xFF,0xC6,0x00,0xFF,0xC3,0x00,0xFF,0xC1,0x00,0xFF,0xBE,0x00,0xFF,0xBB,0x00,0xFF,0xB8,0x00,0xFF,0xB5,0x00,0xFF,0xB2,0x00,0xFF,0xAF,0x00,0xFF,0xAC,0x00,0xFF,0xA9,0x00,0xFF,0xA7,0x00,0xFF,0xA4,0x00,0xFF,0xA1,0x00,0xFF,0x9E,0x00,0xFF,0x9B,0x00,0xFF,0x98,0x00,0xFF,0x95,0x00,0xFF,0x93,0x00,0xFF,0x90,0x00,0xFF,0x8D,0x00,0xFF,0x8A,0x00,0xFF,0x88,0x00,0xFF,0x85,0x00,0xFF,0x83,0x00,0xFF,0x80,0x00,0xFF,0x7E,0x00,0xFF,0x7B,0x00,0xFF,0x78,0x00,0xFF,0x76,0x00,0xFF,0x73,0x00,0xFF,0x70,0x00,0xFF,0x6E,0x00,0xFF,0x6B,0x00,0xFF,0x68,0x00,0xFF,0x65,0x00,0xFF,0x63,0x00,0xFF,0x60,0x00,0xFF,0x5D,0x00,0xFF,0x5A,0x00,0xFF,0x57,0x00,0xFF,0x54,0x00,0xFF,0x51,0x00,0xFF,0x4E,0x00,0xFF,0x4B,0x00,0xFF,0x49,0x00,0xFF,0x46,0x00,0xFF,0x43,0x00,0xFF,0x40,0x00,0xFF,0x3D,0x00,0xFF,0x3A,0x00,0xFF,0x37,0x00,0xFF,0x35,0x00,0xFF,0x32,0x00,0xFF,0x2F,0x00,0xFF,0x2C,0x00,0xFF,0x2A,0x00,0xFF,0x27,0x00,0xFF,0x25,0x00,0xFF,0x22,0x00,0xFF,0x20,0x00,0xFF,0x1D,0x00,0xFF,0x1B,0x00,0xFF,0x18,0x00,0xFF,0x16,0x00,0xFF,0x14,0x00,0xFF,0x12,0x00,0xFF,0x10,0x00,0xFF,0x0E,0x00,0xFF,0x0C,0x00,0xFF,0x0A,0x00,0xFF,0x08,0x00,0xFF,0x06,0x00,0xFF,0x05,0x00,0xFF,0x03,0x00,0xFF,0x02,0x00,0xFF,0x00,0x00,0xFF,0x00,0x01,0xFF,0x00,0x02,0xFF,0x00,0x04,0xFF,0x00,0x05,0xFF,0x00,0x07,0xFF,0x00,0x08,0xFF,0x00,0x0A,0xFF,0x00,0x0C,0xFF,0x00,0x0E,0xFF,0x00,0x10,0xFF,0x00,0x12,0xFF,0x00,0x14,0xFF,0x00,0x16,0xFF,0x00,0x19,0xFF,0x00,0x1B,0xFF,0x00,0x1D,0xFF,0x00,0x20,0xFF,0x00,0x22,0xFF,0x00,0x25,0xFF,0x00,0x28,0xFF,0x00,0x2A,0xFF,0x00,0x2D,0xFF,0x00,0x30,0xFF,0x00,0x32,0xFF,0x00,0x35,0xFF,0x00,0x38,0xFF,0x00,0x3B,0xFF,0x00,0x3D,0xFF,0x00,0x40,0xFF,0x00,0x43,0xFF,0x00,0x46,0xFF,0x00,0x49,0xFF,0x00,0x4C,0xFF,0x00,0x4F,0xFF,0x00,0x52,0xFF,0x00,0x55,0xFF,0x00,0x57,0xFF,0x00,0x5A,0xFF,0x00,0x5D,0xFF,0x00,0x60,0xFF,0x00,0x63,0xFF,0x00,0x66,0xFF,0x00,0x69,0xFF,0x00,0x6B,0xFF,0x00,0x6E,0xFF,0x00,0x71,0xFF,0x00,0x74,0xFF,0x00,0x76,0xFF,0x00,0x79,0xFF,0x00,0x7B,0xFF,0x00,0x7E,0xFF,0x00,0x80,0xFF,0x00,0x83,0xFF,0x00,0x86,0xFF,0x00,0x88,0xFF,0x00,0x8B,0xFF,0x00,0x8E,0xFF,0x00,0x90,0xFF,0x00,0x93,0xFF,0x00,0x96,0xFF,0x00,0x99,0xFF,0x00,0x9B,0xFF,0x00,0x9E,0xFF,0x00,0xA1,0xFF,0x00,0xA4,0xFF,0x00,0xA7,0xFF,0x00,0xAA,0xFF,0x00,0xAD,0xFF,0x00,0xB0,0xFF,0x00,0xB2,0xFF,0x00,0xB5,0xFF,0x00,0x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,0x98,0x00,0xFF,0x95,0x00,0xFF,0x92,0x00,0xFF,0x8F,0x00,0xFF,0x8C,0x00,0xFF,0x8A,0x00,0xFF,0x87,0x00,0xFF,0x85,0x00,0xFF,0x82,0x00,0xFF,0x80,0x00,0xFF,0x7D,0x00,0xFF,0x7A,0x00,0xFF,0x78,0x00,0xFF,0x75,0x00,0xFF,0x73,0x00,0xFF,0x70,0x00,0xFF,0x6D,0x00,0xFF,0x6A,0x00,0xFF,0x67,0x00,0xFF,0x65,0x00,0xFF,0x62,0x00,0xFF,0x5F,0x00,0xFF,0x5C,0x00,0xFF,0x59,0x00,0xFF,0x56,0x00,0xFF,0x53,0x00,0xFF,0x51,0x00,0xFF,0x4E,0x00,0xFF,0x4B,0x00,0xFF,0x48,0x00,0xFF,0x45,0x00,0xFF,0x42,0x00,0xFF,0x3F,0x00,0xFF,0x3C,0x00,0xFF,0x3A,0x00,0xFF,0x37,0x00,0xFF,0x34,0x00,0xFF,0x31,0x00,0xFF,0x2E,0x00,0xFF,0x2C,0x00,0xFF,0x29,0x00,0xFF,0x27,0x00,0xFF,0x24,0x00,0xFF,0x21,0x00,0xFF,0x1F,0x00,0xFF,0x1D,0x00,0xFF,0x1A,0x00,0xFF,0x18,0x00,0xFF,0x16,0x00,0xFF,0x13,0x00,0xFF,0x11,0x00,0xFF,0x0F,0x00,0xFF,0x0D,0x00,0xFF,0x0B,0x00,0xFF,0x0A,0x00,0xFF,0x08,0x00,0xFF,0x06,0x00,0xFF,0x05,0x00,0xFF,0x03,0x00,0xFF,0x02,0x00,0xFF,0x00,0x01,0xFF,0x00,0x02,0xFF,0x00,0x04,0xFF,0x00,0x05,0xFF,0x00,0x07,0xFF,0x00,0x09,0xFF,0x00,0x0A,0xFF,0x00,0x0C,0xFF,0x00,0x0E,0xFF,0x00,0x10,0xFF,0x00,0x12,0xFF,0x00,0x15,0xFF,0x00,0x17,0xFF,0x00,0x19,0xFF,0x00,0x1B,0xFF,0x00,0x1E,0xFF,0x00,0x20,0xFF,0x00,0x23,0xFF,0x00,0x25,0xFF,0x00,0x28,0xFF,0x00,0x2A,0xFF,0x00,0x2D,0xFF,0x00,0x30,0xFF,0x00,0x33,0xFF,0x00,0x35,0xFF,0x00,0x38,0xFF,0x00,0x3B,0xFF,0x00,0x3E,0xFF,0x00,0x41,0xFF,0x00,0x44,0xFF,0x00,0x46,0xFF,0x00,0x49,0xFF,0x00,0x4C,0xFF,0x00,0x4F,0xFF,0x00,0x52,0xFF,0x00,0x55,0xFF,0x00,0x58,0xFF,0x00,0x5B,0xFF,0x00,0x5E,0xFF,0x00,0x61,0xFF,0x00,0x63,0xFF,0x00,0x66,0xFF,0x00,0x69,0xFF,0x00,0x6C,0xFF,0x00,0x6F,0xFF,0x00,0x71,0xFF,0x00,0x74,0xFF,0x00,0x77,0xFF,0x00,0x79,0xFF,0x00,0x7C,0xFF,0x00,0x7F,0xFF,0x00,0x81,0xFF,0x00,0x84,0xFF,0x00,0x86,0xFF,0x00,0x89,0xFF,0x00,0x8B,0xFF,0x00,0x8E,0xFF,0x00,0x91,0xFF,0x00,0x94,0xFF,0x00,0x96,0xFF,0x00,0x99,0xFF,0x00,0x9C,0xFF,0x00,0x9F,0xFF,0x00,0xA2,0xFF,0x00,0xA5,0xFF,0x00,0xA8,0xFF,0x00,0xAA,0xFF,0x00,0xAD,0xFF,0x00,0xB0,0xFF,0x00,0xB3,0xFF,0x00,0xB6,0xFF,0x00,0xB9,0xFF,0x00,0xBC,0xFF,0x00,0xBF,0xFF,0x00,0xC2,0xFF,0x00,0xC4,0xFF,0x00,0xC7,0xFF,0x00,0xCA,0xFF,0x00,0xCD,0xFF,0x00,0xCF,0xFF,0x00,0xD2,0xFF,0x00,0xD5,0xFF,0x00,0xD7,0xFF,0x00,0xDA,0xFF,0x00,0xDD,0xFF,0x00,0xDF,0xFF,0x00,0xE2,0xFF,0x00,0xE4,0xFF,0x00,0xE6,0xFF,0x00,0xE9,0xFF,0x00,0xEB,0xFF,0x00,0xED,0xFF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x00,0xFF,0x5B,0x00,0xFF,0x58,0x00,0xFF,0x56,0x00,0xFF,0x53,0x00,0xFF,0x50,0x00,0xFF,0x4D,0x00,0xFF,0x4A,0x00,0xFF,0x47,0x00,0xFF,0x44,0x00,0xFF,0x41,0x00,0xFF,0x3E,0x00,0xFF,0x3C,0x00,0xFF,0x39,0x00,0xFF,0x36,0x00,0xFF,0x33,0x00,0xFF,0x31,0x00,0xFF,0x2E,0x00,0xFF,0x2B,0x00,0xFF,0x29,0x00,0xFF,0x26,0x00,0xFF,0x23,0x00,0xFF,0x21,0x00,0xFF,0x1E,0x00,0xFF,0x1C,0x00,0xFF,0x1A,0x00,0xFF,0x17,0x00,0xFF,0x15,0x00,0xFF,0x13,0x00,0xFF,0x11,0x00,0xFF,0x0F,0x00,0xFF,0x0D,0x00,0xFF,0x0B,0x00,0xFF,0x09,0x00,0xFF,0x07,0x00,0xFF,0x06,0x00,0xFF,0x04,0x00,0xFF,0x03,0x00,0xFF,0x01,0x00}; +//Scaled Hue Scale +static char color_data[] = {0x2B,0x00,0xFF,0x2B,0x00,0xFF,0x28,0x04,0xFF,0x24,0x08,0xFF,0x20,0x0D,0xFF,0x1C,0x12,0xFF,0x17,0x18,0xFF,0x12,0x1E,0xFF,0x0D,0x25,0xFF,0x07,0x2D,0xFF,0x03,0x35,0xFF,0x01,0x3E,0xFF,0x00,0x42,0xFF,0x00,0x44,0xFF,0x00,0x48,0xFF,0x00,0x4A,0xFF,0x00,0x4D,0xFF,0x00,0x51,0xFF,0x00,0x54,0xFF,0x00,0x58,0xFF,0x00,0x5C,0xFF,0x00,0x5E,0xFF,0x00,0x62,0xFF,0x00,0x66,0xFF,0x00,0x6A,0xFF,0x00,0x6D,0xFF,0x00,0x71,0xFF,0x00,0x75,0xFF,0x00,0x79,0xFF,0x00,0x7C,0xFF,0x00,0x7F,0xFF,0x00,0x83,0xFF,0x00,0x87,0xFF,0x00,0x8B,0xFF,0x00,0x8F,0xFF,0x00,0x92,0xFF,0x00,0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xB9,0x00,0xFF,0xB5,0x00,0xFF,0xB3,0x00,0xFF,0xB1,0x00,0xFF,0xAF,0x00,0xFF,0xAC,0x00,0xFF,0xAA,0x00,0xFF,0xA8,0x00,0xFF,0xA5,0x00,0xFF,0xA3,0x00,0xFF,0xA1,0x00,0xFF,0x9F,0x00,0xFF,0x9C,0x00,0xFF,0x99,0x00,0xFF,0x97,0x00,0xFF,0x95,0x00,0xFF,0x93,0x00,0xFF,0x90,0x00,0xFF,0x8F,0x00,0xFF,0x8C,0x00,0xFF,0x8A,0x00,0xFF,0x88,0x00,0xFF,0x86,0x00,0xFF,0x83,0x00,0xFF,0x81,0x00,0xFF,0x7F,0x00,0xFF,0x7D,0x00,0xFF,0x7C,0x00,0xFF,0x7A,0x00,0xFF,0x78,0x00,0xFF,0x76,0x00,0xFF,0x74,0x00,0xFF,0x72,0x00,0xFF,0x71,0x00,0xFF,0x6F,0x00,0xFF,0x6D,0x00,0xFF,0x6A,0x00,0xFF,0x69,0x00,0xFF,0x67,0x00,0xFF,0x65,0x00,0xFF,0x64,0x00,0xFF,0x61,0x00,0xFF,0x5F,0x00,0xFF,0x5D,0x00,0xFF,0x5B,0x00,0xFF,0x5A,0x00,0xFF,0x57,0x00,0xFF,0x56,0x00,0xFF,0x54,0x00,0xFF,0x51,0x00,0xFF,0x4F,0x00,0xFF,0x4E,0x00,0xFF,0x4C,0x00,0xFF,0x4A,0x00,0xFF,0x48,0x00,0xFF,0x46,0x00,0xFF,0x45,0x00,0xFF,0x43,0x00,0xFF,0x40,0x00,0xFF,0x3F,0x00,0xFF,0x3C,0x00,0xFF,0x3B,0x00,0xFF,0x39,0x00,0xFF,0x37,0x00,0xFF,0x35,0x00,0xFF,0x33,0x00,0xFF,0x32,0x00,0xFF,0x30,0x00,0xFF,0x2F,0x00,0xFF,0x2D,0x00,0xFF,0x2B,0x00,0xFF,0x2A,0x00,0xFF,0x28,0x00,0xFF,0x27,0x00,0xFF,0x25,0x00,0xFF,0x23,0x00,0xFF,0x22,0x00,0xFF,0x21,0x00,0xFF,0x1F,0x00,0xFF,0x1E,0x00,0xFF,0x1C,0x00,0xFF,0x1B,0x00,0xFF,0x1A,0x00,0xFF,0x19,0x00,0xFF,0x18,0x00,0xFF,0x16,0x00,0xFF,0x16,0x01,0xFF,0x15,0x02,0xFF,0x14,0x02,0xFF,0x12,0x02,0xFF,0x12,0x03,0xFF,0x12,0x04,0xFF,0x10,0x05,0xFF,0x10,0x06,0xFF,0x0F,0x06,0xFF,0x0F,0x07,0xFF,0x0D,0x08,0xFF,0x0D,0x09,0xFF,0x0C,0x0A,0xFF,0x0C,0x0B,0xFF,0x0C,0x0C,0xFF,0x0B,0x0C,0xFF,0x0B,0x0E,0xFF,0x0A,0x0F,0xFF,0x09,0x10,0xFF,0x09,0x11,0xFF,0x08,0x12,0xFF,0x08,0x13,0xFF,0x08,0x14,0xFF,0x07,0x15,0xFF,0x07,0x16,0xFF,0x06,0x18,0xFF,0x06,0x19,0xFF,0x06,0x1A,0xFF,0x06,0x1C,0xFF,0x06,0x1D,0xFF,0x06,0x1E,0xFF,0x05,0x1F,0xFF,0x05,0x20,0xFF,0x05,0x21,0xFF,0x05,0x23,0xFF,0x04,0x24,0xFF,0x04,0x25,0xFF,0x04,0x26,0xFF,0x04,0x28,0xFF,0x03,0x29,0xFF,0x03,0x2B,0xFF,0x03,0x2B,0xFF,0x03,0x2D,0xFF,0x03,0x2E,0xFF,0x03,0x30,0xFF,0x03,0x31,0xFF,0x02,0x32,0xFF,0x03,0x34,0xFF,0x03,0x35,0xFF,0x02,0x37,0xFF,0x03,0x39,0xFF,0x02,0x3A,0xFF,0x02,0x3B,0xFF,0x01,0x3C,0xFF,0x01,0x3E,0xFF,0x01,0x3F,0xFF,0x01,0x40,0xFF,0x02,0x42,0xFF,0x02,0x44,0xFF,0x01,0x45,0xFF,0x01,0x46,0xFF,0x01,0x48,0xFF,0x01,0x49,0xFF,0x01,0x4A,0xFF,0x01,0x4C,0xFF,0x00,0x4E,0xFF,0x01,0x4E,0xFF,0x00,0x50,0xFF,0x01,0x52,0xFF,0x01,0x52,0xFF,0x00,0x54,0xFF,0x00,0x55,0xFF,0x00,0x56,0xFF,0x00,0x58,0xFF,0x00,0x58,0xFF,0x00,0x59,0xFF,0x00,0x5A,0xFF,0x00,0x5B,0xFF,0x00,0x5C,0xFF,0x00,0x5D,0xFF,0x00,0x5E,0xFF,0x00,0x5F,0xFF,0x00,0x60,0xFF,0x00,0x61,0xFF,0x00,0x62,0xFF,0x00,0x63,0xFF,0x00,0x64,0xFF,0x00,0x65,0xFF,0x00,0x66,0xFF,0x00,0x67,0xFF,0x00,0x69,0xFF,0x00,0x6A,0xFF,0x00,0x6A,0xFF,0x00,0x6B,0xFF,0x00,0x6C,0xFF,0x00,0x6E,0xFF,0x00,0x6F,0xFF,0x00,0x70,0xFF,0x00,0x71,0xFF,0x00,0x72,0xFF,0x00,0x73,0xFF,0x00,0x74,0xFF,0x00,0x75,0xFF,0x00,0x76,0xFF,0x00,0x77,0xFF,0x00,0x79,0xFF,0x00,0x7A,0xFF,0x00,0x7B,0xFF,0x00,0x7B,0xFF,0x00,0x7D,0xFF,0x00,0x7E,0xFF,0x00,0x7F,0xFF,0x00,0x80,0xFF,0x00,0x82,0xFF,0x00,0x83,0xFF,0x00,0x83,0xFF,0x00,0x84,0xFF,0x00,0x86,0xFF,0x00,0x87,0xFF,0x00,0x88,0xFF,0x00,0x89,0xFF,0x00,0x8A,0xFF,0x00,0x8C,0xFF,0x00,0x8D,0xFF,0x00,0x8E,0xFF,0x00,0x8F,0xFF,0x00,0x90,0xFF,0x00,0x92,0xFF,0x00,0x93,0xFF,0x00,0x93,0xFF,0x00,0x94,0xFF,0x00,0x96,0xFF,0x00,0x97,0xFF,0x00,0x98,0xFF,0x00,0x99,0xFF,0x00,0x9A,0xFF,0x00,0x9B,0xFF,0x00,0x9C,0xFF,0x00,0x9E,0xFF,0x00,0x9E,0xFF,0x00,0x9F,0xFF,0x00,0xA0,0xFF,0x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8B,0x00,0xFF,0x8A,0x00,0xFF,0x89,0x00,0xFF,0x89,0x00,0xFF,0x88,0x00,0xFF,0x87,0x00,0xFF,0x86,0x00,0xFF,0x84,0x00,0xFF,0x84,0x00,0xFF,0x82,0x00,0xFF,0x82,0x00,0xFF,0x81,0x00,0xFF,0x80,0x00,0xFF,0x7F,0x00,0xFF,0x7E,0x00,0xFF,0x7D,0x00,0xFF,0x7C,0x00,0xFF,0x7B,0x00,0xFF,0x7B,0x00,0xFF,0x7A,0x00,0xFF,0x78,0x00,0xFF,0x78,0x00,0xFF,0x77,0x00,0xFF,0x76,0x00,0xFF,0x74,0x00,0xFF,0x74,0x00,0xFF,0x73,0x00,0xFF,0x72,0x00,0xFF,0x71,0x00,0xFF,0x70,0x00,0xFF,0x70,0x00,0xFF,0x6E,0x00,0xFF,0x6D,0x00,0xFF,0x6C,0x00,0xFF,0x6C,0x00,0xFF,0x6B,0x00,0xFF,0x6A,0x00,0xFF,0x6A,0x00,0xFF,0x68,0x00,0xFF,0x67,0x00,0xFF,0x66,0x00,0xFF,0x66,0x00,0xFF,0x65,0x00,0xFF,0x64,0x00,0xFF,0x64,0x00,0xFF,0x62,0x00,0xFF,0x62,0x00,0xFF,0x61,0x00,0xFF,0x60,0x00,0xFF,0x5F,0x00,0xFF,0x5E,0x00,0xFF,0x5D,0x00,0xFF,0x5D,0x00,0xFF,0x5C,0x00,0xFF,0x5A,0x00,0xFF,0x5A,0x00,0xFF,0x59,0x00,0xFF,0x58,0x00,0xFF,0x57,0x00,0xFF,0x56,0x00,0xFF,0x55,0x00,0xFF,0x54,0x00,0xFF,0x54,0x00,0xFF,0x53,0x00,0xFF,0x52,0x00,0xFF,0x51,0x00,0xFF,0x50,0x00,0xFF,0x4F,0x00,0xFF,0x4E,0x00,0xFF,0x4D,0x00,0xFF,0x4D,0x00,0xFF,0x4C,0x00,0xFF,0x4A,0x00,0xFF,0x4A,0x00,0xFF,0x48,0x00,0xFF,0x47,0x00,0xFF,0x47,0x00,0xFF,0x45,0x00,0xFF,0x45,0x00,0xFF,0x44,0x00,0xFF,0x43,0x00,0xFF,0x43,0x00,0xFF,0x41,0x00,0xFF,0x40,0x00,0xFF,0x40,0x00,0xFF,0x3F,0x00,0xFF,0x3E,0x00,0xFF,0x3C,0x00,0xFF,0x3C,0x00,0xFF,0x3B,0x00,0xFF,0x3A,0x00,0xFF,0x38,0x00,0xFF,0x38,0x00,0xFF,0x37,0x00,0xFF,0x36,0x00,0xFF,0x35,0x00,0xFF,0x34,0x00,0xFF,0x34,0x00,0xFF,0x33,0x00,0xFF,0x31,0x00,0xFF,0x31,0x00,0xFF,0x2F,0x00,0xFF,0x2F,0x00,0xFF,0x2E,0x00,0xFF,0x2C,0x00,0xFF,0x2C,0x00,0xFF,0x2B,0x00,0xFF,0x2A,0x00,0xFF,0x29,0x00,0xFF,0x28,0x00,0xFF,0x27,0x00,0xFF,0x26,0x00,0xFF,0x26,0x00,0xFF,0x25,0x00,0xFF,0x25,0x00,0xFF,0x23,0x00,0xFF,0x23,0x00,0xFF,0x22,0x00,0xFF,0x21,0x00,0xFF,0x20,0x00,0xFF,0x1F,0x00,0xFF,0x1E,0x00,0xFF,0x1D,0x00,0xFF,0x1D,0x00,0xFF,0x1C,0x00,0xFF,0x1B,0x00,0xFF,0x1A,0x00,0xFF,0x19,0x00,0xFF,0x19,0x00,0xFF,0x18,0x00,0xFF,0x17,0x00,0xFF,0x16,0x00,0xFF,0x15,0x00,0xFF,0x15,0x00,0xFF,0x14,0x00,0xFF,0x14,0x00,0xFF,0x12,0x00,0xFF,0x12,0x00,0xFF,0x12,0x00,0xFF,0x10,0x00,0xFF,0x10,0x00,0xFF,0x0F,0x00,0xFF,0x0E,0x00,0xFF,0x0E,0x00,0xFF,0x0D,0x00,0xFF,0x0C,0x00,0xFF,0x0B,0x00,0xFF,0x0B,0x00,0xFF,0x0B,0x00,0xFF,0x0A,0x00,0xFF,0x09,0x00,0xFF,0x09,0x00,0xFF,0x08,0x00,0xFF,0x07,0x00,0xFF,0x07,0x00,0xFF,0x06,0x00,0xFF,0x06,0x00,0xFF,0x05,0x00,0xFF,0x04,0x00,0xFF,0x04,0x00,0xFF,0x04,0x00,0xFF,0x04,0x00,0xFF,0x03,0x00,0xFF,0x03,0x00,0xFF,0x02,0x00,0xFF,0x01,0x00,0xFF,0x01,0x00,0xFF,0x01,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x01,0xFF,0x00,0x01,0xFF,0x00,0x02,0xFF,0x00,0x01,0xFF,0x00,0x02,0xFF,0x00,0x03,0xFF,0x00,0x03,0xFF,0x00,0x03,0xFF,0x00,0x04,0xFF,0x00,0x05,0xFF,0x00,0x05,0xFF,0x00,0x05,0xFF,0x00,0x06,0xFF,0x00,0x07,0xFF,0x00,0x06,0xFF,0x00,0x07,0xFF,0x00,0x08,0xFF,0x00,0x09,0xFF,0x00,0x09,0xFF,0x00,0x09,0xFF,0x00,0x0B,0xFF,0x00,0x0B,0xFF,0x00,0x0C,0xFF,0x00,0x0B,0xFF,0x00,0x0C,0xFF,0x00,0x0E,0xFF,0x00,0x0D,0xFF,0x00,0x0E,0xFF,0x00,0x0F,0xFF,0x00,0x0F,0xFF,0x00,0x10,0xFF,0x00,0x11,0xFF,0x00,0x11,0xFF,0x00,0x12,0xFF,0x00,0x13,0xFF,0x00,0x14,0xFF,0x00,0x14,0xFF,0x00,0x15,0xFF,0x00,0x16,0xFF,0x00,0x16,0xFF,0x00,0x17,0xFF,0x00,0x17,0xFF,0x00,0x18,0xFF,0x00,0x19,0xFF,0x00,0x1A,0xFF,0x00,0x1A,0xFF,0x00,0x1B,0xFF,0x00,0x1C,0xFF,0x00,0x1D,0xFF,0x00,0x1E,0xFF,0x00,0x1E,0xFF,0x00,0x1F,0xFF,0x00,0x20,0xFF,0x00,0x21,0xFF,0x00,0x22,0xFF,0x00,0x22,0xFF,0x00,0x22,0xFF,0x00,0x24,0xFF,0x00,0x25,0xFF,0x00,0x26,0xFF,0x00,0x26,0xFF,0x00,0x27,0xFF,0x00,0x27,0xFF,0x00,0x28,0xFF,0x00,0x2A,0xFF,0x00,0x2A,0xFF,0x00,0x2B,0xFF,0x00,0x2C,0xFF,0x00,0x2C,0xFF,0x00,0x2E,0xFF,0x00,0x2E,0xFF,0x00,0x2F,0xFF,0x00,0x30,0xFF,0x00,0x31,0xFF,0x00,0x31,0xFF,0x00,0x32,0xFF,0x00,0x33,0xFF,0x00,0x34,0xFF,0x00,0x35,0xFF,0x00,0x36,0xFF,0x00,0x37,0xFF,0x00,0x37,0xFF,0x00,0x39,0xFF,0x00,0x3A,0xFF,0x00,0x3A,0xFF,0x00,0x3B,0xFF,0x00,0x3C,0xFF,0x00,0x3D,0xFF,0x00,0x3E,0xFF,0x00,0x3E,0xFF,0x00,0x3F,0xFF,0x00,0x40,0xFF,0x00,0x41,0xFF,0x00,0x42,0xFF,0x00,0x43,0xFF,0x00,0x43,0xFF,0x00,0x45,0xFF,0x00,0x46,0xFF,0x00,0x46,0xFF,0x00,0x47,0xFF,0x00,0x48,0xFF,0x00,0x49,0xFF,0x00,0x4A,0xFF,0x00,0x4B,0xFF,0x00,0x4C,0xFF,0x00,0x4C,0xFF,0x00,0x4D,0xFF,0x00,0x4E,0xFF,0x00,0x4F,0xFF,0x00,0x50,0xFF,0x00,0x51,0xFF,0x00,0x51,0xFF,0x00,0x52,0xFF,0x00,0x53,0xFF,0x00,0x54,0xFF,0x00,0x54,0xFF,0x00,0x56,0xFF,0x00,0x56,0xFF,0x00,0x57,0xFF,0x00,0x59,0xFF,0x00,0x59,0xFF,0x00,0x5A,0xFF,0x00,0x5A,0xFF,0x00,0x5C,0xFF,0x00,0x5D,0xFF,0x00,0x5D,0xFF,0x00,0x5E,0xFF,0x00,0x5F,0xFF,0x00,0x60,0xFF,0x00,0x61,0xFF,0x00,0x61,0xFF,0x00,0x62,0xFF,0x00,0x63,0xFF,0x00,0x64,0xFF,0x00,0x64,0xFF,0x00,0x65,0xFF,0x00,0x66,0xFF,0x00,0x67,0xFF,0x00,0x67,0xFF,0x00,0x68,0xFF,0x00,0x69,0xFF,0x00,0x6A,0xFF,0x00,0x6B,0xFF,0x00,0x6B,0xFF,0x00,0x6C,0xFF,0x00,0x6C,0xFF,0x00,0x6D,0xFF,0x00,0x6E,0xFF,0x00,0x6F,0xFF,0x00,0x6F,0xFF,0x00,0x70,0xFF,0x00,0x71,0xFF,0x00,0x72,0xFF,0x00,0x72,0xFF,0x00,0x73,0xFF,0x00,0x74,0xFF,0x00,0x74,0xFF,0x00,0x75,0xFF,0x00,0x76,0xFF,0x00,0x77,0xFF,0x00,0x78,0xFF,0x00,0x78,0xFF,0x00,0x79,0xFF,0x00,0x7A,0xFF,0x00,0x7A,0xFF,0x00,0x7B,0xFF,0x00,0x7C,0xFF,0x00,0x7D,0xFF,0x00,0x7E,0xFF,0x00,0x7E,0xFF,0x00,0x80,0xFF,0x00,0x80,0xFF,0x00,0x81,0xFF,0x00,0x82,0xFF,0x00,0x82,0xFF,0x00,0x83,0xFF,0x00,0x84,0xFF,0x00,0x85,0xFF,0x00,0x85,0xFF,0x00,0x87,0xFF,0x00,0x87,0xFF,0x00,0x88,0xFF,0x00,0x89,0xFF,0x00,0x8A,0xFF,0x00,0x8A,0xFF,0x00,0x8B,0xFF,0x00,0x8C,0xFF,0x00,0x8D,0xFF,0x00,0x8E,0xFF,0x00,0x8F,0xFF,0x00,0x90,0xFF,0x00,0x90,0xFF,0x00,0x91,0xFF,0x00,0x92,0xFF,0x00,0x92,0xFF,0x00,0x94,0xFF,0x00,0x94,0xFF,0x00,0x95,0xFF,0x00,0x95,0xFF,0x00,0x97,0xFF,0x00,0x98,0xFF,0x00,0x98,0xFF,0x00,0x99,0xFF,0x00,0x9A,0xFF,0x00,0x9B,0xFF,0x00,0x9B,0xFF,0x00,0x9C,0xFF,0x00,0x9D,0xFF,0x00,0x9E,0xFF,0x00,0x9F,0xFF,0x00,0x9F,0xFF,0x00,0xA0,0xFF,0x00,0xA1,0xFF,0x00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xD1,0xFF,0x00,0xD1,0xFF,0x00,0xD2,0xFF,0x00,0xD2,0xFF,0x00,0xD3,0xFF,0x00,0xD3,0xFF,0x00,0xD4,0xFF,0x00,0xD3,0xFF,0x00,0xD4,0xFF,0x00,0xD4}; //1024 Pixels +static char plasma_data[] = {0x00,0x00,0x00,0x03,0x00,0x00,0x05,0x00,0x00,0x09,0x00,0x00,0x0E,0x00,0x00,0x12,0x00,0x00,0x17,0x00,0x00,0x1C,0x00,0x00,0x22,0x00,0x00,0x27,0x00,0x00,0x2C,0x00,0x00,0x32,0x00,0x00,0x37,0x00,0x00,0x3C,0x00,0x00,0x41,0x00,0x00,0x45,0x00,0x00,0x4A,0x00,0x00,0x4D,0x00,0x00,0x51,0x00,0x00,0x53,0x00,0x00,0x55,0x00,0x00,0x55,0x00,0x02,0x55,0x02,0x03,0x55,0x03,0x06,0x55,0x03,0x07,0x55,0x05,0x09,0x55,0x06,0x0C,0x55,0x06,0x0F,0x55,0x07,0x10,0x55,0x09,0x13,0x55,0x0A,0x16,0x55,0x0C,0x1A,0x55,0x0C,0x1D,0x54,0x0E,0x20,0x53,0x10,0x23,0x54,0x11,0x26,0x53,0x13,0x2A,0x52,0x14,0x2E,0x51,0x15,0x31,0x50,0x17,0x35,0x50,0x19,0x38,0x4E,0x1A,0x3D,0x4D,0x1C,0x40,0x4D,0x1D,0x44,0x4C,0x1F,0x47,0x4B,0x21,0x4C,0x4A,0x23,0x4F,0x49,0x24,0x54,0x48,0x25,0x57,0x47,0x28,0x5B,0x46,0x29,0x5F,0x45,0x2B,0x62,0x44,0x2D,0x66,0x44,0x2E,0x6A,0x43,0x30,0x6E,0x42,0x32,0x72,0x41,0x33,0x76,0x40,0x35,0x79,0x3F,0x38,0x7C,0x3F,0x39,0x7F,0x3E,0x3B,0x83,0x3D,0x3D,0x86,0x3C,0x3F,0x8A,0x3B,0x40,0x8C,0x3B,0x43,0x8F,0x3B,0x44,0x92,0x3A,0x46,0x95,0x39,0x48,0x98,0x39,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10,0x07,0x07,0x11,0x08,0x07,0x12,0x09,0x08,0x14,0x09,0x08,0x15,0x0A,0x09,0x17,0x0A,0x09,0x19,0x0B,0x0A,0x1A,0x0C,0x0A,0x1C,0x0D,0x0B,0x1D,0x0D,0x0B,0x1F,0x0D,0x0C,0x22,0x0F,0x0D,0x23,0x0F,0x0E,0x25,0x10,0x0E,0x26,0x11,0x0F,0x28,0x12,0x10,0x2A,0x13,0x10,0x2C,0x13,0x11,0x2E,0x14,0x12,0x2F,0x15,0x12,0x31,0x15,0x13,0x33,0x16,0x14,0x35,0x17,0x15,0x36,0x18,0x15,0x39,0x19,0x16,0x3B,0x19,0x17,0x3D,0x1B,0x17,0x3E,0x1B,0x18,0x40,0x1C,0x19,0x42,0x1D,0x1A,0x43,0x1D,0x1B,0x45,0x1E,0x1C,0x47,0x1F,0x1C,0x49,0x20,0x1D,0x4B,0x21,0x1F,0x4C,0x21,0x1F,0x4E,0x22,0x20,0x50,0x23,0x21,0x52,0x23,0x22,0x53,0x24,0x23,0x55,0x25,0x23,0x56,0x26,0x24,0x59,0x26,0x25,0x5A,0x27,0x26,0x5B,0x28,0x27,0x5D,0x28,0x28,0x5E,0x29,0x29,0x60,0x29,0x2A,0x62,0x2A,0x2B,0x63,0x2B,0x2C,0x64,0x2C,0x2E,0x65,0x2C,0x2E,0x66,0x2C,0x2F,0x68,0x2D,0x31,0x69,0x2E,0x32,0x6A,0x2F,0x32,0x6B,0x2F,0x34,0x6C,0x30,0x34,0x6D,0x30,0x35,0x6F,0x31,0x37,0x70,0x31,0x38,0x71,0x32,0x39,0x72,0x33,0x3B,0x73,0x33,0x3C,0x74,0x34,0x3D,0x75,0x35,0x3E,0x76,0x35,0x3F,0x78,0x36,0x41,0x78,0x36,0x42,0x79,0x36,0x43,0x7A,0x37,0x44,0x7B,0x37,0x46,0x7C,0x38,0x48,0x7D,0x39,0x48,0x7E,0x3A,0x49,0x7F,0x39,0x4B,0x80,0x3A,0x4C,0x81,0x3B,0x4E,0x82,0x3C,0x4F,0x83,0x3C,0x51,0x84,0x3C,0x52,0x84,0x3D,0x54,0x86,0x3E,0x55,0x87,0x3E,0x56,0x88,0x3F,0x57,0x89,0x40,0x59,0x8A,0x40,0x5A,0x8A,0x41,0x5C,0x8B,0x41,0x5D,0x8C,0x42,0x5F,0x8D,0x41,0x60,0x8E,0x42,0x62,0x8E,0x42,0x62,0x8F,0x44,0x65,0x90,0x43,0x65,0x91,0x45,0x67,0x91,0x44,0x69,0x92,0x45,0x6A,0x93,0x46,0x6B,0x94,0x46,0x6C,0x94,0x46,0x6E,0x96,0x47,0x70,0x96,0x48,0x70,0x97,0x48,0x72,0x98,0x48,0x73,0x99,0x49,0x74,0x99,0x49,0x76,0x9A,0x4A,0x77,0x9A,0x4B,0x78,0x9B,0x4B,0x7A,0x9C,0x4B,0x7B,0x9D,0x4B,0x7C,0x9E,0x4C,0x7D,0x9F,0x4C,0x7E,0x9F,0x4D,0x7F,0xA0,0x4E,0x80,0xA0,0x4E,0x82,0xA1,0x4E,0x83,0xA2,0x4F,0x84,0xA3,0x4F,0x85,0xA3,0x4F,0x86,0xA4,0x4F,0x88,0xA5,0x50,0x89,0xA5,0x50,0x89,0xA6,0x51,0x8B,0xA6,0x51,0x8B,0xA7,0x51,0x8D,0xA8,0x51,0x8E,0xA9,0x52,0x8F,0xAA,0x52,0x90,0xAA,0x53,0x92,0xAB,0x53,0x92,0xAB,0x53,0x93,0xAC,0x54,0x95,0xAD,0x53,0x95,0xAE,0x54,0x96,0xAE,0x55,0x98,0xAE,0x54,0x98,0xAF,0x55,0x9A,0xB0,0x56,0x9B,0xB0,0x56,0x9C,0xB1,0x56,0x9D,0xB1,0x56,0x9E,0xB2,0x56,0xA0,0xB3,0x57,0xA0,0xB3,0x57,0xA1,0xB3,0x57,0xA2,0xB4,0x58,0xA3,0xB4,0x58,0xA4,0xB5,0x57,0xA5,0xB6,0x58,0xA6,0xB6,0x58,0xA7,0xB7,0x58,0xA8,0xB7,0x59,0xA9,0xB8,0x58,0xAA,0xB9,0x5A,0xAB,0xB9,0x59,0xAC,0xBA,0x5A,0xAD,0xBA,0x5A,0xAE,0xBB,0x5A,0xAF,0xBB,0x5A,0xB0,0xBC,0x5B,0xB0,0xBC,0x5A,0xB1,0xBD,0x5B,0xB2,0xBD,0x5B,0xB3,0xBD,0x5B,0xB4,0xBE,0x5C,0xB5,0xBE,0x5B,0xB5,0xBE,0x5B,0xB7,0xBF,0x5C,0xB7,0xBF,0x5C,0xB8,0xBF,0x5C,0xB9,0xC0,0x5C,0xB9,0xC0,0x5C,0xBA,0xC0,0x5C,0xBA,0xC1,0x5D,0xBB,0xC2,0x5D,0xBC,0xC2,0x5D,0xBC,0xC2,0x5D,0xBD,0xC2,0x5E,0xBE,0xC3,0x5E,0xBE,0xC3,0x5E,0xBF,0xC3,0x5E,0xC0,0xC3,0x5E,0xC0,0xC4,0x5E,0xC1,0xC4,}; //200 Pixels +static char flm_data[] = {0x00,0x00,0x00,0x00,0x01,0x00,0x02,0x01,0x01,0x02,0x02,0x01,0x03,0x02,0x01,0x04,0x02,0x01,0x05,0x03,0x02,0x06,0x04,0x02,0x07,0x05,0x03,0x07,0x05,0x03,0x09,0x06,0x04,0x0A,0x06,0x05,0x0B,0x07,0x05,0x0C,0x08,0x06,0x0E,0x08,0x06,0x0E,0x09,0x07,0x0F,0x0A,0x07,0x11,0x0B,0x08,0x12,0x0C,0x09,0x13,0x0C,0x09,0x14,0x0D,0x09,0x16,0x0D,0x0A,0x18,0x0E,0x0B,0x19,0x10,0x0C,0x1B,0x11,0x0C,0x1C,0x11,0x0D,0x1D,0x12,0x0D,0x1F,0x13,0x0E,0x20,0x14,0x0E,0x22,0x15,0x0F,0x23,0x15,0x10,0x25,0x16,0x10,0x26,0x17,0x11,0x28,0x19,0x12,0x29,0x19,0x13,0x2B,0x1A,0x14,0x2C,0x1B,0x14,0x2E,0x1C,0x15,0x30,0x1D,0x16,0x31,0x1F,0x17,0x33,0x1F,0x17,0x35,0x21,0x18,0x36,0x22,0x19,0x38,0x22,0x19,0x39,0x24,0x1A,0x3B,0x25,0x1B,0x3D,0x26,0x1B,0x3F,0x27,0x1D,0x40,0x27,0x1D,0x42,0x29,0x1E,0x44,0x2A,0x1F,0x46,0x2C,0x1F,0x47,0x2D,0x20,0x49,0x2D,0x21,0x4B,0x2F,0x22,0x4C,0x30,0x23,0x4E,0x30,0x23,0x50,0x31,0x24,0x52,0x33,0x25,0x53,0x34,0x26,0x55,0x35,0x27,0x57,0x36,0x27,0x58,0x37,0x28,0x5A,0x38,0x29,0x5C,0x3A,0x2A,0x5D,0x3A,0x2A,0x5F,0x3C,0x2B,0x61,0x3D,0x2C,0x63,0x3E,0x2C,0x64,0x3F,0x2D,0x65,0x41,0x2F,0x67,0x41,0x2F,0x69,0x43,0x30,0x6A,0x43,0x30,0x6C,0x45,0x31,0x6E,0x46,0x32,0x6F,0x47,0x33,0x71,0x48,0x33,0x72,0x49,0x34,0x74,0x4A,0x35,0x76,0x4C,0x35,0x77,0x4D,0x36,0x79,0x4E,0x36,0x7A,0x4E,0x37,0x7B,0x50,0x39,0x7D,0x51,0x39,0x7E,0x51,0x39,0x7F,0x53,0x3A,0x80,0x54,0x3A,0x82,0x55,0x3B,0x83,0x56,0x3C,0x84,0x57,0x3C,0x85,0x58,0x3D,0x87,0x5A,0x3D,0x88,0x5B,0x3E,0x89,0x5B,0x3F,0x8A,0x5C,0x3F,0x8B,0x5E,0x3F,0x8C,0x5F,0x40,0x8D,0x5F,0x41,0x8E,0x60,0x41,0x90,0x61,0x41,0x90,0x63,0x42,0x92,0x63,0x43,0x92,0x64,0x43,0x93,0x65,0x43,0x94,0x66,0x44,0x95,0x67,0x45,0x96,0x68,0x44,0x97,0x69,0x45,0x97,0x6B,0x45,0x99,0x6B,0x46,0x99,0x6D,0x47,0x9A,0x6D,0x47,0x9B,0x6F,0x48,0x9C,0x70,0x48,0x9D,0x71,0x48,0x9D,0x72,0x48,0x9F,0x73,0x48,0x9E,0x74,0x4A,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2,0xBD,0x5D,0xC3,0xBD,0x5D,0xC3,0xBE,0x5D,0xC3,0xBF,0x5E,0xC3,0xC0,0x5E,0xC3,0xC0,0x5E,0xC4,0xC0,0x5E,0xC4,0xC1,0x5E}; //200 Pixels +static char firw_data[] = {0xFF,0x00,0xFF,0xFF,0x00,0xFF,0xFC,0x00,0xFF,0xF8,0x00,0xFF,0xF3,0x00,0xFF,0xEE,0x00,0xFF,0xE9,0x00,0xFF,0xE4,0x00,0xFF,0xDD,0x00,0xFF,0xD8,0x00,0xFF,0xD2,0x00,0xFF,0xCB,0x00,0xFF,0xC4,0x00,0xFF,0xBD,0x00,0xFF,0xB5,0x00,0xFF,0xAD,0x00,0xFF,0xA6,0x00,0xFF,0x9E,0x00,0xFF,0x96,0x00,0xFF,0x8E,0x00,0xFF,0x87,0x00,0xFF,0x7E,0x00,0xFF,0x77,0x00,0xFF,0x6E,0x00,0xFF,0x66,0x00,0xFF,0x5E,0x00,0xFF,0x56,0x00,0xFF,0x4F,0x00,0xFF,0x47,0x00,0xFF,0x40,0x00,0xFF,0x39,0x00,0xFF,0x32,0x00,0xFF,0x2B,0x00,0xFF,0x25,0x00,0xFF,0x1E,0x00,0xFF,0x19,0x00,0xFF,0x14,0x00,0xFF,0x0F,0x00,0xFF,0x0A,0x00,0xFF,0x06,0x00,0xFF,0x01,0x00,0xFF,0x00,0x01,0xFF,0x00,0x05,0xFF,0x00,0x09,0xFF,0x00,0x0E,0xFF,0x00,0x13,0xFF,0x00,0x18,0xFF,0x00,0x1E,0xFF,0x00,0x24,0xFF,0x00,0x2A,0xFF,0x00,0x30,0xFF,0x00,0x37,0xFF,0x00,0x3E,0xFF,0x00,0x45,0xFF,0x00,0x4D,0xFF,0x00,0x55,0xFF,0x00,0x5C,0xFF,0x00,0x64,0xFF,0x00,0x6C,0xFF,0x00,0x74,0xFF,0x00,0x7C,0xFF,0x00,0x84,0xFF,0x00,0x8D,0xFF,0x00,0x95,0xFF,0x00,0x9D,0xFF,0x00,0xA4,0xFF,0x00,0xAC,0xFF,0x00,0xB3,0xFF,0x00,0xBB,0xFF,0x00,0xC2,0xFF,0x00,0xC9,0xFF,0x00,0xD0,0xFF,0x00,0xD7,0xFF,0x00,0xDD,0xFF,0x00,0xE3,0xFF,0x00,0xE9,0xFF,0x00,0xED,0xFF,0x00,0xF2,0xFF,0x00,0xF6,0xFF,0x00,0xFB,0xFF,0x00,0xFE,0xFF,0x00,0xFF,0xFC,0x00,0xFF,0xF8,0x00,0xFF,0xF4,0x00,0xFF,0xF0,0x00,0xFF,0xEA,0x00,0xFF,0xE5,0x00,0xFF,0xDF,0x00,0xFF,0xD9,0x00,0xFF,0xD3,0x00,0xFF,0xCC,0x00,0xFF,0xC5,0x00,0xFF,0xBD,0x00,0xFF,0xB7,0x00,0xFF,0xAF,0x00,0xFF,0xA7,0x00,0xFF,0xA0,0x00,0xFF,0x97,0x00,0xFF,0x8F,0x00,0xFF,0x88,0x00,0xFF,0x80,0x00,0xFF,0x77,0x00,0xFF,0x6F,0x00,0xFF,0x68,0x00,0xFF,0x5F,0x00,0xFF,0x57,0x00,0xFF,0x50,0x00,0xFF,0x48,0x00,0xFF,0x41,0x00,0xFF,0x3A,0x00,0xFF,0x33,0x00,0xFF,0x2D,0x00,0xFF,0x26,0x00,0xFF,0x20,0x00,0xFF,0x1A,0x00,0xFF,0x15,0x00,0xFF,0x10,0x00,0xFF,0x0B,0x00,0xFF,0x07,0x00,0xFF,0x03,0x00,0xFF,0x00,0x04,0xFF,0x00,0x08,0xFF,0x00,0x0D,0xFF,0x00,0x11,0xFF,0x00,0x17,0xFF,0x00,0x1D,0xFF,0x00,0x23,0xFF,0x00,0x28,0xFF,0x00,0x2F,0xFF,0x00,0x36,0xFF,0x00,0x3D,0xFF,0x00,0x44,0xFF,0x00,0x4B,0xFF,0x00,0x53,0xFF,0x00,0x5A,0xFF,0x00,0x62,0xFF,0x00,0x6B,0xFF,0x00,0x72,0xFF,0x00,0x7B,0xFF,0x00,0x82,0xFF,0x00,0x8A,0xFF,0x00,0x92,0xFF,0x00,0x9A,0xFF,0x00,0xA3,0xFF,0x00,0xAA,0xFF,0x00,0xB1,0xFF,0x00,0xBA,0xFF,0x00,0xC1,0xFF,0x00,0xC8,0xFF,0x00,0xCF,0xFF,0x00,0xD5,0xFF,0x00,0xDB,0xFF,0x00,0xE1,0xFF,0x00,0xE7,0xFF,0x00,0xEC,0xFF,0x00,0xF1,0xFF,0x00,0xF6,0xFF,0x00,0xFA,0xFF,0x00,0xFE,0xFF,0x00,0xFF,0xFD,0x00,0xFF,0xF9,0x00,0xFF,0xF5,0x00,0xFF,0xF1,0x00,0xFF,0xEB,0x00,0xFF,0xE6,0x00,0xFF,0xE0,0x00,0xFF,0xDB,0x00,0xFF,0xD4,0x00,0xFF,0xCE,0x00,0xFF,0xC7,0x00,0xFF,0xBF,0x00,0xFF,0xB8,0x00,0xFF,0xB1,0x00,0xFF,0xA9,0x00,0xFF,0xA1,0x00,0xFF,0x99,0x00,0xFF,0x91,0x00,0xFF,0x89,0x00,0xFF,0x82,0x00,0xFF,0x79,0x00,0xFF,0x71,0x00,0xFF,0x6A,0x00,0xFF,0x61,0x00,0xFF,0x59,0x00,0xFF,0x52,0x00,0xFF,0x4A,0x00,0xFF,0x43,0x00,0xFF,0x3C,0x00,0xFF,0x34,0x00,0xFF,0x2E,0x00,0xFF,0x28,0x00,0xFF,0x22,0x00,0xFF,0x1B,0x00,0xFF,0x16,0x00,0xFF,0x10,0x00,0xFF,0x0C,0x00,0xFF,0x08,0x00,0xFF,0x04,0x00,0xFF,0x00,0x00,}; //200 Pixels +#endif \ No newline at end of file diff --git a/http.h b/includes/http.h similarity index 100% rename from http.h rename to includes/http.h diff --git a/icon.h b/includes/icon.h similarity index 100% rename from icon.h rename to includes/icon.h diff --git a/interface.h b/includes/interface.h similarity index 98% rename from interface.h rename to includes/interface.h index 4afa7a262..7f130649a 100644 --- a/interface.h +++ b/includes/interface.h @@ -159,7 +159,7 @@ 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 *psr,int b, int bq, int mx, int my); +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); diff --git a/md5.h b/includes/md5.h similarity index 100% rename from md5.h rename to includes/md5.h diff --git a/misc.h b/includes/misc.h similarity index 93% rename from misc.h rename to includes/misc.h index 106d2161b..9a92a712d 100644 --- a/misc.h +++ b/includes/misc.h @@ -3,7 +3,7 @@ #include #include -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) #define x86_cpuid(func,af,bf,cf,df) \ do {\ __asm mov eax, func\ @@ -63,6 +63,8 @@ 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); diff --git a/powder.h b/includes/powder.h similarity index 58% rename from powder.h rename to includes/powder.h index af3d4ffe7..3b5e2f0d6 100644 --- a/powder.h +++ b/includes/powder.h @@ -49,7 +49,7 @@ #define PT_NITR 8 #define PT_CLNE 9 #define PT_GAS 10 -#define PT_C4 11 +#define PT_PLEX 11 #define PT_GOO 12 #define PT_ICEI 13 #define PT_METL 14 @@ -106,10 +106,15 @@ #define PT_THRM 65 #define PT_GLOW 66 #define PT_BRCK 67 -#define PT_FWRK 68 -#define PT_PWPO 69 -#define PT_PWNE 70 -#define PT_NUM 71 +#define PT_HFLM 68 +#define PT_FIRW 69 +#define PT_FUSE 70 +#define PT_FSEP 71 +#define PT_AMTR 72 +#define PT_BCOL 73 +#define PT_PCLN 74 +#define PT_HSWC 75 +#define PT_NUM 76 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -140,7 +145,7 @@ struct particle float temp; float pavg[2]; int flags; - int tmp; + int tmp; }; typedef struct particle particle; @@ -190,7 +195,7 @@ static const part_type ptypes[PT_NUM] = {"", 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. Solidifies under pressure"}, + {"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."}, @@ -200,10 +205,10 @@ static const part_type ptypes[PT_NUM] = {"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, 1, 0, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air."}, + {"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."}, + {"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."}, @@ -224,41 +229,46 @@ static const part_type ptypes[PT_NUM] = {"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."}, + {"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"}, + {"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, 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, 115, "Plasma, extremely hot."}, + {"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."}, + {"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+400.0f+273.15f, 88, "Smoke"}, + {"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, 10, 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_POWDERS, R_TEMP+0.0f +273.15f, 211, "Thermite."}, - {"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."}, - {"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."}, - {"FWRK", PIXPACK(0x666666), 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_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "Fireworks!! Glows in fancy"}, - {"PWPO", PIXPACK(0x555080), 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, "Pressure sensitive wire, turns on when high pressure"}, - {"PWNE", PIXPACK(0x585080), 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, "Pressure sensitive wire, turns on when low pressure"}, - //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description + {"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"}, + {"BCOL", PIXPACK(0x333333), 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 Coal. Heavy particles. See COAL"}, + {"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] = @@ -287,11 +297,11 @@ static part_state pstates[PT_NUM] = /* 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_NONE, 0.0f, PT_DSTW, 371.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, 383.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}, @@ -321,106 +331,117 @@ static part_state pstates[PT_NUM] = /* 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_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}, + /* 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, 353.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}, + /* 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}, - /* FWRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* PWPO */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* PWNE */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.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}, + /* BCOL */ {ST_SOLID, 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 */ + /* Water | Oil */ + /* Water 0 | 1 | Water displaces oil */ + /* Oil 0 | 0 | Oil doesn't displace water */ -/* N D W O F M L G N C G C G I W 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 F P P*/ -/* o u a i i e a u i l a 4 o c i 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 W W W*/ -/* n s t l r t v n t n s o e r 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 2 W S S R O C R P N*/ -/* e t r l e l a p r e s i e 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 K O E*/ -/* 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,0,0,0}, /* None */ -/* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0}, /* Dust */ -/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0}, /* Watr */ -/* OILL */ {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,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}, /* BRCK */ -/* FRWK */ {0,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,1,1,0,1,0,0,0,0}, /* THRM */ -/* PWPO */ {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,0,0,0}, /* PWPO*/ -/* PWNE */ {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,0,0,0}, /* PWNE*/ -/* N D W O F M L G N C G C G I W 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 F P P*/ -/* o u a i i e a u i l a 4 o c i 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 W W W*/ -/* n s t l r t v n t n s o e r 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 2 W S S R O C R P N*/ -/* e t r l e l a p r e s i e 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 K O E*/ + /* 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 B 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 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 O 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 L 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,0,0,0,0,0,0,0,0}, /* None */ + /* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0}, /* Dust */ + /* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0}, /* Watr */ + /* OILL */ {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,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,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* Oill */ + /* FIRE */ {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,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}, /* Fire */ + /* STNE */ {0,1,1,1,0,0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1,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0}, /* FSEP */ + /* AMTR */ {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,0,0,0,0,0,0,0,0}, /* AMTR */ + /* BCOL */ {0,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1,0,1,1,0,1,1,0,1,0,1,0,0,1,0,0,0,0}, /* BCOL */ + /* PCLN */ {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,0,0,0,0,0,0,0,0}, /* PCLN */ + /* HSWC */ {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,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 B 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 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 O 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 L N C */ }; extern int isplayer; diff --git a/update.h b/includes/update.h similarity index 100% rename from update.h rename to includes/update.h diff --git a/version.h b/includes/version.h similarity index 100% rename from version.h rename to includes/version.h diff --git a/script.sh b/script.sh new file mode 100755 index 000000000..682a4aeed --- /dev/null +++ b/script.sh @@ -0,0 +1,11 @@ +#!/bin/bash +git pull +make powder-64-sse3 +make powder-64-sse2 +make powder-sse3 +make powder-debug +make powder-sse2 +make powder +make powder-sse +tar czf PowderToyGit.tar.gz ./ + diff --git a/Resources/Font-Data b/src/Resources/Font-Data similarity index 100% rename from Resources/Font-Data rename to src/Resources/Font-Data diff --git a/Resources/Font-Pointers b/src/Resources/Font-Pointers similarity index 100% rename from Resources/Font-Pointers rename to src/Resources/Font-Pointers diff --git a/Resources/Icon-16.png b/src/Resources/Icon-16.png similarity index 100% rename from Resources/Icon-16.png rename to src/Resources/Icon-16.png diff --git a/Resources/Icon-32.png b/src/Resources/Icon-32.png similarity index 100% rename from Resources/Icon-32.png rename to src/Resources/Icon-32.png diff --git a/Resources/powder-res.rc b/src/Resources/powder-res.rc similarity index 100% rename from Resources/powder-res.rc rename to src/Resources/powder-res.rc diff --git a/Resources/powder.icns b/src/Resources/powder.icns similarity index 100% rename from Resources/powder.icns rename to src/Resources/powder.icns diff --git a/Resources/powder.ico b/src/Resources/powder.ico similarity index 100% rename from Resources/powder.ico rename to src/Resources/powder.ico diff --git a/air.c b/src/air.c similarity index 84% rename from air.c rename to src/air.c index 9415bbf06..dd98a124c 100644 --- a/air.c +++ b/src/air.c @@ -1,7 +1,7 @@ #include -#include "air.h" -#include "powder.h" -#include "defines.h" +#include +#include +#include float kernel[9]; float vx[YRES/CELL][XRES/CELL], ovx[YRES/CELL][XRES/CELL]; @@ -54,15 +54,15 @@ void update_air(void) vy[y][x] *= VLOSS; vx[y][x] += dx*TSTEPV; vy[y][x] += dy*TSTEPV; - if(bmap[y][x]==11 || bmap[y][x+1]==11 || - bmap[y][x]==2 || bmap[y][x+1]==2 || - (bmap[y][x]==3 && !emap[y][x]) || - (bmap[y][x+1]==3 && !emap[y][x+1])) + 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]==11 || bmap[y+1][x]==11 || - bmap[y][x]==2 || bmap[y+1][x]==2 || - (bmap[y][x]==3 && !emap[y][x]) || - (bmap[y+1][x]==3 && !emap[y+1][x])) + 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; } @@ -76,9 +76,9 @@ void update_air(void) for(i=-1; i<2; i++) if(y+j>0 && y+j0 && x+i +#include +#include +#include +#define INCLUDE_FONTDATA +#include +#include unsigned cmode = 3; @@ -117,7 +118,7 @@ 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) { #ifdef OpenGL - RenderScene(); + RenderScene(); #else if(sdl_scale == 2) sdl_blit_2(x, y, w, h, src, pitch); @@ -708,7 +709,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) //x = 2+32*(b/2); //y = YRES+2+20*(b%2); #ifdef OpenGL - fillrect(vid_buf, x, y, 28, 16, PIXR(pc), PIXG(pc), PIXB(pc), 255); + fillrect(vid_buf, x, y, 28, 16, PIXR(pc), PIXG(pc), PIXB(pc), 255); #else for(j=1; j<15; j++) { @@ -744,11 +745,7 @@ 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) { - if(i==SEC&&SEC!=0) - drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 0, 255, 255, 255); - else - drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); - + drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); if(hover==i) { fillrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); @@ -851,13 +848,13 @@ 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) { #ifdef OpenGL - glBegin(GL_LINE_LOOP); - glColor4ub(r, g, b, a); - glVertex2i(x, y); - glVertex2i(x+w, y); - glVertex2i(x+w, y+h); - glVertex2i(x, y+h); - glEnd(); + glBegin(GL_LINE_LOOP); + glColor4ub(r, g, b, a); + glVertex2i(x, y); + glVertex2i(x+w, y); + glVertex2i(x+w, y+h); + glVertex2i(x, y+h); + glEnd(); #else int i; for(i=0; i<=w; i++) @@ -876,13 +873,13 @@ 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) { #ifdef OpenGL - glBegin(GL_QUADS); - glColor4ub(r, g, b, a); - glVertex2i(x, y); - glVertex2i(x+w, y); - glVertex2i(x+w, y+h); - glVertex2i(x, y+h); - glEnd(); + glBegin(GL_QUADS); + glColor4ub(r, g, b, a); + glVertex2i(x, y); + glVertex2i(x+w, y); + glVertex2i(x+w, y+h); + glVertex2i(x, y+h); + glEnd(); #else int i,j; for(j=1; j> (x+18)) & 1; + cb += (parts[i].ctype >> x) & 1; + } + for(x=0; x<14; x++) + cg += (parts[i].ctype >> (x+9)) & 1; + x = 624/(cr+cg+cb+1); + cr *= x; + cg *= x; + cb *= x; + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr>255?255:cr,cg>255?255:cg,cb>255?255:cb); + cr >>= 4; + cg >>= 4; + cb >>= 4; x = nx/CELL; y = ny/CELL; cg += fire_g[y][x]; @@ -1457,52 +1467,6 @@ void draw_parts(pixel *vid) x = nx; y = ny; blendpixel(vid,x,y,17,217,24,255); - } - else if((t==PT_FWRK && parts[i].life >= 1)&&(cmode == 3||cmode==4 || cmode==6)) - { - x = nx; - y = ny; - vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors; - cg = 10; - cb = 10; - cr = 10; - x = nx/CELL; - y = ny/CELL; - cg += fire_g[y][x]; - if(cg > 255) cg = 255; - fire_g[y][x] = cg; - cb += fire_b[y][x]; - if(cb > 255) cb = 255; - fire_b[y][x] = cb; - cr += fire_r[y][x]; - if(cr > 255) cr = 255; - fire_r[y][x] = cr; - } - - else if(t==PT_DUST && parts[i].life >= 1) - { - x = nx; - y = ny; - if(cmode == 3||cmode==4 || cmode==6) - { - vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(parts[i].tmp,parts[i].ctype,parts[i].flags); - cg = parts[i].tmp/4; - cb = parts[i].ctype/4; - cr = parts[i].flags/4; - x = nx/CELL; - y = ny/CELL; - cg += fire_g[y][x]; - if(cg > 255) cg = 255; - fire_g[y][x] = cg; - cb += fire_b[y][x]; - if(cb > 255) cb = 255; - fire_b[y][x] = cb; - cr += fire_r[y][x]; - if(cr > 255) cr = 255; - fire_r[y][x] = cr; - } - else - blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255); } else if(t==PT_LNTG&&cmode == 6) { @@ -1710,17 +1674,17 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); } } - else if(t==PT_GLOW) + else if(t==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)); + 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)); if(cmode == 3||cmode==4 || cmode==6) { x = nx/CELL; @@ -1735,38 +1699,71 @@ void draw_parts(pixel *vid) if(fr > 255) fr = 255; fire_r[y][x] = fr; } - if(cmode == 4){ - uint8 R = (int)restrict_flt(0x44 + fr*8, 0, 255); - uint8 G = (int)restrict_flt(0x88 + fg*8, 0, 255); - uint8 B = (int)restrict_flt(0x44 + fb*8, 0, 255); - - blendpixel(vid, nx+1, ny, R, G, B, 223); - blendpixel(vid, nx-1, ny, R, G, B, 223); - blendpixel(vid, nx, ny+1, R, G, B, 223); - blendpixel(vid, nx, ny-1, R, G, B, 223); + if(cmode == 4) { + uint8 R = (int)restrict_flt(0x44 + fr*8, 0, 255); + uint8 G = (int)restrict_flt(0x88 + fg*8, 0, 255); + uint8 B = (int)restrict_flt(0x44 + fb*8, 0, 255); - blendpixel(vid, nx+1, ny-1, R, G, B, 112); - blendpixel(vid, nx-1, ny-1, R, G, B, 112); - blendpixel(vid, nx+1, ny+1, R, G, B, 112); - blendpixel(vid, nx-1, ny+1, R, G, B, 112); - } + blendpixel(vid, nx+1, ny, R, G, B, 223); + blendpixel(vid, nx-1, ny, R, G, B, 223); + blendpixel(vid, nx, ny+1, R, G, B, 223); + blendpixel(vid, nx, ny-1, R, G, B, 223); + + blendpixel(vid, nx+1, ny-1, R, G, B, 112); + blendpixel(vid, nx-1, ny-1, R, G, B, 112); + blendpixel(vid, nx+1, ny+1, R, G, B, 112); + blendpixel(vid, nx-1, ny+1, R, G, B, 112); + } } else if(t==PT_LCRY) { - uint8 GR = 0x50+(parts[i].life*10); - vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, GR); - if(cmode == 4){ - blendpixel(vid, nx+1, ny, GR, GR, GR, 223); - blendpixel(vid, nx-1, ny, GR, GR, GR, 223); - blendpixel(vid, nx, ny+1, GR, GR, GR, 223); - blendpixel(vid, nx, ny-1, GR, GR, GR, 223); + uint8 GR = 0x50+(parts[i].life*10); + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, GR); + if(cmode == 4) { + blendpixel(vid, nx+1, ny, GR, GR, GR, 223); + blendpixel(vid, nx-1, ny, GR, GR, GR, 223); + blendpixel(vid, nx, ny+1, GR, GR, GR, 223); + blendpixel(vid, nx, ny-1, GR, GR, GR, 223); - blendpixel(vid, nx+1, ny-1, GR, GR, GR, 112); - blendpixel(vid, nx-1, ny-1, GR, GR, GR, 112); - blendpixel(vid, nx+1, ny+1, GR, GR, GR, 112); - blendpixel(vid, nx-1, ny+1, GR, GR, GR, 112); - } - } else if(t==PT_PLSM) + blendpixel(vid, nx+1, ny-1, GR, GR, GR, 112); + blendpixel(vid, nx-1, ny-1, GR, GR, GR, 112); + blendpixel(vid, nx+1, ny+1, GR, GR, GR, 112); + blendpixel(vid, nx-1, ny+1, GR, GR, GR, 112); + } + } + else if(t==PT_PCLN) + { + uint8 GR = 0x3B+(parts[i].life*19); + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, 10); + if(cmode == 4) { + blendpixel(vid, nx+1, ny, GR, GR, 10, 223); + blendpixel(vid, nx-1, ny, GR, GR, 10, 223); + blendpixel(vid, nx, ny+1, GR, GR, 10, 223); + blendpixel(vid, nx, ny-1, GR, GR, 10, 223); + + blendpixel(vid, nx+1, ny-1, GR, GR, 10, 112); + blendpixel(vid, nx-1, ny-1, GR, GR, 10, 112); + blendpixel(vid, nx+1, ny+1, GR, GR, 10, 112); + blendpixel(vid, nx-1, ny+1, GR, GR, 10, 112); + } + } + else if(t==PT_HSWC) + { + uint8 GR = 0x3B+(parts[i].life*19); + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, 10, 10); + if(cmode == 4) { + blendpixel(vid, nx+1, ny, GR, 10, 10, 223); + blendpixel(vid, nx-1, ny, GR, 10, 10, 223); + blendpixel(vid, nx, ny+1, GR, 10, 10, 223); + blendpixel(vid, nx, ny-1, GR, 10, 10, 223); + + blendpixel(vid, nx+1, ny-1, GR, 10, 10, 112); + blendpixel(vid, nx-1, ny-1, GR, 10, 10, 112); + blendpixel(vid, nx+1, ny+1, GR, 10, 10, 112); + blendpixel(vid, nx-1, ny+1, GR, 10, 10, 112); + } + } + else if(t==PT_PLSM) { float ttemp = (float)parts[i].life; int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); @@ -1805,10 +1802,126 @@ void draw_parts(pixel *vid) blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); } + } else if(t==PT_HFLM) + { + float ttemp = (float)parts[i].life; + int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); + uint8 R = hflm_data[caddress]; + uint8 G = hflm_data[caddress+1]; + uint8 B = hflm_data[caddress+2]; + if(cmode == 3||cmode==4 || cmode==6) + { + cr = R/8; + cg = G/8; + cb = B/8; + x = nx/CELL; + y = ny/CELL; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else + { + cr = R; + cg = G; + cb = B; + blendpixel(vid, nx, ny, cr, cg, cb, 192); + blendpixel(vid, nx+1, ny, cr, cg, cb, 96); + blendpixel(vid, nx-1, ny, cr, cg, cb, 96); + blendpixel(vid, nx, ny+1, cr, cg, cb, 96); + blendpixel(vid, nx, ny-1, cr, cg, cb, 96); + blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); + } + } else if(t==PT_FIRW&&parts[i].tmp>=3) + { + float ttemp = (float)parts[i].tmp-4; + int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); + uint8 R = firw_data[caddress]; + uint8 G = firw_data[caddress+1]; + uint8 B = firw_data[caddress+2]; + if(cmode == 3||cmode==4 || cmode==6) + { + cr = R/2; + cg = G/2; + cb = B/2; + x = nx/CELL; + y = ny/CELL; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else + { + cr = R; + cg = G; + cb = B; + blendpixel(vid, nx, ny, cr, cg, cb, 192); + blendpixel(vid, nx+1, ny, cr, cg, cb, 96); + blendpixel(vid, nx-1, ny, cr, cg, cb, 96); + blendpixel(vid, nx, ny+1, cr, cg, cb, 96); + blendpixel(vid, nx, ny-1, cr, cg, cb, 96); + blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); + } } else if(t==PT_FIRE && parts[i].life) { - if(cmode == 3||cmode==4 || cmode==6) + float ttemp = (float)parts[i].life; + int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); + uint8 R = flm_data[caddress]; + uint8 G = flm_data[caddress+1]; + uint8 B = flm_data[caddress+2]; + if(cmode == 3||cmode==4 || cmode==6) + { + cr = R/8; + cg = G/8; + cb = B/8; + x = nx/CELL; + y = ny/CELL; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else + { + cr = R; + cg = G; + cb = B; + blendpixel(vid, nx, ny, cr, cg, cb, 192); + blendpixel(vid, nx+1, ny, cr, cg, cb, 96); + blendpixel(vid, nx-1, ny, cr, cg, cb, 96); + blendpixel(vid, nx, ny+1, cr, cg, cb, 96); + blendpixel(vid, nx, ny-1, cr, cg, cb, 96); + blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); + } + // Older Code + /*if(cmode == 3||cmode==4 || cmode==6) { cr = parts[i].life / 4; cg = parts[i].life / 16; @@ -1845,7 +1958,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32); blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); - } + }*/ } else if(t==PT_LAVA && parts[i].life) { @@ -1914,7 +2027,7 @@ void draw_parts(pixel *vid) else { float ttemp = parts[i].temp+(-MIN_TEMP); - int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/512) ) *3, 0.0f, (512.0f*3)-3); + int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3); uint8 R = color_data[caddress]; uint8 G = color_data[caddress+1]; uint8 B = color_data[caddress+2]; @@ -1942,7 +2055,7 @@ void draw_parts(pixel *vid) draw_line(vid , nx, ny+3, player[11], player[12], R, G, B, s); draw_line(vid , player[11], player[12], player[15], player[16], R, G, B, s); - isplayer = 1; //It's a secret. Tssss... + isplayer = 1; //It's a secret. Tssss... } else { @@ -1950,7 +2063,7 @@ void draw_parts(pixel *vid) //blendpixel(vid, nx+1, ny, R, G, B, 255); } } - if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH) + if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3)) { uint8 R = PIXR(ptypes[t].pcolors); uint8 G = PIXG(ptypes[t].pcolors); @@ -1970,11 +2083,11 @@ void draw_parts(pixel *vid) blendpixel(vid, nx+1, ny+1, R, G, B, 112); blendpixel(vid, nx-1, ny+1, R, G, B, 112); } - } + } #endif - } + } #ifdef OpenGL - glFlush (); + glFlush (); #endif } @@ -2000,9 +2113,9 @@ void render_signs(pixel *vid_buf) if(strcmp(signs[i].text, "{t}")==0) { if((pmap[signs[i].y][signs[i].x]>>8)>0 && (pmap[signs[i].y][signs[i].x]>>8)>8].temp-273.15f); //...tempirature + sprintf(buff, "Temp: %4.2f", parts[pmap[signs[i].y][signs[i].x]>>8].temp-273.15); //...tempirature else - sprintf(buff, "Temp: N/A"); //...tempirature + sprintf(buff, "Temp: 0.00"); //...tempirature drawtext(vid_buf, x+3, y+3, buff, 255, 255, 255, 255); } @@ -2069,33 +2182,33 @@ void prepare_alpha(void) pixel *render_packed_rgb(void *image, int width, int height, int cmp_size) { - unsigned char *tmp; - pixel *res; - int i; + unsigned char *tmp; + pixel *res; + int i; - tmp = malloc(width*height*3); - if(!tmp) - return NULL; - res = malloc(width*height*PIXELSIZE); - if(!res) - { - free(tmp); - return NULL; - } + tmp = malloc(width*height*3); + if(!tmp) + return NULL; + res = malloc(width*height*PIXELSIZE); + if(!res) + { + free(tmp); + return NULL; + } - i = width*height*3; - if(BZ2_bzBuffToBuffDecompress((char *)tmp, (unsigned *)&i, (char *)image, cmp_size, 0, 0)) - { - free(res); - free(tmp); - return NULL; - } + i = width*height*3; + if(BZ2_bzBuffToBuffDecompress((char *)tmp, (unsigned *)&i, (char *)image, cmp_size, 0, 0)) + { + free(res); + free(tmp); + return NULL; + } - for(i=0; iSAVE_VERSION) return NULL; - if(c[2]==0x43 && c[1]==0x75 && c[0]==0x66){ - new_format = 1; - } + bw = c[6]; bh = c[7]; w = bw*CELL; @@ -2442,14 +2556,14 @@ void sdl_open(void) } atexit(SDL_Quit); #ifdef OpenGL - sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,32,SDL_OPENGL); - SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); - Enable2D (); - // glBegin(GL_TRIANGLES); - // glColor3ub (255, 0, 0); - // glVertex2d (0, 0); - // glColor3ub (0, 255, 0); - // glVertex2d (640,0); + sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,32,SDL_OPENGL); + SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); + Enable2D (); + // glBegin(GL_TRIANGLES); + // glColor3ub (255, 0, 0); + // glVertex2d (0, 0); + // glColor3ub (0, 255, 0); + // glVertex2d (640,0); // glColor3ub (0, 0, 255); // glVertex2d (50, 50); //glEnd (); @@ -2488,11 +2602,11 @@ void Enable2D () glPushMatrix (); glLoadIdentity (); - glEnable (GL_BLEND); - glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable (GL_BLEND); + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glHint( GL_LINE_SMOOTH_HINT, GL_NICEST); - glHint( GL_POINT_SMOOTH_HINT, GL_NICEST); + glHint( GL_LINE_SMOOTH_HINT, GL_NICEST); + glHint( GL_POINT_SMOOTH_HINT, GL_NICEST); } void RenderScene () { @@ -2500,6 +2614,6 @@ void RenderScene () } void ClearScreen() { - glClear(GL_COLOR_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT); } #endif diff --git a/http.c b/src/http.c similarity index 99% rename from http.c rename to src/http.c index 4713b37b5..cc056c773 100644 --- a/http.c +++ b/src/http.c @@ -42,9 +42,9 @@ #include #endif -#include "defines.h" -#include "http.h" -#include "md5.h" +#include +#include +#include #ifdef WIN32 #define PERROR SOCKET_ERROR diff --git a/interface.c b/src/interface.c similarity index 92% rename from interface.c rename to src/interface.c index fa6c3736b..bdec1114f 100644 --- a/interface.c +++ b/src/interface.c @@ -4,13 +4,13 @@ #include #include #include -#include "http.h" -#include "md5.h" -#include "font.h" -#include "defines.h" -#include "powder.h" -#include "interface.h" -#include "misc.h" +#include +#include +#include +#include +#include +#include +#include SDLMod sdl_mod; int sdl_key, sdl_wheel, sdl_caps=0, sdl_ascii, sdl_zoom_trig=0; @@ -1292,7 +1292,7 @@ void menu_ui(pixel *vid_buf, int i, int *sl, int *sr) else if(n==*sr) { drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); - } + } } } for(n = 0; n=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) - { - drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); - h = n; - } - else if(!bq && mx>=x+32 && mx=y && my< y+15) + if(!bq && mx>=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; @@ -1442,10 +1437,6 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, else if(n==*sr) { drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); - } - else if(n==*psr) - { - drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); } } } @@ -1462,12 +1453,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, mwalls[n-122].colour)+5; - if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) - { - drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); - h = n; - } - else if(!bq && mx>=x+32 && mx=y && my< y+15) + if(!bq && mx>=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; @@ -1479,10 +1465,6 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, else if(n==*sr) { drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); - } - else if(n==*psr) - { - drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); } } } @@ -1496,12 +1478,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5; - if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) - { - drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); - h = n; - } - else if(!bq && mx>=x+32 && mx=y && my< y+15) + if(!bq && mx>=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; @@ -1513,10 +1490,6 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, else if(n==*sr) { drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); - } - else if(n==*psr) - { - drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); } } } @@ -1533,12 +1506,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5; - if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) - { - drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); - h = n; - } - else if(!bq && mx>=x+32 && mx=y && my< y+15) + if(!bq && mx>=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; @@ -1550,19 +1518,11 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *psr,int b, int bq, else if(n==*sr) { drawrect(vid_buf, x+30, y-1, 29, 17, 0, 0, 255, 255); - } - else if(n==*psr) - { - drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); } } } } - if(!bq&&mx>=sdl_scale*(XRES-2) && mx= sdl_scale*((i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16)) && my=0&&i0)&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) - { - SEC = sec; - PSR=-1; - *psr=-1; - } if(b==4&&h!=-1) { - if(sdl_mod & (KMOD_LALT|KMOD_RALT)) - { - PSR=h; - *psr=h; - SEC=-1; - } - else *sr = h; } - else if((b==4&&sec>0)&&(sdl_mod & (KMOD_LALT|KMOD_RALT))) - { - SEC = sec; - PSR=-1; - *psr=-1; - } - } int sdl_poll(void) @@ -1826,7 +1759,7 @@ corrupt: int search_ui(pixel *vid_buf) { - int uih=0,nyu,nyd,b=1,bq,mx=0,my=0,mxq=0,myq=0,mmt=0,gi,gj,gx,gy,pos,i,mp,dp,own,last_own=search_own,page_count=0,last_page=0,last_date=0,j,w,h,st=0,lv; + int uih=0,nyu,nyd,b=1,bq,mx=0,my=0,mxq=0,myq=0,mmt=0,gi,gj,gx,gy,pos,i,mp,dp,dap,own,last_own=search_own,page_count=0,last_page=0,last_date=0,j,w,h,st=0,lv; int is_p1=0, exp_res=GRID_X*GRID_Y, tp, view_own=0; int thumb_drawn[GRID_X*GRID_Y]; pixel *v_buf = (pixel *)malloc(((YRES+MENUSIZE)*(XRES+BARSIZE))*PIXELSIZE); @@ -1856,7 +1789,7 @@ int search_ui(pixel *vid_buf) memset(img_id, 0, sizeof(img_id)); memset(search_ids, 0, sizeof(search_ids)); - memset(search_dates, 0, sizeof(search_dates)); + memset(search_dates, 0, sizeof(search_dates)); memset(search_names, 0, sizeof(search_names)); memset(search_scoreup, 0, sizeof(search_scoreup)); memset(search_scoredown, 0, sizeof(search_scoredown)); @@ -2019,6 +1952,7 @@ int search_ui(pixel *vid_buf) } mp = dp = -1; + dap = -1; st = 0; for(gj=0; gj=gx-6 && mx<=gx+4 && my>=gy+YRES/GRID_S-4 && my<=gy+YRES/GRID_S+6) + { + mp = -1; + dap = pos; + } } - drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, YRES/GRID_S+3, 128, 128, 128, 255); - fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, 1+(YRES/GRID_S+3)/2, 0, 107, 10, 255); - fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2), 6, 1+(YRES/GRID_S+3)/2, 107, 10, 0, 255); + drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, YRES/GRID_S+3, 128, 128, 128, 255); + fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2, 6, 1+(YRES/GRID_S+3)/2, 0, 107, 10, 255); + fillrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2), 6, 1+(YRES/GRID_S+3)/2, 107, 10, 0, 255); + if(mp==pos && !st) drawrect(vid_buf, gx-2, gy-2, XRES/GRID_S+3, YRES/GRID_S+3, 160, 160, 192, 255); else @@ -2091,6 +2031,16 @@ int search_ui(pixel *vid_buf) drawtext(vid_buf, gx-6, gy-6, "\xCD", 255, 255, 255, 255); drawtext(vid_buf, gx-6, gy-6, "\xCE", 212, 151, 81, 255); } + if(!search_dates[pos] && own) + { + fillrect(vid_buf, gx-5, gy+YRES/GRID_S-3, 7, 8, 255, 255, 255, 255); + if(dap == pos) { + drawtext(vid_buf, gx-6, gy+YRES/GRID_S-4, "\xA6", 200, 100, 80, 255); + } else { + drawtext(vid_buf, gx-6, gy+YRES/GRID_S-4, "\xA6", 160, 70, 50, 255); + } + //drawtext(vid_buf, gx-6, gy-6, "\xCE", 212, 151, 81, 255); + } if(view_own || svf_admin || svf_mod) { sprintf(ts+1, "%d", search_votes[pos]); @@ -2132,10 +2082,11 @@ int search_ui(pixel *vid_buf) nyd = search_scoredown[pos]/ry; } - fillrect(vid_buf, gx-1+(XRES/GRID_S)+5, gy-1+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 57, 187, 57, 255); + + fillrect(vid_buf, gx-1+(XRES/GRID_S)+5, gy-1+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 57, 187, 57, 255); fillrect(vid_buf, gx-1+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2), 4, nyd, 187, 57, 57, 255); - //drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 0, 107, 10, 255); - // drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)+1, 4, nyd, 107, 10, 0, 255); + //drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)-nyu, 4, nyu, 0, 107, 10, 255); + //drawrect(vid_buf, gx-2+(XRES/GRID_S)+5, gy-2+((YRES/GRID_S+3)/2)+1, 4, nyd, 107, 10, 0, 255); } } @@ -2204,6 +2155,11 @@ int search_ui(pixel *vid_buf) last = NULL; } } + if(b && !bq && dap!=-1) + { + sprintf(ed.str, "history:%s", search_ids[dap]); + lasttime = TIMEOUT; + } if(b && !bq && tp!=-1) { @@ -2227,17 +2183,17 @@ int search_ui(pixel *vid_buf) fillrect(vid_buf, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 255); info_box(vid_buf, "Loading..."); - if(search_dates[mp]){ - uri = malloc(strlen(search_ids[mp])*3+strlen(search_dates[mp])*3+strlen(SERVER)+71); - strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); - strcaturl(uri, search_ids[mp]); - strcaturl(uri, "&Date="); - strcaturl(uri, search_dates[mp]); - } else { - uri = malloc(strlen(search_ids[mp])*3+strlen(SERVER)+64); - strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); - strcaturl(uri, search_ids[mp]); - } + if(search_dates[mp]) { + uri = malloc(strlen(search_ids[mp])*3+strlen(search_dates[mp])*3+strlen(SERVER)+71); + strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); + strcaturl(uri, search_ids[mp]); + strappend(uri, "&Date="); + strcaturl(uri, search_dates[mp]); + } else { + uri = malloc(strlen(search_ids[mp])*3+strlen(SERVER)+64); + strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); + strcaturl(uri, search_ids[mp]); + } data = http_simple_get(uri, &status, &dlen); free(uri); @@ -2449,9 +2405,22 @@ int search_ui(pixel *vid_buf) thlen = 4; } thumb_cache_add(img_id[i], thumb, thlen); - for(pos=0; pos=GRID_X*GRID_Y) - break; - if(votes) - { - sd = strchr(str+8, ' '); - if(!sd) - return i; - *(sd++) = 0; - pu = strchr(sd, ' '); - if(!pu) - return i; - *(pu++) = 0; - s = strchr(pu, ' '); - if(!s) - return i; - *(s++) = 0; - vu = strchr(s, ' '); - if(!vu) - return i; - *(vu++) = 0; - vd = strchr(vu, ' '); - if(!vd) - return i; - *(vd++) = 0; - q = strchr(vd, ' '); - } - else - { - sd = strchr(str+8, ' '); - if(!sd) - return i; - *(sd++) = 0; - pu = strchr(sd, ' '); - if(!pu) - return i; - *(pu++) = 0; - vu = strchr(pu, ' '); - if(!vu) - return i; - *(vu++) = 0; - vd = strchr(vu, ' '); - if(!vd) - return i; - *(vd++) = 0; - q = strchr(vd, ' '); - } - if(!q) - return i; - *(q++) = 0; - r = strchr(q, ' '); - if(!r) - return i; - *(r++) = 0; - search_ids[i] = mystrdup(str+8); - search_dates[i] = mystrdup(sd); - search_publish[i] = atoi(pu); - search_scoreup[i] = atoi(vu); - search_scoredown[i] = atoi(vd); - search_owners[i] = mystrdup(q); - search_names[i] = mystrdup(r); + if(s) + search_votes[i] = atoi(s); + thumb_cache_find(str+5, search_thumbs+i, search_thsizes+i); + i++; + } + else if(!strncmp(str, "HISTORY ", 8)) + { + if(i>=GRID_X*GRID_Y) + break; + if(votes) + { + sd = strchr(str+8, ' '); + if(!sd) + return i; + *(sd++) = 0; + pu = strchr(sd, ' '); + if(!pu) + return i; + *(pu++) = 0; + s = strchr(pu, ' '); + if(!s) + return i; + *(s++) = 0; + vu = strchr(s, ' '); + if(!vu) + return i; + *(vu++) = 0; + vd = strchr(vu, ' '); + if(!vd) + return i; + *(vd++) = 0; + q = strchr(vd, ' '); + } + else + { + sd = strchr(str+8, ' '); + if(!sd) + return i; + *(sd++) = 0; + pu = strchr(sd, ' '); + if(!pu) + return i; + *(pu++) = 0; + vu = strchr(pu, ' '); + if(!vu) + return i; + *(vu++) = 0; + vd = strchr(vu, ' '); + if(!vd) + return i; + *(vd++) = 0; + q = strchr(vd, ' '); + } + if(!q) + return i; + *(q++) = 0; + r = strchr(q, ' '); + if(!r) + return i; + *(r++) = 0; + search_ids[i] = mystrdup(str+8); - if(s) - search_votes[i] = atoi(s); - thumb_cache_find(str+8, search_thumbs+i, search_thsizes+i); + search_dates[i] = mystrdup(sd); + + search_publish[i] = atoi(pu); + search_scoreup[i] = atoi(vu); + search_scoredown[i] = atoi(vd); + + search_owners[i] = mystrdup(q); + search_names[i] = mystrdup(r); + + if(s) + search_votes[i] = atoi(s); + thumb_cache_find(str+8, search_thumbs+i, search_thsizes+i); i++; } else if(!strncmp(str, "TAG ", 4)) @@ -2971,4 +2958,4 @@ int execute_vote(pixel *vid_buf, char *id, char *action) if(result) free(result); return 1; -} \ No newline at end of file +} diff --git a/main.c b/src/main.c old mode 100644 new mode 100755 similarity index 92% rename from main.c rename to src/main.c index 6c8f0e292..d88b9726b --- a/main.c +++ b/src/main.c @@ -37,18 +37,18 @@ #include #endif -#include "misc.h" -#include "font.h" -#include "defines.h" -#include "powder.h" -#include "graphics.h" -#include "version.h" -#include "http.h" -#include "md5.h" -#include "update.h" -#include "hmap.h" -#include "air.h" -#include "icon.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static const char *it_msg = "\brThe Powder Toy\n" @@ -101,7 +101,6 @@ int legacy_enable = 0; //Used to disable new features such as heat, will be set int death = 0, framerender = 0; int amd = 1; int FPSB = 0; -int cracker = 1; sign signs[MAXSIGNS]; @@ -248,7 +247,7 @@ void *build_save(int *size, int x0, int y0, int w, int h) d[p++] = bmap[y][x]; for(y=by0; y>8); - d[p++] = (tttemp&0x00FF); + //New Temperature saving uses a 16bit unsigned int for temperatures, giving a precision of 1 degree versus 36 for the old format + int tttemp = (int)parts[i-1].temp; + d[p++] = ((tttemp&0xFF00)>>8); + d[p++] = (tttemp&0x00FF); } } for(j=0; j> 16; c[11] = p >> 24; - i -= 12; if(BZ2_bzBuffToBuffCompress((char *)(c+12), (unsigned *)&i, (char *)d, p, 9, 0, 0) != BZ_OK) @@ -385,22 +385,23 @@ int parse_save(void *save, int size, int replace, int x0, int y0) int i,j,k,x,y,p=0,*m=calloc(XRES*YRES, sizeof(int)), ver, pty, ty, legacy_beta=0; int bx0=x0/CELL, by0=y0/CELL, bw, bh, w, h; int fp[NPART], nf=0, new_format = 0, ttv = 0; - //New file header uses PSv, replacing fuC. This is to detect if the client uses a new save format for temperatures - //This creates a problem for old clients, that display and "corrupt" error instead of a "newer version" error - if(size<16) - return 1; - if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50)) - return 1; - if(c[2]==0x76 && c[1]==0x53 && c[0]==0x50){ - new_format = 1; - } - if(c[4]>SAVE_VERSION) - return 2; - ver = c[4]; + //New file header uses PSv, replacing fuC. This is to detect if the client uses a new save format for temperatures + //This creates a problem for old clients, that display and "corrupt" error instead of a "newer version" error - if(ver<34) - { + if(size<16) + return 1; + if(!(c[2]==0x43 && c[1]==0x75 && c[0]==0x66) && !(c[2]==0x76 && c[1]==0x53 && c[0]==0x50)) + return 1; + if(c[2]==0x76 && c[1]==0x53 && c[0]==0x50) { + new_format = 1; + } + if(c[4]>SAVE_VERSION) + return 2; + ver = c[4]; + + if(ver<34) + { legacy_enable = 1; } else @@ -474,38 +475,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) for(x=bx0; x= PT_NUM) goto corrupt; - if(j && !(isplayer == 1 && j==PT_STKM)) + if(j)// && !(isplayer == 1 && j==PT_STKM)) { if(pmap[y][x]) { @@ -623,34 +593,32 @@ int parse_save(void *save, int size, int replace, int x0, int y0) { if(ver>=34&&legacy_beta==0) { - if(p >= size) - { - goto corrupt; - } - if(i <= NPART) - { - if(ver>=42){ - if(new_format){ - ttv = (d[p++])<<8; - ttv |= (d[p++]); - parts[i-1].temp = ttv; - } else { - - parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP; - } - } - else { - parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273.15; - } - } - else - { - p ++; - if(new_format){ - p++; - } - } - } + if(p >= size) + { + goto corrupt; + } + if(i <= NPART) + { + if(ver>=42) { + if(new_format) { + ttv = (d[p++])<<8; + ttv |= (d[p++]); + parts[i-1].temp = ttv; + } else { + parts[i-1].temp = (d[p++]*((MAX_TEMP+(-MIN_TEMP))/255))+MIN_TEMP; + } + } else { + parts[i-1].temp = ((d[p++]*((O_MAX_TEMP+(-O_MIN_TEMP))/255))+O_MIN_TEMP)+273; + } + } + else + { + p++; + if(new_format) { + p++; + } + } + } else { parts[i-1].temp = ptypes[parts[i-1].type].heat; @@ -716,7 +684,6 @@ corrupt: memset(signs, 0, sizeof(signs)); memset(parts, 0, sizeof(particle)*NPART); memset(bmap, 0, sizeof(bmap)); - } return 1; } @@ -1010,7 +977,7 @@ int main(int argc, char *argv[]) #ifdef INTERNAL int vs = 0; #endif - int x, y, b = 0, sl=1, sr=0,su=0,psr=-1, c, lb = 0, lx = 0, ly = 0, lm = 0;//, tx, ty; + int x, y, b = 0, sl=1, sr=0, su=0, c, lb = 0, lx = 0, ly = 0, lm = 0;//, tx, ty; int da = 0, db = 0, it = 2047, mx, my, bs = 2; float nfvx, nfvy; int load_mode=0, load_w=0, load_h=0, load_x=0, load_y=0, load_size=0; @@ -1126,7 +1093,7 @@ int main(int argc, char *argv[]) { for(i=1; i32) - ZSIZE = 32; - if(ZSIZE<2) - ZSIZE = 2; - ZFACTOR = 256/ZSIZE; - } - else - { - if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) - bs -= 1; - else - bs -= ceil((bs/5)+0.5f); - if(bs>1224) - bs = 1224; - if(bs<0) - bs = 0; - } - } - if(sdl_key==SDLK_RIGHTBRACKET){ - if(sdl_zoom_trig==1) - { - ZSIZE += 1; - if(ZSIZE>32) - ZSIZE = 32; - if(ZSIZE<2) - ZSIZE = 2; - ZFACTOR = 256/ZSIZE; - } - else - { - if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) - bs += 1; - else - bs += ceil((bs/5)+0.5f); - if(bs>1224) - bs = 1224; - if(bs<0) - bs = 0; - } - } - if(sdl_key==SDLK_SPACE) - sys_pause = !sys_pause; - if(sdl_key=='h') + if(sdl_key=='7') + { + set_cmode(6); + } + if(sdl_key==SDLK_LEFTBRACKET) { + if(sdl_zoom_trig==1) + { + ZSIZE -= 1; + if(ZSIZE>32) + ZSIZE = 32; + if(ZSIZE<2) + ZSIZE = 2; + ZFACTOR = 256/ZSIZE; + } + else + { + if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) + bs -= 1; + else + bs -= ceil((bs/5)+0.5f); + if(bs>1224) + bs = 1224; + if(bs<0) + bs = 0; + } + } + if(sdl_key==SDLK_RIGHTBRACKET) { + if(sdl_zoom_trig==1) + { + ZSIZE += 1; + if(ZSIZE>32) + ZSIZE = 32; + if(ZSIZE<2) + ZSIZE = 2; + ZFACTOR = 256/ZSIZE; + } + else + { + if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) + bs += 1; + else + bs += ceil((bs/5)+0.5f); + if(bs>1224) + bs = 1224; + if(bs<0) + bs = 0; + } + } + if(sdl_key==SDLK_SPACE) + sys_pause = !sys_pause; + if(sdl_key=='h') hud_enable = !hud_enable; if(sdl_key=='p') - dump_frame(vid_buf, XRES, YRES, XRES); + dump_frame(vid_buf, XRES, YRES, XRES+BARSIZE); if(sdl_key=='v'&&(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))) { if(clipboard_ready==1) @@ -1394,7 +1361,7 @@ int main(int argc, char *argv[]) if(sdl_key=='v') vs = !vs; if(vs) - dump_frame(vid_buf, XRES, YRES, XRES); + dump_frame(vid_buf, XRES, YRES, XRES+BARSIZE); #endif if(sdl_wheel) @@ -1441,7 +1408,7 @@ int main(int argc, char *argv[]) active_menu = i; } } - menu_ui_v3(vid_buf, active_menu, &sl, &sr, &psr, b, bq, x, y); + menu_ui_v3(vid_buf, active_menu, &sl, &sr, b, bq, x, y); if(zoom_en && x>=sdl_scale*zoom_wx && y>=sdl_scale*zoom_wy && x=19 && x<=35 && svf_last && svf_open) + if(x>=19 && x<=35 && svf_last && svf_open && !bq) parse_save(svf_last, svf_lsize, 1, 0, 0); if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) { @@ -1826,7 +1793,7 @@ int main(int argc, char *argv[]) if(lm == 1) { xor_line(lx, ly, x, y, vid_buf); - if(c==127 && lx>=0 && ly>=0 && lx=0 && ly>=0 && lx=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=7) + if(c!=127 || lx<0 || ly<0 || lx>=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=4) create_line(lx, ly, x, y, bs, c); } else @@ -2081,7 +2048,7 @@ int main(int argc, char *argv[]) { #ifdef BETA sprintf(uitext, "Version %d (Beta %d) FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); - //printf("%s\n", uitext); + //printf("%s\n", uitext); #else sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); #endif @@ -2110,16 +2077,16 @@ int main(int argc, char *argv[]) fillrect(vid_buf, 12, 12, textwidth(uitext)+8, 15, 0, 0, 0, 140); drawtext(vid_buf, 16, 16, uitext, 32, 216, 255, 200); } - sdl_blit(0, 0, XRES+BARSIZE, YRES+MENUSIZE, vid_buf, XRES+BARSIZE); + sdl_blit(0, 0, XRES+BARSIZE, YRES+MENUSIZE, vid_buf, XRES+BARSIZE); - //Setting an element for the stick man - if(isplayer==0) - { - if(ptypes[sr].falldown>0 || sr == PT_NEUT || sr == PT_PHOT) - player[2] = sr; - else - player[2] = PT_DUST; - } + //Setting an element for the stick man + if(isplayer==0) + { + if(ptypes[sr].falldown>0 || sr == PT_NEUT || sr == PT_PHOT) + player[2] = sr; + else + player[2] = PT_DUST; + } } diff --git a/md5.c b/src/md5.c similarity index 99% rename from md5.c rename to src/md5.c index 2e348e675..a51f4fea4 100644 --- a/md5.c +++ b/src/md5.c @@ -1,6 +1,6 @@ // based on public-domain code from Colin Plumb (1993) #include -#include "md5.h" +#include static unsigned getu32(const unsigned char *addr) { diff --git a/misc.c b/src/misc.c similarity index 96% rename from misc.c rename to src/misc.c index e32ec7ee7..7c551e277 100644 --- a/misc.c +++ b/src/misc.c @@ -219,6 +219,20 @@ void strcaturl(char *dst, char *src) *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"); diff --git a/powder.c b/src/powder.c similarity index 72% rename from powder.c rename to src/powder.c index 51b84099d..f578e2859 100644 --- a/powder.c +++ b/src/powder.c @@ -1,8 +1,9 @@ +#include #include -#include "defines.h" -#include "powder.h" -#include "air.h" -#include "misc.h" +#include +#include +#include +#include int isplayer = 0; float player[27]; //[0] is a command cell, [3]-[18] are legs positions, [19] is index, [19]-[26] are accelerations @@ -21,21 +22,109 @@ int pfree; unsigned pmap[YRES][XRES]; unsigned cb_pmap[YRES][XRES]; -int try_move(int i, int x, int y, int nx, int ny) +static int pn_junction_sprk(int x, int y, int pt) +{ + unsigned r = pmap[y][x]; + if((r & 0xFF) != pt) + return 0; + r >>= 8; + if(parts[r].type != pt) + return 0; + + parts[r].ctype = pt; + parts[r].type = PT_SPRK; + parts[r].life = 4; + return 1; +} + +static void photoelectric_effect(int nx, int ny) +{ + unsigned r = pmap[ny][nx]; + + if((r&0xFF) == PT_PSCN) { + if((pmap[ny][nx-1] & 0xFF) == PT_NSCN || + (pmap[ny][nx+1] & 0xFF) == PT_NSCN || + (pmap[ny-1][nx] & 0xFF) == PT_NSCN || + (pmap[ny+1][nx] & 0xFF) == PT_NSCN) + pn_junction_sprk(nx, ny, PT_PSCN); + } +} + +static int eval_move(int pt, int nx, int ny, unsigned *rr) { unsigned r; - if(nx<0 || ny<0 || nx>=XRES || ny>=YRES) return 0; - if(x==nx && y==ny) - return 1; + r = pmap[ny][nx]; if(r && (r>>8)>8].type; + if(rr) + *rr = r; - if(parts[i].type==PT_PHOT&&((r&0xFF)==PT_GLAS||(r&0xFF)==PT_PHOT||(r&0xFF)==PT_CLNE||((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) - { + if((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL) + return 1; + + if(pt==PT_NEUT && (r&0xFF)==PT_GLAS) + return 2; + + if(pt==PT_PHOT&&( + (r&0xFF)==PT_GLAS || (r&0xFF)==PT_PHOT || + (r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || + (r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || + ((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) + return 2; + + if(pt==PT_STKM) //Stick man's head shouldn't collide + return 2; + + if(bmap[ny/CELL][nx/CELL]==13 && ptypes[pt].falldown!=0 && pt!=PT_FIRE && pt!=PT_SMKE) + return 0; + if(ptypes[pt].falldown!=2 && bmap[ny/CELL][nx/CELL]==3) + return 0; + if((pt==PT_NEUT ||pt==PT_PHOT) && bmap[ny/CELL][nx/CELL]==7 && !emap[ny/CELL][nx/CELL]) + return 0; + + if(bmap[ny/CELL][nx/CELL]==9) + return 0; + + if(ptypes[pt].falldown!=1 && bmap[ny/CELL][nx/CELL]==10) + return 0; + + if (r && ((r&0xFF) >= PT_NUM || !can_move[pt][(r&0xFF)])) + return 0; + + if(pt == PT_PHOT) + return 2; + return 1; +} + +static void create_cherenkov_photon(int pp); + +int try_move(int i, int x, int y, int nx, int ny) +{ + unsigned r, e; + + if(x==nx && y==ny) + return 1; + + e = eval_move(parts[i].type, nx, ny, &r); + if(!e) { + if(!legacy_enable && parts[i].type==PT_PHOT) { + if((r & 0xFF) == PT_COAL || (r & 0xFF) == PT_BCOL) + parts[r>>8].temp = parts[i].temp; + if((r & 0xFF) < PT_NUM) + parts[i].temp = parts[r>>8].temp = + restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); + } + return 0; + } + if(e == 2) { + if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { + if(rand() < RAND_MAX/10) + create_cherenkov_photon(i); + } return 1; } @@ -51,50 +140,23 @@ int try_move(int i, int x, int y, int nx, int ny) { parts[r>>8].temp = restrict_flt(parts[r>>8].temp+parts[i].temp/2, MIN_TEMP, MAX_TEMP);//3.0f; } + return 0; } - - if(parts[i].type==PT_STKM) //Stick man's head shouldn't collide - { - return 1; - } - - if(bmap[ny/CELL][nx/CELL]==15 && !emap[y/CELL][x/CELL]) - { - return 1; - } - if(bmap[ny/CELL][nx/CELL]==20 && ptypes[parts[i].type].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE) - { - return 0; - } - if((bmap[y/CELL][x/CELL]==15 && !emap[y/CELL][x/CELL]) && (bmap[ny/CELL][nx/CELL]!=15 && !emap[ny/CELL][nx/CELL])) - { - return 0; - } - - if(ptypes[parts[i].type].falldown!=2 && bmap[ny/CELL][nx/CELL]==8) - return 0; - if((parts[i].type==PT_NEUT ||parts[i].type==PT_PHOT) && bmap[ny/CELL][nx/CELL]==3 && !emap[ny/CELL][nx/CELL]) - return 0; - if(r && (r>>8)= PT_NUM || !can_move[parts[i].type][(r&0xFF)])) - return 0; - if(parts[i].type==PT_CNCT && y>8)>8)>= 8; @@ -104,6 +166,150 @@ int try_move(int i, int x, int y, int nx, int ny) return 1; } +#define SURF_RANGE 10 +#define NORMAL_MIN_EST 3 +#define NORMAL_INTERP 20 +#define NORMAL_FRAC 16 + +#define REFRACT 0x80000000 + +/* heavy flint glass, for awesome refraction/dispersion + this way you can make roof prisms easily */ +#define GLASS_IOR 1.9 +#define GLASS_DISP 0.07 + +static unsigned direction_to_map(float dx, float dy) +{ + return (dx >= 0) | + (((dx + dy) >= 0) << 1) | /* 567 */ + ((dy >= 0) << 2) | /* 4+0 */ + (((dy - dx) >= 0) << 3) | /* 321 */ + ((dx <= 0) << 4) | + (((dx + dy) <= 0) << 5) | + ((dy <= 0) << 6) | + (((dy - dx) <= 0) << 7); +} + +static int is_blocking(int t, int x, int y) +{ + if(t & REFRACT) { + if(x<0 || y<0 || x>=XRES || y>=YRES) + return 0; + if((pmap[y][x] & 0xFF) == PT_GLAS) + return 1; + return 0; + } + + return !eval_move(t, x, y, NULL); +} + +static int is_boundary(int pt, int x, int y) +{ + if(!is_blocking(pt,x,y)) + return 0; + if(is_blocking(pt,x,y-1) && is_blocking(pt,x,y+1) && is_blocking(pt,x-1,y) && is_blocking(pt,x+1,y)) + return 0; + return 1; +} + +static int find_next_boundary(int pt, int *x, int *y, int dm, int *em) +{ + static int dx[8] = {1,1,0,-1,-1,-1,0,1}; + static int dy[8] = {0,1,1,1,0,-1,-1,-1}; + static int de[8] = {0x83,0x07,0x0E,0x1C,0x38,0x70,0xE0,0xC1}; + int i, ii, i0; + + if(*x <= 0 || *x >= XRES-1 || *y <= 0 || *y >= YRES-1) + return 0; + + if(*em != -1) { + i0 = *em; + dm &= de[i0]; + } else + i0 = 0; + + for(ii=0; ii<8; ii++) { + i = (ii + i0) & 7; + if((dm & (1 << i)) && is_boundary(pt, *x+dx[i], *y+dy[i])) { + *x += dx[i]; + *y += dy[i]; + *em = i; + return 1; + } + } + + return 0; +} + +int get_normal(int pt, int x, int y, float dx, float dy, float *nx, float *ny) +{ + int ldm, rdm, lm, rm; + int lx, ly, lv, rx, ry, rv; + int i, j; + float r, ex, ey; + + if(!dx && !dy) + return 0; + + if(!is_boundary(pt, x, y)) + return 0; + + ldm = direction_to_map(-dy, dx); + rdm = direction_to_map(dy, -dx); + lx = rx = x; + ly = ry = y; + lv = rv = 1; + lm = rm = -1; + + j = 0; + for(i=0; i= NORMAL_INTERP) + return 0; + + if(pt == PT_PHOT) + photoelectric_effect(x, y); + + return get_normal(pt, x, y, dx, dy, nx, ny); +} void kill_part(int i) { @@ -120,7 +326,7 @@ void kill_part(int i) pfree = i; } -#ifdef WIN32 +#if defined(WIN32) && !defined(__MINGW32__) _inline int create_part(int p, int x, int y, int t) #else inline int create_part(int p, int x, int y, int t) @@ -192,9 +398,7 @@ inline int create_part(int p, int x, int y, int t) (pmap[y][x]&0xFF)!=PT_ETRD && (pmap[y][x]&0xFF)!=PT_BRMT && (pmap[y][x]&0xFF)!=PT_NBLE && - (pmap[y][x]&0xFF)!=PT_INWR && - (pmap[y][x]&0xFF)!=PT_PWPO && - (pmap[y][x]&0xFF)!=PT_PWNE) + (pmap[y][x]&0xFF)!=PT_INWR) return -1; parts[pmap[y][x]>>8].type = PT_SPRK; parts[pmap[y][x]>>8].life = 4; @@ -229,6 +433,7 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = 0; parts[i].ctype = 0; parts[i].temp = ptypes[t].heat; + parts[i].tmp = 0; } if(t==PT_ACID) { @@ -239,16 +444,30 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = 150; } End Testing*/ + if(t==PT_FUSE) { + parts[i].life = 50; + parts[i].tmp = 50; + } + if(t==PT_FSEP) + parts[i].life = 50; + if(t==PT_COAL) { + parts[i].life = 110; + parts[i].tmp = 50; + } + if(t==PT_BCOL) + parts[i].life = 110; if(t==PT_FIRE) parts[i].life = rand()%50+120; if(t==PT_PLSM) parts[i].life = rand()%150+50; + if(t==PT_HFLM) + parts[i].life = rand()%150+50; if(t==PT_LAVA) parts[i].life = rand()%120+240; if(t==PT_NBLE) parts[i].life = 0; if(t==PT_ICEI) - parts[i].ctype = PT_WATR; + parts[i].ctype = PT_WATR; if(t==PT_NEUT) { float r = (rand()%128+128)/127.0f; @@ -259,29 +478,16 @@ inline int create_part(int p, int x, int y, int t) } if(t==PT_PHOT) { - float r = (rand()%3-1)*3; - float a = (rand()%3-1)*3; + float a = (rand()%8) * 0.78540f; parts[i].life = 680; - if(a==0.0f&&r==0.0f) - { - parts[i].life = 0; - parts[i].type = PT_NONE; - return -1; - } - else - { - parts[i].vx = a; - parts[i].vy = r; - } - //} else { - // parts[i].life = 0; - // parts[i].type = PT_NONE; - //}/ + parts[i].ctype = 0x3FFFFFFF; + parts[i].vx = 3.0f*cosf(a); + parts[i].vy = 3.0f*sinf(a); } - if(t!=PT_STKM) + if(t!=PT_STKM && t!=PT_PHOT && t!=PT_NEUT) pmap[y][x] = t|(i<<8); - else + else if(t==PT_STKM) { if(isplayer==0) { @@ -293,10 +499,10 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = 100; parts[i].ctype = 0; parts[i].temp = ptypes[t].heat; - - - player[3] = x-1; //Setting legs positions + + + player[3] = x-1; //Setting legs positions player[4] = y+6; player[5] = x-1; player[6] = y+6; @@ -323,50 +529,108 @@ inline int create_part(int p, int x, int y, int t) return i; } -#ifdef WIN32 +static void create_cherenkov_photon(int pp) +{ + int i, lr, nx, ny; + float r, eff_ior; + + if(pfree == -1) + return; + i = pfree; + + nx = (int)(parts[pp].x + 0.5f); + ny = (int)(parts[pp].y + 0.5f); + if((pmap[ny][nx] & 0xFF) != PT_GLAS) + return; + + if(hypotf(parts[pp].vx, parts[pp].vy) < 1.44f) + return; + + pfree = parts[i].life; + + lr = rand() % 2; + + parts[i].type = PT_PHOT; + parts[i].ctype = 0x00000F80; + parts[i].life = 680; + parts[i].x = parts[pp].x; + parts[i].y = parts[pp].y; + parts[i].temp = parts[pmap[ny][nx] >> 8].temp; + parts[i].tmp = 0; + + if(lr) { + parts[i].vx = parts[pp].vx - 2.5f*parts[pp].vy; + parts[i].vy = parts[pp].vy + 2.5f*parts[pp].vx; + } else { + parts[i].vx = parts[pp].vx + 2.5f*parts[pp].vy; + parts[i].vy = parts[pp].vy - 2.5f*parts[pp].vx; + } + + /* photons have speed of light. no discussion. */ + r = 1.269 / hypotf(parts[i].vx, parts[i].vy); + parts[i].vx *= r; + parts[i].vy *= r; +} + +#if defined(WIN32) && !defined(__MINGW32__) _inline void delete_part(int x, int y) #else inline void delete_part(int x, int y) #endif { unsigned i; + if(x<0 || y<0 || x>=XRES || y>=YRES) return; i = pmap[y][x]; if(!i || (i>>8)>=NPART) return; - if((parts[i>>8].type==PSR)||PSR==0||PSR==130) - { - kill_part(i>>8); - pmap[y][x] = 0; - } - else if(ptypes[parts[i>>8].type].menusection==SEC) - { - kill_part(i>>8); - pmap[y][x] = 0; - } - else - { - return; - } + + kill_part(i>>8); + pmap[y][x] = 0; // just in case } -#ifdef WIN32 +#if defined(WIN32) && !defined(__MINGW32__) _inline int is_wire(int x, int y) #else inline int is_wire(int x, int y) #endif { - return bmap[y][x]==4 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==2 || bmap[y][x]==14 || bmap[y][x]==15; + return bmap[y][x]==6 || bmap[y][x]==7 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==11 || bmap[y][x]==12; } -#ifdef WIN32 +#if defined(WIN32) && !defined(__MINGW32__) _inline int is_wire_off(int x, int y) #else inline int is_wire_off(int x, int y) #endif { - return (bmap[y][x]==4 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==2 || bmap[y][x]==14 || bmap[y][x]==15) && emap[y][x]<8; + return (bmap[y][x]==6 || bmap[y][x]==7 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==11 || bmap[y][x]==12) && emap[y][x]<8; +} + +int get_wavelength_bin(int *wm) +{ + int i, w0=30, wM=0; + + if(!*wm) + return -1; + + for(i=0; i<30; i++) + if(*wm & (1< wM) + wM = i; + } + + if(wM-w0 < 5) + return (wM+w0)/2; + + i = rand() % (wM-w0-3); + i += w0; + + *wm &= 0x1F << i; + return i + 2; } void set_emap(int x, int y) @@ -426,14 +690,14 @@ void set_emap(int x, int y) } } -#ifdef WIN32 +#if defined(WIN32) && !defined(__MINGW32__) _inline int parts_avg(int ci, int ni) #else inline int parts_avg(int ci, int ni) #endif { int pmr = pmap[(int)((parts[ci].y + parts[ni].y)/2)][(int)((parts[ci].x + parts[ni].x)/2)]; - if((pmr>>8) < NPART && (pmr>>8) >= 0) + if((pmr>>8) < NPART && (pmr>>8) >= 1) { return parts[pmr>>8].type; } @@ -443,6 +707,7 @@ inline int parts_avg(int ci, int ni) } } + int nearest_part(int ci, int t) { int distance = sqrt(pow(XRES, 2)+pow(YRES, 2)); @@ -468,29 +733,33 @@ int nearest_part(int ci, int t) void update_particles_i(pixel *vid, int start, int inc) { - int i, j, x, y, t, nx, ny, r, a, s, rt, fe, nt, lpv, nearp, pavg; - float mv, dx, dy, ix, iy, lx, ly, d, pp; - float pt = R_TEMP + 273.15f; + int i, j, x, y, t, nx, ny, r, a, s, lt, rt, fe, nt, lpv, nearp, pavg; + uint16_t tempu1, tempu2; + int16_t temps1, temps2; + float tempf1, tempf2; + float mv, dx, dy, ix, iy, lx, ly, d, pp, nrx, nry, dp; + float nn, ct1, ct2; + float pt = R_TEMP; float c_heat = 0.0f; int h_count = 0; int starti = (start*-1); for(i=start; i<(NPART-starti); i+=inc) if(parts[i].type) { - //printf("parts[%d].type: %d\n", i, parts[i].type); + //printf("parts[%d].type: %d\n", i, parts[i].type); lx = parts[i].x; ly = parts[i].y; t = parts[i].type; if(sys_pause&&!framerender) - return; + return; - if(parts[i].life && t!=PT_ACID && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM) + if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL) { - if(!(parts[i].life==10&&parts[i].type==PT_LCRY)) + if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_PWPO && t!=PT_PWNE) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR) { kill_part(i); continue; @@ -522,15 +791,15 @@ void update_particles_i(pixel *vid, int start, int inc) if(x<0 || y<0 || x>=XRES || y>=YRES || - ((bmap[y/CELL][x/CELL]==11 || - bmap[y/CELL][x/CELL]==2 || - bmap[y/CELL][x/CELL]==12 || - (bmap[y/CELL][x/CELL]==9) || - (bmap[y/CELL][x/CELL]==8 && ptypes[t].falldown!=2) || - (bmap[y/CELL][x/CELL]==13 && ptypes[t].falldown!=1) || - (bmap[y/CELL][x/CELL]==13 && ptypes[t].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE) || - (bmap[y/CELL][x/CELL]==4 && (t==PT_METL || t==PT_SPRK)) || - (bmap[y/CELL][x/CELL]==3 && !emap[y/CELL][x/CELL])) && (t!=PT_STKM))) + ((bmap[y/CELL][x/CELL]==1 || + bmap[y/CELL][x/CELL]==8 || + bmap[y/CELL][x/CELL]==9 || + (bmap[y/CELL][x/CELL]==2) || + (bmap[y/CELL][x/CELL]==3 && ptypes[t].falldown!=2) || + (bmap[y/CELL][x/CELL]==10 && ptypes[t].falldown!=1) || + (bmap[y/CELL][x/CELL]==13 && ptypes[t].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE) || + (bmap[y/CELL][x/CELL]==6 && (t==PT_METL || t==PT_SPRK)) || + (bmap[y/CELL][x/CELL]==7 && !emap[y/CELL][x/CELL])) && (t!=PT_STKM))) { kill_part(i); continue; @@ -589,8 +858,8 @@ void update_particles_i(pixel *vid, int start, int inc) } else { - parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL]; - parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + ptypes[t].gravity; + parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL]; + parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + ptypes[t].gravity; } if(ptypes[t].diffusion) @@ -600,7 +869,7 @@ void update_particles_i(pixel *vid, int start, int inc) } // interpolator -#ifdef WIN32 +#if defined(WIN32) && !defined(__MINGW32__) mv = max(fabsf(parts[i].vx), fabsf(parts[i].vy)); #else mv = fmaxf(fabsf(parts[i].vx), fabsf(parts[i].vy)); @@ -668,13 +937,13 @@ void update_particles_i(pixel *vid, int start, int inc) } if(t==PT_GAS && pv[y/CELL][x/CELL]<-6.0f) t = parts[i].type = PT_OIL; - if(t==PT_DESL && pv[y/CELL][x/CELL]>12.0f) // Only way I know to make it + if(t==PT_DESL && pv[y/CELL][x/CELL]>5.0f) // Only way I know to make it t = parts[i].type = PT_FIRE; // combust under pressure. if(t==PT_GAS && pv[y/CELL][x/CELL]>6.0f) t = parts[i].type = PT_OIL; if(t==PT_BMTL && pv[y/CELL][x/CELL]>2.5f) t = parts[i].type = PT_BRMT; - if(t==PT_BRCK && pv[y/CELL][x/CELL]>2.8f) + if(t==PT_BRCK && pv[y/CELL][x/CELL]>2.8f) t = parts[i].type = PT_STNE; //if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f) // t = parts[i].type = PT_BGLA; @@ -698,7 +967,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_SPRK&&parts[i].ctype==PT_ETRD&&parts[i].life==1) { nearp = nearest_part(i, PT_ETRD); - if(nearp!=-1) + if(nearp!=-1&&parts_avg(i, nearp)!=PT_INSL) { create_line((int)parts[i].x, (int)parts[i].y, (int)parts[nearp].x, (int)parts[nearp].y, 0, PT_PLSM); t = parts[i].type = PT_ETRD; @@ -715,9 +984,9 @@ void update_particles_i(pixel *vid, int start, int inc) int ctemp = pv[y/CELL][x/CELL]*2; c_heat = 0.0f; h_count = 0; - if(t==PT_ICEI && !parts[i].ctype) - parts[i].ctype = PT_WATR; - if(ptypes[t].hconduct>(rand()%250)) + if(t==PT_ICEI && !parts[i].ctype) + parts[i].ctype = PT_WATR; + if(ptypes[t].hconduct>(rand()%250)&&!(parts[i].type==PT_HSWC&&parts[i].life!=10)) { for(nx=-1; nx<2; nx++) { @@ -728,7 +997,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0) + if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)) { h_count++; c_heat += parts[r>>8].temp; @@ -746,7 +1015,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0) + if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)) { parts[r>>8].temp = parts[i].temp; } @@ -764,11 +1033,11 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_LAVA&&parts[i].ctype) { parts[i].life = 0; - if(parts[i].ctype==PT_THRM) - { - parts[i].tmp = 0; - parts[i].ctype = PT_BMTL; - } + if(parts[i].ctype==PT_THRM) + { + parts[i].tmp = 0; + parts[i].ctype = PT_BMTL; + } t = parts[i].type = parts[i].ctype; parts[i].ctype = PT_NONE; } @@ -783,7 +1052,7 @@ void update_particles_i(pixel *vid, int start, int inc) t = parts[i].type = pstates[t].solid; } } - else if((pt>=pstates[t].ltemp&&(pt<=pstates[t].gtemp||!pstates[t].gas)&&pstates[t].state==ST_SOLID&&pstates[t].liquid)||(t==PT_ICEI&&pt=pstates[t].ltemp&&(pt<=pstates[t].gtemp||!pstates[t].gas)&&pstates[t].state==ST_SOLID&&pstates[t].liquid)||(t==PT_ICEI&&pt>pstates[parts[i].ctype].stemp)) { if(pstates[t].liquid==PT_LAVA) { @@ -819,6 +1088,8 @@ void update_particles_i(pixel *vid, int start, int inc) pv[y/CELL][x/CELL] += 0.50f; if(t==PT_FIRE) parts[i].life = rand()%50+120; + if(t==PT_HFLM) + parts[i].life = rand()%50+120; } } if(t==PT_URAN && pv[y/CELL][x/CELL]>0.0f) @@ -829,11 +1100,11 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_LAVA) { parts[i].life = restrict_flt((pt-700)/7, 0.0f, 400.0f); - if(parts[i].ctype==PT_THRM&&parts[i].tmp>0) - { - parts[i].tmp--; - parts[i].temp = 3500; - } + if(parts[i].ctype==PT_THRM&&parts[i].tmp>0) + { + parts[i].tmp--; + parts[i].temp = 3500; + } } pt = parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP); } @@ -847,7 +1118,7 @@ void update_particles_i(pixel *vid, int start, int inc) pt = parts[i].temp -= 2.5f; } - if(t==PT_WATR || t==PT_ETRD || t==PT_SLTW || t==PT_METL || t==PT_RBDM || t==PT_LRBD || t==PT_BRMT || t==PT_PSCN || t==PT_NSCN || t==PT_NTCT || t==PT_PTCT || t==PT_BMTL || t==PT_SPRK|| t == PT_NBLE || t==PT_INWR || t==PT_PWPO || t==PT_PWNE) + if(t==PT_WATR || t==PT_ETRD || t==PT_SLTW || t==PT_METL || t==PT_RBDM || t==PT_LRBD || t==PT_BRMT || t==PT_PSCN || t==PT_NSCN || t==PT_NTCT || t==PT_PTCT || t==PT_BMTL || t==PT_SPRK|| t == PT_NBLE || t==PT_INWR) { nx = x % CELL; if(nx == 0) @@ -865,7 +1136,7 @@ void update_particles_i(pixel *vid, int start, int inc) ny = y/CELL; if(nx>=0 && ny>=0 && nx>8)>=NPART || !r) continue; - if(((r&0xFF)==PT_METL || (r&0xFF)==PT_ETRD || (r&0xFF)==PT_PSCN || (r&0xFF)==PT_NSCN || (r&0xFF)==PT_NTCT || (r&0xFF)==PT_PTCT || (r&0xFF)==PT_BMTL || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD || (r&0xFF)==PT_BRMT||(r&0xFF)==PT_NBLE||(r&0xFF)==PT_PWPO||(r&0xFF)==PT_PWNE)|| (r&0xFF)==PT_INWR && parts[r>>8].ctype!=PT_SPRK ) + if(((r&0xFF)==PT_METL || (r&0xFF)==PT_ETRD || (r&0xFF)==PT_PSCN || (r&0xFF)==PT_NSCN || (r&0xFF)==PT_NTCT || (r&0xFF)==PT_PTCT || (r&0xFF)==PT_BMTL || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD || (r&0xFF)==PT_BRMT||(r&0xFF)==PT_NBLE) || (r&0xFF)==PT_INWR && parts[r>>8].ctype!=PT_SPRK) + { t = parts[i].type = PT_NONE; parts[r>>8].ctype = parts[r>>8].type; @@ -945,6 +1217,143 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_COAL) + { + if(parts[i].life<=0) { + t = PT_NONE; + kill_part(i); + create_part(-1, x, y, PT_FIRE); + goto killed; + } else if(parts[i].life < 100) { + parts[i].life--; + create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_FIRE); + } + if((pv[y/CELL][x/CELL] > 4.3f)&&parts[i].tmp>40) + parts[i].tmp=39; + else if(parts[i].tmp<40&&parts[i].tmp>0) + parts[i].tmp--; + else if(parts[i].tmp<=0) { + t = PT_NONE; + kill_part(i); + r = create_part(-1, x, y, PT_BCOL); + goto killed; + } + for(nx=-2; nx<3; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500)) + { + if(parts[i].life>100) { + parts[i].life = 99; + } + } + } + } + else if(t==PT_BCOL) + { + if(parts[i].life<=0) { + t = PT_NONE; + kill_part(i); + create_part(-1, x, y, PT_FIRE); + goto killed; + } else if(parts[i].life < 100) { + parts[i].life--; + create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_FIRE); + } + + for(nx=-2; nx<3; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500)) + { + if(parts[i].life>100) { + parts[i].life = 99; + } + } + } + } + else if(t==PT_FUSE) + { + if(parts[i].life<=0) { + t = PT_NONE; + kill_part(i); + r = create_part(-1, x, y, PT_PLSM); + parts[r].life = 50; + goto killed; + } else if (parts[i].life < 40) { + parts[i].life--; + if((rand()%100)==0) { + r = create_part(-1, (nx=x+rand()%3-1), (ny=y+rand()%3-1), PT_PLSM); + parts[r].life = 50; + } + } + if((pv[y/CELL][x/CELL] > 2.7f)&&parts[i].tmp>40) + parts[i].tmp=39; + else if(parts[i].tmp<40&&parts[i].tmp>0) + parts[i].tmp--; + else if(parts[i].tmp<=0) { + t = PT_NONE; + kill_part(i); + r = create_part(-1, x, y, PT_FSEP); + goto killed; + } + for(nx=-2; nx<3; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if((r&0xFF)==PT_SPRK || ((parts[i].temp>=(273.15+700.0f)) && 1>(rand()%20))) + { + if(parts[i].life>40) { + parts[i].life = 39; + } + } + } + } + else if(t==PT_FSEP) + { + if(parts[i].life<=0) { + t = PT_NONE; + kill_part(i); + r = create_part(-1, x, y, PT_PLSM); + parts[r].life = 50; + goto killed; + } else if (parts[i].life < 40) { + parts[i].life--; + if((rand()%10)==0) { + r = create_part(-1, (nx=x+rand()%3-1), (ny=y+rand()%3-1), PT_PLSM); + parts[r].life = 50; + } + } + for(nx=-2; nx<3; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+400.0f)) && 1>(rand()%15)) + { + if(parts[i].life>40) { + parts[i].life = 39; + } + } + } + } else if(t==PT_NTCT||t==PT_PTCT||t==PT_INWR) { for(nx=-2; nx<3; nx++) @@ -985,7 +1394,7 @@ void update_particles_i(pixel *vid, int start, int inc) //t = parts[i].type = PT_WATR; } } - else if(t==PT_THRM) + else if(t==PT_THRM) { for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) @@ -996,18 +1405,18 @@ void update_particles_i(pixel *vid, int start, int inc) continue; if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM || (r&0xFF)==PT_LAVA)) { - if(1>(rand()%500)){ - t = parts[i].type = PT_LAVA; - parts[i].ctype = PT_BMTL; - pt = parts[i].temp = 3500.0f; - pv[y/CELL][x/CELL] += 50.0f; - } else { - t = parts[i].type = PT_LAVA; - parts[i].life = 400; - parts[i].ctype = PT_THRM; - pt = parts[i].temp = 3500.0f; - parts[i].tmp = 20; - } + if(1>(rand()%500)) { + t = parts[i].type = PT_LAVA; + parts[i].ctype = PT_BMTL; + pt = parts[i].temp = 3500.0f; + pv[y/CELL][x/CELL] += 50.0f; + } else { + t = parts[i].type = PT_LAVA; + parts[i].life = 400; + parts[i].ctype = PT_THRM; + pt = parts[i].temp = 3500.0f; + parts[i].tmp = 20; + } } //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) //t = parts[i].type = PT_WATR; @@ -1132,7 +1541,7 @@ void update_particles_i(pixel *vid, int start, int inc) continue; if((r&0xFF)!=PT_ACID) { - if ((r&0xFF)==PT_C4 || (r&0xFF)==PT_NITR || (r&0xFF)==PT_GUNP || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD) + if ((r&0xFF)==PT_PLEX || (r&0xFF)==PT_NITR || (r&0xFF)==PT_GUNP || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD) { t = parts[i].type = PT_FIRE; parts[i].life = 4; @@ -1187,16 +1596,16 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_DUST; if((r&0xFF)==PT_DYST && 15>(rand()%1000)) parts[r>>8].type = PT_YEST; - if((r&0xFF)==PT_YEST){ - if(15>(rand()%100000)&&isplayer==0) - parts[r>>8].type = PT_STKM; - else - parts[r>>8].type = PT_DYST; - } - + if((r&0xFF)==PT_YEST) { + if(15>(rand()%100000)&&isplayer==0) + parts[r>>8].type = PT_STKM; + else + parts[r>>8].type = PT_DYST; + } + if((r&0xFF)==PT_WATR && 15>(rand()%100)) parts[r>>8].type = PT_DSTW; - if((r&0xFF)==PT_C4&& 15>(rand()%1000)) + if((r&0xFF)==PT_PLEX && 15>(rand()%1000)) parts[r>>8].type = PT_GOO; if((r&0xFF)==PT_NITR && 15>(rand()%1000)) parts[r>>8].type = PT_DESL; @@ -1206,16 +1615,12 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_GAS; if((r&0xFF)==PT_COAL && 5>(rand()%100)) parts[r>>8].type = PT_WOOD; - if((r&0xFF)==PT_DUST && 5>(rand()%100)) - parts[r>>8].type = PT_FWRK; - if((r&0xFF)==PT_FWRK && 5>(rand()%100)) - parts[r>>8].ctype = PT_DUST; - /*if(parts[r>>8].type>1 && parts[r>>8].type!=PT_NEUT && parts[r>>8].type-1!=PT_NEUT && parts[r>>8].type-1!=PT_STKM && - (ptypes[parts[r>>8].type-1].menusection==SC_LIQUID|| - ptypes[parts[r>>8].type-1].menusection==SC_EXPLOSIVE|| - ptypes[parts[r>>8].type-1].menusection==SC_GAS|| - ptypes[parts[r>>8].type-1].menusection==SC_POWDERS) && 15>(rand()%1000)) - parts[r>>8].type--;*/ + /*if(parts[r>>8].type>1 && parts[r>>8].type!=PT_NEUT && parts[r>>8].type-1!=PT_NEUT && parts[r>>8].type-1!=PT_STKM && + (ptypes[parts[r>>8].type-1].menusection==SC_LIQUID|| + ptypes[parts[r>>8].type-1].menusection==SC_EXPLOSIVE|| + ptypes[parts[r>>8].type-1].menusection==SC_GAS|| + ptypes[parts[r>>8].type-1].menusection==SC_POWDERS) && 15>(rand()%1000)) + parts[r>>8].type--;*/ } } else if(t==PT_PHOT) @@ -1271,13 +1676,172 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_PCLN) + { + for(nx=-2; nx<3; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + rt = parts[r>>8].type; + if(rt==PT_SPRK) + { + if(parts[r>>8].ctype==PT_PSCN) + { + parts[i].life = 10; + } + else if(parts[r>>8].ctype==PT_NSCN) + { + parts[i].life = 9; + } + } + if(rt==PT_PCLN) + { + if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) + { + parts[i].life = 9; + } + else if(parts[i].life==0&&parts[r>>8].life==10) + { + parts[i].life = 10; + } + } + } + } + else if(t==PT_HSWC) + { + for(nx=-2; nx<3; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + rt = parts[r>>8].type; + if(rt==PT_SPRK) + { + if(parts[r>>8].ctype==PT_PSCN) + { + parts[i].life = 10; + } + else if(parts[r>>8].ctype==PT_NSCN) + { + parts[i].life = 9; + } + } + if(rt==PT_HSWC) + { + if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) + { + parts[i].life = 9; + } + else if(parts[i].life==0&&parts[r>>8].life==10) + { + parts[i].life = 10; + } + } + } + } + else if(t==PT_AMTR) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + rt = parts[r>>8].type; + if((r&0xFF)!=PT_AMTR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_NONE && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_BHOL) + { + t = parts[i].life++; + if(parts[i].life==3) + { + parts[i].type = PT_NONE; + kill_part(i); + } + parts[r>>8].life = 0; + parts[r>>8].type = PT_NONE; + kill_part(r>>8); + if(2>(rand()/(RAND_MAX/100))) + create_part(r>>8, x+nx, y+ny, PT_PHOT); + pv[y/CELL][x/CELL] -= 5.0f; + continue; + } + } + } + else if(t==PT_FIRW) { + if(parts[i].tmp==0) { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + rt = parts[r>>8].type; + if(rt==PT_FIRE||rt==PT_PLSM||rt==PT_THDR) + { + parts[i].tmp = 1; + parts[i].life = rand()%50+60; + } + } + } + else if(parts[i].tmp==1) { + if(parts[i].life==0) { + parts[i].tmp=2; + } else { + float newVel = parts[i].life/25; + parts[i].flags = parts[i].flags&0xFFFFFFFE; + if((pmap[(int)(ly-newVel)][(int)lx]&0xFF)==PT_NONE) { + parts[i].vy = -newVel; + ly-=newVel; + iy-=newVel; + } + } + } + else if(parts[i].tmp==2) { + int col = rand()%200+4; + for(nx=-2; nx<3; nx++) { + for(ny=-2; ny<3; ny++) { + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==PT_FIRW) { + parts[r>>8].vx = (rand()%3-1)*tmul; + parts[r>>8].vy = (rand()%3-1)*tmul; + parts[r>>8].tmp = col; + parts[r>>8].life = rand()%100+100; + parts[r>>8].temp = 6000.0f; + } + } + } + } + pv[y/CELL][x/CELL] += 20; + kill_part(i); + } else if(parts[i].tmp>=3) { + if(parts[i].life<=0) { + kill_part(i); + } + } + } else if(t==PT_BTRY) { rt = 3 + (int)pv[y/CELL][x/CELL]; for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) if(x+nx>=0 && y+ny>0 && - x+nx>8)>=NPART || !r) @@ -1293,36 +1857,36 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - }else if(t==PT_SWCH) + } else if(t==PT_SWCH) { rt = 3 + (int)pv[y/CELL][x/CELL]; for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) if(x+nx>=0 && y+ny>0 && - x+nx>8)>=NPART || !r) continue; rt = parts[r>>8].type; - if(parts[r>>8].type == PT_SWCH&&parts_avg(i,r>>8)!=PT_INSL) - { - if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) - { - parts[i].life = 9; - } - else if(parts[i].life==0&&parts[r>>8].life==10) - { - parts[i].life = 10; - } - } - } + if(parts[r>>8].type == PT_SWCH&&parts_avg(i,r>>8)!=PT_INSL) + { + if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) + { + parts[i].life = 9; + } + else if(parts[i].life==0&&parts[r>>8].life==10) + { + parts[i].life = 10; + } + } + } } - if(t==PT_SWCH) - if((parts[i].life>0&&parts[i].life<10)|| parts[i].life == 11) - { - parts[i].life--; - } + if(t==PT_SWCH) + if((parts[i].life>0&&parts[i].life<10)|| parts[i].life == 11) + { + parts[i].life--; + } if(t==PT_FIRE || t==PT_PLSM || t==PT_LAVA || t==PT_SPRK || fe || (t==PT_PHOT&&(1>rand()%10))) { for(nx=-2; nx<3; nx++) @@ -1426,7 +1990,6 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_SPRK && (rt==PT_METL||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)=373.0f)&&parts[i].ctype==PT_NTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp<=373.0f)&&parts[i].ctype==PT_PTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN)&&parts[i].ctype==PT_INWR) && pavg != PT_INSL &&!(parts[i].ctype==PT_SWCH&&(rt==PT_PSCN||rt==PT_NSCN)) ) { parts[r>>8].type = PT_SPRK; @@ -1434,10 +1997,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].ctype = rt; if(parts[r>>8].temp+10.0f<673.0f&&!legacy_enable&&!(rt==PT_LRBD||rt==PT_RBDM||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR)) parts[r>>8].temp = parts[r>>8].temp+10.0f; - } } - if(t==PT_SPRK && rt==PT_NTCT && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)>8].ctype = rt; } } - if(t==PT_SPRK && rt==PT_PWPO && parts[r>>8].life==0 && - (parts[i].life<3 || ((r>>8)1.0f) - { - parts[r>>8].type = PT_SPRK; - parts[r>>8].life = 4; - parts[r>>8].ctype = rt; - } - } - if(t==PT_SPRK && rt==PT_PWNE && parts[r>>8].life==0 && - (parts[i].life<3 || ((r>>8)>8].type = PT_SPRK; - parts[r>>8].life = 4; - parts[r>>8].ctype = rt; - } - } - if(t==PT_SPRK && rt==PT_WATR && parts[r>>8].life==0 && + if(t==PT_SPRK && rt==PT_WATR && parts[r>>8].life==0 && (parts[i].life<2 || ((r>>8)>8].type = PT_SPRK; @@ -1536,7 +2077,7 @@ killed: } if(t==PT_STKM) { - float dt = 0.9;///(FPSB*FPSB); //Delta time in square + float dt = 0.9;///(FPSB*FPSB); //Delta time in square //Tempirature handling if(parts[i].temp<243) parts[i].life -= 1; @@ -1546,7 +2087,7 @@ killed: //Death if(parts[i].life<1 || death == 1 || (pv[y/CELL][x/CELL]>=4.5f && player[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind... { - death = 0; + death = 0; for(r=-2; r<=1; r++) { create_part(-1, x+r, y-2, player[2]); @@ -1558,7 +2099,7 @@ killed: goto killed; } - parts[i].vy += -0.7*dt; //Head up! + parts[i].vy += -0.7*dt; //Head up! //Verlet integration pp = 2*player[3]-player[5]+player[19]*dt*dt;; @@ -1589,18 +2130,18 @@ killed: player[18] = player[16]; player[16] = pp; - //Setting acceleration to 0 - player[19] = 0; - player[20] = 0; + //Setting acceleration to 0 + player[19] = 0; + player[20] = 0; - player[21] = 0; - player[22] = 0; + player[21] = 0; + player[22] = 0; - player[23] = 0; - player[24] = 0; + player[23] = 0; + player[24] = 0; - player[25] = 0; - player[26] = 0; + player[25] = 0; + player[26] = 0; //Go left if (((int)(player[0])&0x01) == 0x01 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS) @@ -1610,32 +2151,32 @@ killed: { if (pmap[(int)(player[8]-1)][(int)(player[7])]) { - player[21] = -3; - player[22] = -2; - player[19] = -2; + player[21] = -3; + player[22] = -2; + player[19] = -2; } if (pmap[(int)(player[16]-1)][(int)(player[15])]) { player[25] = -3; - player[26] = -2; - player[23] = -2; + player[26] = -2; + player[23] = -2; } } else { if (pmap[(int)(player[8]-1)][(int)(player[7])]) //It should move another way in liquids { - player[21] = -1; - player[22] = -1; - player[19] = -1; + player[21] = -1; + player[22] = -1; + player[19] = -1; } if (pmap[(int)(player[16]-1)][(int)(player[15])]) { - player[25] = -1; - player[26] = -1; - player[23] = -1; + player[25] = -1; + player[26] = -1; + player[23] = -1; } } } @@ -1648,52 +2189,52 @@ killed: { if (pmap[(int)(player[8]-1)][(int)(player[7])]) { -player[21] = 3; -player[22] = -2; -player[19] = 2; + player[21] = 3; + player[22] = -2; + player[19] = 2; } if (pmap[(int)(player[16]-1)][(int)(player[15])]) { -player[25] = 3; -player[26] = -2; -player[23] = 2; + player[25] = 3; + player[26] = -2; + player[23] = 2; } } else { if (pmap[(int)(player[8]-1)][(int)(player[7])]) { -player[21] = 1; -player[22] = -1; -player[19] = 1; + player[21] = 1; + player[22] = -1; + player[19] = 1; } if (pmap[(int)(player[16]-1)][(int)(player[15])]) { -player[25] = 1; -player[26] = -1; -player[23] = 1; + player[25] = 1; + player[26] = -1; + player[23] = 1; } } } - //Jump - if (((int)(player[0])&0x04) == 0x04 && (pstates[pmap[(int)(player[8]-0.5)][(int)(player[7])]&0xFF].state != ST_GAS || pstates[pmap[(int)(player[16]-0.5)][(int)(player[15])]&0xFF].state != ST_GAS)) - { - if (pmap[(int)(player[8]-0.5)][(int)(player[7])] || pmap[(int)(player[16]-0.5)][(int)(player[15])]) - { - parts[i].vy = -5; - player[22] -= 1; - player[26] -= 1; - } - } + //Jump + if (((int)(player[0])&0x04) == 0x04 && (pstates[pmap[(int)(player[8]-0.5)][(int)(player[7])]&0xFF].state != ST_GAS || pstates[pmap[(int)(player[16]-0.5)][(int)(player[15])]&0xFF].state != ST_GAS)) + { + if (pmap[(int)(player[8]-0.5)][(int)(player[7])] || pmap[(int)(player[16]-0.5)][(int)(player[15])]) + { + parts[i].vy = -5; + player[22] -= 1; + player[26] -= 1; + } + } //Charge detector wall if foot inside - if(bmap[(int)(player[8]+0.5)/CELL][(int)(player[7]+0.5)/CELL]==4) + if(bmap[(int)(player[8]+0.5)/CELL][(int)(player[7]+0.5)/CELL]==6) set_emap((int)player[7]/CELL, (int)player[8]/CELL); - if(bmap[(int)(player[16]+0.5)/CELL][(int)(player[15]+0.5)/CELL]==4) + if(bmap[(int)(player[16]+0.5)/CELL][(int)(player[15]+0.5)/CELL]==6) set_emap((int)(player[15]+0.5)/CELL, (int)(player[16]+0.5)/CELL); //Searching for particles near head @@ -1703,9 +2244,9 @@ player[23] = 1; if(!pmap[ny+y][nx+x] || (pmap[ny+y][nx+x]>>8)>=NPART) continue; if(ptypes[pmap[ny+y][nx+x]&0xFF].falldown!=0 || (pmap[ny+y][nx+x]&0xFF) == PT_NEUT || (pmap[ny+y][nx+x]&0xFF) == PT_PHOT) - { - player[2] = pmap[ny+y][nx+x]&0xFF; //Current element - } + { + player[2] = pmap[ny+y][nx+x]&0xFF; //Current element + } if((pmap[ny+y][nx+x]&0xFF) == PT_PLNT && parts[i].life<100) //Plant gives him 5 HP { if(parts[i].life<=95) @@ -1720,8 +2261,8 @@ player[23] = 1; parts[i].life -= (102-parts[i].life)/2; kill_part(pmap[ny+y][nx+x]>>8); } - if(bmap[(ny+y)/CELL][(nx+x)/CELL]==7) - player[2] = SPC_AIR; + if(bmap[(ny+y)/CELL][(nx+x)/CELL]==4) + player[2] = SPC_AIR; } //Head position @@ -1741,10 +2282,10 @@ player[23] = 1; } else { - if(player[2] == SPC_AIR) - create_parts(nx + 3*((((int)player[1])&0x02) == 0x02) - 3*((((int)player[1])&0x01) == 0x01), ny, 4, SPC_AIR); - else - create_part(-1, nx, ny, player[2]); + if(player[2] == SPC_AIR) + create_parts(nx + 3*((((int)player[1])&0x02) == 0x02) - 3*((((int)player[1])&0x01) == 0x01), ny, 4, SPC_AIR); + else + create_part(-1, nx, ny, player[2]); r = pmap[ny][nx]; if( ((r>>8) < NPART) && (r>>8)>=0 && player[2] != PT_PHOT && player[2] != SPC_AIR) @@ -1797,11 +2338,11 @@ player[23] = 1; for(nx = -3; nx <= 3; nx++) { r = pmap[(int)(player[16]-2)][(int)(player[15]+nx)]; - if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) + if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) player[15] -= nx; r = pmap[(int)(player[8]-2)][(int)(player[7]+nx)]; - if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) + if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) player[7] -= nx; } @@ -1824,11 +2365,11 @@ player[23] = 1; } else { - if(pstates[r&0xFF].state != ST_GAS) - { - player[8] += ny-1; - parts[i].vy -= 0.5*parts[i].vy*dt; - } + if(pstates[r&0xFF].state != ST_GAS) + { + player[8] += ny-1; + parts[i].vy -= 0.5*parts[i].vy*dt; + } } player[9] = player[7]; } @@ -1850,10 +2391,10 @@ player[23] = 1; else { if(pstates[r&0xFF].state != ST_GAS) - { - player[16] += ny-1; - parts[i].vy -= 0.5*parts[i].vy*dt; - } + { + player[16] += ny-1; + parts[i].vy -= 0.5*parts[i].vy*dt; + } } player[17] = player[15]; } @@ -1870,14 +2411,14 @@ player[23] = 1; //Keeping legs distance if (pow((player[7] - player[15]), 2)<16 && pow((player[8]-player[16]), 2)<1) { - player[21] -= 0.2; - player[25] += 0.2; + player[21] -= 0.2; + player[25] += 0.2; } if (pow((player[3] - player[11]), 2)<16 && pow((player[4]-player[12]), 2)<1) { player[19] -= 0.2; - player[23] += 0.2; + player[23] += 0.2; } //If legs touch something @@ -1942,83 +2483,37 @@ player[23] = 1; else create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); } + if(parts[i].type==PT_PCLN) + { + if(!parts[i].ctype) + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx303&&parts[i].temp<317){ - create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_YEST); - } - } - if(t==PT_FWRK) - { - if((parts[i].temp>400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x])||parts[i].ctype==PT_DUST) - { - - create_part(-1, x , y-1 , PT_FWRK); - r = pmap[y-1][x]; - if(parts[r>>8].type==PT_FWRK) - { - parts[r>>8].vy = rand()%8-22; - parts[r>>8].vx = rand()%20-rand()%20; - parts[r>>8].life=rand()%30+50; - parts[i].type=PT_NONE; - } - } - if(parts[i].life>1) - { - parts[i].life--; - if(parts[i].life>=90&&parts[i].type==PT_FWRK) - 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); - int e = (rand()%255+1); - for(nx=-1; nx<2; nx++) - for(ny=-2; ny<3; ny++) - if(x+nx>=0 && y+ny>0 && - x+nx=rand()%8) - { - if(!pmap[y+ny][x+nx]) - { - create_part(-1, x+nx, y+ny , PT_DUST); - pv[y/CELL][x/CELL] += 2.00f*CFDS; - a= pmap[y+ny][x+nx]; - if(parts[a>>8].type==PT_DUST) - { - parts[a>>8].vy = -(rand()%10-1); - parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; - parts[a>>8].life= rand()%75+35; - parts[a>>8].tmp=q; - parts[a>>8].flags=w; - parts[a>>8].ctype=e; - parts[a>>8].temp= rand()%20+600; - } - } - } - - } - parts[i].type=PT_NONE; - } - } - if(t==PT_DUST&&!parts[i].life==0) - { - if(parts[i].life>=0) - { - parts[i].life--; - if(parts[i].life<1) - parts[i].type=PT_NONE; - } - - } + if(parts[i].temp>303&&parts[i].temp<317) { + create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_YEST); + } + } if(t==PT_PLSM&&parts[i].ctype == PT_NBLE&&parts[i].life <=1) { parts[i].type = PT_NBLE; parts[i].life = 0; } - if (t==PT_FIRE && parts[i].life <=1 && parts[i].temp<673) + if (t==PT_FIRE && parts[i].life <=1 && parts[i].temp<625) { t = parts[i].type = PT_SMKE; parts[i].life = rand()%20+250; @@ -2036,6 +2531,55 @@ player[23] = 1; continue; } + if(parts[i].type == PT_PHOT) { + rt = pmap[ny][nx] & 0xFF; + + if(rt==PT_CLNE) { + lt = pmap[ny][nx] >> 8; + if(!parts[lt].ctype) + parts[lt].ctype = PT_PHOT; + } + + lt = pmap[y][x] & 0xFF; + + r = eval_move(PT_PHOT, nx, ny, NULL); + + if(((rt==PT_GLAS && lt!=PT_GLAS) || (rt!=PT_GLAS && lt==PT_GLAS)) && r) { + if(!get_normal_interp(REFRACT|parts[i].type, x, y, parts[i].vx, parts[i].vy, &nrx, &nry)) { + kill_part(i); + continue; + } + + r = get_wavelength_bin(&parts[i].ctype); + if(r == -1) { + kill_part(i); + continue; + } + nn = GLASS_IOR - GLASS_DISP*(r-15)/15.0f; + nn *= nn; + + nrx = -nrx; + nry = -nry; + if(rt==PT_GLAS && lt!=PT_GLAS) + nn = 1.0f/nn; + ct1 = parts[i].vx*nrx + parts[i].vy*nry; + ct2 = 1.0f - (nn*nn)*(1.0f-(ct1*ct1)); + if(ct2 < 0.0f) { + parts[i].vx -= 2.0f*ct1*nrx; + parts[i].vy -= 2.0f*ct1*nry; + parts[i].x = lx; + parts[i].y = ly; + nx = (int)(lx + 0.5f); + ny = (int)(ly + 0.5f); + } else { + ct2 = sqrtf(ct2); + ct2 = ct2 - nn*ct1; + parts[i].vx = nn*parts[i].vx + ct2*nrx; + parts[i].vy = nn*parts[i].vy + ct2*nry; + } + } + } + rt = parts[i].flags & FLAG_STAGNANT; parts[i].flags &= ~FLAG_STAGNANT; if(!try_move(i, x, y, nx, ny)) @@ -2149,44 +2693,92 @@ player[23] = 1; else { parts[i].flags |= FLAG_STAGNANT; - if(nx>x+ISTP) nx=x+ISTP; - if(nxy+ISTP) ny=y+ISTP; - if(ny(rand()%1000)) { kill_part(i); continue; } - else if(try_move(i, x, y, 2*x-nx, ny)) + else if(t==PT_NEUT || t==PT_PHOT) { - parts[i].x = (float)(2*x-nx); - parts[i].y = (float)iy; - parts[i].vx *= ptypes[t].collision; - } - else if(try_move(i, x, y, nx, 2*y-ny)) - { - parts[i].x = (float)ix; - parts[i].y = (float)(2*y-ny); - parts[i].vy *= ptypes[t].collision; + r = pmap[ny][nx]; + + /* this should be replaced with a particle type attribute ("photwl" or something) */ + if((r & 0xFF) == PT_PSCN) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_NSCN) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_COAL) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_BCOL) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_PLEX) parts[i].ctype &= 0x1F00003E; + if((r & 0xFF) == PT_NITR) parts[i].ctype &= 0x0007C000; + if((r & 0xFF) == PT_NBLE) parts[i].ctype &= 0x3FFF8000; + if((r & 0xFF) == PT_LAVA) parts[i].ctype &= 0x3FF00000; + if((r & 0xFF) == PT_ACID) parts[i].ctype &= 0x1FE001FE; + if((r & 0xFF) == PT_DUST) parts[i].ctype &= 0x3FFFFFC0; + if((r & 0xFF) == PT_SNOW) parts[i].ctype &= 0x03FFFFFF; + if((r & 0xFF) == PT_GOO) parts[i].ctype &= 0x3FFAAA00; + if((r & 0xFF) == PT_PLNT) parts[i].ctype &= 0x0007C000; + if((r & 0xFF) == PT_PLUT) parts[i].ctype &= 0x001FCE00; + if((r & 0xFF) == PT_URAN) parts[i].ctype &= 0x003FC000; + + if(get_normal_interp(t, lx, ly, parts[i].vx, parts[i].vy, &nrx, &nry)) { + dp = nrx*parts[i].vx + nry*parts[i].vy; + parts[i].vx -= 2.0f*dp*nrx; + parts[i].vy -= 2.0f*dp*nry; + nx = (int)(parts[i].x + parts[i].vx + 0.5f); + ny = (int)(parts[i].y + parts[i].vy + 0.5f); + if(try_move(i, x, y, nx, ny)) { + parts[i].x = (float)nx; + parts[i].y = (float)ny; + } else { + kill_part(i); + continue; + } + } else { + kill_part(i); + continue; + } + + if(!parts[i].ctype) { + kill_part(i); + continue; + } } + else { - parts[i].vx *= ptypes[t].collision; - parts[i].vy *= ptypes[t].collision; + if(nx>x+ISTP) nx=x+ISTP; + if(nxy+ISTP) ny=y+ISTP; + if(ny=XRES-CELL || ny=YRES-CELL) - { + if(nx=XRES-CELL || ny=YRES-CELL) + { kill_part(i); continue; } } - if(framerender){ - framerender = 0; - sys_pause = 1; - } + if(framerender) { + framerender = 0; + sys_pause = 1; + } } void update_particles(pixel *vid) @@ -2209,8 +2801,10 @@ 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>1)&1; i>1)&1; i>1)&1; i>1)&1; i>1)&1; i121&&PSR<141)) - { - r = r/CELL; - x = x/CELL; - y = y/CELL; - x -= r/2; - y -= r/2; - for (ox=x; ox<=x+r; ox++) - { - for (oy=y; oy<=y+r; oy++) - { - if(ox>=0&&ox=0&&oy0||SEC>0))) - { - for(j=-r; j<=r; j++) - for(i=-r; i<=r; i++) - if(i*i+j*j<=r*r) - delete_part(x+i, y+j); - return 1; } - if(c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM) { for(j=-r; j<=r; j++) @@ -2988,6 +3540,15 @@ int create_parts(int x, int y, int r, int c) return 1; } + if(c == 0) + { + for(j=-r; j<=r; j++) + for(i=-r; i<=r; i++) + if(i*i+j*j<=r*r) + delete_part(x+i, y+j); + return 1; + } + for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) if(i*i+j*j<=r*r) diff --git a/update.c b/src/update.c similarity index 99% rename from update.c rename to src/update.c index ba32b54c6..99b9d1bc2 100644 --- a/update.c +++ b/src/update.c @@ -37,7 +37,7 @@ #include #endif -#include "update.h" +#include static char *exe_name(void) { From bff5961d602531b224821da54a874a09f1dba317 Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 28 Oct 2010 19:18:06 -0400 Subject: [PATCH 15/79] updating --- Makefile | 6 +- includes/defines.h | 16 +- includes/graphics.h | 6 +- includes/interface.h | 39 ++- includes/powder.h | 325 ++++++++------------ src/graphics.c | 244 ++++++++++----- src/interface.c | 708 ++++++++++++++++++++++++++++++++++++++++--- src/main.c | 21 +- src/powder.c | 440 ++++++++++++++++++--------- 9 files changed, 1333 insertions(+), 472 deletions(-) mode change 100755 => 100644 src/main.c diff --git a/Makefile b/Makefile index 8a25f401d..9e1f41ee4 100755 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ LFLAGS := -lSDL -lm -lbz2 MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3 MFLAGS_SSE2 := -march=native-DX86 -DX86_SSE2 -msse2 MFLAGS_SSE := -march=native -DX86 -DX86_SSE -FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2 +FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2 COMPILER := gcc LINUX_TARG := powder-64-sse2 powder-sse powder-sse2 WIN32_TARG := powder-sse.exe powder-sse2.exe @@ -14,7 +14,7 @@ WIN32_TARG := powder-sse.exe powder-sse2.exe powder: $(SOURCES) $(COMPILER) -DINTERNAL -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 powder-debug: $(SOURCES) - $(COMPILER) -m64 -o$@ $(FLAGS_DBUG) -DLIN64 $(SOURCES) + $(COMPILER) -m64 -o$@ $(FLAGS_DBUG) -DLIN64 $(SOURCES) -Iincludes/ -DLIN64 powder-sse3: $(SOURCES) $(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32 @@ -30,7 +30,7 @@ powder-64-sse3-opengl: $(SOURCES) $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 -lGL -lGLU -DOpenGL strip $@ powder-64-sse3: $(SOURCES) - $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 + $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 -j3 strip $@ mv $@ build powder-64-sse2: $(SOURCES) diff --git a/includes/defines.h b/includes/defines.h index a324e9f54..0f80ab69a 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -23,7 +23,7 @@ #define HTTP_TIMEOUT 10 #define MENUSIZE 40 -#define BARSIZE 14 +#define BARSIZE 17 #define XRES 612 #define YRES 384 #define NPART XRES*YRES @@ -62,6 +62,18 @@ typedef unsigned short pixel; typedef unsigned int pixel; #endif +#define SURF_RANGE 10 +#define NORMAL_MIN_EST 3 +#define NORMAL_INTERP 20 +#define NORMAL_FRAC 16 + +#define REFRACT 0x80000000 + +/* heavy flint glass, for awesome refraction/dispersion + this way you can make roof prisms easily */ +#define GLASS_IOR 1.9 +#define GLASS_DISP 0.07 + typedef unsigned char uint8; extern int amd; @@ -115,4 +127,4 @@ 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 \ No newline at end of file +#endif diff --git a/includes/graphics.h b/includes/graphics.h index 6a1507e94..ec0d597f0 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -77,6 +77,8 @@ extern inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a); +int drawtextwrap(pixel *vid, int x, int y, int w, 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); @@ -91,12 +93,14 @@ int drawtextmax(pixel *vid, int x, int y, int w, char *s, int r, int g, int b, i int textnwidth(char *s, int n); +int textnheight(char *s, int n, int w); + 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); +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); diff --git a/includes/interface.h b/includes/interface.h index 7f130649a..0f4dd3fd6 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -67,12 +67,32 @@ static menu_section msections[] = struct ui_edit { - int x, y, w, nx; + int x, y, w, nx, h; char str[256],*def; - int focus, cursor, hide; + int focus, cursor, hide, multiline; }; typedef struct ui_edit ui_edit; +struct save_info +{ + char *title; + char *name; + char *author; + char *date; + char *description; + int publish; + int voteup; + int votedown; + int vote; + int myvote; + int myfav; + char *tags; + int comment_count; + char *comments[6]; + char *commentauthors[6]; +}; +typedef struct save_info save_info; + struct ui_checkbox { int x, y; @@ -112,6 +132,7 @@ extern void *search_thumbs[GRID_X*GRID_Y]; extern int search_thsizes[GRID_X*GRID_Y]; extern int search_own; +extern int search_fav; extern int search_date; extern int search_page; extern char search_expr[256]; @@ -169,15 +190,27 @@ char *download_ui(pixel *vid_buf, char *uri, int *len); int search_ui(pixel *vid_buf); +int open_ui(pixel *vid_buf, char *save_id, char *save_date); + +int info_parse(char *info_data, save_info *info); + 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_delete(pixel *vid_buf, char *id); + +int execute_report(pixel *vid_buf, char *id); + +void execute_submit(pixel *vid_buf, char *id, char *message); + +void execute_fav(pixel *vid_buf, char *id); int execute_vote(pixel *vid_buf, char *id, char *action); +void open_link(char *uri); + #endif diff --git a/includes/powder.h b/includes/powder.h index 3b5e2f0d6..fbf79fc05 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -114,7 +114,9 @@ #define PT_BCOL 73 #define PT_PCLN 74 #define PT_HSWC 75 -#define PT_NUM 76 +#define PT_IRON 76 +#define PT_MORT 77 +#define PT_NUM 78 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -127,14 +129,18 @@ #define ST_LIQUID 2 #define ST_GAS 3 /* - We should start to implement these. + TODO: 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 TYPE_PART 0x0001 //1 Powders +#define TYPE_LIQUID 0x0002 //2 Liquids +#define TYPE_SOLID 0x0004 //4 Solids +#define TYPE_GAS 0x0008 //8 Gasses (Includes plasma) +#define TYPE_ENERGY 0x0018 //16 Energy (Thunder, Light, Neutrons etc.) +#define PROP_CONDUCTS 0x0020 //32 Conducts electricity (Currently Unused) +#define PROP_BLACK 0x0040 //64 Absorbs Photons +#define PROP_NEUTPENETRATE 0x0080 //128 Penetrated by neutrons +#define PROP_NEUTABSORB 0x0100 //256 Absorbs neutrons, reflect is default +#define PROP_DEADLY 0x0200 //512 Is deadly for stickman. #define FLAG_STAGNANT 1 struct particle @@ -167,6 +173,7 @@ struct part_type int meltable; int hardness; int menu; + int weight; int menusection; float heat; unsigned char hconduct; @@ -189,102 +196,111 @@ struct part_state }; typedef struct part_state part_state; //Should probably be const. +/* Weight Help + * 1 = Gas || + * 2 = Light || Liquids 0-49 + * 98 = Heavy || Powder 50-99 + * 100 = Solid || + * -1 is Neutrons and Photons + */ 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"}, - {"BCOL", PIXPACK(0x333333), 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 Coal. Heavy particles. See COAL"}, - {"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 + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weight 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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Erases particles.", 0}, + {"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, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, + {"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, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires.", TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTPENETRATE}, + {"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, 20, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable.", TYPE_LIQUID}, + {"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, 2, SC_EXPLOSIVE, R_TEMP+400.0f+273.15f, 88, "Ignites flammable materials. Heats air.", TYPE_GAS}, + {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Heavy particles. Meltable.", TYPE_PART}, + {"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, 45, SC_LIQUID, R_TEMP+1500.0f+273.15f, 60, "Heavy liquid. Ignites flammable materials. Solidifies when cold.", TYPE_LIQUID}, + {"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, 85, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 97, "Light dust. Explosive.", TYPE_PART}, + {"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, 23, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 50, "Liquid. Pressure sensitive explosive.", TYPE_LIQUID}, + {"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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Duplicates any particles it touches.", TYPE_SOLID}, + {"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, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Gas. Diffuses. Flammable. Liquifies under pressure.", TYPE_GAS}, + {"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, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive.", TYPE_SOLID}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure.", TYPE_SOLID}, + {"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, 100, SC_SOLIDS, R_TEMP-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air.", TYPE_SOLID}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Conducts electricity. Meltable.", TYPE_SOLID|PROP_CONDUCTS}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electricity. Conducted by metal and water.", TYPE_SOLID}, + {"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, 50, SC_POWDERS, R_TEMP-30.0f+273.15f, 46, "Light particles.", TYPE_PART}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Solid. Flammable.", TYPE_SOLID}, + {"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, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Neutrons. Interact with matter in odd ways.", TYPE_ENERGY}, + {"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, 90, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 251, "Heavy particles. Fissile. Generates neutrons under pressure.", TYPE_PART|PROP_NEUTPENETRATE}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Plant, drinks water and grows.", TYPE_SOLID}, + {"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, 10, SC_LIQUID, R_TEMP+0.0f +273.15f, 34, "Dissolves almost everything.", TYPE_LIQUID}, + {"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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Hole, will drain away any particles.", TYPE_SOLID}, + {"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, 1, SC_GAS, R_TEMP+100.0f+273.15f, 48, "Steam, heats up air, produced from hot water.", TYPE_GAS}, + {"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, 55, SC_POWDERS, R_TEMP+0.0f +273.15f, 100, "Concrete, stronger than stone.", TYPE_PART}, + {"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, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 23, "Distilled water, does not conduct electricity.", TYPE_LIQUID|PROP_NEUTPENETRATE}, + {"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, 75, SC_POWDERS, R_TEMP+0.0f +273.15f, 110, "Salt, dissolves in water.", TYPE_PART}, + {"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, 35, SC_LIQUID, R_TEMP+0.0f +273.15f, 75, "Saltwater, conducts electricity, difficult to freeze.", TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTPENETRATE}, + {"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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 186, "Diamond. Indestructable.", TYPE_SOLID}, //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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Breakable metal.", TYPE_SOLID|PROP_CONDUCTS}, + {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken metal.", TYPE_PART|PROP_CONDUCTS}, + {"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, -1, SC_ELEC, R_TEMP+900.0f+273.15f, 251, "Photons. Travel in straight lines.", TYPE_ENERGY}, + {"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, 90, SC_NUCLEAR, R_TEMP+30.0f+273.15f, 251, "Heavy particles. Generates heat under pressure.", TYPE_PART}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures.", TYPE_SOLID}, + {"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, 25, SC_LIQUID, R_TEMP+28.0f+273.15f, 44, "Liquid Wax.", TYPE_LIQUID}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "P-Type Silicon, Will transfer current to any conductor.", TYPE_SOLID}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "N-Type Silicon, Will only transfer current to P-Type Silicon.", TYPE_SOLID}, + {"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, 30, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold.", TYPE_LIQUID}, + {"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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Insulator, does not conduct heat or electricity.", TYPE_SOLID}, + {"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, 100, SC_SPECIAL, R_TEMP+70.0f+273.15f, 255, "Black hole, sucks in other particles and heats up.", TYPE_SOLID}, + {"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, 100, SC_SPECIAL, R_TEMP-16.0f+273.15f, 255, "White hole, pushes other particles away.", TYPE_SOLID}, + {"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, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 240, "Rubidium, explosive, especially on contact with water, low melting point", TYPE_SOLID|PROP_CONDUCTS}, + {"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, 45, SC_EXPLOSIVE, R_TEMP+45.0f+273.15f, 170, "Liquid Rubidium.", TYPE_LIQUID|PROP_CONDUCTS}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when hot (More than 100C)", TYPE_SOLID}, + {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Sand, Heavy particles. Meltable.", TYPE_PART}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure", TYPE_SOLID}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when cold (Less than 120C)", TYPE_SOLID}, + {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Glass, Heavy particles. Meltable. Bagels.", TYPE_PART}, + {"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, 1, SC_ELEC, 9000.0f +273.15f, 251, "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals.", TYPE_ENERGY}, + {"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, 1, SC_GAS, 9000.0f +273.15f, 115, "Plasma, extremely hot.", TYPE_GAS}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)", TYPE_SOLID}, + {"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, 100, SC_SOLIDS, 35.0f, 46, "Nitrogen Ice.", TYPE_SOLID}, + {"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, 1, SC_GAS, R_TEMP+2.0f +273.15f, 106, "Noble Gas. Diffuses. Conductive. Ionizes into plasma when intruduced to electricity", TYPE_GAS}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Generates Electricity.", TYPE_SOLID}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)", TYPE_SOLID}, + {"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, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!", 0}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)", TYPE_SOLID}, + {"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, 1, SC_GAS, R_TEMP+320.0f+273.15f, 88, "Smoke", TYPE_GAS}, + {"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, 15, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Explodes under high pressure and temperatures", TYPE_LIQUID}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly.", TYPE_SOLID}, + {"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, 30, SC_LIQUID, 80.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire", TYPE_LIQUID}, + {"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, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Gas. Ignites easily.", TYPE_GAS}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Insulated Wire. Doesn't conduct to metal or semiconductors.", TYPE_SOLID}, + {"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, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Yeast, grows when warm (~37C).", TYPE_PART}, + {"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, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Dead Yeast.", TYPE_PART}, + {"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, 90, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 211, "Thermite. Burns at extremly high temperature.", TYPE_PART}, + {"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, 40, SC_LIQUID, R_TEMP+20.0f+273.15f, 44, "Glow, Glows under pressure", TYPE_LIQUID}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Brick, breakable building material.", TYPE_SOLID}, + {"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, 2, SC_SPECIAL, 0.0f, 88, "Sub-zero flame.", TYPE_GAS}, + {"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, 55, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 70, "Fireworks!", TYPE_PART}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity.", TYPE_SOLID}, + {"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, 70, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Fuse Powder. See FUSE.", TYPE_PART}, + {"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, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Anti-Matter, Destroys a majority of particles", TYPE_PART}, //Maybe TYPE_ENERGY? + {"BCOL", PIXPACK(0x333333), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Coal. Heavy particles. See COAL", TYPE_PART}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches.", TYPE_SOLID}, + {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, + {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, + {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; static part_state pstates[PT_NUM] = { - // Name Solid Frzp Liquid Mpnt Gas Bpoint + // 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}, + /* 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}, + /* 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}, @@ -292,12 +308,12 @@ static part_state pstates[PT_NUM] = /* 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}, + /* 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}, + /* 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}, @@ -305,13 +321,13 @@ static part_state pstates[PT_NUM] = /* 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}, + /* 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}, + /* 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}, @@ -325,123 +341,32 @@ static part_state pstates[PT_NUM] = /* 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}, + /* 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}, + /* 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}, - /* BCOL */ {ST_SOLID, 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] = -{ - /* Water | Oil */ - /* Water 0 | 1 | Water displaces oil */ - /* Oil 0 | 0 | Oil doesn't displace water */ - - /* 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 B 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 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 O 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 L 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,0,0,0,0,0,0,0,0}, /* None */ - /* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0}, /* Dust */ - /* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,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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,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 B 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 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 O 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 L N C */ + /* 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}, + /* BCOL */ {ST_SOLID, 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}, + /* IRON */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; extern int isplayer; @@ -494,7 +419,7 @@ 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); +int parts_avg(int ci, int ni); #endif int nearest_part(int ci, int t); diff --git a/src/graphics.c b/src/graphics.c index 2c9a68649..d6604a3e5 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -745,15 +745,15 @@ 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) { - drawrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); + drawrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); if(hover==i) { - fillrect(vid_buf, XRES-2, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); - drawtext(vid_buf, XRES+1, (i*16)+YRES+MENUSIZE-14-(SC_TOTAL*16), msections[i].icon, 0, 0, 0, 255); + fillrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); + drawtext(vid_buf, (XRES+BARSIZE)-13, (i*16)+YRES+MENUSIZE-14-(SC_TOTAL*16), msections[i].icon, 0, 0, 0, 255); } else { - drawtext(vid_buf, XRES+1, (i*16)+YRES+MENUSIZE-14-(SC_TOTAL*16), msections[i].icon, 255, 255, 255, 255); + drawtext(vid_buf, (XRES+BARSIZE)-13, (i*16)+YRES+MENUSIZE-14-(SC_TOTAL*16), msections[i].icon, 255, 255, 255, 255); } } @@ -844,6 +844,62 @@ int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a #endif return x; } +int drawtextwrap(pixel *vid, int x, int y, int w, const char *s, int r, int g, int b, int a) +{ +#ifdef OpenGL +#else + int sx = x; + int rh = 12; + int rw = 0; + int cw = x; + for(; *s; s++) + { + if(*s == '\n') + { + x = sx; + rw = 0; + y += FONT_H+2; + } + else if(*s == '\b') + { + switch(s[1]) + { + case 'w': + r = g = b = 255; + break; + case 'g': + r = g = b = 192; + break; + case 'o': + r = 255; + g = 216; + b = 32; + break; + case 'r': + r = 255; + g = b = 0; + break; + case 'b': + r = g = 0; + b = 255; + break; + } + s++; + } + else + { + if(x-cw>=w) { + x = sx; + rw = 0; + y+=FONT_H+2; + rh+=FONT_H+2; + } + x = drawchar(vid, x, y, *(unsigned char *)s, r, g, b, a); + } + } +#endif + return rh; +} void drawrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a) { @@ -946,6 +1002,19 @@ int textnwidth(char *s, int n) } return x-1; } +int textnheight(char *s, int n, int w) +{ + int x = 0; + //TODO: Implement Textnheight for wrapped text + for(; *s; s++) + { + if(!n) + break; + x += font_data[font_ptrs[(int)(*(unsigned char *)s)]]; + n--; + } + return x-1; +} int textwidthx(char *s, int w) { @@ -1420,20 +1489,20 @@ void draw_parts(pixel *vid) cg = 0; cb = 0; cr = 0; - for(x=0; x<12; x++) { - cr += (parts[i].ctype >> (x+18)) & 1; - cb += (parts[i].ctype >> x) & 1; - } - for(x=0; x<14; x++) - cg += (parts[i].ctype >> (x+9)) & 1; - x = 624/(cr+cg+cb+1); - cr *= x; - cg *= x; - cb *= x; + for(x=0; x<12; x++) { + cr += (parts[i].ctype >> (x+18)) & 1; + cb += (parts[i].ctype >> x) & 1; + } + for(x=0; x<14; x++) + cg += (parts[i].ctype >> (x+9)) & 1; + x = 624/(cr+cg+cb+1); + cr *= x; + cg *= x; + cb *= x; vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr>255?255:cr,cg>255?255:cg,cb>255?255:cb); - cr >>= 4; - cg >>= 4; - cb >>= 4; + cr >>= 4; + cg >>= 4; + cb >>= 4; x = nx/CELL; y = ny/CELL; cg += fire_g[y][x]; @@ -1448,9 +1517,22 @@ void draw_parts(pixel *vid) } else { - cr = 0xFF; - cg = 0xFF; - cb = 0xFF; + cg = 0; + cb = 0; + cr = 0; + for(x=0; x<12; x++) { + cr += (parts[i].ctype >> (x+18)) & 1; + cb += (parts[i].ctype >> x) & 1; + } + for(x=0; x<14; x++) + cg += (parts[i].ctype >> (x+9)) & 1; + x = 624/(cr+cg+cb+1); + cr *= x; + cg *= x; + cb *= x; + cr = cr>255?255:cr; + cg = cg>255?255:cg; + cb = cb>255?255:cb; blendpixel(vid, nx, ny, cr, cg, cb, 192); blendpixel(vid, nx+1, ny, cr, cg, cb, 96); blendpixel(vid, nx-1, ny, cr, cg, cb, 96); @@ -1883,45 +1965,48 @@ void draw_parts(pixel *vid) } else if(t==PT_FIRE && parts[i].life) { - float ttemp = (float)parts[i].life; - int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); - uint8 R = flm_data[caddress]; - uint8 G = flm_data[caddress+1]; - uint8 B = flm_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) - { - cr = R/8; - cg = G/8; - cb = B/8; - x = nx/CELL; - y = ny/CELL; - cg += fire_g[y][x]; - if(cg > 255) cg = 255; - fire_g[y][x] = cg; - cb += fire_b[y][x]; - if(cb > 255) cb = 255; - fire_b[y][x] = cb; - cr += fire_r[y][x]; - if(cr > 255) cr = 255; - fire_r[y][x] = cr; - } - else - { - cr = R; - cg = G; - cb = B; - blendpixel(vid, nx, ny, cr, cg, cb, 192); - blendpixel(vid, nx+1, ny, cr, cg, cb, 96); - blendpixel(vid, nx-1, ny, cr, cg, cb, 96); - blendpixel(vid, nx, ny+1, cr, cg, cb, 96); - blendpixel(vid, nx, ny-1, cr, cg, cb, 96); - blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32); - blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32); - blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); - blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); - } - // Older Code - /*if(cmode == 3||cmode==4 || cmode==6) + float ttemp = (float)((int)(parts[i].life/2)); + int caddress = restrict_flt(restrict_flt(ttemp, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); + uint8 R = flm_data[caddress]; + uint8 G = flm_data[caddress+1]; + uint8 B = flm_data[caddress+2]; + if(cmode == 3||cmode==4 || cmode==6) + { + cr = R/8; + cg = G/8; + cb = B/8; + x = nx/CELL; + y = ny/CELL; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else + { + cr = parts[i].life * 8; + cg = parts[i].life * 2; + cb = parts[i].life; + if(cr>255) cr = 255; + if(cg>192) cg = 212; + if(cb>128) cb = 192; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + blendpixel(vid, nx+1, ny, cr, cg, cb, 96); + blendpixel(vid, nx-1, ny, cr, cg, cb, 96); + blendpixel(vid, nx, ny+1, cr, cg, cb, 96); + blendpixel(vid, nx, ny-1, cr, cg, cb, 96); + blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); + blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); + } + // Older Code + /*if(cmode == 3||cmode==4 || cmode==6) { cr = parts[i].life / 4; cg = parts[i].life / 16; @@ -2065,23 +2150,42 @@ void draw_parts(pixel *vid) } if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3)) { - uint8 R = PIXR(ptypes[t].pcolors); - uint8 G = PIXG(ptypes[t].pcolors); - uint8 B = PIXB(ptypes[t].pcolors); + if(t==PT_PHOT) { + cg = 0; + cb = 0; + cr = 0; + for(x=0; x<12; x++) { + cr += (parts[i].ctype >> (x+18)) & 1; + cb += (parts[i].ctype >> x) & 1; + } + for(x=0; x<14; x++) + cg += (parts[i].ctype >> (x+9)) & 1; + x = 624/(cr+cg+cb+1); + cr *= x; + cg *= x; + cb *= x; + cr = cr>255?255:cr; + cg = cg>255?255:cg; + cb = cb>255?255:cb; + } else { + cr = PIXR(ptypes[t].pcolors); + cg = PIXG(ptypes[t].pcolors); + cb = PIXB(ptypes[t].pcolors); + } //if(vid[(ny-1)*YRES+(nx-1)]!=0){ // blendpixel(vid, nx, ny-1, R, G, B, 46); //} - blendpixel(vid, nx+1, ny, R, G, B, 223); - blendpixel(vid, nx-1, ny, R, G, B, 223); - blendpixel(vid, nx, ny+1, R, G, B, 223); - blendpixel(vid, nx, ny-1, R, G, B, 223); + blendpixel(vid, nx+1, ny, cr, cg, cb, 223); + blendpixel(vid, nx-1, ny, cr, cg, cb, 223); + blendpixel(vid, nx, ny+1, cr, cg, cb, 223); + blendpixel(vid, nx, ny-1, cr, cg, cb, 223); - blendpixel(vid, nx+1, ny-1, R, G, B, 112); - blendpixel(vid, nx-1, ny-1, R, G, B, 112); - blendpixel(vid, nx+1, ny+1, R, G, B, 112); - blendpixel(vid, nx-1, ny+1, R, G, B, 112); + blendpixel(vid, nx+1, ny-1, cr, cg, cb, 112); + blendpixel(vid, nx-1, ny-1, cr, cg, cb, 112); + blendpixel(vid, nx+1, ny+1, cr, cg, cb, 112); + blendpixel(vid, nx-1, ny+1, cr, cg, cb, 112); } } #endif diff --git a/src/interface.c b/src/interface.c index bdec1114f..4ab7bf4ac 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1,3 +1,6 @@ +#ifdef MACOSX +#include +#endif #include #include #include @@ -46,6 +49,7 @@ void *search_thumbs[GRID_X*GRID_Y]; int search_thsizes[GRID_X*GRID_Y]; int search_own = 0; +int search_fav = 0; int search_date = 0; int search_page = 0; char search_expr[256] = ""; @@ -207,7 +211,7 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) strcpy(signs[i].text, ed.str); signs[i].ju = ju; } - +//TODO: Finish text wrapping in text edits void ui_edit_draw(pixel *vid_buf, ui_edit *ed) { int cx, i; @@ -225,8 +229,13 @@ void ui_edit_draw(pixel *vid_buf, ui_edit *ed) if(ed->str[0]) { - drawtext(vid_buf, ed->x, ed->y, str, 255, 255, 255, 255); - drawtext(vid_buf, ed->x+ed->w-11, ed->y-1, "\xAA", 128, 128, 128, 255); + if(ed->multiline){ + drawtextwrap(vid_buf, ed->x, ed->y, ed->w-14, str, 255, 255, 255, 255); + drawtext(vid_buf, ed->x+ed->w-11, ed->y-1, "\xAA", 128, 128, 128, 255); + } else { + drawtext(vid_buf, ed->x, ed->y, str, 255, 255, 255, 255); + drawtext(vid_buf, ed->x+ed->w-11, ed->y-1, "\xAA", 128, 128, 128, 255); + } } else if(!ed->focus) drawtext(vid_buf, ed->x, ed->y, ed->def, 128, 128, 128, 255); @@ -258,19 +267,35 @@ void ui_edit_process(int mx, int my, int mb, ui_edit *ed) else str = ed->str; - if(mx>=ed->x+ed->w-11 && mxx+ed->w && my>=ed->y-5 && myy+11) - { - ed->focus = 1; - ed->cursor = 0; - ed->str[0] = 0; - } - else if(mx>=ed->x-ed->nx && mxx+ed->w && my>=ed->y-5 && myy+11) - { - ed->focus = 1; - ed->cursor = textwidthx(str, mx-ed->x); - } - else - ed->focus = 0; + if(ed->multiline){ + if(mx>=ed->x+ed->w-11 && mxx+ed->w && my>=ed->y-5 && myy+11) + { + ed->focus = 1; + ed->cursor = 0; + ed->str[0] = 0; + } + else if(mx>=ed->x-ed->nx && mxx+ed->w && my>=ed->y-5 && myy+ed->h) + { + ed->focus = 1; + ed->cursor = textwidthx(str, mx-ed->x); + } + else + ed->focus = 0; + } else { + if(mx>=ed->x+ed->w-11 && mxx+ed->w && my>=ed->y-5 && myy+11) + { + ed->focus = 1; + ed->cursor = 0; + ed->str[0] = 0; + } + else if(mx>=ed->x-ed->nx && mxx+ed->w && my>=ed->y-5 && myy+11) + { + ed->focus = 1; + ed->cursor = textwidthx(str, mx-ed->x); + } + else + ed->focus = 0; + } } if(ed->focus && sdl_key) { @@ -335,19 +360,19 @@ void ui_edit_process(int mx, int my, int mb, ui_edit *ed) } ts[0]=ed->hide?0x8D:ch; ts[1]=0; - if(textwidth(str)+textwidth(ts) > ed->w-14) + if((textwidth(str)+textwidth(ts) > ed->w-14 && !ed->multiline) || (float)(((textwidth(str)+textwidth(ts))/(ed->w-14)*12) > ed->h && ed->multiline)) break; memmove(ed->str+ed->cursor+1, ed->str+ed->cursor, l+1-ed->cursor); ed->str[ed->cursor] = ch; ed->cursor++; } #else - if(sdl_ascii>=' ' && sdl_ascii<127) + if(sdl_ascii>=' ' && sdl_ascii<127 && l<255) { ch = sdl_ascii; ts[0]=ed->hide?0x8D:ch; ts[1]=0; - if(textwidth(str)+textwidth(ts) > ed->w-14) + if((textwidth(str)+textwidth(ts) > ed->w-14 && !ed->multiline) || (float)(((textwidth(str)+textwidth(ts))/(ed->w-14)*12) > ed->h && ed->multiline)) break; memmove(ed->str+ed->cursor+1, ed->str+ed->cursor, l+1-ed->cursor); ed->str[ed->cursor] = ch; @@ -1121,6 +1146,7 @@ int save_name_ui(pixel *vid_buf) ed.focus = 1; ed.hide = 0; ed.cursor = strlen(svf_name); + ed.multiline = 0; strcpy(ed.str, svf_name); cb.x = x0+10; @@ -1759,7 +1785,7 @@ corrupt: int search_ui(pixel *vid_buf) { - int uih=0,nyu,nyd,b=1,bq,mx=0,my=0,mxq=0,myq=0,mmt=0,gi,gj,gx,gy,pos,i,mp,dp,dap,own,last_own=search_own,page_count=0,last_page=0,last_date=0,j,w,h,st=0,lv; + int uih=0,nyu,nyd,b=1,bq,mx=0,my=0,mxq=0,myq=0,mmt=0,gi,gj,gx,gy,pos,i,mp,dp,dap,own,last_own=search_own,last_fav=search_fav,page_count=0,last_page=0,last_date=0,j,w,h,st=0,lv; int is_p1=0, exp_res=GRID_X*GRID_Y, tp, view_own=0; int thumb_drawn[GRID_X*GRID_Y]; pixel *v_buf = (pixel *)malloc(((YRES+MENUSIZE)*(XRES+BARSIZE))*PIXELSIZE); @@ -1817,6 +1843,7 @@ int search_ui(pixel *vid_buf) ed.focus = 1; ed.hide = 0; ed.cursor = strlen(search_expr); + ed.multiline = 0; strcpy(ed.str, search_expr); sdl_wheel = 0; @@ -1851,39 +1878,50 @@ int search_ui(pixel *vid_buf) if(!svf_login) { search_own = 0; - drawrect(vid_buf, XRES-64, 8, 56, 16, 96, 96, 96, 255); - drawtext(vid_buf, XRES-61, 11, "\x94", 96, 80, 16, 255); - drawtext(vid_buf, XRES-61, 11, "\x93", 128, 128, 128, 255); - drawtext(vid_buf, XRES-46, 13, "My Own", 128, 128, 128, 255); + drawrect(vid_buf, XRES-64+16, 8, 56, 16, 96, 96, 96, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x94", 96, 80, 16, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x93", 128, 128, 128, 255); + drawtext(vid_buf, XRES-46+16, 13, "My Own", 128, 128, 128, 255); } else if(search_own) { - fillrect(vid_buf, XRES-65, 7, 58, 18, 255, 255, 255, 255); - drawtext(vid_buf, XRES-61, 11, "\x94", 192, 160, 64, 255); - drawtext(vid_buf, XRES-61, 11, "\x93", 32, 32, 32, 255); - drawtext(vid_buf, XRES-46, 13, "My Own", 0, 0, 0, 255); + fillrect(vid_buf, XRES-65+16, 7, 58, 18, 255, 255, 255, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x94", 192, 160, 64, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x93", 32, 32, 32, 255); + drawtext(vid_buf, XRES-46+16, 13, "My Own", 0, 0, 0, 255); } else { - drawrect(vid_buf, XRES-64, 8, 56, 16, 192, 192, 192, 255); - drawtext(vid_buf, XRES-61, 11, "\x94", 192, 160, 32, 255); - drawtext(vid_buf, XRES-61, 11, "\x93", 255, 255, 255, 255); - drawtext(vid_buf, XRES-46, 13, "My Own", 255, 255, 255, 255); + drawrect(vid_buf, XRES-64+16, 8, 56, 16, 192, 192, 192, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x94", 192, 160, 32, 255); + drawtext(vid_buf, XRES-61+16, 11, "\x93", 255, 255, 255, 255); + drawtext(vid_buf, XRES-46+16, 13, "My Own", 255, 255, 255, 255); + } + + if(search_fav) + { + fillrect(vid_buf, XRES-134, 7, 18, 18, 255, 255, 255, 255); + drawtext(vid_buf, XRES-130, 11, "\xCC", 192, 160, 64, 255); + } + else + { + drawrect(vid_buf, XRES-134, 8, 16, 16, 192, 192, 192, 255); + drawtext(vid_buf, XRES-130, 11, "\xCC", 192, 160, 32, 255); } if(search_date) { - fillrect(vid_buf, XRES-130, 7, 62, 18, 255, 255, 255, 255); - drawtext(vid_buf, XRES-126, 11, "\xA6", 32, 32, 32, 255); - drawtext(vid_buf, XRES-111, 13, "By date", 0, 0, 0, 255); + fillrect(vid_buf, XRES-130+16, 7, 62, 18, 255, 255, 255, 255); + drawtext(vid_buf, XRES-126+16, 11, "\xA6", 32, 32, 32, 255); + drawtext(vid_buf, XRES-111+16, 13, "By date", 0, 0, 0, 255); } else { - drawrect(vid_buf, XRES-129, 8, 60, 16, 192, 192, 192, 255); - drawtext(vid_buf, XRES-126, 11, "\xA9", 144, 48, 32, 255); - drawtext(vid_buf, XRES-126, 11, "\xA8", 32, 144, 32, 255); - drawtext(vid_buf, XRES-126, 11, "\xA7", 255, 255, 255, 255); - drawtext(vid_buf, XRES-111, 13, "By votes", 255, 255, 255, 255); + drawrect(vid_buf, XRES-129+16, 8, 60, 16, 192, 192, 192, 255); + drawtext(vid_buf, XRES-126+16, 11, "\xA9", 144, 48, 32, 255); + drawtext(vid_buf, XRES-126+16, 11, "\xA8", 32, 144, 32, 255); + drawtext(vid_buf, XRES-126+16, 11, "\xA7", 255, 255, 255, 255); + drawtext(vid_buf, XRES-111+16, 13, "By votes", 255, 255, 255, 255); } if(search_page) @@ -2133,16 +2171,21 @@ int search_ui(pixel *vid_buf) if(sdl_key==SDLK_ESCAPE) goto finish; - if(b && !bq && mx>=XRES-64 && mx<=XRES-8 && my>=8 && my<=24 && svf_login) + if(b && !bq && mx>=XRES-64+16 && mx<=XRES-8+16 && my>=8 && my<=24 && svf_login) { search_own = !search_own; lasttime = TIMEOUT; } - if(b && !bq && mx>=XRES-129 && mx<=XRES-65 && my>=8 && my<=24) + if(b && !bq && mx>=XRES-129+16 && mx<=XRES-65+16 && my>=8 && my<=24) { search_date = !search_date; lasttime = TIMEOUT; } + if(b && !bq && mx>=XRES-134 && mx<=XRES-134+16 && my>=8 && my<=24) + { + search_fav = !search_fav; + lasttime = TIMEOUT; + } if(b && !bq && dp!=-1) if(confirm_ui(vid_buf, "Do you want to delete?", search_names[dp], "Delete")) @@ -2180,6 +2223,10 @@ int search_ui(pixel *vid_buf) if((b && !bq && mp!=-1 && !st && !uih) || do_open==1) { + if(open_ui(vid_buf, search_ids[mp], search_dates[mp]?search_dates[mp]:NULL)==1) { + goto finish; + } + /* fillrect(vid_buf, 0, 0, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 255); info_box(vid_buf, "Loading..."); @@ -2300,17 +2347,17 @@ int search_ui(pixel *vid_buf) if(data) free(data); - goto finish; + goto finish;*/ } if(!last) { search = 1; } - else if(!active && (strcmp(last, ed.str) || last_own!=search_own || last_date!=search_date || last_page!=search_page)) + else if(!active && (strcmp(last, ed.str) || last_own!=search_own || last_date!=search_date || last_page!=search_page || last_fav!=search_fav)) { search = 1; - if(strcmp(last, ed.str) || last_own!=search_own || last_date!=search_date) + if(strcmp(last, ed.str) || last_own!=search_own || last_fav!=search_fav || last_date!=search_date) { search_page = 0; page_count = 0; @@ -2328,8 +2375,10 @@ int search_ui(pixel *vid_buf) last_own = search_own; last_date = search_date; last_page = search_page; + last_fav = search_fav; active = 1; - uri = malloc(strlen(last)*3+80+strlen(SERVER)+strlen(svf_user)); + // TODO: Create a better fix for this bug + uri = malloc(strlen(last)*3+180+strlen(SERVER)+strlen(svf_user)+20); //Increase "padding" from 80 to 180 to fix the search memory corruption bug if(search_own || svf_admin || svf_mod) tmp = "&ShowVotes=true"; else @@ -2358,6 +2407,10 @@ int search_ui(pixel *vid_buf) strcaturl(uri, " user:"); strcaturl(uri, svf_user); } + if(search_fav) + { + strcaturl(uri, " cat:favs"); + } if(search_date) strcaturl(uri, " sort:date"); @@ -2495,6 +2548,449 @@ finish: return 0; } +int open_ui(pixel *vid_buf, char *save_id, char *save_date) +{ + int b=1,bq,mx,my,ca=0,thumb_w,thumb_h,active=0,active_2=0,cc=0,ccy=0,cix=0,hasdrawninfo=0,hasdrawnthumb=0,authoritah=0,myown=0,queue_open=0,data_size=0,retval=0,bc=255,openable=1; + char *uri, *uri_2, *o_uri; + void *data, *info_data; + save_info *info = malloc(sizeof(save_info)); + void *http = NULL, *http_2 = NULL; + int lasttime = TIMEOUT; + int status, status_2, info_ready = 0, data_ready = 0; + time_t http_last_use = HTTP_TIMEOUT, http_last_use_2 = HTTP_TIMEOUT; + pixel *save_pic;// = malloc((XRES/2)*(YRES/2)); + ui_edit ed; + + pixel *old_vid=(pixel *)calloc((XRES+BARSIZE)*(YRES+MENUSIZE), PIXELSIZE); + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + + fillrect(vid_buf, 50, 50, XRES+BARSIZE-100, YRES+MENUSIZE-100, 0, 0, 0, 255); + drawrect(vid_buf, 50, 50, XRES+BARSIZE-100, YRES+MENUSIZE-100, 255, 255, 255, 255); + 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); + + ed.x = 57+(XRES/2)+1; + ed.y = YRES+MENUSIZE-118; + ed.w = XRES+BARSIZE-114-((XRES/2)+1); + ed.h = 48; + ed.nx = 1; + ed.def = "Add comment"; + ed.focus = 1; + ed.hide = 0; + ed.multiline = 1; + ed.cursor = 0; + strcpy(ed.str, ""); + + memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); + + while(!sdl_poll()) + { + b = SDL_GetMouseState(&mx, &my); + if(!b) + break; + } + + //Begin Async loading of data + if(save_date) { + // We're loading an historical save + uri = malloc(strlen(save_id)*3+strlen(save_date)*3+strlen(SERVER)+71); + strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); + strcaturl(uri, save_id); + strappend(uri, "&Date="); + strcaturl(uri, save_date); + + uri_2 = malloc(strlen(save_id)*3+strlen(save_date)*3+strlen(SERVER)+71); + strcpy(uri_2, "http://" SERVER "/Info.api?ID="); + strcaturl(uri_2, save_id); + strappend(uri_2, "&Date="); + strcaturl(uri_2, save_date); + } else { + //We're loading a normal save + uri = malloc(strlen(save_id)*3+strlen(SERVER)+64); + strcpy(uri, "http://" SERVER "/Get.api?Op=save&ID="); + strcaturl(uri, save_id); + + uri_2 = malloc(strlen(save_id)*3+strlen(SERVER)+64); + strcpy(uri_2, "http://" SERVER "/Info.api?ID="); + strcaturl(uri_2, save_id); + } + http = http_async_req_start(http, uri, NULL, 0, 1); + http_2 = http_async_req_start(http_2, uri_2, NULL, 0, 1); + if(svf_login) + { + http_auth_headers(http, svf_user, svf_pass); + http_auth_headers(http_2, svf_user, svf_pass); + } + http_last_use = time(NULL); + http_last_use_2 = time(NULL); + free(uri); + free(uri_2); + active = 1; + active_2 = 1; + while(!sdl_poll()) + { + bq = b; + b = SDL_GetMouseState(&mx, &my); + mx /= sdl_scale; + my /= sdl_scale; + + if(active && http_async_req_status(http)) + { + int imgh, imgw, nimgh, nimgw; + http_last_use = time(NULL); + data = http_async_req_stop(http, &status, &data_size); + if(status == 200) + { + pixel *full_save = prerender_save(data, data_size, &imgw, &imgh); + save_pic = rescale_img(full_save, imgw, imgh, &thumb_w, &thumb_h, 2); + data_ready = 1; + free(full_save); + } + active = 0; + free(http); + http = NULL; + } + if(active_2 && http_async_req_status(http_2)) + { + http_last_use_2 = time(NULL); + info_data = http_async_req_stop(http_2, &status_2, NULL); + if(status_2 == 200) + { + info_ready = info_parse(info_data, info); + if(info_ready==-1) { + error_ui(vid_buf, 0, "Not found"); + break; + } + } + free(info_data); + active_2 = 0; + free(http_2); + http_2 = NULL; + } + + if(data_ready && !hasdrawnthumb) { + draw_image(vid_buf, save_pic, 51, 51, thumb_w, thumb_h, 255); + hasdrawnthumb = 1; + memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); + } + if(info_ready && !hasdrawninfo) { + //drawtext(vid_buf, 2, 2, info->name, 255, 255, 255, 255); + cix = drawtext(vid_buf, 60, (YRES/2)+60, info->name, 255, 255, 255, 255); + cix = drawtext(vid_buf, 60, (YRES/2)+72, "Author:", 255, 255, 255, 155); + cix = drawtext(vid_buf, cix+4, (YRES/2)+72, info->author, 255, 255, 255, 255); + cix = drawtext(vid_buf, cix+4, (YRES/2)+72, "Date:", 255, 255, 255, 155); + cix = drawtext(vid_buf, cix+4, (YRES/2)+72, info->date, 255, 255, 255, 255); + drawtextwrap(vid_buf, 62, (YRES/2)+86, (XRES/2)-24, info->description, 255, 255, 255, 200); + + ccy = 0; + for(cc=0; cccomment_count; cc++) { + drawtext(vid_buf, 60+(XRES/2)+1, ccy+60, info->commentauthors[cc], 255, 255, 255, 255); + ccy += 12; + ccy += drawtextwrap(vid_buf, 60+(XRES/2)+1, ccy+60, XRES+BARSIZE-100-((XRES/2)+1)-20, info->comments[cc], 255, 255, 255, 185); + ccy += 10; + draw_line(vid_buf, 50+(XRES/2)+2, ccy+52, XRES+BARSIZE-50, ccy+52, 100, 100, 100, XRES+BARSIZE); + } + hasdrawninfo = 1; + myown = svf_login && !strcmp(info->author, svf_user); + authoritah = svf_login && (!strcmp(info->author, svf_user) || svf_admin || svf_mod); + memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); + } + if(info_ready && svf_login){ + + fillrect(vid_buf, 50+(XRES/2)+1, YRES+MENUSIZE-125, XRES+BARSIZE-100-((XRES/2)+1), 75, 0, 0, 0, 255); + drawrect(vid_buf, 50+(XRES/2)+1, YRES+MENUSIZE-125, XRES+BARSIZE-100-((XRES/2)+1), 75, 200, 200, 200, 255); + + drawrect(vid_buf, 54+(XRES/2)+1, YRES+MENUSIZE-121, XRES+BARSIZE-108-((XRES/2)+1), 48, 255, 255, 255, 200); + + ui_edit_draw(vid_buf, &ed); + + 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); + } + + if(queue_open) { + if(info_ready && data_ready) { + // Do Open! + status = parse_save(data, data_size, 1, 0, 0); + if(!status) { + //if(svf_last) + //free(svf_last); + svf_last = data; + svf_lsize = data_size; + + svf_open = 1; + svf_own = svf_login && !strcmp(info->author, svf_user); + svf_publish = info->publish && svf_login && !strcmp(info->author, svf_user); + + strcpy(svf_id, save_id); + strcpy(svf_name, info->name); + if(info->tags) + { + strncpy(svf_tags, info->tags, 255); + svf_tags[255] = 0; + } else { + svf_tags[0] = 0; + } + svf_myvote = info->myvote; + retval = 1; + break; + } else { + queue_open = 0; + + svf_open = 0; + svf_publish = 0; + svf_own = 0; + svf_myvote = 0; + svf_id[0] = 0; + svf_name[0] = 0; + svf_tags[0] = 0; + if(svf_last) + free(svf_last); + svf_last = NULL; + error_ui(vid_buf, 0, "An Error Occurred"); + } + } else { + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 190); + drawtext(vid_buf, XRES+BARSIZE/2, XRES+MENUSIZE, "Loading...", 0, 0, 0, 200); + } + } + + //Open Button + bc = openable?255:150; + drawrect(vid_buf, 50, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); + drawtext(vid_buf, 73, YRES+MENUSIZE-63, "Open", 255, 255, 255, bc); + drawtext(vid_buf, 58, YRES+MENUSIZE-64, "\x81", 255, 255, 255, bc); + //Fav Button + bc = svf_login?255:150; + drawrect(vid_buf, 100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); + drawtext(vid_buf, 122, YRES+MENUSIZE-63, "Fav.", 255, 255, 255, bc); + drawtext(vid_buf, 107, YRES+MENUSIZE-64, "\xCC", 255, 255, 255, bc); + //Report Button + bc = (svf_login && info_ready)?255:150; + drawrect(vid_buf, 150, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); + drawtext(vid_buf, 168, YRES+MENUSIZE-63, "Report", 255, 255, 255, bc); + drawtext(vid_buf, 158, YRES+MENUSIZE-63, "!", 255, 255, 255, bc); + //Delete Button + bc = authoritah?255:150; + drawrect(vid_buf, 200, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); + drawtext(vid_buf, 218, YRES+MENUSIZE-63, "Delete", 255, 255, 255, bc); + drawtext(vid_buf, 206, YRES+MENUSIZE-64, "\xAA", 255, 255, 255, bc); + //Open in browser button + bc = 255; + drawrect(vid_buf, 250, YRES+MENUSIZE-68, 107, 18, 255, 255, 255, bc); + drawtext(vid_buf, 273, YRES+MENUSIZE-63, "Open in Browser", 255, 255, 255, bc); + drawtext(vid_buf, 258, YRES+MENUSIZE-64, "\x81", 255, 255, 255, bc); + + //Open Button + if(sdl_key==SDLK_RETURN && openable) { + queue_open = 1; + } + if(mx > 50 && mx < 50+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && openable) { + fillrect(vid_buf, 50, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + queue_open = 1; + } + } + //Fav Button + if(mx > 100 && mx < 100+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login) { + fillrect(vid_buf, 100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Adding to favourites..."); + execute_fav(vid_buf, save_id); + } + } + //Report Button + if(mx > 150 && mx < 150+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login && info_ready) { + fillrect(vid_buf, 150, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + if(confirm_ui(vid_buf, "Are you sure?", "Are you sure you wish to report this save?", "Report")){ + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Reporting..."); + if(execute_report(vid_buf, save_id)){ + info_ui(vid_buf, "Success", "This save has been reported"); + retval = 0; + break; + } + } + } + } + //Delete Button + if(mx > 200 && mx < 200+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && (authoritah || myown)) { + fillrect(vid_buf, 200, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + if(myown || !info->publish){ + if(confirm_ui(vid_buf, "Are you sure you wish to delete this?", "You will not be able recover it.", "Delete")){ + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Deleting..."); + if(execute_delete(vid_buf, save_id)){ + retval = 0; + break; + } + } + } else { + if(confirm_ui(vid_buf, "Are you sure?", "This save will be removed from the search index.", "Remove")){ + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Removing..."); + if(execute_delete(vid_buf, save_id)){ + retval = 0; + break; + } + } + } + } + } + //Open in browser button + if(mx > 250 && mx < 250+107 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50) { + fillrect(vid_buf, 250, YRES+MENUSIZE-68, 107, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + //TODO: Open link + o_uri = malloc(7+strlen(SERVER)+41+strlen(save_id)*3); + strcpy(o_uri, "http://" SERVER "/Browse/View.html?ID="); + strcaturl(o_uri, save_id); + open_link(o_uri); + free(o_uri); + } + } + //Submit Button + if(mx > XRES+BARSIZE-100 && mx < XRES+BARSIZE-100+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login && info_ready) { + fillrect(vid_buf, XRES+BARSIZE-100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + if(b && !bq) { + //Button Clicked + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Submitting Comment..."); + execute_submit(vid_buf, save_id, ed.str); + } + } + + sdl_blit(0, 0, (XRES+BARSIZE), YRES+MENUSIZE, vid_buf, (XRES+BARSIZE)); + memcpy(vid_buf, old_vid, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); + if(info_ready && svf_login){ + ui_edit_process(mx, my, b, &ed); + } + + if(sdl_key==SDLK_ESCAPE) + break; + + if(lasttimetitle = mystrdup(info_data+6); + j++; + } + else if(!strncmp(info_data, "NAME ", 5)) + { + info->name = mystrdup(info_data+5); + j++; + } + else if(!strncmp(info_data, "AUTHOR ", 7)) + { + info->author = mystrdup(info_data+7); + j++; + } + else if(!strncmp(info_data, "DATE ", 5)) + { + info->date = mystrdup(info_data+5); + j++; + } + else if(!strncmp(info_data, "DESCRIPTION ", 12)) + { + info->description = mystrdup(info_data+12); + j++; + } + else if(!strncmp(info_data, "VOTEUP ", 7)) + { + info->voteup = atoi(info_data+7); + j++; + } + else if(!strncmp(info_data, "VOTEDOWN ", 9)) + { + info->votedown = atoi(info_data+9); + j++; + } + else if(!strncmp(info_data, "VOTE ", 5)) + { + info->vote = atoi(info_data+5); + j++; + } + else if(!strncmp(info_data, "MYVOTE ", 7)) + { + info->myvote = atoi(info_data+7); + j++; + } + else if(!strncmp(info_data, "MYFAV ", 6)) + { + info->myfav = atoi(info_data+6); + j++; + } + else if(!strncmp(info_data, "PUBLISH ", 8)) + { + info->publish = atoi(info_data+8); + j++; + } + else if(!strncmp(info_data, "TAGS ", 5)) + { + info->tags = mystrdup(info_data+5); + j++; + } + else if(!strncmp(info_data, "COMMENT ", 8)) + { + if(info->comment_count>=6) { + info_data = p; + continue; + } else { + q = strchr(info_data+8, ' '); + *(q++) = 0; + info->commentauthors[info->comment_count] = mystrdup(info_data+8); + info->comments[info->comment_count] = mystrdup(q); + info->comment_count++; + } + j++; + } + info_data = p; + } + if(j>=8) { + return 1; + } else { + return -1; + } +} + int search_results(char *str, int votes) { int i,j; @@ -2890,7 +3386,7 @@ void execute_save(pixel *vid_buf) free(result); } -void execute_delete(pixel *vid_buf, char *id) +int execute_delete(pixel *vid_buf, char *id) { int status; char *result; @@ -2906,6 +3402,111 @@ void execute_delete(pixel *vid_buf, char *id) svf_user, svf_pass, &status, NULL); + if(status!=200) + { + error_ui(vid_buf, status, http_ret_text(status)); + if(result) + free(result); + return 0; + } + if(result && strncmp(result, "OK", 2)) + { + error_ui(vid_buf, 0, result); + free(result); + return 0; + } + + if(result) + free(result); + return 1; +} + +void execute_submit(pixel *vid_buf, char *id, char *message) +{ + int status; + char *result; + + char *names[] = {"ID", "Message", NULL}; + char *parts[2]; + + parts[0] = id; + parts[1] = message; + + result = http_multipart_post( + "http://" SERVER "/Comment.api", + names, parts, NULL, + svf_user, svf_pass, + &status, NULL); + + if(status!=200) + { + error_ui(vid_buf, status, http_ret_text(status)); + if(result) + free(result); + return; + } + if(result && strncmp(result, "OK", 2)) + { + error_ui(vid_buf, 0, result); + free(result); + return; + } + + if(result) + free(result); +} + +int execute_report(pixel *vid_buf, char *id) +{ + int status; + char *result; + + char *names[] = {"ID", NULL}; + char *parts[1]; + + parts[0] = id; + + result = http_multipart_post( + "http://" SERVER "/Report.api", + names, parts, NULL, + svf_user, svf_pass, + &status, NULL); + + if(status!=200) + { + error_ui(vid_buf, status, http_ret_text(status)); + if(result) + free(result); + return 0; + } + if(result && strncmp(result, "OK", 2)) + { + error_ui(vid_buf, 0, result); + free(result); + return 0; + } + + if(result) + free(result); + return 1; +} + +void execute_fav(pixel *vid_buf, char *id) +{ + int status; + char *result; + + char *names[] = {"ID", NULL}; + char *parts[1]; + + parts[0] = id; + + result = http_multipart_post( + "http://" SERVER "/Favourite.api", + names, parts, NULL, + svf_user, svf_pass, + &status, NULL); + if(status!=200) { error_ui(vid_buf, status, http_ret_text(status)); @@ -2959,3 +3560,16 @@ int execute_vote(pixel *vid_buf, char *id, char *action) free(result); return 1; } +void open_link(char *uri){ +#ifdef WIN32 + ShellExecute(0, "OPEN", uri, NULL, NULL, 0) +#elif MACOSX + //LSOpenCFURLRef(CFURLCreateWithString(NULL, CFStringCreateWithCString(NULL, uri, 0) ,NULL), NULL); //TODO: Get this crap working +#elif LIN32 + execvp("xdg-open", uri); +#elif LIN64 + execvp("xdg-open", uri); +#else + printf("Cannot open browser\n"); +#endif +} diff --git a/src/main.c b/src/main.c old mode 100755 new mode 100644 index d88b9726b..5ef9ce304 --- a/src/main.c +++ b/src/main.c @@ -270,8 +270,11 @@ void *build_save(int *size, int x0, int y0, int w, int h) { x = (int)(parts[i].x+0.5f); y = (int)(parts[i].y+0.5f); - if(x>=x0 && x=y0 && y=x0 && x=y0 && y= size) goto corrupt; j=d[p++]; - if(j >= PT_NUM) - goto corrupt; + if(j >= PT_NUM) { + //TODO: Possibly some server side translation + j = PT_DUST;//goto corrupt; + } if(j)// && !(isplayer == 1 && j==PT_STKM)) { if(pmap[y][x]) { k = pmap[y][x]>>8; parts[k].type = j; + if(j == PT_PHOT) + parts[k].ctype = 0x3fffffff; parts[k].x = (float)x; parts[k].y = (float)y; m[(x-x0)+(y-y0)*w] = k+1; @@ -519,6 +526,8 @@ int parse_save(void *save, int size, int replace, int x0, int y0) else if(i < nf) { parts[fp[i]].type = j; + if(j == PT_PHOT) + parts[fp[i]].ctype = 0x3fffffff; parts[fp[i]].x = (float)x; parts[fp[i]].y = (float)y; m[(x-x0)+(y-y0)*w] = fp[i]+1; @@ -629,7 +638,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) { i = m[j]; ty = d[pty+j]; - if(i && (ty==PT_CLNE || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34))) + if(i && (ty==PT_CLNE || (ty==PT_PCLN && ver>=43) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34))) { if(p >= size) goto corrupt; diff --git a/src/powder.c b/src/powder.c index f578e2859..fc645a5e5 100644 --- a/src/powder.c +++ b/src/powder.c @@ -26,10 +26,10 @@ static int pn_junction_sprk(int x, int y, int pt) { unsigned r = pmap[y][x]; if((r & 0xFF) != pt) - return 0; + return 0; r >>= 8; if(parts[r].type != pt) - return 0; + return 0; parts[r].ctype = pt; parts[r].type = PT_SPRK; @@ -42,14 +42,19 @@ static void photoelectric_effect(int nx, int ny) unsigned r = pmap[ny][nx]; if((r&0xFF) == PT_PSCN) { - if((pmap[ny][nx-1] & 0xFF) == PT_NSCN || - (pmap[ny][nx+1] & 0xFF) == PT_NSCN || - (pmap[ny-1][nx] & 0xFF) == PT_NSCN || - (pmap[ny+1][nx] & 0xFF) == PT_NSCN) - pn_junction_sprk(nx, ny, PT_PSCN); + if((pmap[ny][nx-1] & 0xFF) == PT_NSCN || + (pmap[ny][nx+1] & 0xFF) == PT_NSCN || + (pmap[ny-1][nx] & 0xFF) == PT_NSCN || + (pmap[ny+1][nx] & 0xFF) == PT_NSCN) + pn_junction_sprk(nx, ny, PT_PSCN); } } - +/* + RETURN-value explenation +1 = Swap +0 = No move/Bounce +2 = Both particles occupy the same space. + */ static int eval_move(int pt, int nx, int ny, unsigned *rr) { unsigned r; @@ -64,15 +69,13 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) *rr = r; if((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL) - return 1; - - if(pt==PT_NEUT && (r&0xFF)==PT_GLAS) - return 2; + return 1; if(pt==PT_PHOT&&( (r&0xFF)==PT_GLAS || (r&0xFF)==PT_PHOT || (r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || - (r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || + (r&0xFF)==PT_GLOW || (r&0xFF)==PT_WATR || + (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || ((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) return 2; @@ -92,15 +95,25 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) if(ptypes[pt].falldown!=1 && bmap[ny/CELL][nx/CELL]==10) return 0; - if (r && ((r&0xFF) >= PT_NUM || !can_move[pt][(r&0xFF)])) + if(ptypes[pt].properties&TYPE_ENERGY && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&TYPE_ENERGY)))) + return 2; + + if(pt==PT_NEUT && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE)))) + return 1; + if((r&0xFF)==PT_NEUT && ptypes[pt].properties&PROP_NEUTPENETRATE) + return 0; + + if (r && ((r&0xFF) >= PT_NUM || (ptypes[pt].weight <= ptypes[(r&0xFF)].weight))) return 0; - if(pt == PT_PHOT) + if(pt == PT_PHOT) return 2; + return 1; } static void create_cherenkov_photon(int pp); +static void create_gain_photon(int pp); int try_move(int i, int x, int y, int nx, int ny) { @@ -110,21 +123,39 @@ int try_move(int i, int x, int y, int nx, int ny) return 1; e = eval_move(parts[i].type, nx, ny, &r); - if(!e) { - if(!legacy_enable && parts[i].type==PT_PHOT) { + + /* half-silvered mirror */ + if(!e && parts[i].type==PT_PHOT && + (((r&0xFF)==PT_BMTL && rand()>8].temp = parts[i].temp; + if((r & 0xFF) < PT_NUM) - parts[i].temp = parts[r>>8].temp = - restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); + parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); } return 0; } - if(e == 2) { - if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { - if(rand() < RAND_MAX/10) - create_cherenkov_photon(i); - } + + if(e == 2) + { + if(parts[i].type == PT_PHOT && (r&0xFF)==PT_GLOW && !parts[r>>8].life) + if(rand() < RAND_MAX/30) + { + parts[r>>8].life = 120; + create_gain_photon(i); + } + + if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { + if(rand() < RAND_MAX/10) + create_cherenkov_photon(i); + } return 1; } @@ -154,29 +185,24 @@ int try_move(int i, int x, int y, int nx, int ny) if(r && (r>>8)> 8; + if(r && e>8)>= 8; - parts[r].x += x-nx; - parts[r].y += y-ny; - } - return 1; } -#define SURF_RANGE 10 -#define NORMAL_MIN_EST 3 -#define NORMAL_INTERP 20 -#define NORMAL_FRAC 16 - -#define REFRACT 0x80000000 - -/* heavy flint glass, for awesome refraction/dispersion - this way you can make roof prisms easily */ -#define GLASS_IOR 1.9 -#define GLASS_DISP 0.07 static unsigned direction_to_map(float dx, float dy) { @@ -306,7 +332,7 @@ int get_normal_interp(int pt, float x0, float y0, float dx, float dy, float *nx, return 0; if(pt == PT_PHOT) - photoelectric_effect(x, y); + photoelectric_effect(x, y); return get_normal(pt, x, y, dx, dy, nx, ny); } @@ -314,19 +340,21 @@ int get_normal_interp(int pt, float x0, float y0, float dx, float dy, float *nx, void kill_part(int i) { int x, y; + + if(parts[i].type != PT_PHOT) { + 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].type = PT_SPRK; @@ -476,11 +505,15 @@ inline int create_part(int p, int x, int y, int t) parts[i].vx = r*cosf(a); parts[i].vy = r*sinf(a); } + if(t==PT_MORT) + { + parts[i].vx = 2; + } if(t==PT_PHOT) { - float a = (rand()%8) * 0.78540f; + float a = (rand()%8) * 0.78540f; parts[i].life = 680; - parts[i].ctype = 0x3FFFFFFF; + parts[i].ctype = 0x3FFFFFFF; parts[i].vx = 3.0f*cosf(a); parts[i].vy = 3.0f*sinf(a); } @@ -529,6 +562,51 @@ inline int create_part(int p, int x, int y, int t) return i; } +static void create_gain_photon(int pp) +{ + float xx, yy; + int i, lr, temp_bin, nx, ny; + + if(pfree == -1) + return; + i = pfree; + + lr = rand() % 2; + + if(lr) { + xx = parts[pp].x - 0.3*parts[pp].vy; + yy = parts[pp].y + 0.3*parts[pp].vx; + } else { + xx = parts[pp].x + 0.3*parts[pp].vy; + yy = parts[pp].y - 0.3*parts[pp].vx; + } + + nx = (int)(xx + 0.5f); + ny = (int)(yy + 0.5f); + + if(nx<0 || ny<0 || nx>=XRES || ny>=YRES) + return; + + if((pmap[ny][nx] & 0xFF) != PT_GLOW) + return; + + pfree = parts[i].life; + + parts[i].type = PT_PHOT; + parts[i].life = 680; + parts[i].x = xx; + parts[i].y = yy; + parts[i].vx = parts[pp].vx; + parts[i].vy = parts[pp].vy; + parts[i].temp = parts[pmap[ny][nx] >> 8].temp; + parts[i].tmp = 0; + + temp_bin = (int)((parts[i].temp-273.0f)*0.25f); + if(temp_bin < 0) temp_bin = 0; + if(temp_bin > 25) temp_bin = 25; + parts[i].ctype = 0x1F << temp_bin; +} + static void create_cherenkov_photon(int pp) { int i, lr, nx, ny; @@ -541,10 +619,10 @@ static void create_cherenkov_photon(int pp) nx = (int)(parts[pp].x + 0.5f); ny = (int)(parts[pp].y + 0.5f); if((pmap[ny][nx] & 0xFF) != PT_GLAS) - return; + return; if(hypotf(parts[pp].vx, parts[pp].vy) < 1.44f) - return; + return; pfree = parts[i].life; @@ -559,11 +637,11 @@ static void create_cherenkov_photon(int pp) parts[i].tmp = 0; if(lr) { - parts[i].vx = parts[pp].vx - 2.5f*parts[pp].vy; - parts[i].vy = parts[pp].vy + 2.5f*parts[pp].vx; + parts[i].vx = parts[pp].vx - 2.5f*parts[pp].vy; + parts[i].vy = parts[pp].vy + 2.5f*parts[pp].vx; } else { - parts[i].vx = parts[pp].vx + 2.5f*parts[pp].vy; - parts[i].vy = parts[pp].vy - 2.5f*parts[pp].vx; + parts[i].vx = parts[pp].vx + 2.5f*parts[pp].vy; + parts[i].vy = parts[pp].vy - 2.5f*parts[pp].vx; } /* photons have speed of light. no discussion. */ @@ -572,7 +650,7 @@ static void create_cherenkov_photon(int pp) parts[i].vy *= r; } -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 _inline void delete_part(int x, int y) #else inline void delete_part(int x, int y) @@ -590,7 +668,7 @@ inline void delete_part(int x, int y) pmap[y][x] = 0; // just in case } -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 _inline int is_wire(int x, int y) #else inline int is_wire(int x, int y) @@ -599,7 +677,7 @@ inline int is_wire(int x, int y) return bmap[y][x]==6 || bmap[y][x]==7 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==11 || bmap[y][x]==12; } -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 _inline int is_wire_off(int x, int y) #else inline int is_wire_off(int x, int y) @@ -613,18 +691,18 @@ int get_wavelength_bin(int *wm) int i, w0=30, wM=0; if(!*wm) - return -1; + return -1; for(i=0; i<30; i++) - if(*wm & (1< wM) - wM = i; - } + if(*wm & (1< wM) + wM = i; + } if(wM-w0 < 5) - return (wM+w0)/2; + return (wM+w0)/2; i = rand() % (wM-w0-3); i += w0; @@ -690,7 +768,7 @@ void set_emap(int x, int y) } } -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 _inline int parts_avg(int ci, int ni) #else inline int parts_avg(int ci, int ni) @@ -734,9 +812,6 @@ int nearest_part(int ci, int t) void update_particles_i(pixel *vid, int start, int inc) { int i, j, x, y, t, nx, ny, r, a, s, lt, rt, fe, nt, lpv, nearp, pavg; - uint16_t tempu1, tempu2; - int16_t temps1, temps2; - float tempf1, tempf2; float mv, dx, dy, ix, iy, lx, ly, d, pp, nrx, nry, dp; float nn, ct1, ct2; float pt = R_TEMP; @@ -759,7 +834,7 @@ void update_particles_i(pixel *vid, int start, int inc) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW) { kill_part(i); continue; @@ -767,7 +842,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(parts[i].life<=0 && t==PT_SPRK) { t = parts[i].ctype; - if(t!=PT_METL&&t!=PT_BMTL&&t!=PT_BRMT&&t!=PT_LRBD&&t!=PT_RBDM&&t!=PT_BTRY&&t!=PT_NBLE) + if(t!=PT_METL&&t!=PT_IRON&&t!=PT_BMTL&&t!=PT_BRMT&&t!=PT_LRBD&&t!=PT_RBDM&&t!=PT_BTRY&&t!=PT_NBLE) parts[i].temp = R_TEMP + 273.15f; if(!t) t = PT_METL; @@ -869,7 +944,7 @@ void update_particles_i(pixel *vid, int start, int inc) } // interpolator -#if defined(WIN32) && !defined(__MINGW32__) +#ifdef WIN32 mv = max(fabsf(parts[i].vx), fabsf(parts[i].vy)); #else mv = fmaxf(fabsf(parts[i].vx), fabsf(parts[i].vy)); @@ -943,6 +1018,8 @@ void update_particles_i(pixel *vid, int start, int inc) t = parts[i].type = PT_OIL; if(t==PT_BMTL && pv[y/CELL][x/CELL]>2.5f) t = parts[i].type = PT_BRMT; + if(t==PT_BMTL && pv[y/CELL][x/CELL]>1.0f && parts[i].tmp==1) + t = parts[i].type = PT_BRMT; if(t==PT_BRCK && pv[y/CELL][x/CELL]>2.8f) t = parts[i].type = PT_STNE; //if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f) @@ -1118,7 +1195,7 @@ void update_particles_i(pixel *vid, int start, int inc) pt = parts[i].temp -= 2.5f; } - if(t==PT_WATR || t==PT_ETRD || t==PT_SLTW || t==PT_METL || t==PT_RBDM || t==PT_LRBD || t==PT_BRMT || t==PT_PSCN || t==PT_NSCN || t==PT_NTCT || t==PT_PTCT || t==PT_BMTL || t==PT_SPRK|| t == PT_NBLE || t==PT_INWR) + if(t==PT_WATR || t==PT_ETRD || t==PT_SLTW || t==PT_METL || t==PT_IRON || t==PT_RBDM || t==PT_LRBD || t==PT_BRMT || t==PT_PSCN || t==PT_NSCN || t==PT_NTCT || t==PT_PTCT || t==PT_BMTL || t==PT_SPRK|| t == PT_NBLE || t==PT_INWR) { nx = x % CELL; if(nx == 0) @@ -1136,7 +1213,7 @@ void update_particles_i(pixel *vid, int start, int inc) ny = y/CELL; if(nx>=0 && ny>=0 && nx>8)>=NPART || !r) continue; - if(((r&0xFF)==PT_METL || (r&0xFF)==PT_ETRD || (r&0xFF)==PT_PSCN || (r&0xFF)==PT_NSCN || (r&0xFF)==PT_NTCT || (r&0xFF)==PT_PTCT || (r&0xFF)==PT_BMTL || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD || (r&0xFF)==PT_BRMT||(r&0xFF)==PT_NBLE) || (r&0xFF)==PT_INWR && parts[r>>8].ctype!=PT_SPRK) - + if(((r&0xFF)==PT_METL || (r&0xFF)==PT_IRON || (r&0xFF)==PT_ETRD || (r&0xFF)==PT_PSCN || (r&0xFF)==PT_NSCN || (r&0xFF)==PT_NTCT || (r&0xFF)==PT_PTCT || (r&0xFF)==PT_BMTL || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD || (r&0xFF)==PT_BRMT || (r&0xFF)==PT_NBLE || (r&0xFF)==PT_INWR) && parts[r>>8].ctype!=PT_SPRK) { t = parts[i].type = PT_NONE; parts[r>>8].ctype = parts[r>>8].type; @@ -1217,6 +1293,67 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_BMTL) { + if(parts[i].tmp>1) { + parts[i].tmp--; + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + rt =parts[r>>8].type; + if((rt==PT_METL || rt==PT_IRON) && 1>(rand()/(RAND_MAX/100))) + { + parts[r>>8].type=PT_BMTL; + parts[r>>8].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100; + } + } + } else if(parts[i].tmp==1 && 1>rand()%1000) { + parts[i].tmp = 0; + t = parts[i].type = PT_BRMT; + } + } + + else if(t==PT_IRON) { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if((((r&0xFF) == PT_SALT && 15>(rand()/(RAND_MAX/700))) || + ((r&0xFF) == PT_SLTW && 30>(rand()/(RAND_MAX/2000))) || + ((r&0xFF) == PT_WATR && 5 >(rand()/(RAND_MAX/6000))) || + ((r&0xFF) == PT_O2 && 2 >(rand()/(RAND_MAX/500))) || + ((r&0xFF) == PT_LO2))&& + (!(parts[i].life)) + ) + { + parts[i].type=PT_BMTL; + parts[i].tmp=(rand()/(RAND_MAX/10))+20; + } + } + } + else if((t==PT_SPRK||parts[i].type==PT_SPRK) && parts[i].ctype==PT_IRON) { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if(((r&0xFF) == PT_DSTW && 30>(rand()/(RAND_MAX/1000))) || + ((r&0xFF) == PT_SLTW && 30>(rand()/(RAND_MAX/1000))) || + ((r&0xFF) == PT_WATR && 30>(rand()/(RAND_MAX/1000)))) + { + parts[r>>8].type=PT_O2; + //parts[r>>8].tmp=(rand()/(RAND_MAX/10))+20; + } + } + } else if(t==PT_COAL) { if(parts[i].life<=0) { @@ -1285,16 +1422,18 @@ void update_particles_i(pixel *vid, int start, int inc) else if(t==PT_FUSE) { if(parts[i].life<=0) { - t = PT_NONE; + //t = parts[i].life = PT_NONE; kill_part(i); r = create_part(-1, x, y, PT_PLSM); - parts[r].life = 50; - goto killed; + if(r!=-1) + parts[r].life = 50; + //goto killed; } else if (parts[i].life < 40) { parts[i].life--; if((rand()%100)==0) { r = create_part(-1, (nx=x+rand()%3-1), (ny=y+rand()%3-1), PT_PLSM); - parts[r].life = 50; + if(r!=-1) + parts[r].life = 50; } } if((pv[y/CELL][x/CELL] > 2.7f)&&parts[i].tmp>40) @@ -1302,10 +1441,10 @@ void update_particles_i(pixel *vid, int start, int inc) else if(parts[i].tmp<40&&parts[i].tmp>0) parts[i].tmp--; else if(parts[i].tmp<=0) { - t = PT_NONE; + //t = PT_NONE; kill_part(i); r = create_part(-1, x, y, PT_FSEP); - goto killed; + //goto killed; } for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) @@ -1326,16 +1465,18 @@ void update_particles_i(pixel *vid, int start, int inc) else if(t==PT_FSEP) { if(parts[i].life<=0) { - t = PT_NONE; + //t = PT_NONE; kill_part(i); r = create_part(-1, x, y, PT_PLSM); - parts[r].life = 50; - goto killed; + if(r!=-1) + parts[r].life = 50; + //goto killed; } else if (parts[i].life < 40) { parts[i].life--; if((rand()%10)==0) { r = create_part(-1, (nx=x+rand()%3-1), (ny=y+rand()%3-1), PT_PLSM); - parts[r].life = 50; + if(r!=-1) + parts[r].life = 50; } } for(nx=-2; nx<3; nx++) @@ -1346,7 +1487,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+400.0f)) && 1>(rand()%15)) + if(((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+400.0f))) && 1>(rand()%15)) { if(parts[i].life>40) { parts[i].life = 39; @@ -1548,7 +1689,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_FIRE; parts[r>>8].life = 4; } - else if(((r&0xFF)!=PT_CLNE && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50) + else if(((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50) { parts[i].life--; parts[r>>8].type = PT_NONE; @@ -1641,6 +1782,9 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_MORT) { + create_part(-1, x, y-1, PT_SMKE); + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) @@ -1807,7 +1951,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } else if(parts[i].tmp==2) { - int col = rand()%200+4; + int col = rand()%200+4; for(nx=-2; nx<3; nx++) { for(ny=-2; ny<3; ny++) { if(x+nx>=0 && y+ny>0 && x+nx>8].type; if(parts_avg(i,r>>8) != PT_INSL) { - if((rt==PT_METL||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE)&&parts[r>>8].life==0 && abs(nx)+abs(ny) < 4) + if((rt==PT_METL||rt==PT_IRON||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE)&&parts[r>>8].life==0 && abs(nx)+abs(ny) < 4) { parts[r>>8].life = 4; parts[r>>8].ctype = rt; @@ -1901,7 +2045,8 @@ void update_particles_i(pixel *vid, int start, int inc) continue; rt = parts[r>>8].type; if((a || ptypes[rt].explosive) && ((rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL && rt!=PT_SWCH) || t!=PT_SPRK) && - (t!=PT_LAVA || parts[i].life>0 || (rt!=PT_STNE && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_METL && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SWCH && rt!=PT_INWR)) && + !(t==PT_PHOT && rt==PT_INSL) && + (t!=PT_LAVA || parts[i].life>0 || (rt!=PT_STNE && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_METL && rt!=PT_IRON && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SWCH && rt!=PT_INWR)) && ptypes[rt].flammable && (ptypes[rt].flammable + (int)(pv[(y+ny)/CELL][(x+nx)/CELL]*10.0f))>(rand()%1000)) { parts[r>>8].type = PT_FIRE; @@ -1915,7 +2060,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(lpv < 1) lpv = 1; if(legacy_enable) { - if(t!=PT_SPRK && ptypes[rt].meltable && ((rt!=PT_RBDM && rt!=PT_LRBD) || t!=PT_SPRK) && ((t!=PT_FIRE&&t!=PT_PLSM) || (rt!=PT_METL && rt!=PT_ETRD && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SALT && rt!=PT_INWR)) && + if(t!=PT_SPRK && ptypes[rt].meltable && ((rt!=PT_RBDM && rt!=PT_LRBD) || t!=PT_SPRK) && ((t!=PT_FIRE&&t!=PT_PLSM) || (rt!=PT_METL && rt!=PT_IRON && rt!=PT_ETRD && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SALT && rt!=PT_INWR)) && ptypes[rt].meltable*lpv>(rand()%1000)) { if(t!=PT_LAVA || parts[i].life>0) @@ -1987,7 +2132,7 @@ void update_particles_i(pixel *vid, int start, int inc) pavg = parts_avg(i, r>>8); if(pavg != PT_INSL) { - if(t==PT_SPRK && (rt==PT_METL||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 && + if(t==PT_SPRK && (rt==PT_METL||rt==PT_IRON||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)=373.0f)&&parts[i].ctype==PT_NTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp<=373.0f)&&parts[i].ctype==PT_PTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN)&&parts[i].ctype==PT_INWR) && pavg != PT_INSL &&!(parts[i].ctype==PT_SWCH&&(rt==PT_PSCN||rt==PT_NSCN)) ) @@ -2480,8 +2625,10 @@ killed: (pmap[y+ny][x+nx]&0xFF)!=0xFF) parts[i].ctype = pmap[y+ny][x+nx]&0xFF; } - else + else { create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); + } + } if(parts[i].type==PT_PCLN) { @@ -2499,8 +2646,21 @@ killed: (pmap[y+ny][x+nx]&0xFF)!=PT_STKM && (pmap[y+ny][x+nx]&0xFF)!=0xFF) parts[i].ctype = pmap[y+ny][x+nx]&0xFF; - if(parts[i].ctype && parts[i].life==10) - create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); + if(parts[i].ctype && parts[i].life==10) { + if(parts[i].ctype==PT_PHOT) { + for(nx=-1; nx<2; nx++) { + for(ny=-1; ny<2; ny++) { + r = create_part(-1, x+nx, y+ny, parts[i].ctype); + if(r!=-1) { + parts[r].vx = nx*3; + parts[r].vy = ny*3; + } + } + } + } else { + create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); + } + } } if(t==PT_YEST) { @@ -2534,7 +2694,7 @@ killed: if(parts[i].type == PT_PHOT) { rt = pmap[ny][nx] & 0xFF; - if(rt==PT_CLNE) { + if(rt==PT_CLNE || rt==PT_PCLN) { lt = pmap[ny][nx] >> 8; if(!parts[lt].ctype) parts[lt].ctype = PT_PHOT; @@ -2542,7 +2702,7 @@ killed: lt = pmap[y][x] & 0xFF; - r = eval_move(PT_PHOT, nx, ny, NULL); + r = eval_move(PT_PHOT, nx, ny, NULL); if(((rt==PT_GLAS && lt!=PT_GLAS) || (rt!=PT_GLAS && lt==PT_GLAS)) && r) { if(!get_normal_interp(REFRACT|parts[i].type, x, y, parts[i].vx, parts[i].vy, &nrx, &nry)) { @@ -2550,13 +2710,13 @@ killed: continue; } - r = get_wavelength_bin(&parts[i].ctype); - if(r == -1) { - kill_part(i); - continue; - } - nn = GLASS_IOR - GLASS_DISP*(r-15)/15.0f; - nn *= nn; + r = get_wavelength_bin(&parts[i].ctype); + if(r == -1) { + kill_part(i); + continue; + } + nn = GLASS_IOR - GLASS_DISP*(r-15)/15.0f; + nn *= nn; nrx = -nrx; nry = -nry; @@ -2567,10 +2727,10 @@ killed: if(ct2 < 0.0f) { parts[i].vx -= 2.0f*ct1*nrx; parts[i].vy -= 2.0f*ct1*nry; - parts[i].x = lx; - parts[i].y = ly; - nx = (int)(lx + 0.5f); - ny = (int)(ly + 0.5f); + parts[i].x = lx; + parts[i].y = ly; + nx = (int)(lx + 0.5f); + ny = (int)(ly + 0.5f); } else { ct2 = sqrtf(ct2); ct2 = ct2 - nn*ct1; @@ -2700,24 +2860,25 @@ killed: } else if(t==PT_NEUT || t==PT_PHOT) { - r = pmap[ny][nx]; + r = pmap[ny][nx]; - /* this should be replaced with a particle type attribute ("photwl" or something) */ - if((r & 0xFF) == PT_PSCN) parts[i].ctype = 0x00000000; - if((r & 0xFF) == PT_NSCN) parts[i].ctype = 0x00000000; - if((r & 0xFF) == PT_COAL) parts[i].ctype = 0x00000000; - if((r & 0xFF) == PT_BCOL) parts[i].ctype = 0x00000000; - if((r & 0xFF) == PT_PLEX) parts[i].ctype &= 0x1F00003E; - if((r & 0xFF) == PT_NITR) parts[i].ctype &= 0x0007C000; - if((r & 0xFF) == PT_NBLE) parts[i].ctype &= 0x3FFF8000; - if((r & 0xFF) == PT_LAVA) parts[i].ctype &= 0x3FF00000; - if((r & 0xFF) == PT_ACID) parts[i].ctype &= 0x1FE001FE; - if((r & 0xFF) == PT_DUST) parts[i].ctype &= 0x3FFFFFC0; - if((r & 0xFF) == PT_SNOW) parts[i].ctype &= 0x03FFFFFF; - if((r & 0xFF) == PT_GOO) parts[i].ctype &= 0x3FFAAA00; - if((r & 0xFF) == PT_PLNT) parts[i].ctype &= 0x0007C000; - if((r & 0xFF) == PT_PLUT) parts[i].ctype &= 0x001FCE00; - if((r & 0xFF) == PT_URAN) parts[i].ctype &= 0x003FC000; + /* this should be replaced with a particle type attribute ("photwl" or something) */ + if((r & 0xFF) == PT_PSCN) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_NSCN) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_SPRK) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_COAL) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_BCOL) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_PLEX) parts[i].ctype &= 0x1F00003E; + if((r & 0xFF) == PT_NITR) parts[i].ctype &= 0x0007C000; + if((r & 0xFF) == PT_NBLE) parts[i].ctype &= 0x3FFF8000; + if((r & 0xFF) == PT_LAVA) parts[i].ctype &= 0x3FF00000; + if((r & 0xFF) == PT_ACID) parts[i].ctype &= 0x1FE001FE; + if((r & 0xFF) == PT_DUST) parts[i].ctype &= 0x3FFFFFC0; + if((r & 0xFF) == PT_SNOW) parts[i].ctype &= 0x03FFFFFF; + if((r & 0xFF) == PT_GOO) parts[i].ctype &= 0x3FFAAA00; + if((r & 0xFF) == PT_PLNT) parts[i].ctype &= 0x0007C000; + if((r & 0xFF) == PT_PLUT) parts[i].ctype &= 0x001FCE00; + if((r & 0xFF) == PT_URAN) parts[i].ctype &= 0x003FC000; if(get_normal_interp(t, lx, ly, parts[i].vx, parts[i].vy, &nrx, &nry)) { dp = nrx*parts[i].vx + nry*parts[i].vy; @@ -2737,10 +2898,10 @@ killed: continue; } - if(!parts[i].ctype) { - kill_part(i); - continue; - } + if(!parts[i].ctype) { + kill_part(i); + continue; + } } else @@ -2801,10 +2962,10 @@ 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 Date: Thu, 28 Oct 2010 19:31:06 -0400 Subject: [PATCH 16/79] added specific element eraser again for my own uses sinces everyone else thinks its useless. alt-click to pick and then alt-click in the game to erase the picked element. you could then have right and left click be two different elements and alt-click on the eraser to keep two elements selected and an easy to use eraser as well --- includes/interface.h | 1 + src/interface.c | 43 +++++++++++++++++++++++++++++++++++++++++-- src/powder.c | 23 +++++++++++++++++++---- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/includes/interface.h b/includes/interface.h index 0f4dd3fd6..ddc260db0 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -100,6 +100,7 @@ struct ui_checkbox }; typedef struct ui_checkbox ui_checkbox; +int SLALT; extern SDLMod sdl_mod; extern int sdl_key, sdl_wheel, sdl_caps, sdl_ascii, sdl_zoom_trig; extern char *shift_0; diff --git a/src/interface.c b/src/interface.c index 4ab7bf4ac..2c6664512 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1484,6 +1484,15 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; } + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT))) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + h = n; + } + else if(n==SLALT) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + } else if(n==*sl) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); @@ -1509,6 +1518,15 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; } + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT))) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + h = n; + } + else if(n==SLALT) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + } else if(n==*sl) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); @@ -1537,6 +1555,15 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; } + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT))) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + h = n; + } + else if(n==SLALT) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + } else if(n==*sl) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); @@ -1564,11 +1591,23 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, if(b==1&&h!=-1) { - *sl = h; + if(sdl_mod & (KMOD_LALT)) + { + SLALT = h; + } + else{ + *sl = h; + } } if(b==4&&h!=-1) { - *sr = h; + if(sdl_mod & (KMOD_LALT)) + { + SLALT = h; + } + else{ + *sr = h; + } } } diff --git a/src/powder.c b/src/powder.c index fc645a5e5..526066377 100644 --- a/src/powder.c +++ b/src/powder.c @@ -663,9 +663,13 @@ inline void delete_part(int x, int y) i = pmap[y][x]; if(!i || (i>>8)>=NPART) return; - - kill_part(i>>8); - pmap[y][x] = 0; // just in case + if((parts[i>>8].type==SLALT)||SLALT==-1||SLALT==0) + { + kill_part(i>>8); + pmap[y][x] = 0; + } + else + return; } #ifdef WIN32 @@ -3580,7 +3584,7 @@ int flood_parts(int x, int y, int c, int cm, int bm) int create_parts(int x, int y, int r, int c) { - int i, j, f = 0, u, v, oy, ox, b = 0, dw = 0; //n; + int i, j, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0; //n; if(c == 125) { @@ -3691,6 +3695,14 @@ int create_parts(int x, int y, int r, int c) } return 1; } + if(sdl_mod & (KMOD_LALT)) + { + for(j=-r; j<=r; j++) + for(i=-r; i<=r; i++) + if(i*i+j*j<=r*r) + delete_part(x+i, y+j); + return 1; + } if(c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM) { for(j=-r; j<=r; j++) @@ -3702,10 +3714,13 @@ int create_parts(int x, int y, int r, int c) if(c == 0) { + stemp = SLALT; + SLALT = -1; for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) if(i*i+j*j<=r*r) delete_part(x+i, y+j); + SLALT = stemp; return 1; } From 8f397f3a039794bf01a4e0ad3d9de0ed9e5d5184 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 29 Oct 2010 23:37:15 -0400 Subject: [PATCH 17/79] moving signs! i think everything still works, click the weird random extra button, someone can add an icon later. --- includes/defines.h | 2 +- includes/interface.h | 2 ++ src/graphics.c | 12 +++++++++++- src/interface.c | 19 ++++++++++++++++--- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 0f80ab69a..8ffa44941 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -90,7 +90,7 @@ extern int death; struct sign { - int x,y,ju; + int x,y,ju,m; char text[256]; }; typedef struct sign sign; diff --git a/includes/interface.h b/includes/interface.h index ddc260db0..b378a9944 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -153,6 +153,8 @@ 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 move_sign(pixel *vid_buf,int i); + void ui_edit_draw(pixel *vid_buf, ui_edit *ed); void ui_edit_process(int mx, int my, int mb, ui_edit *ed); diff --git a/src/graphics.c b/src/graphics.c index d6604a3e5..39f95953b 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2198,7 +2198,7 @@ void draw_parts(pixel *vid) void render_signs(pixel *vid_buf) { - int i, j, x, y, w, h, dx, dy; + int i, j, x, y, w, h, dx, dy,mx,my,b=1,bq; char buff[30]; //Buffer for(i=0; i=x && mx<=x+w && my>=y && my<=y+h) break; @@ -119,7 +124,6 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) } if(i >= MAXSIGNS) return; - if(nm) { signs[i].x = mx; @@ -165,6 +169,10 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) draw_icon(vid_buf, x0+68, y0+42, 0x9E, ju == 1); draw_icon(vid_buf, x0+86, y0+42, 0x9F, ju == 2); + drawrect(vid_buf,x0+104,y0+42,26,15,255,255,255,255); + + + if(!nm) { drawtext(vid_buf, x0+138, y0+45, "\x86", 160, 48, 32, 255); @@ -187,6 +195,11 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) if(b && !bq && mx>=x0+86 && mx<=x0+103 && my>=y0+42 && my<=y0+59) ju = 2; + if(b && !bq && mx>=x0+104 && mx<=x0+130 && my>=y0+42 && my<=y0+59) + { + signs[i].m = 1; + break; + } if(b && !bq && mx>=x0+9 && mx=y0+22 && my=x0 && mx=y0+64 && my<=y0+80) From edab61ec4dc262be7dca1acf4d44c24ad513f126 Mon Sep 17 00:00:00 2001 From: Philip Date: Mon, 1 Nov 2010 12:58:22 -0400 Subject: [PATCH 18/79] forgot to delete something --- includes/interface.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/includes/interface.h b/includes/interface.h index b378a9944..ddc260db0 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -153,8 +153,6 @@ 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 move_sign(pixel *vid_buf,int i); - void ui_edit_draw(pixel *vid_buf, ui_edit *ed); void ui_edit_process(int mx, int my, int mb, ui_edit *ed); From 176ecb11974c2fde3a174afcf14ce9922182b50c Mon Sep 17 00:00:00 2001 From: Philip Date: Mon, 1 Nov 2010 17:37:27 -0400 Subject: [PATCH 19/79] eraser uses shift-alt instead of alt because linux alt-click is normally move window --- src/interface.c | 10 +++++----- src/main.c | 4 ++-- src/powder.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/interface.c b/src/interface.c index 81b5ed6af..2161bcb1c 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1497,7 +1497,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; } - if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT))) + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT))) { drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); h = n; @@ -1531,7 +1531,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; } - if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT))) + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT))) { drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); h = n; @@ -1568,7 +1568,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; } - if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT))) + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT))) { drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); h = n; @@ -1604,7 +1604,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, if(b==1&&h!=-1) { - if(sdl_mod & (KMOD_LALT)) + if(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT)) { SLALT = h; } @@ -1614,7 +1614,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, } if(b==4&&h!=-1) { - if(sdl_mod & (KMOD_LALT)) + if(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT)) { SLALT = h; } diff --git a/src/main.c b/src/main.c index 5ef9ce304..af9dcc6ba 100644 --- a/src/main.c +++ b/src/main.c @@ -1833,7 +1833,7 @@ int main(int argc, char *argv[]) } else { - if((sdl_mod & (KMOD_LSHIFT|KMOD_RSHIFT)) && !(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))) + if((sdl_mod & (KMOD_LSHIFT|KMOD_RSHIFT)) && !(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL|KMOD_LALT))) { lx = x; ly = y; @@ -1856,7 +1856,7 @@ int main(int argc, char *argv[]) lb = 0; lm = 0; } - else if((sdl_mod & (KMOD_LALT||KMOD_RALT)) || b==SDL_BUTTON_MIDDLE) + else if(((sdl_mod & (KMOD_LALT||KMOD_RALT)) && !sdl_mod & (KMOD_LALT)) || b==SDL_BUTTON_MIDDLE) { if(y>0 && y0 && x Date: Mon, 1 Nov 2010 23:56:06 -0400 Subject: [PATCH 20/79] changed moving sign code so it doesn't modify the sign itself. --- includes/defines.h | 3 ++- src/graphics.c | 2 +- src/interface.c | 8 ++++---- src/main.c | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 8ffa44941..df1fa0aef 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -90,7 +90,7 @@ extern int death; struct sign { - int x,y,ju,m; + int x,y,ju; char text[256]; }; typedef struct sign sign; @@ -103,6 +103,7 @@ struct stamp }; typedef struct stamp stamp; +int MSIGN; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/src/graphics.c b/src/graphics.c index 39f95953b..b403fe36f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2237,7 +2237,7 @@ void render_signs(pixel *vid_buf) x+=dx; y+=dy; } - if(signs[i].m==1) + if(MSIGN==i) { bq = b; b = SDL_GetMouseState(&mx, &my); diff --git a/src/interface.c b/src/interface.c index 2161bcb1c..e56186845 100644 --- a/src/interface.c +++ b/src/interface.c @@ -97,7 +97,7 @@ 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) { - int i, w, h, x, y, nm=0, ju,movesign = 0; + int i, w, h, x, y, nm=0, ju; int x0=(XRES-192)/2,y0=(YRES-80)/2,b=1,bq; ui_edit ed; @@ -105,9 +105,9 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) for(i=0; i=x0+104 && mx<=x0+130 && my>=y0+42 && my<=y0+59) { - signs[i].m = 1; + MSIGN = i; break; } if(b && !bq && mx>=x0+9 && mx=y0+22 && my Date: Tue, 2 Nov 2010 21:39:06 -0400 Subject: [PATCH 21/79] Fix for ctrl-shift-alt click crash incase someone did it for some reason. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 59d26004b..bf320cc96 100644 --- a/src/main.c +++ b/src/main.c @@ -1848,7 +1848,7 @@ int main(int argc, char *argv[]) lb = b; lm = 2; } - else if((sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) && (sdl_mod & (KMOD_LSHIFT|KMOD_RSHIFT))) + else if((sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) && (sdl_mod & (KMOD_LSHIFT|KMOD_RSHIFT)) && !sdl_mod & (KMOD_LALT)) { if(c!=125&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM) flood_parts(x, y, c, -1, -1); @@ -1857,7 +1857,7 @@ int main(int argc, char *argv[]) lb = 0; lm = 0; } - else if(((sdl_mod & (KMOD_LALT||KMOD_RALT)) && !sdl_mod & (KMOD_LALT)) || b==SDL_BUTTON_MIDDLE) + else if(((sdl_mod & (KMOD_LALT||KMOD_RALT)) && !sdl_mod & (KMOD_SHIFT)) || b==SDL_BUTTON_MIDDLE) { if(y>0 && y0 && x Date: Tue, 2 Nov 2010 23:20:56 -0400 Subject: [PATCH 22/79] forgot parentheses... --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index bf320cc96..85a986868 100644 --- a/src/main.c +++ b/src/main.c @@ -1848,7 +1848,7 @@ int main(int argc, char *argv[]) lb = b; lm = 2; } - else if((sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) && (sdl_mod & (KMOD_LSHIFT|KMOD_RSHIFT)) && !sdl_mod & (KMOD_LALT)) + else if((sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) && (sdl_mod & (KMOD_LSHIFT|KMOD_RSHIFT)) && !(sdl_mod & (KMOD_LALT))) { if(c!=125&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM) flood_parts(x, y, c, -1, -1); From 4ed5b47bfffd20c887e422a3997a756cc0066866 Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 4 Nov 2010 22:12:51 -0400 Subject: [PATCH 23/79] LOL GOL WORKS --- includes/defines.h | 3 +++ includes/powder.h | 4 ++- src/graphics.c | 2 +- src/main.c | 2 ++ src/powder.c | 62 +++++++++++++++++++++++++++++++++++++++++++--- 5 files changed, 67 insertions(+), 6 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index df1fa0aef..1827ecad6 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -104,6 +104,9 @@ struct stamp typedef struct stamp stamp; int MSIGN; +int NGOL; +int CGOL; +int gol[XRES][YRES]; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/powder.h b/includes/powder.h index fbf79fc05..10758a076 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -116,7 +116,8 @@ #define PT_HSWC 75 #define PT_IRON 76 #define PT_MORT 77 -#define PT_NUM 78 +#define PT_GOL 78 +#define PT_NUM 79 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -284,6 +285,7 @@ static const part_type ptypes[PT_NUM] = {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, + {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Game Of Life!", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; diff --git a/src/graphics.c b/src/graphics.c index b403fe36f..e108e99e2 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1244,6 +1244,7 @@ void draw_parts(pixel *vid) int cr, cg, cb; float fr, fg, fb; float pt = R_TEMP; + int gol[XRES][YRES]; for(i = 0; i>8)>0 && (pmap[signs[i].y][signs[i].x]>>8)=8) + { + CGOL = 0; + create_part(-1,0,0,PT_GOL); + for(nx=0;nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==PT_GOL) + for(int nnx=1; nnx>-2; nnx--) + for(int nny=1; nny>-2; nny--) + if(nx+nnx>=0 && ny+nny>0 && nx+nnx=4){ + gol[nx+nnx][ny+nny] =5; + } + else if(gol[nx+nnx][ny+nny]==3){ + gol[nx+nnx][ny+nny] =4; + } + else if(gol[nx+nnx][ny+nny]==2){ + gol[nx+nnx][ny+nny] =3; + } + else if(gol[nx+nnx][ny+nny]==1){ + gol[nx+nnx][ny+nny] =2; + } + else if(gol[nx+nnx][ny+nny]==0){ + gol[nx+nnx][ny+nny] =1; + } + } + } + } + for(nx=0;nx=5){ + parts[r>>8].type=PT_NONE; + } + else if(gol[nx][ny]==3){ + create_part(-1,nx,ny,PT_GOL); + } + else if(gol[nx][ny]==2&&parts[r>>8].type==PT_GOL){ + parts[r>>8].type=PT_NONE; + } + else if(gol[nx][ny]==1){ + parts[r>>8].type=PT_NONE; + } + gol[nx][ny]=0; + + } + } + CGOL++; for(i=start; i<(NPART-starti); i+=inc) if(parts[i].type) { @@ -831,10 +888,7 @@ void update_particles_i(pixel *vid, int start, int inc) ly = parts[i].y; t = parts[i].type; - if(sys_pause&&!framerender) - return; - - if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL) + if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; From 068076a4aeaa444e72b44f716172e4e583953e2d Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 5 Nov 2010 01:22:43 -0400 Subject: [PATCH 24/79] Made it go faster, once per frame, and cool heat colors. --- includes/defines.h | 1 + includes/powder.h | 2 +- src/main.c | 1 + src/powder.c | 11 ++++++++--- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 1827ecad6..4e0304a23 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -106,6 +106,7 @@ typedef struct stamp stamp; int MSIGN; int NGOL; int CGOL; +int GSPEED; int gol[XRES][YRES]; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; diff --git a/includes/powder.h b/includes/powder.h index 10758a076..75fa7285f 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -285,7 +285,7 @@ static const part_type ptypes[PT_NUM] = {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, - {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Game Of Life!", TYPE_SOLID}, + {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 9000.0f, 0, "Game Of Life!", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; diff --git a/src/main.c b/src/main.c index 89267163c..36efa8899 100644 --- a/src/main.c +++ b/src/main.c @@ -104,6 +104,7 @@ int FPSB = 0; int MSIGN =-1; int NGOL = 0; int CGOL = 0; +int GSPEED = 1; sign signs[MAXSIGNS]; diff --git a/src/powder.c b/src/powder.c index 911dbf9fc..b4aeebb5f 100644 --- a/src/powder.c +++ b/src/powder.c @@ -824,7 +824,7 @@ void update_particles_i(pixel *vid, int start, int inc) int starti = (start*-1); if(sys_pause&&!framerender) return; - if(CGOL>=8) + if(CGOL>=GSPEED) { CGOL = 0; create_part(-1,0,0,PT_GOL); @@ -862,7 +862,7 @@ void update_particles_i(pixel *vid, int start, int inc) for(nx=0;nx=5){ + if(gol[nx][ny]>=5&&(parts[r>>8].type==PT_NONE||parts[r>>8].type==PT_GOL)){ parts[r>>8].type=PT_NONE; } else if(gol[nx][ny]==3){ @@ -871,7 +871,7 @@ void update_particles_i(pixel *vid, int start, int inc) else if(gol[nx][ny]==2&&parts[r>>8].type==PT_GOL){ parts[r>>8].type=PT_NONE; } - else if(gol[nx][ny]==1){ + else if(gol[nx][ny]==1&&(parts[r>>8].type==PT_NONE||parts[r>>8].type==PT_GOL)){ parts[r>>8].type=PT_NONE; } gol[nx][ny]=0; @@ -1843,6 +1843,11 @@ void update_particles_i(pixel *vid, int start, int inc) else if(t==PT_MORT) { create_part(-1, x, y-1, PT_SMKE); } + else if(t==PT_GOL) + { + if(parts[i].temp>0) + parts[i].temp -= 50.0f; + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) From a23d46a9f6e612a51f9dfa5e0f6a578953da6757 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 5 Nov 2010 21:25:02 -0400 Subject: [PATCH 25/79] GOL works 100% now. todo: make some way to set GSPEED from ingame, and is the number of frames per generation. --- includes/defines.h | 1 + includes/powder.h | 2 +- src/interface.c | 2 +- src/main.c | 4 ++- src/powder.c | 63 ++++++++++++++++++++++++++++++---------------- 5 files changed, 47 insertions(+), 25 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 4e0304a23..26a2f762c 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -108,6 +108,7 @@ int NGOL; int CGOL; int GSPEED; int gol[XRES][YRES]; +int gol2[XRES][YRES]; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/powder.h b/includes/powder.h index 75fa7285f..052916144 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -285,7 +285,7 @@ static const part_type ptypes[PT_NUM] = {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, - {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 9000.0f, 0, "Game Of Life!", TYPE_SOLID}, + {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 9000.0f, 40, "Game Of Life!", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; diff --git a/src/interface.c b/src/interface.c index e56186845..07edca9cc 100644 --- a/src/interface.c +++ b/src/interface.c @@ -3614,7 +3614,7 @@ int execute_vote(pixel *vid_buf, char *id, char *action) } void open_link(char *uri){ #ifdef WIN32 - ShellExecute(0, "OPEN", uri, NULL, NULL, 0) + ShellExecute(0, "OPEN", uri, NULL, NULL, 0); #elif MACOSX //LSOpenCFURLRef(CFURLCreateWithString(NULL, CFStringCreateWithCString(NULL, uri, 0) ,NULL), NULL); //TODO: Get this crap working #elif LIN32 diff --git a/src/main.c b/src/main.c index 36efa8899..75e191222 100644 --- a/src/main.c +++ b/src/main.c @@ -104,7 +104,7 @@ int FPSB = 0; int MSIGN =-1; int NGOL = 0; int CGOL = 0; -int GSPEED = 1; +int GSPEED = 0; sign signs[MAXSIGNS]; @@ -521,6 +521,8 @@ int parse_save(void *save, int size, int replace, int x0, int y0) { k = pmap[y][x]>>8; parts[k].type = j; + if(j ==PT_GOL) + gol[x][y] = 1; if(j == PT_PHOT) parts[k].ctype = 0x3fffffff; parts[k].x = (float)x; diff --git a/src/powder.c b/src/powder.c index b4aeebb5f..1d55a1884 100644 --- a/src/powder.c +++ b/src/powder.c @@ -824,38 +824,57 @@ void update_particles_i(pixel *vid, int start, int inc) int starti = (start*-1); if(sys_pause&&!framerender) return; + gol2[0][0] = 3; + for(nx=0;nx>8)>=NPART || !r) + { + gol[nx][ny] = 0; + continue; + } + if(parts[r>>8].type==PT_GOL) + gol[nx][ny] = 1; + } + for(nx=0;nx=0 && ny+nny>0 && nx+nnx=5&&gol[nx][ny]==1) + parts[r>>8].type = PT_NONE; + else if(gol2[nx][ny]<=2&&gol[nx][ny]==1) + parts[r>>8].type = PT_NONE; + gol2[nx][ny] = 0; + } + /*gol[0][0] = 3; other gol code, still has glitch if(CGOL>=GSPEED) { CGOL = 0; - create_part(-1,0,0,PT_GOL); for(nx=0;nx>8)>=NPART || !r) - continue; + continue; if(parts[r>>8].type==PT_GOL) - for(int nnx=1; nnx>-2; nnx--) - for(int nny=1; nny>-2; nny--) + for(int nnx=-1; nnx<2; nnx++) + for(int nny=-1; nny<2; nny++) if(nx+nnx>=0 && ny+nny>0 && nx+nnx=4){ - gol[nx+nnx][ny+nny] =5; - } - else if(gol[nx+nnx][ny+nny]==3){ - gol[nx+nnx][ny+nny] =4; - } - else if(gol[nx+nnx][ny+nny]==2){ - gol[nx+nnx][ny+nny] =3; - } - else if(gol[nx+nnx][ny+nny]==1){ - gol[nx+nnx][ny+nny] =2; - } - else if(gol[nx+nnx][ny+nny]==0){ - gol[nx+nnx][ny+nny] =1; - } + gol[nx+nnx][ny+nny] ++; } } } @@ -865,7 +884,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(gol[nx][ny]>=5&&(parts[r>>8].type==PT_NONE||parts[r>>8].type==PT_GOL)){ parts[r>>8].type=PT_NONE; } - else if(gol[nx][ny]==3){ + else if(gol[nx][ny]==3&&parts[r>>8].type==PT_NONE){ create_part(-1,nx,ny,PT_GOL); } else if(gol[nx][ny]==2&&parts[r>>8].type==PT_GOL){ @@ -878,7 +897,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } - CGOL++; + CGOL++;*/ for(i=start; i<(NPART-starti); i+=inc) if(parts[i].type) { From 76bfb3cc8ae83d6b3804010925d6f3ac02b9b8d0 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 5 Nov 2010 21:31:06 -0400 Subject: [PATCH 26/79] git is weird... --- src/powder.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/powder.c b/src/powder.c index 1d55a1884..2c49d1cab 100644 --- a/src/powder.c +++ b/src/powder.c @@ -824,10 +824,11 @@ void update_particles_i(pixel *vid, int start, int inc) int starti = (start*-1); if(sys_pause&&!framerender) return; - gol2[0][0] = 3; + if(CGOL>=GSPEED) for(nx=0;nx>8)>=NPART || !r) { @@ -858,7 +859,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_NONE; gol2[nx][ny] = 0; } - /*gol[0][0] = 3; other gol code, still has glitch + CGOL++; + /*gol[0][0] = 3; other gol code if(CGOL>=GSPEED) { CGOL = 0; From 5c91fde92e7321f9b3a56eaf90b5d288545472c3 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 5 Nov 2010 23:17:46 -0400 Subject: [PATCH 27/79] GOL wraps around the edges --- src/powder.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/powder.c b/src/powder.c index 2c49d1cab..67e743ccb 100644 --- a/src/powder.c +++ b/src/powder.c @@ -825,8 +825,8 @@ void update_particles_i(pixel *vid, int start, int inc) if(sys_pause&&!framerender) return; if(CGOL>=GSPEED) - for(nx=0;nx>8].type==PT_GOL) gol[nx][ny] = 1; } - for(nx=0;nx=0 && ny+nny>0 && nx+nnx=XRES-4) + gol2[4][YRES-5] ++; + else if(ny+nny>=YRES-4&&nx+nnx<4) + gol2[XRES-5][4] ++; + else if(nx+nnx<4) + gol2[XRES-5][ny+nny] ++; + else if(ny+nny<4) + gol2[nx+nnx][YRES-5] ++; + else if(ny+nny>=YRES-4&&nx+nnx>=XRES-4) + gol2[4][4] ++; + else if(ny+nny>=YRES-4) + gol2[nx+nnx][4] ++; + else if(nx+nnx>=XRES-4) + gol2[4][ny+nny] ++; + else gol2[nx+nnx][ny+nny] ++; + + + } } - for(nx=0;nx Date: Sat, 6 Nov 2010 17:13:43 -0400 Subject: [PATCH 28/79] Added high life, assimilation, and 2x2 to life particles, and put it in its own menu section. --- includes/defines.h | 5 +- includes/interface.h | 4 +- includes/powder.h | 10 ++- src/main.c | 9 ++- src/powder.c | 157 +++++++++++++++++++++++++++---------------- 5 files changed, 121 insertions(+), 64 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 26a2f762c..7763f75e8 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -18,6 +18,8 @@ #define THUMB_CACHE_SIZE 256 +#define NGOL 5 + #define IMGCONNS 3 #define TIMEOUT 100 #define HTTP_TIMEOUT 10 @@ -104,11 +106,10 @@ struct stamp typedef struct stamp stamp; int MSIGN; -int NGOL; int CGOL; int GSPEED; int gol[XRES][YRES]; -int gol2[XRES][YRES]; +int gol2[XRES][YRES][NGOL]; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/interface.h b/includes/interface.h index ddc260db0..2ec807def 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -50,7 +50,8 @@ static menu_wall mwalls[] = #define SC_GAS 3 #define SC_LIQUID 4 #define SC_NUCLEAR 7 -#define SC_TOTAL 9 +#define SC_LIFE 9 +#define SC_TOTAL 10 static menu_section msections[] = { @@ -63,6 +64,7 @@ static menu_section msections[] = {"\xD1", "Solids", 0}, {"\xC6", "Radioactive", 0}, {"\xCC", "Special", 0}, + {"\xC8", "Life", 0}, }; struct ui_edit diff --git a/includes/powder.h b/includes/powder.h index 052916144..8729b869d 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -117,7 +117,10 @@ #define PT_IRON 76 #define PT_MORT 77 #define PT_GOL 78 -#define PT_NUM 79 +#define PT_HLIF 79 +#define PT_ASIM 80 +#define PT_2x2 81 +#define PT_NUM 82 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -285,7 +288,10 @@ static const part_type ptypes[PT_NUM] = {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, - {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 9000.0f, 40, "Game Of Life!", TYPE_SOLID}, + {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life!", TYPE_SOLID}, + {"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL)", TYPE_SOLID}, + {"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (like GOL)", TYPE_SOLID}, + {"2x2", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (like GOL)", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; diff --git a/src/main.c b/src/main.c index 75e191222..bb57fc622 100644 --- a/src/main.c +++ b/src/main.c @@ -102,7 +102,6 @@ int death = 0, framerender = 0; int amd = 1; int FPSB = 0; int MSIGN =-1; -int NGOL = 0; int CGOL = 0; int GSPEED = 0; @@ -521,8 +520,14 @@ int parse_save(void *save, int size, int replace, int x0, int y0) { k = pmap[y][x]>>8; parts[k].type = j; - if(j ==PT_GOL) + if(j == PT_GOL) gol[x][y] = 1; + if(j == PT_HLIF) + gol[x][y] = 2; + if(j == PT_ASIM) + gol[x][y] = 3; + if(j == PT_2x2) + gol[x][y] = 4; if(j == PT_PHOT) parts[k].ctype = 0x3fffffff; parts[k].x = (float)x; diff --git a/src/powder.c b/src/powder.c index 67e743ccb..daaef9146 100644 --- a/src/powder.c +++ b/src/powder.c @@ -835,34 +835,49 @@ void update_particles_i(pixel *vid, int start, int inc) gol[nx][ny] = 0; continue; } - if(parts[r>>8].type==PT_GOL) - gol[nx][ny] = 1; + else if(parts[r>>8].type==PT_GOL) + { + gol[nx][ny] = 1; + } + else if(parts[r>>8].type==PT_HLIF) + { + gol[nx][ny] = 2; + } + else if(parts[r>>8].type==PT_ASIM) + { + gol[nx][ny] = 3; + } + else if(parts[r>>8].type==PT_2x2) + { + gol[nx][ny] = 4; + } } for(nx=4;nx=1) for(int nnx=-1;nnx<2;nnx++) for(int nny=-1;nny<2;nny++) { if(ny+nny<4&&nx+nnx<4) - gol2[XRES-5][YRES-5] ++; + gol2[XRES-5][YRES-5][z] ++; else if(ny+nny<4&&nx+nnx>=XRES-4) - gol2[4][YRES-5] ++; + gol2[4][YRES-5][z] ++; else if(ny+nny>=YRES-4&&nx+nnx<4) - gol2[XRES-5][4] ++; + gol2[XRES-5][4][z] ++; else if(nx+nnx<4) - gol2[XRES-5][ny+nny] ++; + gol2[XRES-5][ny+nny][z] ++; else if(ny+nny<4) - gol2[nx+nnx][YRES-5] ++; + gol2[nx+nnx][YRES-5][z] ++; else if(ny+nny>=YRES-4&&nx+nnx>=XRES-4) - gol2[4][4] ++; + gol2[4][4][z] ++; else if(ny+nny>=YRES-4) - gol2[nx+nnx][4] ++; + gol2[nx+nnx][4][z] ++; else if(nx+nnx>=XRES-4) - gol2[4][ny+nny] ++; + gol2[4][ny+nny][z] ++; else - gol2[nx+nnx][ny+nny] ++; + gol2[nx+nnx][ny+nny][z] ++; } @@ -871,55 +886,83 @@ void update_particles_i(pixel *vid, int start, int inc) for(ny=4;ny=2) + { create_part(-1,nx,ny,PT_GOL); - else if(gol2[nx][ny]>=5&&gol[nx][ny]==1) + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][2]>=2) + { + create_part(-1,nx,ny,PT_HLIF); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][3]>=2) + { + create_part(-1,nx,ny,PT_ASIM); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][4]>=2) + { + create_part(-1,nx,ny,PT_2x2); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][1]==1) + { + create_part(-1,nx,ny,PT_GOL); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][2]==1) + { + create_part(-1,nx,ny,PT_HLIF); + } + + else if(v==4&&gol[nx][ny]==0&&gol2[nx][ny][3]>=2) + { + create_part(-1,nx,ny,PT_ASIM); + } + else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][3]>=3) + { + create_part(-1,nx,ny,PT_ASIM); + } + + else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][2]>=3) + { + create_part(-1,nx,ny,PT_HLIF); + } + else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][4]>=3) + { + create_part(-1,nx,ny,PT_2x2); + } + + else if(v>=5&&gol[nx][ny]==1) parts[r>>8].type = PT_NONE; - else if(gol2[nx][ny]<=2&&gol[nx][ny]==1) + else if(v<=2&&gol[nx][ny]==1) parts[r>>8].type = PT_NONE; - gol2[nx][ny] = 0; + + else if(v>=5&&gol[nx][ny]==2) + parts[r>>8].type = PT_NONE; + else if(v<=2&&gol[nx][ny]==2) + parts[r>>8].type = PT_NONE; + + + else if(v<=4&&gol[nx][ny]==3) + parts[r>>8].type = PT_NONE; + else if(v>=9&&gol[nx][ny]==3) + parts[r>>8].type = PT_NONE; + + else if(v>=7&&gol[nx][ny]==4) + parts[r>>8].type = PT_NONE; + else if(v==4&&gol[nx][ny]==4) + parts[r>>8].type = PT_NONE; + else if(v==5&&gol[nx][ny]==4) + parts[r>>8].type = PT_NONE; + else if(v<=1&&gol[nx][ny]==4) + parts[r>>8].type = PT_NONE; + + gol2[nx][ny][1]=0; + gol2[nx][ny][2]=0; + gol2[nx][ny][3]=0; + gol2[nx][ny][4]=0; } CGOL++; - /*gol[0][0] = 3; other gol code - if(CGOL>=GSPEED) - { - CGOL = 0; - for(nx=0;nx>8)>=NPART || !r) - continue; - if(parts[r>>8].type==PT_GOL) - for(int nnx=-1; nnx<2; nnx++) - for(int nny=-1; nny<2; nny++) - if(nx+nnx>=0 && ny+nny>0 && nx+nnx=5&&(parts[r>>8].type==PT_NONE||parts[r>>8].type==PT_GOL)){ - parts[r>>8].type=PT_NONE; - } - else if(gol[nx][ny]==3&&parts[r>>8].type==PT_NONE){ - create_part(-1,nx,ny,PT_GOL); - } - else if(gol[nx][ny]==2&&parts[r>>8].type==PT_GOL){ - parts[r>>8].type=PT_NONE; - } - else if(gol[nx][ny]==1&&(parts[r>>8].type==PT_NONE||parts[r>>8].type==PT_GOL)){ - parts[r>>8].type=PT_NONE; - } - gol[nx][ny]=0; - - } - } - CGOL++;*/ for(i=start; i<(NPART-starti); i+=inc) if(parts[i].type) { @@ -1884,7 +1927,7 @@ void update_particles_i(pixel *vid, int start, int inc) else if(t==PT_MORT) { create_part(-1, x, y-1, PT_SMKE); } - else if(t==PT_GOL) + else if(t==PT_GOL||t==PT_HLIF||t==PT_ASIM||t==PT_2x2) { if(parts[i].temp>0) parts[i].temp -= 50.0f; From 75922ae31df9df98f258cf2a5995524b3e4fc63b Mon Sep 17 00:00:00 2001 From: Philip Date: Sat, 6 Nov 2010 19:03:35 -0400 Subject: [PATCH 29/79] added Day&Night life particles --- includes/defines.h | 2 +- includes/powder.h | 4 +++- src/main.c | 2 ++ src/powder.c | 35 ++++++++++++++++++++++++++++++++++- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 7763f75e8..675728d36 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -18,7 +18,7 @@ #define THUMB_CACHE_SIZE 256 -#define NGOL 5 +#define NGOL 6 #define IMGCONNS 3 #define TIMEOUT 100 diff --git a/includes/powder.h b/includes/powder.h index 8729b869d..94e748dc8 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -120,7 +120,8 @@ #define PT_HLIF 79 #define PT_ASIM 80 #define PT_2x2 81 -#define PT_NUM 82 +#define PT_DANI 82 +#define PT_NUM 83 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -292,6 +293,7 @@ static const part_type ptypes[PT_NUM] = {"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL)", TYPE_SOLID}, {"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (like GOL)", TYPE_SOLID}, {"2x2", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (like GOL)", TYPE_SOLID}, + {"DANI", PIXPACK(0x00FFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Day and Night! (like GOL)", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; diff --git a/src/main.c b/src/main.c index bb57fc622..fe5cfd8ba 100644 --- a/src/main.c +++ b/src/main.c @@ -528,6 +528,8 @@ int parse_save(void *save, int size, int replace, int x0, int y0) gol[x][y] = 3; if(j == PT_2x2) gol[x][y] = 4; + if(j == PT_DANI) + gol[x][y] = 5; if(j == PT_PHOT) parts[k].ctype = 0x3fffffff; parts[k].x = (float)x; diff --git a/src/powder.c b/src/powder.c index daaef9146..948629904 100644 --- a/src/powder.c +++ b/src/powder.c @@ -850,7 +850,11 @@ void update_particles_i(pixel *vid, int start, int inc) else if(parts[r>>8].type==PT_2x2) { gol[nx][ny] = 4; - } + } + else if(parts[r>>8].type==PT_DANI) + { + gol[nx][ny] = 5; + } } for(nx=4;nx=2) { create_part(-1,nx,ny,PT_2x2); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][5]>=2) + { + create_part(-1,nx,ny,PT_DANI); } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][1]==1) { create_part(-1,nx,ny,PT_GOL); @@ -913,6 +922,10 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1,nx,ny,PT_HLIF); } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][4]==1) + { + create_part(-1,nx,ny,PT_2x2); + } else if(v==4&&gol[nx][ny]==0&&gol2[nx][ny][3]>=2) { @@ -931,6 +944,20 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1,nx,ny,PT_2x2); } + else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][5]>=3) + { + create_part(-1,nx,ny,PT_DANI); + } + + else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4) + { + create_part(-1,nx,ny,PT_DANI); + } + + else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4) + { + create_part(-1,nx,ny,PT_DANI); + } else if(v>=5&&gol[nx][ny]==1) parts[r>>8].type = PT_NONE; @@ -957,10 +984,16 @@ void update_particles_i(pixel *vid, int start, int inc) else if(v<=1&&gol[nx][ny]==4) parts[r>>8].type = PT_NONE; + else if(v==6&&gol[nx][ny]==5) + parts[r>>8].type = PT_NONE; + else if(v<=3&&gol[nx][ny]==5) + parts[r>>8].type = PT_NONE; + gol2[nx][ny][1]=0; gol2[nx][ny][2]=0; gol2[nx][ny][3]=0; gol2[nx][ny][4]=0; + gol2[nx][ny][5]=0; } CGOL++; for(i=start; i<(NPART-starti); i+=inc) From 3ad216f95310822837e423c4e6e96fea51a8c0b2 Mon Sep 17 00:00:00 2001 From: Philip Date: Sat, 6 Nov 2010 20:45:36 -0400 Subject: [PATCH 30/79] added amoeba, move, pseudo life, and diamoeba particles --- includes/defines.h | 2 +- includes/powder.h | 20 +++++-- src/main.c | 8 +++ src/powder.c | 146 ++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 154 insertions(+), 22 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 675728d36..95bc520a1 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -18,7 +18,7 @@ #define THUMB_CACHE_SIZE 256 -#define NGOL 6 +#define NGOL 10 #define IMGCONNS 3 #define TIMEOUT 100 diff --git a/includes/powder.h b/includes/powder.h index 94e748dc8..08aeea0fb 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -121,7 +121,11 @@ #define PT_ASIM 80 #define PT_2x2 81 #define PT_DANI 82 -#define PT_NUM 83 +#define PT_AMOE 83 +#define PT_MOVE 84 +#define PT_PGOL 85 +#define PT_DMOE 86 +#define PT_NUM 87 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -289,11 +293,15 @@ static const part_type ptypes[PT_NUM] = {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, - {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life!", TYPE_SOLID}, - {"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL)", TYPE_SOLID}, - {"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (like GOL)", TYPE_SOLID}, - {"2x2", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (like GOL)", TYPE_SOLID}, - {"DANI", PIXPACK(0x00FFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Day and Night! (like GOL)", TYPE_SOLID}, + {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! (23/3)", TYPE_SOLID}, + {"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL 23/36)", TYPE_SOLID}, + {"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (4567/345)", TYPE_SOLID}, + {"2x2", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (125/36)", TYPE_SOLID}, + {"DANI", PIXPACK(0x00FFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Day and Night! (34678/3678)", TYPE_SOLID}, + {"AMOE", PIXPACK(0xFF00FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Amoeba! (1358/357)", TYPE_SOLID}, + {"MOVE", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Move particles! (245/368)", TYPE_SOLID}, + {"PGOL", PIXPACK(0xE05010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Pseudo Life! (238/357)", TYPE_SOLID}, + {"DMOE", PIXPACK(0x500000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Diamoeba! (5678/35678)", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; diff --git a/src/main.c b/src/main.c index fe5cfd8ba..9db78dbbd 100644 --- a/src/main.c +++ b/src/main.c @@ -530,6 +530,14 @@ int parse_save(void *save, int size, int replace, int x0, int y0) gol[x][y] = 4; if(j == PT_DANI) gol[x][y] = 5; + if(j == PT_AMOE) + gol[x][y] = 6; + if(j == PT_MOVE) + gol[x][y] = 7; + if(j == PT_PGOL) + gol[x][y] = 8; + if(j == PT_DMOE) + gol[x][y] = 9; if(j == PT_PHOT) parts[k].ctype = 0x3fffffff; parts[k].x = (float)x; diff --git a/src/powder.c b/src/powder.c index 948629904..2ceaeead8 100644 --- a/src/powder.c +++ b/src/powder.c @@ -855,6 +855,22 @@ void update_particles_i(pixel *vid, int start, int inc) { gol[nx][ny] = 5; } + else if(parts[r>>8].type==PT_AMOE) + { + gol[nx][ny] = 6; + } + else if(parts[r>>8].type==PT_MOVE) + { + gol[nx][ny] = 7; + } + else if(parts[r>>8].type==PT_PGOL) + { + gol[nx][ny] = 8; + } + else if(parts[r>>8].type==PT_DMOE) + { + gol[nx][ny] = 9; + } } for(nx=4;nx=2) { create_part(-1,nx,ny,PT_GOL); @@ -913,6 +935,22 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1,nx,ny,PT_DANI); } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][6]>=2) + { + create_part(-1,nx,ny,PT_AMOE); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][7]>=2) + { + create_part(-1,nx,ny,PT_MOVE); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][8]>=2) + { + create_part(-1,nx,ny,PT_PGOL); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][9]>=2) + { + create_part(-1,nx,ny,PT_DMOE); + } else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][1]==1) { @@ -926,16 +964,41 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1,nx,ny,PT_2x2); } - + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][6]==1) + { + create_part(-1,nx,ny,PT_AMOE); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][7]==1) + { + create_part(-1,nx,ny,PT_MOVE); + } + else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][8]==1) + { + create_part(-1,nx,ny,PT_PGOL); + } + //4 else if(v==4&&gol[nx][ny]==0&&gol2[nx][ny][3]>=2) { create_part(-1,nx,ny,PT_ASIM); } + //5 else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][3]>=3) { create_part(-1,nx,ny,PT_ASIM); } - + else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][6]>=3) + { + create_part(-1,nx,ny,PT_AMOE); + } + else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][8]>=3) + { + create_part(-1,nx,ny,PT_PGOL); + } + else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][9]>=3) + { + create_part(-1,nx,ny,PT_DMOE); + } + //6 else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][2]>=3) { create_part(-1,nx,ny,PT_HLIF); @@ -948,33 +1011,62 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1,nx,ny,PT_DANI); } - + else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][7]>=3) + { + create_part(-1,nx,ny,PT_MOVE); + } + else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][9]>=3) + { + create_part(-1,nx,ny,PT_DMOE); + } + //7 else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4) { create_part(-1,nx,ny,PT_DANI); } - + else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][6]>=4) + { + create_part(-1,nx,ny,PT_AMOE); + } + else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][8]>=4) + { + create_part(-1,nx,ny,PT_PGOL); + } + else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][9]>=4) + { + create_part(-1,nx,ny,PT_DMOE); + } + //8 else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4) { create_part(-1,nx,ny,PT_DANI); } - + else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][7]>=4) + { + create_part(-1,nx,ny,PT_MOVE); + } + else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][9]>=4) + { + create_part(-1,nx,ny,PT_DMOE); + } + //rules to kill particle + //GOL else if(v>=5&&gol[nx][ny]==1) parts[r>>8].type = PT_NONE; else if(v<=2&&gol[nx][ny]==1) parts[r>>8].type = PT_NONE; - + //HLIF else if(v>=5&&gol[nx][ny]==2) parts[r>>8].type = PT_NONE; else if(v<=2&&gol[nx][ny]==2) parts[r>>8].type = PT_NONE; - + //ASIM else if(v<=4&&gol[nx][ny]==3) parts[r>>8].type = PT_NONE; else if(v>=9&&gol[nx][ny]==3) parts[r>>8].type = PT_NONE; - + //2x2 else if(v>=7&&gol[nx][ny]==4) parts[r>>8].type = PT_NONE; else if(v==4&&gol[nx][ny]==4) @@ -983,17 +1075,41 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_NONE; else if(v<=1&&gol[nx][ny]==4) parts[r>>8].type = PT_NONE; - + //DANI else if(v==6&&gol[nx][ny]==5) parts[r>>8].type = PT_NONE; else if(v<=3&&gol[nx][ny]==5) parts[r>>8].type = PT_NONE; + //AMOE + else if(v==8&&gol[nx][ny]==6) + parts[r>>8].type = PT_NONE; + else if(v==7&&gol[nx][ny]==6) + parts[r>>8].type = PT_NONE; + else if(v==5&&gol[nx][ny]==6) + parts[r>>8].type = PT_NONE; + else if(v==3&&gol[nx][ny]==6) + parts[r>>8].type = PT_NONE; + else if(v==1&&gol[nx][ny]==6) + parts[r>>8].type = PT_NONE; + //MOVE + else if(v>=7&&gol[nx][ny]==7) + parts[r>>8].type = PT_NONE; + else if(v==4&&gol[nx][ny]==7) + parts[r>>8].type = PT_NONE; + else if(v<=2&&gol[nx][ny]==7) + parts[r>>8].type = PT_NONE; + //PGOL + else if((v<=8&&v>=5)&&gol[nx][ny]==8) + parts[r>>8].type = PT_NONE; + else if(v<=2&&gol[nx][ny]==8) + parts[r>>8].type = PT_NONE; - gol2[nx][ny][1]=0; - gol2[nx][ny][2]=0; - gol2[nx][ny][3]=0; - gol2[nx][ny][4]=0; - gol2[nx][ny][5]=0; + //DMOE + else if(v<=5&&gol[nx][ny]==9) + parts[r>>8].type = PT_NONE; + + for(int z = 1;z0) parts[i].temp -= 50.0f; From fd79639c5d5165d07f454b2e146154f78cec957c Mon Sep 17 00:00:00 2001 From: Philip Date: Sun, 7 Nov 2010 00:15:45 -0400 Subject: [PATCH 31/79] compressed code, yay and a grid for rule sets. --- includes/powder.h | 15 ++- src/powder.c | 275 +++++----------------------------------------- 2 files changed, 42 insertions(+), 248 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 08aeea0fb..0b749f79e 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -386,7 +386,20 @@ static part_state pstates[PT_NUM] = /* HSWC */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* IRON */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; - +static int grule[NGOL][10] = +{ +// 0,1,2,3,4,5,6,7,8,9 live=1 spawn=2 spawn&live=3 + {0,0,0,0,0,0,0,0,0,0},//blank + {0,0,1,3,0,0,0,0,0,0},//GOL + {0,0,1,3,0,0,2,0,0,0},//HLIF + {0,0,0,2,3,3,1,1,0,0},//ASIM + {0,1,1,2,0,1,2,0,0,0},//2x2 + {0,0,0,3,1,0,3,3,3,0},//DANI + {0,1,0,3,0,3,0,2,1,0},//AMOE + {0,0,1,2,1,1,2,0,2,0},//MOVE + {0,0,1,3,0,2,0,2,1,0},//PGOL + {0,0,0,2,0,3,3,3,3,0},//DMOE +}; extern int isplayer; extern float player[27]; diff --git a/src/powder.c b/src/powder.c index 2ceaeead8..ea6506340 100644 --- a/src/powder.c +++ b/src/powder.c @@ -835,69 +835,38 @@ void update_particles_i(pixel *vid, int start, int inc) gol[nx][ny] = 0; continue; } - else if(parts[r>>8].type==PT_GOL) - { - gol[nx][ny] = 1; - } - else if(parts[r>>8].type==PT_HLIF) - { - gol[nx][ny] = 2; - } - else if(parts[r>>8].type==PT_ASIM) - { - gol[nx][ny] = 3; - } - else if(parts[r>>8].type==PT_2x2) - { - gol[nx][ny] = 4; - } - else if(parts[r>>8].type==PT_DANI) - { - gol[nx][ny] = 5; - } - else if(parts[r>>8].type==PT_AMOE) - { - gol[nx][ny] = 6; - } - else if(parts[r>>8].type==PT_MOVE) - { - gol[nx][ny] = 7; - } - else if(parts[r>>8].type==PT_PGOL) - { - gol[nx][ny] = 8; - } - else if(parts[r>>8].type==PT_DMOE) - { - gol[nx][ny] = 9; - } + else + for(int golnum=1;golnum>8].type==golnum+77) + gol[nx][ny] = golnum; + } for(nx=4;nx=1) + int golnum = gol[nx][ny]; + if(golnum>=1) for(int nnx=-1;nnx<2;nnx++) for(int nny=-1;nny<2;nny++) { if(ny+nny<4&&nx+nnx<4) - gol2[XRES-5][YRES-5][z] ++; + gol2[XRES-5][YRES-5][golnum] ++; else if(ny+nny<4&&nx+nnx>=XRES-4) - gol2[4][YRES-5][z] ++; + gol2[4][YRES-5][golnum] ++; else if(ny+nny>=YRES-4&&nx+nnx<4) - gol2[XRES-5][4][z] ++; + gol2[XRES-5][4][golnum] ++; else if(nx+nnx<4) - gol2[XRES-5][ny+nny][z] ++; + gol2[XRES-5][ny+nny][golnum] ++; else if(ny+nny<4) - gol2[nx+nnx][YRES-5][z] ++; + gol2[nx+nnx][YRES-5][golnum] ++; else if(ny+nny>=YRES-4&&nx+nnx>=XRES-4) - gol2[4][4][z] ++; + gol2[4][4][golnum] ++; else if(ny+nny>=YRES-4) - gol2[nx+nnx][4][z] ++; + gol2[nx+nnx][4][golnum] ++; else if(nx+nnx>=XRES-4) - gol2[4][ny+nny][z] ++; + gol2[4][ny+nny][golnum] ++; else - gol2[nx+nnx][ny+nny][z] ++; + gol2[nx+nnx][ny+nny][golnum] ++; } @@ -906,208 +875,20 @@ void update_particles_i(pixel *vid, int start, int inc) for(ny=4;ny=2) + int neighbors = 0; + for(int golnum = 1;golnum=2&&gol2[nx][ny][golnum]>=goldelete/2) + { + create_part(-1,nx,ny,golnum+77); + } + else if(neighbors==goldelete&&gol[nx][ny]==golnum&&(grule[golnum][goldelete-1]==0||grule[golnum][goldelete-1]==2)) + parts[r>>8].type = PT_NONE; } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][2]>=2) - { - create_part(-1,nx,ny,PT_HLIF); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][3]>=2) - { - create_part(-1,nx,ny,PT_ASIM); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][4]>=2) - { - create_part(-1,nx,ny,PT_2x2); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][5]>=2) - { - create_part(-1,nx,ny,PT_DANI); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][6]>=2) - { - create_part(-1,nx,ny,PT_AMOE); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][7]>=2) - { - create_part(-1,nx,ny,PT_MOVE); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][8]>=2) - { - create_part(-1,nx,ny,PT_PGOL); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][9]>=2) - { - create_part(-1,nx,ny,PT_DMOE); - } - - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][1]==1) - { - create_part(-1,nx,ny,PT_GOL); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][2]==1) - { - create_part(-1,nx,ny,PT_HLIF); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][4]==1) - { - create_part(-1,nx,ny,PT_2x2); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][6]==1) - { - create_part(-1,nx,ny,PT_AMOE); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][7]==1) - { - create_part(-1,nx,ny,PT_MOVE); - } - else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][8]==1) - { - create_part(-1,nx,ny,PT_PGOL); - } - //4 - else if(v==4&&gol[nx][ny]==0&&gol2[nx][ny][3]>=2) - { - create_part(-1,nx,ny,PT_ASIM); - } - //5 - else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][3]>=3) - { - create_part(-1,nx,ny,PT_ASIM); - } - else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][6]>=3) - { - create_part(-1,nx,ny,PT_AMOE); - } - else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][8]>=3) - { - create_part(-1,nx,ny,PT_PGOL); - } - else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][9]>=3) - { - create_part(-1,nx,ny,PT_DMOE); - } - //6 - else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][2]>=3) - { - create_part(-1,nx,ny,PT_HLIF); - } - else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][4]>=3) - { - create_part(-1,nx,ny,PT_2x2); - } - else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][5]>=3) - { - create_part(-1,nx,ny,PT_DANI); - } - else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][7]>=3) - { - create_part(-1,nx,ny,PT_MOVE); - } - else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][9]>=3) - { - create_part(-1,nx,ny,PT_DMOE); - } - //7 - else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4) - { - create_part(-1,nx,ny,PT_DANI); - } - else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][6]>=4) - { - create_part(-1,nx,ny,PT_AMOE); - } - else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][8]>=4) - { - create_part(-1,nx,ny,PT_PGOL); - } - else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][9]>=4) - { - create_part(-1,nx,ny,PT_DMOE); - } - //8 - else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4) - { - create_part(-1,nx,ny,PT_DANI); - } - else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][7]>=4) - { - create_part(-1,nx,ny,PT_MOVE); - } - else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][9]>=4) - { - create_part(-1,nx,ny,PT_DMOE); - } - //rules to kill particle - //GOL - else if(v>=5&&gol[nx][ny]==1) - parts[r>>8].type = PT_NONE; - else if(v<=2&&gol[nx][ny]==1) - parts[r>>8].type = PT_NONE; - //HLIF - else if(v>=5&&gol[nx][ny]==2) - parts[r>>8].type = PT_NONE; - else if(v<=2&&gol[nx][ny]==2) - parts[r>>8].type = PT_NONE; - - //ASIM - else if(v<=4&&gol[nx][ny]==3) - parts[r>>8].type = PT_NONE; - else if(v>=9&&gol[nx][ny]==3) - parts[r>>8].type = PT_NONE; - //2x2 - else if(v>=7&&gol[nx][ny]==4) - parts[r>>8].type = PT_NONE; - else if(v==4&&gol[nx][ny]==4) - parts[r>>8].type = PT_NONE; - else if(v==5&&gol[nx][ny]==4) - parts[r>>8].type = PT_NONE; - else if(v<=1&&gol[nx][ny]==4) - parts[r>>8].type = PT_NONE; - //DANI - else if(v==6&&gol[nx][ny]==5) - parts[r>>8].type = PT_NONE; - else if(v<=3&&gol[nx][ny]==5) - parts[r>>8].type = PT_NONE; - //AMOE - else if(v==8&&gol[nx][ny]==6) - parts[r>>8].type = PT_NONE; - else if(v==7&&gol[nx][ny]==6) - parts[r>>8].type = PT_NONE; - else if(v==5&&gol[nx][ny]==6) - parts[r>>8].type = PT_NONE; - else if(v==3&&gol[nx][ny]==6) - parts[r>>8].type = PT_NONE; - else if(v==1&&gol[nx][ny]==6) - parts[r>>8].type = PT_NONE; - //MOVE - else if(v>=7&&gol[nx][ny]==7) - parts[r>>8].type = PT_NONE; - else if(v==4&&gol[nx][ny]==7) - parts[r>>8].type = PT_NONE; - else if(v<=2&&gol[nx][ny]==7) - parts[r>>8].type = PT_NONE; - //PGOL - else if((v<=8&&v>=5)&&gol[nx][ny]==8) - parts[r>>8].type = PT_NONE; - else if(v<=2&&gol[nx][ny]==8) - parts[r>>8].type = PT_NONE; - - //DMOE - else if(v<=5&&gol[nx][ny]==9) - parts[r>>8].type = PT_NONE; - for(int z = 1;z Date: Sun, 7 Nov 2010 01:03:57 -0500 Subject: [PATCH 32/79] slight change --- includes/defines.h | 2 +- src/powder.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 95bc520a1..717bc4d93 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -18,7 +18,7 @@ #define THUMB_CACHE_SIZE 256 -#define NGOL 10 +#define NGOL 11 #define IMGCONNS 3 #define TIMEOUT 100 diff --git a/src/powder.c b/src/powder.c index ea6506340..e3905b627 100644 --- a/src/powder.c +++ b/src/powder.c @@ -882,7 +882,7 @@ void update_particles_i(pixel *vid, int start, int inc) for(int golnum = 1;golnum=2&&gol2[nx][ny][golnum]>=goldelete/2) + if(neighbors==goldelete&&gol[nx][ny]==0&&grule[golnum][goldelete]>=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2) { create_part(-1,nx,ny,golnum+77); } From cbe3ed49c4604864ef41e6d8e629b25259eb491e Mon Sep 17 00:00:00 2001 From: Philip Date: Sun, 7 Nov 2010 13:34:09 -0500 Subject: [PATCH 33/79] Removed old fix, not needed. And fixed loading of other saves with GoL particles on screen --- src/main.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/main.c b/src/main.c index 9db78dbbd..ee20b8d00 100644 --- a/src/main.c +++ b/src/main.c @@ -514,30 +514,13 @@ int parse_save(void *save, int size, int replace, int x0, int y0) //TODO: Possibly some server side translation j = PT_DUST;//goto corrupt; } + gol[x][y]=0; if(j)// && !(isplayer == 1 && j==PT_STKM)) { if(pmap[y][x]) { k = pmap[y][x]>>8; parts[k].type = j; - if(j == PT_GOL) - gol[x][y] = 1; - if(j == PT_HLIF) - gol[x][y] = 2; - if(j == PT_ASIM) - gol[x][y] = 3; - if(j == PT_2x2) - gol[x][y] = 4; - if(j == PT_DANI) - gol[x][y] = 5; - if(j == PT_AMOE) - gol[x][y] = 6; - if(j == PT_MOVE) - gol[x][y] = 7; - if(j == PT_PGOL) - gol[x][y] = 8; - if(j == PT_DMOE) - gol[x][y] = 9; if(j == PT_PHOT) parts[k].ctype = 0x3fffffff; parts[k].x = (float)x; From 3de06dea86b09ae382f6eda411c69db5acf2c111 Mon Sep 17 00:00:00 2001 From: Philip Date: Sun, 7 Nov 2010 17:55:25 -0500 Subject: [PATCH 34/79] Increased efficiency a lot, GoL only runs when there is a GoL particle, and other small checks to make it faster. Blank screen fps went from 44 to 60, with a few particles, 44 to 55. --- includes/defines.h | 3 +- src/main.c | 2 +- src/powder.c | 96 ++++++++++++++++++++++++---------------------- 3 files changed, 53 insertions(+), 48 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 717bc4d93..2eb107577 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -18,7 +18,7 @@ #define THUMB_CACHE_SIZE 256 -#define NGOL 11 +#define NGOL 10 #define IMGCONNS 3 #define TIMEOUT 100 @@ -107,6 +107,7 @@ typedef struct stamp stamp; int MSIGN; int CGOL; +int ISGOL; int GSPEED; int gol[XRES][YRES]; int gol2[XRES][YRES][NGOL]; diff --git a/src/main.c b/src/main.c index ee20b8d00..e7f2cd10d 100644 --- a/src/main.c +++ b/src/main.c @@ -103,7 +103,7 @@ int amd = 1; int FPSB = 0; int MSIGN =-1; int CGOL = 0; -int GSPEED = 0; +int GSPEED = 1; sign signs[MAXSIGNS]; diff --git a/src/powder.c b/src/powder.c index e3905b627..1daa18094 100644 --- a/src/powder.c +++ b/src/powder.c @@ -822,13 +822,15 @@ void update_particles_i(pixel *vid, int start, int inc) float c_heat = 0.0f; int h_count = 0; int starti = (start*-1); - if(sys_pause&&!framerender) + if(sys_pause&&!framerender) return; - if(CGOL>=GSPEED) - for(nx=4;nx=GSPEED)//GSPEED is frames per generation + { + for(nx=4;nx>8)>=NPART || !r) { @@ -838,61 +840,62 @@ void update_particles_i(pixel *vid, int start, int inc) else for(int golnum=1;golnum>8].type==golnum+77) - gol[nx][ny] = golnum; - - } - for(nx=4;nx=1) - for(int nnx=-1;nnx<2;nnx++) - for(int nny=-1;nny<2;nny++) { - if(ny+nny<4&&nx+nnx<4) - gol2[XRES-5][YRES-5][golnum] ++; - else if(ny+nny<4&&nx+nnx>=XRES-4) - gol2[4][YRES-5][golnum] ++; - else if(ny+nny>=YRES-4&&nx+nnx<4) - gol2[XRES-5][4][golnum] ++; - else if(nx+nnx<4) - gol2[XRES-5][ny+nny][golnum] ++; - else if(ny+nny<4) - gol2[nx+nnx][YRES-5][golnum] ++; - else if(ny+nny>=YRES-4&&nx+nnx>=XRES-4) - gol2[4][4][golnum] ++; - else if(ny+nny>=YRES-4) - gol2[nx+nnx][4][golnum] ++; - else if(nx+nnx>=XRES-4) - gol2[4][ny+nny][golnum] ++; - else - gol2[nx+nnx][ny+nny][golnum] ++; + gol[nx][ny] = golnum; + for(int nnx=-1;nnx<2;nnx++) + for(int nny=-1;nny<2;nny++) + { + if(ny+nny<4&&nx+nnx<4)//any way to make wrapping code smaller? + gol2[XRES-5][YRES-5][golnum] ++; + else if(ny+nny<4&&nx+nnx>=XRES-4) + gol2[4][YRES-5][golnum] ++; + else if(ny+nny>=YRES-4&&nx+nnx<4) + gol2[XRES-5][4][golnum] ++; + else if(nx+nnx<4) + gol2[XRES-5][ny+nny][golnum] ++; + else if(ny+nny<4) + gol2[nx+nnx][YRES-5][golnum] ++; + else if(ny+nny>=YRES-4&&nx+nnx>=XRES-4) + gol2[4][4][golnum] ++; + else if(ny+nny>=YRES-4) + gol2[nx+nnx][4][golnum] ++; + else if(nx+nnx>=XRES-4) + gol2[4][ny+nny][golnum] ++; + else + gol2[nx+nnx][ny+nny][golnum] ++; + } } + } - for(nx=4;nx=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2) - { - create_part(-1,nx,ny,golnum+77); - } - else if(neighbors==goldelete&&gol[nx][ny]==golnum&&(grule[golnum][goldelete-1]==0||grule[golnum][goldelete-1]==2)) - parts[r>>8].type = PT_NONE; + neighbors += gol2[nx][ny][golnum]; } - for(int z = 1;z=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2) + { + create_part(-1,nx,ny,golnum+77); + } + else if(neighbors==goldelete&&gol[nx][ny]==golnum&&(grule[golnum][goldelete-1]==0||grule[golnum][goldelete-1]==2)) + parts[pmap[ny][nx]>>8].type = PT_NONE; + } + for(int z = 1;z0) parts[i].temp -= 50.0f; + ISGOL=1; } else if(t==PT_LCRY) { From b8ed9035f7d3af3b1b7e8d404b277abcb53df083 Mon Sep 17 00:00:00 2001 From: Philip Date: Sun, 7 Nov 2010 19:05:33 -0500 Subject: [PATCH 35/79] small fix so it goes at the right speed. --- src/powder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/powder.c b/src/powder.c index 1daa18094..71e30313f 100644 --- a/src/powder.c +++ b/src/powder.c @@ -894,7 +894,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - if(ISGOL) + if(CGOL==0) CGOL++; for(i=start; i<(NPART-starti); i+=inc) if(parts[i].type) From 16265e3736d5cf9e5620d423e03ed1df0ede50eb Mon Sep 17 00:00:00 2001 From: Philip Date: Mon, 8 Nov 2010 19:59:03 -0500 Subject: [PATCH 36/79] made faster --- includes/defines.h | 2 +- includes/graphics.h | 6 ++--- includes/misc.h | 8 +++--- includes/powder.h | 12 ++++----- src/graphics.c | 6 ++--- src/misc.c | 8 +++--- src/powder.c | 64 +++++++++++++++++++++++++++------------------ 7 files changed, 60 insertions(+), 46 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 2eb107577..53a0f1920 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -1,7 +1,7 @@ #ifndef DEFINE_H #define DEFINE_H -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) #define PATH_SEP "\\" #else #define PATH_SEP "/" diff --git a/includes/graphics.h b/includes/graphics.h index ec0d597f0..6f6b133f9 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -63,13 +63,13 @@ 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 +#if defined(WIN32) && !defined(__GNUC__) _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 +#if defined(WIN32) && !defined(__GNUC__) _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); @@ -97,7 +97,7 @@ int textnheight(char *s, int n, int w); int textwidthx(char *s, int w); -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a); #else void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a); diff --git a/includes/misc.h b/includes/misc.h index 9a92a712d..5f08c950a 100644 --- a/includes/misc.h +++ b/includes/misc.h @@ -21,19 +21,19 @@ __asm__ __volatile ("cpuid":\ static char hex[] = "0123456789ABCDEF"; //Signum function -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) extern _inline int isign(float i); #else extern inline int isign(float i); #endif -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) 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 +#if defined(WIN32) && !defined(__GNUC__) extern _inline float restrict_flt(float f, float min, float max); #else extern inline float restrict_flt(float f, float min, float max); @@ -69,4 +69,4 @@ void *file_load(char *fn, int *size); int cpu_check(void); -#endif \ No newline at end of file +#endif diff --git a/includes/powder.h b/includes/powder.h index 0b749f79e..14f2e91ec 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -299,7 +299,7 @@ static const part_type ptypes[PT_NUM] = {"2x2", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (125/36)", TYPE_SOLID}, {"DANI", PIXPACK(0x00FFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Day and Night! (34678/3678)", TYPE_SOLID}, {"AMOE", PIXPACK(0xFF00FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Amoeba! (1358/357)", TYPE_SOLID}, - {"MOVE", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Move particles! (245/368)", TYPE_SOLID}, + {"MOVE", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "'Move' particles! Does not move things.. it is a life type(245/368)", TYPE_SOLID}, {"PGOL", PIXPACK(0xE05010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Pseudo Life! (238/357)", TYPE_SOLID}, {"DMOE", PIXPACK(0x500000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Diamoeba! (5678/35678)", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description @@ -421,25 +421,25 @@ int try_move(int i, int x, int y, int nx, int ny); void kill_part(int i); -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) 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 +#if defined(WIN32) && !defined(__GNUC__) extern _inline void delete_part(int x, int y); #else extern inline void delete_part(int x, int y); #endif -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) extern _inline int is_wire(int x, int y); #else extern inline int is_wire(int x, int y); #endif -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) extern _inline int is_wire_off(int x, int y); #else extern inline int is_wire_off(int x, int y); @@ -447,7 +447,7 @@ extern inline int is_wire_off(int x, int y); void set_emap(int x, int y); -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline int parts_avg(int ci, int ni); #else int parts_avg(int ci, int ni); diff --git a/src/graphics.c b/src/graphics.c index e108e99e2..9ac815bcc 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -757,7 +757,7 @@ void draw_menu(pixel *vid_buf, int i, int hover) } } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a) #else inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a) @@ -776,7 +776,7 @@ inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a) vid[y*(XRES+BARSIZE)+x] = PIXRGB(r,g,b); } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a) #else inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a) @@ -1030,7 +1030,7 @@ int textwidthx(char *s, int w) return n; } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _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) diff --git a/src/misc.c b/src/misc.c index 7c551e277..87615cd51 100644 --- a/src/misc.c +++ b/src/misc.c @@ -7,7 +7,7 @@ #include "graphics.h" //Signum function -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline int isign(float i) #else inline int isign(float i) @@ -20,7 +20,7 @@ inline int isign(float i) return 0; } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline unsigned clamp_flt(float f, float min, float max) #else inline unsigned clamp_flt(float f, float min, float max) @@ -33,7 +33,7 @@ inline unsigned clamp_flt(float f, float min, float max) return (int)(255.0f*(f-min)/(max-min)); } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline float restrict_flt(float f, float min, float max) #else inline float restrict_flt(float f, float min, float max) @@ -280,4 +280,4 @@ int cpu_check(void) #endif #endif return 0; -} \ No newline at end of file +} diff --git a/src/powder.c b/src/powder.c index 71e30313f..1c63255cf 100644 --- a/src/powder.c +++ b/src/powder.c @@ -354,7 +354,7 @@ void kill_part(int i) pfree = i; } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline int create_part(int p, int x, int y, int t) #else inline int create_part(int p, int x, int y, int t) @@ -650,7 +650,7 @@ static void create_cherenkov_photon(int pp) parts[i].vy *= r; } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline void delete_part(int x, int y) #else inline void delete_part(int x, int y) @@ -672,7 +672,7 @@ inline void delete_part(int x, int y) return; } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline int is_wire(int x, int y) #else inline int is_wire(int x, int y) @@ -681,7 +681,7 @@ inline int is_wire(int x, int y) return bmap[y][x]==6 || bmap[y][x]==7 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==11 || bmap[y][x]==12; } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline int is_wire_off(int x, int y) #else inline int is_wire_off(int x, int y) @@ -772,7 +772,7 @@ void set_emap(int x, int y) } } -#ifdef WIN32 +#if defined(WIN32) && !defined(__GNUC__) _inline int parts_avg(int ci, int ni) #else inline int parts_avg(int ci, int ni) @@ -845,24 +845,42 @@ void update_particles_i(pixel *vid, int start, int inc) for(int nnx=-1;nnx<2;nnx++) for(int nny=-1;nny<2;nny++) { - if(ny+nny<4&&nx+nnx<4)//any way to make wrapping code smaller? + if(ny+nny<4&&nx+nnx<4){//any way to make wrapping code smaller? gol2[XRES-5][YRES-5][golnum] ++; - else if(ny+nny<4&&nx+nnx>=XRES-4) + gol2[XRES-5][YRES-5][0] ++; + } + else if(ny+nny<4&&nx+nnx>=XRES-4){ gol2[4][YRES-5][golnum] ++; - else if(ny+nny>=YRES-4&&nx+nnx<4) + gol2[4][YRES-5][0] ++; + } + else if(ny+nny>=YRES-4&&nx+nnx<4){ gol2[XRES-5][4][golnum] ++; - else if(nx+nnx<4) + gol2[XRES-5][4][0] ++; + } + else if(nx+nnx<4){ gol2[XRES-5][ny+nny][golnum] ++; - else if(ny+nny<4) + gol2[XRES-5][ny+nny][0] ++; + } + else if(ny+nny<4){ gol2[nx+nnx][YRES-5][golnum] ++; - else if(ny+nny>=YRES-4&&nx+nnx>=XRES-4) + gol2[nx+nnx][YRES-5][0] ++; + } + else if(ny+nny>=YRES-4&&nx+nnx>=XRES-4){ gol2[4][4][golnum] ++; - else if(ny+nny>=YRES-4) + gol2[4][4][0] ++; + } + else if(ny+nny>=YRES-4){ gol2[nx+nnx][4][golnum] ++; - else if(nx+nnx>=XRES-4) + gol2[nx+nnx][4][0] ++; + } + else if(nx+nnx>=XRES-4){ gol2[4][ny+nny][golnum] ++; - else + gol2[4][ny+nny][0] ++; + } + else{ gol2[nx+nnx][ny+nny][golnum] ++; + gol2[nx+nnx][ny+nny][0] ++; + } } @@ -872,15 +890,11 @@ void update_particles_i(pixel *vid, int start, int inc) for(nx=4;nx=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2) { @@ -889,9 +903,9 @@ void update_particles_i(pixel *vid, int start, int inc) else if(neighbors==goldelete&&gol[nx][ny]==golnum&&(grule[golnum][goldelete-1]==0||grule[golnum][goldelete-1]==2)) parts[pmap[ny][nx]>>8].type = PT_NONE; } - for(int z = 1;z Date: Tue, 9 Nov 2010 01:04:59 -0500 Subject: [PATCH 37/79] Added 3 more life types --- includes/defines.h | 4 ++-- includes/powder.h | 33 +++++++++++++++++++++------------ src/main.c | 4 ++-- src/powder.c | 4 ++-- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 53a0f1920..7664161c1 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -18,8 +18,6 @@ #define THUMB_CACHE_SIZE 256 -#define NGOL 10 - #define IMGCONNS 3 #define TIMEOUT 100 #define HTTP_TIMEOUT 10 @@ -58,6 +56,8 @@ extern unsigned char ZSIZE; #define STAMP_Y 4 #define STAMP_MAX 120 +#define NGOL 13 + #ifdef PIX16 typedef unsigned short pixel; #else diff --git a/includes/powder.h b/includes/powder.h index 14f2e91ec..93fc0abb1 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -125,7 +125,10 @@ #define PT_MOVE 84 #define PT_PGOL 85 #define PT_DMOE 86 -#define PT_NUM 87 +#define PT_34 87 +#define PT_LLIF 88 +#define PT_STAN 89 +#define PT_NUM 90 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -302,6 +305,9 @@ static const part_type ptypes[PT_NUM] = {"MOVE", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "'Move' particles! Does not move things.. it is a life type(245/368)", TYPE_SOLID}, {"PGOL", PIXPACK(0xE05010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Pseudo Life! (238/357)", TYPE_SOLID}, {"DMOE", PIXPACK(0x500000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Diamoeba! (5678/35678)", TYPE_SOLID}, + {"34", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "34! (34/34)", TYPE_SOLID}, + {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, + {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -386,19 +392,22 @@ static part_state pstates[PT_NUM] = /* HSWC */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* IRON */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; -static int grule[NGOL][10] = +static int grule[NGOL][9] = { // 0,1,2,3,4,5,6,7,8,9 live=1 spawn=2 spawn&live=3 - {0,0,0,0,0,0,0,0,0,0},//blank - {0,0,1,3,0,0,0,0,0,0},//GOL - {0,0,1,3,0,0,2,0,0,0},//HLIF - {0,0,0,2,3,3,1,1,0,0},//ASIM - {0,1,1,2,0,1,2,0,0,0},//2x2 - {0,0,0,3,1,0,3,3,3,0},//DANI - {0,1,0,3,0,3,0,2,1,0},//AMOE - {0,0,1,2,1,1,2,0,2,0},//MOVE - {0,0,1,3,0,2,0,2,1,0},//PGOL - {0,0,0,2,0,3,3,3,3,0},//DMOE + {0,0,0,0,0,0,0,0,0},//blank + {0,0,1,3,0,0,0,0,0},//GOL + {0,0,1,3,0,0,2,0,0},//HLIF + {0,0,0,2,3,3,1,1,0},//ASIM + {0,1,1,2,0,1,2,0,0},//2x2 + {0,0,0,3,1,0,3,3,3},//DANI + {0,1,0,3,0,3,0,2,1},//AMOE + {0,0,1,2,1,1,2,0,2},//MOVE + {0,0,1,3,0,2,0,2,1},//PGOL + {0,0,0,2,0,3,3,3,3},//DMOE + {0,0,0,3,3,0,0,0,0},//34 + {0,0,0,2,2,3,0,0,0},//LLIF + {0,0,1,3,0,1,3,3,3},//STAN }; extern int isplayer; extern float player[27]; diff --git a/src/main.c b/src/main.c index e7f2cd10d..63431b431 100644 --- a/src/main.c +++ b/src/main.c @@ -102,8 +102,8 @@ int death = 0, framerender = 0; int amd = 1; int FPSB = 0; int MSIGN =-1; -int CGOL = 0; -int GSPEED = 1; +//int CGOL = 0; +//int GSPEED = 1; sign signs[MAXSIGNS]; diff --git a/src/powder.c b/src/powder.c index 1c63255cf..b845094b7 100644 --- a/src/powder.c +++ b/src/powder.c @@ -824,7 +824,7 @@ void update_particles_i(pixel *vid, int start, int inc) int starti = (start*-1); if(sys_pause&&!framerender) return; - if(ISGOL==1&&CGOL>=GSPEED)//GSPEED is frames per generation + if(ISGOL==1&&CGOL>=1)//GSPEED is frames per generation { for(nx=4;nx0) parts[i].temp -= 50.0f; From 83cd8c7979614f4164af3c9e3d19ff705e8a5430 Mon Sep 17 00:00:00 2001 From: Philip Date: Tue, 9 Nov 2010 17:41:54 -0500 Subject: [PATCH 38/79] Slight changes, added some comments --- src/main.c | 4 ++-- src/powder.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 63431b431..f513a20e5 100644 --- a/src/main.c +++ b/src/main.c @@ -102,8 +102,8 @@ int death = 0, framerender = 0; int amd = 1; int FPSB = 0; int MSIGN =-1; -//int CGOL = 0; -//int GSPEED = 1; +int CGOL = 0; +int GSPEED = 1;//causes my .exe to crash.. sign signs[MAXSIGNS]; diff --git a/src/powder.c b/src/powder.c index b845094b7..5f7c669d5 100644 --- a/src/powder.c +++ b/src/powder.c @@ -824,7 +824,7 @@ void update_particles_i(pixel *vid, int start, int inc) int starti = (start*-1); if(sys_pause&&!framerender) return; - if(ISGOL==1&&CGOL>=1)//GSPEED is frames per generation + if(ISGOL==1&&CGOL>=GSPEED)//GSPEED is frames per generation { for(nx=4;nx=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2) { create_part(-1,nx,ny,golnum+77); } - else if(neighbors==goldelete&&gol[nx][ny]==golnum&&(grule[golnum][goldelete-1]==0||grule[golnum][goldelete-1]==2)) + else if(neighbors-1==goldelete&&gol[nx][ny]==golnum&&(grule[golnum][goldelete]==0||grule[golnum][goldelete]==2))//subtract 1 because it counted itself parts[pmap[ny][nx]>>8].type = PT_NONE; } gol2[nx][ny][0] = 0; From bd8a9f49313839cee94513f6c3059fdbdf824dda Mon Sep 17 00:00:00 2001 From: Philip Date: Wed, 10 Nov 2010 14:28:05 -0500 Subject: [PATCH 39/79] made myself for AntB because he is a bad coder, here you go --- includes/powder.h | 18 +++++++++++++++++- src/powder.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 93fc0abb1..891c44118 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -128,7 +128,8 @@ #define PT_34 87 #define PT_LLIF 88 #define PT_STAN 89 -#define PT_NUM 90 +#define PT_CRAC 90 +#define PT_NUM 91 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -308,6 +309,7 @@ static const part_type ptypes[PT_NUM] = {"34", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "34! (34/34)", TYPE_SOLID}, {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, + {"CRAC", PIXPACK(0xF0F0BA), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP + 273.15f, 140, "A cracker acting like a sponge", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -391,6 +393,20 @@ static part_state pstates[PT_NUM] = /* 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}, /* IRON */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* MORT */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* CRAC */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { diff --git a/src/powder.c b/src/powder.c index 5f7c669d5..9a166ca06 100644 --- a/src/powder.c +++ b/src/powder.c @@ -919,7 +919,7 @@ void update_particles_i(pixel *vid, int start, int inc) ly = parts[i].y; t = parts[i].type; - if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL) + if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL && t!=PT_CRAC) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; @@ -1880,6 +1880,49 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].temp -= 50.0f; ISGOL=1; } + else if(t==PT_CRAC) + { + if(pv[y/CELL][x/CELL]<=3&&pv[y/CELL][x/CELL]>=-3) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8].type==PT_WATR&&5>=rand()%100) + { + parts[i].tmp++; + parts[r>>8].type=PT_NONE; + } + } + } + else + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r )&&parts[i].tmp>=1)//if nothing then create water + { + create_part(-1,x+nx,y+ny,PT_WATR); + parts[i].tmp --; + } + } + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8].type==t&&(parts[i].tmp>parts[r>>8].tmp)&&5>=rand()%50&&parts[i].tmp>0)//diffusion + { + parts[r>>8].tmp ++; + parts[i].tmp --; + } + } + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) From e47c60c07a942aad222f49ac895931807c77f7cc Mon Sep 17 00:00:00 2001 From: Philip Date: Wed, 10 Nov 2010 16:33:44 -0500 Subject: [PATCH 40/79] CRAC has real diffusion and gets darker with more water. you can see the water moving around. --- src/graphics.c | 14 ++++++++++++++ src/powder.c | 16 ++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index 9ac815bcc..2eb1c7a32 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1349,6 +1349,20 @@ void draw_parts(pixel *vid) } } + else if(t==PT_CRAC) + { + cr = PIXR(ptypes[t].pcolors) - parts[i].life*15; + cg = PIXG(ptypes[t].pcolors) - parts[i].life*15; + cb = PIXB(ptypes[t].pcolors) - parts[i].life*15; + if(cr<=50) + cr = 50; + if(cg<=50) + cg = 50; + if(cb<=20) + cb = 20; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + + } else if(t==PT_ACID) { if(parts[i].life>255) parts[i].life = 255; diff --git a/src/powder.c b/src/powder.c index 9a166ca06..bb891c4f3 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1892,7 +1892,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if(parts[r>>8].type==PT_WATR&&5>=rand()%100) { - parts[i].tmp++; + parts[i].life++; parts[r>>8].type=PT_NONE; } } @@ -1904,22 +1904,22 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>8)>=NPART || !r )&&parts[i].tmp>=1)//if nothing then create water + if(((r>>8)>=NPART || !r )&&parts[i].life>=1)//if nothing then create water { create_part(-1,x+nx,y+ny,PT_WATR); - parts[i].tmp --; + parts[i].life --; } } - for(nx=-1; nx<2; nx++) - for(ny=-1; ny<2; ny++) + nx = rand()%5-2; + ny = rand()%5-2; if(x+nx>=0 && y+ny>0 && x+nx>8].type==t&&(parts[i].tmp>parts[r>>8].tmp)&&5>=rand()%50&&parts[i].tmp>0)//diffusion + if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion { - parts[r>>8].tmp ++; - parts[i].tmp --; + parts[r>>8].life ++; + parts[i].life --; } } } From 673eb2437e2cc7491b94f95e0f65cd276e351872 Mon Sep 17 00:00:00 2001 From: Philip Date: Wed, 10 Nov 2010 18:02:40 -0500 Subject: [PATCH 41/79] fixed tiny bug where it wouldnt diffuse --- src/powder.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/powder.c b/src/powder.c index bb891c4f3..ca98e4338 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1910,18 +1910,18 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life --; } } - nx = rand()%5-2; - ny = rand()%5-2; - if(x+nx>=0 && y+ny>0 && - x+nx>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion - { - parts[r>>8].life ++; - parts[i].life --; - } + nx = rand()%5-2; + ny = rand()%5-2; + if(x+nx>=0 && y+ny>0 && + x+nx>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion + { + parts[r>>8].life ++; + parts[i].life --; } + } } else if(t==PT_LCRY) { From 179a9f731a251249237d9007038771036ff701df Mon Sep 17 00:00:00 2001 From: Philip Date: Wed, 10 Nov 2010 19:42:42 -0500 Subject: [PATCH 42/79] Updating with all new changes --- includes/defines.h | 4 +- includes/graphics.h | 4 +- includes/interface.h | 4 +- includes/powder.h | 11 +- src/graphics.c | 34 ++- src/interface.c | 501 +++++++++++++++++++++++-------------------- src/powder.c | 63 ++++-- 7 files changed, 363 insertions(+), 258 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 7664161c1..68cc60039 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -1,14 +1,14 @@ #ifndef DEFINE_H #define DEFINE_H -#if defined(WIN32) && !defined(__GNUC__) +#ifdef WIN32 #define PATH_SEP "\\" #else #define PATH_SEP "/" #endif #define SAVE_VERSION 43 -#define MINOR_VERSION 0 +#define MINOR_VERSION 1 #define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter. #define BETA diff --git a/includes/graphics.h b/includes/graphics.h index 6f6b133f9..e23fe9d10 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -93,10 +93,12 @@ int drawtextmax(pixel *vid, int x, int y, int w, char *s, int r, int g, int b, i int textnwidth(char *s, int n); -int textnheight(char *s, int n, int w); +void textnpos(char *s, int n, int w, int *cx, int *cy); int textwidthx(char *s, int w); +int textposxy(char *s, int width, int w, int h); + #if defined(WIN32) && !defined(__GNUC__) _inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a); #else diff --git a/includes/interface.h b/includes/interface.h index 2ec807def..852294537 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -205,7 +205,7 @@ void execute_save(pixel *vid_buf); int execute_delete(pixel *vid_buf, char *id); -int execute_report(pixel *vid_buf, char *id); +int execute_report(pixel *vid_buf, char *id, char *reason); void execute_submit(pixel *vid_buf, char *id, char *message); @@ -215,5 +215,7 @@ int execute_vote(pixel *vid_buf, char *id, char *action); void open_link(char *uri); +int report_ui(pixel *vid_buf, char *save_id); + #endif diff --git a/includes/powder.h b/includes/powder.h index 891c44118..255c5d7d1 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -148,12 +148,13 @@ #define TYPE_LIQUID 0x0002 //2 Liquids #define TYPE_SOLID 0x0004 //4 Solids #define TYPE_GAS 0x0008 //8 Gasses (Includes plasma) -#define TYPE_ENERGY 0x0018 //16 Energy (Thunder, Light, Neutrons etc.) +#define TYPE_ENERGY 0x0010 //16 Energy (Thunder, Light, Neutrons etc.) #define PROP_CONDUCTS 0x0020 //32 Conducts electricity (Currently Unused) #define PROP_BLACK 0x0040 //64 Absorbs Photons #define PROP_NEUTPENETRATE 0x0080 //128 Penetrated by neutrons #define PROP_NEUTABSORB 0x0100 //256 Absorbs neutrons, reflect is default -#define PROP_DEADLY 0x0200 //512 Is deadly for stickman. +#define PROP_NEUTPASS 0x0200 //512 Neutrons pass through, such as with glass +#define PROP_DEADLY 0x0400 //1024 Is deadly for stickman. #define FLAG_STAGNANT 1 struct particle @@ -230,8 +231,8 @@ static const part_type ptypes[PT_NUM] = {"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, 23, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 50, "Liquid. Pressure sensitive explosive.", TYPE_LIQUID}, {"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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Duplicates any particles it touches.", TYPE_SOLID}, {"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, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Gas. Diffuses. Flammable. Liquifies under pressure.", TYPE_GAS}, - {"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, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive.", TYPE_SOLID}, - {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure.", TYPE_SOLID}, + {"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, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive.", TYPE_SOLID | PROP_NEUTPENETRATE}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure.", TYPE_SOLID | PROP_NEUTPENETRATE}, {"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, 100, SC_SOLIDS, R_TEMP-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air.", TYPE_SOLID}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Conducts electricity. Meltable.", TYPE_SOLID|PROP_CONDUCTS}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electricity. Conducted by metal and water.", TYPE_SOLID}, @@ -264,7 +265,7 @@ static const part_type ptypes[PT_NUM] = {"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, 45, SC_EXPLOSIVE, R_TEMP+45.0f+273.15f, 170, "Liquid Rubidium.", TYPE_LIQUID|PROP_CONDUCTS}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when hot (More than 100C)", TYPE_SOLID}, {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Sand, Heavy particles. Meltable.", TYPE_PART}, - {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure", TYPE_SOLID}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure", TYPE_SOLID | PROP_NEUTPASS}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when cold (Less than 120C)", TYPE_SOLID}, {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Glass, Heavy particles. Meltable. Bagels.", TYPE_PART}, {"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, 1, SC_ELEC, 9000.0f +273.15f, 251, "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals.", TYPE_ENERGY}, diff --git a/src/graphics.c b/src/graphics.c index 2eb1c7a32..c56d06718 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1002,18 +1002,25 @@ int textnwidth(char *s, int n) } return x-1; } -int textnheight(char *s, int n, int w) +void textnpos(char *s, int n, int w, int *cx, int *cy) { int x = 0; + int y = 0; //TODO: Implement Textnheight for wrapped text for(; *s; s++) { - if(!n) + if(!n){ break; + } x += font_data[font_ptrs[(int)(*(unsigned char *)s)]]; + if(x>=w) { + x = 0; + y += FONT_H+2; + } n--; } - return x-1; + *cx = x-1; + *cy = y; } int textwidthx(char *s, int w) @@ -1029,6 +1036,23 @@ int textwidthx(char *s, int w) } return n; } +int textposxy(char *s, int width, int w, int h) +{ + int x=0,y=0,n=0,cw; + for(; *s; s++) + { + cw = font_data[font_ptrs[(int)(*(unsigned char *)s)]]; + if(x+(cw/2) >= w && y+6 >= h) + break; + x += cw; + if(x>=width) { + x = 0; + y += FONT_H+2; + } + n++; + } + return n; +} #if defined(WIN32) && !defined(__GNUC__) _inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a) @@ -1244,7 +1268,6 @@ void draw_parts(pixel *vid) int cr, cg, cb; float fr, fg, fb; float pt = R_TEMP; - int gol[XRES][YRES]; for(i = 0; i= 10) { x = nx; y = ny; diff --git a/src/interface.c b/src/interface.c index 07edca9cc..45d1efdb2 100644 --- a/src/interface.c +++ b/src/interface.c @@ -33,6 +33,7 @@ int svf_myvote = 0; int svf_publish = 0; char svf_id[16] = ""; char svf_name[64] = ""; +char svf_description[255] = ""; char svf_tags[256] = ""; void *svf_last = NULL; int svf_lsize; @@ -227,7 +228,7 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) //TODO: Finish text wrapping in text edits void ui_edit_draw(pixel *vid_buf, ui_edit *ed) { - int cx, i; + int cx, i, cy; char echo[256], *str; if(ed->hide) @@ -254,9 +255,15 @@ void ui_edit_draw(pixel *vid_buf, ui_edit *ed) drawtext(vid_buf, ed->x, ed->y, ed->def, 128, 128, 128, 255); if(ed->focus) { - cx = textnwidth(str, ed->cursor); + if(ed->multiline){ + textnpos(str, ed->cursor, ed->w-14, &cx, &cy); + } else { + cx = textnwidth(str, ed->cursor); + cy = 0; + } + for(i=-3; i<9; i++) - drawpixel(vid_buf, ed->x+cx, ed->y+i, 255, 255, 255, 255); + drawpixel(vid_buf, ed->x+cx, ed->y+i+cy, 255, 255, 255, 255); } } @@ -290,7 +297,7 @@ void ui_edit_process(int mx, int my, int mb, ui_edit *ed) else if(mx>=ed->x-ed->nx && mxx+ed->w && my>=ed->y-5 && myy+ed->h) { ed->focus = 1; - ed->cursor = textwidthx(str, mx-ed->x); + ed->cursor = textposxy(str, ed->w-14, mx-ed->x, my-ed->y); } else ed->focus = 0; @@ -1137,9 +1144,10 @@ finish: int save_name_ui(pixel *vid_buf) { - int x0=(XRES-192)/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,nd=0; void *th; ui_edit ed; + ui_edit ed2; ui_checkbox cb; th = build_thumb(&ths, 0); @@ -1161,6 +1169,18 @@ int save_name_ui(pixel *vid_buf) ed.cursor = strlen(svf_name); ed.multiline = 0; strcpy(ed.str, svf_name); + + ed2.x = x0+13; + ed2.y = y0+45; + ed2.w = 166; + ed2.h = 85; + ed2.nx = 1; + ed2.def = "[simulation description]"; + ed2.focus = 0; + ed2.hide = 0; + ed2.cursor = strlen(svf_description); + ed2.multiline = 1; + strcpy(ed2.str, svf_description); cb.x = x0+10; cb.y = y0+53+YRES/4; @@ -1175,26 +1195,32 @@ int save_name_ui(pixel *vid_buf) mx /= sdl_scale; my /= sdl_scale; - drawrect(vid_buf, x0, y0, 192, 90+YRES/4, 192, 192, 192, 255); - clearrect(vid_buf, x0, y0, 192, 90+YRES/4); + drawrect(vid_buf, x0, y0, 420, 90+YRES/4, 192, 192, 192, 255); + clearrect(vid_buf, x0, y0, 420, 90+YRES/4); drawtext(vid_buf, x0+8, y0+8, "New simulation name:", 255, 255, 255, 255); drawtext(vid_buf, x0+10, y0+23, "\x82", 192, 192, 192, 255); drawrect(vid_buf, x0+8, y0+20, 176, 16, 192, 192, 192, 255); + + drawrect(vid_buf, x0+8, y0+40, 176, 95, 192, 192, 192, 255); ui_edit_draw(vid_buf, &ed); + ui_edit_draw(vid_buf, &ed2); - drawrect(vid_buf, x0+(192-XRES/4)/2-2, y0+42, XRES/4+3, YRES/4+3, 128, 128, 128, 255); - render_thumb(th, ths, 0, vid_buf, x0+(192-XRES/4)/2, y0+44, 4); + drawrect(vid_buf, x0+(205-XRES/3)/2-2+205, y0+30, XRES/3+3, YRES/3+3, 128, 128, 128, 255); + render_thumb(th, ths, 0, vid_buf, x0+(205-XRES/3)/2+205, y0+32, 3); ui_checkbox_draw(vid_buf, &cb); drawtext(vid_buf, x0+34, y0+50+YRES/4, "Publish? (Do not publish others'\nworks without permission)", 192, 192, 192, 255); drawtext(vid_buf, x0+5, y0+79+YRES/4, "Save simulation", 255, 255, 255, 255); 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); sdl_blit(0, 0, (XRES+BARSIZE), YRES+MENUSIZE, vid_buf, (XRES+BARSIZE)); ui_edit_process(mx, my, b, &ed); + ui_edit_process(mx, my, b, &ed2); ui_checkbox_process(mx, my, b, bq, &cb); if(b && !bq && ((mx>=x0+9 && mx=y0+22 && my(XRES+BARSIZE-400)+150 && my>(YRES+MENUSIZE-150)-18 && mx<(XRES+BARSIZE-400)+200 && my<(YRES+MENUSIZE-150)){ + fillrect(vid_buf, (XRES+BARSIZE-400)+150, (YRES+MENUSIZE-150)-18, 50, 18, 255, 255, 255, 40); + if(b){ + if(execute_report(vid_buf, save_id, ed.str)){ + info_ui(vid_buf, "Success", "This save has been reported"); + return 1; + } else { + return 0; + } + } + } + if(mx>200 && my>(YRES+MENUSIZE-150)-18 && mx<250 && my<(YRES+MENUSIZE-150)){ + fillrect(vid_buf, 200, (YRES+MENUSIZE-150)-18, 50, 18, 255, 255, 255, 40); + if(b) + return 0; + } + ui_edit_draw(vid_buf, &ed); + sdl_blit(0, 0, (XRES+BARSIZE), YRES+MENUSIZE, vid_buf, (XRES+BARSIZE)); + ui_edit_process(mx, my, b, &ed); + } + return 0; +} + int open_ui(pixel *vid_buf, char *save_id, char *save_date) { int b=1,bq,mx,my,ca=0,thumb_w,thumb_h,active=0,active_2=0,cc=0,ccy=0,cix=0,hasdrawninfo=0,hasdrawnthumb=0,authoritah=0,myown=0,queue_open=0,data_size=0,retval=0,bc=255,openable=1; - char *uri, *uri_2, *o_uri; + int nyd,nyu,ry,lv; + + char *uri, *uri_2, *o_uri; void *data, *info_data; save_info *info = malloc(sizeof(save_info)); void *http = NULL, *http_2 = NULL; @@ -2727,13 +2700,44 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); } if(info_ready && !hasdrawninfo) { - //drawtext(vid_buf, 2, 2, info->name, 255, 255, 255, 255); + //Render all the save information cix = drawtext(vid_buf, 60, (YRES/2)+60, info->name, 255, 255, 255, 255); cix = drawtext(vid_buf, 60, (YRES/2)+72, "Author:", 255, 255, 255, 155); cix = drawtext(vid_buf, cix+4, (YRES/2)+72, info->author, 255, 255, 255, 255); cix = drawtext(vid_buf, cix+4, (YRES/2)+72, "Date:", 255, 255, 255, 155); cix = drawtext(vid_buf, cix+4, (YRES/2)+72, info->date, 255, 255, 255, 255); drawtextwrap(vid_buf, 62, (YRES/2)+86, (XRES/2)-24, info->description, 255, 255, 255, 200); + + //Draw the score bars + if(info->voteup>0||info->votedown>0) + { + lv = (info->voteup>info->votedown?info->voteup:info->votedown); + + if(50>lv) + { + ry = ((float)(50)/(float)lv); + if(lv<8) + { + ry = ry/(8-lv); + } + nyu = info->voteup*ry; + nyd = info->votedown*ry; + } + else + { + ry = ((float)lv/(float)(50)); + nyu = info->voteup/ry; + nyd = info->votedown/ry; + } + + fillrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+53, 54, 6, 0, 107, 10, 255); + fillrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+59, 54, 6, 107, 10, 0, 255); + drawrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+53, 54, 6, 128, 128, 128, 255); + drawrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+59, 54, 6, 128, 128, 128, 255); + + fillrect(vid_buf, 48+(XRES/2)-nyu, (YRES/2)+54, nyu, 4, 57, 187, 57, 255); + fillrect(vid_buf, 48+(XRES/2)-nyd, (YRES/2)+60, nyd, 4, 187, 57, 57, 255); + } ccy = 0; for(cc=0; cccomment_count; cc++) { @@ -2749,7 +2753,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) memcpy(old_vid, vid_buf, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); } if(info_ready && svf_login){ - + //Render the comment box. fillrect(vid_buf, 50+(XRES/2)+1, YRES+MENUSIZE-125, XRES+BARSIZE-100-((XRES/2)+1), 75, 0, 0, 0, 255); drawrect(vid_buf, 50+(XRES/2)+1, YRES+MENUSIZE-125, XRES+BARSIZE-100-((XRES/2)+1), 75, 200, 200, 200, 255); @@ -2761,55 +2765,8 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) drawtext(vid_buf, XRES+BARSIZE-90, YRES+MENUSIZE-63, "Submit", 255, 255, 255, 255); } - if(queue_open) { - if(info_ready && data_ready) { - // Do Open! - status = parse_save(data, data_size, 1, 0, 0); - if(!status) { - //if(svf_last) - //free(svf_last); - svf_last = data; - svf_lsize = data_size; - - svf_open = 1; - svf_own = svf_login && !strcmp(info->author, svf_user); - svf_publish = info->publish && svf_login && !strcmp(info->author, svf_user); - - strcpy(svf_id, save_id); - strcpy(svf_name, info->name); - if(info->tags) - { - strncpy(svf_tags, info->tags, 255); - svf_tags[255] = 0; - } else { - svf_tags[0] = 0; - } - svf_myvote = info->myvote; - retval = 1; - break; - } else { - queue_open = 0; - - svf_open = 0; - svf_publish = 0; - svf_own = 0; - svf_myvote = 0; - svf_id[0] = 0; - svf_name[0] = 0; - svf_tags[0] = 0; - if(svf_last) - free(svf_last); - svf_last = NULL; - error_ui(vid_buf, 0, "An Error Occurred"); - } - } else { - fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 190); - drawtext(vid_buf, XRES+BARSIZE/2, XRES+MENUSIZE, "Loading...", 0, 0, 0, 200); - } - } - //Open Button - bc = openable?255:150; + bc = openable?255:150; drawrect(vid_buf, 50, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); drawtext(vid_buf, 73, YRES+MENUSIZE-63, "Open", 255, 255, 255, bc); drawtext(vid_buf, 58, YRES+MENUSIZE-64, "\x81", 255, 255, 255, bc); @@ -2824,55 +2781,50 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) drawtext(vid_buf, 168, YRES+MENUSIZE-63, "Report", 255, 255, 255, bc); drawtext(vid_buf, 158, YRES+MENUSIZE-63, "!", 255, 255, 255, bc); //Delete Button - bc = authoritah?255:150; - drawrect(vid_buf, 200, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); - drawtext(vid_buf, 218, YRES+MENUSIZE-63, "Delete", 255, 255, 255, bc); - drawtext(vid_buf, 206, YRES+MENUSIZE-64, "\xAA", 255, 255, 255, bc); - //Open in browser button - bc = 255; + bc = authoritah?255:150; + drawrect(vid_buf, 200, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, bc); + drawtext(vid_buf, 218, YRES+MENUSIZE-63, "Delete", 255, 255, 255, bc); + drawtext(vid_buf, 206, YRES+MENUSIZE-64, "\xAA", 255, 255, 255, bc); + //Open in browser button + bc = 255; drawrect(vid_buf, 250, YRES+MENUSIZE-68, 107, 18, 255, 255, 255, bc); drawtext(vid_buf, 273, YRES+MENUSIZE-63, "Open in Browser", 255, 255, 255, bc); drawtext(vid_buf, 258, YRES+MENUSIZE-64, "\x81", 255, 255, 255, bc); - //Open Button - if(sdl_key==SDLK_RETURN && openable) { + //Open Button + if(sdl_key==SDLK_RETURN && openable) { queue_open = 1; } - if(mx > 50 && mx < 50+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && openable) { + if(mx > 50 && mx < 50+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && openable && !queue_open) { fillrect(vid_buf, 50, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); if(b && !bq) { - //Button Clicked + //Button Clicked queue_open = 1; } } - //Fav Button - if(mx > 100 && mx < 100+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login) { + //Fav Button + if(mx > 100 && mx < 100+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login && !queue_open) { fillrect(vid_buf, 100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); - if(b && !bq) { + if(b && !bq) { //Button Clicked - fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); - info_box(vid_buf, "Adding to favourites..."); - execute_fav(vid_buf, save_id); + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); + info_box(vid_buf, "Adding to favourites..."); + execute_fav(vid_buf, save_id); } - } - //Report Button - if(mx > 150 && mx < 150+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login && info_ready) { - fillrect(vid_buf, 150, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); + } + //Report Button + if(mx > 150 && mx < 150+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login && info_ready && !queue_open) { + fillrect(vid_buf, 150, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); if(b && !bq) { //Button Clicked - if(confirm_ui(vid_buf, "Are you sure?", "Are you sure you wish to report this save?", "Report")){ - fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192); - info_box(vid_buf, "Reporting..."); - if(execute_report(vid_buf, save_id)){ - info_ui(vid_buf, "Success", "This save has been reported"); - retval = 0; - break; - } + if(report_ui(vid_buf, save_id)){ + retval = 0; + break; } } } //Delete Button - if(mx > 200 && mx < 200+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && (authoritah || myown)) { + if(mx > 200 && mx < 200+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && (authoritah || myown) && !queue_open) { fillrect(vid_buf, 200, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); if(b && !bq) { //Button Clicked @@ -2898,7 +2850,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) } } //Open in browser button - if(mx > 250 && mx < 250+107 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50) { + if(mx > 250 && mx < 250+107 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && !queue_open) { fillrect(vid_buf, 250, YRES+MENUSIZE-68, 107, 18, 255, 255, 255, 40); if(b && !bq) { //Button Clicked @@ -2911,7 +2863,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) } } //Submit Button - if(mx > XRES+BARSIZE-100 && mx < XRES+BARSIZE-100+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login && info_ready) { + if(mx > XRES+BARSIZE-100 && mx < XRES+BARSIZE-100+50 && my > YRES+MENUSIZE-68 && my < YRES+MENUSIZE-50 && svf_login && info_ready && !queue_open) { fillrect(vid_buf, XRES+BARSIZE-100, YRES+MENUSIZE-68, 50, 18, 255, 255, 255, 40); if(b && !bq) { //Button Clicked @@ -2921,18 +2873,86 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) } } + if(!(mx>50 && my>50 && mxauthor, svf_user); + svf_publish = info->publish && svf_login && !strcmp(info->author, svf_user); + + strcpy(svf_id, save_id); + strcpy(svf_name, info->name); + strcpy(svf_description, info->description); + if(info->tags) + { + strncpy(svf_tags, info->tags, 255); + svf_tags[255] = 0; + } else { + svf_tags[0] = 0; + } + svf_myvote = info->myvote; + retval = 1; + break; + } else { + queue_open = 0; + + svf_open = 0; + svf_publish = 0; + svf_own = 0; + svf_myvote = 0; + svf_id[0] = 0; + svf_name[0] = 0; + svf_description[0] = 0; + svf_tags[0] = 0; + if(svf_last) + free(svf_last); + svf_last = NULL; + error_ui(vid_buf, 0, "An Error Occurred"); + } + } else { + fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 190); + drawtext(vid_buf, 50+(XRES/4)-textwidth("Loading...")/2, 50+(YRES/4), "Loading...", 255, 255, 255, 128); + } + } + sdl_blit(0, 0, (XRES+BARSIZE), YRES+MENUSIZE, vid_buf, (XRES+BARSIZE)); memcpy(vid_buf, old_vid, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); if(info_ready && svf_login){ ui_edit_process(mx, my, b, &ed); } - if(sdl_key==SDLK_ESCAPE) + if(sdl_key==SDLK_ESCAPE){ + retval = 0; break; + } if(lasttime= PT_NUM || (ptypes[(r&0xFF)].properties&TYPE_ENERGY)))) + if(r && (r&0xFF) < PT_NUM){ + //if(ptypes[pt].properties&TYPE_ENERGY && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&TYPE_ENERGY)))) + if(ptypes[pt].properties&TYPE_ENERGY && ptypes[(r&0xFF)].properties&TYPE_ENERGY) return 2; - if(pt==PT_NEUT && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE)))) + //if(pt==PT_NEUT && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE)))) + if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPASS) + return 2; + if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE) return 1; if((r&0xFF)==PT_NEUT && ptypes[pt].properties&PROP_NEUTPENETRATE) return 0; + } if (r && ((r&0xFF) >= PT_NUM || (ptypes[pt].weight <= ptypes[(r&0xFF)].weight))) return 0; @@ -1204,6 +1210,11 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].tmp = 0; parts[i].ctype = PT_BMTL; } + if(parts[i].ctype==PT_PLUT) + { + parts[i].tmp = 0; + parts[i].ctype = PT_LAVA; + } t = parts[i].type = parts[i].ctype; parts[i].ctype = PT_NONE; } @@ -1271,6 +1282,11 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].tmp--; parts[i].temp = 3500; } + if(parts[i].ctype==PT_PLUT&&parts[i].tmp>0) + { + parts[i].tmp--; + parts[i].temp = MAX_TEMP; + } } pt = parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP); } @@ -1516,7 +1532,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = create_part(-1, x, y, PT_PLSM); if(r!=-1) parts[r].life = 50; - //goto killed; + goto killed; } else if (parts[i].life < 40) { parts[i].life--; if((rand()%100)==0) { @@ -1533,7 +1549,7 @@ void update_particles_i(pixel *vid, int start, int inc) //t = PT_NONE; kill_part(i); r = create_part(-1, x, y, PT_FSEP); - //goto killed; + goto killed; } for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) @@ -1559,7 +1575,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = create_part(-1, x, y, PT_PLSM); if(r!=-1) parts[r].life = 50; - //goto killed; + goto killed; } else if (parts[i].life < 40) { parts[i].life--; if((rand()%10)==0) { @@ -1811,7 +1827,12 @@ void update_particles_i(pixel *vid, int start, int inc) { if(33>rand()%100) { - create_part(r>>8, x+nx, y+ny, rand()%2 ? PT_LAVA : PT_URAN); + create_part(r>>8, x+nx, y+ny, rand()%3 ? PT_LAVA : PT_URAN); + parts[r>>8].temp = MAX_TEMP; + if(parts[r>>8].type==PT_LAVA){ + parts[r>>8].tmp = 100; + parts[r>>8].ctype = PT_PLUT; + } } else { @@ -2046,14 +2067,15 @@ void update_particles_i(pixel *vid, int start, int inc) { parts[i].type = PT_NONE; kill_part(i); + goto killed; } parts[r>>8].life = 0; parts[r>>8].type = PT_NONE; kill_part(r>>8); if(2>(rand()/(RAND_MAX/100))) - create_part(r>>8, x+nx, y+ny, PT_PHOT); + create_part(-1, x+nx, y+ny, PT_PHOT); pv[y/CELL][x/CELL] -= 5.0f; - continue; + //goto killed; } } } @@ -2111,9 +2133,11 @@ void update_particles_i(pixel *vid, int start, int inc) } pv[y/CELL][x/CELL] += 20; kill_part(i); + goto killed; } else if(parts[i].tmp>=3) { if(parts[i].life<=0) { kill_part(i); + goto killed; } } } @@ -2252,6 +2276,19 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + //Check if there is a SWCH that is currently covered with SPRK + //If so check if the current SPRK is covering a NSCN + //If so turn the SPRK that covers the SWCH back into SWCH and turn it off + if(rt==PT_SPRK && parts[r>>8].ctype == PT_SWCH && t==PT_SPRK) + { + pavg = parts_avg(r>>8, i); + if(parts[i].ctype == PT_NSCN&&pavg != PT_INSL) + { + parts[r>>8].type = PT_SWCH; + parts[r>>8].ctype = PT_NONE; + parts[r>>8].life = 0; + } + } pavg = parts_avg(i, r>>8); if(rt==PT_SWCH && t==PT_SPRK) { @@ -2260,7 +2297,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].life = 10; if(parts[i].ctype == PT_NSCN&&pavg != PT_INSL) parts[r>>8].life = 9; - if(!(parts[i].ctype == PT_PSCN||parts[i].ctype == PT_NSCN)&&parts[r>>8].life == 10&&pavg != PT_INSL) + if(!(parts[i].ctype == PT_PSCN||parts[i].ctype == PT_NSCN)&&parts[r>>8].life >= 10&&pavg != PT_INSL) //Life can be 11 too, so don't just check for 10 { parts[r>>8].type = PT_SPRK; parts[r>>8].ctype = PT_SWCH; @@ -2996,7 +3033,7 @@ killed: kill_part(i); continue; } - else if(t==PT_NEUT || t==PT_PHOT) + else if(t==PT_NEUT || t==PT_PHOT) //Seems to break neutrons, sorry Skylark { r = pmap[ny][nx]; @@ -3032,12 +3069,14 @@ killed: continue; } } else { - kill_part(i); + if(t!=PT_NEUT) + kill_part(i); continue; } if(!parts[i].ctype) { - kill_part(i); + if(t!=PT_NEUT) + kill_part(i); continue; } } From bf1d90d7c3283b9a145ea98d6b1802465ea259b4 Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 11 Nov 2010 11:02:02 -0500 Subject: [PATCH 43/79] CRAC improvements. Resistant to fire when wet, steams when hot, fixed wall errors. --- includes/powder.h | 4 +- src/powder.c | 128 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 92 insertions(+), 40 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 255c5d7d1..28f05c6f3 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -310,7 +310,7 @@ static const part_type ptypes[PT_NUM] = {"34", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "34! (34/34)", TYPE_SOLID}, {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, - {"CRAC", PIXPACK(0xF0F0BA), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP + 273.15f, 140, "A cracker acting like a sponge", TYPE_SOLID}, + {"CRAC", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "cracker64 - Spongey, Made by himself",TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -407,7 +407,7 @@ static part_state pstates[PT_NUM] = /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* CRAC */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* Crac */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 22730.0f}, }; static int grule[NGOL][9] = { diff --git a/src/powder.c b/src/powder.c index a371c635e..edc8f9e0f 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1904,45 +1904,97 @@ void update_particles_i(pixel *vid, int start, int inc) else if(t==PT_CRAC) { if(pv[y/CELL][x/CELL]<=3&&pv[y/CELL][x/CELL]>=-3) - { + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r || parts[i].temp>374.0f) + continue; + if(parts[r>>8].type==PT_WATR&&33>=rand()/(RAND_MAX/100)+1) + { + parts[i].life++; + parts[r>>8].type=PT_NONE; + } + } + } + else + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART) + continue; + if((bmap[(y+ny)/CELL][(x+nx)/CELL]==8||bmap[(y+ny)/CELL][(x+nx)/CELL]==7||bmap[(y+ny)/CELL][(x+nx)/CELL]==2||bmap[(y+ny)/CELL][(x+nx)/CELL]==1|| + bmap[(y+ny)/CELL][(x+nx)/CELL]==9||bmap[(y+ny)/CELL][(x+nx)/CELL]==10||bmap[(y+ny)/CELL][(x+nx)/CELL]==13)) + continue; + if((!r)&&parts[i].life>=1)//if nothing then create water + { + create_part(-1,x+nx,y+ny,PT_WATR); + parts[i].life--; + } + } + for(int trade = 0; trade<9;trade ++) + { + nx = rand()%5-2; + ny = rand()%5-2; + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion + { + int temp = parts[i].life - parts[r>>8].life; + if(temp ==1) + { + parts[r>>8].life ++; + parts[i].life --; + trade = 9; + } + else if(temp>0) + { + parts[r>>8].life += temp/2; + parts[i].life -= temp/2; + trade = 9; + } + } + } + } for(nx=-1; nx<2; nx++) - for(ny=-1; ny<2; ny++) - if(x+nx>=0 && y+ny>0 && - x+nx>8].type==PT_WATR&&5>=rand()%100) - { - parts[i].life++; - parts[r>>8].type=PT_NONE; - } + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==PT_FIRE&&parts[i].life>0) + { + if(parts[i].life<=2) + parts[i].life --; + parts[i].life -= parts[i].life/3; + } } - } - else - for(nx=-1; nx<2; nx++) - for(ny=-1; ny<2; ny++) - if(x+nx>=0 && y+ny>0 && - x+nx>8)>=NPART || !r )&&parts[i].life>=1)//if nothing then create water - { - create_part(-1,x+nx,y+ny,PT_WATR); - parts[i].life --; - } - } - nx = rand()%5-2; - ny = rand()%5-2; - if(x+nx>=0 && y+ny>0 && - x+nx>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion - { - parts[r>>8].life ++; - parts[i].life --; - } - } + if(parts[i].temp>=374) + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART) + continue; + if((bmap[(y+ny)/CELL][(x+nx)/CELL]==8||bmap[(y+ny)/CELL][(x+nx)/CELL]==3||bmap[(y+ny)/CELL][(x+nx)/CELL]==2||bmap[(y+ny)/CELL][(x+nx)/CELL]==1||bmap[(y+ny)/CELL][(x+nx)/CELL]==10)) + continue; + if((!r)&&parts[i].life>=1)//if nothing then create steam + { + create_part(-1,x+nx,y+ny,PT_WTRV); + parts[i].life--; + parts[r>>8].temp = parts[i].temp; + parts[i].temp -= 40.0f; + } + } } else if(t==PT_LCRY) { @@ -2208,7 +2260,7 @@ void update_particles_i(pixel *vid, int start, int inc) rt = parts[r>>8].type; if((a || ptypes[rt].explosive) && ((rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL && rt!=PT_SWCH) || t!=PT_SPRK) && !(t==PT_PHOT && rt==PT_INSL) && - (t!=PT_LAVA || parts[i].life>0 || (rt!=PT_STNE && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_METL && rt!=PT_IRON && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SWCH && rt!=PT_INWR)) && + (t!=PT_LAVA || parts[i].life>0 || (rt!=PT_STNE && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_METL && rt!=PT_IRON && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SWCH && rt!=PT_INWR)) && !(rt==PT_CRAC && parts[r>>8].life>0) && ptypes[rt].flammable && (ptypes[rt].flammable + (int)(pv[(y+ny)/CELL][(x+nx)/CELL]*10.0f))>(rand()%1000)) { parts[r>>8].type = PT_FIRE; From c23938eb6a2fd6b01386a398c14d4bfe37d4b4ca Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 11 Nov 2010 21:38:43 -0500 Subject: [PATCH 44/79] Nothing display, for pilojo, called it cracker display for lulz, also won the race against antb, which didnt last long, he went on a baloon trip. --- src/graphics.c | 10 ++++++++-- src/interface.c | 4 ++++ src/main.c | 22 +++++++++++++--------- src/powder.c | 1 - 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index c56d06718..8bd9c281f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1328,8 +1328,14 @@ void draw_parts(pixel *vid) nx = (int)(parts[i].x+0.5f); ny = (int)(parts[i].y+0.5f); - - if(cmode!=CM_HEAT) + if(cmode==7)//nothing display + { + cr = PIXR(ptypes[t].pcolors); + cg = PIXG(ptypes[t].pcolors); + cb = PIXB(ptypes[t].pcolors); + blendpixel(vid, nx, ny, cr, cg, cb, 255); + } + else if(cmode!=CM_HEAT) { if(t==PT_STKM) //Just draw head here { diff --git a/src/interface.c b/src/interface.c index 45d1efdb2..9c32c5c40 100644 --- a/src/interface.c +++ b/src/interface.c @@ -548,6 +548,8 @@ void draw_svf_ui(pixel *vid_buf) break; case 6: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xC4", 100, 150, 255, 255); + case 7: + drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xC4", 100, 150, 255, 255); break; } drawrect(vid_buf, XRES-32+BARSIZE/*478*/, YRES+(MENUSIZE-16), 14, 14, 255, 255, 255, 255); @@ -1769,6 +1771,8 @@ void set_cmode(int cm) } else if(cmode==1) strcpy(itc_msg, "Pressure Display"); + else if(cmode==7) + strcpy(itc_msg, "Cracker Display"); else strcpy(itc_msg, "Velocity Display"); } diff --git a/src/main.c b/src/main.c index f513a20e5..a16891f94 100644 --- a/src/main.c +++ b/src/main.c @@ -1266,12 +1266,16 @@ int main(int argc, char *argv[]) { set_cmode(6); } + if(sdl_key=='8') + { + set_cmode(7); + } if(sdl_key==SDLK_LEFTBRACKET) { if(sdl_zoom_trig==1) { ZSIZE -= 1; - if(ZSIZE>32) - ZSIZE = 32; + if(ZSIZE>60) + ZSIZE = 60; if(ZSIZE<2) ZSIZE = 2; ZFACTOR = 256/ZSIZE; @@ -1292,8 +1296,8 @@ int main(int argc, char *argv[]) if(sdl_zoom_trig==1) { ZSIZE += 1; - if(ZSIZE>32) - ZSIZE = 32; + if(ZSIZE>60) + ZSIZE = 60; if(ZSIZE<2) ZSIZE = 2; ZFACTOR = 256/ZSIZE; @@ -1345,7 +1349,7 @@ int main(int argc, char *argv[]) } else if(sdl_key=='c') { - set_cmode((cmode+1) % 7); + set_cmode((cmode+1) % 8); if(it > 50) it = 50; } @@ -1382,8 +1386,8 @@ int main(int argc, char *argv[]) if(sdl_zoom_trig==1) { ZSIZE += sdl_wheel; - if(ZSIZE>32) - ZSIZE = 32; + if(ZSIZE>60) + ZSIZE = 60; if(ZSIZE<2) ZSIZE = 2; ZFACTOR = 256/ZSIZE; @@ -1782,9 +1786,9 @@ int main(int argc, char *argv[]) if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) { if(b & SDL_BUTTON_LMASK) - set_cmode((cmode+1) % 7); + set_cmode((cmode+1) % 8); if(b & SDL_BUTTON_RMASK) - set_cmode((cmode+6) % 7); + set_cmode((cmode+7) % 8); save_presets(0); } if(x>=(XRES+BARSIZE-(510-494)) && x<=(XRES+BARSIZE-(510-509)) && !bq) diff --git a/src/powder.c b/src/powder.c index edc8f9e0f..97e6ae765 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1991,7 +1991,6 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1,x+nx,y+ny,PT_WTRV); parts[i].life--; - parts[r>>8].temp = parts[i].temp; parts[i].temp -= 40.0f; } } From ac6fdb49e80a27c86f46da1d7e4112fc15d6ba2f Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 11 Nov 2010 21:42:56 -0500 Subject: [PATCH 45/79] stupid git, no icon for nothing display, why would there be one --- src/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface.c b/src/interface.c index 9c32c5c40..90684a376 100644 --- a/src/interface.c +++ b/src/interface.c @@ -549,7 +549,7 @@ void draw_svf_ui(pixel *vid_buf) case 6: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xC4", 100, 150, 255, 255); case 7: - drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xC4", 100, 150, 255, 255); + drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); break; } drawrect(vid_buf, XRES-32+BARSIZE/*478*/, YRES+(MENUSIZE-16), 14, 14, 255, 255, 255, 255); From 7aeb8020ba6e9aaf5724a825e7a0c8240d6e4deb Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 11 Nov 2010 22:09:23 -0500 Subject: [PATCH 46/79] moved nothing display after stickman. --- src/graphics.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index 8bd9c281f..7b8d0c0f9 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1328,13 +1328,6 @@ void draw_parts(pixel *vid) nx = (int)(parts[i].x+0.5f); ny = (int)(parts[i].y+0.5f); - if(cmode==7)//nothing display - { - cr = PIXR(ptypes[t].pcolors); - cg = PIXG(ptypes[t].pcolors); - cb = PIXB(ptypes[t].pcolors); - blendpixel(vid, nx, ny, cr, cg, cb, 255); - } else if(cmode!=CM_HEAT) { if(t==PT_STKM) //Just draw head here @@ -1362,7 +1355,14 @@ void draw_parts(pixel *vid) isplayer = 1; //It's a secret. Tssss... } - if(t==PT_MWAX&&cmode == 6) + if(cmode==7)//nothing display + { + cr = PIXR(ptypes[t].pcolors); + cg = PIXG(ptypes[t].pcolors); + cb = PIXB(ptypes[t].pcolors); + blendpixel(vid, nx, ny, cr, cg, cb, 255); + } + else if(t==PT_MWAX&&cmode == 6) { for(x=-1; x<=1; x++) { From 383b2ad709e8b03702c8590ce944639ddd471e7b Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 11 Nov 2010 22:14:24 -0500 Subject: [PATCH 47/79] oops --- src/graphics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics.c b/src/graphics.c index 7b8d0c0f9..8836b526d 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1328,7 +1328,7 @@ void draw_parts(pixel *vid) nx = (int)(parts[i].x+0.5f); ny = (int)(parts[i].y+0.5f); - else if(cmode!=CM_HEAT) + if(cmode!=CM_HEAT) { if(t==PT_STKM) //Just draw head here { From ebcded767e1e35a3431b4938cb9dd39b6b8ad188 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 12 Nov 2010 12:46:02 -0500 Subject: [PATCH 48/79] First release of the mod --- includes/powder.h | 8 +++++++- src/interface.c | 6 ++++-- src/main.c | 6 +++--- src/powder.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 28f05c6f3..ad5bc20b4 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -129,7 +129,9 @@ #define PT_LLIF 88 #define PT_STAN 89 #define PT_CRAC 90 -#define PT_NUM 91 +#define PT_RIME 91 +#define PT_FOG 92 +#define PT_NUM 93 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -311,6 +313,8 @@ static const part_type ptypes[PT_NUM] = {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, {"CRAC", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "cracker64 - Spongey, Made by himself",TYPE_SOLID}, + {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 100, "from FOG",TYPE_SOLID}, + {"FOG", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 0.4f, 0.95f, -0.1f, 0.0f, 0.50f, 0.001f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 100, "hmmm",TYPE_GAS}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -408,6 +412,8 @@ static part_state pstates[PT_NUM] = /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* Crac */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 22730.0f}, + /* RIME */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FOG */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { diff --git a/src/interface.c b/src/interface.c index 90684a376..7fae8544b 100644 --- a/src/interface.c +++ b/src/interface.c @@ -170,7 +170,7 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) draw_icon(vid_buf, x0+68, y0+42, 0x9E, ju == 1); draw_icon(vid_buf, x0+86, y0+42, 0x9F, ju == 2); - drawrect(vid_buf,x0+104,y0+42,26,15,255,255,255,255); + @@ -180,6 +180,8 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) drawtext(vid_buf, x0+138, y0+45, "\x85", 255, 255, 255, 255); drawtext(vid_buf, x0+152, y0+46, "Delete", 255, 255, 255, 255); drawrect(vid_buf, x0+134, y0+42, 50, 15, 255, 255, 255, 255); + drawrect(vid_buf,x0+104,y0+42,26,15,255,255,255,255); + drawtext(vid_buf, x0+110, y0+48, "Mv.", 255, 255, 255, 255); } drawtext(vid_buf, x0+5, y0+69, "OK", 255, 255, 255, 255); @@ -196,7 +198,7 @@ void add_sign_ui(pixel *vid_buf, int mx, int my) if(b && !bq && mx>=x0+86 && mx<=x0+103 && my>=y0+42 && my<=y0+59) ju = 2; - if(b && !bq && mx>=x0+104 && mx<=x0+130 && my>=y0+42 && my<=y0+59) + if(!nm && b && !bq && mx>=x0+104 && mx<=x0+130 && my>=y0+42 && my<=y0+59) { MSIGN = i; break; diff --git a/src/main.c b/src/main.c index a16891f94..8bb917a92 100644 --- a/src/main.c +++ b/src/main.c @@ -102,8 +102,8 @@ int death = 0, framerender = 0; int amd = 1; int FPSB = 0; int MSIGN =-1; -int CGOL = 0; -int GSPEED = 1;//causes my .exe to crash.. +//int CGOL = 0; +//int GSPEED = 1;//causes my .exe to crash.. sign signs[MAXSIGNS]; @@ -2064,7 +2064,7 @@ int main(int argc, char *argv[]) if(currentTime-pastFPS>=1000) { #ifdef BETA - sprintf(uitext, "Version %d (Beta %d) FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); + sprintf(uitext, "Cracker's Version %d (Beta %d) FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); //printf("%s\n", uitext); #else sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); diff --git a/src/powder.c b/src/powder.c index 97e6ae765..04999fbd0 100644 --- a/src/powder.c +++ b/src/powder.c @@ -929,7 +929,7 @@ void update_particles_i(pixel *vid, int start, int inc) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG) { kill_part(i); continue; @@ -1995,6 +1995,51 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_FOG) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if(pstates[parts[r>>8].type].state==ST_SOLID&&5>=rand()%50&&parts[i].life==0&&!(parts[r>>8].type==PT_CLNE||parts[r>>8].type==PT_PCLN)) + { + t = parts[i].type = PT_RIME; + parts[i].vx = 0; + parts[i].vy = 0; + } + if(parts[r>>8].type==PT_SPRK) + { + parts[i].life += rand()%20; + } + } + } + else if(t==PT_RIME) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + rt = parts[r>>8].type; + if(rt==PT_SPRK) + { + t = parts[i].type = PT_FOG; + parts[i].life = rand()%50 + 60; + } + else if(rt==PT_FOG&&parts[r>>8].life>0) + { + t = parts[i].type = PT_FOG; + parts[i].life = parts[r>>8].life/2; + } + } + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) From 02067b1587821349e80cda5a0b98153c332a69ee Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 12 Nov 2010 21:14:47 -0500 Subject: [PATCH 49/79] Fix movement of fog and fixed life exchange. --- includes/powder.h | 2 +- src/powder.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index ad5bc20b4..15848ff04 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -314,7 +314,7 @@ static const part_type ptypes[PT_NUM] = {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, {"CRAC", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "cracker64 - Spongey, Made by himself",TYPE_SOLID}, {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 100, "from FOG",TYPE_SOLID}, - {"FOG", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 0.4f, 0.95f, -0.1f, 0.0f, 0.50f, 0.001f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 100, "hmmm",TYPE_GAS}, + {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 100, "hmmm",TYPE_GAS}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; diff --git a/src/powder.c b/src/powder.c index 04999fbd0..fa9f02b3c 100644 --- a/src/powder.c +++ b/src/powder.c @@ -2036,7 +2036,7 @@ void update_particles_i(pixel *vid, int start, int inc) else if(rt==PT_FOG&&parts[r>>8].life>0) { t = parts[i].type = PT_FOG; - parts[i].life = parts[r>>8].life/2; + parts[i].life = parts[r>>8].life; } } } From 663db5374fcd64afe81235f6646b3112ad5971c1 Mon Sep 17 00:00:00 2001 From: Philip Date: Mon, 15 Nov 2010 11:57:37 -0500 Subject: [PATCH 50/79] Added BCLN LOVE WTF. description on forum post. A fix for loading COAL. made everything use the #defines for cmode (ex. CM_HEAT instead of 5). --- includes/defines.h | 2 + includes/powder.h | 35 ++++++++-- src/graphics.c | 106 ++++++++++++++++++++---------- src/interface.c | 30 ++++----- src/main.c | 34 +++++----- src/powder.c | 160 +++++++++++++++++++++++++++++++++++++++++---- 6 files changed, 284 insertions(+), 83 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 68cc60039..0dbb62e21 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -108,7 +108,9 @@ typedef struct stamp stamp; int MSIGN; int CGOL; int ISGOL; +int ISLOVE; int GSPEED; +int love[XRES/9][YRES/9]; int gol[XRES][YRES]; int gol2[XRES][YRES][NGOL]; extern sign signs[MAXSIGNS]; diff --git a/includes/powder.h b/includes/powder.h index 15848ff04..0909ab57f 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -5,7 +5,8 @@ #include "defines.h" #include "interface.h" -#define CM_COUNT 7 +#define CM_COUNT 8//todo: switch cmode==0, ect. with cmode==CM_VEL +#define CM_NOTHING 7 #define CM_FANCY 6 #define CM_HEAT 5 #define CM_BLOB 4 @@ -131,7 +132,10 @@ #define PT_CRAC 90 #define PT_RIME 91 #define PT_FOG 92 -#define PT_NUM 93 +#define PT_BCLN 93 +#define PT_LOVE 94 +#define PT_WTF 95 +#define PT_NUM 96 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -313,8 +317,12 @@ static const part_type ptypes[PT_NUM] = {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, {"CRAC", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "cracker64 - Spongey, Made by himself",TYPE_SOLID}, - {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 100, "from FOG",TYPE_SOLID}, - {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 100, "hmmm",TYPE_GAS}, + {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_SOLIDS, 243.15f, 100, "Not quite Ice",TYPE_SOLID}, + {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, 243.15f, 100, "Not quite Steam",TYPE_GAS}, + {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, + {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, + {"WTF", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "WTF for catelite", TYPE_LIQUID}, + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -344,7 +352,7 @@ static part_state pstates[PT_NUM] = /* 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}, + /* WTRV */ {ST_GAS, PT_RIME, 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}, @@ -412,8 +420,11 @@ static part_state pstates[PT_NUM] = /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* Crac */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 22730.0f}, - /* RIME */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* RIME */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 273.15f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* FOG */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* BCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* LOVE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* WTF */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { @@ -432,6 +443,18 @@ static int grule[NGOL][9] = {0,0,0,2,2,3,0,0,0},//LLIF {0,0,1,3,0,1,3,3,3},//STAN }; +static int loverule[9][9] = +{ + {0,0,1,1,0,0,0,0,0}, + {0,1,0,0,1,1,0,0,0}, + {1,0,0,0,0,0,1,0,0}, + {1,0,0,0,0,0,0,1,0}, + {0,1,0,0,0,0,0,0,1}, + {1,0,0,0,0,0,0,1,0}, + {1,0,0,0,0,0,1,0,0}, + {0,1,0,0,1,1,0,0,0}, + {0,0,1,1,0,0,0,0,0}, +}; extern int isplayer; extern float player[27]; diff --git a/src/graphics.c b/src/graphics.c index 8836b526d..999040903 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -21,7 +21,7 @@ #include -unsigned cmode = 3; +unsigned cmode = CM_FIRE; SDL_Surface *sdl_scrn; int sdl_scale = 1; @@ -1107,7 +1107,7 @@ void draw_air(pixel *vid) int x, y, i, j; pixel c; - if(cmode == 2) + if(cmode == CM_PERS) return; for(y=0; y=700&&(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)) + { + x = nx/CELL; + y = ny/CELL; + cr = 20; + cg = 20; + cb = 20; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else + { + cr = PIXR(ptypes[t].pcolors) + parts[i].life*1; + cg = PIXG(ptypes[t].pcolors) + parts[i].life*2; + cb = PIXB(ptypes[t].pcolors) + parts[i].life*4; + if(cr>=255) + cr = 255; + if(cg>=255) + cg = 255; + if(cb>=255) + cb = 255; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + + } + } else if(t==PT_ACID) { @@ -1401,7 +1437,7 @@ void draw_parts(pixel *vid) cr = PIXR(ptypes[t].pcolors)/s; cg = PIXG(ptypes[t].pcolors)/s; cb = PIXB(ptypes[t].pcolors)/s; - if(cmode==6) { + if(cmode==CM_FANCY) { for(x=-1; x<=1; x++) { for(y=-1; y<=1; y++) @@ -1416,7 +1452,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx, ny, cr, cg, cb, 255); } - if(cmode==4) + if(cmode==CM_BLOB) { blendpixel(vid, nx+1, ny, cr, cg, cb, 223); blendpixel(vid, nx-1, ny, cr, cg, cb, 223); @@ -1429,7 +1465,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny+1, cr, cg, cb, 112); } } - else if(t==PT_OIL&&cmode == 6) + else if(t==PT_OIL&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1444,7 +1480,7 @@ void draw_parts(pixel *vid) } else if(t==PT_NEUT) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors; cg = 8; @@ -1473,7 +1509,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); } - } else if(t==PT_PLUT&&cmode == 6) + } else if(t==PT_PLUT&&cmode == CM_FANCY) { int tempx; int tempy; @@ -1493,7 +1529,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-tempx, ny-tempy, cr, cg, cb, 5); } } - } else if(t==PT_URAN&&cmode == 6) + } else if(t==PT_URAN&&cmode == CM_FANCY) { int tempx; int tempy; @@ -1513,7 +1549,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-tempx, ny-tempy, cr, cg, cb, 5); } } - } else if(t==PT_SLTW&&cmode == 6) + } else if(t==PT_SLTW&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1528,7 +1564,7 @@ void draw_parts(pixel *vid) } else if(t==PT_PHOT) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cg = 0; cb = 0; @@ -1595,7 +1631,7 @@ void draw_parts(pixel *vid) y = ny; blendpixel(vid,x,y,17,217,24,255); } - else if(t==PT_LNTG&&cmode == 6) + else if(t==PT_LNTG&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1610,7 +1646,7 @@ void draw_parts(pixel *vid) } else if(t==PT_SMKE) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { x = nx/CELL; y = ny/CELL; @@ -1643,7 +1679,7 @@ void draw_parts(pixel *vid) } } } - else if(t==PT_WATR&&cmode == 6) + else if(t==PT_WATR&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1656,7 +1692,7 @@ void draw_parts(pixel *vid) } } - } else if(t==PT_DSTW&&cmode == 6) + } else if(t==PT_DSTW&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1669,7 +1705,7 @@ void draw_parts(pixel *vid) } } } - else if(t==PT_NITR&&cmode == 6) + else if(t==PT_NITR&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1683,7 +1719,7 @@ void draw_parts(pixel *vid) } } - else if(t==PT_LRBD&&cmode == 6) + else if(t==PT_LRBD&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1698,7 +1734,7 @@ void draw_parts(pixel *vid) } - else if(t==PT_NBLE&&cmode == 6) + else if(t==PT_NBLE&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1714,7 +1750,7 @@ void draw_parts(pixel *vid) } } - else if(t==PT_GAS&&cmode == 6) + else if(t==PT_GAS&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) { @@ -1732,7 +1768,7 @@ void draw_parts(pixel *vid) } else if(t==PT_WTRV) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { x = nx/CELL; y = ny/CELL; @@ -1767,7 +1803,7 @@ void draw_parts(pixel *vid) } else if(t==PT_THDR) { - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors; cg = 16; @@ -1812,7 +1848,7 @@ void draw_parts(pixel *vid) 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)); - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { x = nx/CELL; y = ny/CELL; @@ -1826,7 +1862,7 @@ void draw_parts(pixel *vid) if(fr > 255) fr = 255; fire_r[y][x] = fr; } - if(cmode == 4) { + if(cmode == CM_BLOB) { uint8 R = (int)restrict_flt(0x44 + fr*8, 0, 255); uint8 G = (int)restrict_flt(0x88 + fg*8, 0, 255); uint8 B = (int)restrict_flt(0x44 + fb*8, 0, 255); @@ -1846,7 +1882,7 @@ void draw_parts(pixel *vid) { uint8 GR = 0x50+(parts[i].life*10); vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, GR); - if(cmode == 4) { + if(cmode == CM_BLOB) { blendpixel(vid, nx+1, ny, GR, GR, GR, 223); blendpixel(vid, nx-1, ny, GR, GR, GR, 223); blendpixel(vid, nx, ny+1, GR, GR, GR, 223); @@ -1862,7 +1898,7 @@ void draw_parts(pixel *vid) { uint8 GR = 0x3B+(parts[i].life*19); vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, GR, 10); - if(cmode == 4) { + if(cmode == CM_BLOB) { blendpixel(vid, nx+1, ny, GR, GR, 10, 223); blendpixel(vid, nx-1, ny, GR, GR, 10, 223); blendpixel(vid, nx, ny+1, GR, GR, 10, 223); @@ -1878,7 +1914,7 @@ void draw_parts(pixel *vid) { uint8 GR = 0x3B+(parts[i].life*19); vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, 10, 10); - if(cmode == 4) { + if(cmode == CM_BLOB) { blendpixel(vid, nx+1, ny, GR, 10, 10, 223); blendpixel(vid, nx-1, ny, GR, 10, 10, 223); blendpixel(vid, nx, ny+1, GR, 10, 10, 223); @@ -1897,7 +1933,7 @@ void draw_parts(pixel *vid) uint8 R = plasma_data[caddress]; uint8 G = plasma_data[caddress+1]; uint8 B = plasma_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr = R/8; cg = G/8; @@ -1936,7 +1972,7 @@ void draw_parts(pixel *vid) uint8 R = hflm_data[caddress]; uint8 G = hflm_data[caddress+1]; uint8 B = hflm_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr = R/8; cg = G/8; @@ -1975,7 +2011,7 @@ void draw_parts(pixel *vid) uint8 R = firw_data[caddress]; uint8 G = firw_data[caddress+1]; uint8 B = firw_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr = R/2; cg = G/2; @@ -2015,7 +2051,7 @@ void draw_parts(pixel *vid) uint8 R = flm_data[caddress]; uint8 G = flm_data[caddress+1]; uint8 B = flm_data[caddress+2]; - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr = R/8; cg = G/8; @@ -2103,7 +2139,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny, cr, cg, cb, 64); blendpixel(vid, nx, ny+1, cr, cg, cb, 64); blendpixel(vid, nx, ny-1, cr, cg, cb, 64); - if(cmode == 3||cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { cr /= 32; cg /= 32; @@ -2124,7 +2160,7 @@ void draw_parts(pixel *vid) else if(t==PT_LAVA || t==PT_SPRK) { vid[ny*(XRES+BARSIZE)+nx] = ptypes[t].pcolors; - if(cmode == 3 || cmode==4 || cmode==6) + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) { if(t == PT_LAVA) { @@ -2193,7 +2229,7 @@ void draw_parts(pixel *vid) //blendpixel(vid, nx+1, ny, R, G, B, 255); } } - if(cmode == 4&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3)) + if(cmode == CM_BLOB&&t!=PT_FIRE&&t!=PT_PLSM&&t!=PT_HFLM&&t!=PT_NONE&&t!=PT_ACID&&t!=PT_LCRY&&t!=PT_GLOW&&t!=PT_SWCH&&t!=PT_SMKE&&t!=PT_WTRV&&!(t==PT_FIRW&&parts[i].tmp==3)) { if(t==PT_PHOT) { cg = 0; diff --git a/src/interface.c b/src/interface.c index 7fae8544b..8f0a5590e 100644 --- a/src/interface.c +++ b/src/interface.c @@ -528,29 +528,29 @@ void draw_svf_ui(pixel *vid_buf) switch(cmode) { - case 0: + case CM_VEL: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x98", 128, 160, 255, 255); break; - case 1: + case CM_PRESS: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x99", 255, 212, 32, 255); break; - case 2: + case CM_PERS: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x9A", 212, 212, 212, 255); break; - case 3: + case CM_FIRE: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x9B", 255, 0, 0, 255); drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x9C", 255, 255, 64, 255); break; - case 4: + case CM_BLOB: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xBF", 55, 255, 55, 255); break; - case 5: + case CM_HEAT: drawtext(vid_buf, XRES-27+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xBE", 255, 0, 0, 255); drawtext(vid_buf, XRES-27+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xBD", 255, 255, 255, 255); break; - case 6: + case CM_FANCY: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xC4", 100, 150, 255, 255); - case 7: + case CM_NOTHING: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); break; } @@ -1741,39 +1741,39 @@ void set_cmode(int cm) { cmode = cm; itc = 51; - if(cmode==4) + if(cmode==CM_BLOB) { memset(fire_r, 0, sizeof(fire_r)); memset(fire_g, 0, sizeof(fire_g)); memset(fire_b, 0, sizeof(fire_b)); strcpy(itc_msg, "Blob Display"); } - else if(cmode==5) + else if(cmode==CM_HEAT) { strcpy(itc_msg, "Heat Display"); } - else if(cmode==6) + else if(cmode==CM_FANCY) { memset(fire_r, 0, sizeof(fire_r)); memset(fire_g, 0, sizeof(fire_g)); memset(fire_b, 0, sizeof(fire_b)); strcpy(itc_msg, "Fancy Display"); } - else if(cmode==3) + else if(cmode==CM_FIRE) { memset(fire_r, 0, sizeof(fire_r)); memset(fire_g, 0, sizeof(fire_g)); memset(fire_b, 0, sizeof(fire_b)); strcpy(itc_msg, "Fire Display"); } - else if(cmode==2) + else if(cmode==CM_PERS) { memset(fire_bg, 0, XRES*YRES*PIXELSIZE); strcpy(itc_msg, "Persistent Display"); } - else if(cmode==1) + else if(cmode==CM_PRESS) strcpy(itc_msg, "Pressure Display"); - else if(cmode==7) + else if(cmode==CM_NOTHING) strcpy(itc_msg, "Cracker Display"); else strcpy(itc_msg, "Velocity Display"); diff --git a/src/main.c b/src/main.c index 8bb917a92..1ce25ba65 100644 --- a/src/main.c +++ b/src/main.c @@ -530,6 +530,8 @@ int parse_save(void *save, int size, int replace, int x0, int y0) else if(i < nf) { parts[fp[i]].type = j; + if(j == PT_COAL) + parts[fp[i]].tmp = 50; if(j == PT_PHOT) parts[fp[i]].ctype = 0x3fffffff; parts[fp[i]].x = (float)x; @@ -1123,11 +1125,11 @@ int main(int argc, char *argv[]) #ifdef OpenGL ClearScreen(); #else - if(cmode==0 || cmode==1) + if(cmode==CM_VEL || cmode==CM_PRESS) { draw_air(vid_buf); } - else if(cmode==2) + else if(cmode==CM_PERS) { memcpy(vid_buf, fire_bg, XRES*YRES*PIXELSIZE); memset(vid_buf+(XRES*YRES), 0, ((XRES+BARSIZE)*YRES*PIXELSIZE)-(XRES*YRES*PIXELSIZE)); @@ -1140,7 +1142,7 @@ int main(int argc, char *argv[]) update_particles(vid_buf); draw_parts(vid_buf); - if(cmode==2) + if(cmode==CM_PERS) { if(!fire_fc) { @@ -1152,7 +1154,7 @@ int main(int argc, char *argv[]) } fire_fc = (fire_fc+1) % 3; } - if(cmode==3||cmode==4||cmode==6) + if(cmode==CM_FIRE||cmode==CM_BLOB||cmode==CM_FANCY) render_fire(vid_buf); render_signs(vid_buf); @@ -1240,35 +1242,35 @@ int main(int argc, char *argv[]) } if(sdl_key=='1') { - set_cmode(0); + set_cmode(CM_VEL); } if(sdl_key=='2') { - set_cmode(1); + set_cmode(CM_PRESS); } if(sdl_key=='3') { - set_cmode(2); + set_cmode(CM_PERS); } if(sdl_key=='4') { - set_cmode(3); + set_cmode(CM_FIRE); } if(sdl_key=='5') { - set_cmode(4); + set_cmode(CM_BLOB); } if(sdl_key=='6') { - set_cmode(5); + set_cmode(CM_HEAT); } if(sdl_key=='7') { - set_cmode(6); + set_cmode(CM_FANCY); } - if(sdl_key=='8') + if(sdl_key=='8') { - set_cmode(7); + set_cmode(CM_NOTHING); } if(sdl_key==SDLK_LEFTBRACKET) { if(sdl_zoom_trig==1) @@ -1349,7 +1351,7 @@ int main(int argc, char *argv[]) } else if(sdl_key=='c') { - set_cmode((cmode+1) % 8); + set_cmode((cmode+1) % CM_COUNT); if(it > 50) it = 50; } @@ -1786,9 +1788,9 @@ int main(int argc, char *argv[]) if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) { if(b & SDL_BUTTON_LMASK) - set_cmode((cmode+1) % 8); + set_cmode((cmode+1) % CM_COUNT); if(b & SDL_BUTTON_RMASK) - set_cmode((cmode+7) % 8); + set_cmode((cmode+(CM_COUNT-1)) % CM_COUNT); save_presets(0); } if(x>=(XRES+BARSIZE-(510-494)) && x<=(XRES+BARSIZE-(510-509)) && !bq) diff --git a/src/powder.c b/src/powder.c index fa9f02b3c..714ebcd3b 100644 --- a/src/powder.c +++ b/src/powder.c @@ -830,6 +830,49 @@ void update_particles_i(pixel *vid, int start, int inc) int starti = (start*-1); if(sys_pause&&!framerender) return; + + if(ISLOVE==1) + { + for(ny=4;ny>8)>=NPART || !r) + { + continue; + } + if(parts[r>>8].type==PT_LOVE) + { + love[nx/9][ny/9] = 1; + } + + } + } + for(nx=0;nx<=XRES-4;nx++) + { + for(ny=0;ny<=YRES-4;ny++) + { + if(love[nx/9][ny/9]==1) + { + for(int nnx=0;nnx<9;nnx++) + for(int nny=0;nny<9;nny++) + { + rt=pmap[ny+nny][nx+nnx]; + if((rt>>8)>=NPART) + { + continue; + } + if(!rt&&loverule[nnx][nny]==1) + create_part(-1,nx+nnx,ny+nny,PT_LOVE); + if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0) + parts[rt>>8].type=PT_NONE; + } + } + love[nx/9][ny/9]=0; + } + } + } if(ISGOL==1&&CGOL>=GSPEED)//GSPEED is frames per generation { for(nx=4;nx1.0f) { @@ -1901,16 +1944,18 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].temp -= 50.0f; ISGOL=1; } + else if(t==PT_LOVE) + ISLOVE=1; else if(t==PT_CRAC) { - if(pv[y/CELL][x/CELL]<=3&&pv[y/CELL][x/CELL]>=-3) - { + if(pv[y/CELL][x/CELL]<=3&&pv[y/CELL][x/CELL]>=-3) + { for(nx=-1; nx<2; nx++) for(ny=-1; ny<2; ny++) if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r || parts[i].temp>374.0f) + if((r>>8)>=NPART || !r || parts[i].temp>374.0f) continue; if(parts[r>>8].type==PT_WATR&&33>=rand()/(RAND_MAX/100)+1) { @@ -1963,7 +2008,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - for(nx=-1; nx<2; nx++) + for(nx=-1; nx<2; nx++) for(ny=-1; ny<2; ny++) if(x+nx>=0 && y+ny>0 && x+nx=374) - for(nx=-1; nx<2; nx++) + if(parts[i].temp>=374) + for(nx=-1; nx<2; nx++) for(ny=-1; ny<2; ny++) if(x+nx>=0 && y+ny>0 && x+nx=373.15) + t = parts[i].type = PT_WTRV; for(nx=-1; nx<2; nx++) for(ny=-1; ny<2; ny++) if(x+nx>=0 && y+ny>0 && @@ -2008,8 +2055,6 @@ void update_particles_i(pixel *vid, int start, int inc) if(pstates[parts[r>>8].type].state==ST_SOLID&&5>=rand()%50&&parts[i].life==0&&!(parts[r>>8].type==PT_CLNE||parts[r>>8].type==PT_PCLN)) { t = parts[i].type = PT_RIME; - parts[i].vx = 0; - parts[i].vy = 0; } if(parts[r>>8].type==PT_SPRK) { @@ -2019,6 +2064,8 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_RIME) { + parts[i].vx = 0; + parts[i].vy = 0; for(nx=-1; nx<2; nx++) for(ny=-1; ny<2; ny++) if(x+nx>=0 && y+ny>0 && @@ -2040,6 +2087,76 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_WTF) + { + int maxlife = ((10000/(parts[i].temp + 1))-1); + if((10000%((int)parts[i].temp+1))>rand()%((int)parts[i].temp+1)) + maxlife ++; + if(parts[i].life < maxlife) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r || (parts[i].life >=maxlife)) + continue; + if(parts[r>>8].type==PT_WTF&&33>=rand()/(RAND_MAX/100)+1) + { + if((parts[i].life + parts[r>>8].life + 1) <= maxlife) + { + parts[i].life += parts[r>>8].life + 1; + parts[r>>8].type=PT_NONE; + } + } + } + } + else + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || (parts[i].life<=maxlife)) + continue; + if((bmap[(y+ny)/CELL][(x+nx)/CELL]==8||bmap[(y+ny)/CELL][(x+nx)/CELL]==7||bmap[(y+ny)/CELL][(x+nx)/CELL]==2||bmap[(y+ny)/CELL][(x+nx)/CELL]==1|| + bmap[(y+ny)/CELL][(x+nx)/CELL]==9||bmap[(y+ny)/CELL][(x+nx)/CELL]==10||bmap[(y+ny)/CELL][(x+nx)/CELL]==13)) + continue; + if((!r)&&parts[i].life>=1)//if nothing then create wtf + { + create_part(-1,x+nx,y+ny,PT_WTF); + parts[i].life--; + parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; + } + } + for(int trade = 0; trade<9;trade ++) + { + nx = rand()%5-2; + ny = rand()%5-2; + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion + { + int temp = parts[i].life - parts[r>>8].life; + if(temp ==1) + { + parts[r>>8].life ++; + parts[i].life --; + trade = 9; + } + else if(temp>0) + { + parts[r>>8].life += temp/2; + parts[i].life -= temp/2; + trade = 9; + } + } + } + } + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) @@ -2900,6 +3017,27 @@ killed: create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); } + } + if(t==PT_BCLN) + { + if(!parts[i].ctype) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx Date: Tue, 16 Nov 2010 12:15:34 -0500 Subject: [PATCH 51/79] added WARP PUMP fix alt-click select. --- includes/powder.h | 20 +++++++----- src/main.c | 2 +- src/powder.c | 82 +++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 82 insertions(+), 22 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 0909ab57f..901f0b347 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -5,7 +5,7 @@ #include "defines.h" #include "interface.h" -#define CM_COUNT 8//todo: switch cmode==0, ect. with cmode==CM_VEL +#define CM_COUNT 8 #define CM_NOTHING 7 #define CM_FANCY 6 #define CM_HEAT 5 @@ -135,7 +135,9 @@ #define PT_BCLN 93 #define PT_LOVE 94 #define PT_WTF 95 -#define PT_NUM 96 +#define PT_WARP 96 +#define PT_PUMP 97 +#define PT_NUM 98 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -304,16 +306,16 @@ static const part_type ptypes[PT_NUM] = {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, - {"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! (23/3)", TYPE_SOLID}, + {"GOL ", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! (23/3)", TYPE_SOLID}, {"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL 23/36)", TYPE_SOLID}, {"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (4567/345)", TYPE_SOLID}, - {"2x2", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (125/36)", TYPE_SOLID}, + {"2x2 ", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (125/36)", TYPE_SOLID}, {"DANI", PIXPACK(0x00FFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Day and Night! (34678/3678)", TYPE_SOLID}, {"AMOE", PIXPACK(0xFF00FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Amoeba! (1358/357)", TYPE_SOLID}, {"MOVE", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "'Move' particles! Does not move things.. it is a life type(245/368)", TYPE_SOLID}, {"PGOL", PIXPACK(0xE05010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Pseudo Life! (238/357)", TYPE_SOLID}, {"DMOE", PIXPACK(0x500000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Diamoeba! (5678/35678)", TYPE_SOLID}, - {"34", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "34! (34/34)", TYPE_SOLID}, + {"34 ", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "34! (34/34)", TYPE_SOLID}, {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, {"CRAC", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "cracker64 - Spongey, Made by himself",TYPE_SOLID}, @@ -321,8 +323,9 @@ static const part_type ptypes[PT_NUM] = {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, 243.15f, 100, "Not quite Steam",TYPE_GAS}, {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, - {"WTF", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "WTF for catelite", TYPE_LIQUID}, - + {"WTF", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 251, "WTF for catelite, volume changes with temp", TYPE_LIQUID}, + {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, + {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -425,10 +428,11 @@ static part_state pstates[PT_NUM] = /* BCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* LOVE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WTF */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* WARP */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { -// 0,1,2,3,4,5,6,7,8,9 live=1 spawn=2 spawn&live=3 +// 0,1,2,3,4,5,6,7,8 live=1 spawn=2 spawn&live=3 {0,0,0,0,0,0,0,0,0},//blank {0,0,1,3,0,0,0,0,0},//GOL {0,0,1,3,0,0,2,0,0},//HLIF diff --git a/src/main.c b/src/main.c index 1ce25ba65..4aff502be 100644 --- a/src/main.c +++ b/src/main.c @@ -1866,7 +1866,7 @@ int main(int argc, char *argv[]) lb = 0; lm = 0; } - else if(((sdl_mod & (KMOD_LALT||KMOD_RALT)) && !sdl_mod & (KMOD_SHIFT)) || b==SDL_BUTTON_MIDDLE) + else if(((sdl_mod & (KMOD_LALT|KMOD_RALT)) && !(sdl_mod & (KMOD_SHIFT))) || b==SDL_BUTTON_MIDDLE) { if(y>0 && y0 && x>8].temp>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 4.0f, MIN_TEMP, MAX_TEMP); + if((pmap[y][x]&0xFF)==PT_PUMP) + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 0.1f, MIN_TEMP, MAX_TEMP); + else + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 4.0f, MIN_TEMP, MAX_TEMP); } if(t==SPC_COOL&&parts[pmap[y][x]>>8].temp>MIN_TEMP) { - parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 4.0f, MIN_TEMP, MAX_TEMP); + if((pmap[y][x]&0xFF)==PT_PUMP) + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 0.1f, MIN_TEMP, MAX_TEMP); + else + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 4.0f, MIN_TEMP, MAX_TEMP); } return pmap[y][x]>>8; } @@ -479,6 +485,9 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = 150; } End Testing*/ + if(t==PT_WARP) { + parts[i].life = rand()%95+70; + } if(t==PT_FUSE) { parts[i].life = 50; parts[i].tmp = 50; @@ -1022,18 +1031,40 @@ void update_particles_i(pixel *vid, int start, int inc) vy[y/CELL][x/CELL] *= ptypes[t].airloss; vx[y/CELL][x/CELL] += ptypes[t].airdrag*parts[i].vx; vy[y/CELL][x/CELL] += ptypes[t].airdrag*parts[i].vy; - if(t==PT_GAS||t==PT_NBLE) + if(t==PT_GAS||t==PT_NBLE||t==PT_PUMP) { - if(pv[y/CELL][x/CELL]<3.5f) - pv[y/CELL][x/CELL] += ptypes[t].hotair*(3.5f-pv[y/CELL][x/CELL]); - if(y+CELL=256.0+273.15) + parts[i].temp=256.0+273.15; + if(parts[i].temp<= -256.0+273.15) + parts[i].temp = -256.0+273.15; + + if(pv[y/CELL][x/CELL]<(parts[i].temp-273.15)) + pv[y/CELL][x/CELL] += ptypes[t].hotair*((parts[i].temp-273.15)-pv[y/CELL][x/CELL]); + if(y+CELL=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type!=PT_WARP&&parts[r>>8].type!=PT_STKM&&parts[r>>8].type!=PT_DMND&&parts[r>>8].type!=PT_CLNE&&parts[r>>8].type!=PT_BCLN&&parts[r>>8].type!=PT_PCLN&&(10>=rand()%200)) + { + t = parts[i].type = parts[r>>8].type; + parts[i].ctype = parts[r>>8].ctype; + parts[i].life = parts[r>>8].life; + parts[i].tmp = parts[r>>8].tmp; + parts[i].temp = parts[r>>8].temp; + parts[r>>8].type = PT_WARP; + parts[r>>8].life = rand()%90; + trade = 5; + } + } + } + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) From 9383c1ca4c0b7b1232762fa7511a4179c98caa24 Mon Sep 17 00:00:00 2001 From: Philip Date: Tue, 16 Nov 2010 19:47:18 -0500 Subject: [PATCH 52/79] Added a different velocity/pressure display. Added old fireworks i made. --- includes/powder.h | 13 +++++++--- src/graphics.c | 62 +++++++++++++++++++++++++++++++++++++++++++++-- src/interface.c | 6 ++++- src/main.c | 8 ++++-- src/powder.c | 57 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 137 insertions(+), 9 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 901f0b347..9924440c0 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -5,7 +5,8 @@ #include "defines.h" #include "interface.h" -#define CM_COUNT 8 +#define CM_COUNT 9 +#define CM_CRACK 8 #define CM_NOTHING 7 #define CM_FANCY 6 #define CM_HEAT 5 @@ -137,7 +138,8 @@ #define PT_WTF 95 #define PT_WARP 96 #define PT_PUMP 97 -#define PT_NUM 98 +#define PT_FWRK 98 +#define PT_NUM 99 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -326,6 +328,7 @@ static const part_type ptypes[PT_NUM] = {"WTF", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 251, "WTF for catelite, volume changes with temp", TYPE_LIQUID}, {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, + {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -427,8 +430,10 @@ static part_state pstates[PT_NUM] = /* FOG */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* LOVE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* WTF */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* WARP */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* WTF */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* WARP */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PUMP */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FWRK */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { diff --git a/src/graphics.c b/src/graphics.c index 999040903..797ca747d 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1113,17 +1113,50 @@ void draw_air(pixel *vid) for(y=0; y 0.0f) c = PIXRGB(clamp_flt(pv[y][x], 0.0f, 8.0f), 0, 0); else c = PIXRGB(0, 0, clamp_flt(-pv[y][x], 0.0f, 8.0f)); } - else + else if(cmode == CM_VEL) + { c = PIXRGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f), clamp_flt(pv[y][x], 0.0f, 8.0f), clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f)); + } + else if(cmode == CM_CRACK) + { + int r; + int g; + int b; + r = clamp_flt(fabsf(vx[y][x]), 0.0f, 24.0f) + clamp_flt(fabsf(vy[y][x]), 0.0f, 20.0f); + g = clamp_flt(fabsf(vx[y][x]), 0.0f, 20.0f) + clamp_flt(fabsf(vy[y][x]), 0.0f, 24.0f); + b = clamp_flt(fabsf(vx[y][x]), 0.0f, 24.0f) + clamp_flt(fabsf(vy[y][x]), 0.0f, 20.0f); + if(pv[y][x] > 0.0f) + { + r += clamp_flt(pv[y][x], 0.0f, 16.0f); + if(r>255) + r=255; + if(g>255) + g=255; + if(b>255) + b=255; + c = PIXRGB(r, g, b); + } + else + { + b += clamp_flt(-pv[y][x], 0.0f, 16.0f); + if(r>255) + r=255; + if(g>255) + g=255; + if(b>255) + b=255; + c = PIXRGB(r, g, b); + } + } for(j=0; j= 1) + { + x = nx; + y = ny; + if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) + { + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(parts[i].tmp,parts[i].ctype,parts[i].flags); + cg = parts[i].tmp/4; + cb = parts[i].ctype/4; + cr = parts[i].flags/4; + x = nx/CELL; + y = ny/CELL; + cg += fire_g[y][x]; + if(cg > 255) cg = 255; + fire_g[y][x] = cg; + cb += fire_b[y][x]; + if(cb > 255) cb = 255; + fire_b[y][x] = cb; + cr += fire_r[y][x]; + if(cr > 255) cr = 255; + fire_r[y][x] = cr; + } + else + blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255); + } else if(t==PT_ACID) { if(parts[i].life>255) parts[i].life = 255; diff --git a/src/interface.c b/src/interface.c index 8f0a5590e..e22a9c42a 100644 --- a/src/interface.c +++ b/src/interface.c @@ -552,6 +552,8 @@ void draw_svf_ui(pixel *vid_buf) drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xC4", 100, 150, 255, 255); case CM_NOTHING: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); + case CM_CRACK: + drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); break; } drawrect(vid_buf, XRES-32+BARSIZE/*478*/, YRES+(MENUSIZE-16), 14, 14, 255, 255, 255, 255); @@ -1774,7 +1776,9 @@ void set_cmode(int cm) else if(cmode==CM_PRESS) strcpy(itc_msg, "Pressure Display"); else if(cmode==CM_NOTHING) - strcpy(itc_msg, "Cracker Display"); + strcpy(itc_msg, "Nothing Display"); + else if(cmode==CM_CRACK) + strcpy(itc_msg, "Alternate Velocity Display"); else strcpy(itc_msg, "Velocity Display"); } diff --git a/src/main.c b/src/main.c index 4aff502be..506e97621 100644 --- a/src/main.c +++ b/src/main.c @@ -1125,7 +1125,7 @@ int main(int argc, char *argv[]) #ifdef OpenGL ClearScreen(); #else - if(cmode==CM_VEL || cmode==CM_PRESS) + if(cmode==CM_VEL || cmode==CM_PRESS || cmode==CM_CRACK) { draw_air(vid_buf); } @@ -1268,10 +1268,14 @@ int main(int argc, char *argv[]) { set_cmode(CM_FANCY); } - if(sdl_key=='8') + if(sdl_key=='8') { set_cmode(CM_NOTHING); } + if(sdl_key=='9') + { + set_cmode(CM_CRACK); + } if(sdl_key==SDLK_LEFTBRACKET) { if(sdl_zoom_trig==1) { diff --git a/src/powder.c b/src/powder.c index fb564d3e1..7cdba8c2b 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1940,6 +1940,10 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_GAS; if((r&0xFF)==PT_COAL && 5>(rand()%100)) parts[r>>8].type = PT_WOOD; + if((r&0xFF)==PT_DUST && 5>(rand()%100)) + parts[r>>8].type = PT_FWRK; + if((r&0xFF)==PT_FWRK && 5>(rand()%100)) + parts[r>>8].ctype = PT_DUST; /*if(parts[r>>8].type>1 && parts[r>>8].type!=PT_NEUT && parts[r>>8].type-1!=PT_NEUT && parts[r>>8].type-1!=PT_STKM && (ptypes[parts[r>>8].type-1].menusection==SC_LIQUID|| ptypes[parts[r>>8].type-1].menusection==SC_EXPLOSIVE|| @@ -2213,6 +2217,59 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + if(t==PT_FWRK) + { + if((parts[i].temp>400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x])||parts[i].ctype==PT_DUST) + { + + create_part(-1, x , y-1 , PT_FWRK); + r = pmap[y-1][x]; + if(parts[r>>8].type==PT_FWRK) + { + parts[r>>8].vy = rand()%8-22; + parts[r>>8].vx = rand()%20-rand()%20; + parts[r>>8].life=rand()%15+25; + parts[i].type=PT_NONE; + } + } + if(parts[i].life>1) + { + if(parts[i].life>=45&&parts[i].type==PT_FWRK) + 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); + int e = (rand()%255+1); + for(nx=-1; nx<2; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx=rand()%8) + { + if(!pmap[y+ny][x+nx]) + { + create_part(-1, x+nx, y+ny , PT_DUST); + pv[y/CELL][x/CELL] += 2.00f*CFDS; + a= pmap[y+ny][x+nx]; + if(parts[a>>8].type==PT_DUST) + { + parts[a>>8].vy = -(rand()%10-1); + parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; + parts[a>>8].life= rand()%37+18; + parts[a>>8].tmp=q; + parts[a>>8].flags=w; + parts[a>>8].ctype=e; + parts[a>>8].temp= rand()%20+6000; + } + } + } + } + parts[i].type=PT_NONE; + } + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) From 5d0da4b13882608536ba96e977de1fe4fd6f8b55 Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 18 Nov 2010 00:01:46 -0500 Subject: [PATCH 53/79] Added PIPE, yay. Added whole menu sections to be able to be specifically deleted. --- includes/defines.h | 2 + includes/powder.h | 4 +- src/graphics.c | 63 +++++++++++++++++++- src/interface.c | 37 +++++++++++- src/powder.c | 142 ++++++++++++++++++++++++++++++++++++++++++--- 5 files changed, 238 insertions(+), 10 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 0dbb62e21..173bc2bbe 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -113,6 +113,8 @@ int GSPEED; int love[XRES/9][YRES/9]; int gol[XRES][YRES]; int gol2[XRES][YRES][NGOL]; +int SEC; +int SEC2; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/powder.h b/includes/powder.h index 9924440c0..cf92906fd 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -139,7 +139,8 @@ #define PT_WARP 96 #define PT_PUMP 97 #define PT_FWRK 98 -#define PT_NUM 99 +#define PT_PIPE 99 +#define PT_NUM 100 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -329,6 +330,7 @@ static const part_type ptypes[PT_NUM] = {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, + {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 273.15f, 0, "probably doesn't work", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; diff --git a/src/graphics.c b/src/graphics.c index 797ca747d..1f8ef9176 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -745,7 +745,10 @@ 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) { - drawrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); + if(i==SEC&&SEC!=0) + drawrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 0, 255, 255, 255); + else + drawrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); if(hover==i) { fillrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16), 14, 14, 255, 255, 255, 255); @@ -1486,6 +1489,64 @@ void draw_parts(pixel *vid) else blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255); } + else if(t==PT_PIPE) + { + if(parts[i].ctype==2) + { + cr = 50; + cg = 1; + cb = 1; + } + else if(parts[i].ctype==3) + { + cr = 1; + cg = 50; + cb = 1; + } + else if(parts[i].ctype==4) + { + cr = 1; + cg = 1; + cb = 50; + } + else if(parts[i].temp<272.15&&parts[i].ctype!=1) + { + if(parts[i].temp>173.25&&parts[i].temp<273.15) + { + cr = 50; + cg = 1; + cb = 1; + } + if(parts[i].temp>73.25&&parts[i].temp<=173.15) + { + cr = 1; + cg = 50; + cb = 1; + } + if(parts[i].temp>=0&&parts[i].temp<=73.15) + { + cr = 1; + cg = 1; + cb = 50; + } + } + else + { + cr = PIXR(ptypes[t].pcolors); + cg = PIXG(ptypes[t].pcolors); + cb = PIXB(ptypes[t].pcolors); + } + if(parts[i].tmp) + { + cr = PIXR(ptypes[parts[i].tmp].pcolors); + cg = PIXG(ptypes[parts[i].tmp].pcolors); + cb = PIXB(ptypes[parts[i].tmp].pcolors); + } + blendpixel(vid, nx, ny, cr, cg, cb, 255); + + + + } else if(t==PT_ACID) { if(parts[i].life>255) parts[i].life = 255; diff --git a/src/interface.c b/src/interface.c index e22a9c42a..0ea1bc75b 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1479,6 +1479,7 @@ 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 h,x,y,n=0,height,width,sy,rows=0; + SEC = SEC2; mx /= sdl_scale; my /= sdl_scale; rows = ceil((float)msections[i].itemcount/16.0f); @@ -1505,6 +1506,15 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); h = n; } + if(!bq && mx>=x+32 && mx=y && my< y+15&&(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT))) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + h = n; + } + else if(n==SLALT) + { + drawrect(vid_buf, x+30, y-1, 29, 17, 0, 255, 255, 255); + } else if(n==*sl) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); @@ -1624,6 +1634,13 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, } } } + if(!bq&&mx>=sdl_scale*((XRES+BARSIZE)-16) && mx= sdl_scale*((i*16)+YRES+MENUSIZE-16-(SC_TOTAL*16)) && my=0&&i=0) + { + SLALT = -1; + SEC2 = SEC; + } + } if(b==1&&h!=-1) { if(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT)) { SLALT = h; + SEC2 = -1; } else{ *sl = h; } } + if(b==4&&h==-1) + { + if(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT) && SEC>=0) + { + SLALT = -1; + SEC2 = SEC; + } + } if(b==4&&h!=-1) { - if(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT)) + if(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT)) { SLALT = h; + SEC2 = -1; } else{ *sr = h; diff --git a/src/powder.c b/src/powder.c index 7cdba8c2b..eee2bace3 100644 --- a/src/powder.c +++ b/src/powder.c @@ -498,6 +498,8 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = 110; parts[i].tmp = 50; } + if(t==PT_PIPE) + parts[i].life = 100; if(t==PT_BCOL) parts[i].life = 110; if(t==PT_FIRE) @@ -678,11 +680,16 @@ inline void delete_part(int x, int y) i = pmap[y][x]; if(!i || (i>>8)>=NPART) return; - if((parts[i>>8].type==SLALT)||SLALT==-1||SLALT==0) + if((parts[i>>8].type==SLALT)||SLALT==0) { kill_part(i>>8); pmap[y][x] = 0; } + else if(ptypes[parts[i>>8].type].menusection==SEC) + { + kill_part(i>>8); + pmap[y][x] = 0; + } else return; } @@ -981,7 +988,7 @@ void update_particles_i(pixel *vid, int start, int inc) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE) { kill_part(i); continue; @@ -2164,7 +2171,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; } } - for(int trade = 0; trade<9;trade ++) + for(int trade = 0; trade<4;trade ++) { nx = rand()%5-2; ny = rand()%5-2; @@ -2180,13 +2187,11 @@ void update_particles_i(pixel *vid, int start, int inc) { parts[r>>8].life ++; parts[i].life --; - trade = 9; } else if(temp>0) { parts[r>>8].life += temp/2; parts[i].life -= temp/2; - trade = 9; } } } @@ -2211,7 +2216,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].tmp = parts[r>>8].tmp; parts[i].temp = parts[r>>8].temp; parts[r>>8].type = PT_WARP; - parts[r>>8].life = rand()%90; + parts[r>>8].life = rand()%90+1; trade = 5; } } @@ -2305,6 +2310,129 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_PIPE) + { + if(!parts[i].ctype && parts[i].life<=50) + { + if(parts[i].temp<272.15) + { + if(parts[i].temp>173.25&&parts[i].temp<273.15) + { + parts[i].ctype = 2; + parts[i].life = 0; + } + if(parts[i].temp>73.25&&parts[i].temp<=173.15) + { + parts[i].ctype = 3; + parts[i].life = 0; + } + if(parts[i].temp>=0&&parts[i].temp<=73.15) + { + parts[i].ctype = 4; + parts[i].life = 0; + } + } + else + { + for(nx=-2; nx<3; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART ) + continue; + if(!r) + create_part(-1,x+nx,y+ny,PT_DMND); + } + if(parts[i].life==1) + parts[i].ctype = 1; + } + } + if(parts[i].ctype==1) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART) + continue; + if(!r&&!parts[i].life) + { + parts[i].life=50; + continue; + } + if(!r) + continue; + } + if(parts[i].life==2) + { + parts[i].ctype = 2; + parts[i].life = 6; + } + } + if(parts[i].ctype>1) + for(int o = 0;o<3;o++) + for(int ctype = 2;ctype<5;ctype++) + { + if(parts[i].ctype==ctype) + { + if(parts[i].life==3) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==PT_PIPE&&parts[r>>8].ctype==1) + { + //parts[r>>8].ctype = (((ctype-1)%3)+2);//forward + parts[r>>8].ctype = (((ctype)%3)+2);//reverse + parts[r>>8].life = 6; + } + } + //if(created == 0) + //{ + // parts[i].ctype = (((ctype)%3)+2); + // parts[i].life = 6; //causes trippyness + //} + //else + // parts[i].life = 0; + } + else + { + nx = rand()%3-1; + ny = rand()%3-1; + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART) + continue; + else if(!r&&parts[i].tmp!=0) + { + create_part(-1,x+nx,y+ny,parts[i].tmp); + parts[i].tmp = 0; + continue; + } + else if(!r) + continue; + else if(parts[r>>8].type!=PT_PIPE && parts[r>>8].type!=PT_DMND && parts[i].tmp == 0 && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS)) + { + parts[i].tmp = parts[r>>8].type; + parts[r>>8].type = PT_NONE; + } + else if(parts[r>>8].type==PT_PIPE && parts[r>>8].ctype!=(((ctype)%3)+2) && parts[r>>8].tmp==0&&parts[i].tmp>0) + { + parts[r>>8].tmp = parts[i].tmp; + parts[i].tmp = 0; + } + } + } + } + } + } else if(t==PT_PCLN) { for(nx=-2; nx<3; nx++) @@ -4235,7 +4363,7 @@ int create_parts(int x, int y, int r, int c) if(c == 0) { stemp = SLALT; - SLALT = -1; + SLALT = 0; for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) if(i*i+j*j<=r*r) From 5e56850682e033a202f633319c08965b0ed1ac69 Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 18 Nov 2010 16:23:24 -0500 Subject: [PATCH 54/79] Added element replacement ability. hit insert. capslock is shift-alt so you can do lines/boxes with specific element erase. read post for other changes --- includes/defines.h | 1 + includes/powder.h | 4 +- src/graphics.c | 2 +- src/main.c | 11 ++++- src/powder.c | 108 +++++++++++++++++++++++---------------------- 5 files changed, 70 insertions(+), 56 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 173bc2bbe..e7b9be181 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -115,6 +115,7 @@ int gol[XRES][YRES]; int gol2[XRES][YRES][NGOL]; int SEC; int SEC2; +int REPLACE_MODE; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/powder.h b/includes/powder.h index cf92906fd..56381185c 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -255,7 +255,7 @@ static const part_type ptypes[PT_NUM] = {"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, 10, SC_LIQUID, R_TEMP+0.0f +273.15f, 34, "Dissolves almost everything.", TYPE_LIQUID}, {"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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Hole, will drain away any particles.", TYPE_SOLID}, {"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, 1, SC_GAS, R_TEMP+100.0f+273.15f, 48, "Steam, heats up air, produced from hot water.", TYPE_GAS}, - {"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, 55, SC_POWDERS, R_TEMP+0.0f +273.15f, 100, "Concrete, stronger than stone.", TYPE_PART}, + {"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, 2, 1, 55, SC_POWDERS, R_TEMP+0.0f +273.15f, 100, "Concrete, stronger than stone.", TYPE_PART}, {"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, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 23, "Distilled water, does not conduct electricity.", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"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, 75, SC_POWDERS, R_TEMP+0.0f +273.15f, 110, "Salt, dissolves in water.", TYPE_PART}, {"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, 35, SC_LIQUID, R_TEMP+0.0f +273.15f, 75, "Saltwater, conducts electricity, difficult to freeze.", TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTPENETRATE}, @@ -330,7 +330,7 @@ static const part_type ptypes[PT_NUM] = {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, - {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 273.15f, 0, "probably doesn't work", TYPE_SOLID}, + {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 273.15f, 0, "Moves elements around, read the post on how to use.", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; diff --git a/src/graphics.c b/src/graphics.c index 1f8ef9176..c58d4f260 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1391,7 +1391,7 @@ void draw_parts(pixel *vid) isplayer = 1; //It's a secret. Tssss... } - if(cmode==CM_NOTHING)//nothing display + if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY)//nothing display but show needed color changes { cr = PIXR(ptypes[t].pcolors); cg = PIXG(ptypes[t].pcolors); diff --git a/src/main.c b/src/main.c index 506e97621..17ccbab3e 100644 --- a/src/main.c +++ b/src/main.c @@ -1320,6 +1320,8 @@ int main(int argc, char *argv[]) bs = 0; } } + if(sdl_key==SDLK_INSERT) + REPLACE_MODE = !REPLACE_MODE; if(sdl_key==SDLK_SPACE) sys_pause = !sys_pause; if(sdl_key=='h') @@ -1863,6 +1865,8 @@ int main(int argc, char *argv[]) } else if((sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) && (sdl_mod & (KMOD_LSHIFT|KMOD_RSHIFT)) && !(sdl_mod & (KMOD_LALT))) { + if(sdl_mod & (KMOD_CAPS)) + c = 0; if(c!=125&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM) flood_parts(x, y, c, -1, -1); lx = x; @@ -2070,7 +2074,12 @@ int main(int argc, char *argv[]) if(currentTime-pastFPS>=1000) { #ifdef BETA - sprintf(uitext, "Cracker's Version %d (Beta %d) FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); + if(REPLACE_MODE) + sprintf(uitext, "Cracker's Version %d FPS:%d REPLACE MODE", SAVE_VERSION,FPS); + else if(sdl_mod&(KMOD_CAPS)) + sprintf(uitext, "Cracker's Version %d FPS:%d CAPS LOCK ON", SAVE_VERSION, FPS); + else + sprintf(uitext, "Cracker's Version %d (Beta %d) FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); //printf("%s\n", uitext); #else sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); diff --git a/src/powder.c b/src/powder.c index eee2bace3..2adf88067 100644 --- a/src/powder.c +++ b/src/powder.c @@ -499,7 +499,7 @@ inline int create_part(int p, int x, int y, int t) parts[i].tmp = 50; } if(t==PT_PIPE) - parts[i].life = 100; + parts[i].life = 60; if(t==PT_BCOL) parts[i].life = 110; if(t==PT_FIRE) @@ -1196,8 +1196,10 @@ void update_particles_i(pixel *vid, int start, int inc) t = parts[i].type = PT_BRMT; if(t==PT_BMTL && pv[y/CELL][x/CELL]>1.0f && parts[i].tmp==1) t = parts[i].type = PT_BRMT; - if(t==PT_BRCK && pv[y/CELL][x/CELL]>2.8f) + if(t==PT_BRCK && pv[y/CELL][x/CELL]>8.8f) t = parts[i].type = PT_STNE; + if(t==PT_PIPE && pv[y/CELL][x/CELL]>10.0f) + t = parts[i].type = PT_BRMT; //if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f) // t = parts[i].type = PT_BGLA; if(t==PT_GLAS) @@ -1803,6 +1805,8 @@ void update_particles_i(pixel *vid, int start, int inc) { parts[r>>8].type = PT_SLTW; } + if((r&0xFF)==PT_PLNT&&5>(rand()%1000)) + parts[r>>8].type = PT_NONE; if(((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && pt>12.0f && 1>(rand()%500)) { parts[i].life = 4; @@ -2136,21 +2140,21 @@ void update_particles_i(pixel *vid, int start, int inc) maxlife ++; if(parts[i].life < maxlife) { - for(nx=-1; nx<2; nx++) - for(ny=-1; ny<2; ny++) - if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r || (parts[i].life >=maxlife)) - continue; - if(parts[r>>8].type==PT_WTF&&33>=rand()/(RAND_MAX/100)+1) + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r || (parts[i].life >=maxlife)) + continue; + if(parts[r>>8].type==PT_WTF&&33>=rand()/(RAND_MAX/100)+1) + { + if((parts[i].life + parts[r>>8].life + 1) <= maxlife) { - if((parts[i].life + parts[r>>8].life + 1) <= maxlife) - { - parts[i].life += parts[r>>8].life + 1; - parts[r>>8].type=PT_NONE; - } - } + parts[i].life += parts[r>>8].life + 1; + parts[r>>8].type=PT_NONE; + } + } } } else @@ -2168,33 +2172,33 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1,x+nx,y+ny,PT_WTF); parts[i].life--; - parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; + parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; } - } + } for(int trade = 0; trade<4;trade ++) { - nx = rand()%5-2; - ny = rand()%5-2; - if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) - continue; - if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion - { - int temp = parts[i].life - parts[r>>8].life; - if(temp ==1) + nx = rand()%5-2; + ny = rand()%5-2; + if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion { - parts[r>>8].life ++; - parts[i].life --; - } - else if(temp>0) - { - parts[r>>8].life += temp/2; - parts[i].life -= temp/2; + int temp = parts[i].life - parts[r>>8].life; + if(temp ==1) + { + parts[r>>8].life ++; + parts[i].life --; + } + else if(temp>0) + { + parts[r>>8].life += temp/2; + parts[i].life -= temp/2; + } } } - } } } else if(t==PT_WARP) @@ -2226,7 +2230,6 @@ void update_particles_i(pixel *vid, int start, int inc) { if((parts[i].temp>400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x])||parts[i].ctype==PT_DUST) { - create_part(-1, x , y-1 , PT_FWRK); r = pmap[y-1][x]; if(parts[r>>8].type==PT_FWRK) @@ -2312,7 +2315,7 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_PIPE) { - if(!parts[i].ctype && parts[i].life<=50) + if(!parts[i].ctype && parts[i].life<=10) { if(parts[i].temp<272.15) { @@ -2342,7 +2345,7 @@ void update_particles_i(pixel *vid, int start, int inc) if((r>>8)>=NPART ) continue; if(!r) - create_part(-1,x+nx,y+ny,PT_DMND); + create_part(-1,x+nx,y+ny,PT_BRCK); } if(parts[i].life==1) parts[i].ctype = 1; @@ -2388,18 +2391,10 @@ void update_particles_i(pixel *vid, int start, int inc) continue; if(parts[r>>8].type==PT_PIPE&&parts[r>>8].ctype==1) { - //parts[r>>8].ctype = (((ctype-1)%3)+2);//forward parts[r>>8].ctype = (((ctype)%3)+2);//reverse parts[r>>8].life = 6; } } - //if(created == 0) - //{ - // parts[i].ctype = (((ctype)%3)+2); - // parts[i].life = 6; //causes trippyness - //} - //else - // parts[i].life = 0; } else { @@ -2418,7 +2413,7 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(!r) continue; - else if(parts[r>>8].type!=PT_PIPE && parts[r>>8].type!=PT_DMND && parts[i].tmp == 0 && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS)) + else if(parts[i].tmp == 0 && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS)) { parts[i].tmp = parts[r>>8].type; parts[r>>8].type = PT_NONE; @@ -4193,7 +4188,7 @@ int flood_parts(int x, int y, int c, int cm, int bm) bm = 0; } - if((pmap[y][x]&0xFF)!=cm || bmap[y/CELL][x/CELL]!=bm) + if((pmap[y][x]&0xFF)!=cm || bmap[y/CELL][x/CELL]!=bm ||( (sdl_mod & (KMOD_CAPS)) && cm!=SLALT)) return 1; // go left as far as possible @@ -4343,7 +4338,7 @@ int create_parts(int x, int y, int r, int c) } return 1; } - if(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT)) + if(((sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT))|| sdl_mod & (KMOD_CAPS) )&& !REPLACE_MODE) { for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) @@ -4351,6 +4346,15 @@ int create_parts(int x, int y, int r, int c) delete_part(x+i, y+j); return 1; } + if(REPLACE_MODE) + { + for(j=-r; j<=r; j++) + for(i=-r; i<=r; i++) + if(i*i+j*j<=r*r) + delete_part(x+i, y+j); + if(c==0) + return 1; + } if(c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM) { for(j=-r; j<=r; j++) @@ -4371,7 +4375,7 @@ int create_parts(int x, int y, int r, int c) SLALT = stemp; return 1; } - + for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) if(i*i+j*j<=r*r) From 435f71c7814cf9d4c55168852caf21ac80674490 Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 18 Nov 2010 23:27:24 -0500 Subject: [PATCH 55/79] Added FRZZ FRZW GRAV. add square brush, hit tab to switch between the two. pipe ctype saves. --- includes/defines.h | 5 ++++ includes/powder.h | 37 +++++++++++++++--------- src/graphics.c | 34 +++++++++++++++++++++- src/main.c | 8 ++++-- src/powder.c | 72 ++++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 133 insertions(+), 23 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index e7b9be181..56c970758 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -58,6 +58,10 @@ extern unsigned char ZSIZE; #define NGOL 13 +#define CIRCLE_BRUSH 0 +#define SQUARE_BRUSH 1 +#define BRUSH_NUM 2 + #ifdef PIX16 typedef unsigned short pixel; #else @@ -116,6 +120,7 @@ int gol2[XRES][YRES][NGOL]; int SEC; int SEC2; int REPLACE_MODE; +int CURRENT_BRUSH; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/powder.h b/includes/powder.h index 56381185c..ae128e685 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -140,7 +140,10 @@ #define PT_PUMP 97 #define PT_FWRK 98 #define PT_PIPE 99 -#define PT_NUM 100 +#define PT_FRZZ 100 +#define PT_FRZW 101 +#define PT_GRAV 102 +#define PT_NUM 103 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -234,17 +237,17 @@ static const part_type ptypes[PT_NUM] = {"", 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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Erases particles.", 0}, {"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, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, {"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, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires.", TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTPENETRATE}, - {"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, 20, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable.", TYPE_LIQUID}, + {"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, 20, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable.", TYPE_LIQUID}, {"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, 2, SC_EXPLOSIVE, R_TEMP+400.0f+273.15f, 88, "Ignites flammable materials. Heats air.", TYPE_GAS}, {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Heavy particles. Meltable.", TYPE_PART}, {"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, 45, SC_LIQUID, R_TEMP+1500.0f+273.15f, 60, "Heavy liquid. Ignites flammable materials. Solidifies when cold.", TYPE_LIQUID}, - {"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, 85, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 97, "Light dust. Explosive.", TYPE_PART}, + {"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, 85, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 97, "Light dust. Explosive.", TYPE_PART}, {"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, 23, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 50, "Liquid. Pressure sensitive explosive.", TYPE_LIQUID}, {"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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Duplicates any particles it touches.", TYPE_SOLID}, - {"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, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Gas. Diffuses. Flammable. Liquifies under pressure.", TYPE_GAS}, - {"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, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive.", TYPE_SOLID | PROP_NEUTPENETRATE}, - {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure.", TYPE_SOLID | PROP_NEUTPENETRATE}, - {"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, 100, SC_SOLIDS, R_TEMP-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air.", TYPE_SOLID}, + {"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, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Gas. Diffuses. Flammable. Liquifies under pressure.", TYPE_GAS}, + {"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, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive.", TYPE_SOLID | PROP_NEUTPENETRATE}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure.", TYPE_SOLID | PROP_NEUTPENETRATE}, + {"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, 100, SC_SOLIDS, R_TEMP-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air.", TYPE_SOLID}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. Conducts electricity. Meltable.", TYPE_SOLID|PROP_CONDUCTS}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electricity. Conducted by metal and water.", TYPE_SOLID}, {"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, 50, SC_POWDERS, R_TEMP-30.0f+273.15f, 46, "Light particles.", TYPE_PART}, @@ -264,11 +267,11 @@ static const part_type ptypes[PT_NUM] = {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken metal.", TYPE_PART|PROP_CONDUCTS}, {"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, -1, SC_ELEC, R_TEMP+900.0f+273.15f, 251, "Photons. Travel in straight lines.", TYPE_ENERGY}, {"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, 90, SC_NUCLEAR, R_TEMP+30.0f+273.15f, 251, "Heavy particles. Generates heat under pressure.", TYPE_PART}, - {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures.", TYPE_SOLID}, + {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures.", TYPE_SOLID}, {"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, 25, SC_LIQUID, R_TEMP+28.0f+273.15f, 44, "Liquid Wax.", TYPE_LIQUID}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "P-Type Silicon, Will transfer current to any conductor.", TYPE_SOLID}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "N-Type Silicon, Will only transfer current to P-Type Silicon.", TYPE_SOLID}, - {"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, 30, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold.", TYPE_LIQUID}, + {"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, 30, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold.", TYPE_LIQUID}, {"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, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Insulator, does not conduct heat or electricity.", TYPE_SOLID}, {"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, 100, SC_SPECIAL, R_TEMP+70.0f+273.15f, 255, "Black hole, sucks in other particles and heats up.", TYPE_SOLID}, {"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, 100, SC_SPECIAL, R_TEMP-16.0f+273.15f, 255, "White hole, pushes other particles away.", TYPE_SOLID}, @@ -291,8 +294,8 @@ static const part_type ptypes[PT_NUM] = {"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, 1, SC_GAS, R_TEMP+320.0f+273.15f, 88, "Smoke", TYPE_GAS}, {"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, 15, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Explodes under high pressure and temperatures", TYPE_LIQUID}, {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly.", TYPE_SOLID}, - {"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, 30, SC_LIQUID, 80.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire", TYPE_LIQUID}, - {"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, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Gas. Ignites easily.", TYPE_GAS}, + {"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, 30, SC_LIQUID, 80.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire", TYPE_LIQUID}, + {"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, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Gas. Ignites easily.", TYPE_GAS}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Insulated Wire. Doesn't conduct to metal or semiconductors.", TYPE_SOLID}, {"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, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Yeast, grows when warm (~37C).", TYPE_PART}, {"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, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Dead Yeast.", TYPE_PART}, @@ -331,7 +334,10 @@ static const part_type ptypes[PT_NUM] = {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 273.15f, 0, "Moves elements around, read the post on how to use.", TYPE_SOLID}, - //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description + {"FRZZ", 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, 50, SC_POWDERS, 90.0f, 46, "FREEZE", TYPE_PART}, + {"FRZW", 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, 30, SC_LIQUID, 90.0f, 29, "FREEZE WATER", TYPE_LIQUID}, + {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, +//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; static part_state pstates[PT_NUM] = @@ -434,8 +440,11 @@ static part_state pstates[PT_NUM] = /* LOVE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WTF */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WARP */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* PUMP */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* FWRK */ {ST_GAS , PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PUMP */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FWRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FWRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FRZZ */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FRZW */ {ST_LIQUID, PT_ICEI, 53.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { diff --git a/src/graphics.c b/src/graphics.c index c58d4f260..ee89625e6 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1489,6 +1489,30 @@ void draw_parts(pixel *vid) else blendpixel(vid,x,y,parts[i].tmp,parts[i].ctype,parts[i].flags,255); } + else if(t==PT_GRAV) + { + cr = 20; + cg = 20; + cb = 20; + if(parts[i].vx>0) + cr += (parts[i].vx)*60; + if(parts[i].vy>0) + cb += (parts[i].vy)*60; + if(parts[i].vx<0) + cg -= (parts[i].vx)*60; + if(parts[i].vy<0) + { + cr -= (parts[i].vy)*30; + cg -= (parts[i].vy)*30; + } + if(cr>255) + cr=255; + if(cg>255) + cg=255; + if(cb>255) + cb=255; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + } else if(t==PT_PIPE) { if(parts[i].ctype==2) @@ -2821,7 +2845,15 @@ void render_cursor(pixel *vid, int x, int y, int t, int r) { if(r<=0) xor_pixel(x, y, vid); - else + else if(CURRENT_BRUSH==SQUARE_BRUSH) + for(j=-r; j<=r; j++) + { + xor_pixel(x+r, y+j, vid); + xor_pixel(x-r, y+j, vid); + if(abs(j)r*r || i*i+(j+1)*(j+1)>r*r)) diff --git a/src/main.c b/src/main.c index 17ccbab3e..beedda784 100644 --- a/src/main.c +++ b/src/main.c @@ -325,7 +325,7 @@ void *build_save(int *size, int x0, int y0, int w, int h) for(j=0; j=43) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34))) + if(i && (ty==PT_CLNE || (ty==PT_PCLN && ver>=43) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34) || (ty==PT_PIPE && ver>=43))) { if(p >= size) goto corrupt; @@ -1276,6 +1276,10 @@ int main(int argc, char *argv[]) { set_cmode(CM_CRACK); } + if(sdl_key==SDLK_TAB) + { + CURRENT_BRUSH =(CURRENT_BRUSH + 1)%BRUSH_NUM ; + } if(sdl_key==SDLK_LEFTBRACKET) { if(sdl_zoom_trig==1) { diff --git a/src/powder.c b/src/powder.c index 2adf88067..8657f6ab7 100644 --- a/src/powder.c +++ b/src/powder.c @@ -498,6 +498,8 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = 110; parts[i].tmp = 50; } + if(t==PT_FRZW) + parts[i].life = 100; if(t==PT_PIPE) parts[i].life = 60; if(t==PT_BCOL) @@ -988,7 +990,7 @@ void update_particles_i(pixel *vid, int start, int inc) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)) { kill_part(i); continue; @@ -1456,6 +1458,13 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_ICEI || t==PT_SNOW) { + if(parts[i].ctype==PT_FRZW) + { + parts[i].temp -= 1.0f; + if(parts[i].temp<0) + parts[i].temp = 0; + + } for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) if(x+nx>=0 && y+ny>0 && @@ -2428,6 +2437,57 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_FRZZ) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==PT_WATR&&5>rand()%100) + { + parts[r>>8].type=PT_FRZW; + parts[r>>8].life = 100; + t = parts[i].type = PT_NONE; + } + + } + } + else if(t==PT_FRZW) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==PT_WATR&&5>rand()%70) + { + parts[r>>8].type=PT_FRZW; + } + } + if(parts[i].life==0&&13>rand()%2500) + { + t = parts[i].type=PT_ICEI; + parts[i].ctype=PT_FRZW; + parts[i].temp -= 200.0f; + if(parts[i].temp<0) + parts[i].temp = 0; + } + else if((100-(parts[i].life))>rand()%50000) + { + t = parts[i].type=PT_ICEI; + parts[i].ctype=PT_FRZW; + parts[i].temp -= 200.0f; + if(parts[i].temp<0) + parts[i].temp = 0; + } + } else if(t==PT_PCLN) { for(nx=-2; nx<3; nx++) @@ -4342,7 +4402,7 @@ int create_parts(int x, int y, int r, int c) { for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) - if(i*i+j*j<=r*r) + if((CURRENT_BRUSH==CIRCLE_BRUSH && i*i+j*j<=r*r)||CURRENT_BRUSH==SQUARE_BRUSH) delete_part(x+i, y+j); return 1; } @@ -4350,7 +4410,7 @@ int create_parts(int x, int y, int r, int c) { for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) - if(i*i+j*j<=r*r) + if((CURRENT_BRUSH==CIRCLE_BRUSH && i*i+j*j<=r*r)||CURRENT_BRUSH==SQUARE_BRUSH) delete_part(x+i, y+j); if(c==0) return 1; @@ -4359,7 +4419,7 @@ int create_parts(int x, int y, int r, int c) { for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) - if(i*i+j*j<=r*r) + if((CURRENT_BRUSH==CIRCLE_BRUSH && i*i+j*j<=r*r)||CURRENT_BRUSH==SQUARE_BRUSH) create_part(-1, x+i, y+j, c); return 1; } @@ -4370,7 +4430,7 @@ int create_parts(int x, int y, int r, int c) SLALT = 0; for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) - if(i*i+j*j<=r*r) + if((CURRENT_BRUSH==CIRCLE_BRUSH && i*i+j*j<=r*r)||CURRENT_BRUSH==SQUARE_BRUSH) delete_part(x+i, y+j); SLALT = stemp; return 1; @@ -4378,7 +4438,7 @@ int create_parts(int x, int y, int r, int c) for(j=-r; j<=r; j++) for(i=-r; i<=r; i++) - if(i*i+j*j<=r*r) + if((CURRENT_BRUSH==CIRCLE_BRUSH && i*i+j*j<=r*r)||CURRENT_BRUSH==SQUARE_BRUSH) if(create_part(-1, x+i, y+j, c)==-1) f = 1; return !f; From c1182db42d609a181128b818da28d323c39445fc Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 19 Nov 2010 18:01:56 -0500 Subject: [PATCH 56/79] Fixed SWCH for real. Fix repeating spark while creating it. Adjustable x and y for brushes. --- includes/graphics.h | 2 +- includes/powder.h | 4 +- src/graphics.c | 30 ++++++++----- src/main.c | 102 +++++++++++++++++++++++++++++++++----------- src/powder.c | 72 ++++++++++++++++--------------- 5 files changed, 136 insertions(+), 74 deletions(-) diff --git a/includes/graphics.h b/includes/graphics.h index e23fe9d10..2cb37d3d8 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -137,7 +137,7 @@ 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 render_cursor(pixel *vid, int x, int y, int t, float rx, float ry); void sdl_open(void); diff --git a/includes/powder.h b/includes/powder.h index ae128e685..627b74be8 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -540,8 +540,8 @@ 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); +int create_parts(int x, int y, float rx, float ry, int c); -void create_line(int x1, int y1, int x2, int y2, int r, int c); +void create_line(int x1, int y1, int x2, int y2, float rx, float ry, int c); #endif diff --git a/src/graphics.c b/src/graphics.c index ee89625e6..99e691eb9 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2838,25 +2838,33 @@ corrupt: return 1; } -void render_cursor(pixel *vid, int x, int y, int t, int r) +void render_cursor(pixel *vid, int x, int y, int t, float rx, float ry) { int i,j,c; if(trx || (j+1)>ry)) { - xor_pixel(x+r, y+j, vid); - xor_pixel(x-r, y+j, vid); - if(abs(j)r*r || i*i+(j+1)*(j+1)>r*r)) + for(j=0; j<=ry; j++) + for(i=0; i<=rx; i++) + if((i*i)/(rx*rx)+(j*j)/(ry*rx)<=1 && (((i+1)*(i+1))/(rx*rx)+(j*j)/(ry*rx)>1 || ((i*i)/(rx*rx)+((j+1)*(j+1))/(ry*ry)>1))) { xor_pixel(x+i, y+j, vid); if(j) xor_pixel(x+i, y-j, vid); @@ -2867,7 +2875,7 @@ void render_cursor(pixel *vid, int x, int y, int t, int r) else { int tc; - c = (r/CELL) * CELL; + c = (rx/CELL) * CELL; x = (x/CELL) * CELL; y = (y/CELL) * CELL; diff --git a/src/main.c b/src/main.c index beedda784..29b553e27 100644 --- a/src/main.c +++ b/src/main.c @@ -993,8 +993,8 @@ int main(int argc, char *argv[]) int vs = 0; #endif int x, y, b = 0, sl=1, sr=0, su=0, c, lb = 0, lx = 0, ly = 0, lm = 0;//, tx, ty; - int da = 0, db = 0, it = 2047, mx, my, bs = 2; - float nfvx, nfvy; + int da = 0, db = 0, it = 2047, mx, my; + float nfvx, nfvy, bsx = 2, bsy = 2; int load_mode=0, load_w=0, load_h=0, load_x=0, load_y=0, load_size=0; void *load_data=NULL; pixel *load_img=NULL;//, *fbi_img=NULL; @@ -1292,14 +1292,32 @@ int main(int argc, char *argv[]) } else { - if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) - bs -= 1; + if(sdl_mod & (KMOD_LALT|KMOD_RALT) && !(sdl_mod & (KMOD_SHIFT|KMOD_CTRL))) + { + bsx -= 1; + bsy -= 1; + } + else if(sdl_mod & (KMOD_SHIFT) && !(sdl_mod & (KMOD_CTRL))) + { + bsx -= 1; + } + else if(sdl_mod & (KMOD_CTRL) && !(sdl_mod & (KMOD_SHIFT))) + { + bsy -= 1; + } else - bs -= ceil((bs/5)+0.5f); - if(bs>1224) - bs = 1224; - if(bs<0) - bs = 0; + { + bsx -= ceil((bsx/5)+0.5f); + bsy -= ceil((bsy/5)+0.5f); + } + if(bsx>1180) + bsx = 1180; + if(bsy>1180) + bsy = 1180; + if(bsx<0) + bsx = 0; + if(bsy<0) + bsy = 0; } } if(sdl_key==SDLK_RIGHTBRACKET) { @@ -1314,14 +1332,32 @@ int main(int argc, char *argv[]) } else { - if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) - bs += 1; + if(sdl_mod & (KMOD_LALT|KMOD_RALT) && !(sdl_mod & (KMOD_SHIFT|KMOD_CTRL))) + { + bsx += 1; + bsy += 1; + } + else if(sdl_mod & (KMOD_SHIFT) && !(sdl_mod & (KMOD_CTRL))) + { + bsx += 1; + } + else if(sdl_mod & (KMOD_CTRL) && !(sdl_mod & (KMOD_SHIFT))) + { + bsy += 1; + } else - bs += ceil((bs/5)+0.5f); - if(bs>1224) - bs = 1224; - if(bs<0) - bs = 0; + { + bsx += ceil((bsx/5)+0.5f); + bsy += ceil((bsy/5)+0.5f); + } + if(bsx>1180) + bsx = 1180; + if(bsy>1180) + bsy = 1180; + if(bsx<0) + bsx = 0; + if(bsy<0) + bsy = 0; } } if(sdl_key==SDLK_INSERT) @@ -1407,11 +1443,27 @@ int main(int argc, char *argv[]) } else { - bs += sdl_wheel; - if(bs>1224) - bs = 1224; - if(bs<0) - bs = 0; + if(!(sdl_mod & (KMOD_SHIFT|KMOD_CTRL))) + { + bsx += sdl_wheel; + bsy += sdl_wheel; + } + else if(sdl_mod & (KMOD_SHIFT) && !(sdl_mod & (KMOD_CTRL))) + { + bsx += sdl_wheel; + } + else if(sdl_mod & (KMOD_CTRL) && !(sdl_mod & (KMOD_SHIFT))) + { + bsy += sdl_wheel; + } + if(bsx>1180) + bsx = 1180; + if(bsx<0) + bsx = 0; + if(bsy>1180) + bsy = 1180; + if(bsy<0) + bsy = 0; sdl_wheel = 0; /*if(su >= PT_NUM) { if(sl < PT_NUM) @@ -1846,7 +1898,7 @@ int main(int argc, char *argv[]) } else { - create_line(lx, ly, x, y, bs, c); + create_line(lx, ly, x, y, bsx, bsy, c); lx = x; ly = y; } @@ -1920,7 +1972,7 @@ int main(int argc, char *argv[]) cb_emap[cby][cbx] = emap[cby][cbx]; } - create_parts(x, y, bs, c); + create_parts(x, y, bsx, bsy, c); lx = x; ly = y; lb = b; @@ -1940,7 +1992,7 @@ int main(int argc, char *argv[]) if(lm == 1) { if(c!=127 || lx<0 || ly<0 || lx>=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=4) - create_line(lx, ly, x, y, bs, c); + create_line(lx, ly, x, y, bsx, bsy, c); } else create_box(lx, ly, x, y, c); @@ -1964,7 +2016,7 @@ int main(int argc, char *argv[]) if(zoom_en!=1 && !load_mode && !save_mode) { - render_cursor(vid_buf, mx/sdl_scale, my/sdl_scale, su, bs); + render_cursor(vid_buf, mx/sdl_scale, my/sdl_scale, su, bsx, bsy); mousex = mx/sdl_scale; mousey = my/sdl_scale; } diff --git a/src/powder.c b/src/powder.c index 8657f6ab7..52a7a2a67 100644 --- a/src/powder.c +++ b/src/powder.c @@ -441,6 +441,8 @@ inline int create_part(int p, int x, int y, int t) (pmap[y][x]&0xFF)!=PT_IRON && (pmap[y][x]&0xFF)!=PT_INWR) return -1; + if(parts[pmap[y][x]>>8].life!=0) + return -1; parts[pmap[y][x]>>8].type = PT_SPRK; parts[pmap[y][x]>>8].life = 4; parts[pmap[y][x]>>8].ctype = pmap[y][x]&0xFF; @@ -1226,7 +1228,7 @@ void update_particles_i(pixel *vid, int start, int inc) nearp = nearest_part(i, PT_ETRD); if(nearp!=-1&&parts_avg(i, nearp)!=PT_INSL) { - create_line((int)parts[i].x, (int)parts[i].y, (int)parts[nearp].x, (int)parts[nearp].y, 0, PT_PLSM); + create_line((int)parts[i].x, (int)parts[i].y, (int)parts[nearp].x, (int)parts[nearp].y, 0, 0, PT_PLSM); t = parts[i].type = PT_ETRD; parts[i].ctype = PT_NONE; parts[i].life = 20; @@ -2698,7 +2700,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } if(t==PT_SWCH) - if((parts[i].life>0&&parts[i].life<10)|| parts[i].life == 11) + if((parts[i].life>0&&parts[i].life<10)|| parts[i].life > 10) { parts[i].life--; } @@ -2795,7 +2797,7 @@ void update_particles_i(pixel *vid, int start, int inc) { parts[r>>8].type = PT_SWCH; parts[r>>8].ctype = PT_NONE; - parts[r>>8].life = 0; + parts[r>>8].life = 9; } } pavg = parts_avg(i, r>>8); @@ -2806,7 +2808,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].life = 10; if(parts[i].ctype == PT_NSCN&&pavg != PT_INSL) parts[r>>8].life = 9; - if(!(parts[i].ctype == PT_PSCN||parts[i].ctype == PT_NSCN)&&parts[r>>8].life >= 10&&pavg != PT_INSL) //Life can be 11 too, so don't just check for 10 + if(!(parts[i].ctype == PT_PSCN||parts[i].ctype == PT_NSCN)&&parts[r>>8].life == 10&&pavg != PT_INSL) { parts[r>>8].type = PT_SPRK; parts[r>>8].ctype = PT_SWCH; @@ -2896,7 +2898,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_SPRK&&parts[i].ctype==PT_SWCH&&parts[i].life<=1) { parts[i].type = PT_SWCH; - parts[i].life = 11; + parts[i].life = 14; } } } @@ -3112,7 +3114,7 @@ killed: else { if(player[2] == SPC_AIR) - create_parts(nx + 3*((((int)player[1])&0x02) == 0x02) - 3*((((int)player[1])&0x01) == 0x01), ny, 4, SPC_AIR); + create_parts(nx + 3*((((int)player[1])&0x02) == 0x02) - 3*((((int)player[1])&0x01) == 0x01), ny, 4, 4, SPC_AIR); else create_part(-1, nx, ny, player[2]); @@ -4212,7 +4214,7 @@ void create_box(int x1, int y1, int x2, int y2, int c) } for(j=y1; j<=y2; j++) for(i=x1; i<=x2; i++) - create_parts(i, j, 1, c); + create_parts(i, j, 1, 1, c); } int flood_parts(int x, int y, int c, int cm, int bm) @@ -4268,7 +4270,7 @@ int flood_parts(int x, int y, int c, int cm, int bm) // fill span for(x=x1; x<=x2; x++) - if(!create_parts(x, y, 0, co)) + if(!create_parts(x, y, 0, 0, co)) return 0; // fill children @@ -4285,7 +4287,7 @@ int flood_parts(int x, int y, int c, int cm, int bm) return 1; } -int create_parts(int x, int y, int r, int c) +int create_parts(int x, int y, float rx, float ry, int c) { int i, j, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0; //n; @@ -4374,14 +4376,14 @@ int create_parts(int x, int y, int r, int c) } if(dw==1) { - r = r/CELL; + rx = rx/CELL; x = x/CELL; y = y/CELL; - x -= r/2; - y -= r/2; - for (ox=x; ox<=x+r; ox++) + x -= rx/2; + y -= rx/2; + for (ox=x; ox<=x+rx; ox++) { - for (oy=y; oy<=y+r; oy++) + for (oy=y; oy<=y+rx; oy++) { if(ox>=0&&ox=0&&oyabs(x2-x1), x, y, dx, dy, sy; float e, de; @@ -4478,19 +4480,19 @@ void create_line(int x1, int y1, int x2, int y2, int r, int c) for(x=x1; x<=x2; x++) { if(cp) - create_parts(y, x, r, c); + create_parts(y, x, rx, ry, c); else - create_parts(x, y, r, c); + create_parts(x, y, rx, ry, c); e += de; if(e >= 0.5f) { y += sy; - if(c==135 || c==140 || c==134 || c==133 || c==132 || c==131 || c==129 || c==128 || c==127 || c==125 || c==124 || c==123 || c==122 || !r) + if(c==135 || c==140 || c==134 || c==133 || c==132 || c==131 || c==129 || c==128 || c==127 || c==125 || c==124 || c==123 || c==122 || !(rx+ry)) { if(cp) - create_parts(y, x, r, c); + create_parts(y, x, rx, ry, c); else - create_parts(x, y, r, c); + create_parts(x, y, rx, ry, c); } e -= 1.0f; } From a38dddaf5a2106ffb3d112584f657a6c3d97c4fb Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 19 Nov 2010 22:03:52 -0500 Subject: [PATCH 57/79] Made wall code use #defines. small fix for adjustabl brush. --- includes/powder.h | 17 ++-- src/air.c | 24 ++--- src/graphics.c | 2 +- src/interface.c | 8 +- src/main.c | 12 +-- src/powder.c | 249 ++++++++++++++++++---------------------------- 6 files changed, 131 insertions(+), 181 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 627b74be8..83986bf11 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -16,13 +16,10 @@ #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 UI_WALLSTART 122 +#define UI_ACTUALSTART 22 +#define UI_WALLCOUNT 19 #define WL_WALLELEC 22 #define WL_EWALL 23 @@ -38,8 +35,16 @@ #define WL_ALLOWSOLID 33 #define WL_ALLOWALLELEC 34 #define WL_EHOLE 35 + +#define SPC_AIR 136 +#define SPC_HEAT 137 +#define SPC_COOL 138 +#define SPC_VACUUM 139 + #define WL_ALLOWGAS 40 + + #define PT_NONE 0 #define PT_DUST 1 #define PT_WATR 2 diff --git a/src/air.c b/src/air.c index dd98a124c..04141e2dc 100644 --- a/src/air.c +++ b/src/air.c @@ -54,15 +54,15 @@ void update_air(void) 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])) + if(bmap[y][x]==WL_WALL || bmap[y][x+1]==WL_WALL || + bmap[y][x]==WL_WALLELEC || bmap[y][x+1]==WL_WALLELEC || + (bmap[y][x]==WL_EWALL && !emap[y][x]) || + (bmap[y][x+1]==WL_EWALL && !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])) + if(bmap[y][x]==WL_WALL || bmap[y+1][x]==WL_WALL || + bmap[y][x]==WL_WALLELEC || bmap[y+1][x]==WL_WALLELEC || + (bmap[y][x]==WL_EWALL && !emap[y][x]) || + (bmap[y+1][x]==WL_EWALL && !emap[y+1][x])) vy[y][x] = 0; } @@ -76,9 +76,9 @@ void update_air(void) for(i=-1; i<2; i++) if(y+j>0 && y+j0 && x+i1 || ((i*i)/(rx*rx)+((j+1)*(j+1))/(ry*ry)>1))) + if((i*i)/(rx*rx)+(j*j)/(ry*ry)<=1 && (((i+1)*(i+1))/(rx*rx)+(j*j)/(ry*ry)>1 || ((i*i)/(rx*rx)+((j+1)*(j+1))/(ry*ry)>1))) { xor_pixel(x+i, y+j, vid); if(j) xor_pixel(x+i, y-j, vid); diff --git a/src/interface.c b/src/interface.c index 0ea1bc75b..6df2ae5df 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1491,7 +1491,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, sy = y; if(i==SC_WALL) { - for(n = 122; n<122+UI_WALLCOUNT; n++) + for(n = UI_WALLSTART; n=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); @@ -1528,7 +1528,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, } else if(i==SC_SPECIAL) { - for(n = 122; n<122+UI_WALLCOUNT; n++) + for(n = UI_WALLSTART; n=x+32 && mx=y && my< y+15) { drawrect(vid_buf, x+30, y-1, 29, 17, 255, 0, 0, 255); diff --git a/src/main.c b/src/main.c index 29b553e27..4e427c984 100644 --- a/src/main.c +++ b/src/main.c @@ -250,7 +250,7 @@ void *build_save(int *size, int x0, int y0, int w, int h) d[p++] = bmap[y][x]; for(y=by0; y=0 && ly>=0 && lx=0 && ly>=0 && lx=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=4) + if(c!=127 || lx<0 || ly<0 || lx>=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=WL_FAN) create_line(lx, ly, x, y, bsx, bsy, c); } else diff --git a/src/powder.c b/src/powder.c index 52a7a2a67..7645b5ac2 100644 --- a/src/powder.c +++ b/src/powder.c @@ -82,17 +82,17 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) if(pt==PT_STKM) //Stick man's head shouldn't collide return 2; - if(bmap[ny/CELL][nx/CELL]==13 && ptypes[pt].falldown!=0 && pt!=PT_FIRE && pt!=PT_SMKE) + if(bmap[ny/CELL][nx/CELL]==WL_ALLOWGAS && ptypes[pt].falldown!=0 && pt!=PT_FIRE && pt!=PT_SMKE) return 0; - if(ptypes[pt].falldown!=2 && bmap[ny/CELL][nx/CELL]==3) + if(ptypes[pt].falldown!=2 && bmap[ny/CELL][nx/CELL]==WL_ALLOWLIQUID) return 0; - if((pt==PT_NEUT ||pt==PT_PHOT) && bmap[ny/CELL][nx/CELL]==7 && !emap[ny/CELL][nx/CELL]) + if((pt==PT_NEUT ||pt==PT_PHOT) && bmap[ny/CELL][nx/CELL]==WL_EWALL && !emap[ny/CELL][nx/CELL]) return 0; - if(bmap[ny/CELL][nx/CELL]==9) + if(bmap[ny/CELL][nx/CELL]==WL_ALLOWAIR) return 0; - if(ptypes[pt].falldown!=1 && bmap[ny/CELL][nx/CELL]==10) + if(ptypes[pt].falldown!=1 && bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID) return 0; if(r && (r&0xFF) < PT_NUM){ @@ -183,12 +183,12 @@ int try_move(int i, int x, int y, int nx, int ny) if(parts[i].type==PT_CNCT && y>8)>8)=XRES || y>=YRES || - ((bmap[y/CELL][x/CELL]==1 || - bmap[y/CELL][x/CELL]==8 || - bmap[y/CELL][x/CELL]==9 || - (bmap[y/CELL][x/CELL]==2) || - (bmap[y/CELL][x/CELL]==3 && ptypes[t].falldown!=2) || - (bmap[y/CELL][x/CELL]==10 && ptypes[t].falldown!=1) || - (bmap[y/CELL][x/CELL]==13 && ptypes[t].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE) || - (bmap[y/CELL][x/CELL]==6 && (t==PT_METL || t==PT_SPRK)) || - (bmap[y/CELL][x/CELL]==7 && !emap[y/CELL][x/CELL])) && (t!=PT_STKM))) + ((bmap[y/CELL][x/CELL]==WL_WALL || + bmap[y/CELL][x/CELL]==WL_WALLELEC || + bmap[y/CELL][x/CELL]==WL_ALLOWAIR || + (bmap[y/CELL][x/CELL]==WL_DESTROYALL) || + (bmap[y/CELL][x/CELL]==WL_ALLOWLIQUID && ptypes[t].falldown!=2) || + (bmap[y/CELL][x/CELL]==WL_ALLOWSOLID && ptypes[t].falldown!=1) || + (bmap[y/CELL][x/CELL]==WL_ALLOWGAS && ptypes[t].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE) || + (bmap[y/CELL][x/CELL]==WL_DETECT && (t==PT_METL || t==PT_SPRK)) || + (bmap[y/CELL][x/CELL]==WL_EWALL && !emap[y/CELL][x/CELL])) && (t!=PT_STKM))) { kill_part(i); continue; @@ -1158,7 +1158,7 @@ void update_particles_i(pixel *vid, int start, int inc) iy += dy; nx = (int)(ix+0.5f); ny = (int)(iy+0.5f); - if(nx<0 || ny<0 || nx>=XRES || ny>=YRES || pmap[ny][nx] || (bmap[ny/CELL][nx/CELL] && bmap[ny/CELL][nx/CELL]!=5)) + if(nx<0 || ny<0 || nx>=XRES || ny>=YRES || pmap[ny][nx] || (bmap[ny/CELL][nx/CELL] && bmap[ny/CELL][nx/CELL]!=WL_STREAM)) { parts[i].x = ix; parts[i].y = iy; @@ -1172,7 +1172,7 @@ void update_particles_i(pixel *vid, int start, int inc) for(ny=-1; ny<2; ny++) if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART) continue; - if((bmap[(y+ny)/CELL][(x+nx)/CELL]==8||bmap[(y+ny)/CELL][(x+nx)/CELL]==7||bmap[(y+ny)/CELL][(x+nx)/CELL]==2||bmap[(y+ny)/CELL][(x+nx)/CELL]==1|| - bmap[(y+ny)/CELL][(x+nx)/CELL]==9||bmap[(y+ny)/CELL][(x+nx)/CELL]==10||bmap[(y+ny)/CELL][(x+nx)/CELL]==13)) + if((bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALLELEC||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_EWALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_DESTROYALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALL|| + bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWAIR||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWSOLID||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWGAS)) continue; if((!r)&&parts[i].life>=1)//if nothing then create water { @@ -2087,7 +2087,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART) continue; - if((bmap[(y+ny)/CELL][(x+nx)/CELL]==8||bmap[(y+ny)/CELL][(x+nx)/CELL]==3||bmap[(y+ny)/CELL][(x+nx)/CELL]==2||bmap[(y+ny)/CELL][(x+nx)/CELL]==1||bmap[(y+ny)/CELL][(x+nx)/CELL]==10)) + if((bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALLELEC||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWLIQUID||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_DESTROYALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWSOLID)) continue; if((!r)&&parts[i].life>=1)//if nothing then create steam { @@ -2143,8 +2143,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life = parts[r>>8].life; } } - } - else if(t==PT_WTF) + } + else if(t==PT_WTF) { int maxlife = ((10000/(parts[i].temp + 1))-1); if((10000%((int)parts[i].temp+1))>rand()%((int)parts[i].temp+1)) @@ -2169,15 +2169,15 @@ void update_particles_i(pixel *vid, int start, int inc) } } else - for(nx=-1; nx<2; nx++) - for(ny=-1; ny<2; ny++) + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) if(x+nx>=0 && y+ny>0 && x+nx>8)>=NPART || (parts[i].life<=maxlife)) continue; - if((bmap[(y+ny)/CELL][(x+nx)/CELL]==8||bmap[(y+ny)/CELL][(x+nx)/CELL]==7||bmap[(y+ny)/CELL][(x+nx)/CELL]==2||bmap[(y+ny)/CELL][(x+nx)/CELL]==1|| - bmap[(y+ny)/CELL][(x+nx)/CELL]==9||bmap[(y+ny)/CELL][(x+nx)/CELL]==10||bmap[(y+ny)/CELL][(x+nx)/CELL]==13)) + if((bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALLELEC||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_EWALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_DESTROYALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALL|| + bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWAIR||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWSOLID||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWGAS)) continue; if((!r)&&parts[i].life>=1)//if nothing then create wtf { @@ -2211,8 +2211,8 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - } - else if(t==PT_WARP) + } + else if(t==PT_WARP) { for(int trade = 0; trade<5;trade ++) { @@ -2237,8 +2237,8 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - if(t==PT_FWRK) - { + else if(t==PT_FWRK) + { if((parts[i].temp>400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x])||parts[i].ctype==PT_DUST) { create_part(-1, x , y-1 , PT_FWRK); @@ -2288,7 +2288,7 @@ void update_particles_i(pixel *vid, int start, int inc) } parts[i].type=PT_NONE; } - } + } else if(t==PT_LCRY) { for(nx=-1; nx<2; nx++) @@ -2714,7 +2714,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(bmap[(y+ny)/CELL][(x+nx)/CELL] && bmap[(y+ny)/CELL][(x+nx)/CELL]!=5) + if(bmap[(y+ny)/CELL][(x+nx)/CELL] && bmap[(y+ny)/CELL][(x+nx)/CELL]!=WL_STREAM) continue; rt = parts[r>>8].type; if((a || ptypes[rt].explosive) && ((rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL && rt!=PT_SWCH) || t!=PT_SPRK) && @@ -3063,9 +3063,9 @@ killed: } //Charge detector wall if foot inside - if(bmap[(int)(player[8]+0.5)/CELL][(int)(player[7]+0.5)/CELL]==6) + if(bmap[(int)(player[8]+0.5)/CELL][(int)(player[7]+0.5)/CELL]==WL_DETECT) set_emap((int)player[7]/CELL, (int)player[8]/CELL); - if(bmap[(int)(player[16]+0.5)/CELL][(int)(player[15]+0.5)/CELL]==6) + if(bmap[(int)(player[16]+0.5)/CELL][(int)(player[15]+0.5)/CELL]==WL_DETECT) set_emap((int)(player[15]+0.5)/CELL, (int)(player[16]+0.5)/CELL); //Searching for particles near head @@ -3092,7 +3092,7 @@ killed: parts[i].life -= (102-parts[i].life)/2; kill_part(pmap[ny+y][nx+x]>>8); } - if(bmap[(ny+y)/CELL][(nx+x)/CELL]==4) + if(bmap[(ny+y)/CELL][(nx+x)/CELL]==WL_FAN) player[2] = SPC_AIR; } @@ -3523,7 +3523,7 @@ killed: s = 1; break; } - if((pmap[y][j]&255)!=t || (bmap[y/CELL][j/CELL] && bmap[y/CELL][j/CELL]!=5)) + if((pmap[y][j]&255)!=t || (bmap[y/CELL][j/CELL] && bmap[y/CELL][j/CELL]!=WL_STREAM)) break; } if(parts[i].vy>0) @@ -3538,7 +3538,7 @@ killed: parts[i].y += j-y; break; } - if((pmap[j][x]&255)!=t || (bmap[j/CELL][x/CELL] && bmap[j/CELL][x/CELL]!=5)) + if((pmap[j][x]&255)!=t || (bmap[j/CELL][x/CELL] && bmap[j/CELL][x/CELL]!=WL_STREAM)) { s = 0; break; @@ -3689,7 +3689,7 @@ void update_particles(pixel *vid) { for(x=0; x>1)&1; i>1)&1; i>1)&1; i>1)&1; i>1)&1; i>1)&1; i=122&&c<=122+UI_WALLCOUNT) + if(c>=UI_WALLSTART&&c<=UI_WALLSTART+UI_WALLCOUNT) { c = c-100; } @@ -4238,12 +4238,12 @@ int flood_parts(int x, int y, int c, int cm, int bm) } if(bm==-1) { - if(c==30) + if(c==WL_ERASE) { bm = bmap[y/CELL][x/CELL]; if(!bm) return 0; - if(bm==1) + if(bm==WL_WALL) cm = 0xFF; } else @@ -4291,83 +4291,28 @@ int create_parts(int x, int y, float rx, float ry, int c) { int i, j, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0; //n; - if(c == 125) + + int wall = c - 100; + for(int r=UI_ACTUALSTART;r<=UI_ACTUALSTART+UI_WALLCOUNT;r++) { - i = x / CELL; - j = y / CELL; - for(v=-1; v<2; v++) - for(u=-1; u<2; u++) + if(wall==WL_STREAM) + { + i = x / CELL; + j = y / CELL; + for(v=-1; v<2; v++) + for(u=-1; u<2; u++) if(i+u>=0 && i+u=0 && j+v Date: Sun, 21 Nov 2010 01:08:33 -0500 Subject: [PATCH 58/79] Fixed ehole, made wall code use defines, wall specific deletion. --- includes/defines.h | 2 ++ includes/powder.h | 1 + src/graphics.c | 2 +- src/main.c | 39 +++++++++++++++++++++++++++----- src/powder.c | 55 ++++++++++++++++++++++++++++------------------ 5 files changed, 72 insertions(+), 27 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 56c970758..3dba08fff 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -86,6 +86,8 @@ extern int amd; extern int FPSB; +int NUM_PARTS; + extern int legacy_enable; extern int sys_pause; diff --git a/includes/powder.h b/includes/powder.h index 83986bf11..b989de722 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -27,6 +27,7 @@ #define WL_STREAM 25 #define WL_SIGN 26 #define WL_FAN 27 +#define WL_FANHELPER 255 #define WL_ALLOWLIQUID 28 #define WL_DESTROYALL 29 #define WL_ERASE 30 diff --git a/src/graphics.c b/src/graphics.c index b7808d928..8c873d1f7 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2875,7 +2875,7 @@ void render_cursor(pixel *vid, int x, int y, int t, float rx, float ry) else { int tc; - c = (rx/CELL) * CELL; + c = ((int)rx/CELL) * CELL; x = (x/CELL) * CELL; y = (y/CELL) * CELL; diff --git a/src/main.c b/src/main.c index 4e427c984..5a8189bce 100644 --- a/src/main.c +++ b/src/main.c @@ -481,7 +481,36 @@ int parse_save(void *save, int size, int replace, int x0, int y0) for(x=bx0; x=0 && i+u=0 && j+v=0 && i+u=0 && j+v Date: Mon, 22 Nov 2010 15:36:24 -0500 Subject: [PATCH 59/79] floodfill fix, @_@ elements, grav changes color --- includes/defines.h | 8 ++++ includes/powder.h | 16 +++++-- src/graphics.c | 38 +++++++++++++--- src/main.c | 6 +-- src/powder.c | 110 +++++++++++++++++++++++++++++++++++---------- 5 files changed, 141 insertions(+), 37 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 3dba08fff..10f210d2e 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -87,6 +87,13 @@ extern int amd; extern int FPSB; int NUM_PARTS; +int GRAV; +int GRAV_R; +int GRAV_G; +int GRAV_B; +int GRAV_R2; +int GRAV_G2; +int GRAV_B2; extern int legacy_enable; @@ -115,6 +122,7 @@ int MSIGN; int CGOL; int ISGOL; int ISLOVE; +int ISGRAV; int GSPEED; int love[XRES/9][YRES/9]; int gol[XRES][YRES]; diff --git a/includes/powder.h b/includes/powder.h index b989de722..562229399 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -149,7 +149,10 @@ #define PT_FRZZ 100 #define PT_FRZW 101 #define PT_GRAV 102 -#define PT_NUM 103 +#define PT_A_A 103 +#define PT_A_AG 104 +#define PT_A_AS 105 +#define PT_NUM 106 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -343,6 +346,9 @@ static const part_type ptypes[PT_NUM] = {"FRZZ", 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, 50, SC_POWDERS, 90.0f, 46, "FREEZE", TYPE_PART}, {"FRZW", 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, 30, SC_LIQUID, 90.0f, 29, "FREEZE WATER", TYPE_LIQUID}, {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, + {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@", TYPE_LIQUID}, + {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS}, + {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -439,8 +445,8 @@ static part_state pstates[PT_NUM] = /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* Crac */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 22730.0f}, - /* RIME */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 273.15f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* Crac */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 2730.0f}, + /* RIME */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 273.15f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* FOG */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* LOVE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, @@ -451,6 +457,10 @@ static part_state pstates[PT_NUM] = /* FWRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* FRZZ */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* FRZW */ {ST_LIQUID, PT_ICEI, 53.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* GRAV */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* @_@ */ {ST_LIQUID, PT_A_AG, 100.0f, PT_NONE, 0.0f, PT_A_AS, 400.0f, PT_NONE, 0.0f}, + /* @_@g */ {ST_GAS , PT_A_AG, 100.0f, PT_A_A , 273.0f, PT_A_AS, 400.0f, PT_NONE, 0.0f}, + /* @_@s */ {ST_SOLID, PT_A_AG, 100.0f, PT_A_A , 273.0f, PT_A_AS, 400.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { diff --git a/src/graphics.c b/src/graphics.c index 8c873d1f7..03ff5e94f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1495,15 +1495,30 @@ void draw_parts(pixel *vid) cg = 20; cb = 20; if(parts[i].vx>0) - cr += (parts[i].vx)*60; + { + cr += (parts[i].vx)*GRAV_R; + cg += (parts[i].vx)*GRAV_G; + cb += (parts[i].vx)*GRAV_B; + } if(parts[i].vy>0) - cb += (parts[i].vy)*60; + { + cr += (parts[i].vy)*GRAV_G; + cg += (parts[i].vy)*GRAV_B; + cb += (parts[i].vy)*GRAV_R; + + } if(parts[i].vx<0) - cg -= (parts[i].vx)*60; + { + cr -= (parts[i].vx)*GRAV_B; + cg -= (parts[i].vx)*GRAV_R; + cb -= (parts[i].vx)*GRAV_G; + + } if(parts[i].vy<0) { - cr -= (parts[i].vy)*30; - cg -= (parts[i].vy)*30; + cr -= (parts[i].vy)*GRAV_R2; + cg -= (parts[i].vy)*GRAV_G2; + cb -= (parts[i].vy)*GRAV_B2; } if(cr>255) cr=255; @@ -2840,13 +2855,22 @@ corrupt: void render_cursor(pixel *vid, int x, int y, int t, float rx, float ry) { - int i,j,c; + int i,j,c; + float temprx, tempry; if(t1 || ((i*i)/(rx*rx)+((j+1)*(j+1))/(ry*ry)>1))) + if((i*i)/(temprx*temprx)+(j*j)/(tempry*tempry)<=1 && (((i+1)*(i+1))/(temprx*temprx)+(j*j)/(tempry*tempry)>1 || ((i*i)/(temprx*temprx)+((j+1)*(j+1))/(tempry*tempry)>1))) { xor_pixel(x+i, y+j, vid); if(j) xor_pixel(x+i, y-j, vid); diff --git a/src/main.c b/src/main.c index 5a8189bce..3020cbf1f 100644 --- a/src/main.c +++ b/src/main.c @@ -2160,11 +2160,11 @@ int main(int argc, char *argv[]) { #ifdef BETA if(REPLACE_MODE) - sprintf(uitext, "Cracker's Version %d Parts:%d REPLACE MODE", SAVE_VERSION,NUM_PARTS); + sprintf(uitext, "Cracker's V%d FPS:%d Parts:%d REPLACE MODE", SAVE_VERSION, FPS,NUM_PARTS); else if(sdl_mod&(KMOD_CAPS)) - sprintf(uitext, "Cracker's Version %d Parts:%d CAPS LOCK ON", SAVE_VERSION, NUM_PARTS); + sprintf(uitext, "Cracker's V%d FPS:%d Parts:%d CAPS LOCK ON", SAVE_VERSION, FPS, NUM_PARTS); else - sprintf(uitext, "Cracker's Version %d Parts:%d", SAVE_VERSION, NUM_PARTS); + sprintf(uitext, "Cracker's V%d FPS:%d Parts:%d", SAVE_VERSION, FPS, NUM_PARTS); //printf("%s\n", uitext); #else sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); diff --git a/src/powder.c b/src/powder.c index 773d4fdf5..dac227f5b 100644 --- a/src/powder.c +++ b/src/powder.c @@ -852,9 +852,55 @@ void update_particles_i(pixel *vid, int start, int inc) int starti = (start*-1); if(sys_pause&&!framerender) return; - + if(ISGRAV==1) + { + ISGRAV = 0; + GRAV ++; + GRAV_R = 60; + GRAV_G = 0; + GRAV_B = 0; + GRAV_R2 = 30; + GRAV_G2 = 30; + GRAV_B2 = 0; + for(int q = 0;q <= GRAV;q++) + { + if(GRAV_R >0 && GRAV_G==0) + { + GRAV_R--; + GRAV_B++; + } + if(GRAV_B >0 && GRAV_R==0) + { + GRAV_B--; + GRAV_G++; + } + if(GRAV_G >0 && GRAV_B==0) + { + GRAV_G--; + GRAV_R++; + } + if(GRAV_R2 >0 && GRAV_G2==0) + { + GRAV_R2--; + GRAV_B2++; + } + if(GRAV_B2 >0 && GRAV_R2==0) + { + GRAV_B2--; + GRAV_G2++; + } + if(GRAV_G2 >0 && GRAV_B2==0) + { + GRAV_G2--; + GRAV_R2++; + } + } + if(GRAV>180) GRAV = 0; + + } if(ISLOVE==1) { + ISLOVE = 0; for(ny=4;ny=-3) @@ -4231,11 +4280,13 @@ int flood_parts(int x, int y, int c, int cm, int bm) } if(cm==-1) { - if(c==0) + if(c==0) { cm = pmap[y][x]&0xFF; if(!cm) return 0; + if(REPLACE_MODE && cm!=SLALT) + return 0; } else cm = 0; @@ -4293,7 +4344,8 @@ int flood_parts(int x, int y, int c, int cm, int bm) int create_parts(int x, int y, float rx, float ry, int c) { - int i, j, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0; //n; + int i, j, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0; + float tempry, temprx; //n; int wall = c - 100; @@ -4303,7 +4355,10 @@ int create_parts(int x, int y, float rx, float ry, int c) { if(c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM) break; - b = wall; + if(wall == WL_ERASE) + b = 0; + else + b = wall; dw = 1; } } @@ -4358,46 +4413,53 @@ int create_parts(int x, int y, float rx, float ry, int c) } return 1; } + temprx = rx;//fixes windows divided by 0 crashing + tempry = ry; + if(rx == 0) rx = 1; + + if(ry == 0) ry = 1; + if(((sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT))|| sdl_mod & (KMOD_CAPS) )&& !REPLACE_MODE) { - for(j=-ry; j<=ry; j++) - for(i=-rx; i<=rx; i++) + for(j=-tempry; j<=tempry; j++) + for(i=-temprx; i<=temprx; i++) if((CURRENT_BRUSH==CIRCLE_BRUSH && (i*i)/(rx*rx)+(j*j)/(ry*ry)<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=ry*rx)) delete_part(x+i, y+j); return 1; } - if(REPLACE_MODE) - { - for(j=-ry; j<=ry; j++) - for(i=-rx; i<=rx; i++) - if((CURRENT_BRUSH==CIRCLE_BRUSH && (i*i)/(rx*rx)+(j*j)/(ry*ry)<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=ry*rx)) - delete_part(x+i, y+j); - if(c==0) - return 1; - } + if(c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM) { - for(j=-ry; j<=ry; j++) - for(i=-rx; i<=rx; i++) + for(j=-tempry; j<=tempry; j++) + for(i=-temprx; i<=temprx; i++) if((CURRENT_BRUSH==CIRCLE_BRUSH && (i*i)/(rx*rx)+(j*j)/(ry*ry)<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=ry*rx)) create_part(-1, x+i, y+j, c); return 1; } - if(c == 0) + if(c == 0 && !REPLACE_MODE) { stemp = SLALT; SLALT = 0; - for(j=-ry; j<=ry; j++) - for(i=-rx; i<=rx; i++) + for(j=-tempry; j<=tempry; j++) + for(i=-temprx; i<=temprx; i++) if((CURRENT_BRUSH==CIRCLE_BRUSH && (i*i)/(rx*rx)+(j*j)/(ry*ry)<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=ry*rx)) delete_part(x+i, y+j); SLALT = stemp; return 1; } - - for(j=-ry; j<=ry; j++) - for(i=-rx; i<=rx; i++) + if(REPLACE_MODE) //&& c!=0) + { + for(j=-tempry; j<=tempry; j++) + for(i=-temprx; i<=temprx; i++) + if((CURRENT_BRUSH==CIRCLE_BRUSH && (i*i)/(rx*rx)+(j*j)/(ry*ry)<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=ry*rx)) + delete_part(x+i, y+j); + if(c==0) + return 1; + + } + for(j=-tempry; j<=tempry; j++) + for(i=-temprx; i<=temprx; i++) if((CURRENT_BRUSH==CIRCLE_BRUSH && (i*i)/(rx*rx)+(j*j)/(ry*ry)<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=ry*rx)) if(create_part(-1, x+i, y+j, c)==-1) f = 1; From 50f4da5996e14828708788928713735b8de85cb0 Mon Sep 17 00:00:00 2001 From: Philip Date: Mon, 22 Nov 2010 15:54:35 -0500 Subject: [PATCH 60/79] plnt eats smoke and gives off o2. GLAS acts as insulation for acid, kind of --- includes/powder.h | 2 +- src/powder.c | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 562229399..cbe152c75 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -288,7 +288,7 @@ static const part_type ptypes[PT_NUM] = {"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, 45, SC_EXPLOSIVE, R_TEMP+45.0f+273.15f, 170, "Liquid Rubidium.", TYPE_LIQUID|PROP_CONDUCTS}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when hot (More than 100C)", TYPE_SOLID}, {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Sand, Heavy particles. Meltable.", TYPE_PART}, - {"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, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure", TYPE_SOLID | PROP_NEUTPASS}, + {"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, 0, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 150, "Solid. Meltable. Shatters under pressure", TYPE_SOLID | PROP_NEUTPASS}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Semi-conductor. Only conducts electricity when cold (Less than 120C)", TYPE_SOLID}, {"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, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Glass, Heavy particles. Meltable. Bagels.", TYPE_PART}, {"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, 1, SC_ELEC, 9000.0f +273.15f, 251, "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals.", TYPE_ENERGY}, diff --git a/src/powder.c b/src/powder.c index dac227f5b..85ffce69c 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1779,9 +1779,29 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life = 4; t = parts[i].type = PT_FIRE; } + else if((r&0xFF)==PT_SMKE && (1>rand()%250)) + { + parts[r>>8].type = PT_NONE; + parts[i].life = rand()%60 + 60; + } //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) //t = parts[i].type = PT_WATR; } + if(parts[i].life==2) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART) + continue; + if(!r) + create_part(-1,x+nx,y+ny,PT_O2); + } + parts[i].life = 0; + } } else if(t==PT_THRM) { @@ -1939,7 +1959,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_FIRE; parts[r>>8].life = 4; } - else if(((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50) + else if(((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50&&parts_avg(i,r>>8) != PT_GLAS) { parts[i].life--; parts[r>>8].type = PT_NONE; From d89e7e4abe34719a1e2e4375933abeec7fd3b470 Mon Sep 17 00:00:00 2001 From: Philip Date: Tue, 23 Nov 2010 13:28:57 -0500 Subject: [PATCH 61/79] added ISOZ, isotope z, radioactive liquid, reacts with photons, not neutrons.Has a solid form that slowly decays away. uses negative pressure. Instant wire INST, conducts instantly, like walls. Only takes spark from PSCN and only gives it to NSCN. Portal elements. PRTI is the 'in' side, and PRTO is where they come out. you don't need a lot. --- includes/interface.h | 4 +- includes/powder.h | 29 ++++++-- src/powder.c | 168 +++++++++++++++++++++++++++++++++++++++---- 3 files changed, 182 insertions(+), 19 deletions(-) diff --git a/includes/interface.h b/includes/interface.h index 852294537..ded361546 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -51,7 +51,8 @@ static menu_wall mwalls[] = #define SC_LIQUID 4 #define SC_NUCLEAR 7 #define SC_LIFE 9 -#define SC_TOTAL 10 +#define SC_CRACKER 10 +#define SC_TOTAL 11 static menu_section msections[] = { @@ -65,6 +66,7 @@ static menu_section msections[] = {"\xC6", "Radioactive", 0}, {"\xCC", "Special", 0}, {"\xC8", "Life", 0}, + {"\xC8", "Cracker", 0}, }; struct ui_edit diff --git a/includes/powder.h b/includes/powder.h index cbe152c75..1d2c9d4d1 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -152,7 +152,12 @@ #define PT_A_A 103 #define PT_A_AG 104 #define PT_A_AS 105 -#define PT_NUM 106 +#define PT_INST 106 +#define PT_ISOZ 107 +#define PT_ISZS 108 +#define PT_PRTI 109 +#define PT_PRTO 110 +#define PT_NUM 111 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -343,12 +348,17 @@ static const part_type ptypes[PT_NUM] = {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 273.15f, 0, "Moves elements around, read the post on how to use.", TYPE_SOLID}, - {"FRZZ", 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, 50, SC_POWDERS, 90.0f, 46, "FREEZE", TYPE_PART}, - {"FRZW", 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, 30, SC_LIQUID, 90.0f, 29, "FREEZE WATER", TYPE_LIQUID}, + {"FRZZ", 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, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, + {"FRZW", 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, 30, SC_CRACKER, 90.0f, 29, "FREEZE WATER", TYPE_LIQUID}, {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, - {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@", TYPE_LIQUID}, - {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS}, - {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID}, + {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_CRACKER, R_TEMP+0.0f +273.15f, 29, "@_@", TYPE_LIQUID}, + {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS}, + {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID}, + {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls", TYPE_SOLID|PROP_CONDUCTS}, + {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, + {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "thingy solid", TYPE_SOLID}, + {"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID}, + {"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal OUT. Things come out here", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -461,6 +471,11 @@ static part_state pstates[PT_NUM] = /* @_@ */ {ST_LIQUID, PT_A_AG, 100.0f, PT_NONE, 0.0f, PT_A_AS, 400.0f, PT_NONE, 0.0f}, /* @_@g */ {ST_GAS , PT_A_AG, 100.0f, PT_A_A , 273.0f, PT_A_AS, 400.0f, PT_NONE, 0.0f}, /* @_@s */ {ST_SOLID, PT_A_AG, 100.0f, PT_A_A , 273.0f, PT_A_AS, 400.0f, PT_NONE, 0.0f}, + /* INST */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* ISOZ */ {ST_LIQUID, PT_ISZS, 160.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* ISZS */ {ST_SOLID, PT_NONE, 0.0f, PT_ISOZ, 300.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PRTI */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PRTO */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { @@ -491,6 +506,8 @@ static int loverule[9][9] = {0,1,0,0,1,1,0,0,0}, {0,0,1,1,0,0,0,0,0}, }; +int portal[8][20]; + extern int isplayer; extern float player[27]; diff --git a/src/powder.c b/src/powder.c index 85ffce69c..1279ef583 100644 --- a/src/powder.c +++ b/src/powder.c @@ -76,7 +76,8 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) (r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || (r&0xFF)==PT_GLOW || (r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || - ((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) + (r&0xFF)==PT_ISOZ || (r&0xFF)==PT_ISZS || + ((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) return 2; if(pt==PT_STKM) //Stick man's head shouldn't collide @@ -182,6 +183,8 @@ int try_move(int i, int x, int y, int nx, int ny) return 0; } + if((pmap[ny][nx]&0xFF)==PT_CNCT) + return 0; if(parts[i].type==PT_CNCT && y>8].life!=0) return -1; @@ -926,15 +930,19 @@ void update_particles_i(pixel *vid, int start, int inc) for(int nnx=0;nnx<9;nnx++) for(int nny=0;nny<9;nny++) { - rt=pmap[ny+nny][nx+nnx]; - if((rt>>8)>=NPART) + if(ny+nny>0&&ny+nny=0&&nx+nnx>8)>=NPART) + { + continue; + } + if(!rt&&loverule[nnx][nny]==1) + create_part(-1,nx+nnx,ny+nny,PT_LOVE); + if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0) + parts[rt>>8].type=PT_NONE; + } - if(!rt&&loverule[nnx][nny]==1) - create_part(-1,nx+nnx,ny+nny,PT_LOVE); - if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0) - parts[rt>>8].type=PT_NONE; } } love[nx/9][ny/9]=0; @@ -1040,7 +1048,7 @@ void update_particles_i(pixel *vid, int start, int inc) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST) { kill_part(i); continue; @@ -1270,7 +1278,17 @@ void update_particles_i(pixel *vid, int start, int inc) t = PT_NEUT; create_part(i, x, y, t); } - + if((t==PT_ISOZ||t==PT_ISZS) && 1>rand()%200 && ((int)(-4.0f*(pv[y/CELL][x/CELL])))>(rand()%1000)) + { + t = PT_PHOT; + float rr = (rand()%228+128)/127.0f; + float a = (rand()%8) * 0.78540f; + parts[i].life = 680; + parts[i].ctype = 0x3FFFFFFF; + parts[i].vx = rr*cosf(a); + parts[i].vy = rr*sinf(a); + create_part(i, x, y, t); + } if(t==PT_SPRK&&parts[i].ctype==PT_ETRD&&parts[i].life==1) { nearp = nearest_part(i, PT_ETRD); @@ -2060,6 +2078,41 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].vy *= 0.995; } } + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if((r&0xFF)==PT_ISOZ && 5>(rand()%2000)) + { + parts[i].vx *= 0.90; + parts[i].vy *= 0.90; + parts[r>>8].type = PT_PHOT; + float a = (rand()%8) * 0.78540f; + float rr = (rand()%128+128)/127.0f; + parts[r>>8].life = 680; + parts[r>>8].ctype = 0x3FFFFFFF; + parts[r>>8].vx = rr*cosf(a); + parts[r>>8].vy = rr*sinf(a); + pv[y/CELL][x/CELL] -= 15.0f * CFDS; + } + if((r&0xFF)==PT_ISZS && 5>(rand()%2000)) + { + parts[i].vx *= 0.90; + parts[i].vy *= 0.90; + parts[r>>8].type = PT_PHOT; + float rr = (rand()%228+128)/127.0f; + float a = (rand()%8) * 0.78540f; + parts[r>>8].life = 680; + parts[r>>8].ctype = 0x3FFFFFFF; + parts[r>>8].vx = rr*cosf(a); + parts[r>>8].vy = rr*sinf(a); + pv[y/CELL][x/CELL] -= 15.0f * CFDS; + } + } } else if(t==PT_MORT) { create_part(-1, x, y-1, PT_SMKE); @@ -2561,6 +2614,97 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].temp = 0; } } + else if(t==PT_INST) + { + if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF==t) + { + parts[i].tmp = 1;//x + //parts[i].flags = 1;//y + parts[pmap[y-1][x]].flags=1; + parts[pmap[y+1][x]].flags=1; + parts[pmap[y][x-1]].tmp = 1; + parts[pmap[y][x+1]].tmp =1; + } + /*else if(pmap[y-1][x]&0xFF!=t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF==t) + { + parts[i].tmp = 1; + } + else if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF!=t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF==t) + { + parts[i].tmp = 1; + } + else if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF!=t&&pmap[y][x+1]&0xFF==t) + { + parts[i].flags = 1; + } + else if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF!=t) + { + parts[i].flags = 1; + }*/ + for(nx=-2; nx<3; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)) + { + flood_parts(x,y,PT_SPRK,PT_INST,-1); + } + else if(parts[r>>8].type==PT_SPRK&&parts[r>>8].ctype==PT_INST) + { + flood_parts(x,y,PT_SPRK,PT_INST,-1); + } + } + } + else if(t==PT_PRTI) + { + int count =0; + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS)) + for(int nnx=0;nnx<8;nnx++) + if(!portal[count][nnx]) + { + portal[count][nnx] = parts[r>>8].type; + parts[r>>8].type = PT_NONE; + break; + } + } + } + else if(t==PT_PRTO) + { + int count = 0; + for(nx=1; nx>-2; nx--) + for(ny=1; ny>-2; ny--) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || r) + continue; + if(!r) + { + for(int nnx =0 ;nnx<8;nnx++) + if(portal[count][nnx]) + { + create_part(-1,x+nx,y+ny,portal[count][nnx]); + portal[count][nnx] = 0; + break; + } + } + } + } else if(t==PT_PCLN) { for(nx=-2; nx<3; nx++) @@ -2892,7 +3036,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_SPRK && (rt==PT_METL||rt==PT_IRON||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 && (parts[i].life<3 || ((r>>8)=373.0f)&&parts[i].ctype==PT_NTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp<=373.0f)&&parts[i].ctype==PT_PTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN)&&parts[i].ctype==PT_INWR) && pavg != PT_INSL &&!(parts[i].ctype==PT_SWCH&&(rt==PT_PSCN||rt==PT_NSCN)) ) + if(!(rt==PT_PSCN&&parts[i].ctype==PT_NSCN)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp>=373.0f)&&parts[i].ctype==PT_NTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp<=373.0f)&&parts[i].ctype==PT_PTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN)&&parts[i].ctype==PT_INWR) && pavg != PT_INSL &&!(parts[i].ctype==PT_SWCH&&(rt==PT_PSCN||rt==PT_NSCN))&&!(parts[i].ctype==PT_INST&&rt!=PT_NSCN) ) { parts[r>>8].type = PT_SPRK; parts[r>>8].life = 4; From f02d50465617ae37f549c395297f75cb56854a95 Mon Sep 17 00:00:00 2001 From: Philip Date: Wed, 24 Nov 2010 00:42:20 -0500 Subject: [PATCH 62/79] Added PSTE, a colloid element that turns solid under pressure. WTF is now radioactive with neutrons. boom. --- includes/powder.h | 15 +++++++++++---- src/powder.c | 34 +++++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 1d2c9d4d1..0cf3bca52 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -157,7 +157,9 @@ #define PT_ISZS 108 #define PT_PRTI 109 #define PT_PRTO 110 -#define PT_NUM 111 +#define PT_PSTE 111 +#define PT_PSTS 112 +#define PT_NUM 113 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -343,7 +345,7 @@ static const part_type ptypes[PT_NUM] = {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, 243.15f, 100, "Not quite Steam",TYPE_GAS}, {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, - {"WTF", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 251, "WTF for catelite, volume changes with temp", TYPE_LIQUID}, + {"WTF", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, @@ -351,14 +353,17 @@ static const part_type ptypes[PT_NUM] = {"FRZZ", 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, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, {"FRZW", 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, 30, SC_CRACKER, 90.0f, 29, "FREEZE WATER", TYPE_LIQUID}, {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, - {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_CRACKER, R_TEMP+0.0f +273.15f, 29, "@_@", TYPE_LIQUID}, + {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_CRACKER, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS}, {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID}, {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls", TYPE_SOLID|PROP_CONDUCTS}, {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, - {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "thingy solid", TYPE_SOLID}, + {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID}, {"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID}, {"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal OUT. Things come out here", TYPE_SOLID}, + {"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Colloid", TYPE_LIQUID}, + {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "blah blah solid not in the menu", TYPE_SOLID}, + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -476,6 +481,8 @@ static part_state pstates[PT_NUM] = /* ISZS */ {ST_SOLID, PT_NONE, 0.0f, PT_ISOZ, 300.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* PRTI */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* PRTO */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PSTE */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* PSTS */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { diff --git a/src/powder.c b/src/powder.c index 1279ef583..0582f8fec 100644 --- a/src/powder.c +++ b/src/powder.c @@ -945,7 +945,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - love[nx/9][ny/9]=0; + love[nx/9][ny/9]=0; } } } @@ -1006,11 +1006,8 @@ void update_particles_i(pixel *vid, int start, int inc) gol2[nx+nnx][ny+nny][golnum] ++; gol2[nx+nnx][ny+nny][0] ++; } - - } } - } for(nx=4;nx10.0f) t = parts[i].type = PT_BRMT; + if(t==PT_PSTE && pv[y/CELL][x/CELL]>0.5f) + t = parts[i].type = PT_PSTS; + if(t==PT_PSTS && pv[y/CELL][x/CELL]<0.5f) + t = parts[i].type = PT_PSTE; //if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f) // t = parts[i].type = PT_BGLA; if(t==PT_GLAS) @@ -1289,6 +1290,9 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].vy = rr*sinf(a); create_part(i, x, y, t); } + if(t==PT_PSTE) + if(parts[i].temp>747.0f) + t = parts[i].type = PT_BRCK; if(t==PT_SPRK&&parts[i].ctype==PT_ETRD&&parts[i].life==1) { nearp = nearest_part(i, PT_ETRD); @@ -1880,7 +1884,11 @@ void update_particles_i(pixel *vid, int start, int inc) { parts[i].life = 4; t = parts[i].type = PT_FIRE; - + } + if(((r&0xFF)==PT_CNCT&&t==PT_WATR) && 1>(rand()%500)) + { + t = parts[i].type = PT_PSTE; + parts[r>>8].type = PT_NONE; } } } @@ -2026,6 +2034,22 @@ void update_particles_i(pixel *vid, int start, int inc) pv[y/CELL][x/CELL] += 10.0f * CFDS; //Used to be 2, some people said nukes weren't powerful enough fe ++; } + if((r&0xFF)==PT_WTF && (rt+1)>(rand()%1000)) + { + + create_part(r>>8, x+nx, y+ny, PT_NEUT); + parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx; + parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy; + if(parts[r>>8].life>0) + { + parts[r>>8].life --; + parts[r>>8].temp += (parts[r>>8].life*17); + pv[y/CELL][x/CELL] += 6.0f * CFDS; + + } + else + parts[r>>8].type = PT_NONE; + } if((r&0xFF)==PT_GUNP && 15>(rand()%1000)) parts[r>>8].type = PT_DUST; if((r&0xFF)==PT_DYST && 15>(rand()%1000)) From 1eeda3f5cce7cd5f0867ae8945ae49479a43aeef Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Thu, 25 Nov 2010 01:01:28 -0500 Subject: [PATCH 63/79] ANAR, behaves opposite of dust. fix fuse loading, floodfilling of neut/photons. --- includes/powder.h | 11 +++++++---- src/graphics.c | 2 +- src/main.c | 6 ++++-- src/powder.c | 34 +++++++++++++++++++++++++--------- 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 0cf3bca52..268dcf70e 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -141,7 +141,7 @@ #define PT_FOG 92 #define PT_BCLN 93 #define PT_LOVE 94 -#define PT_WTF 95 +#define PT_DEUT 95 #define PT_WARP 96 #define PT_PUMP 97 #define PT_FWRK 98 @@ -159,7 +159,8 @@ #define PT_PRTO 110 #define PT_PSTE 111 #define PT_PSTS 112 -#define PT_NUM 113 +#define PT_ANAR 113 +#define PT_NUM 114 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -345,7 +346,7 @@ static const part_type ptypes[PT_NUM] = {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, 243.15f, 100, "Not quite Steam",TYPE_GAS}, {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, - {"WTF", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, + {"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, @@ -363,7 +364,7 @@ static const part_type ptypes[PT_NUM] = {"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal OUT. Things come out here", TYPE_SOLID}, {"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Colloid", TYPE_LIQUID}, {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "blah blah solid not in the menu", TYPE_SOLID}, - + {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves", TYPE_PART}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -483,6 +484,8 @@ static part_state pstates[PT_NUM] = /* PRTO */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* PSTE */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* PSTS */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* ANAR */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + }; static int grule[NGOL][9] = { diff --git a/src/graphics.c b/src/graphics.c index 03ff5e94f..b63ea7bec 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1428,7 +1428,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx, ny, cr, cg, cb, 255); } - else if(t==PT_WTF) + else if(t==PT_DEUT) { if(parts[i].life>=700&&(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)) diff --git a/src/main.c b/src/main.c index 3020cbf1f..b12dc253f 100644 --- a/src/main.c +++ b/src/main.c @@ -559,8 +559,10 @@ int parse_save(void *save, int size, int replace, int x0, int y0) else if(i < nf) { parts[fp[i]].type = j; - if(j == PT_COAL) - parts[fp[i]].tmp = 50; + if(j == PT_COAL) + parts[fp[i]].tmp = 50; + if(j == PT_FUSE) + parts[fp[i]].tmp = 50; if(j == PT_PHOT) parts[fp[i]].ctype = 0x3fffffff; parts[fp[i]].x = (float)x; diff --git a/src/powder.c b/src/powder.c index 0582f8fec..59ef37ff1 100644 --- a/src/powder.c +++ b/src/powder.c @@ -545,7 +545,7 @@ inline int create_part(int p, int x, int y, int t) parts[i].vy = 3.0f*sinf(a); } - if(t!=PT_STKM && t!=PT_PHOT && t!=PT_NEUT) + if(t!=PT_STKM)// && t!=PT_PHOT && t!=PT_NEUT) is this needed? it breaks floodfill pmap[y][x] = t|(i<<8); else if(t==PT_STKM) { @@ -1041,7 +1041,7 @@ void update_particles_i(pixel *vid, int start, int inc) ly = parts[i].y; t = parts[i].type; - if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL && t!=PT_CRAC && t!=PT_WTF) + if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL && t!=PT_CRAC && t!=PT_DEUT) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) parts[i].life--; @@ -1093,8 +1093,16 @@ void update_particles_i(pixel *vid, int start, int inc) vx[y/CELL][x/CELL] *= ptypes[t].airloss; vy[y/CELL][x/CELL] *= ptypes[t].airloss; - vx[y/CELL][x/CELL] += ptypes[t].airdrag*parts[i].vx; - vy[y/CELL][x/CELL] += ptypes[t].airdrag*parts[i].vy; + if(t==PT_ANAR) + { + vx[y/CELL][x/CELL] -= ptypes[t].airdrag*parts[i].vx; + vy[y/CELL][x/CELL] -= ptypes[t].airdrag*parts[i].vy; + } + else + { + vx[y/CELL][x/CELL] += ptypes[t].airdrag*parts[i].vx; + vy[y/CELL][x/CELL] += ptypes[t].airdrag*parts[i].vy; + } if(t==PT_GAS||t==PT_NBLE||t==PT_PUMP) { if(t==PT_PUMP) @@ -1166,8 +1174,16 @@ void update_particles_i(pixel *vid, int start, int inc) } else { + if(t==PT_ANAR) + { + parts[i].vx -= ptypes[t].advection*vx[y/CELL][x/CELL]; + parts[i].vy -= ptypes[t].advection*vy[y/CELL][x/CELL] + ptypes[t].gravity; + } + else{ parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL]; parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + ptypes[t].gravity; + + } } if(ptypes[t].diffusion) @@ -2034,7 +2050,7 @@ void update_particles_i(pixel *vid, int start, int inc) pv[y/CELL][x/CELL] += 10.0f * CFDS; //Used to be 2, some people said nukes weren't powerful enough fe ++; } - if((r&0xFF)==PT_WTF && (rt+1)>(rand()%1000)) + if((r&0xFF)==PT_DEUT && (rt+1)>(rand()%1000)) { create_part(r>>8, x+nx, y+ny, PT_NEUT); @@ -2292,7 +2308,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - else if(t==PT_WTF) + else if(t==PT_DEUT) { int maxlife = ((10000/(parts[i].temp + 1))-1); if((10000%((int)parts[i].temp+1))>rand()%((int)parts[i].temp+1)) @@ -2306,7 +2322,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r || (parts[i].life >=maxlife)) continue; - if(parts[r>>8].type==PT_WTF&&33>=rand()/(RAND_MAX/100)+1) + if(parts[r>>8].type==PT_DEUT&&33>=rand()/(RAND_MAX/100)+1) { if((parts[i].life + parts[r>>8].life + 1) <= maxlife) { @@ -2327,9 +2343,9 @@ void update_particles_i(pixel *vid, int start, int inc) if((bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALLELEC||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_EWALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_DESTROYALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALL|| bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWAIR||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWSOLID||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWGAS)) continue; - if((!r)&&parts[i].life>=1)//if nothing then create wtf + if((!r)&&parts[i].life>=1)//if nothing then create deut { - create_part(-1,x+nx,y+ny,PT_WTF); + create_part(-1,x+nx,y+ny,PT_DEUT); parts[i].life--; parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; } From 3b4caf409dd6894650de0c4e2c806bcf59a806e1 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Fri, 26 Nov 2010 00:57:55 -0500 Subject: [PATCH 64/79] INST wire now can cross itself like walls, so it can be used exactly like them in a MUCH smaller space. --- src/powder.c | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/powder.c b/src/powder.c index 59ef37ff1..5a2ab1f56 100644 --- a/src/powder.c +++ b/src/powder.c @@ -2693,10 +2693,6 @@ void update_particles_i(pixel *vid, int start, int inc) { flood_parts(x,y,PT_SPRK,PT_INST,-1); } - else if(parts[r>>8].type==PT_SPRK&&parts[r>>8].ctype==PT_INST) - { - flood_parts(x,y,PT_SPRK,PT_INST,-1); - } } } else if(t==PT_PRTI) @@ -4478,6 +4474,9 @@ 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) { c = c-100; @@ -4533,6 +4532,40 @@ int flood_parts(int x, int y, int c, int cm, int bm) return 0; // fill children + if(cm==PT_INST&&co==PT_SPRK) + { + if(y>=CELL+dy && x1==x2 && + ((pmap[y-1][x1-1]&0xFF)==PT_INST||(pmap[y-1][x1-1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1]&0xFF)==PT_INST||(pmap[y-1][x1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1+1]&0xFF)==PT_INST || (pmap[y-1][x1+1]&0xFF)==PT_SPRK) && + (pmap[y-2][x1-1]&0xFF)!=PT_INST && ((pmap[y-2][x1]&0xFF)==PT_INST ||(pmap[y-2][x1]&0xFF)==PT_SPRK) && (pmap[y-2][x1+1]&0xFF)!=PT_INST) + flood_parts(x1, y-2, co, cm, bm); + else if(y>=CELL+dy) + for(x=x1; x<=x2; x++) + if((pmap[y-1][x]&0xFF)!=PT_SPRK) + { + if(x==x1 || x==x2 || y>=YRES-CELL-1 || + (pmap[y-1][x-1]&0xFF)==PT_INST || (pmap[y-1][x+1]&0xFF)==PT_INST || + (pmap[y+1][x-1]&0xFF)==PT_INST || ((pmap[y+1][x]&0xFF)!=PT_INST&&(pmap[y+1][x]&0xFF)!=PT_SPRK) || (pmap[y+1][x+1]&0xFF)==PT_INST) + flood_parts(x, y-dy, co, cm, bm); + + } + + if(y=CELL+dy) for(x=x1; x<=x2; x++) if((pmap[y-dy][x]&0xFF)==cm && bmap[(y-dy)/CELL][x/CELL]==bm) @@ -4543,7 +4576,9 @@ int flood_parts(int x, int y, int c, int cm, int bm) if((pmap[y+dy][x]&0xFF)==cm && bmap[(y+dy)/CELL][x/CELL]==bm) if(!flood_parts(x, y+dy, co, cm, bm)) return 0; - return 1; + } + if(!(cm==PT_INST&&co==PT_SPRK)) + return 1; } int create_parts(int x, int y, float rx, float ry, int c) From 77a17ecaeedb2e7e505527848e8bf4d1465ac529 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Sun, 28 Nov 2010 16:58:57 -0500 Subject: [PATCH 65/79] VINE, plant grows up the side of WOOD. INST wire is now also a battery and will charge if it doesn't give off a spark right away. Will give spark to NSCN or SWCH that is on. found some more wall defines i missed. moved wall code up 100 numbers. INVS, solid that turns invisible to elements when under pressure. --- includes/powder.h | 62 ++++++++++++------- src/graphics.c | 38 ++++++------ src/interface.c | 38 +++++++----- src/powder.c | 150 ++++++++++++++++++++++++++++------------------ 4 files changed, 172 insertions(+), 116 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 268dcf70e..9ae0302cb 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -17,32 +17,32 @@ #define CM_VEL 0 -#define UI_WALLSTART 122 -#define UI_ACTUALSTART 22 +#define UI_WALLSTART 222 +#define UI_ACTUALSTART 122 #define UI_WALLCOUNT 19 -#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_WALLELEC 122 +#define WL_EWALL 123 +#define WL_DETECT 124 +#define WL_STREAM 125 +#define WL_SIGN 126 +#define WL_FAN 127 #define WL_FANHELPER 255 -#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_ALLOWLIQUID 128 +#define WL_DESTROYALL 129 +#define WL_ERASE 130 +#define WL_WALL 131 +#define WL_ALLOWAIR 132 +#define WL_ALLOWSOLID 133 +#define WL_ALLOWALLELEC 134 +#define WL_EHOLE 135 -#define SPC_AIR 136 -#define SPC_HEAT 137 -#define SPC_COOL 138 -#define SPC_VACUUM 139 +#define SPC_AIR 236 +#define SPC_HEAT 237 +#define SPC_COOL 238 +#define SPC_VACUUM 239 -#define WL_ALLOWGAS 40 +#define WL_ALLOWGAS 140 @@ -160,7 +160,12 @@ #define PT_PSTE 111 #define PT_PSTS 112 #define PT_ANAR 113 -#define PT_NUM 114 +#define PT_VINE 114 +#define PT_INVIS 115 +#define PT_EQUALVEL 116//all particles equal their velocities +#define PT_INST2 117 +#define PT_INST3 118 +#define PT_NUM 119 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -357,7 +362,7 @@ static const part_type ptypes[PT_NUM] = {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_CRACKER, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS}, {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID}, - {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls", TYPE_SOLID|PROP_CONDUCTS}, + {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery.", TYPE_SOLID|PROP_CONDUCTS}, {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID}, {"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID}, @@ -365,6 +370,12 @@ static const part_type ptypes[PT_NUM] = {"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Colloid", TYPE_LIQUID}, {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "blah blah solid not in the menu", TYPE_SOLID}, {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves", TYPE_PART}, + {"VINE", PIXPACK(0x0A9C00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 65, "Vine, not in menu", TYPE_SOLID}, + {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, + {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, + {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, + {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -485,6 +496,11 @@ static part_state pstates[PT_NUM] = /* PSTE */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* PSTS */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* ANAR */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* VINE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 573.0f}, + /* INVS */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* EQVE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* INST2*/ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* INST3*/ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = diff --git a/src/graphics.c b/src/graphics.c index b63ea7bec..d74651e8d 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -447,7 +447,7 @@ void draw_tool(pixel *vid_buf, int b, int sl, int sr, unsigned pc, unsigned iswa int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) { int i, j, c; - if(b>=121) + if(b>=UI_WALLSTART) { b = b-100; //x = (2+32*((b-22)/1)); @@ -470,7 +470,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 23: + case WL_EWALL: for(j=1; j<15; j++) { for(i=1; i<6+j; i++) @@ -489,7 +489,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 24: + case WL_DETECT: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -498,7 +498,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 25: + case WL_STREAM: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -512,7 +512,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) drawpixel(vid_buf, x+i, y+8+(int)(3.9f*cos(i*0.3f)), 255, 255, 255, 255); } break; - case 26: + case WL_SIGN: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -523,7 +523,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) drawtext(vid_buf, x+9, y+3, "\xA1", 32, 64, 128, 255); drawtext(vid_buf, x+9, y+3, "\xA0", 255, 255, 255, 255); break; - case 27: + case WL_FAN: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -532,7 +532,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 28: + case WL_ALLOWLIQUID: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -544,7 +544,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 29: + case WL_DESTROYALL: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -553,7 +553,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 30: + case WL_ERASE: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<13; i+=2) @@ -569,7 +569,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 32: + case WL_ALLOWAIR: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -578,7 +578,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 33: + case WL_ALLOWSOLID: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -587,7 +587,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 34: + case WL_ALLOWALLELEC: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -599,7 +599,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 36: + case SPC_AIR-100: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -618,7 +618,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } drawtext(vid_buf, x+14-textwidth("AIR")/2, y+4, "AIR", c, c, c, 255); break; - case 37: + case SPC_HEAT-100: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -637,7 +637,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } drawtext(vid_buf, x+14-textwidth("HEAT")/2, y+4, "HEAT", c, c, c, 255); break; - case 38: + case SPC_COOL-100: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -656,7 +656,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } drawtext(vid_buf, x+14-textwidth("COOL")/2, y+4, "COOL", c, c, c, 255); break; - case 39: + case SPC_VACUUM-100: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -675,7 +675,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } drawtext(vid_buf, x+14-textwidth("VAC")/2, y+4, "VAC", c, c, c, 255); break; - case 40: + case WL_ALLOWGAS: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -693,7 +693,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } } - if(b==30) + if(b==WL_ERASE) { for(j=4; j<12; j++) { @@ -1586,6 +1586,8 @@ void draw_parts(pixel *vid) } + else if(t==PT_INVIS && (pv[ny/CELL][nx/CELL]>4.0f ||pv[ny/CELL][nx/CELL]<-4.0f)) + blendpixel(vid, nx, ny, 15, 0, 150, 100); else if(t==PT_ACID) { if(parts[i].life>255) parts[i].life = 255; diff --git a/src/interface.c b/src/interface.c index 6df2ae5df..a4ecc8f04 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1646,9 +1646,9 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { drawtext(vid_buf, XRES-textwidth((char *)msections[i].name)-BARSIZE, sy-10, (char *)msections[i].name, 255, 255, 255, 255); } - else if(i==SC_WALL||(i==SC_SPECIAL&&h>=122)) + else if(i==SC_WALL||(i==SC_SPECIAL&&h>=UI_WALLSTART)) { - drawtext(vid_buf, XRES-textwidth((char *)mwalls[h-122].descs)-BARSIZE, sy-10, (char *)mwalls[h-122].descs, 255, 255, 255, 255); + drawtext(vid_buf, XRES-textwidth((char *)mwalls[h-UI_WALLSTART].descs)-BARSIZE, sy-10, (char *)mwalls[h-UI_WALLSTART].descs, 255, 255, 255, 255); } else { @@ -2756,15 +2756,16 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) //Draw the score bars if(info->voteup>0||info->votedown>0) { - lv = (info->voteup>info->votedown?info->voteup:info->votedown); - + lv = (info->voteup>info->votedown)?info->voteup:info->votedown; + lv = (lv>10)?lv:10; + if(50>lv) { ry = ((float)(50)/(float)lv); - if(lv<8) - { - ry = ry/(8-lv); - } + //if(lv<8) + //{ + // ry = ry/(8-lv); + //} nyu = info->voteup*ry; nyd = info->votedown*ry; } @@ -2774,11 +2775,13 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) nyu = info->voteup/ry; nyd = info->votedown/ry; } + nyu = nyu>50?50:nyu; + nyd = nyd>50?50:nyd; - fillrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+53, 54, 6, 0, 107, 10, 255); - fillrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+59, 54, 6, 107, 10, 0, 255); - drawrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+53, 54, 6, 128, 128, 128, 255); - drawrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+59, 54, 6, 128, 128, 128, 255); + fillrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+53, 52, 6, 0, 107, 10, 255); + fillrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+59, 52, 6, 107, 10, 0, 255); + drawrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+53, 52, 6, 128, 128, 128, 255); + drawrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+59, 52, 6, 128, 128, 128, 255); fillrect(vid_buf, 48+(XRES/2)-nyu, (YRES/2)+54, nyu, 4, 57, 187, 57, 255); fillrect(vid_buf, 48+(XRES/2)-nyd, (YRES/2)+60, nyd, 4, 187, 57, 57, 255); @@ -2790,7 +2793,9 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) ccy += 12; ccy += drawtextwrap(vid_buf, 60+(XRES/2)+1, ccy+60, XRES+BARSIZE-100-((XRES/2)+1)-20, info->comments[cc], 255, 255, 255, 185); ccy += 10; - draw_line(vid_buf, 50+(XRES/2)+2, ccy+52, XRES+BARSIZE-50, ccy+52, 100, 100, 100, XRES+BARSIZE); + if(ccy+52author, svf_user); @@ -2917,8 +2922,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) execute_submit(vid_buf, save_id, ed.str); } } - - if(!(mx>50 && my>50 && mx50 && my>50 && mx= PT_NUM || (ptypes[(r&0xFF)].properties&TYPE_ENERGY)))) - if(ptypes[pt].properties&TYPE_ENERGY && ptypes[(r&0xFF)].properties&TYPE_ENERGY) - return 2; + if(ptypes[pt].properties&TYPE_ENERGY && ptypes[(r&0xFF)].properties&TYPE_ENERGY) + return 2; - //if(pt==PT_NEUT && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE)))) - if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPASS) - return 2; - if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE) - return 1; - if((r&0xFF)==PT_NEUT && ptypes[pt].properties&PROP_NEUTPENETRATE) - return 0; + if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPASS) + return 2; + if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE) + return 1; + if((r&0xFF)==PT_NEUT && ptypes[pt].properties&PROP_NEUTPENETRATE) + return 0; } if (r && ((r&0xFF) >= PT_NUM || (ptypes[pt].weight <= ptypes[(r&0xFF)].weight))) @@ -132,7 +128,8 @@ int try_move(int i, int x, int y, int nx, int ny) return 1; e = eval_move(parts[i].type, nx, ny, &r); - + if((pmap[ny][nx]&0xFF)==PT_INVIS && (pv[ny/CELL][nx/CELL]>4.0f ||pv[ny/CELL][nx/CELL]<-4.0f)) + return 1; /* half-silvered mirror */ if(!e && parts[i].type==PT_PHOT && (((r&0xFF)==PT_BMTL && rand()>8].type = PT_INST2; + parts[pmap[y][x]>>8].life += 5; + pmap[y][x] = (pmap[y][x]&~0xFF) | PT_INST2; + return pmap[y][x]>>8; + } + if(t==PT_INST3) + if((pmap[y][x]&0xFF)==PT_INST||(pmap[y][x]&0xFF)==PT_INST2) + { + parts[pmap[y][x]>>8].type = PT_INST3; + if(parts[pmap[y][x]>>8].life%4==0) + parts[pmap[y][x]>>8].life -=0; + else + parts[pmap[y][x]>>8].life -= 2; + pmap[y][x] = (pmap[y][x]&~0xFF) | PT_INST3; + return pmap[y][x]>>8; + } if(t==SPC_AIR) { pv[y/CELL][x/CELL] += 0.03f; @@ -444,8 +460,7 @@ inline int create_part(int p, int x, int y, int t) (pmap[y][x]&0xFF)!=PT_BRMT && (pmap[y][x]&0xFF)!=PT_NBLE && (pmap[y][x]&0xFF)!=PT_IRON && - (pmap[y][x]&0xFF)!=PT_INWR && - (pmap[y][x]&0xFF)!=PT_INST) + (pmap[y][x]&0xFF)!=PT_INWR) return -1; if(parts[pmap[y][x]>>8].life!=0) return -1; @@ -1043,7 +1058,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL && t!=PT_CRAC && t!=PT_DEUT) { - if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC))) + if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC)) && !(parts[i].life%4==0 && parts[i].type==PT_INST)) parts[i].life--; if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST) { @@ -1063,6 +1078,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life = 64; if(t == PT_SLTW) parts[i].life = 54; + if(t == PT_SWCH) + parts[i].life = 15; } } @@ -1283,7 +1300,7 @@ void update_particles_i(pixel *vid, int start, int inc) { parts[i].pavg[0] = parts[i].pavg[1]; parts[i].pavg[1] = pv[y/CELL][x/CELL]; - if(parts[i].pavg[1]-parts[i].pavg[0] > 0.05f || parts[i].pavg[1]-parts[i].pavg[0] < -0.05f) + if(parts[i].pavg[1]-parts[i].pavg[0] > 0.25f || parts[i].pavg[1]-parts[i].pavg[0] < -0.25f) { parts[i].type = PT_BGLA; } @@ -1822,6 +1839,10 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_NONE; parts[i].life = rand()%60 + 60; } + else if((r&0xFF)==PT_WOOD && (1>rand()%20) && abs(nx+ny)<=2) + { + create_part(-1,(x+nx)+(rand()%3)-1,(y+ny)+(rand()%3)-1,PT_VINE); + } //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) //t = parts[i].type = PT_WATR; } @@ -1841,6 +1862,25 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life = 0; } } + else if(t==PT_VINE) + { + nx=(rand()%3)-1; + ny=(rand()%3)-1; + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART) + continue; + if(1>rand()%15) + parts[i].type=PT_PLNT; + else if(!r) + { + create_part(-1,x+nx,y+ny,PT_VINE); + parts[i].type=PT_PLNT; + } + } + } else if(t==PT_THRM) { for(nx=-2; nx<3; nx++) @@ -2656,31 +2696,6 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_INST) { - if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF==t) - { - parts[i].tmp = 1;//x - //parts[i].flags = 1;//y - parts[pmap[y-1][x]].flags=1; - parts[pmap[y+1][x]].flags=1; - parts[pmap[y][x-1]].tmp = 1; - parts[pmap[y][x+1]].tmp =1; - } - /*else if(pmap[y-1][x]&0xFF!=t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF==t) - { - parts[i].tmp = 1; - } - else if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF!=t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF==t) - { - parts[i].tmp = 1; - } - else if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF!=t&&pmap[y][x+1]&0xFF==t) - { - parts[i].flags = 1; - } - else if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF!=t) - { - parts[i].flags = 1; - }*/ for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) if(x+nx>=0 && y+ny>0 && @@ -2689,12 +2704,28 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)) + else if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)&&(parts[r>>8].life>=3)&&parts[i].life%4==0) { - flood_parts(x,y,PT_SPRK,PT_INST,-1); + flood_parts(x,y,PT_INST2,PT_INST,-1); + } + else if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0&&(parts[i].life>=4)&&parts[i].life%4<=1) + { + create_part(-1,x+nx,y+ny,PT_SPRK); + flood_parts(x,y,PT_INST3,PT_INST,-1); + } + else if(parts[r>>8].type==PT_SWCH&&parts[r>>8].life==10&&(parts[i].life>=4)&&parts[i].life%4<=1) + { + parts[r>>8].type=PT_SPRK; + parts[r>>8].ctype=PT_SWCH; + parts[r>>8].life=4; + flood_parts(x,y,PT_INST3,PT_INST,-1); } } } + else if(t==PT_INST2 || t==PT_INST3) + { + t = parts[pmap[y][x]>>8].type=PT_INST; + } else if(t==PT_PRTI) { int count =0; @@ -3146,7 +3177,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].temp = 3500; pv[y/CELL][x/CELL] += 1; } - if(t==PT_SPRK&&parts[i].ctype==PT_SWCH&&parts[i].life<=1) + if(t==PT_SPRK&&parts[i].ctype==PT_SWCH&&parts[i].life<=0) { parts[i].type = PT_SWCH; parts[i].life = 14; @@ -4474,8 +4505,8 @@ 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) { @@ -4528,38 +4559,39 @@ int flood_parts(int x, int y, int c, int cm, int bm) // fill span for(x=x1; x<=x2; x++) + { if(!create_parts(x, y, 0, 0, co)) return 0; - + } // fill children - if(cm==PT_INST&&co==PT_SPRK) + if(cm==PT_INST&&(co==PT_INST2||co==PT_INST3)) { if(y>=CELL+dy && x1==x2 && - ((pmap[y-1][x1-1]&0xFF)==PT_INST||(pmap[y-1][x1-1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1]&0xFF)==PT_INST||(pmap[y-1][x1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1+1]&0xFF)==PT_INST || (pmap[y-1][x1+1]&0xFF)==PT_SPRK) && - (pmap[y-2][x1-1]&0xFF)!=PT_INST && ((pmap[y-2][x1]&0xFF)==PT_INST ||(pmap[y-2][x1]&0xFF)==PT_SPRK) && (pmap[y-2][x1+1]&0xFF)!=PT_INST) + ((pmap[y-1][x1-1]&0xFF)==PT_INST||((pmap[y-1][x1-1]&0xFF)==PT_INST3||(pmap[y-1][x1-1]&0xFF)==PT_INST2)) && ((pmap[y-1][x1]&0xFF)==PT_INST||((pmap[y-1][x1]&0xFF)==PT_INST3||(pmap[y-1][x1]&0xFF)==PT_INST2)) && ((pmap[y-1][x1+1]&0xFF)==PT_INST || ((pmap[y-1][x1+1]&0xFF)==PT_INST3||(pmap[y-1][x1+1]&0xFF)==PT_INST2)) && + (pmap[y-2][x1-1]&0xFF)!=PT_INST && ((pmap[y-2][x1]&0xFF)==PT_INST ||((pmap[y-2][x1]&0xFF)==PT_INST3||(pmap[y-2][x1]&0xFF)==PT_INST2)) && (pmap[y-2][x1+1]&0xFF)!=PT_INST) flood_parts(x1, y-2, co, cm, bm); else if(y>=CELL+dy) for(x=x1; x<=x2; x++) - if((pmap[y-1][x]&0xFF)!=PT_SPRK) + if((pmap[y-1][x]&0xFF)!=co) { if(x==x1 || x==x2 || y>=YRES-CELL-1 || (pmap[y-1][x-1]&0xFF)==PT_INST || (pmap[y-1][x+1]&0xFF)==PT_INST || - (pmap[y+1][x-1]&0xFF)==PT_INST || ((pmap[y+1][x]&0xFF)!=PT_INST&&(pmap[y+1][x]&0xFF)!=PT_SPRK) || (pmap[y+1][x+1]&0xFF)==PT_INST) + (pmap[y+1][x-1]&0xFF)==PT_INST || ((pmap[y+1][x]&0xFF)!=PT_INST&&(pmap[y+1][x]&0xFF)!=co) || (pmap[y+1][x+1]&0xFF)==PT_INST) flood_parts(x, y-dy, co, cm, bm); } if(y= 0.5f) { y += sy; - if(c==135 || c==140 || c==134 || c==133 || c==132 || c==131 || c==129 || c==128 || c==127 || c==125 || c==124 || c==123 || c==122 || !(rx+ry)) + if(c==WL_EHOLE || c==WL_ALLOWGAS || c==WL_ALLOWALLELEC || c==WL_ALLOWSOLID || c==WL_ALLOWAIR || c==WL_WALL || c==WL_DESTROYALL || c==WL_ALLOWLIQUID || c==WL_FAN || c==WL_STREAM || c==WL_DETECT || c==WL_EWALL || c==WL_WALLELEC || !(rx+ry)) { if(cp) create_parts(y, x, rx, ry, c); From bb16ffa2bbef12d8a8b1c151b3d987e272420675 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Mon, 29 Nov 2010 22:42:36 -0500 Subject: [PATCH 66/79] PUMP is now powered and blue, fixed some wall probems, portals are more random, maybe fixed love for mac? --- includes/powder.h | 4 +-- src/graphics.c | 16 +++++++++ src/main.c | 6 ++-- src/powder.c | 83 ++++++++++++++++++++++++++++++++++++++--------- 4 files changed, 89 insertions(+), 20 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 9ae0302cb..ffb4ee34a 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -353,7 +353,7 @@ static const part_type ptypes[PT_NUM] = {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, {"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, - {"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, + {"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 273.15f, 0, "Moves elements around, read the post on how to use.", TYPE_SOLID}, {"FRZZ", 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, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, @@ -370,7 +370,7 @@ static const part_type ptypes[PT_NUM] = {"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Colloid", TYPE_LIQUID}, {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "blah blah solid not in the menu", TYPE_SOLID}, {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves", TYPE_PART}, - {"VINE", PIXPACK(0x0A9C00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 65, "Vine, not in menu", TYPE_SOLID}, + {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 65, "Vine, not in menu", TYPE_SOLID}, {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, diff --git a/src/graphics.c b/src/graphics.c index d74651e8d..81bc75665 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2086,6 +2086,22 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny+1, GR, 10, 10, 112); } } + else if(t==PT_PUMP) + { + uint8 GR = 0x3B+(parts[i].life*19); + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(10, 10, GR); + if(cmode == CM_BLOB) { + blendpixel(vid, nx+1, ny, 10, 10, GR, 223); + blendpixel(vid, nx-1, ny, 10, 10, GR, 223); + blendpixel(vid, nx, ny+1, 10, 10, GR, 223); + blendpixel(vid, nx, ny-1, 10, 10, GR, 223); + + blendpixel(vid, nx+1, ny-1, 10, 10, GR, 112); + blendpixel(vid, nx-1, ny-1, 10, 10, GR, 112); + blendpixel(vid, nx+1, ny+1, 10, 10, GR, 112); + blendpixel(vid, nx-1, ny+1, 10, 10, GR, 112); + } + } else if(t==PT_PLSM) { float ttemp = (float)parts[i].life; diff --git a/src/main.c b/src/main.c index b12dc253f..ebb39ba64 100644 --- a/src/main.c +++ b/src/main.c @@ -1895,7 +1895,7 @@ int main(int argc, char *argv[]) { c = (b&1) ? sl : sr; su = c; - if(c==126) + if(c==WL_SIGN+100) { if(!bq) add_sign_ui(vid_buf, x, y); @@ -1905,7 +1905,7 @@ int main(int argc, char *argv[]) if(lm == 1) { xor_line(lx, ly, x, y, vid_buf); - if(c==127 && lx>=0 && ly>=0 && lx=0 && ly>=0 && lx=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=WL_FAN) + if(c!=WL_FAN+100 || lx<0 || ly<0 || lx>=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=WL_FAN) create_line(lx, ly, x, y, bsx, bsy, c); } else diff --git a/src/powder.c b/src/powder.c index bd0b7e6d2..32dc3a9c2 100644 --- a/src/powder.c +++ b/src/powder.c @@ -515,6 +515,8 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = 50; parts[i].tmp = 50; } + if(t==PT_PUMP) + parts[i].life= 10; if(t==PT_FSEP) parts[i].life = 50; if(t==PT_COAL) { @@ -954,7 +956,7 @@ void update_particles_i(pixel *vid, int start, int inc) } if(!rt&&loverule[nnx][nny]==1) create_part(-1,nx+nnx,ny+nny,PT_LOVE); - if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0) + else if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0) parts[rt>>8].type=PT_NONE; } @@ -1058,9 +1060,9 @@ void update_particles_i(pixel *vid, int start, int inc) if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL && t!=PT_CRAC && t!=PT_DEUT) { - if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC)) && !(parts[i].life%4==0 && parts[i].type==PT_INST)) + if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC||parts[i].type==PT_PUMP)) && !(parts[i].life%4==0 && parts[i].type==PT_INST)) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_PUMP && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST) { kill_part(i); continue; @@ -1122,7 +1124,7 @@ void update_particles_i(pixel *vid, int start, int inc) } if(t==PT_GAS||t==PT_NBLE||t==PT_PUMP) { - if(t==PT_PUMP) + if(t==PT_PUMP && parts[i].life==10) { if(parts[i].temp>=256.0+273.15) parts[i].temp=256.0+273.15; @@ -1130,14 +1132,14 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].temp = -256.0+273.15; if(pv[y/CELL][x/CELL]<(parts[i].temp-273.15)) - pv[y/CELL][x/CELL] += ptypes[t].hotair*((parts[i].temp-273.15)-pv[y/CELL][x/CELL]); + pv[y/CELL][x/CELL] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL][x/CELL]); if(y+CELL>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)&&(parts[r>>8].life>=3)&&parts[i].life%4==0) { flood_parts(x,y,PT_INST2,PT_INST,-1); + parts[r>>8].type==parts[r>>8].ctype; } else if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0&&(parts[i].life>=4)&&parts[i].life%4<=1) { @@ -2720,11 +2723,19 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].life=4; flood_parts(x,y,PT_INST3,PT_INST,-1); } + //else if(parts[r>>8].type==PT_INST&&parts[r>>8].life%4==0&&parts[r>>8].life>parts[i].life) + //parts[i].life --; } } - else if(t==PT_INST2 || t==PT_INST3) + else if(t==PT_INST2) { - t = parts[pmap[y][x]>>8].type=PT_INST; + if(parts[i].life%4==0) + t = parts[pmap[y][x]>>8].type=PT_INST; + } + else if(t==PT_INST3) + { + if(parts[i].life%4!=0) + t = parts[pmap[y][x]>>8].type=PT_INST; } else if(t==PT_PRTI) { @@ -2740,9 +2751,9 @@ void update_particles_i(pixel *vid, int start, int inc) continue; if(parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS)) for(int nnx=0;nnx<8;nnx++) - if(!portal[count][nnx]) + if(!portal[count-1][nnx]) { - portal[count][nnx] = parts[r>>8].type; + portal[count-1][nnx] = parts[r>>8].type; parts[r>>8].type = PT_NONE; break; } @@ -2763,12 +2774,19 @@ void update_particles_i(pixel *vid, int start, int inc) if(!r) { for(int nnx =0 ;nnx<8;nnx++) - if(portal[count][nnx]) + { + int randomness = count + rand()%3-1; + if(randomness<1) + randomness=1; + if(randomness>8) + randomness=8; + if(portal[randomness-1][nnx]) { - create_part(-1,x+nx,y+ny,portal[count][nnx]); - portal[count][nnx] = 0; + create_part(-1,x+nx,y+ny,portal[randomness-1][nnx]); + portal[randomness-1][nnx] = 0; break; } + } } } } @@ -2842,6 +2860,41 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_PUMP) + { + for(nx=-2; nx<3; nx++) + for(ny=-2; ny<3; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + rt = parts[r>>8].type; + if(rt==PT_SPRK) + { + if(parts[r>>8].ctype==PT_PSCN) + { + parts[i].life = 10; + } + else if(parts[r>>8].ctype==PT_NSCN) + { + parts[i].life = 9; + } + } + if(rt==PT_PUMP) + { + if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) + { + parts[i].life = 9; + } + else if(parts[i].life==0&&parts[r>>8].life==10) + { + parts[i].life = 10; + } + } + } + } else if(t==PT_AMTR) { for(nx=-1; nx<2; nx++) From 491016eaf4b5f3065c43c0a142a0a0ebc2c3de63 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Tue, 30 Nov 2010 14:43:42 -0500 Subject: [PATCH 67/79] Fixed love crash on mac, added adjustable grid mode, hit 'g', goes up to 9. --- includes/defines.h | 1 + includes/powder.h | 4 ++-- src/graphics.c | 11 +++++++++++ src/main.c | 4 ++++ src/powder.c | 14 +++++++++----- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 10f210d2e..cc7fcf343 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -131,6 +131,7 @@ int SEC; int SEC2; int REPLACE_MODE; int CURRENT_BRUSH; +int GRID_MODE; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/powder.h b/includes/powder.h index ffb4ee34a..260a6ea2b 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -369,8 +369,8 @@ static const part_type ptypes[PT_NUM] = {"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal OUT. Things come out here", TYPE_SOLID}, {"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Colloid", TYPE_LIQUID}, {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "blah blah solid not in the menu", TYPE_SOLID}, - {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves", TYPE_PART}, - {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 65, "Vine, not in menu", TYPE_SOLID}, + {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite", TYPE_PART}, + {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 65, "Vine, grows", TYPE_SOLID}, {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, diff --git a/src/graphics.c b/src/graphics.c index 81bc75665..30c807ad8 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1304,6 +1304,17 @@ void draw_parts(pixel *vid) int cr, cg, cb; float fr, fg, fb; float pt = R_TEMP; + if(GRID_MODE) + { + for(ny=0;ny>8)>=NPART || !r) { continue; } - if(parts[r>>8].type==PT_LOVE) + else if((ny<9||nx<9||ny>YRES-7||nx>XRES-10)&&parts[r>>8].type==PT_LOVE) + parts[r>>8].type = PT_NONE; + else if(parts[r>>8].type==PT_LOVE) { love[nx/9][ny/9] = 1; } } } - for(nx=0;nx<=XRES-4;nx++) + for(nx=9;nx<=XRES-18;nx++) { - for(ny=0;ny<=YRES-4;ny++) + for(ny=9;ny<=YRES-7;ny++) { if(love[nx/9][ny/9]==1) { @@ -956,6 +958,8 @@ void update_particles_i(pixel *vid, int start, int inc) } if(!rt&&loverule[nnx][nny]==1) create_part(-1,nx+nnx,ny+nny,PT_LOVE); + else if(!rt) + continue; else if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0) parts[rt>>8].type=PT_NONE; From 656b5ff4965d53e9fbc904cb517f9139b8f24b82 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Wed, 1 Dec 2010 15:27:13 -0500 Subject: [PATCH 68/79] SHLD, element that grows from spark and will regrow if damaged. Lots of other small changes and fixes. replace mode ONLY draws on the element to be replaced. --- includes/defines.h | 1 + includes/powder.h | 45 ++++++---- src/graphics.c | 2 +- src/main.c | 4 +- src/powder.c | 217 ++++++++++++++++++++++++++++++++++++++++----- 5 files changed, 228 insertions(+), 41 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index cc7fcf343..87604b51f 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -132,6 +132,7 @@ int SEC2; int REPLACE_MODE; int CURRENT_BRUSH; int GRID_MODE; +int VINE_MODE; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/powder.h b/includes/powder.h index 260a6ea2b..781cd2aab 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -165,7 +165,11 @@ #define PT_EQUALVEL 116//all particles equal their velocities #define PT_INST2 117 #define PT_INST3 118 -#define PT_NUM 119 +#define PT_SHLD1 119 +#define PT_SHLD2 120 +#define PT_SHLD3 121 +#define PT_SHLD4 122 +#define PT_NUM 123 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -346,36 +350,40 @@ static const part_type ptypes[PT_NUM] = {"34 ", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "34! (34/34)", TYPE_SOLID}, {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, - {"CRAC", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "cracker64 - Spongey, Made by himself",TYPE_SOLID}, - {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_SOLIDS, 243.15f, 100, "Not quite Ice",TYPE_SOLID}, - {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, 243.15f, 100, "Not quite Steam",TYPE_GAS}, + {"CRAC", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.",TYPE_SOLID}, + {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_CRACKER, 243.15f, 100, "Not quite Ice",TYPE_SOLID}, + {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, 243.15f, 100, "Not quite Steam",TYPE_GAS}, {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, {"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, - {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, - {"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID}, + {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, + {"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_ELEC, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, - {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 273.15f, 0, "Moves elements around, read the post on how to use.", TYPE_SOLID}, + {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, 273.15f, 0, "Moves elements around, read the post on how to use.", TYPE_SOLID}, {"FRZZ", 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, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, - {"FRZW", 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, 30, SC_CRACKER, 90.0f, 29, "FREEZE WATER", TYPE_LIQUID}, - {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, + {"FRZW", 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, 30, SC_CRACKER, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID}, + {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_CRACKER, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, - {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS}, - {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID}, - {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery.", TYPE_SOLID|PROP_CONDUCTS}, + {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, SC_CRACKER, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS}, + {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_CRACKER, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID}, + {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery, PSCN to charge, NSCN to take.", TYPE_SOLID|PROP_CONDUCTS}, {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID}, {"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID}, {"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal OUT. Things come out here", TYPE_SOLID}, {"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Colloid", TYPE_LIQUID}, - {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "blah blah solid not in the menu", TYPE_SOLID}, - {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite", TYPE_PART}, + {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Solid form of PSTE, temporary", TYPE_SOLID}, + {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite", TYPE_PART}, {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 65, "Vine, grows", TYPE_SOLID}, {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, - + {"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Shield, spark it to grow", 0}, + {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Shield lvl 2", 0}, + {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Shield lvl 3", 0}, + {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Shield lvl 4", 0}, + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -501,7 +509,10 @@ static part_state pstates[PT_NUM] = /* EQVE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* INST2*/ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* INST3*/ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - + /* SHLD1*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* SHLD2*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* SHLD3*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* SHLD4*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = { @@ -532,7 +543,7 @@ static int loverule[9][9] = {0,1,0,0,1,1,0,0,0}, {0,0,1,1,0,0,0,0,0}, }; -int portal[8][20]; +int portal[8][8]; extern int isplayer; extern float player[27]; diff --git a/src/graphics.c b/src/graphics.c index 30c807ad8..5561f047b 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1402,7 +1402,7 @@ void draw_parts(pixel *vid) isplayer = 1; //It's a secret. Tssss... } - if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY)//nothing display but show needed color changes + if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP)//nothing display but show needed color changes { cr = PIXR(ptypes[t].pcolors); cg = PIXG(ptypes[t].pcolors); diff --git a/src/main.c b/src/main.c index 41f49459c..63765f242 100644 --- a/src/main.c +++ b/src/main.c @@ -1395,6 +1395,8 @@ int main(int argc, char *argv[]) REPLACE_MODE = !REPLACE_MODE; if(sdl_key=='g') GRID_MODE = (GRID_MODE+1)%10; + if(sdl_key=='t') + VINE_MODE = !VINE_MODE; if(sdl_key==SDLK_SPACE) sys_pause = !sys_pause; if(sdl_key=='h') @@ -1956,7 +1958,7 @@ int main(int argc, char *argv[]) { if(sdl_mod & (KMOD_CAPS)) c = 0; - if(c!=125&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM) + if(c!=WL_STREAM&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM&&!REPLACE_MODE) flood_parts(x, y, c, -1, -1); lx = x; ly = y; diff --git a/src/powder.c b/src/powder.c index 43ef46771..4dd46fb71 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1066,7 +1066,7 @@ void update_particles_i(pixel *vid, int start, int inc) { if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC||parts[i].type==PT_PUMP)) && !(parts[i].life%4==0 && parts[i].type==PT_INST)) parts[i].life--; - if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_PUMP && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST) + if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_PUMP && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST && t!=PT_SHLD1&& t!=PT_SHLD2&& t!=PT_SHLD3&& t!=PT_SHLD4) { kill_part(i); continue; @@ -1186,7 +1186,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].vx *= ptypes[t].loss; parts[i].vy *= ptypes[t].loss; - if((t==PT_GOO||t==PT_BCLN) && !parts[i].life) + if((t==PT_GOO) && !parts[i].life) { if(pv[y/CELL][x/CELL]>1.0f) { @@ -1195,6 +1195,15 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life = rand()%80+300; } } + if((t==PT_BCLN) && !parts[i].life) + { + if(pv[y/CELL][x/CELL]>4.0f) + { + parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL]; + parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL]; + parts[i].life = rand()%40+80; + } + } else { if(t==PT_ANAR) @@ -1300,6 +1309,14 @@ void update_particles_i(pixel *vid, int start, int inc) t = parts[i].type = PT_PSTS; if(t==PT_PSTS && pv[y/CELL][x/CELL]<0.5f) t = parts[i].type = PT_PSTE; + if(t==PT_SHLD1 && pv[y/CELL][x/CELL]>7.0f) + t = parts[i].type = PT_NONE; + if(t==PT_SHLD2 && pv[y/CELL][x/CELL]>15.0f) + t = parts[i].type = PT_NONE; + if(t==PT_SHLD3 && pv[y/CELL][x/CELL]>25.0f) + t = parts[i].type = PT_NONE; + if(t==PT_SHLD4 && pv[y/CELL][x/CELL]>40.0f) + t = parts[i].type = PT_NONE; //if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f) // t = parts[i].type = PT_BGLA; if(t==PT_GLAS) @@ -1845,7 +1862,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_NONE; parts[i].life = rand()%60 + 60; } - else if((r&0xFF)==PT_WOOD && (1>rand()%20) && abs(nx+ny)<=2) + else if((r&0xFF)==PT_WOOD && (1>rand()%20) && abs(nx+ny)<=2 && VINE_MODE) { create_part(-1,(x+nx)+(rand()%3)-1,(y+ny)+(rand()%3)-1,PT_VINE); } @@ -2257,7 +2274,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion + if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion { int temp = parts[i].life - parts[r>>8].life; if(temp ==1) @@ -2405,7 +2422,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion + if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion { int temp = parts[i].life - parts[r>>8].life; if(temp ==1) @@ -2440,6 +2457,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life = parts[r>>8].life; parts[i].tmp = parts[r>>8].tmp; parts[i].temp = parts[r>>8].temp; + parts[i].vx = parts[r>>8].vx; + parts[i].vy = parts[r>>8].vy; parts[r>>8].type = PT_WARP; parts[r>>8].life = rand()%90+1; trade = 5; @@ -2582,12 +2601,7 @@ void update_particles_i(pixel *vid, int start, int inc) if((r>>8)>=NPART) continue; if(!r&&!parts[i].life) - { parts[i].life=50; - continue; - } - if(!r) - continue; } if(parts[i].life==2) { @@ -2712,23 +2726,21 @@ void update_particles_i(pixel *vid, int start, int inc) continue; else if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)&&(parts[r>>8].life>=3)&&parts[i].life%4==0) { - flood_parts(x,y,PT_INST2,PT_INST,-1); + flood_parts(x,y,PT_INST2,PT_INST,-1);//add life parts[r>>8].type==parts[r>>8].ctype; } else if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0&&(parts[i].life>=4)&&parts[i].life%4<=1) { create_part(-1,x+nx,y+ny,PT_SPRK); - flood_parts(x,y,PT_INST3,PT_INST,-1); + flood_parts(x,y,PT_INST3,PT_INST,-1);//sub life } else if(parts[r>>8].type==PT_SWCH&&parts[r>>8].life==10&&(parts[i].life>=4)&&parts[i].life%4<=1) { parts[r>>8].type=PT_SPRK; parts[r>>8].ctype=PT_SWCH; parts[r>>8].life=4; - flood_parts(x,y,PT_INST3,PT_INST,-1); + flood_parts(x,y,PT_INST3,PT_INST,-1);//sub life } - //else if(parts[r>>8].type==PT_INST&&parts[r>>8].life%4==0&&parts[r>>8].life>parts[i].life) - //parts[i].life --; } } else if(t==PT_INST2) @@ -2744,8 +2756,8 @@ void update_particles_i(pixel *vid, int start, int inc) else if(t==PT_PRTI) { int count =0; - for(nx=-1; nx<2; nx++) - for(ny=-1; ny<2; ny++) + for(ny=-1; ny<2; ny++) + for(nx=-1; nx<2; nx++) if(x+nx>=0 && y+ny>0 && x+nx-2; nx--) - for(ny=1; ny>-2; ny--) + for(ny=1; ny>-2; ny--) + for(nx=1; nx>-2; nx--) if(x+nx>=0 && y+ny>0 && x+nx=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) + for(int nnx=-1;nnx<2;nnx++) + for(int nny=-1;nny<2;nny++) + { + if(parts[i].life==0) + { + t = parts[i].type = PT_SHLD2; + parts[i].life = 7; + } + else if(!pmap[y+ny+nny][x+nx+nnx]) + { + create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1); + parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; + } + } + else if(parts[r>>8].type==PT_SHLD3&&4>rand()%10) + { + t = parts[i].type=PT_SHLD2; + parts[i].life = 7; + } + } + } + else if(t==PT_SHLD2) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART) + continue; + if(!r && parts[i].life>0) + create_part(-1,x+nx,y+ny,PT_SHLD1); + if(!r) + continue; + else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) + for(int nnx=-1;nnx<2;nnx++) + for(int nny=-1;nny<2;nny++) + { + if(3>rand()%200&&parts[i].life==0) + { + t = parts[i].type = PT_SHLD3; + parts[i].life = 7; + } + else if(!pmap[y+ny+nny][x+nx+nnx]) + { + create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1); + parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; + } + } + else if(parts[r>>8].type==PT_SHLD4&&4>rand()%10) + { + t = parts[i].type=PT_SHLD3; + parts[i].life = 7; + } + } + } + else if(t==PT_SHLD3) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART) + continue; + if(!r) + { + if(1>rand()%2500) + { + create_part(-1,x+nx,y+ny,PT_SHLD1); + parts[pmap[y+ny][x+nx]>>8].life=7; + t = parts[i].type = PT_SHLD2; + } + else + continue; + + } + if(parts[r>>8].type==PT_SHLD1 && parts[i].life>3) + { + parts[r>>8].type = PT_SHLD2; + parts[r>>8].life=7; + } + else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) + for(int nnx=-1;nnx<2;nnx++) + for(int nny=-1;nny<2;nny++) + { + if(2>rand()%3000&&parts[i].life==0) + { + t = parts[i].type = PT_SHLD4; + parts[i].life = 7; + } + else if(!pmap[y+ny+nny][x+nx+nnx]) + { + create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1); + parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; + } + } + } + } + else if(t==PT_SHLD4) + { + for(nx=-1; nx<2; nx++) + for(ny=-1; ny<2; ny++) + if(x+nx>=0 && y+ny>0 && + x+nx>8)>=NPART) + continue; + if(!r) + { + if(1>rand()%5500) + { + create_part(-1,x+nx,y+ny,PT_SHLD1); + parts[pmap[y+ny][x+nx]>>8].life=7; + t = parts[i].type = PT_SHLD2; + } + else + continue; + + } + if(parts[r>>8].type==PT_SHLD2 && parts[i].life>3) + { + parts[r>>8].type = PT_SHLD3; + parts[r>>8].life = 7; + } + else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) + for(int nnx=-1;nnx<2;nnx++) + for(int nny=-1;nny<2;nny++) + { + if(!pmap[y+ny+nny][x+nx+nnx]) + { + create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1); + parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; + } + } + } + } else if(t==PT_AMTR) { for(nx=-1; nx<2; nx++) @@ -4604,12 +4767,14 @@ int flood_parts(int x, int y, int c, int cm, int bm) while(x1>=CELL) { if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm) + if(cm!=PT_INST&&((pmap[y][x1-1]&0xFF)!=PT_INST2&&(pmap[y][x1-1]&0xFF)!=PT_INST3)) break; x1--; } while(x2 Date: Wed, 1 Dec 2010 16:35:34 -0500 Subject: [PATCH 69/79] woops, didn't test INST, works now --- src/powder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/powder.c b/src/powder.c index 4dd46fb71..f61e1be5c 100644 --- a/src/powder.c +++ b/src/powder.c @@ -4767,14 +4767,14 @@ int flood_parts(int x, int y, int c, int cm, int bm) while(x1>=CELL) { if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm) - if(cm!=PT_INST&&((pmap[y][x1-1]&0xFF)!=PT_INST2&&(pmap[y][x1-1]&0xFF)!=PT_INST3)) + if(((pmap[y][x1-1]&0xFF)!=PT_INST2&&(pmap[y][x1-1]&0xFF)!=PT_INST3)) break; x1--; } while(x2 Date: Fri, 3 Dec 2010 00:13:00 -0500 Subject: [PATCH 70/79] lots and lots of small changes/fixes. fixed typo for water movement, made parts_avg kinda better? electronics still work. --- includes/defines.h | 2 + includes/graphics.h | 2 +- includes/powder.h | 34 ++++++-- src/graphics.c | 15 +--- src/main.c | 4 +- src/powder.c | 205 ++++++++++++++++++++++++++++++-------------- 6 files changed, 176 insertions(+), 86 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 87604b51f..b2e1cca8a 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -122,9 +122,11 @@ int MSIGN; int CGOL; int ISGOL; int ISLOVE; +int ISLOLZ; int ISGRAV; int GSPEED; int love[XRES/9][YRES/9]; +int lolz[XRES/9][YRES/9]; int gol[XRES][YRES]; int gol2[XRES][YRES][NGOL]; int SEC; diff --git a/includes/graphics.h b/includes/graphics.h index 2cb37d3d8..352439521 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -137,7 +137,7 @@ 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, float rx, float ry); +void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry); void sdl_open(void); diff --git a/includes/powder.h b/includes/powder.h index 781cd2aab..1442e63bc 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -169,7 +169,8 @@ #define PT_SHLD2 120 #define PT_SHLD3 121 #define PT_SHLD4 122 -#define PT_NUM 123 +#define PT_LOLZ 123 +#define PT_NUM 124 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -379,10 +380,11 @@ static const part_type ptypes[PT_NUM] = {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, - {"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Shield, spark it to grow", 0}, - {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Shield lvl 2", 0}, - {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Shield lvl 3", 0}, - {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Shield lvl 4", 0}, + {"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, + {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", 0}, + {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, + {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0}, + {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Lolz", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -513,6 +515,8 @@ static part_state pstates[PT_NUM] = /* SHLD2*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD3*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD4*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* LOlZ */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + }; static int grule[NGOL][9] = { @@ -543,6 +547,18 @@ static int loverule[9][9] = {0,1,0,0,1,1,0,0,0}, {0,0,1,1,0,0,0,0,0}, }; +static int lolzrule[9][9] = +{ + {0,0,0,0,0,0,0,0,0}, + {1,0,0,0,0,0,1,0,0}, + {1,0,0,0,0,0,1,0,0}, + {1,0,0,1,1,0,0,1,0}, + {1,0,1,0,0,1,0,1,0}, + {1,0,1,0,0,1,0,1,0}, + {0,1,0,1,1,0,0,1,0}, + {0,1,0,0,0,0,0,1,0}, + {0,1,0,0,0,0,0,1,0}, +}; int portal[8][8]; extern int isplayer; @@ -593,9 +609,9 @@ extern inline int is_wire_off(int x, int y); void set_emap(int x, int y); #if defined(WIN32) && !defined(__GNUC__) -_inline int parts_avg(int ci, int ni); +_inline int parts_avg(int ci, int ni, int t); #else -int parts_avg(int ci, int ni); +int parts_avg(int ci, int ni, int t); #endif int nearest_part(int ci, int t); @@ -610,8 +626,8 @@ 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, float rx, float ry, int c); +int create_parts(int x, int y, int rx, int ry, int c); -void create_line(int x1, int y1, int x2, int y2, float rx, float ry, int c); +void create_line(int x1, int y1, int x2, int y2, int rx, int ry, int c); #endif diff --git a/src/graphics.c b/src/graphics.c index 5561f047b..ed1a4b38e 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2882,24 +2882,15 @@ corrupt: return 1; } -void render_cursor(pixel *vid, int x, int y, int t, float rx, float ry) +void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry) { int i,j,c; - float temprx, tempry; if(t1 || ((i*i)/(temprx*temprx)+((j+1)*(j+1))/(tempry*tempry)>1))) + if((pow(i,2))/(pow(rx,2))+(pow(j,2))/(pow(ry,2))<=1 && ((pow(i+1,2))/(pow(rx,2))+(pow(j,2))/(pow(ry,2))>1 || (pow(i,2))/(pow(rx,2))+(pow(j+1,2))/(pow(ry,2))>1)) { xor_pixel(x+i, y+j, vid); if(j) xor_pixel(x+i, y-j, vid); @@ -2928,7 +2919,7 @@ void render_cursor(pixel *vid, int x, int y, int t, float rx, float ry) else { int tc; - c = ((int)rx/CELL) * CELL; + c = (rx/CELL) * CELL; x = (x/CELL) * CELL; y = (y/CELL) * CELL; diff --git a/src/main.c b/src/main.c index 63765f242..05e4bc100 100644 --- a/src/main.c +++ b/src/main.c @@ -1024,8 +1024,8 @@ int main(int argc, char *argv[]) int vs = 0; #endif int x, y, b = 0, sl=1, sr=0, su=0, c, lb = 0, lx = 0, ly = 0, lm = 0;//, tx, ty; - int da = 0, db = 0, it = 2047, mx, my; - float nfvx, nfvy, bsx = 2, bsy = 2; + int da = 0, db = 0, it = 2047, mx, my, bsx = 2, bsy = 2; + float nfvx, nfvy; int load_mode=0, load_w=0, load_h=0, load_x=0, load_y=0, load_size=0; void *load_data=NULL; pixel *load_img=NULL;//, *fbi_img=NULL; diff --git a/src/powder.c b/src/powder.c index f61e1be5c..dbf05b064 100644 --- a/src/powder.c +++ b/src/powder.c @@ -822,20 +822,30 @@ void set_emap(int x, int y) } #if defined(WIN32) && !defined(__GNUC__) -_inline int parts_avg(int ci, int ni) +_inline int parts_avg(int ci, int ni,int t)//t is the particle you are looking for #else -inline int parts_avg(int ci, int ni) +inline int parts_avg(int ci, int ni,int t) #endif { - int pmr = pmap[(int)((parts[ci].y + parts[ni].y)/2)][(int)((parts[ci].x + parts[ni].x)/2)]; - if((pmr>>8) < NPART && (pmr>>8) >= 1) - { - return parts[pmr>>8].type; - } - else - { - return PT_NONE; - } + if(t==PT_INSL)//to keep electronics working + { + int pmr = pmap[(int)((parts[ci].y + parts[ni].y)/2)][(int)((parts[ci].x + parts[ni].x)/2)]; + if((pmr>>8) < NPART && pmr) + return parts[pmr>>8].type; + else + return PT_NONE; + } + else + { + int pmr2 = pmap[(int)((parts[ci].y + parts[ni].y)/2+0.5f)][(int)((parts[ci].x + parts[ni].x)/2+0.5f)];//seems to be more accurate. + if((pmr2>>8) < NPART && pmr2) + { + if(parts[pmr2>>8].type==t) + return t; + } + else + return PT_NONE; + } } @@ -970,6 +980,57 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + if(ISLOLZ==1) + { + ISLOLZ = 0; + for(ny=0;ny>8)>=NPART || !r) + { + continue; + } + else if((ny<9||nx<9||ny>YRES-7||nx>XRES-10)&&parts[r>>8].type==PT_LOLZ) + parts[r>>8].type = PT_NONE; + else if(parts[r>>8].type==PT_LOLZ) + { + lolz[nx/9][ny/9] = 1; + } + + } + } + for(nx=9;nx<=XRES-18;nx++) + { + for(ny=9;ny<=YRES-7;ny++) + { + if(lolz[nx/9][ny/9]==1) + { + for(int nnx=0;nnx<9;nnx++) + for(int nny=0;nny<9;nny++) + { + if(ny+nny>0&&ny+nny=0&&nx+nnx>8)>=NPART) + { + continue; + } + if(!rt&&lolzrule[nny][nnx]==1) + create_part(-1,nx+nnx,ny+nny,PT_LOLZ); + else if(!rt) + continue; + else if(parts[rt>>8].type==PT_LOLZ&&lolzrule[nny][nnx]==0) + parts[rt>>8].type=PT_NONE; + + } + } + } + lolz[nx/9][ny/9]=0; + } + } + } if(ISGOL==1&&CGOL>=GSPEED)//GSPEED is frames per generation { for(nx=4;nx4.0f) { @@ -1352,7 +1413,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(t==PT_SPRK&&parts[i].ctype==PT_ETRD&&parts[i].life==1) { nearp = nearest_part(i, PT_ETRD); - if(nearp!=-1&&parts_avg(i, nearp)!=PT_INSL) + if(nearp!=-1&&parts_avg(i, nearp, PT_INSL)!=PT_INSL) { create_line((int)parts[i].x, (int)parts[i].y, (int)parts[nearp].x, (int)parts[nearp].y, 0, 0, PT_PLSM); t = parts[i].type = PT_ETRD; @@ -1831,7 +1892,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_METL && parts_avg(i, r>>8)!=PT_INSL) + if((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_METL && parts_avg(i, r>>8,PT_INSL)!=PT_INSL) { parts[i].temp = 473.0f; } @@ -1864,7 +1925,12 @@ void update_particles_i(pixel *vid, int start, int inc) } else if((r&0xFF)==PT_WOOD && (1>rand()%20) && abs(nx+ny)<=2 && VINE_MODE) { - create_part(-1,(x+nx)+(rand()%3)-1,(y+ny)+(rand()%3)-1,PT_VINE); + int nnx = rand()%3 -1; + int nny = rand()%3 -1; + if(x+nx+nnx>=0 && y+ny+nny>0 && + x+nx+nnx>8].temp = parts[i].temp; } //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) //t = parts[i].type = PT_WATR; @@ -1900,6 +1966,7 @@ void update_particles_i(pixel *vid, int start, int inc) else if(!r) { create_part(-1,x+nx,y+ny,PT_VINE); + parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; parts[i].type=PT_PLNT; } } @@ -2064,10 +2131,13 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_FIRE; parts[r>>8].life = 4; } - else if(((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50&&parts_avg(i,r>>8) != PT_GLAS) + else if(((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50) { - parts[i].life--; - parts[r>>8].type = PT_NONE; + if(parts_avg(i, r>>8,PT_GLAS)!= PT_GLAS) + { + parts[i].life--; + parts[r>>8].type = PT_NONE; + } } else if (parts[i].life==50) { @@ -2228,6 +2298,8 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_LOVE) ISLOVE=1; + else if(t==PT_LOLZ) + ISLOLZ=1; else if(t==PT_GRAV) ISGRAV=1; else if(t==PT_CRAC) @@ -2477,7 +2549,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].vy = rand()%8-22; parts[r>>8].vx = rand()%20-rand()%20; parts[r>>8].life=rand()%15+25; - parts[i].type=PT_NONE; + t=parts[i].type=PT_NONE; } } if(parts[i].life>1) @@ -2515,7 +2587,7 @@ void update_particles_i(pixel *vid, int start, int inc) } } } - parts[i].type=PT_NONE; + t=parts[i].type=PT_NONE; } } else if(t==PT_LCRY) @@ -2765,12 +2837,15 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS)) + if(parts[r>>8].type==PT_SPRK || (parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS))) for(int nnx=0;nnx<8;nnx++) if(!portal[count-1][nnx]) { portal[count-1][nnx] = parts[r>>8].type; - parts[r>>8].type = PT_NONE; + if(parts[r>>8].type==PT_SPRK) + parts[r>>8].type = parts[r>>8].ctype; + else + parts[r>>8].type = PT_NONE; break; } } @@ -2796,7 +2871,20 @@ void update_particles_i(pixel *vid, int start, int inc) randomness=1; if(randomness>8) randomness=8; - if(portal[randomness-1][nnx]) + if(portal[randomness-1][nnx]==PT_SPRK)//todo. make it look better + { + create_part(-1,x+1,y,portal[randomness-1][nnx]); + create_part(-1,x+1,y+1,portal[randomness-1][nnx]); + create_part(-1,x+1,y-1,portal[randomness-1][nnx]); + create_part(-1,x,y-1,portal[randomness-1][nnx]); + create_part(-1,x,y+1,portal[randomness-1][nnx]); + create_part(-1,x-1,y+1,portal[randomness-1][nnx]); + create_part(-1,x-1,y,portal[randomness-1][nnx]); + create_part(-1,x-1,y-1,portal[randomness-1][nnx]); + portal[randomness-1][nnx] = 0; + break; + } + else if(portal[randomness-1][nnx]) { create_part(-1,x+nx,y+ny,portal[randomness-1][nnx]); portal[randomness-1][nnx] = 0; @@ -2925,7 +3013,7 @@ void update_particles_i(pixel *vid, int start, int inc) for(int nnx=-1;nnx<2;nnx++) for(int nny=-1;nny<2;nny++) { - if(parts[i].life==0) + if(7>rand()%200&&parts[i].life==0) { t = parts[i].type = PT_SHLD2; parts[i].life = 7; @@ -2933,7 +3021,7 @@ void update_particles_i(pixel *vid, int start, int inc) else if(!pmap[y+ny+nny][x+nx+nnx]) { create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1); - parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; + //parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; } } else if(parts[r>>8].type==PT_SHLD3&&4>rand()%10) @@ -3116,7 +3204,7 @@ void update_particles_i(pixel *vid, int start, int inc) } else { float newVel = parts[i].life/25; parts[i].flags = parts[i].flags&0xFFFFFFFE; - if((pmap[(int)(ly-newVel)][(int)lx]&0xFF)==PT_NONE) { + if((pmap[(int)(ly-newVel)][(int)lx]&0xFF)==PT_NONE && ly-newVel>0) { parts[i].vy = -newVel; ly-=newVel; iy-=newVel; @@ -3166,7 +3254,7 @@ void update_particles_i(pixel *vid, int start, int inc) if((r>>8)>=NPART || !r) continue; rt = parts[r>>8].type; - if(parts_avg(i,r>>8) != PT_INSL) + if(parts_avg(i,r>>8,PT_INSL) != PT_INSL) { if((rt==PT_METL||rt==PT_IRON||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE)&&parts[r>>8].life==0 && abs(nx)+abs(ny) < 4) { @@ -3188,7 +3276,7 @@ void update_particles_i(pixel *vid, int start, int inc) if((r>>8)>=NPART || !r) continue; rt = parts[r>>8].type; - if(parts[r>>8].type == PT_SWCH&&parts_avg(i,r>>8)!=PT_INSL) + if(parts[r>>8].type == PT_SWCH&&parts_avg(i,r>>8,PT_INSL)!=PT_INSL) { if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) { @@ -3294,7 +3382,7 @@ void update_particles_i(pixel *vid, int start, int inc) //If so turn the SPRK that covers the SWCH back into SWCH and turn it off if(rt==PT_SPRK && parts[r>>8].ctype == PT_SWCH && t==PT_SPRK) { - pavg = parts_avg(r>>8, i); + pavg = parts_avg(r>>8, i,PT_INSL); if(parts[i].ctype == PT_NSCN&&pavg != PT_INSL) { parts[r>>8].type = PT_SWCH; @@ -3302,11 +3390,11 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].life = 9; } } - pavg = parts_avg(i, r>>8); + pavg = parts_avg(i, r>>8,PT_INSL); if(rt==PT_SWCH && t==PT_SPRK) { - pavg = parts_avg(r>>8, i); - if(parts[i].ctype == PT_PSCN&&pavg != PT_INSL) + pavg = parts_avg(r>>8, i,PT_INSL); + if(parts[i].ctype == PT_PSCN&&pavg != PT_INSL && parts[r>>8].life<10) parts[r>>8].life = 10; if(parts[i].ctype == PT_NSCN&&pavg != PT_INSL) parts[r>>8].life = 9; @@ -3317,7 +3405,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].life = 4; } } - pavg = parts_avg(i, r>>8); + pavg = parts_avg(i, r>>8,PT_INSL); if(pavg != PT_INSL) { if(t==PT_SPRK && (rt==PT_METL||rt==PT_IRON||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 && @@ -4033,7 +4121,7 @@ killed: else r = -1; if(s) - for(j=y+r; j>=0 && j=y-rt && j=0 && j=y-rt && jabs(x2-x1), x, y, dx, dy, sy; float e, de; From d56684312dd9429da8be8666206ad1656d3185a9 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Sat, 4 Dec 2010 12:24:54 -0500 Subject: [PATCH 71/79] WIFI, a wireless SPRK transmitter, has 25 'channels' controlled by temp. starting at 0C, every 100 degrees is a different channel, they are colored as well. Heat-gradient display, colors of elements is slightly changed based on temp. maybe some other fixes. --- includes/defines.h | 1 + includes/powder.h | 9 +++++++-- src/graphics.c | 32 ++++++++++++++++++++++++++++++++ src/interface.c | 7 +++++++ src/main.c | 4 ++++ src/powder.c | 45 +++++++++++++++++++++++++++++++++++++++++---- 6 files changed, 92 insertions(+), 6 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index b2e1cca8a..a0db95d49 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -124,6 +124,7 @@ int ISGOL; int ISLOVE; int ISLOLZ; int ISGRAV; +int ISWIRE; int GSPEED; int love[XRES/9][YRES/9]; int lolz[XRES/9][YRES/9]; diff --git a/includes/powder.h b/includes/powder.h index 1442e63bc..a06249f3c 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -5,7 +5,8 @@ #include "defines.h" #include "interface.h" -#define CM_COUNT 9 +#define CM_COUNT 10 +#define CM_GRAD 9 #define CM_CRACK 8 #define CM_NOTHING 7 #define CM_FANCY 6 @@ -170,7 +171,8 @@ #define PT_SHLD3 121 #define PT_SHLD4 122 #define PT_LOLZ 123 -#define PT_NUM 124 +#define PT_WIFI 124 +#define PT_NUM 125 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -385,6 +387,7 @@ static const part_type ptypes[PT_NUM] = {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0}, {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Lolz", TYPE_SOLID}, + {"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID|PROP_CONDUCTS}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -516,6 +519,7 @@ static part_state pstates[PT_NUM] = /* SHLD3*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD4*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* LOlZ */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* WIFI */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = @@ -560,6 +564,7 @@ static int lolzrule[9][9] = {0,1,0,0,0,0,0,1,0}, }; int portal[8][8]; +int wireless[25]; extern int isplayer; extern float player[27]; diff --git a/src/graphics.c b/src/graphics.c index ed1a4b38e..1af3f9bcb 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1409,6 +1409,29 @@ void draw_parts(pixel *vid) cb = PIXB(ptypes[t].pcolors); blendpixel(vid, nx, ny, cr, cg, cb, 255); } + if(cmode==CM_GRAD) + { + float frequency = 0.05; + int q = parts[i].temp; + cr = sin(frequency*q) * 16 + PIXR(ptypes[t].pcolors); + cg = sin(frequency*q) * 16 + PIXG(ptypes[t].pcolors); + cb = sin(frequency*q) * 16 + PIXB(ptypes[t].pcolors); + if(cr>=255) + cr = 255; + if(cg>=255) + cg = 255; + if(cb>=255) + cb = 255; + if(cr<=0) + cr = 0; + if(cg<=0) + cg = 0; + if(cb<=0) + cb = 0; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + + + } else if(t==PT_MWAX&&cmode == CM_FANCY) { for(x=-1; x<=1; x++) @@ -1539,6 +1562,15 @@ void draw_parts(pixel *vid) cb=255; blendpixel(vid, nx, ny, cr, cg, cb, 255); } + else if(t==PT_WIFI) + { + float frequency = 0.25; + int q = parts[i].tmp; + cr = sin(frequency*q + 0) * 127 + 128; + cg = sin(frequency*q + 2) * 127 + 128; + cb = sin(frequency*q + 4) * 127 + 128; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + } else if(t==PT_PIPE) { if(parts[i].ctype==2) diff --git a/src/interface.c b/src/interface.c index a4ecc8f04..3937ec84f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -550,9 +550,14 @@ void draw_svf_ui(pixel *vid_buf) break; case CM_FANCY: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xC4", 100, 150, 255, 255); + break; case CM_NOTHING: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); + break; case CM_CRACK: + drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); + break; + case CM_GRAD: drawtext(vid_buf, XRES-29+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\x00", 100, 150, 255, 255); break; } @@ -1814,6 +1819,8 @@ void set_cmode(int cm) strcpy(itc_msg, "Nothing Display"); else if(cmode==CM_CRACK) strcpy(itc_msg, "Alternate Velocity Display"); + else if(cmode==CM_GRAD) + strcpy(itc_msg, "Heat Gradient Display"); else strcpy(itc_msg, "Velocity Display"); } diff --git a/src/main.c b/src/main.c index 05e4bc100..6fd5bf5d1 100644 --- a/src/main.c +++ b/src/main.c @@ -1307,6 +1307,10 @@ int main(int argc, char *argv[]) { set_cmode(CM_CRACK); } + if(sdl_key=='0') + { + set_cmode(CM_GRAD); + } if(sdl_key==SDLK_TAB) { CURRENT_BRUSH =(CURRENT_BRUSH + 1)%BRUSH_NUM ; diff --git a/src/powder.c b/src/powder.c index dbf05b064..ff5b92619 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1112,8 +1112,16 @@ void update_particles_i(pixel *vid, int start, int inc) gol2[nx][ny][z] = 0; } } - if(CGOL==0) - CGOL++; + if(ISWIRE==1) + { + CGOL = 0; + ISWIRE = 0; + } + if(CGOL==1) + { + for(int q = 0;q<25;q++) + wireless[q] = 0; + } for(i=start; i<(NPART-starti); i+=inc) if(parts[i].type) { @@ -2817,12 +2825,12 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_INST2) { - if(parts[i].life%4==0) + if(parts[i].life%4<=1) t = parts[pmap[y][x]>>8].type=PT_INST; } else if(t==PT_INST3) { - if(parts[i].life%4!=0) + if(parts[i].life%4<=1) t = parts[pmap[y][x]>>8].type=PT_INST; } else if(t==PT_PRTI) @@ -2894,6 +2902,35 @@ void update_particles_i(pixel *vid, int start, int inc) } } } + else if(t==PT_WIFI) + { + CGOL = 1; + int temprange = 100; + for(int temp = 0; temp < 2500; temp += temprange) + if(parts[i].temp-273.15>temp&&parts[i].temp-273.15=0 && y+ny>0 && + x+nx>8)>=NPART || !r) + continue; + if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp]) + { + parts[r>>8].type = PT_SPRK; + parts[r>>8].ctype = PT_NSCN; + parts[r>>8].life = 4; + } + else if(parts[r>>8].type==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3 && !wireless[parts[i].tmp]) + { + parts[r>>8].type = parts[r>>8].ctype; + wireless[parts[i].tmp] = 1; + ISWIRE = 1; + } + } + } else if(t==PT_PCLN) { for(nx=-2; nx<3; nx++) From 2cf25c8a6aad84b2f86060e791948a0aed307192 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Sat, 4 Dec 2010 23:29:41 -0500 Subject: [PATCH 72/79] FILT, a photon color filter, not really a filter right now, but it changes the color. Other small changes --- includes/defines.h | 2 +- includes/powder.h | 13 ++++++++----- src/graphics.c | 24 ++++++++++++++++++++++++ src/interface.c | 17 ++++++++++------- src/main.c | 34 ++++++++++++++++++++++++++-------- src/powder.c | 31 +++++++++++++++++++++++-------- 6 files changed, 92 insertions(+), 29 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index a0db95d49..f5d238599 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -7,7 +7,7 @@ #define PATH_SEP "/" #endif -#define SAVE_VERSION 43 +#define SAVE_VERSION 44 #define MINOR_VERSION 1 #define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter. #define BETA diff --git a/includes/powder.h b/includes/powder.h index a06249f3c..7d726ad21 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -172,7 +172,8 @@ #define PT_SHLD4 122 #define PT_LOLZ 123 #define PT_WIFI 124 -#define PT_NUM 125 +#define PT_FILT 125 +#define PT_NUM 126 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -358,7 +359,7 @@ static const part_type ptypes[PT_NUM] = {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, 243.15f, 100, "Not quite Steam",TYPE_GAS}, {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, - {"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, + {"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, {"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_ELEC, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, @@ -366,11 +367,11 @@ static const part_type ptypes[PT_NUM] = {"FRZZ", 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, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, {"FRZW", 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, 30, SC_CRACKER, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID}, {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, - {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_CRACKER, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, + {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, SC_CRACKER, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS}, {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_CRACKER, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID}, {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery, PSCN to charge, NSCN to take.", TYPE_SOLID|PROP_CONDUCTS}, - {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, + {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 24, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID}, {"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID}, {"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal OUT. Things come out here", TYPE_SOLID}, @@ -387,7 +388,8 @@ static const part_type ptypes[PT_NUM] = {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0}, {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Lolz", TYPE_SOLID}, - {"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID|PROP_CONDUCTS}, + {"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID}, + {"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", TYPE_SOLID}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -520,6 +522,7 @@ static part_state pstates[PT_NUM] = /* SHLD4*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* LOlZ */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WIFI */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* FILT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = diff --git a/src/graphics.c b/src/graphics.c index 1af3f9bcb..5476bf719 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1765,6 +1765,30 @@ void draw_parts(pixel *vid) } } } + else if(t==PT_FILT) + { + int temp_bin = (int)((parts[i].temp-273.0f)*0.025f); + if(temp_bin < 0) temp_bin = 0; + if(temp_bin > 25) temp_bin = 25; + parts[i].ctype = 0x1F << temp_bin; + cg = 0; + cb = 0; + cr = 0; + for(x=0; x<12; x++) { + cr += (parts[i].ctype >> (x+18)) & 1; + cb += (parts[i].ctype >> x) & 1; + } + for(x=0; x<14; x++) + cg += (parts[i].ctype >> (x+9)) & 1; + x = 624/(cr+cg+cb+1); + cr *= x; + cg *= x; + cb *= x; + cr = cr>255?255:cr; + cg = cg>255?255:cg; + cb = cb>255?255:cb; + blendpixel(vid, nx, ny, cr, cg, cb, 127); + } else if(t==PT_PHOT) { if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) diff --git a/src/interface.c b/src/interface.c index 3937ec84f..49252117f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -2796,12 +2796,14 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) ccy = 0; for(cc=0; cccomment_count; cc++) { - drawtext(vid_buf, 60+(XRES/2)+1, ccy+60, info->commentauthors[cc], 255, 255, 255, 255); - ccy += 12; - ccy += drawtextwrap(vid_buf, 60+(XRES/2)+1, ccy+60, XRES+BARSIZE-100-((XRES/2)+1)-20, info->comments[cc], 255, 255, 255, 185); - ccy += 10; - if(ccy+52comments[cc])/(XRES+BARSIZE-100-((XRES/2)+1)-20)))*12)<(YRES+MENUSIZE-50)){ + drawtext(vid_buf, 60+(XRES/2)+1, ccy+60, info->commentauthors[cc], 255, 255, 255, 255); + ccy += 12; + ccy += drawtextwrap(vid_buf, 60+(XRES/2)+1, ccy+60, XRES+BARSIZE-100-((XRES/2)+1)-20, info->comments[cc], 255, 255, 255, 185); + ccy += 10; + if(ccy+5250 && my>50 && mx50 && my>50 && mx>8); + d[p++] = (ttlife&0x00FF); + } } for(j=0; j= size) - goto corrupt; - if(i <= NPART) - parts[i-1].life = d[p++]*4; - else - p++; + if(ver>=44){ + if(p >= size) { + goto corrupt; + } + if(i <= NPART) { + ttv = (d[p++])<<8; + ttv |= (d[p++]); + parts[i-1].life = ttv; + } else { + p+=2; + } + } else { + if(p >= size) + goto corrupt; + if(i <= NPART) + parts[i-1].life = d[p++]*4; + else + p++; + } } } for(j=0; j>8].life > 5))) return 2; @@ -157,7 +158,13 @@ int try_move(int i, int x, int y, int nx, int ny) parts[r>>8].life = 120; create_gain_photon(i); } - + if(parts[i].type == PT_PHOT && (r&0xFF)==PT_FILT) + { + int temp_bin = (int)((parts[r>>8].temp-273.0f)*0.025f); + if(temp_bin < 0) temp_bin = 0; + if(temp_bin > 25) temp_bin = 25; + parts[i].ctype = 0x1F << temp_bin; + } if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { if(rand() < RAND_MAX/10) create_cherenkov_photon(i); @@ -1451,7 +1458,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)) + if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)&&!(parts[i].type==PT_PHOT&&parts[r>>8].type==PT_FILT)) { h_count++; c_heat += parts[r>>8].temp; @@ -1469,7 +1476,7 @@ void update_particles_i(pixel *vid, int start, int inc) r = pmap[y+ny][x+nx]; if((r>>8)>=NPART || !r) continue; - if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)) + if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)&&!(parts[i].type==PT_PHOT&&parts[r>>8].type==PT_FILT)) { parts[r>>8].temp = parts[i].temp; } @@ -4892,15 +4899,23 @@ int flood_parts(int x, int y, int c, int cm, int bm) while(x1>=CELL) { if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm) - if(((pmap[y][x1-1]&0xFF)!=PT_INST2&&(pmap[y][x1-1]&0xFF)!=PT_INST3)) - break; + { + if(cm!=PT_INST) + break; + else if((pmap[y][x1-1]&0xFF)!=PT_INST2&&(pmap[y][x1-1]&0xFF)!=PT_INST3) + break; + } x1--; } while(x2=CELL+dy && x1==x2 && ((pmap[y-1][x1-1]&0xFF)==PT_INST||((pmap[y-1][x1-1]&0xFF)==PT_INST3||(pmap[y-1][x1-1]&0xFF)==PT_INST2)) && ((pmap[y-1][x1]&0xFF)==PT_INST||((pmap[y-1][x1]&0xFF)==PT_INST3||(pmap[y-1][x1]&0xFF)==PT_INST2)) && ((pmap[y-1][x1+1]&0xFF)==PT_INST || ((pmap[y-1][x1+1]&0xFF)==PT_INST3||(pmap[y-1][x1+1]&0xFF)==PT_INST2)) && From efb7c6bc9c1524314b67bf10ee821eefe65e2aeb Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Sun, 5 Dec 2010 21:56:46 -0500 Subject: [PATCH 73/79] updated with simon's changes --- includes/interface.h | 25 +++++++------ includes/powder.h | 89 +++++++++++++++++++++++--------------------- src/graphics.c | 2 +- src/interface.c | 18 ++++----- src/main.c | 33 ++++++++-------- 5 files changed, 85 insertions(+), 82 deletions(-) diff --git a/includes/interface.h b/includes/interface.h index ded361546..a5f1a116a 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -8,6 +8,7 @@ struct menu_section char *icon; const char *name; int itemcount; + int doshow; }; typedef struct menu_section menu_section; @@ -52,21 +53,21 @@ static menu_wall mwalls[] = #define SC_NUCLEAR 7 #define SC_LIFE 9 #define SC_CRACKER 10 -#define SC_TOTAL 11 +#define SC_TOTAL 10 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}, - {"\xC8", "Life", 0}, - {"\xC8", "Cracker", 0}, + {"\xC1", "Walls", 0, 1}, + {"\xC2", "Electronics", 0, 1}, + {"\xC3", "Explosives", 0, 1}, + {"\xC5", "Gasses", 0, 1}, + {"\xC4", "Liquids", 0, 1}, + {"\xD0", "Powders", 0, 1}, + {"\xD1", "Solids", 0, 1}, + {"\xC6", "Radioactive", 0, 1}, + {"\xCC", "Special", 0, 1}, + {"\xC8", "Life", 0, 1}, + {"\xC8", "Cracker", 0, 0}, }; struct ui_edit diff --git a/includes/powder.h b/includes/powder.h index 7d726ad21..1e987c99e 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -173,7 +173,8 @@ #define PT_LOLZ 123 #define PT_WIFI 124 #define PT_FILT 125 -#define PT_NUM 126 +#define PT_XEON 126//radioactive gas +#define PT_NUM 127 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -342,54 +343,55 @@ static const part_type ptypes[PT_NUM] = {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, - {"GOL ", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! (23/3)", TYPE_SOLID}, - {"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL 23/36)", TYPE_SOLID}, - {"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (4567/345)", TYPE_SOLID}, - {"2x2 ", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (125/36)", TYPE_SOLID}, - {"DANI", PIXPACK(0x00FFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Day and Night! (34678/3678)", TYPE_SOLID}, - {"AMOE", PIXPACK(0xFF00FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Amoeba! (1358/357)", TYPE_SOLID}, - {"MOVE", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "'Move' particles! Does not move things.. it is a life type(245/368)", TYPE_SOLID}, - {"PGOL", PIXPACK(0xE05010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Pseudo Life! (238/357)", TYPE_SOLID}, - {"DMOE", PIXPACK(0x500000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Diamoeba! (5678/35678)", TYPE_SOLID}, - {"34 ", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "34! (34/34)", TYPE_SOLID}, - {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, - {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, - {"CRAC", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.",TYPE_SOLID}, - {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_CRACKER, 243.15f, 100, "Not quite Ice",TYPE_SOLID}, - {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, 243.15f, 100, "Not quite Steam",TYPE_GAS}, + {"GOL ", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! (23/3)", TYPE_SOLID}, + {"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL 23/36)", TYPE_SOLID}, + {"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (4567/345)", TYPE_SOLID}, + {"2x2 ", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (125/36)", TYPE_SOLID}, + {"DANI", PIXPACK(0x00FFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Day and Night! (34678/3678)", TYPE_SOLID}, + {"AMOE", PIXPACK(0xFF00FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Amoeba! (1358/357)", TYPE_SOLID}, + {"MOVE", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "'Move' particles! Does not move things.. it is a life type(245/368)", TYPE_SOLID}, + {"PGOL", PIXPACK(0xE05010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Pseudo Life! (238/357)", TYPE_SOLID}, + {"DMOE", PIXPACK(0x500000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Diamoeba! (5678/35678)", TYPE_SOLID}, + {"34 ", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "34! (34/34)", TYPE_SOLID}, + {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, + {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, + {"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.",TYPE_SOLID}, + {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_CRACKER, 243.15f, 100, "Not quite Ice",TYPE_SOLID}, + {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, 243.15f, 100, "Not quite Steam",TYPE_GAS}, {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, - {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, + {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, {"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, - {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS}, - {"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_ELEC, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", TYPE_SOLID}, - {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."}, - {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, 273.15f, 0, "Moves elements around, read the post on how to use.", TYPE_SOLID}, - {"FRZZ", 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, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, - {"FRZW", 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, 30, SC_CRACKER, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID}, - {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART}, - {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, - {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, SC_CRACKER, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS}, - {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_CRACKER, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID}, + {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_NUCLEAR, R_TEMP +273.15f, 100, "Displaces other elements.",TYPE_GAS}, + {"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_ELEC, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", TYPE_SOLID}, + {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 100, "First fireworks made, activated by heat/neutrons."}, + {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SOLIDS, 273.15f, 0, "Moves elements around, read FAQ on website for help.", TYPE_SOLID}, + {"FRZZ", 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, 0, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, + {"FRZW", 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, 0, 30, SC_CRACKER, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID}, + {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Changes colour based on velocity.", TYPE_PART}, + {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, + {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, SC_CRACKER, R_TEMP-200.0f+273.15f, 42, "@_@ gas", TYPE_GAS}, + {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_CRACKER, R_TEMP+300.0f+273.15f, 251, "@_@ solid", TYPE_SOLID}, {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery, PSCN to charge, NSCN to take.", TYPE_SOLID|PROP_CONDUCTS}, {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 24, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, - {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID}, - {"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID}, - {"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal OUT. Things come out here", TYPE_SOLID}, - {"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Colloid", TYPE_LIQUID}, - {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Solid form of PSTE, temporary", TYPE_SOLID}, - {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite", TYPE_PART}, - {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 65, "Vine, grows", TYPE_SOLID}, - {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, - {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, + {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID}, + {"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID}, + {"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 40, "Portal OUT. Things come out here", TYPE_SOLID}, + {"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Colloid, Hardens under pressure", TYPE_LIQUID}, + {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Solid form of PSTE, temporary", TYPE_SOLID}, + {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite gravity", TYPE_PART}, + {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Vine, grows", TYPE_SOLID}, + {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, + {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, - {"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, - {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", 0}, - {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, - {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0}, - {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Lolz", TYPE_SOLID}, - {"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID}, - {"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", TYPE_SOLID}, + {"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, + {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", 0}, + {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, + {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0}, + {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 373.0f, 40, "Lolz", TYPE_SOLID}, + {"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID}, + {"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", TYPE_SOLID}, + {"XEON", PIXPACK(0xEB7917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_NUCLEAR, R_TEMP+2.0f +273.15f, 106, "Radioactive gas, absorbs neutrons.", TYPE_GAS}, //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; @@ -523,6 +525,7 @@ static part_state pstates[PT_NUM] = /* LOlZ */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WIFI */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* FILT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* RGAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, }; static int grule[NGOL][9] = diff --git a/src/graphics.c b/src/graphics.c index 5476bf719..bba3890d3 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1409,7 +1409,7 @@ void draw_parts(pixel *vid) cb = PIXB(ptypes[t].pcolors); blendpixel(vid, nx, ny, cr, cg, cb, 255); } - if(cmode==CM_GRAD) + else if(cmode==CM_GRAD) { float frequency = 0.05; int q = parts[i].temp; diff --git a/src/interface.c b/src/interface.c index 49252117f..044b65c77 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1491,7 +1491,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, height = (ceil((float)msections[i].itemcount/16.0f)*18); width = restrict_flt(msections[i].itemcount*31, 0, 16*31); h = -1; - x = XRES-BARSIZE-26; + x = XRES-BARSIZE-18; y = YRES+1; sy = y; if(i==SC_WALL) @@ -1500,9 +1500,9 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { if(n!=SPC_AIR&&n!=SPC_HEAT&&n!=SPC_COOL&&n!=SPC_VACUUM) { - if(x-26<=20) + if(x-18<=20) { - x = XRES-BARSIZE-26; + x = XRES-BARSIZE-18; y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, mwalls[n-UI_WALLSTART].colour)+5; @@ -1537,9 +1537,9 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { if(n==SPC_AIR||n==SPC_HEAT||n==SPC_COOL||n==SPC_VACUUM) { - if(x-26<=20) + if(x-18<=20) { - x = XRES-BARSIZE-26; + x = XRES-BARSIZE-18; y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, mwalls[n-UI_WALLSTART].colour)+5; @@ -1571,9 +1571,9 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { if(ptypes[n].menusection==i&&ptypes[n].menu==1) { - if(x-26<=20) + if(x-18<=20) { - x = XRES-BARSIZE-26; + x = XRES-BARSIZE-18; y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5; @@ -1608,9 +1608,9 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { if(ptypes[n].menusection==i&&ptypes[n].menu==1) { - if(x-26<=20) + if(x-18<=20) { - x = XRES-BARSIZE-26; + x = XRES-BARSIZE-18; y += 19; } x -= draw_tool_xy(vid_buf, x, y, n, ptypes[n].pcolors)+5; diff --git a/src/main.c b/src/main.c index c7818fc54..d191fad3a 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,7 @@ * Copyright (c) 2010 Skresanov Savely * Copyright (c) 2010 Bryan Hoyle * Copyright (c) 2010 Nathan Cousins + * Copyright (c) 2010 cracker64 * * 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 @@ -51,7 +52,7 @@ #include static const char *it_msg = - "\brThe Powder Toy\n" + "\brThe Powder Toy - http://powdertoy.co.uk/\n" "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\n" "\n" "\bgControl+C/V/X are Copy, Paste and cut respectively.\n" @@ -68,18 +69,16 @@ static const char *it_msg = "'L' will load the most recent stamp, 'K' shows a library of stamps you saved.\n" "'C' will cycle the display mode (Fire, Blob, Velocity and Pressure). The numbers 1 to 7 will do the same\n" "Use the mouse scroll wheel to change the tool size for particles.\n" - "'Q' will quit the application.\n" "The spacebar can be used to pause physics.\n" "'P' will take a screenshot and save it into the current directory.\n" "\n" - "\brhttp://powdertoy.co.uk/\n" "\bgCopyright (c) 2008-10 Stanislaw K Skowronek (\brhttp://powder.unaligned.org\bg, \bbirc.unaligned.org #wtf\bg)\n" "\bgCopyright (c) 2010 Simon Robertshaw (\brhttp://powdertoy.co.uk\bg, \bbirc.freenode.net #powder\bg)\n" "\bgCopyright (c) 2010 Skresanov Savely (Stickman)\n" + "\bgCopyright (c) 2010 cracker64\n" "\bgCopyright (c) 2010 Bryan Hoyle (New elements)\n" "\bgCopyright (c) 2010 Nathan Cousins (New elements, small engine mods.)\n" "\n" - "\bgSpecial thanks to Brian Ledbetter for maintaining ports.\n" "\bgTo use online features such as saving, you need to register at: \brhttp://powdertoy.co.uk/Register.html" ; @@ -2186,23 +2185,23 @@ int main(int argc, char *argv[]) } if(currentTime-pastFPS>=1000) { -#ifdef BETA - if(REPLACE_MODE) - sprintf(uitext, "Cracker's V%d FPS:%d Parts:%d REPLACE MODE", SAVE_VERSION, FPS,NUM_PARTS); - else if(sdl_mod&(KMOD_CAPS)) - sprintf(uitext, "Cracker's V%d FPS:%d Parts:%d CAPS LOCK ON", SAVE_VERSION, FPS, NUM_PARTS); - else if(GRID_MODE) - sprintf(uitext, "Cracker's V%d FPS:%d Parts:%d Grid:%d", SAVE_VERSION, FPS, NUM_PARTS,GRID_MODE); - else - sprintf(uitext, "Cracker's V%d FPS:%d Parts:%d", SAVE_VERSION, FPS, NUM_PARTS); - //printf("%s\n", uitext); -#else - sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPS); -#endif FPSB = FPS; FPS = 0; pastFPS = currentTime; } + +#ifdef BETA + sprintf(uitext, "Version %d Beta %d FPS:%d Parts:%d", SAVE_VERSION, MINOR_VERSION, FPSB, NUM_PARTS); +#else + sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPSB); +#endif + if(REPLACE_MODE) + strappend(uitext, " [REPLACE MODE]"); + if(sdl_mod&(KMOD_CAPS)) + strappend(uitext, " [CAP LOCKS]"); + if(GRID_MODE) + sprintf(uitext, "%s [GRID: %d]", uitext, GRID_MODE); + if(sdl_zoom_trig||zoom_en) { if(zoom_x Date: Mon, 6 Dec 2010 18:54:09 -0500 Subject: [PATCH 74/79] removed battery from INST wire, some other small fixes --- includes/powder.h | 24 +++++-------- src/graphics.c | 2 +- src/main.c | 8 ++--- src/powder.c | 85 ++++++++++++----------------------------------- 4 files changed, 35 insertions(+), 84 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index 1e987c99e..e0112a46c 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -164,17 +164,15 @@ #define PT_VINE 114 #define PT_INVIS 115 #define PT_EQUALVEL 116//all particles equal their velocities -#define PT_INST2 117 -#define PT_INST3 118 -#define PT_SHLD1 119 -#define PT_SHLD2 120 -#define PT_SHLD3 121 -#define PT_SHLD4 122 -#define PT_LOLZ 123 -#define PT_WIFI 124 -#define PT_FILT 125 -#define PT_XEON 126//radioactive gas -#define PT_NUM 127 +#define PT_SHLD1 117 +#define PT_SHLD2 118 +#define PT_SHLD3 119 +#define PT_SHLD4 120 +#define PT_LOLZ 121 +#define PT_WIFI 122 +#define PT_FILT 123 +#define PT_XEON 124//radioactive gas +#define PT_NUM 125 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -382,8 +380,6 @@ static const part_type ptypes[PT_NUM] = {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Vine, grows", TYPE_SOLID}, {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, - {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, - {"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, {"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", 0}, {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, @@ -516,8 +512,6 @@ static part_state pstates[PT_NUM] = /* VINE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 573.0f}, /* INVS */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* EQVE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* INST2*/ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* INST3*/ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD1*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD2*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD3*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, diff --git a/src/graphics.c b/src/graphics.c index bba3890d3..dffcc7c71 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1409,7 +1409,7 @@ void draw_parts(pixel *vid) cb = PIXB(ptypes[t].pcolors); blendpixel(vid, nx, ny, cr, cg, cb, 255); } - else if(cmode==CM_GRAD) + else if(cmode==CM_GRAD)//forgot to put else, broke nothing view { float frequency = 0.05; int q = parts[i].temp; diff --git a/src/main.c b/src/main.c index d191fad3a..94dc55c29 100644 --- a/src/main.c +++ b/src/main.c @@ -329,7 +329,7 @@ void *build_save(int *size, int x0, int y0, int w, int h) for(j=0; j=43) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34) || (ty==PT_PIPE && ver>=43))) + if(i && (ty==PT_CLNE || (ty==PT_PCLN && ver>=43) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34) || (ty==PT_PIPE && ver>=43) || (ty==PT_BCLN && ver>=43))) { if(p >= size) goto corrupt; @@ -2195,12 +2195,12 @@ int main(int argc, char *argv[]) #else sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPSB); #endif + if(GRID_MODE) + sprintf(uitext, "%s [GRID: %d]", uitext, GRID_MODE); if(REPLACE_MODE) strappend(uitext, " [REPLACE MODE]"); if(sdl_mod&(KMOD_CAPS)) strappend(uitext, " [CAP LOCKS]"); - if(GRID_MODE) - sprintf(uitext, "%s [GRID: %d]", uitext, GRID_MODE); if(sdl_zoom_trig||zoom_en) { diff --git a/src/powder.c b/src/powder.c index f6cc143fd..f2d308fd7 100644 --- a/src/powder.c +++ b/src/powder.c @@ -405,25 +405,6 @@ inline int create_part(int p, int x, int y, int t) return -1; } } - if(t==PT_INST2) - if((pmap[y][x]&0xFF)==PT_INST) - { - parts[pmap[y][x]>>8].type = PT_INST2; - parts[pmap[y][x]>>8].life += 5; - pmap[y][x] = (pmap[y][x]&~0xFF) | PT_INST2; - return pmap[y][x]>>8; - } - if(t==PT_INST3) - if((pmap[y][x]&0xFF)==PT_INST||(pmap[y][x]&0xFF)==PT_INST2) - { - parts[pmap[y][x]>>8].type = PT_INST3; - if(parts[pmap[y][x]>>8].life%4==0) - parts[pmap[y][x]>>8].life -=0; - else - parts[pmap[y][x]>>8].life -= 2; - pmap[y][x] = (pmap[y][x]&~0xFF) | PT_INST3; - return pmap[y][x]>>8; - } if(t==SPC_AIR) { pv[y/CELL][x/CELL] += 0.03f; @@ -467,6 +448,7 @@ inline int create_part(int p, int x, int y, int t) (pmap[y][x]&0xFF)!=PT_BRMT && (pmap[y][x]&0xFF)!=PT_NBLE && (pmap[y][x]&0xFF)!=PT_IRON && + (pmap[y][x]&0xFF)!=PT_INST && (pmap[y][x]&0xFF)!=PT_INWR) return -1; if(parts[pmap[y][x]>>8].life!=0) @@ -1140,7 +1122,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL && t!=PT_CRAC && t!=PT_DEUT) { - if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC||parts[i].type==PT_PUMP)) && !(parts[i].life%4==0 && parts[i].type==PT_INST)) + if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC||parts[i].type==PT_PUMP))) parts[i].life--; if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_PUMP && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST && t!=PT_SHLD1&& t!=PT_SHLD2&& t!=PT_SHLD3&& t!=PT_SHLD4) { @@ -2813,33 +2795,11 @@ void update_particles_i(pixel *vid, int start, int inc) continue; else if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)&&(parts[r>>8].life>=3)&&parts[i].life%4==0) { - flood_parts(x,y,PT_INST2,PT_INST,-1);//add life + flood_parts(x,y,PT_SPRK,PT_INST,-1);//add life parts[r>>8].type==parts[r>>8].ctype; } - else if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0&&(parts[i].life>=4)&&parts[i].life%4<=1) - { - create_part(-1,x+nx,y+ny,PT_SPRK); - flood_parts(x,y,PT_INST3,PT_INST,-1);//sub life - } - else if(parts[r>>8].type==PT_SWCH&&parts[r>>8].life==10&&(parts[i].life>=4)&&parts[i].life%4<=1) - { - parts[r>>8].type=PT_SPRK; - parts[r>>8].ctype=PT_SWCH; - parts[r>>8].life=4; - flood_parts(x,y,PT_INST3,PT_INST,-1);//sub life - } } } - else if(t==PT_INST2) - { - if(parts[i].life%4<=1) - t = parts[pmap[y][x]>>8].type=PT_INST; - } - else if(t==PT_INST3) - { - if(parts[i].life%4<=1) - t = parts[pmap[y][x]>>8].type=PT_INST; - } else if(t==PT_PRTI) { int count =0; @@ -3941,6 +3901,8 @@ killed: x+nx> 8; if(!parts[lt].ctype) parts[lt].ctype = PT_PHOT; @@ -4857,8 +4820,8 @@ 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) { @@ -4900,9 +4863,6 @@ int flood_parts(int x, int y, int c, int cm, int bm) { if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm) { - if(cm!=PT_INST) - break; - else if((pmap[y][x1-1]&0xFF)!=PT_INST2&&(pmap[y][x1-1]&0xFF)!=PT_INST3) break; } x1--; @@ -4911,9 +4871,6 @@ int flood_parts(int x, int y, int c, int cm, int bm) { if((pmap[y][x2+1]&0xFF)!=cm || bmap[y/CELL][(x2+1)/CELL]!=bm) { - if(cm!=PT_INST) - break; - else if((pmap[y][x1+1]&0xFF)!=PT_INST2&&(pmap[y][x1+1]&0xFF)!=PT_INST3) break; } x2++; @@ -4926,36 +4883,36 @@ int flood_parts(int x, int y, int c, int cm, int bm) return 0; } // fill children - if(cm==PT_INST&&(co==PT_INST2||co==PT_INST3))//crossings for inst wire, same as walls + if(cm==PT_INST&&co==PT_SPRK)//wire crossing for INST { if(y>=CELL+dy && x1==x2 && - ((pmap[y-1][x1-1]&0xFF)==PT_INST||((pmap[y-1][x1-1]&0xFF)==PT_INST3||(pmap[y-1][x1-1]&0xFF)==PT_INST2)) && ((pmap[y-1][x1]&0xFF)==PT_INST||((pmap[y-1][x1]&0xFF)==PT_INST3||(pmap[y-1][x1]&0xFF)==PT_INST2)) && ((pmap[y-1][x1+1]&0xFF)==PT_INST || ((pmap[y-1][x1+1]&0xFF)==PT_INST3||(pmap[y-1][x1+1]&0xFF)==PT_INST2)) && - (pmap[y-2][x1-1]&0xFF)!=PT_INST && ((pmap[y-2][x1]&0xFF)==PT_INST ||((pmap[y-2][x1]&0xFF)==PT_INST3||(pmap[y-2][x1]&0xFF)==PT_INST2)) && (pmap[y-2][x1+1]&0xFF)!=PT_INST) + ((pmap[y-1][x1-1]&0xFF)==PT_INST||(pmap[y-1][x1-1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1]&0xFF)==PT_INST||(pmap[y-1][x1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1+1]&0xFF)==PT_INST || (pmap[y-1][x1+1]&0xFF)==PT_SPRK) && + (pmap[y-2][x1-1]&0xFF)!=PT_INST && ((pmap[y-2][x1]&0xFF)==PT_INST ||(pmap[y-2][x1]&0xFF)==PT_SPRK) && (pmap[y-2][x1+1]&0xFF)!=PT_INST) flood_parts(x1, y-2, co, cm, bm); else if(y>=CELL+dy) for(x=x1; x<=x2; x++) - if((pmap[y-1][x]&0xFF)!=co) + if((pmap[y-1][x]&0xFF)!=PT_SPRK) { if(x==x1 || x==x2 || y>=YRES-CELL-1 || (pmap[y-1][x-1]&0xFF)==PT_INST || (pmap[y-1][x+1]&0xFF)==PT_INST || - (pmap[y+1][x-1]&0xFF)==PT_INST || ((pmap[y+1][x]&0xFF)!=PT_INST&&(pmap[y+1][x]&0xFF)!=co) || (pmap[y+1][x+1]&0xFF)==PT_INST) + (pmap[y+1][x-1]&0xFF)==PT_INST || ((pmap[y+1][x]&0xFF)!=PT_INST&&(pmap[y+1][x]&0xFF)!=PT_SPRK) || (pmap[y+1][x+1]&0xFF)==PT_INST) flood_parts(x, y-dy, co, cm, bm); - + } if(y Date: Wed, 8 Dec 2010 12:14:02 -0500 Subject: [PATCH 75/79] Bugfix for wifi, would cause a double spark if timed just right. updated to --- includes/defines.h | 2 +- includes/interface.h | 6 +- includes/powder.h | 79 +++++++++++++--------- src/graphics.c | 83 ++++++++++++++++++++++- src/interface.c | 23 ++++--- src/main.c | 90 ++++++++++++++++++++----- src/powder.c | 156 +++++++++++++++++++++++++++++++------------ 7 files changed, 330 insertions(+), 109 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index f5d238599..18c98691b 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -8,7 +8,7 @@ #endif #define SAVE_VERSION 44 -#define MINOR_VERSION 1 +#define MINOR_VERSION 2 #define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter. #define BETA diff --git a/includes/interface.h b/includes/interface.h index a5f1a116a..381458c4b 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -53,7 +53,8 @@ static menu_wall mwalls[] = #define SC_NUCLEAR 7 #define SC_LIFE 9 #define SC_CRACKER 10 -#define SC_TOTAL 10 +#define SC_CRACKER2 11 +#define SC_TOTAL 11 static menu_section msections[] = { @@ -67,7 +68,8 @@ static menu_section msections[] = {"\xC6", "Radioactive", 0, 1}, {"\xCC", "Special", 0, 1}, {"\xC8", "Life", 0, 1}, - {"\xC8", "Cracker", 0, 0}, + {"\xC8", "Cracker", 0, 1}, + {"\xC8", "Cracker!", 0, 0}, }; struct ui_edit diff --git a/includes/powder.h b/includes/powder.h index e0112a46c..25044dab9 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -164,15 +164,19 @@ #define PT_VINE 114 #define PT_INVIS 115 #define PT_EQUALVEL 116//all particles equal their velocities -#define PT_SHLD1 117 -#define PT_SHLD2 118 -#define PT_SHLD3 119 -#define PT_SHLD4 120 -#define PT_LOLZ 121 -#define PT_WIFI 122 -#define PT_FILT 123 -#define PT_XEON 124//radioactive gas -#define PT_NUM 125 +#define PT_INST2 117 +#define PT_INST3 118 +#define PT_SHLD1 119 +#define PT_SHLD2 120 +#define PT_SHLD3 121 +#define PT_SHLD4 122 +#define PT_LOLZ 123 +#define PT_WIFI 124 +#define PT_FILT 125 +#define PT_XEON 126//radioactive gas +#define PT_ARAY 127 +#define PT_BRAY 128 +#define PT_NUM 129 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -339,8 +343,8 @@ static const part_type ptypes[PT_NUM] = {"BCOL", PIXPACK(0x333333), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Coal. Heavy particles. See COAL", TYPE_PART}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches.", TYPE_SOLID}, {"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, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", TYPE_SOLID}, - {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, - {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, + {"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 1, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID}, + {"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 1, -1, SC_CRACKER2, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART}, {"GOL ", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! (23/3)", TYPE_SOLID}, {"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL 23/36)", TYPE_SOLID}, {"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (4567/345)", TYPE_SOLID}, @@ -354,21 +358,21 @@ static const part_type ptypes[PT_NUM] = {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! (5/345)", TYPE_SOLID}, {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, {"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.",TYPE_SOLID}, - {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_CRACKER, 243.15f, 100, "Not quite Ice",TYPE_SOLID}, + {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_CRACKER2, 243.15f, 100, "Not quite Ice",TYPE_SOLID}, {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, 243.15f, 100, "Not quite Steam",TYPE_GAS}, {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, - {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, + {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER2, 373.0f, 40, "Love...", TYPE_SOLID}, {"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_NUCLEAR, R_TEMP +273.15f, 100, "Displaces other elements.",TYPE_GAS}, {"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_ELEC, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 100, "First fireworks made, activated by heat/neutrons."}, {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SOLIDS, 273.15f, 0, "Moves elements around, read FAQ on website for help.", TYPE_SOLID}, - {"FRZZ", 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, 0, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, - {"FRZW", 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, 0, 30, SC_CRACKER, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID}, + {"FRZZ", 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, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, + {"FRZW", 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, 30, SC_CRACKER, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID}, {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Changes colour based on velocity.", TYPE_PART}, {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, - {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, SC_CRACKER, R_TEMP-200.0f+273.15f, 42, "@_@ gas", TYPE_GAS}, - {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_CRACKER, R_TEMP+300.0f+273.15f, 251, "@_@ solid", TYPE_SOLID}, + {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER2, R_TEMP-200.0f+273.15f, 42, "@_@ gas", TYPE_GAS}, + {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER2, R_TEMP+300.0f+273.15f, 251, "@_@ solid", TYPE_SOLID}, {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery, PSCN to charge, NSCN to take.", TYPE_SOLID|PROP_CONDUCTS}, {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 24, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID}, @@ -379,33 +383,37 @@ static const part_type ptypes[PT_NUM] = {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite gravity", TYPE_PART}, {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Vine, grows", TYPE_SOLID}, {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, - {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, + {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, + {"int2", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, + {"int3", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, {"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, - {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", 0}, - {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, - {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0}, - {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 373.0f, 40, "Lolz", TYPE_SOLID}, + {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", 0}, + {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, + {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0}, + {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER2, 373.0f, 40, "Lolz", TYPE_SOLID}, {"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID}, {"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", TYPE_SOLID}, {"XEON", PIXPACK(0xEB7917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_NUCLEAR, R_TEMP+2.0f +273.15f, 106, "Radioactive gas, absorbs neutrons.", TYPE_GAS}, - + {"ARAY", PIXPACK(0xFFBB00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Emmitter. Rays create points when they collide", TYPE_SOLID}, + {"BRAY", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Point. Rays create points when they collide", TYPE_SOLID} + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; static part_state pstates[PT_NUM] = { - // Name Solid Frzp Liquid Mpnt Gas Bpoint + // Name State Solid Frzp Liquid Mpnt Gas Bpoint 'Plasma' Flashpoint /* 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}, + /* 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}, + /* 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}, @@ -413,12 +421,12 @@ static part_state pstates[PT_NUM] = /* 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}, + /* 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_RIME, 273.0f, PT_DSTW, 371.0f, PT_NONE, 373.0f, PT_NONE, 0.0f}, + /* WTRV */ {ST_GAS, PT_RIME, 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}, @@ -426,7 +434,7 @@ static part_state pstates[PT_NUM] = /* 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}, + /* 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}, @@ -447,7 +455,7 @@ static part_state pstates[PT_NUM] = /* 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}, + /* 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}, @@ -456,14 +464,14 @@ static part_state pstates[PT_NUM] = /* 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}, + /* 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}, + /* 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}, @@ -512,6 +520,8 @@ static part_state pstates[PT_NUM] = /* VINE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 573.0f}, /* INVS */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* EQVE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* INST2*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* INST3*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD1*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD2*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD3*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, @@ -520,6 +530,8 @@ static part_state pstates[PT_NUM] = /* WIFI */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* FILT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* RGAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* ARAY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, + /* BRAY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f} }; static int grule[NGOL][9] = @@ -564,7 +576,8 @@ static int lolzrule[9][9] = {0,1,0,0,0,0,0,1,0}, }; int portal[8][8]; -int wireless[25]; +float portaltemp[8][8]; +int wireless[25][2]; extern int isplayer; extern float player[27]; diff --git a/src/graphics.c b/src/graphics.c index dffcc7c71..9b89f79b0 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1402,12 +1402,35 @@ void draw_parts(pixel *vid) isplayer = 1; //It's a secret. Tssss... } - if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP)//nothing display but show needed color changes + if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP && t!=PT_FILT)//nothing display but show needed color changes { + if(t==PT_PHOT) + { + cg = 0; + cb = 0; + cr = 0; + for(x=0; x<12; x++) { + cr += (parts[i].ctype >> (x+18)) & 1; + cb += (parts[i].ctype >> x) & 1; + } + for(x=0; x<14; x++) + cg += (parts[i].ctype >> (x+9)) & 1; + x = 624/(cr+cg+cb+1); + cr *= x; + cg *= x; + cb *= x; + cr = cr>255?255:cr; + cg = cg>255?255:cg; + cb = cb>255?255:cb; + blendpixel(vid, nx, ny, cr, cg, cb, 255); + } + else + { cr = PIXR(ptypes[t].pcolors); cg = PIXG(ptypes[t].pcolors); cb = PIXB(ptypes[t].pcolors); blendpixel(vid, nx, ny, cr, cg, cb, 255); + } } else if(cmode==CM_GRAD)//forgot to put else, broke nothing view { @@ -1789,6 +1812,21 @@ void draw_parts(pixel *vid) cb = cb>255?255:cb; blendpixel(vid, nx, ny, cr, cg, cb, 127); } + else if(t==PT_BRAY && parts[i].tmp==0) + { + int trans = parts[i].life * 7; + blendpixel(vid, nx, ny, PIXR(ptypes[t].pcolors), PIXG(ptypes[t].pcolors), PIXB(ptypes[t].pcolors), trans); + } + else if(t==PT_BRAY && parts[i].tmp==1) + { + int trans = parts[i].life/4; + blendpixel(vid, nx, ny, PIXR(ptypes[t].pcolors), PIXG(ptypes[t].pcolors), PIXB(ptypes[t].pcolors), trans); + } + else if(t==PT_BRAY && parts[i].tmp==2) + { + int trans = parts[i].life*100; + blendpixel(vid, nx, ny, 255, 150, 50, trans); + } else if(t==PT_PHOT) { if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY) @@ -2805,6 +2843,47 @@ pixel *prerender_save(void *save, int size, int *width, int *height) else fb[(ry+j)*w+(rx+i)] = PIXPACK(0x808080); break; + case WL_WALL: + for(j=0; j>1)&1; i>1)&1; i>1)&1; i0) { - if(j==PT_STKM) //Stickman should be drawed another way + if(j==PT_STKM) { //Stickman drawing for(k=-2; k<=1; k++) diff --git a/src/interface.c b/src/interface.c index 044b65c77..af679d83d 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1500,7 +1500,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { if(n!=SPC_AIR&&n!=SPC_HEAT&&n!=SPC_COOL&&n!=SPC_VACUUM) { - if(x-18<=20) + if(x-18<=2) { x = XRES-BARSIZE-18; y += 19; @@ -1537,7 +1537,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { if(n==SPC_AIR||n==SPC_HEAT||n==SPC_COOL||n==SPC_VACUUM) { - if(x-18<=20) + if(x-18<=0) { x = XRES-BARSIZE-18; y += 19; @@ -1571,7 +1571,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { if(ptypes[n].menusection==i&&ptypes[n].menu==1) { - if(x-18<=20) + if(x-18<=0) { x = XRES-BARSIZE-18; y += 19; @@ -1608,7 +1608,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { if(ptypes[n].menusection==i&&ptypes[n].menu==1) { - if(x-18<=20) + if(x-18<=0) { x = XRES-BARSIZE-18; y += 19; @@ -2190,7 +2190,7 @@ int search_ui(pixel *vid_buf) drawrect(vid_buf, gx-2, gy-2, XRES/GRID_S+3, YRES/GRID_S+3, 160, 160, 192, 255); else drawrect(vid_buf, gx-2, gy-2, XRES/GRID_S+3, YRES/GRID_S+3, 128, 128, 128, 255); - if(own) + if(own && search_fav!=1) { if(dp == pos) drawtext(vid_buf, gx+XRES/GRID_S-4, gy-6, "\x86", 255, 48, 32, 255); @@ -2321,7 +2321,7 @@ int search_ui(pixel *vid_buf) lasttime = TIMEOUT; } - if(b && !bq && dp!=-1) + if(b && !bq && dp!=-1 && search_fav!=0) if(confirm_ui(vid_buf, "Do you want to delete?", search_names[dp], "Delete")) { execute_delete(vid_buf, search_ids[dp]); @@ -2720,9 +2720,14 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) if(status == 200) { pixel *full_save = prerender_save(data, data_size, &imgw, &imgh); - save_pic = rescale_img(full_save, imgw, imgh, &thumb_w, &thumb_h, 2); - data_ready = 1; - free(full_save); + if(full_save!=NULL){ + save_pic = rescale_img(full_save, imgw, imgh, &thumb_w, &thumb_h, 2); + data_ready = 1; + free(full_save); + } else { + error_ui(vid_buf, 0, "Save may be from a newer version"); + break; + } } active = 0; free(http); diff --git a/src/main.c b/src/main.c index 94dc55c29..ccc87a213 100644 --- a/src/main.c +++ b/src/main.c @@ -233,7 +233,7 @@ void *build_thumb(int *size, int bzip2) void *build_save(int *size, int x0, int y0, int w, int h) { - unsigned char *d=calloc(1,3*(XRES/CELL)*(YRES/CELL)+(XRES*YRES)*8+MAXSIGNS*262), *c; + 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; @@ -249,7 +249,7 @@ void *build_save(int *size, int x0, int y0, int w, int h) d[p++] = bmap[y][x]; for(y=by0; y>8); d[p++] = (ttlife&0x00FF); } + } + for(j=0; j>8); + d[p++] = (tttmp&0x00FF); + } } for(j=0; j=44){ + legacy_enable = c[3]&0x01; + if(!sys_pause){ + sys_pause = (c[3]>>1)&0x01; + } + } else { + if(c[3]==1||c[3]==0){ + legacy_enable = c[3]; + } else { + legacy_beta = 1; + } + } } bw = c[6]; @@ -519,7 +538,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) } for(y=by0; y= size) goto corrupt; @@ -527,7 +546,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) } for(y=by0; y= size) goto corrupt; @@ -648,6 +667,25 @@ int parse_save(void *save, int size, int replace, int x0, int y0) } } } + if(ver>=44){ + for(j=0; j= size) { + goto corrupt; + } + if(i <= NPART) { + ttv = (d[p++])<<8; + ttv |= (d[p++]); + parts[i-1].tmp = ttv; + } else { + p+=2; + } + } + } + } for(j=0; j=43) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34) || (ty==PT_PIPE && ver>=43) || (ty==PT_BCLN && ver>=43))) + if(i && (ty==PT_CLNE || (ty==PT_PCLN && ver>=43) || (ty==PT_BCLN && ver>=44) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34) || (ty==PT_PIPE && ver>=43))) { if(p >= size) goto corrupt; @@ -1027,8 +1065,8 @@ int main(int argc, char *argv[]) #ifdef BETA int is_beta = 0; #endif - char uitext[48] = ""; - char heattext[64] = ""; + char uitext[255] = ""; + char heattext[128] = ""; int currentTime = 0; int FPS = 0; int pastFPS = 0; @@ -1187,6 +1225,17 @@ int main(int argc, char *argv[]) memset(vid_buf, 0, (XRES+BARSIZE)*YRES*PIXELSIZE); } #endif + + //Can't be too sure... + if(bsx>1180) + bsx = 1180; + if(bsx<0) + bsx = 0; + if(bsy>1180) + bsy = 1180; + if(bsy<0) + bsy = 0; + update_particles(vid_buf); draw_parts(vid_buf); @@ -1412,6 +1461,8 @@ int main(int argc, char *argv[]) bsy = 0; } } + if((sdl_mod & (KMOD_RCTRL) )&&( sdl_mod & (KMOD_RALT))) + active_menu = 11; if(sdl_key==SDLK_INSERT) REPLACE_MODE = !REPLACE_MODE; if(sdl_key=='g') @@ -1901,8 +1952,11 @@ int main(int argc, char *argv[]) memset(fire_g, 0, sizeof(fire_g)); memset(fire_b, 0, sizeof(fire_b)); } - if(x>=19 && x<=35 && svf_last && svf_open && !bq) - parse_save(svf_last, svf_lsize, 1, 0, 0); + if(x>=19 && x<=35 && svf_last && svf_open && !bq){ + //int tpval = sys_pause; + parse_save(svf_last, svf_lsize, 1, 0, 0); + //sys_pause = tpval; + } if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) { if(b & SDL_BUTTON_LMASK) @@ -2195,12 +2249,12 @@ int main(int argc, char *argv[]) #else sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPSB); #endif - if(GRID_MODE) - sprintf(uitext, "%s [GRID: %d]", uitext, GRID_MODE); if(REPLACE_MODE) strappend(uitext, " [REPLACE MODE]"); if(sdl_mod&(KMOD_CAPS)) strappend(uitext, " [CAP LOCKS]"); + if(GRID_MODE) + sprintf(uitext, "%s [GRID: %d]", uitext, GRID_MODE); if(sdl_zoom_trig||zoom_en) { diff --git a/src/powder.c b/src/powder.c index f2d308fd7..424c4a7e2 100644 --- a/src/powder.c +++ b/src/powder.c @@ -504,8 +504,12 @@ inline int create_part(int p, int x, int y, int t) parts[i].life = 50; parts[i].tmp = 50; } - if(t==PT_PUMP) - parts[i].life= 10; + if(t==PT_DEUT) + parts[i].life = 20; + if(t==PT_BRAY) + parts[i].life = 30; + if(t==PT_PUMP) + parts[i].life= 10; if(t==PT_FSEP) parts[i].life = 50; if(t==PT_COAL) { @@ -863,7 +867,7 @@ int nearest_part(int ci, int t) void update_particles_i(pixel *vid, int start, int inc) { - int i, j, x, y, t, nx, ny, r, a, s, lt, rt, fe, nt, lpv, nearp, pavg; + int i, j, x, y, t, nx, ny, r, a, s, lt, rt, fe, nt, lpv, nearp, pavg, nnx, nny, q, golnum, goldelete, z, ctype, temp, trade; float mv, dx, dy, ix, iy, lx, ly, d, pp, nrx, nry, dp; float nn, ct1, ct2; float pt = R_TEMP; @@ -882,7 +886,7 @@ void update_particles_i(pixel *vid, int start, int inc) GRAV_R2 = 30; GRAV_G2 = 30; GRAV_B2 = 0; - for(int q = 0;q <= GRAV;q++) + for( q = 0;q <= GRAV;q++) { if(GRAV_R >0 && GRAV_G==0) { @@ -945,8 +949,8 @@ void update_particles_i(pixel *vid, int start, int inc) { if(love[nx/9][ny/9]==1) { - for(int nnx=0;nnx<9;nnx++) - for(int nny=0;nny<9;nny++) + for( nnx=0;nnx<9;nnx++) + for( nny=0;nny<9;nny++) { if(ny+nny>0&&ny+nny=0&&nx+nnx0&&ny+nny=0&&nx+nnx>8].type==golnum+77) { gol[nx][ny] = golnum; - for(int nnx=-1;nnx<2;nnx++) - for(int nny=-1;nny<2;nny++)//it will count itself as its own neighbor, which is needed, but will have 1 extra for delete check + for( nnx=-1;nnx<2;nnx++) + for( nny=-1;nny<2;nny++)//it will count itself as its own neighbor, which is needed, but will have 1 extra for delete check { if(ny+nny<4&&nx+nnx<4){//any way to make wrapping code smaller? gol2[XRES-5][YRES-5][golnum] ++; @@ -1086,8 +1090,8 @@ void update_particles_i(pixel *vid, int start, int inc) int neighbors = gol2[nx][ny][0]; if(neighbors==0) continue; - for(int golnum = 1;golnum=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2) { @@ -1097,19 +1101,24 @@ void update_particles_i(pixel *vid, int start, int inc) parts[pmap[ny][nx]>>8].type = PT_NONE; } gol2[nx][ny][0] = 0; - for(int z = 1;z=0 && y+ny>0 && x+nx>8)>=NPART || !r) + continue; + if((r&0xFF)==PT_SPRK){ + int destroy = (parts[r>>8].ctype==PT_PSCN)?1:0; + for (int docontinue = 1, nxx = 0, nyy = 0, nxi = nx*-1, nyi = ny*-1; docontinue; nyy+=nyi, nxx+=nxi) { + if(!(x+nxi+nxx= 0 && y+nyi+nyy >= 0)){ + break; + } + r = pmap[y+nyi+nyy][x+nxi+nxx]; + if(!((r>>8)>=NPART)) { + if(!r){ + int nr = create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_BRAY); + if(nr!=-1&&destroy){ + parts[nr].tmp = 2; + parts[nr].life = 2; + } + } else if(!destroy) { + if(parts[r>>8].type==PT_BRAY&&parts[r>>8].tmp==0){ + if(nyy!=0 || nxx!=0){ + parts[r>>8].type = PT_BRAY; + parts[r>>8].life = 1020; + parts[r>>8].tmp = 1; + } + docontinue = 0; + } else if(parts[r>>8].type==PT_BRAY&&parts[r>>8].tmp==1){ + parts[r>>8].life = 1020; + //docontinue = 1; + } else { + if(nyy!=0 || nxx!=0){ + create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK); + } + docontinue = 0; + } + } else if(destroy) { + if(parts[r>>8].type==PT_BRAY){ + parts[r>>8].life = 1; + docontinue = 1; + } else { + docontinue = 0; + } + } + } + } + } + //parts[i].life = 4; + } + } + } + } else if(t==PT_FUSE) { if(parts[i].life<=0) { @@ -2334,7 +2397,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life--; } } - for(int trade = 0; trade<9;trade ++) + for( trade = 0; trade<9;trade ++) { nx = rand()%5-2; ny = rand()%5-2; @@ -2480,9 +2543,10 @@ void update_particles_i(pixel *vid, int start, int inc) create_part(-1,x+nx,y+ny,PT_DEUT); parts[i].life--; parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; + parts[pmap[y+ny][x+nx]>>8].life = 0; } } - for(int trade = 0; trade<4;trade ++) + for( trade = 0; trade<4;trade ++) { nx = rand()%5-2; ny = rand()%5-2; @@ -2510,7 +2574,7 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_WARP) { - for(int trade = 0; trade<5;trade ++) + for( trade = 0; trade<5;trade ++) { nx = rand()%3-1; ny = rand()%3-1; @@ -2679,8 +2743,8 @@ void update_particles_i(pixel *vid, int start, int inc) } } if(parts[i].ctype>1) - for(int o = 0;o<3;o++) - for(int ctype = 2;ctype<5;ctype++) + for( q = 0;q<3;q++) + for( ctype = 2;ctype<5;ctype++) { if(parts[i].ctype==ctype) { @@ -2813,10 +2877,11 @@ void update_particles_i(pixel *vid, int start, int inc) if((r>>8)>=NPART || !r) continue; if(parts[r>>8].type==PT_SPRK || (parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS))) - for(int nnx=0;nnx<8;nnx++) + for( nnx=0;nnx<8;nnx++) if(!portal[count-1][nnx]) { portal[count-1][nnx] = parts[r>>8].type; + portaltemp[count-1][nnx] = parts[r>>8].temp; if(parts[r>>8].type==PT_SPRK) parts[r>>8].type = parts[r>>8].ctype; else @@ -2839,7 +2904,7 @@ void update_particles_i(pixel *vid, int start, int inc) continue; if(!r) { - for(int nnx =0 ;nnx<8;nnx++) + for( nnx =0 ;nnx<8;nnx++) { int randomness = count + rand()%3-1; if(randomness<1) @@ -2857,12 +2922,15 @@ void update_particles_i(pixel *vid, int start, int inc) create_part(-1,x-1,y,portal[randomness-1][nnx]); create_part(-1,x-1,y-1,portal[randomness-1][nnx]); portal[randomness-1][nnx] = 0; + portaltemp[randomness-1][nnx] = 0; break; } else if(portal[randomness-1][nnx]) { create_part(-1,x+nx,y+ny,portal[randomness-1][nnx]); + parts[pmap[y+ny][x+nx]>>8].temp = portaltemp[randomness-1][nnx]; portal[randomness-1][nnx] = 0; + portaltemp[randomness-1][nnx] = 0; break; } } @@ -2871,9 +2939,8 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_WIFI) { - CGOL = 1; int temprange = 100; - for(int temp = 0; temp < 2500; temp += temprange) + for( temp = 0; temp < 2500; temp += temprange) if(parts[i].temp-273.15>temp&&parts[i].temp-273.15>8)>=NPART || !r) continue; - if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp]) + if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp][0]) { parts[r>>8].type = PT_SPRK; parts[r>>8].ctype = PT_NSCN; parts[r>>8].life = 4; } - else if(parts[r>>8].type==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3 && !wireless[parts[i].tmp]) + else if(parts[r>>8].type==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3 && !wireless[parts[i].tmp][0]) { parts[r>>8].type = parts[r>>8].ctype; - wireless[parts[i].tmp] = 1; + wireless[parts[i].tmp][0] = 1; + wireless[parts[i].tmp][1] = 1; ISWIRE = 1; } } @@ -3014,8 +3082,8 @@ void update_particles_i(pixel *vid, int start, int inc) if((r>>8)>=NPART || !r) continue; else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) - for(int nnx=-1;nnx<2;nnx++) - for(int nny=-1;nny<2;nny++) + for( nnx=-1;nnx<2;nnx++) + for( nny=-1;nny<2;nny++) { if(7>rand()%200&&parts[i].life==0) { @@ -3050,8 +3118,8 @@ void update_particles_i(pixel *vid, int start, int inc) if(!r) continue; else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) - for(int nnx=-1;nnx<2;nnx++) - for(int nny=-1;nny<2;nny++) + for( nnx=-1;nnx<2;nnx++) + for( nny=-1;nny<2;nny++) { if(3>rand()%200&&parts[i].life==0) { @@ -3099,8 +3167,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].life=7; } else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) - for(int nnx=-1;nnx<2;nnx++) - for(int nny=-1;nny<2;nny++) + for( nnx=-1;nnx<2;nnx++) + for( nny=-1;nny<2;nny++) { if(2>rand()%3000&&parts[i].life==0) { @@ -3143,8 +3211,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].life = 7; } else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) - for(int nnx=-1;nnx<2;nnx++) - for(int nny=-1;nny<2;nny++) + for( nnx=-1;nnx<2;nnx++) + for( nny=-1;nny<2;nny++) { if(!pmap[y+ny+nny][x+nx+nnx]) { @@ -4934,10 +5002,10 @@ 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) { - int i, j, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0;//n; + int i, j, r, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0;//n; int wall = c - 100; - for(int r=UI_ACTUALSTART;r<=UI_ACTUALSTART+UI_WALLCOUNT;r++) + for(r=UI_ACTUALSTART;r<=UI_ACTUALSTART+UI_WALLCOUNT;r++) { if(wall==r) { From d017764fbef66fffa058a79d0e3d569f75121a1e Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Wed, 8 Dec 2010 14:53:53 -0500 Subject: [PATCH 76/79] Photons no longer give heat to insulation type things. is basically the same as official besides a few bug fixes. --- includes/defines.h | 4 ++-- includes/interface.h | 4 ++-- includes/powder.h | 16 ++++++++-------- src/powder.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 18c98691b..59559a043 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -8,9 +8,9 @@ #endif #define SAVE_VERSION 44 -#define MINOR_VERSION 2 +#define MINOR_VERSION 6 #define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter. -#define BETA +//#define BETA #define SERVER "powdertoy.co.uk" diff --git a/includes/interface.h b/includes/interface.h index 381458c4b..57700b28d 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -54,7 +54,7 @@ static menu_wall mwalls[] = #define SC_LIFE 9 #define SC_CRACKER 10 #define SC_CRACKER2 11 -#define SC_TOTAL 11 +#define SC_TOTAL 10 static menu_section msections[] = { @@ -68,7 +68,7 @@ static menu_section msections[] = {"\xC6", "Radioactive", 0, 1}, {"\xCC", "Special", 0, 1}, {"\xC8", "Life", 0, 1}, - {"\xC8", "Cracker", 0, 1}, + {"\xC8", "Cracker", 0, 0}, {"\xC8", "Cracker!", 0, 0}, }; diff --git a/includes/powder.h b/includes/powder.h index 25044dab9..f42fcbc15 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -359,7 +359,7 @@ static const part_type ptypes[PT_NUM] = {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! (235678/3678)", TYPE_SOLID}, {"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.",TYPE_SOLID}, {"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_CRACKER2, 243.15f, 100, "Not quite Ice",TYPE_SOLID}, - {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, 243.15f, 100, "Not quite Steam",TYPE_GAS}, + {"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER2, 243.15f, 100, "Not quite Steam",TYPE_GAS}, {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, {"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER2, 373.0f, 40, "Love...", TYPE_SOLID}, {"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, @@ -367,13 +367,13 @@ static const part_type ptypes[PT_NUM] = {"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_ELEC, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", TYPE_SOLID}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 100, "First fireworks made, activated by heat/neutrons."}, {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SOLIDS, 273.15f, 0, "Moves elements around, read FAQ on website for help.", TYPE_SOLID}, - {"FRZZ", 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, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, - {"FRZW", 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, 30, SC_CRACKER, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID}, + {"FRZZ", 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, 50, SC_CRACKER2, 90.0f, 46, "FREEZE", TYPE_PART}, + {"FRZW", 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, 30, SC_CRACKER2, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID}, {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Changes colour based on velocity.", TYPE_PART}, {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER2, R_TEMP-200.0f+273.15f, 42, "@_@ gas", TYPE_GAS}, {"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER2, R_TEMP+300.0f+273.15f, 251, "@_@ solid", TYPE_SOLID}, - {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery, PSCN to charge, NSCN to take.", TYPE_SOLID|PROP_CONDUCTS}, + {"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery, PSCN to charge, NSCN to take.", TYPE_SOLID|PROP_CONDUCTS}, {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 24, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID}, {"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID}, @@ -383,9 +383,9 @@ static const part_type ptypes[PT_NUM] = {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite gravity", TYPE_PART}, {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Vine, grows", TYPE_SOLID}, {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, - {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, - {"int2", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, - {"int3", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, + {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER2, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, + {"int2", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, + {"int3", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, {"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", 0}, {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, @@ -393,7 +393,7 @@ static const part_type ptypes[PT_NUM] = {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER2, 373.0f, 40, "Lolz", TYPE_SOLID}, {"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID}, {"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", TYPE_SOLID}, - {"XEON", PIXPACK(0xEB7917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_NUCLEAR, R_TEMP+2.0f +273.15f, 106, "Radioactive gas, absorbs neutrons.", TYPE_GAS}, + {"XEON", PIXPACK(0xEB7917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER2, R_TEMP+2.0f +273.15f, 106, "Radioactive gas, absorbs neutrons.", TYPE_GAS}, {"ARAY", PIXPACK(0xFFBB00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Emmitter. Rays create points when they collide", TYPE_SOLID}, {"BRAY", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Point. Rays create points when they collide", TYPE_SOLID} //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description diff --git a/src/powder.c b/src/powder.c index 424c4a7e2..b6f8264db 100644 --- a/src/powder.c +++ b/src/powder.c @@ -144,7 +144,7 @@ int try_move(int i, int x, int y, int nx, int ny) if((r & 0xFF) == PT_COAL || (r & 0xFF) == PT_BCOL) parts[r>>8].temp = parts[i].temp; - if((r & 0xFF) < PT_NUM) + if((r & 0xFF) < PT_NUM && ptypes[r&0xFF].hconduct) parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); } return 0; From 95c4e49f53cc5da31a3bfef3e3ee957b824e08d6 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Fri, 10 Dec 2010 14:05:06 -0500 Subject: [PATCH 77/79] Lots of small changes/fixes mentioned in my mod post. --- includes/defines.h | 1 + includes/powder.h | 12 ++++-------- src/graphics.c | 19 +++++++++++++++---- src/main.c | 23 +++++++++++++++++++++-- src/powder.c | 21 ++++++++++++++++----- 5 files changed, 57 insertions(+), 19 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 59559a043..fb52c2e97 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -136,6 +136,7 @@ int REPLACE_MODE; int CURRENT_BRUSH; int GRID_MODE; int VINE_MODE; +int DEBUG_MODE; extern sign signs[MAXSIGNS]; extern stamp stamps[STAMP_MAX]; extern int stamp_count; diff --git a/includes/powder.h b/includes/powder.h index f42fcbc15..589932c44 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -173,10 +173,9 @@ #define PT_LOLZ 123 #define PT_WIFI 124 #define PT_FILT 125 -#define PT_XEON 126//radioactive gas -#define PT_ARAY 127 -#define PT_BRAY 128 -#define PT_NUM 129 +#define PT_ARAY 126 +#define PT_BRAY 127 +#define PT_NUM 128 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -393,11 +392,9 @@ static const part_type ptypes[PT_NUM] = {"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_CRACKER2, 373.0f, 40, "Lolz", TYPE_SOLID}, {"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID}, {"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", TYPE_SOLID}, - {"XEON", PIXPACK(0xEB7917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER2, R_TEMP+2.0f +273.15f, 106, "Radioactive gas, absorbs neutrons.", TYPE_GAS}, {"ARAY", PIXPACK(0xFFBB00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Emmitter. Rays create points when they collide", TYPE_SOLID}, {"BRAY", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Point. Rays create points when they collide", TYPE_SOLID} //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description -//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description }; static part_state pstates[PT_NUM] = @@ -529,7 +526,6 @@ static part_state pstates[PT_NUM] = /* LOlZ */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* WIFI */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* FILT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* RGAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* ARAY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BRAY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f} @@ -577,7 +573,7 @@ static int lolzrule[9][9] = }; int portal[8][8]; float portaltemp[8][8]; -int wireless[25][2]; +int wireless[MAX_TEMP/100][2]; extern int isplayer; extern float player[27]; diff --git a/src/graphics.c b/src/graphics.c index 9b89f79b0..90a143868 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1402,7 +1402,7 @@ void draw_parts(pixel *vid) isplayer = 1; //It's a secret. Tssss... } - if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP && t!=PT_FILT)//nothing display but show needed color changes + if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP && t!=PT_FILT && t!=PT_HSWC && t!=PT_PCLN && t!=PT_DEUT && t!=PT_WIFI)//nothing display but show needed color changes { if(t==PT_PHOT) { @@ -1587,12 +1587,23 @@ void draw_parts(pixel *vid) } else if(t==PT_WIFI) { - float frequency = 0.25; + float frequency = 0.0628; int q = parts[i].tmp; cr = sin(frequency*q + 0) * 127 + 128; cg = sin(frequency*q + 2) * 127 + 128; cb = sin(frequency*q + 4) * 127 + 128; - blendpixel(vid, nx, ny, cr, cg, cb, 255); + blendpixel(vid, nx, ny, cr, cg, cb, 255); + if(mousex==(nx) && mousey==(ny)) + { + int z; + for(z = 0; z>1)&1; i>8].temp-273.15f, parts[cr>>8].life); #else - 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); + if(DEBUG_MODE) + sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[parts[cr>>8].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); + else + 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 } else @@ -2247,7 +2263,10 @@ int main(int argc, char *argv[]) #ifdef BETA sprintf(uitext, "Version %d Beta %d FPS:%d Parts:%d", SAVE_VERSION, MINOR_VERSION, FPSB, NUM_PARTS); #else - sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPSB); + if(DEBUG_MODE) + sprintf(uitext, "Version %d Beta %d FPS:%d Parts:%d", SAVE_VERSION, MINOR_VERSION, FPSB, NUM_PARTS); + else + sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPSB); #endif if(REPLACE_MODE) strappend(uitext, " [REPLACE MODE]"); diff --git a/src/powder.c b/src/powder.c index b6f8264db..46880b99f 100644 --- a/src/powder.c +++ b/src/powder.c @@ -505,7 +505,7 @@ inline int create_part(int p, int x, int y, int t) parts[i].tmp = 50; } if(t==PT_DEUT) - parts[i].life = 20; + parts[i].life = 10; if(t==PT_BRAY) parts[i].life = 30; if(t==PT_PUMP) @@ -1173,7 +1173,7 @@ void update_particles_i(pixel *vid, int start, int inc) (bmap[y/CELL][x/CELL]==WL_DESTROYALL) || (bmap[y/CELL][x/CELL]==WL_ALLOWLIQUID && ptypes[t].falldown!=2) || (bmap[y/CELL][x/CELL]==WL_ALLOWSOLID && ptypes[t].falldown!=1) || - (bmap[y/CELL][x/CELL]==WL_ALLOWGAS && ptypes[t].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE) || + (bmap[y/CELL][x/CELL]==WL_ALLOWGAS && ptypes[t].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE && parts[i].type!=PT_HFLM) || (bmap[y/CELL][x/CELL]==WL_DETECT && (t==PT_METL || t==PT_SPRK)) || (bmap[y/CELL][x/CELL]==WL_EWALL && !emap[y/CELL][x/CELL])) && (t!=PT_STKM))) { @@ -1972,6 +1972,7 @@ void update_particles_i(pixel *vid, int start, int inc) { t = parts[i].type = PT_PLNT; parts[r>>8].type = PT_PLNT; + parts[r>>8].life = 0; } else if((r&0xFF)==PT_LAVA && 1>(rand()%250)) { @@ -1989,8 +1990,12 @@ void update_particles_i(pixel *vid, int start, int inc) int nny = rand()%3 -1; if(x+nx+nnx>=0 && y+ny+nny>0 && x+nx+nnx>8)>=NPART||pmap[y+ny+nny][x+nx+nnx]) + continue; if(create_part(-1,x+nx+nnx,y+ny+nny,PT_VINE)) parts[pmap[y+ny+nny][x+nx+nnx]>>8].temp = parts[i].temp; + } } //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) //t = parts[i].type = PT_WATR; @@ -2940,8 +2945,8 @@ void update_particles_i(pixel *vid, int start, int inc) else if(t==PT_WIFI) { int temprange = 100; - for( temp = 0; temp < 2500; temp += temprange) - if(parts[i].temp-273.15>temp&&parts[i].temp-273.15temp&&parts[i].temp-73.15 >8].ctype = PT_NSCN; parts[r>>8].life = 4; } + else if(parts[r>>8].type==PT_PSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp][0]) + { + parts[r>>8].type = PT_SPRK; + parts[r>>8].ctype = PT_PSCN; + parts[r>>8].life = 4; + } else if(parts[r>>8].type==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3 && !wireless[parts[i].tmp][0]) { - parts[r>>8].type = parts[r>>8].ctype; + //parts[r>>8].type = parts[r>>8].ctype; wireless[parts[i].tmp][0] = 1; wireless[parts[i].tmp][1] = 1; ISWIRE = 1; From 137b96244decf44a70c6622558c1cee718fc5855 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Fri, 10 Dec 2010 14:17:11 -0500 Subject: [PATCH 78/79] forgot to add channel resets for higher than 25 --- src/powder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/powder.c b/src/powder.c index 46880b99f..f6a0a91fb 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1112,7 +1112,7 @@ void update_particles_i(pixel *vid, int start, int inc) //} if(ISWIRE==1) { - for( q = 0;q<25;q++) + for( q = 0;q<99;q++) if(!wireless[q][1]) { wireless[q][0] = 0; From d4f0b2295d878ad7b26081a41d448b35bdf88f95 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Fri, 10 Dec 2010 20:45:33 -0500 Subject: [PATCH 79/79] compiles for vilsual studio now --- src/powder.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/powder.c b/src/powder.c index f6a0a91fb..3734fa9d8 100644 --- a/src/powder.c +++ b/src/powder.c @@ -867,8 +867,8 @@ int nearest_part(int ci, int t) void update_particles_i(pixel *vid, int start, int inc) { - int i, j, x, y, t, nx, ny, r, a, s, lt, rt, fe, nt, lpv, nearp, pavg, nnx, nny, q, golnum, goldelete, z, ctype, temp, trade; - float mv, dx, dy, ix, iy, lx, ly, d, pp, nrx, nry, dp; + int i, j, x, y, t, nx, ny, r, a, s, lt, rt, fe, nt, lpv, nearp, pavg, nnx, nny, q, golnum, goldelete, z, ctype, temp, trade, docontinue, nxx, nyy, nxi, nyi; + float mv, dx, dy, ix, iy, lx, ly, d, pp, nrx, nry, dp, rr, rrr; float nn, ct1, ct2; float pt = R_TEMP; float c_heat = 0.0f; @@ -1405,8 +1405,8 @@ void update_particles_i(pixel *vid, int start, int inc) if((t==PT_ISOZ||t==PT_ISZS) && 1>rand()%200 && ((int)(-4.0f*(pv[y/CELL][x/CELL])))>(rand()%1000)) { t = PT_PHOT; - float rr = (rand()%228+128)/127.0f; - float a = (rand()%8) * 0.78540f; + rr = (rand()%228+128)/127.0f; + rrr = (rand()%8) * 0.78540f; parts[i].life = 680; parts[i].ctype = 0x3FFFFFFF; parts[i].vx = rr*cosf(a); @@ -1821,7 +1821,7 @@ void update_particles_i(pixel *vid, int start, int inc) continue; if((r&0xFF)==PT_SPRK){ int destroy = (parts[r>>8].ctype==PT_PSCN)?1:0; - for (int docontinue = 1, nxx = 0, nyy = 0, nxi = nx*-1, nyi = ny*-1; docontinue; nyy+=nyi, nxx+=nxi) { + for (docontinue = 1, nxx = 0, nyy = 0, nxi = nx*-1, nyi = ny*-1; docontinue; nyy+=nyi, nxx+=nxi) { if(!(x+nxi+nxx= 0 && y+nyi+nyy >= 0)){ break; } @@ -2329,8 +2329,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].vx *= 0.90; parts[i].vy *= 0.90; parts[r>>8].type = PT_PHOT; - float a = (rand()%8) * 0.78540f; - float rr = (rand()%128+128)/127.0f; + rrr = (rand()%8) * 0.78540f; + rr = (rand()%128+128)/127.0f; parts[r>>8].life = 680; parts[r>>8].ctype = 0x3FFFFFFF; parts[r>>8].vx = rr*cosf(a); @@ -2342,8 +2342,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].vx *= 0.90; parts[i].vy *= 0.90; parts[r>>8].type = PT_PHOT; - float rr = (rand()%228+128)/127.0f; - float a = (rand()%8) * 0.78540f; + rr = (rand()%228+128)/127.0f; + rrr = (rand()%8) * 0.78540f; parts[r>>8].life = 680; parts[r>>8].ctype = 0x3FFFFFFF; parts[r>>8].vx = rr*cosf(a);