Makes getFlatIcon slower. (Also more precise) (#34199)

* getFlatIcon fixes and improvements. DO NOT TOUCH

* Fixes area blendings

* Stuff

* Drops the named arg
This commit is contained in:
AnturK
2018-01-16 14:32:35 +01:00
committed by CitadelStationBot
parent ade3ded854
commit 89766bdc4e
4 changed files with 63 additions and 50 deletions
+7 -13
View File
@@ -190,7 +190,7 @@
/obj/item/device/camera/proc/camera_get_icon(list/turfs, turf/center)
var/atoms[] = list()
var/list/atoms = list()
for(var/turf/T in turfs)
atoms.Add(T)
for(var/atom/movable/A in T)
@@ -203,15 +203,7 @@
continue
atoms.Add(A)
var/list/sorted = list()
var/j
for(var/i = 1 to atoms.len)
var/atom/c = atoms[i]
for(j = sorted.len, j > 0, --j)
var/atom/c2 = sorted[j]
if(c2.layer <= c.layer)
break
sorted.Insert(j+1, c)
var/list/sorted = sortTim(atoms,/proc/cmp_atom_layer_asc)
var/icon/res = icon('icons/effects/96x96.dmi', "")
@@ -222,8 +214,8 @@
if(L.lying)
img.Turn(L.lying)
var/offX = 32 * (A.x - center.x) + A.pixel_x + 33
var/offY = 32 * (A.y - center.y) + A.pixel_y + 33
var/offX = world.icon_size * (A.x - center.x) + A.pixel_x + 33
var/offY = world.icon_size * (A.y - center.y) + A.pixel_y + 33
if(ismovableatom(A))
var/atom/movable/AM = A
offX += AM.step_x
@@ -235,7 +227,9 @@
blueprints = 1
for(var/turf/T in turfs)
res.Blend(getFlatIcon(T.loc), blendMode2iconMode(T.blend_mode), 32 * (T.x - center.x) + 33, 32 * (T.y - center.y) + 33)
var/area/A = T.loc
if(A.icon_state)//There's actually something to blend in.
res.Blend(getFlatIcon(A), blendMode2iconMode(A.blend_mode), world.icon_size * (T.x - center.x) + 33, world.icon_size * (T.y - center.y) + 33)
return res