diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2011-08-24 15:35:52 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-27 10:37:03 (GMT) |
| commit | 42cfb74c2bb82eb185962a17f848e47265a16316 (patch) | |
| tree | d2185ba1276dd85144b7d26099f597833f0cc975 /src/luaconsole.c | |
| parent | f97e8e5c7caddadadf71f7635070777c6e1248ad (diff) | |
| download | powder-42cfb74c2bb82eb185962a17f848e47265a16316.zip powder-42cfb74c2bb82eb185962a17f848e47265a16316.tar.gz | |
Remove blocking walls from pmap
2.5% speed increase on a screen full of water
Diffstat (limited to 'src/luaconsole.c')
| -rw-r--r-- | src/luaconsole.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/luaconsole.c b/src/luaconsole.c index adf4620..bac4182 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -504,7 +504,7 @@ int luatpt_set_property(lua_State* l) for (nx = x; nx<x+w; nx++) for (ny = y; ny<y+h; ny++){ r = pmap[ny][nx]; - if (!r || (r>>8) >= NPART || (partsel && partsel != parts[r>>8].type)) + if (!r || (partsel && partsel != parts[r>>8].type)) { r = photons[ny][nx]; if (!r || (partsel && partsel != parts[r>>8].type)) @@ -523,9 +523,9 @@ int luatpt_set_property(lua_State* l) if (i>=XRES || y>=YRES) return luaL_error(l, "Coordinates out of range (%d,%d)", i, y); r = pmap[y][i]; - if (!r || (r>>8)>=NPART || (partsel && partsel != parts[r>>8].type)) + if (!r || (partsel && partsel != parts[r>>8].type)) r = photons[y][i]; - if (!r || (r>>8)>=NPART || (partsel && partsel != parts[r>>8].type)) + if (!r || (partsel && partsel != parts[r>>8].type)) return 0; i = r>>8; } @@ -553,9 +553,9 @@ int luatpt_get_property(lua_State* l) y = luaL_optint(l, 3, -1); if(y!=-1 && y < YRES && y >= 0 && i < XRES && i >= 0){ r = pmap[y][i]; - if (!r || (r>>8)>=NPART) + if (!r) r = photons[y][i]; - if (!r || (r>>8)>=NPART) + if (!r) { if (strcmp(prop,"type")==0){ lua_pushinteger(l, 0); |
