diff --git a/includes/powder.h b/includes/powder.h index a782e7c80..62cbd9f00 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -223,6 +223,7 @@ #define PT_EXOT 145 #define OLD_PT_WIND 147 +#define PT_EMBR 147 #define PT_H2 148 #define PT_SOAP 149 #define PT_NBHL 150 @@ -310,7 +311,6 @@ int graphics_CLST(GRAPHICS_FUNC_ARGS); int graphics_CBNW(GRAPHICS_FUNC_ARGS); int graphics_SPNG(GRAPHICS_FUNC_ARGS); int graphics_LIFE(GRAPHICS_FUNC_ARGS); -int graphics_DUST(GRAPHICS_FUNC_ARGS); int graphics_GRAV(GRAPHICS_FUNC_ARGS); int graphics_WIFI(GRAPHICS_FUNC_ARGS); int graphics_PRTI(GRAPHICS_FUNC_ARGS); @@ -354,6 +354,7 @@ int graphics_SOAP(GRAPHICS_FUNC_ARGS); int graphics_EXOT(GRAPHICS_FUNC_ARGS); int graphics_WARP(GRAPHICS_FUNC_ARGS); int graphics_stickmen(GRAPHICS_FUNC_ARGS); +int graphics_EMBR(GRAPHICS_FUNC_ARGS); void TRON_init_graphics(); @@ -389,6 +390,7 @@ int update_CLNE(UPDATE_FUNC_ARGS); int update_COAL(UPDATE_FUNC_ARGS); int update_DEUT(UPDATE_FUNC_ARGS); int update_DSTW(UPDATE_FUNC_ARGS); +int update_EMBR(UPDATE_FUNC_ARGS); int update_FOG(UPDATE_FUNC_ARGS); int update_FRZW(UPDATE_FUNC_ARGS); int update_FRZZ(UPDATE_FUNC_ARGS); diff --git a/src/elementdata.c b/src/elementdata.c index fc3d8dfe7..ddcb9b2a6 100644 --- a/src/elementdata.c +++ b/src/elementdata.c @@ -28,7 +28,7 @@ part_type ptypes[PT_NUM] = { //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Use Weight Section H Ins 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, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Erases particles.", ST_NONE, 0, NULL, NULL}, - {"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, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", ST_SOLID, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, NULL, &graphics_DUST}, + {"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, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", ST_SOLID, TYPE_PART, NULL, NULL}, {"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, 1, 30, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires.", ST_LIQUID, TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE, &update_WATR, NULL}, {"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, 1, 20, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable.", ST_LIQUID, TYPE_LIQUID, NULL, NULL}, #ifdef REALISTIC @@ -178,7 +178,7 @@ part_type ptypes[PT_NUM] = {"TTAN", PIXPACK(0x909090), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Titanium, Higher melting temperature than other metals, blocks all air pressure", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW|PROP_LIFE_DEC, &update_TTAN, NULL}, {"EXOT", PIXPACK(0x404040), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.0003f * CFDS, 2, 0, 0, 0, 2, 1, 1, 46, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 250, "Exotic matter. Explodes with excess exposure to electrons.", ST_LIQUID, TYPE_LIQUID, &update_EXOT, &graphics_EXOT}, /*FREE*/{"BRAN", PIXPACK(0xCCCC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Brian 6 S6/B246/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL}, - /*FREE*/{"WIND", PIXPACK(0x101010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 0, 100, SC_SPECIAL, 0.0f, 40, "", ST_NONE, ST_NONE, NULL, NULL}, + {"EMBR", PIXPACK(0xFFF288), 0.4f, 0.001f * CFDS, 0.99f, 0.90f, 0.0f, 0.07f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 0, 1, 30, SC_EXPLOSIVE, 500.0f +273.15f, 29, "Sparks. Formed by explosions.", ST_NONE, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL|PROP_SPARKSETTLE, &update_EMBR, &graphics_EMBR}, {"HYGN", PIXPACK(0x5070FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.10f, 0.00f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 251, "Combines with O2 to make WATR", ST_GAS, TYPE_GAS, &update_H2, NULL}, {"SOAP", PIXPACK(0xF5F5DC), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 35, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Soap. Creates bubbles.", ST_LIQUID, TYPE_LIQUID|PROP_NEUTPENETRATE|PROP_LIFE_DEC, &update_SOAP, NULL}, {"BHOL", PIXPACK(0x202020), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 186, "Black hole (Requires newtonian gravity)", ST_SOLID, TYPE_SOLID, &update_NBHL, NULL}, diff --git a/src/elements/bang.c b/src/elements/bang.c index d827f3352..1a2a1ecf5 100644 --- a/src/elements/bang.c +++ b/src/elements/bang.c @@ -73,8 +73,8 @@ int update_BANG(UPDATE_FUNC_ARGS) { { if(!(rand()%15)) { - create_part(i, x, y, PT_BOMB); - parts[i].tmp = 1; + create_part(i, x, y, PT_EMBR); + parts[i].tmp = 0; parts[i].life = 50; parts[i].temp = restrict_flt((MAX_TEMP/3)+otemp, MIN_TEMP, MAX_TEMP); parts[i].vx = rand()%20-10; diff --git a/src/elements/bomb.c b/src/elements/bomb.c index e8544c9b3..f60c86b3f 100644 --- a/src/elements/bomb.c +++ b/src/elements/bomb.c @@ -17,84 +17,52 @@ int update_BOMB(UPDATE_FUNC_ARGS) { int r, rx, ry, nb; - //Spark is used so much now that it should be a seperate element. - if (parts[i].tmp==1) { - for (rx=-1; rx<2; rx++) - for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rxtmp==0) { - //Normal bomb - *pixel_mode |= PMODE_FLARE; - } - else if(cpart->tmp==2) - { - //Flash - *pixel_mode = PMODE_FLAT | FIRE_ADD; - *colr = *colg = *colb = *firer = *fireg = *fireb = *firea = 255; - } - else - { - //Flying spark - *pixel_mode = PMODE_SPARK | PMODE_ADD; - *cola = 4*cpart->life; - } - return 0; + *pixel_mode |= PMODE_FLARE; + return 1; } diff --git a/src/elements/elec.c b/src/elements/elec.c index 3d8471d06..bafe93999 100644 --- a/src/elements/elec.c +++ b/src/elements/elec.c @@ -34,25 +34,31 @@ int update_ELEC(UPDATE_FUNC_ARGS) { continue; if ((r&0xFF)==PT_GLAS) { - fire_r[y/CELL][x/CELL] += rand()%200; //D: Doesn't work with OpenGL, also shouldn't be here - fire_g[y/CELL][x/CELL] += rand()%200; - fire_b[y/CELL][x/CELL] += rand()%200; for (rrx=-1; rrx<=1; rrx++) { for (rry=-1; rry<=1; rry++) { if (x+rx+rrx>=0 && y+ry+rry>=0 && x+rx+rrx. + */ + +#include + +/* ctype - colour RRGGBB (optional) + * life - decremented each frame, disappears when life reaches zero + * tmp - mode + * 0 - BOMB sparks + * 1 - firework sparks (colour defaults to white) + * 2 - flash (colour defaults to white) + */ +int update_EMBR(UPDATE_FUNC_ARGS) { + int r, rx, ry, nb; + for (rx=-1; rx<2; rx++) + for (ry=-1; ry<2; ry++) + if (x+rx>=0 && y+ry>0 && x+rxctype&0xFFFFFF) + { + int maxComponent; + *colr = (cpart->ctype&0xFF0000)>>16; + *colg = (cpart->ctype&0x00FF00)>>8; + *colb = (cpart->ctype&0x0000FF); + maxComponent = *colr; + if (*colg>maxComponent) maxComponent = *colg; + if (*colb>maxComponent) maxComponent = *colb; + if (maxComponent<60)//make sure it isn't too dark to see + { + float multiplier = 60.0f/maxComponent; + *colr *= multiplier; + *colg *= multiplier; + *colb *= multiplier; + } + } + else if (cpart->tmp != 0) + { + *colr = *colg = *colb = 255; + } + + if (decorations_enable && cpart->dcolour) + { + int a = (cpart->dcolour>>24)&0xFF; + *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8; + *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8; + *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8; + } + *firer = *colr; + *fireg = *colg; + *fireb = *colb; + + if (cpart->tmp==1) + { + *pixel_mode = FIRE_ADD | PMODE_BLEND | PMODE_GLOW; + *firea = (cpart->life-15)*4; + *cola = (cpart->life+15)*4; + } + else if (cpart->tmp==2) + { + *pixel_mode = PMODE_FLAT | FIRE_ADD; + *firea = 255; + } + else + { + *pixel_mode = PMODE_SPARK | PMODE_ADD; + if (cpart->life<64) *cola = 4*cpart->life; + } + return 0; +} diff --git a/src/elements/firw.c b/src/elements/firw.c index 5bb8f3d88..3f392b69d 100644 --- a/src/elements/firw.c +++ b/src/elements/firw.c @@ -14,10 +14,11 @@ */ #include +#include "hmap.h" int update_FIRW(UPDATE_FUNC_ARGS) { int r, rx, ry, rt, np; - if (parts[i].tmp==0) { + if (parts[i].tmp<=0) { for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) if (x+rx>=0 && y+ry>0 && x+rx0) { - parts[i].vy = -newVel; - ly-=newVel; - iy-=newVel; - }*/ - parts[i].vy = -newVel; + // TODO: different gravity modes + Newtonian gravity + parts[i].vy = -parts[i].life*0.04f - 0.1f; } } - else if (parts[i].tmp==2) { - int col = rand()%200+4; - int tmul; - for (rx=-2; rx<3; rx++) - for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx-1) - { - parts[np].vx = (rand()%3-1)*tmul; - parts[np].vy = (rand()%3-1)*tmul; - parts[np].tmp = col; - parts[np].life = rand()%100+100; - parts[np].temp = 6000.0f; - parts[np].dcolour = parts[i].dcolour; - } - } - pv[y/CELL][x/CELL] += 20; + else if (parts[i].tmp>=2) { + float angle, magnitude; + int caddress = (rand()%200)*3; + int n; + unsigned col = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2])); + for (n=0; n<40; n++) + { + np = create_part(-3, x, y, PT_EMBR); + if (np>-1) + { + magnitude = ((rand()%60)+40)*0.05f; + angle = (rand()%6284)*0.001f;//(in radians, between 0 and 2*pi) + parts[np].vx = parts[i].vx + cosf(angle)*magnitude; + parts[np].vy = parts[i].vy + sinf(angle)*magnitude - 2.5f; + parts[np].ctype = col; + parts[np].tmp = 1; + parts[np].life = rand()%40+70; + parts[np].temp = (rand()%500)+5750.0f; + parts[np].dcolour = parts[i].dcolour; + } + } + pv[y/CELL][x/CELL] += 8.0f; kill_part(i); return 1; - } else if (parts[i].tmp>=3) { - if (parts[i].life<=0) { - kill_part(i); - return 1; - } } return 0; } diff --git a/src/elements/fwrk.c b/src/elements/fwrk.c index 173b6e76a..f54877b10 100644 --- a/src/elements/fwrk.c +++ b/src/elements/fwrk.c @@ -34,33 +34,29 @@ int update_FWRK(UPDATE_FUNC_ARGS) { 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 (rx=-1; rx<2; rx++) - for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=rand()%8) - { - if (!pmap[y+ry][x+rx]) - { - np = create_part(-1, x+rx, y+ry , PT_DUST); - pv[y/CELL][x/CELL] += 2.00f*CFDS; - if (np!=-1) - { - parts[np].vy = -(rand()%10-1); - parts[np].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; - parts[np].life= rand()%37+18; - parts[np].tmp=q; - parts[np].tmp2=w; - parts[np].ctype=e; - parts[np].temp= rand()%20+6000; - parts[np].dcolour = parts[i].dcolour; - } - } - } - } + int r = (rand()%245+11); + int g = (rand()%245+11); + int b = (rand()%245+11); + int n; + float angle, magnitude; + unsigned col = (r<<16) | (g<<8) | b; + for (n=0; n<40; n++) + { + np = create_part(-3, x, y, PT_EMBR); + if (np>-1) + { + magnitude = ((rand()%60)+40)*0.05f; + angle = (rand()%6284)*0.001f;//(in radians, between 0 and 2*pi) + parts[np].vx = parts[i].vx + cosf(angle)*magnitude; + parts[np].vy = parts[i].vy + sinf(angle)*magnitude - 2.5f; + parts[np].ctype = col; + parts[np].tmp = 1; + parts[np].life = rand()%40+70; + parts[np].temp = (rand()%500)+5750.0f; + parts[np].dcolour = parts[i].dcolour; + } + } + pv[y/CELL][x/CELL] += 8.0f; kill_part(i); return 1; } diff --git a/src/elements/ignt.c b/src/elements/ignt.c index 36f48a3d8..bf706bcd8 100644 --- a/src/elements/ignt.c +++ b/src/elements/ignt.c @@ -40,9 +40,9 @@ int update_IGNT(UPDATE_FUNC_ARGS) { { if(rand()%3) { - int nb = create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_BOMB); + int nb = create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_EMBR); if (nb!=-1) { - parts[nb].tmp = 1; + parts[nb].tmp = 0; parts[nb].life = 30; parts[nb].vx = rand()%20-10; parts[nb].vy = rand()%20-10; diff --git a/src/elements/newgraphics.c b/src/elements/newgraphics.c index 946afc80c..c8581f6fa 100644 --- a/src/elements/newgraphics.c +++ b/src/elements/newgraphics.c @@ -117,29 +117,6 @@ int graphics_LIFE(GRAPHICS_FUNC_ARGS) *colb = PIXB(pc); return 0; } -int graphics_DUST(GRAPHICS_FUNC_ARGS) -{ - if(cpart->life >= 1) - { - *firea = 120; - *firer = *colr = cpart->tmp2; - *fireg = *colg = cpart->tmp; - *fireb = *colb = cpart->ctype; - if (decorations_enable && cpart->dcolour) - { - int a = (cpart->dcolour>>24)&0xFF; - *firer = *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8; - *fireg = *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8; - *fireb = *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8; - } - *pixel_mode |= PMODE_GLOW | FIRE_ADD; - /**firea = 255; - *firer = *colr; - *fireg = *colg; - *fireb = *colb;*/ - } - return 0; -} int graphics_GRAV(GRAPHICS_FUNC_ARGS) { *colr = 20; @@ -497,33 +474,7 @@ int graphics_HFLM(GRAPHICS_FUNC_ARGS) } int graphics_FIRW(GRAPHICS_FUNC_ARGS) { - if(cpart->tmp>=3) - { - int caddress = restrict_flt(restrict_flt((float)(cpart->tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); - *colr = (unsigned char)firw_data[caddress]; - *colg = (unsigned char)firw_data[caddress+1]; - *colb = (unsigned char)firw_data[caddress+2]; - - if (decorations_enable && cpart->dcolour) - { - int a = (cpart->dcolour>>24)&0xFF; - *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8; - *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8; - *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8; - } - - *firea = cpart->life*4; - if(*firea > 240) - *firea = 240; - *firer = *colr; - *fireg = *colg; - *fireb = *colb; - - *pixel_mode = PMODE_NONE; //Clear default, don't draw pixel - *pixel_mode |= FIRE_ADD; - //Returning 0 means dynamic, do not cache - } - else if(cpart->tmp > 0) + if(cpart->tmp > 0) { *pixel_mode |= PMODE_GLOW; } diff --git a/src/powder.c b/src/powder.c index 9dd2fd16a..fd01dd620 100644 --- a/src/powder.c +++ b/src/powder.c @@ -184,6 +184,7 @@ void init_can_move() can_move[PT_ANAR][PT_WHOL] = 1; can_move[PT_ANAR][PT_NWHL] = 1; can_move[PT_THDR][PT_THDR] = 2; + can_move[PT_EMBR][PT_EMBR] = 2; } /* @@ -254,9 +255,6 @@ int try_move(int i, int x, int y, int nx, int ny) e = eval_move(parts[i].type, nx, ny, &r); - if ((r&0xFF)==PT_BOMB && parts[i].type==PT_BOMB && parts[i].tmp == 1) - e = 2; - /* half-silvered mirror */ if (!e && parts[i].type==PT_PHOT && (((r&0xFF)==PT_BMTL && rand() SAVE_VERSION) + if(saved_version > SAVE_VERSION) { fprintf(stderr, "Save from newer version\n"); return 2; @@ -1386,6 +1388,31 @@ int parse_save_OPS(void *save, int size, int replace, int x0, int y0, unsigned c } if (!ptypes[partsptr[newIndex].type].enabled) partsptr[newIndex].type = PT_NONE; + + + if (saved_version<81) + { + if (partsptr[newIndex].type==PT_BOMB && partsptr[newIndex].tmp!=0) + { + partsptr[newIndex].type = PT_EMBR; + partsptr[newIndex].ctype = 0; + if (partsptr[newIndex].tmp==1) + partsptr[newIndex].tmp = 0; + } + if (partsptr[newIndex].type==PT_DUST && partsptr[newIndex].life>0) + { + partsptr[newIndex].type = PT_EMBR; + partsptr[newIndex].ctype = (partsptr[newIndex].tmp2<<16) | (partsptr[newIndex].tmp<<8) | partsptr[newIndex].ctype; + partsptr[newIndex].tmp = 1; + } + if (partsptr[newIndex].type==PT_FIRW && partsptr[newIndex].tmp>=2) + { + int caddress = restrict_flt(restrict_flt((float)(partsptr[newIndex].tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); + partsptr[newIndex].type = PT_EMBR; + partsptr[newIndex].tmp = 1; + partsptr[newIndex].ctype = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2])); + } + } } } } @@ -2116,6 +2143,30 @@ int parse_save_PSv(void *save, int size, int replace, int x0, int y0, unsigned c } if (!ptypes[parts[i-1].type].enabled) parts[i-1].type = PT_NONE; + + if (ver<81) + { + if (parts[i-1].type==PT_BOMB && parts[i-1].tmp!=0) + { + parts[i-1].type = PT_EMBR; + parts[i-1].ctype = 0; + if (parts[i-1].tmp==1) + parts[i-1].tmp = 0; + } + if (parts[i-1].type==PT_DUST && parts[i-1].life>0) + { + parts[i-1].type = PT_EMBR; + parts[i-1].ctype = (parts[i-1].tmp2<<16) | (parts[i-1].tmp<<8) | parts[i-1].ctype; + parts[i-1].tmp = 1; + } + if (parts[i-1].type==PT_FIRW && parts[i-1].tmp>=2) + { + int caddress = restrict_flt(restrict_flt((float)(parts[i-1].tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); + parts[i-1].type = PT_EMBR; + parts[i-1].tmp = 1; + parts[i-1].ctype = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2])); + } + } } }