-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tweak(half-o-codebase): ports emissives, SSoverlays, on_update_icon()…
…, mapview character preview, etc. Too much of a mess to actually describe it. PR #10924
- Loading branch information
1 parent
e0ddfaf
commit 96f3cdf
Showing
583 changed files
with
2,753 additions
and
2,015 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
// Emissive blockers | ||
|
||
/// For anything that shouldn't block emissives. Small objects or translucent objects primarily | ||
#define EMISSIVE_BLOCK_NONE 0 | ||
/// For anything that doesn't change outline or opaque area much or at all. | ||
#define EMISSIVE_BLOCK_GENERIC 1 | ||
/// Uses a dedicated render_target object to copy the entire appearance in real time to the blocking layer. For things that can change in appearance a lot from the base state, like humans. | ||
#define EMISSIVE_BLOCK_UNIQUE 2 | ||
|
||
/// The color matrix applied to all emissive overlays. Should be solely dependent on alpha and not have RGB overlap with [EM_BLOCK_COLOR]. | ||
#define EMISSIVE_COLOR list(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1, 1,1,1,0) | ||
/// A globaly cached version of [EMISSIVE_COLOR] for quick access. | ||
GLOBAL_LIST_INIT(emissive_color, EMISSIVE_COLOR) | ||
/// The color matrix applied to all emissive blockers. Should be solely dependent on alpha and not have RGB overlap with [EMISSIVE_COLOR]. | ||
#define EM_BLOCK_COLOR list(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1, 0,0,0,0) | ||
/// A globaly cached version of [EM_BLOCK_COLOR] for quick access. | ||
GLOBAL_LIST_INIT(em_block_color, EM_BLOCK_COLOR) | ||
/// The color matrix used to mask out emissive blockers on the emissive plane. Alpha should default to zero, be solely dependent on the RGB value of [EMISSIVE_COLOR], and be independant of the RGB value of [EM_BLOCK_COLOR]. | ||
#define EM_MASK_MATRIX list(0,0,0,1/3, 0,0,0,1/3, 0,0,0,1/3, 0,0,0,0, 1,1,1,0) | ||
/// A globally cached version of [EM_MASK_MATRIX] for quick access. | ||
GLOBAL_LIST_INIT(em_mask_matrix, EM_MASK_MATRIX) | ||
|
||
/// A set of appearance flags applied to all emissive and emissive blocker overlays. | ||
#define EMISSIVE_APPEARANCE_FLAGS (KEEP_APART|KEEP_TOGETHER|RESET_COLOR|NO_CLIENT_COLOR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
/// Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the [EMISSIVE_COLOR]. | ||
/proc/emissive_appearance(icon, icon_state = "", layer = FLOAT_LAYER, alpha = 255, appearance_flags = 0) | ||
var/mutable_appearance/appearance = mutable_appearance(icon = icon, icon_state = icon_state, layer = layer, plane = EMISSIVE_PLANE, flags = appearance_flags|EMISSIVE_APPEARANCE_FLAGS) | ||
appearance.alpha = alpha | ||
appearance.blend_mode = BLEND_OVERLAY | ||
appearance.color = GLOB.emissive_color | ||
return appearance | ||
|
||
/// Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the [EM_BLOCK_COLOR]. | ||
/proc/emissive_blocker(icon, icon_state = "", layer = FLOAT_LAYER, alpha = 255, appearance_flags = 0, source = null) | ||
var/mutable_appearance/appearance = mutable_appearance(icon = icon, icon_state = icon_state, layer = layer, plane = EMISSIVE_PLANE, flags = appearance_flags|EMISSIVE_APPEARANCE_FLAGS) | ||
appearance.color = GLOB.em_block_color | ||
if(source) | ||
appearance.render_source = source | ||
// Since only render_target handles transform we don't get any applied transform "stacking" | ||
appearance.appearance_flags |= RESET_TRANSFORM | ||
return appearance | ||
|
||
// Designed to be a faster version of the above, for most use-cases | ||
/proc/fast_emissive_blocker(atom/make_blocker) | ||
var/mutable_appearance/blocker = new() | ||
blocker.icon = make_blocker.icon | ||
blocker.icon_state = make_blocker.icon_state | ||
blocker.appearance_flags |= make_blocker.appearance_flags | EMISSIVE_APPEARANCE_FLAGS | ||
blocker.dir = make_blocker.dir | ||
blocker.color = GLOB.em_block_color | ||
blocker.plane = EMISSIVE_PLANE | ||
return blocker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.