@@ -108,8 +108,11 @@ pub enum ViewMode {
108108/// Palette-indexed framebuffer. Each pixel is a u8 index into a palette
109109/// whose size is determined by the SIMD tier.
110110pub struct Framebuffer {
111+ /// Framebuffer width in pixels.
111112 pub width : usize ,
113+ /// Framebuffer height in pixels.
112114 pub height : usize ,
115+ /// Active palette tier (determines color count and sprite size).
113116 pub tier : PaletteTier ,
114117 /// Row-major palette indices, length = width × height.
115118 pub pixels : Vec < u8 > ,
@@ -551,6 +554,7 @@ pub struct WobbleState {
551554}
552555
553556impl WobbleState {
557+ /// Allocate wobble state for `capacity` nodes (decay 0.92, amplitude 3.0).
554558 pub fn new ( capacity : usize ) -> Self {
555559 Self {
556560 displace : vec ! [ 0.0 ; capacity * 2 ] ,
@@ -613,6 +617,7 @@ pub struct FireState {
613617}
614618
615619impl FireState {
620+ /// Allocate fire state for `capacity` nodes (decay rate 16/tick).
616621 pub fn new ( capacity : usize ) -> Self {
617622 Self {
618623 intensity : vec ! [ 0u8 ; capacity] ,
@@ -755,19 +760,23 @@ pub struct FlybyFrame {
755760 pub packed : Vec < u64 > ,
756761 /// Bits per pixel used for packing.
757762 pub bpp : usize ,
758- /// Camera position at this keyframe.
763+ /// Camera X position at this keyframe.
759764 pub cam_x : f32 ,
765+ /// Camera Y position at this keyframe.
760766 pub cam_y : f32 ,
767+ /// Camera zoom factor at this keyframe.
761768 pub cam_zoom : f32 ,
762769}
763770
764771/// Ring buffer of pre-rendered flyby keyframes.
765772pub struct FlybyCache {
773+ /// Pre-rendered keyframes in the orbit sequence.
766774 pub frames : Vec < FlybyFrame > ,
767775 /// Current playback position in [0, frames.len()).
768776 pub cursor : usize ,
769- /// Width/height of pre-rendered frames.
777+ /// Width of pre-rendered frames.
770778 pub width : usize ,
779+ /// Height of pre-rendered frames.
771780 pub height : usize ,
772781}
773782
@@ -843,9 +852,11 @@ impl FlybyCache {
843852 self . frames . iter ( ) . map ( |f| f. packed . len ( ) * 8 ) . sum ( )
844853 }
845854
855+ /// Frame count.
846856 /// Frame count.
847857 pub fn len ( & self ) -> usize { self . frames . len ( ) }
848858
859+ /// True when no keyframes have been pre-rendered.
849860 pub fn is_empty ( & self ) -> bool { self . frames . is_empty ( ) }
850861}
851862
@@ -1114,6 +1125,7 @@ pub struct PyramidShader {
11141125}
11151126
11161127impl PyramidShader {
1128+ /// Allocate the four-level pyramid (~9 MB total: L1=4K + L2=64K + L3=1M + L4=4M + scratch).
11171129 pub fn new ( palette_max : u8 ) -> Self {
11181130 Self {
11191131 l1 : vec ! [ 0u8 ; 64 * 64 ] ,
0 commit comments