@@ -186,20 +186,35 @@ ui_draw_help_panel(app_state_t *app_state)
186186 DrawTextEx (app_state -> main_font , "Controls" , (Vector2 ){(f32 )(help_x + UI_PANEL_PADDING ), (f32 )line_y }, FONT_SIZE_MEDIUM , 2 , WHITE );
187187 line_y += line_spacing + 4 ;
188188
189- // Consolidated static help text (reduces DrawTextEx calls from 5 to 1)
190189 bool zoom_locked = !app_state -> is_paused &&
191190 (app_state -> data_to_draw == DRAW_DATA_A ||
192191 app_state -> data_to_draw == DRAW_DATA_B ||
193192 app_state -> data_to_draw == DRAW_DATA_ALL );
194- const char * help_lines = zoom_locked
195- ? "1-4 Dataset\nR Camera mode\nB Toggle bloom\nH Toggle help\nF11 Fullscreen"
196- : "1-4 Dataset\nR Camera mode\nB Toggle bloom\nH Toggle help\nF11 Fullscreen\nScroll Zoom" ;
197- DrawTextEx (app_state -> main_font , help_lines , (Vector2 ){(f32 )(help_x + UI_PANEL_PADDING ), (f32 )line_y }, FONT_SIZE_MEDIUM , 1 , TEXT_DIM );
193+
194+ const char * lines [8 ];
195+ i32 line_count = 0 ;
196+ lines [line_count ++ ] = "1-4 Dataset" ;
197+ lines [line_count ++ ] = "R Camera mode" ;
198+ lines [line_count ++ ] = "B Toggle bloom" ;
199+ lines [line_count ++ ] = "H Toggle help" ;
200+ lines [line_count ++ ] = "F11 Fullscreen" ;
201+ if (!zoom_locked )
202+ {
203+ lines [line_count ++ ] = "Scroll Zoom" ;
204+ }
205+
206+ for (i32 i = 0 ; i < line_count ; ++ i )
207+ {
208+ DrawTextEx (app_state -> main_font , lines [i ],
209+ (Vector2 ){(f32 )(help_x + UI_PANEL_PADDING ), (f32 )line_y }, FONT_SIZE_MEDIUM , 1 , TEXT_DIM );
210+ line_y += line_spacing ;
211+ }
198212
199213 if (app_state -> is_paused )
200214 {
201- line_y += line_spacing * 5 + 6 ;
202- DrawTextEx (app_state -> main_font , "WASD+Mouse Shift/Space" , (Vector2 ){(f32 )(help_x + UI_PANEL_PADDING ), (f32 )line_y }, FONT_SIZE_MEDIUM , 1 , ACCENT_PURPLE );
215+ line_y += 4 ;
216+ DrawTextEx (app_state -> main_font , "WASD+Mouse Shift/Space" ,
217+ (Vector2 ){(f32 )(help_x + UI_PANEL_PADDING ), (f32 )line_y }, FONT_SIZE_MEDIUM , 1 , ACCENT_PURPLE );
203218 }
204219 }
205220 else
0 commit comments