-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throws check tick all over the photo code #4584
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -184,6 +184,7 @@ | |||||||
for(var/atom/A in the_turf) | ||||||||
if(A.invisibility) continue | ||||||||
atoms.Add(A) | ||||||||
CHECK_TICK | ||||||||
|
||||||||
// Sort the atoms into their layers | ||||||||
var/list/sorted = sort_atoms_by_layer(atoms) | ||||||||
|
@@ -209,6 +210,7 @@ | |||||||
xoff+=A:step_x | ||||||||
yoff+=A:step_y | ||||||||
res.Blend(IM, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff) | ||||||||
CHECK_TICK | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Harry when he sees single letter vars in the code context 👀 |
||||||||
|
||||||||
// Lastly, render any contained effects on top. | ||||||||
for(var/turf/the_turf as anything in turfs) | ||||||||
|
@@ -218,6 +220,7 @@ | |||||||
var/image/IM = getFlatIcon(the_turf.loc) | ||||||||
if(IM) | ||||||||
res.Blend(IM, blendMode2iconMode(the_turf.blend_mode),xoff,yoff) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The get flat icon just before this did a bunch of blends so worth checking tick before this blend. Also try testing this by merging with master to get the getflaticon fixes pr in and you can better evaluate if this resolves any issues with large pictures (you may need to opt in to the more expensive get flat icon only for testing - not something the cameras should generally opt into unless we find cases where the extra work is needed for photos) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also whitespace may be funky on mobile - not sure why this suggestion diff is red lining the existing code - just want a new line with check tick. |
||||||||
CHECK_TICK | ||||||||
return res | ||||||||
|
||||||||
|
||||||||
|
@@ -243,13 +246,15 @@ | |||||||
/obj/item/device/camera/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag) | ||||||||
if(!on || !pictures_left || ismob(target.loc) || isstorage(target.loc)) return | ||||||||
if(user.contains(target) || istype(target, /atom/movable/screen)) return | ||||||||
captureimage(target, user, flag) | ||||||||
|
||||||||
playsound(loc, pick('sound/items/polaroid1.ogg', 'sound/items/polaroid2.ogg'), 15, 1) | ||||||||
|
||||||||
pictures_left-- | ||||||||
desc = "A polaroid camera. It has [pictures_left] photos left." | ||||||||
to_chat(user, SPAN_NOTICE("[pictures_left] photos left.")) | ||||||||
|
||||||||
captureimage(target, user, flag) | ||||||||
|
||||||||
icon_state = icon_off | ||||||||
on = 0 | ||||||||
spawn(64) | ||||||||
|
@@ -262,6 +267,7 @@ | |||||||
var/list/turf/turfs = RANGE_TURFS(radius, target) & view(world_view_size + radius, user.client) | ||||||||
for(var/turf/T as anything in turfs) | ||||||||
mobs += get_mobs(T) | ||||||||
CHECK_TICK | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checking tick on just loops filtering out contents I'm skeptical is helpful. |
||||||||
var/datum/picture/P = createpicture(target, user, turfs, mobs, flag) | ||||||||
printpicture(user, P) | ||||||||
|
||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking tick on just loops filtering out contents I'm skeptical is helpful.