mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Camera net/chunk refactor. Slight performance improvements and makes it GC properly (#20302)
* Add SScamera * Refactor camera * Refactor how camera chunks add/remove cams * Use CAMERA_VIEW_DISTANCE to determine max view dist of cam * Fix movable cameras and optimise them * Optimise update() * Ensure aiEyes get removed properly when deleted * Final optimisations and refactoring * Fix cameras being EMPed * Shits fixed * AA review * Fix merge mistake * Add comment about early return * Seans review * the it the Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * Update code/game/machinery/camera/camera.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * Ensure the robit has a camera before updating it --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
co-authored by
S34N
Ryan
Charlie
parent
4a1873023a
commit
0fedbb9257
@@ -0,0 +1,24 @@
|
||||
// Subsystem that controls the camera vision tiles
|
||||
SUBSYSTEM_DEF(camera)
|
||||
name = "Camera"
|
||||
flags = SS_BACKGROUND | SS_NO_INIT
|
||||
priority = FIRE_PRIORITY_CAMERA
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
wait = 2.5 SECONDS
|
||||
offline_implications = "AI camera view won't update. No immediate action is needed."
|
||||
var/list/chunk_queue = list()
|
||||
|
||||
/datum/controller/subsystem/camera/fire(resumed)
|
||||
for(var/datum/camerachunk/chunk as anything in chunk_queue)
|
||||
chunk.update()
|
||||
chunk_queue -= chunk
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
|
||||
/datum/controller/subsystem/camera/proc/queue(datum/camerachunk/chunk)
|
||||
if(!chunk_queue[chunk])
|
||||
chunk_queue[chunk] = chunk
|
||||
|
||||
/datum/controller/subsystem/camera/proc/remove_from_queue(datum/camerachunk/chunk)
|
||||
chunk_queue -= chunk
|
||||
Reference in New Issue
Block a user