soap lines, create_parts fix, compiling fixes

This commit is contained in:
Jacob1 2012-03-14 19:20:27 -04:00
parent d74e281003
commit dc688470a6
6 changed files with 16 additions and 15 deletions

View File

@ -792,7 +792,7 @@ void create_box(int x1, int y1, int x2, int y2, int c, int flags);
int flood_parts(int x, int y, int c, int cm, int bm, int flags); int flood_parts(int x, int y, int c, int cm, int bm, int flags);
int create_parts(int x, int y, int rx, int ry, int c, int flags); int create_parts(int x, int y, int rx, int ry, int c, int flags, int fill);
void create_line(int x1, int y1, int x2, int y2, int rx, int ry, int c, int flags); void create_line(int x1, int y1, int x2, int y2, int rx, int ry, int c, int flags);

View File

@ -257,7 +257,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) {
{ {
int np = -1; int np = -1;
if (playerp->elem == SPC_AIR) if (playerp->elem == SPC_AIR)
create_parts(rx + 3*((((int)playerp->pcomm)&0x02) == 0x02) - 3*((((int)playerp->pcomm)&0x01) == 0x01), ry, 4, 4, SPC_AIR, 0); create_parts(rx + 3*((((int)playerp->pcomm)&0x02) == 0x02) - 3*((((int)playerp->pcomm)&0x01) == 0x01), ry, 4, 4, SPC_AIR, 0, 1);
else if (playerp->elem==PT_LIGH && playerp->frames<30)//limit lightning creation rate else if (playerp->elem==PT_LIGH && playerp->frames<30)//limit lightning creation rate
np = -1; np = -1;
else else

View File

@ -887,11 +887,7 @@ inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
return x + w; return x + w;
} }
#if defined(WIN32) && !defined(__GNUC__) int addchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
_inline int addchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
#else
inline int addchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
#endif
{ {
int i, j, w, bn = 0, ba = 0; int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c]; char *rp = font_data + font_ptrs[c];
@ -1934,6 +1930,11 @@ void render_parts(pixel *vid)
#endif #endif
//Pixel rendering //Pixel rendering
if (t==PT_SOAP)
{
if ((parts[i].ctype&7) == 7)
draw_line(vid, nx, ny, (int)(parts[parts[i].tmp].x+0.5f), (int)(parts[parts[i].tmp].y+0.5f), 245, 245, 220, XRES+BARSIZE);
}
if(pixel_mode & PSPEC_STICKMAN) if(pixel_mode & PSPEC_STICKMAN)
{ {
char buff[20]; //Buffer for HP char buff[20]; //Buffer for HP

View File

@ -1286,9 +1286,9 @@ int luatpt_set_property(lua_State* l)
} }
i = r>>8; i = r>>8;
if(format==2){ if(format==2){
*((float*)(((void*)&parts[i])+offset)) = f; *((float*)(((char*)&parts[i])+offset)) = f;
} else { } else {
*((int*)(((void*)&parts[i])+offset)) = t; *((int*)(((char*)&parts[i])+offset)) = t;
} }
} }
} else { } else {
@ -1310,9 +1310,9 @@ int luatpt_set_property(lua_State* l)
if (partsel && partsel != parts[i].type) if (partsel && partsel != parts[i].type)
return 0; return 0;
if(format==2){ if(format==2){
*((float*)(((void*)&parts[i])+offset)) = f; *((float*)(((char*)&parts[i])+offset)) = f;
} else { } else {
*((int*)(((void*)&parts[i])+offset)) = t; *((int*)(((char*)&parts[i])+offset)) = t;
} }
} }
return 0; return 0;

View File

@ -2371,7 +2371,7 @@ int main(int argc, char *argv[])
if (c!=WL_STREAM+100&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM&&!REPLACE_MODE&&c!=SPC_WIND&&c!=SPC_PGRV&&c!=SPC_NGRV) if (c!=WL_STREAM+100&&c!=SPC_AIR&&c!=SPC_HEAT&&c!=SPC_COOL&&c!=SPC_VACUUM&&!REPLACE_MODE&&c!=SPC_WIND&&c!=SPC_PGRV&&c!=SPC_NGRV)
flood_parts(x, y, c, -1, -1, get_brush_flags()); flood_parts(x, y, c, -1, -1, get_brush_flags());
if (c==SPC_HEAT || c==SPC_COOL) if (c==SPC_HEAT || c==SPC_COOL)
create_parts(x, y, bsx, bsy, c, get_brush_flags()); create_parts(x, y, bsx, bsy, c, get_brush_flags(), 1);
lx = x; lx = x;
ly = y; ly = y;
lb = 0; lb = 0;
@ -2424,7 +2424,7 @@ int main(int argc, char *argv[])
cb_bmap[cby][cbx] = bmap[cby][cbx]; cb_bmap[cby][cbx] = bmap[cby][cbx];
cb_emap[cby][cbx] = emap[cby][cbx]; cb_emap[cby][cbx] = emap[cby][cbx];
} }
create_parts(x, y, bsx, bsy, c, get_brush_flags()); create_parts(x, y, bsx, bsy, c, get_brush_flags(), 1);
lx = x; lx = x;
ly = y; ly = y;
lb = b; lb = b;

View File

@ -2724,7 +2724,7 @@ void create_box(int x1, int y1, int x2, int y2, int c, int flags)
} }
for (j=y1; j<=y2; j++) for (j=y1; j<=y2; j++)
for (i=x1; i<=x2; i++) for (i=x1; i<=x2; i++)
create_parts(i, j, 0, 0, c, flags); create_parts(i, j, 0, 0, c, flags, 1);
} }
int flood_prop_2(int x, int y, size_t propoffset, void * propvalue, int proptype, int parttype, char * bitmap) int flood_prop_2(int x, int y, size_t propoffset, void * propvalue, int proptype, int parttype, char * bitmap)
@ -2849,7 +2849,7 @@ int flood_parts(int x, int y, int fullc, int cm, int bm, int flags)
if (create_part(-1,x, y, fullc)==-1) if (create_part(-1,x, y, fullc)==-1)
return 0; return 0;
} }
else if (!create_parts(x, y, 0, 0, fullc, flags)) else if (!create_parts(x, y, 0, 0, fullc, flags, 1))
return 0; return 0;
} }
// fill children // fill children