Skip to content
Snippets Groups Projects
Commit 165afe4b authored by daniel's avatar daniel
Browse files

python/fire: Use neighbors on the NSEW, not diagonal for smoothing

parent 141de831
No related branches found
No related tags found
No related merge requests found
......@@ -19,10 +19,10 @@ def init_fire():
# Smooth image and cool (darken) pixels according to cool_map
def avg_cooled(x, y, buf):
res = 0
res += buf[(y*client.WIDTH-1) + x-1]
res += buf[(y*client.WIDTH-1) + x+1]
res += buf[(y*client.WIDTH+1) + x-1]
res += buf[(y*client.WIDTH+1) + x+1]
res += buf[(y*client.WIDTH) + x-1]
res += buf[(y*client.WIDTH) + x+1]
res += buf[(y*client.WIDTH-1) + x]
res += buf[(y*client.WIDTH+1) + x]
res += buf[(y*client.WIDTH) + x]
res = int(res / 5.0 - cool_map[(y+ cool_offs)%client.HEIGHT*client.WIDTH + x])
if res < 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment