Merge pull request #34829 from AnturK/photosnotmovies

Removes animation from photos
This commit is contained in:
Jordan Brown
2018-01-24 00:54:49 -05:00
committed by CitadelStationBot
parent f4a817be01
commit 0b2f1c2826
2 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -714,7 +714,7 @@ The _flatIcons list is a cache for generated icon files.
*/
// Creates a single icon from a given /atom or /image. Only the first argument is required.
/proc/getFlatIcon(image/A, defdir, deficon, defstate, defblend, start = TRUE)
/proc/getFlatIcon(image/A, defdir, deficon, defstate, defblend, start = TRUE, no_anim = FALSE)
// We start with a blank canvas, otherwise some icon procs crash silently
var/icon/flat = icon('icons/effects/effects.dmi', "nothing") // Final flattened icon
if(!A)
@@ -867,7 +867,7 @@ The _flatIcons list is a cache for generated icon files.
curblend = BLEND_OVERLAY
add = icon(I.icon, I.icon_state, base_icon_dir)
else // 'I' is an appearance object.
add = getFlatIcon(new/image(I), curdir, curicon, curstate, curblend, FALSE)
add = getFlatIcon(new/image(I), curdir, curicon, curstate, curblend, FALSE, no_anim)
// Find the new dimensions of the flat icon to fit the added overlay
addX1 = min(flatX1, I.pixel_x+1)
@@ -889,7 +889,10 @@ The _flatIcons list is a cache for generated icon files.
if(A.alpha < 255)
flat.Blend(rgb(255, 255, 255, A.alpha), ICON_MULTIPLY)
return icon(flat, "", SOUTH)
if(no_anim)
return icon(flat, "", SOUTH, frame=1)
else
return icon(flat, "", SOUTH)
/proc/getIconMask(atom/A)//By yours truly. Creates a dynamic mask for a mob/whatever. /N
var/icon/alpha_mask = new(A.icon,A.icon_state)//So we want the default icon and icon state of A.
+2 -2
View File
@@ -216,7 +216,7 @@
var/icon/res = icon('icons/effects/96x96.dmi', "")
for(var/atom/A in sorted)
var/icon/img = getFlatIcon(A)
var/icon/img = getFlatIcon(A, no_anim = TRUE)
if(isliving(A))
var/mob/living/L = A
if(L.lying)
@@ -237,7 +237,7 @@
for(var/turf/T in turfs)
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)
res.Blend(getFlatIcon(A,no_anim = TRUE), blendMode2iconMode(A.blend_mode), world.icon_size * (T.x - center.x) + 33, world.icon_size * (T.y - center.y) + 33)
return res