
Performance & Engine Optimizations
Hybrid Rendering Pipeline: Implemented hardware scaling (pygame.SCALED) for fullscreen mode to minimize CPU overhead. Windowed mode now utilizes optimized software scaling with correct aspect ratio preservation (letterboxing).
Background Physics Refactor: Rewrote Rain and Snow particle systems to utilize numpy for vectorized position updates, replacing iterative Python loops.
Multithreaded Physics: Moved particle physics calculations to a separate thread (ThreadPoolExecutor) to decouple simulation load from the main render thread.
Global Asset Caching: Implemented a global cache for particle textures to eliminate frame drops during theme transitions and boss entry.
UI Rendering Caching: Added surface caching for draw_text_with_shadow and draw_panel. Static UI elements and text are no longer re-rendered every frame.
Gradient Optimization: Replaced iterative line-drawing for gradients with hardware-accelerated surface scaling in card backgrounds and sky generation.
Physics Stability: Clamped visual delta-time calculations to prevent physics instability and object teleportation when game speed multipliers (e.g., NRG Drink) are active.
Module Loading: Optimized buffs.py resource loading to prevent redundant module imports during boss exclusion checks.
Bug Fixes
Boss Encounter (Jumper): Fixed a logic error where selecting a debuff triggered a turn reset, causing an infinite loop.
Boss Encounter (DLSS): Fixed an issue where the 500x500 resolution challenge resulted in stretched visuals. The renderer now correctly applies letterboxing to maintain the 16:9 aspect ratio.
Input Handling: Corrected mouse coordinate mapping to account for black bars/letterboxing in windowed mode, resolving "ghost button" issues where visual hitboxes did not match logical hitboxes.
Crash Fix: Resolved a TypeError in the Cloud class update method regarding missing arguments.
