feat(rendering): GameplayRenderer base class — occlusion for all renderers (D-170)

New GameplayRenderer extends Node2D with built-in occlusion support.
Subclasses override _gameplay_process() and _gameplay_draw() instead
of _process() and _draw() — these are skipped when a fullscreen
implant app covers gameplay.

Migrated all 5 gameplay renderers:
- CursorRenderer: hover detection + bracket drawing paused
- EntityRenderer: position lerping paused
- FogEntities: fog dot rendering paused
- SoundIndicatorRenderer: directional arrows paused
- WorldRenderer: tile/fog/entity updates paused

No more manual occlusion wiring — the base class handles everything.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 11:51:30 +02:00
co-authored by Claude Opus 4.6
parent a01f7c9cfb
commit 34a21d4cd0
6 changed files with 70 additions and 23 deletions
+5 -5
View File
@@ -1,5 +1,5 @@
class_name CursorRenderer
extends Node2D
extends GameplayRenderer
## Cursor state machine — 4 geometric states, 150ms linear transitions (D-056).
## Insert-styled cursor on z-layer 7 (UILayer CanvasLayer).
@@ -54,7 +54,7 @@ var _bracket_a: float = 0.0
var _alpha: float = 0.45
func _ready() -> void:
func _renderer_ready() -> void:
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
z_index = 100 # D-170: cursor must always render above all HUD/implant layers
_from = _snapshot()
@@ -69,7 +69,7 @@ func _notification(what: int) -> void:
visible = true
func _process(delta: float) -> void:
func _gameplay_process(delta: float) -> void:
if not _mouse_inside:
return
_time += delta
@@ -243,8 +243,8 @@ func _interpolate() -> void:
# --- Drawing ---
func _draw() -> void:
# _hover_offset is computed in _detect_hover() during _process(), not recalculated
func _gameplay_draw() -> void:
# _hover_offset is computed in _detect_hover() during _gameplay_process(), not recalculated
# here. This is safe because Camera2D (tree sibling, earlier in scene order) applies
# its smoothing transform before CursorRenderer._process() reads canvas_transform.
# Nothing modifies the canvas transform between _process() and _draw().