Skip to content

Commit ed13d94

Browse files
authored
processing subsystem update (#7489)
- processing subsystems now declare time as second intervals - adds missing stat tag - MC now respects abstract type for subsystems (even if we don't use it lol)
1 parent e8f3ff1 commit ed13d94

File tree

9 files changed

+27
-15
lines changed

9 files changed

+27
-15
lines changed

code/controllers/master.dm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
142142
else
143143
var/list/subsytem_types = subtypesof(/datum/controller/subsystem)
144144
tim_sort(subsytem_types, GLOBAL_PROC_REF(cmp_subsystem_init))
145-
for(var/I in subsytem_types)
146-
var/datum/controller/subsystem/S = new I
147-
_subsystems += S
145+
for(var/datum/controller/subsystem/ss_path as anything in subsytem_types)
146+
if(ss_path.abstract_type == ss_path)
147+
continue
148+
var/datum/controller/subsystem/ss_instance = new ss_path
149+
_subsystems += ss_instance
148150
Master = src
149151

150152
/**

code/controllers/subsystem/processing/circuits.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PROCESSING_SUBSYSTEM_DEF(circuit)
66
name = "Circuit"
77
init_order = INIT_ORDER_CIRCUIT
88
subsystem_flags = SS_NO_FIRE
9+
stat_tag = "P_CIRCUIT"
910

1011
var/cipherkey
1112

code/controllers/subsystem/processing/instruments.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PROCESSING_SUBSYSTEM_DEF(instruments)
55
init_stage = INIT_STAGE_EARLY
66
subsystem_flags = SS_KEEP_TIMING
77
priority = FIRE_PRIORITY_INSTRUMENTS
8+
stat_tag = "P_INST"
89
var/static/list/datum/instrument/instrument_data = list() //id = datum
910
var/static/list/datum/song/songs = list()
1011
var/static/musician_maxlines = 600
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
PROCESSING_SUBSYSTEM_DEF(moving_cameras)
22
name = "Camera Movement"
3-
wait = 5
3+
wait = 0.5 SECONDS
44
stat_tag = "MCAM"
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
/**
2+
* General object processing subsystem. Fires once per 2 seconds.
3+
*/
14
PROCESSING_SUBSYSTEM_DEF(obj)
25
name = "Objects"
36
priority = FIRE_PRIORITY_OBJ
47
subsystem_flags = SS_NO_INIT
5-
wait = 20
8+
wait = 2 SECONDS
9+
stat_tag = "P_OBJ"

code/controllers/subsystem/processing/process_20fps.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
*/
44
PROCESSING_SUBSYSTEM_DEF(process_20fps)
55
name = "Processing - 20 fps"
6-
wait = 0.5
7-
stat_tag = "P20"
6+
wait = (1 / 20) SECONDS
7+
stat_tag = "P_20"

code/controllers/subsystem/processing/process_5fps.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
*/
44
PROCESSING_SUBSYSTEM_DEF(process_5fps)
55
name = "Processing - 5 FPS"
6-
wait = 2
7-
stat_tag = "P5"
6+
wait = (1 / 5) SECONDS
7+
stat_tag = "P_5"

code/controllers/subsystem/processing/processing.dm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
//Used to process objects.
2-
1+
/**
2+
* Base of processing subsystems.
3+
* This is a generic processing subsystem that ticks once per second.
4+
*/
35
SUBSYSTEM_DEF(processing)
4-
name = "Processing - 1 FPS"
56
priority = FIRE_PRIORITY_PROCESS
67
subsystem_flags = SS_BACKGROUND|SS_POST_FIRE_TIMING|SS_NO_INIT
78
wait = 1 SECONDS
89

9-
var/stat_tag = "P1" //Used for logging
10+
var/stat_tag = "P_DEF" //Used for logging
1011
var/list/processing = list()
1112
var/list/currentrun = list()
1213

code/controllers/subsystem/processing/projectiles.dm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
/**
2+
* A very fast-ticking subsystem that runs projectiles.
3+
*/
14
PROCESSING_SUBSYSTEM_DEF(projectiles)
25
name = "Projectiles"
3-
wait = 0.5
4-
stat_tag = "PP"
6+
wait = (1 / 20) SECONDS
7+
stat_tag = "P_PROJ"
58
priority = FIRE_PRIORITY_PROJECTILES
69
subsystem_flags = SS_NO_INIT | SS_KEEP_TIMING
710

0 commit comments

Comments
 (0)