summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob1 <jfu614@gmail.com>2012-03-14 23:20:27 (GMT)
committer Jacob1 <jfu614@gmail.com>2012-03-14 23:20:27 (GMT)
commitdc688470a656c70757581e932eda7e0ea69f85bb (patch)
treed4d567977016f9dc540142410850f6bc5bd35998 /src
parentd74e2810034e63e221d667c22b49772ab1a3af22 (diff)
downloadpowder-dc688470a656c70757581e932eda7e0ea69f85bb.zip
powder-dc688470a656c70757581e932eda7e0ea69f85bb.tar.gz
soap lines, create_parts fix, compiling fixes
Diffstat (limited to 'src')
-rw-r--r--src/elements/stkm.c2
-rw-r--r--src/graphics.c11
-rw-r--r--src/luaconsole.c8
-rw-r--r--src/main.c4
-rw-r--r--src/powder.c4
5 files changed, 15 insertions, 14 deletions
diff --git a/src/elements/stkm.c b/src/elements/stkm.c
index d8286d5..7a67b65 100644
--- a/src/elements/stkm.c
+++ b/src/elements/stkm.c
@@ -257,7 +257,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) {
{
int np = -1;
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
np = -1;
else
diff --git a/src/graphics.c b/src/graphics.c
index 7a510a9..754b8de 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -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;
}
-#if defined(WIN32) && !defined(__GNUC__)
-_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 addchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
{
int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c];
@@ -1934,6 +1930,11 @@ void render_parts(pixel *vid)
#endif
//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)
{
char buff[20]; //Buffer for HP
diff --git a/src/luaconsole.c b/src/luaconsole.c
index 6fb90df..1d5446f 100644
--- a/src/luaconsole.c
+++ b/src/luaconsole.c
@@ -1286,9 +1286,9 @@ int luatpt_set_property(lua_State* l)
}
i = r>>8;
if(format==2){
- *((float*)(((void*)&parts[i])+offset)) = f;
+ *((float*)(((char*)&parts[i])+offset)) = f;
} else {
- *((int*)(((void*)&parts[i])+offset)) = t;
+ *((int*)(((char*)&parts[i])+offset)) = t;
}
}
} else {
@@ -1310,9 +1310,9 @@ int luatpt_set_property(lua_State* l)
if (partsel && partsel != parts[i].type)
return 0;
if(format==2){
- *((float*)(((void*)&parts[i])+offset)) = f;
+ *((float*)(((char*)&parts[i])+offset)) = f;
} else {
- *((int*)(((void*)&parts[i])+offset)) = t;
+ *((int*)(((char*)&parts[i])+offset)) = t;
}
}
return 0;
diff --git a/src/main.c b/src/main.c
index bc908de..3ca7ff9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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)
flood_parts(x, y, c, -1, -1, get_brush_flags());
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;
ly = y;
lb = 0;
@@ -2424,7 +2424,7 @@ int main(int argc, char *argv[])
cb_bmap[cby][cbx] = bmap[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;
ly = y;
lb = b;
diff --git a/src/powder.c b/src/powder.c
index 13924d3..1a472eb 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -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 (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)
@@ -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)
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;
}
// fill children